From 4f422785c6e7fee53559be6fc227367e567c5e49 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Wed, 26 May 2021 09:13:05 +0800 Subject: [PATCH] MDL-71113 javascript: Improve basic JS Documentation --- .../analytics/amd/build/log_info.min.js.map | 2 +- .../amd/build/potential-contexts.min.js.map | 2 +- admin/tool/analytics/amd/src/log_info.js | 1 - .../analytics/amd/src/potential-contexts.js | 1 - .../dataprivacy/amd/build/events.min.js.map | 2 +- .../amd/build/expand_contract.min.js.map | 2 +- .../amd/build/form-user-selector.min.js.map | 2 +- admin/tool/dataprivacy/amd/src/events.js | 1 - .../dataprivacy/amd/src/expand_contract.js | 1 - .../dataprivacy/amd/src/form-user-selector.js | 1 - .../amd/build/delete_license.min.js.map | 2 +- .../licensemanager/amd/src/delete_license.js | 1 - .../lp/amd/build/actionselector.min.js.map | 2 +- .../tool/lp/amd/build/competencies.min.js.map | 2 +- .../amd/build/competency_outcomes.min.js.map | 2 +- .../competency_plan_navigation.min.js.map | 2 +- .../lp/amd/build/competency_rule.min.js.map | 2 +- .../amd/build/competency_rule_all.min.js.map | 2 +- .../build/competency_rule_points.min.js.map | 2 +- .../lp/amd/build/competencypicker.min.js.map | 2 +- .../competencypicker_user_plans.min.js.map | 2 +- .../amd/build/competencyruleconfig.min.js.map | 2 +- .../lp/amd/build/evidence_delete.min.js.map | 2 +- .../amd/build/form-cohort-selector.min.js.map | 2 +- .../amd/build/form-user-selector.min.js.map | 2 +- .../build/frameworks_datasource.min.js.map | 2 +- .../lp/amd/build/grade_dialogue.min.js.map | 2 +- .../grade_user_competency_inline.min.js.map | 2 +- .../lp/amd/build/module_navigation.min.js.map | 2 +- .../tool/lp/amd/build/scalevalues.min.js.map | 2 +- ...er_competency_course_navigation.min.js.map | 2 +- .../amd/build/user_competency_info.min.js.map | 2 +- .../user_competency_plan_popup.min.js.map | 2 +- admin/tool/lp/amd/src/actionselector.js | 5 +- admin/tool/lp/amd/src/competencies.js | 1 + admin/tool/lp/amd/src/competency_outcomes.js | 4 +- .../lp/amd/src/competency_plan_navigation.js | 5 +- admin/tool/lp/amd/src/competency_rule.js | 4 +- admin/tool/lp/amd/src/competency_rule_all.js | 6 +- .../tool/lp/amd/src/competency_rule_points.js | 4 +- admin/tool/lp/amd/src/competencypicker.js | 3 +- .../lp/amd/src/competencypicker_user_plans.js | 5 +- admin/tool/lp/amd/src/competencyruleconfig.js | 1 + admin/tool/lp/amd/src/evidence_delete.js | 1 + admin/tool/lp/amd/src/form-cohort-selector.js | 1 - admin/tool/lp/amd/src/form-user-selector.js | 1 - .../tool/lp/amd/src/frameworks_datasource.js | 1 + admin/tool/lp/amd/src/grade_dialogue.js | 6 +- .../amd/src/grade_user_competency_inline.js | 5 +- admin/tool/lp/amd/src/module_navigation.js | 4 +- admin/tool/lp/amd/src/scalevalues.js | 3 +- .../src/user_competency_course_navigation.js | 5 +- admin/tool/lp/amd/src/user_competency_info.js | 1 + .../lp/amd/src/user_competency_plan_popup.js | 1 + .../policy/amd/build/acceptmodal.min.js.map | 2 +- admin/tool/policy/amd/src/acceptmodal.js | 1 - .../amd/build/filter_cssselector.min.js.map | 2 +- .../amd/build/managesteps.min.js.map | 2 +- .../amd/build/managetours.min.js.map | 2 +- .../tool/usertours/amd/build/tour.min.js.map | 2 +- .../usertours/amd/build/usertours.min.js.map | 2 +- .../usertours/amd/src/filter_cssselector.js | 1 - admin/tool/usertours/amd/src/managesteps.js | 1 - admin/tool/usertours/amd/src/managetours.js | 1 - admin/tool/usertours/amd/src/tour.js | 3 +- admin/tool/usertours/amd/src/usertours.js | 1 - .../util/ui/amd/build/async_backup.min.js.map | 2 +- backup/util/ui/amd/src/async_backup.js | 2 +- .../accessreview/amd/build/module.min.js.map | 2 +- blocks/accessreview/amd/src/module.js | 2 + blocks/amd/build/events.min.js.map | 2 +- blocks/amd/src/events.js | 11 ++- .../amd/build/repository.min.js.map | 2 +- blocks/myoverview/amd/src/repository.js | 1 + .../starredcourses/amd/build/main.min.js.map | 2 +- .../amd/build/repository.min.js.map | 2 +- blocks/starredcourses/amd/src/main.js | 1 + blocks/starredcourses/amd/src/repository.js | 3 +- calendar/amd/build/events.min.js.map | 2 +- calendar/amd/build/modal_delete.min.js.map | 2 +- .../month_navigation_drag_drop.min.js.map | 2 +- .../amd/build/month_view_drag_drop.min.js.map | 2 +- calendar/amd/build/repository.min.js.map | 2 +- calendar/amd/src/events.js | 1 - calendar/amd/src/modal_delete.js | 4 +- .../amd/src/month_navigation_drag_drop.js | 1 - calendar/amd/src/month_view_drag_drop.js | 1 - calendar/amd/src/repository.js | 1 - course/amd/build/copy_modal.min.js.map | 2 +- course/amd/src/copy_modal.js | 3 +- .../form-potential-user-selector.min.js.map | 2 +- .../amd/src/form-potential-user-selector.js | 1 - filter/amd/build/events.min.js.map | 2 +- filter/amd/src/events.js | 7 ++ .../amd/build/comment_chooser.min.js.map | 2 +- .../form/guide/amd/src/comment_chooser.js | 1 - lib/amd/build/ajax.min.js.map | 2 +- lib/amd/build/auto_rows.min.js.map | 2 +- lib/amd/build/autoscroll.min.js.map | 2 +- lib/amd/build/backoff_timer.min.js.map | 2 +- lib/amd/build/chart_axis.min.js.map | 2 +- lib/amd/build/chart_bar.min.js.map | 2 +- lib/amd/build/chart_base.min.js.map | 2 +- lib/amd/build/chart_line.min.js.map | 2 +- lib/amd/build/chart_output_base.min.js.map | 2 +- lib/amd/build/chart_output_chartjs.min.js.map | 2 +- .../build/chart_output_htmltable.min.js.map | 2 +- lib/amd/build/chart_pie.min.js.map | 2 +- lib/amd/build/chart_series.min.js.map | 2 +- lib/amd/build/config.min.js.map | 2 +- .../custom_interaction_events.min.js.map | 2 +- lib/amd/build/dragdrop.min.js.map | 2 +- lib/amd/build/emoji/auto_complete.min.js.map | 2 +- lib/amd/build/emoji/data.min.js.map | 2 +- lib/amd/build/emoji/picker.min.js.map | 2 +- lib/amd/build/event_dispatcher.min.js.map | 2 +- lib/amd/build/form-autocomplete.min.js.map | 2 +- lib/amd/build/form-cohort-selector.min.js.map | 2 +- lib/amd/build/form-course-selector.min.js.map | 2 +- lib/amd/build/fragment.min.js.map | 2 +- lib/amd/build/fullscreen.min.js.map | 2 +- lib/amd/build/icon_system.min.js.map | 2 +- .../build/icon_system_fontawesome.min.js.map | 2 +- lib/amd/build/icon_system_standard.min.js.map | 2 +- lib/amd/build/key_codes.min.js.map | 2 +- .../build/local/aria/aria-hidden.min.js.map | 2 +- lib/amd/build/local/aria/focuslock.min.js.map | 2 +- lib/amd/build/local/aria/selectors.min.js.map | 2 +- lib/amd/build/local/modal/alert.min.js.map | 2 +- lib/amd/build/modal.min.js.map | 2 +- lib/amd/build/modal_backdrop.min.js.map | 2 +- lib/amd/build/modal_cancel.min.js.map | 2 +- lib/amd/build/modal_save_cancel.min.js.map | 2 +- lib/amd/build/normalise.min.js.map | 2 +- lib/amd/build/permissionmanager.min.js.map | 2 +- .../popover_region_controller.min.js.map | 2 +- lib/amd/build/prefetch.min.js | 2 +- lib/amd/build/prefetch.min.js.map | 2 +- lib/amd/build/sortable_list.min.js.map | 2 +- lib/amd/build/str.min.js.map | 2 +- lib/amd/build/toast.min.js.map | 2 +- lib/amd/build/truncate.min.js.map | 2 +- lib/amd/build/url.min.js.map | 2 +- lib/amd/build/utils.min.js.map | 2 +- lib/amd/src/ajax.js | 63 ++++++++++++---- lib/amd/src/aria.js | 1 - lib/amd/src/auto_rows.js | 1 - lib/amd/src/autoscroll.js | 1 - lib/amd/src/backoff_timer.js | 7 +- lib/amd/src/chart_axis.js | 5 +- lib/amd/src/chart_bar.js | 1 - lib/amd/src/chart_base.js | 1 - lib/amd/src/chart_line.js | 1 - lib/amd/src/chart_output_base.js | 1 - lib/amd/src/chart_output_chartjs.js | 1 - lib/amd/src/chart_output_htmltable.js | 1 - lib/amd/src/chart_pie.js | 1 - lib/amd/src/chart_series.js | 1 - lib/amd/src/config.js | 4 +- lib/amd/src/custom_interaction_events.js | 3 +- lib/amd/src/dragdrop.js | 4 -- lib/amd/src/emoji/auto_complete.js | 6 +- lib/amd/src/emoji/data.js | 1 + lib/amd/src/emoji/picker.js | 45 +++++++++--- lib/amd/src/event_dispatcher.js | 33 ++++----- lib/amd/src/form-autocomplete.js | 5 +- lib/amd/src/form-cohort-selector.js | 3 +- lib/amd/src/form-course-selector.js | 3 +- lib/amd/src/fragment.js | 3 +- lib/amd/src/fullscreen.js | 2 +- lib/amd/src/icon_system.js | 3 + lib/amd/src/icon_system_fontawesome.js | 2 + lib/amd/src/icon_system_standard.js | 8 ++- lib/amd/src/key_codes.js | 8 ++- lib/amd/src/local/aria/aria-hidden.js | 10 ++- lib/amd/src/local/aria/focuslock.js | 13 +++- lib/amd/src/local/aria/selectors.js | 1 - lib/amd/src/local/modal/alert.js | 7 +- lib/amd/src/modal.js | 3 +- lib/amd/src/modal_backdrop.js | 2 +- lib/amd/src/modal_cancel.js | 5 +- lib/amd/src/modal_save_cancel.js | 7 +- lib/amd/src/normalise.js | 8 ++- lib/amd/src/permissionmanager.js | 6 +- lib/amd/src/popover_region_controller.js | 1 - lib/amd/src/prefetch.js | 66 ++++++++++++++--- lib/amd/src/sortable_list.js | 29 ++++---- lib/amd/src/str.js | 72 ++++++++++++++++--- lib/amd/src/toast.js | 19 ++++- lib/amd/src/truncate.js | 1 - lib/amd/src/url.js | 1 - lib/amd/src/utils.js | 41 ++++++----- lib/form/amd/build/defaultcustom.min.js.map | 2 +- lib/form/amd/build/dynamicform.min.js.map | 2 +- .../amd/build/encryptedpassword.min.js.map | 2 +- lib/form/amd/build/events.min.js.map | 2 +- lib/form/amd/build/passwordunmask.min.js.map | 2 +- lib/form/amd/build/showadvanced.min.js.map | 2 +- lib/form/amd/src/defaultcustom.js | 1 - lib/form/amd/src/dynamicform.js | 3 + lib/form/amd/src/encryptedpassword.js | 2 +- lib/form/amd/src/events.js | 22 ++++-- lib/form/amd/src/passwordunmask.js | 2 +- lib/form/amd/src/showadvanced.js | 3 +- .../build/local/dynamic/repository.min.js.map | 2 +- lib/table/amd/src/local/dynamic/repository.js | 53 +++++++------- ...message_notification_preference.min.js.map | 2 +- .../amd/build/message_preferences.min.js.map | 2 +- .../amd/build/message_repository.min.js.map | 2 +- .../build/notification_preference.min.js.map | 2 +- .../build/notification_processor.min.js.map | 2 +- ...notification_processor_settings.min.js.map | 2 +- ...s_notifications_list_controller.min.js.map | 2 +- .../preferences_processor_form.min.js.map | 2 +- .../build/toggle_contact_button.min.js.map | 2 +- .../src/message_notification_preference.js | 2 +- message/amd/src/message_preferences.js | 2 +- message/amd/src/message_repository.js | 1 - message/amd/src/notification_preference.js | 2 +- message/amd/src/notification_processor.js | 2 +- .../src/notification_processor_settings.js | 2 +- ...eferences_notifications_list_controller.js | 2 +- message/amd/src/preferences_processor_form.js | 2 +- message/amd/src/toggle_contact_button.js | 4 +- .../notification_area_content_area.min.js.map | 2 +- .../notification_area_control_area.min.js.map | 2 +- .../amd/build/notification_area_events.min.js | 2 +- .../build/notification_area_events.min.js.map | 2 +- .../build/notification_repository.min.js.map | 2 +- .../amd/src/notification_area_content_area.js | 2 +- .../amd/src/notification_area_control_area.js | 2 +- .../popup/amd/src/notification_area_events.js | 11 ++- .../popup/amd/src/notification_repository.js | 1 - .../amd/build/grading_actions.min.js.map | 2 +- .../grading_form_change_checker.min.js.map | 2 +- .../amd/build/grading_navigation.min.js.map | 2 +- .../grading_navigation_user_info.min.js.map | 2 +- mod/assign/amd/build/grading_panel.min.js.map | 2 +- .../amd/build/grading_review_panel.min.js.map | 2 +- mod/assign/amd/src/grading_actions.js | 3 +- .../amd/src/grading_form_change_checker.js | 2 +- mod/assign/amd/src/grading_navigation.js | 2 +- .../amd/src/grading_navigation_user_info.js | 3 +- mod/assign/amd/src/grading_panel.js | 2 +- mod/assign/amd/src/grading_review_panel.js | 3 +- .../amd/build/discussion_nested_v2.min.js.map | 2 +- .../amd/build/form-user-selector.min.js.map | 2 +- .../local/grader/gradingpanel.min.js.map | 2 +- .../local/grader/user_picker.min.js.map | 2 +- .../amd/build/local/layout/fullscreen.min.js | 2 +- .../build/local/layout/fullscreen.min.js.map | 2 +- mod/forum/amd/src/discussion_nested_v2.js | 3 +- mod/forum/amd/src/form-user-selector.js | 1 - .../local/grades/local/grader/gradingpanel.js | 3 +- .../local/grades/local/grader/user_picker.js | 6 ++ mod/forum/amd/src/local/layout/fullscreen.js | 36 ++++++++-- .../cartridge_registration_form.min.js.map | 2 +- mod/lti/amd/build/contentitem.min.js.map | 2 +- .../amd/build/contentitem_return.min.js.map | 2 +- .../build/external_registration.min.js.map | 2 +- .../external_registration_return.min.js.map | 2 +- mod/lti/amd/build/form-field.min.js.map | 2 +- .../amd/build/tool_card_controller.min.js.map | 2 +- .../tool_configure_controller.min.js.map | 2 +- mod/lti/amd/build/tool_proxy.min.js.map | 2 +- .../tool_proxy_card_controller.min.js.map | 2 +- mod/lti/amd/build/tool_type.min.js.map | 2 +- .../amd/src/cartridge_registration_form.js | 1 - mod/lti/amd/src/contentitem.js | 1 - mod/lti/amd/src/contentitem_return.js | 1 - mod/lti/amd/src/external_registration.js | 3 +- .../amd/src/external_registration_return.js | 4 +- mod/lti/amd/src/form-field.js | 1 - mod/lti/amd/src/tool_card_controller.js | 1 - mod/lti/amd/src/tool_configure_controller.js | 1 - mod/lti/amd/src/tool_proxy.js | 3 +- mod/lti/amd/src/tool_proxy_card_controller.js | 1 - mod/lti/amd/src/tool_type.js | 3 +- .../seb/amd/build/managetemplates.min.js.map | 2 +- .../accessrule/seb/amd/src/managetemplates.js | 1 - mod/quiz/amd/build/preflightcheck.min.js.map | 2 +- mod/quiz/amd/src/preflightcheck.js | 1 - question/amd/build/repository.min.js.map | 2 +- question/amd/src/repository.js | 1 - .../ddimageortext/amd/build/form.min.js.map | 2 +- .../amd/build/question.min.js.map | 2 +- question/type/ddimageortext/amd/src/form.js | 17 +++-- .../type/ddimageortext/amd/src/question.js | 8 +-- .../type/ddmarker/amd/build/form.min.js.map | 2 +- .../ddmarker/amd/build/question.min.js.map | 2 +- .../type/ddmarker/amd/build/shapes.min.js.map | 2 +- question/type/ddmarker/amd/src/form.js | 2 +- question/type/ddmarker/amd/src/question.js | 2 +- question/type/ddmarker/amd/src/shapes.js | 2 +- .../amd/build/grading_popup.min.js.map | 2 +- .../build/user_course_navigation.min.js.map | 2 +- report/competency/amd/src/grading_popup.js | 5 +- .../amd/src/user_course_navigation.js | 5 +- .../form-search-user-selector.min.js.map | 2 +- search/amd/src/form-search-user-selector.js | 1 - theme/boost/amd/build/drawer.min.js.map | 2 +- theme/boost/amd/build/loader.min.js.map | 2 +- theme/boost/amd/build/scroll.min.js.map | 2 +- theme/boost/amd/src/drawer.js | 1 + theme/boost/amd/src/loader.js | 3 +- theme/boost/amd/src/scroll.js | 3 +- 306 files changed, 722 insertions(+), 475 deletions(-) diff --git a/admin/tool/analytics/amd/build/log_info.min.js.map b/admin/tool/analytics/amd/build/log_info.min.js.map index 6e21bd92aae94..c3243b8a2f894 100644 --- a/admin/tool/analytics/amd/build/log_info.min.js.map +++ b/admin/tool/analytics/amd/build/log_info.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/log_info.js"],"names":["define","$","str","ModalFactory","Notification","loadInfo","id","info","link","get_string","then","langString","bodyInfo","forEach","item","append","create","title","body","html","large","catch","exception"],"mappings":"AAuBAA,OAAM,2BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,oBAAvB,CAA6C,mBAA7C,CAAD,CAAoE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA+BC,CAA/B,CAA6C,CAEnH,MAAoD,CAShDC,QAAQ,CAAE,kBAASC,CAAT,CAAaC,CAAb,CAAmB,CAEzB,GAAIC,CAAAA,CAAI,CAAGP,CAAC,CAAC,wBAAyBK,CAAzB,CAA8B,KAA/B,CAAZ,CACAJ,CAAG,CAACO,UAAJ,CAAe,SAAf,CAA0B,gBAA1B,EAA4CC,IAA5C,CAAiD,SAASC,CAAT,CAAqB,CAElE,GAAIC,CAAAA,CAAQ,CAAGX,CAAC,CAAC,MAAD,CAAhB,CACAM,CAAI,CAACM,OAAL,CAAa,SAASC,CAAT,CAAe,CACxBF,CAAQ,CAACG,MAAT,CAAgB,OAASD,CAAT,CAAgB,OAAhC,CACH,CAFD,EAGAF,CAAQ,CAACG,MAAT,CAAgB,OAAhB,EAEA,MAAOZ,CAAAA,CAAY,CAACa,MAAb,CAAoB,CACvBC,KAAK,CAAEN,CADgB,CAEvBO,IAAI,CAAEN,CAAQ,CAACO,IAAT,EAFiB,CAGvBC,KAAK,GAHkB,CAApB,CAIJZ,CAJI,CAMV,CAdD,EAcGa,KAdH,CAcSjB,CAAY,CAACkB,SAdtB,CAeH,CA3B+C,CA6BvD,CA/BK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Shows a dialogue with info about this logs.\n *\n * @module tool_analytics/log_info\n * @class log_info\n * @copyright 2017 David Monllao {@link http://www.davidmonllao.com}\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/notification'], function($, str, ModalFactory, Notification) {\n\n return /** @alias module:tool_analytics/log_info */ {\n\n /**\n * Prepares a modal info for a log's results.\n *\n * @method loadInfo\n * @param {int} id\n * @param {string[]} info\n */\n loadInfo: function(id, info) {\n\n var link = $('[data-model-log-id=\"' + id + '\"]');\n str.get_string('loginfo', 'tool_analytics').then(function(langString) {\n\n var bodyInfo = $(\"\");\n\n return ModalFactory.create({\n title: langString,\n body: bodyInfo.html(),\n large: true,\n }, link);\n\n }).catch(Notification.exception);\n }\n };\n});\n"],"file":"log_info.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/log_info.js"],"names":["define","$","str","ModalFactory","Notification","loadInfo","id","info","link","get_string","then","langString","bodyInfo","forEach","item","append","create","title","body","html","large","catch","exception"],"mappings":"AAsBAA,OAAM,2BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,oBAAvB,CAA6C,mBAA7C,CAAD,CAAoE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA+BC,CAA/B,CAA6C,CAEnH,MAAoD,CAShDC,QAAQ,CAAE,kBAASC,CAAT,CAAaC,CAAb,CAAmB,CAEzB,GAAIC,CAAAA,CAAI,CAAGP,CAAC,CAAC,wBAAyBK,CAAzB,CAA8B,KAA/B,CAAZ,CACAJ,CAAG,CAACO,UAAJ,CAAe,SAAf,CAA0B,gBAA1B,EAA4CC,IAA5C,CAAiD,SAASC,CAAT,CAAqB,CAElE,GAAIC,CAAAA,CAAQ,CAAGX,CAAC,CAAC,MAAD,CAAhB,CACAM,CAAI,CAACM,OAAL,CAAa,SAASC,CAAT,CAAe,CACxBF,CAAQ,CAACG,MAAT,CAAgB,OAASD,CAAT,CAAgB,OAAhC,CACH,CAFD,EAGAF,CAAQ,CAACG,MAAT,CAAgB,OAAhB,EAEA,MAAOZ,CAAAA,CAAY,CAACa,MAAb,CAAoB,CACvBC,KAAK,CAAEN,CADgB,CAEvBO,IAAI,CAAEN,CAAQ,CAACO,IAAT,EAFiB,CAGvBC,KAAK,GAHkB,CAApB,CAIJZ,CAJI,CAMV,CAdD,EAcGa,KAdH,CAcSjB,CAAY,CAACkB,SAdtB,CAeH,CA3B+C,CA6BvD,CA/BK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Shows a dialogue with info about this logs.\n *\n * @module tool_analytics/log_info\n * @copyright 2017 David Monllao {@link http://www.davidmonllao.com}\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/notification'], function($, str, ModalFactory, Notification) {\n\n return /** @alias module:tool_analytics/log_info */ {\n\n /**\n * Prepares a modal info for a log's results.\n *\n * @method loadInfo\n * @param {int} id\n * @param {string[]} info\n */\n loadInfo: function(id, info) {\n\n var link = $('[data-model-log-id=\"' + id + '\"]');\n str.get_string('loginfo', 'tool_analytics').then(function(langString) {\n\n var bodyInfo = $(\"
    \");\n info.forEach(function(item) {\n bodyInfo.append('
  • ' + item + '
  • ');\n });\n bodyInfo.append(\"
\");\n\n return ModalFactory.create({\n title: langString,\n body: bodyInfo.html(),\n large: true,\n }, link);\n\n }).catch(Notification.exception);\n }\n };\n});\n"],"file":"log_info.min.js"} \ No newline at end of file diff --git a/admin/tool/analytics/amd/build/potential-contexts.min.js.map b/admin/tool/analytics/amd/build/potential-contexts.min.js.map index 6de7893e1cbd7..c4ca6a9fec5bf 100644 --- a/admin/tool/analytics/amd/build/potential-contexts.min.js.map +++ b/admin/tool/analytics/amd/build/potential-contexts.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/potential-contexts.js"],"names":["define","$","Ajax","processResults","selector","results","contexts","isArray","each","index","context","push","value","id","label","name","transport","query","success","failure","promise","modelid","attr","call","methodname","args","then","fail"],"mappings":"AAwBAA,OAAM,qCAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAE9C,MAA8D,CAE1DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAQ,CAAG,EAAf,CACA,GAAIL,CAAC,CAACM,OAAF,CAAUF,CAAV,CAAJ,CAAwB,CACpBJ,CAAC,CAACO,IAAF,CAAOH,CAAP,CAAgB,SAASI,CAAT,CAAgBC,CAAhB,CAAyB,CACrCJ,CAAQ,CAACK,IAAT,CAAc,CACVC,KAAK,CAAEF,CAAO,CAACG,EADL,CAEVC,KAAK,CAAEJ,CAAO,CAACK,IAFL,CAAd,CAIH,CALD,EAMA,MAAOT,CAAAA,CAEV,CATD,IASO,CACH,MAAOD,CAAAA,CACV,CACJ,CAhByD,CAkB1DW,SAAS,CAAE,mBAASZ,CAAT,CAAmBa,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,IAC/CC,CAAAA,CAD+C,CAG/CC,CAAO,CAAGpB,CAAC,CAACG,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,SAAjB,GAA+B,IAHM,CAInDF,CAAO,CAAGlB,CAAI,CAACqB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,mCADK,CAEjBC,IAAI,CAAE,CACFR,KAAK,CAAEA,CADL,CAEFI,OAAO,CAAEA,CAFP,CAFW,CAAD,CAAV,CAAV,CAQAD,CAAO,CAAC,CAAD,CAAP,CAAWM,IAAX,CAAgBR,CAAhB,EAAyBS,IAAzB,CAA8BR,CAA9B,CACH,CA/ByD,CAmCjE,CArCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Potential contexts selector module.\n *\n * @module tool_analytics/potential-contexts\n * @class potential-contexts\n * @copyright 2019 David Monllao\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n return /** @alias module:tool_analytics/potential-contexts */ {\n\n processResults: function(selector, results) {\n var contexts = [];\n if ($.isArray(results)) {\n $.each(results, function(index, context) {\n contexts.push({\n value: context.id,\n label: context.name\n });\n });\n return contexts;\n\n } else {\n return results;\n }\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n let modelid = $(selector).attr('modelid') || null;\n promise = Ajax.call([{\n methodname: 'tool_analytics_potential_contexts',\n args: {\n query: query,\n modelid: modelid\n }\n }]);\n\n promise[0].then(success).fail(failure);\n }\n\n };\n\n});\n"],"file":"potential-contexts.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/potential-contexts.js"],"names":["define","$","Ajax","processResults","selector","results","contexts","isArray","each","index","context","push","value","id","label","name","transport","query","success","failure","promise","modelid","attr","call","methodname","args","then","fail"],"mappings":"AAuBAA,OAAM,qCAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAE9C,MAA8D,CAE1DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAQ,CAAG,EAAf,CACA,GAAIL,CAAC,CAACM,OAAF,CAAUF,CAAV,CAAJ,CAAwB,CACpBJ,CAAC,CAACO,IAAF,CAAOH,CAAP,CAAgB,SAASI,CAAT,CAAgBC,CAAhB,CAAyB,CACrCJ,CAAQ,CAACK,IAAT,CAAc,CACVC,KAAK,CAAEF,CAAO,CAACG,EADL,CAEVC,KAAK,CAAEJ,CAAO,CAACK,IAFL,CAAd,CAIH,CALD,EAMA,MAAOT,CAAAA,CAEV,CATD,IASO,CACH,MAAOD,CAAAA,CACV,CACJ,CAhByD,CAkB1DW,SAAS,CAAE,mBAASZ,CAAT,CAAmBa,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,IAC/CC,CAAAA,CAD+C,CAG/CC,CAAO,CAAGpB,CAAC,CAACG,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,SAAjB,GAA+B,IAHM,CAInDF,CAAO,CAAGlB,CAAI,CAACqB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,mCADK,CAEjBC,IAAI,CAAE,CACFR,KAAK,CAAEA,CADL,CAEFI,OAAO,CAAEA,CAFP,CAFW,CAAD,CAAV,CAAV,CAQAD,CAAO,CAAC,CAAD,CAAP,CAAWM,IAAX,CAAgBR,CAAhB,EAAyBS,IAAzB,CAA8BR,CAA9B,CACH,CA/ByD,CAmCjE,CArCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Potential contexts selector module.\n *\n * @module tool_analytics/potential-contexts\n * @copyright 2019 David Monllao\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n return /** @alias module:tool_analytics/potential-contexts */ {\n\n processResults: function(selector, results) {\n var contexts = [];\n if ($.isArray(results)) {\n $.each(results, function(index, context) {\n contexts.push({\n value: context.id,\n label: context.name\n });\n });\n return contexts;\n\n } else {\n return results;\n }\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n let modelid = $(selector).attr('modelid') || null;\n promise = Ajax.call([{\n methodname: 'tool_analytics_potential_contexts',\n args: {\n query: query,\n modelid: modelid\n }\n }]);\n\n promise[0].then(success).fail(failure);\n }\n\n };\n\n});\n"],"file":"potential-contexts.min.js"} \ No newline at end of file diff --git a/admin/tool/analytics/amd/src/log_info.js b/admin/tool/analytics/amd/src/log_info.js index 74f2afe1e05ba..90a683a4be6c7 100644 --- a/admin/tool/analytics/amd/src/log_info.js +++ b/admin/tool/analytics/amd/src/log_info.js @@ -17,7 +17,6 @@ * Shows a dialogue with info about this logs. * * @module tool_analytics/log_info - * @class log_info * @copyright 2017 David Monllao {@link http://www.davidmonllao.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/analytics/amd/src/potential-contexts.js b/admin/tool/analytics/amd/src/potential-contexts.js index 6737c9e63dd53..75acd126afe47 100644 --- a/admin/tool/analytics/amd/src/potential-contexts.js +++ b/admin/tool/analytics/amd/src/potential-contexts.js @@ -17,7 +17,6 @@ * Potential contexts selector module. * * @module tool_analytics/potential-contexts - * @class potential-contexts * @copyright 2019 David Monllao * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/dataprivacy/amd/build/events.min.js.map b/admin/tool/dataprivacy/amd/build/events.min.js.map index 342a1740821e5..60293f3a3d728 100644 --- a/admin/tool/dataprivacy/amd/build/events.min.js.map +++ b/admin/tool/dataprivacy/amd/build/events.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/events.js"],"names":["define","approve","bulkApprove","deny","bulkDeny","complete"],"mappings":"AAuBAA,OAAM,2BAAC,EAAD,CAAK,UAAW,CAClB,MAAO,CACHC,OAAO,CAAE,uCADN,CAEHC,WAAW,CAAE,4CAFV,CAGHC,IAAI,CAAE,oCAHH,CAIHC,QAAQ,CAAE,yCAJP,CAKHC,QAAQ,CAAE,wCALP,CAOV,CARK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the events the data privacy tool can fire.\n *\n * @module tool_dataprivacy/events\n * @class events\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([], function() {\n return {\n approve: 'tool_dataprivacy-data_request:approve',\n bulkApprove: 'tool_dataprivacy-data_request:bulk_approve',\n deny: 'tool_dataprivacy-data_request:deny',\n bulkDeny: 'tool_dataprivacy-data_request:bulk_deny',\n complete: 'tool_dataprivacy-data_request:complete'\n };\n});\n"],"file":"events.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/events.js"],"names":["define","approve","bulkApprove","deny","bulkDeny","complete"],"mappings":"AAsBAA,OAAM,2BAAC,EAAD,CAAK,UAAW,CAClB,MAAO,CACHC,OAAO,CAAE,uCADN,CAEHC,WAAW,CAAE,4CAFV,CAGHC,IAAI,CAAE,oCAHH,CAIHC,QAAQ,CAAE,yCAJP,CAKHC,QAAQ,CAAE,wCALP,CAOV,CARK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the events the data privacy tool can fire.\n *\n * @module tool_dataprivacy/events\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([], function() {\n return {\n approve: 'tool_dataprivacy-data_request:approve',\n bulkApprove: 'tool_dataprivacy-data_request:bulk_approve',\n deny: 'tool_dataprivacy-data_request:deny',\n bulkDeny: 'tool_dataprivacy-data_request:bulk_deny',\n complete: 'tool_dataprivacy-data_request:complete'\n };\n});\n"],"file":"events.min.js"} \ No newline at end of file diff --git a/admin/tool/dataprivacy/amd/build/expand_contract.min.js.map b/admin/tool/dataprivacy/amd/build/expand_contract.min.js.map index 55f0eeb7b0a41..cd1ba61d3fd9e 100644 --- a/admin/tool/dataprivacy/amd/build/expand_contract.min.js.map +++ b/admin/tool/dataprivacy/amd/build/expand_contract.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/expand_contract.js"],"names":["define","$","url","str","expandedImage","imageUrl","collapsedImage","CLASSES","EXPAND","COLLAPSE","expandCollapse","targetnode","thisnode","hasClass","removeClass","addClass","attr","find","expandCollapseAll","nextstate","currentstate","ariaexpandedstate","iconclassnow","iconclassnext","imagenow","each","data","get_string","then","langString","html","catch","Notification","exception"],"mappings":"AAwBAA,OAAM,oCAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,UAAvB,CAAD,CAAqC,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAAsB,IAEzDC,CAAAA,CAAa,CAAGH,CAAC,CAAC,uBAAsBC,CAAG,CAACG,QAAJ,CAAa,YAAb,CAAtB,CAAmD,MAApD,CAFwC,CAGzDC,CAAc,CAAGL,CAAC,CAAC,uBAAsBC,CAAG,CAACG,QAAJ,CAAa,aAAb,CAAtB,CAAoD,MAArD,CAHuC,CAQzDE,CAAO,CAAG,CACVC,MAAM,CAAE,gBADE,CAEVC,QAAQ,CAAE,eAFA,CAR+C,CAa7D,MAA6D,CAOzDC,cAAc,CAAE,wBAASC,CAAT,CAAqBC,CAArB,CAA+B,CAC3C,GAAID,CAAU,CAACE,QAAX,CAAoB,MAApB,CAAJ,CAAiC,CAC7BF,CAAU,CAACG,WAAX,CAAuB,MAAvB,EACAH,CAAU,CAACI,QAAX,CAAoB,SAApB,EACAJ,CAAU,CAACK,IAAX,CAAgB,eAAhB,KACAJ,CAAQ,CAACK,IAAT,CAA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,IAAtB,CAA2B,UAAW,CAClCxB,CAAC,CAAC,IAAD,CAAD,CAAQa,WAAR,CAAoBM,CAApB,EACAnB,CAAC,CAAC,IAAD,CAAD,CAAQc,QAAR,CAAiBI,CAAjB,EACAlB,CAAC,CAAC,IAAD,CAAD,CAAQe,IAAR,CAAa,eAAb,CAA8BK,CAA9B,CACH,CAJD,EAKApB,CAAC,CAAC,8BAAD,CAAD,CAAkCyB,IAAlC,CAAuC,iBAAvC,CAA0DN,CAA1D,EAEAjB,CAAG,CAACwB,UAAJ,CAAeP,CAAf,CAA6B,kBAA7B,EAAiDQ,IAAjD,CAAsD,SAASC,CAAT,CAAqB,CACvE5B,CAAC,CAAC,8BAAD,CAAD,CAAkC6B,IAAlC,CAAuCD,CAAvC,CAEH,CAHD,EAGGE,KAHH,CAGSC,YAAY,CAACC,SAHtB,EAKAhC,CAAC,CAAC,cAAD,CAAD,CAAkBwB,IAAlB,CAAuB,UAAW,CAC9BxB,CAAC,CAAC,IAAD,CAAD,CAAQa,WAAR,CAAoBQ,CAApB,EACArB,CAAC,CAAC,IAAD,CAAD,CAAQc,QAAR,CAAiBQ,CAAjB,CACH,CAHD,EAIAtB,CAAC,CAAC,kBAAD,CAAD,CAAsBwB,IAAtB,CAA2B,UAAW,CAClCxB,CAAC,CAAC,IAAD,CAAD,CAAQe,IAAR,CAAa,KAAb,CAAoBQ,CAApB,CACH,CAFD,CAGH,CAvDwD,CAyDhE,CAtEK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Potential user selector module.\n *\n * @module tool_dataprivacy/expand_contract\n * @class page-expand-contract\n * @copyright 2018 Adrian Greeve\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/url', 'core/str'], function($, url, str) {\n\n var expandedImage = $('\"\"');\n var collapsedImage = $('\"\"');\n\n /*\n * Class names to apply when expanding/collapsing nodes.\n */\n var CLASSES = {\n EXPAND: 'fa-caret-right',\n COLLAPSE: 'fa-caret-down'\n };\n\n return /** @alias module:tool_dataprivacy/expand-collapse */ {\n /**\n * Expand or collapse a selected node.\n *\n * @param {object} targetnode The node that we want to expand / collapse\n * @param {object} thisnode The node that was clicked.\n */\n expandCollapse: function(targetnode, thisnode) {\n if (targetnode.hasClass('hide')) {\n targetnode.removeClass('hide');\n targetnode.addClass('visible');\n targetnode.attr('aria-expanded', true);\n thisnode.find(':header i.fa').removeClass(CLASSES.EXPAND);\n thisnode.find(':header i.fa').addClass(CLASSES.COLLAPSE);\n thisnode.find(':header img.icon').attr('src', expandedImage.attr('src'));\n } else {\n targetnode.removeClass('visible');\n targetnode.addClass('hide');\n targetnode.attr('aria-expanded', false);\n thisnode.find(':header i.fa').removeClass(CLASSES.COLLAPSE);\n thisnode.find(':header i.fa').addClass(CLASSES.EXPAND);\n thisnode.find(':header img.icon').attr('src', collapsedImage.attr('src'));\n }\n },\n\n /**\n * Expand or collapse all nodes on this page.\n *\n * @param {string} nextstate The next state to change to.\n */\n expandCollapseAll: function(nextstate) {\n var currentstate = (nextstate == 'visible') ? 'hide' : 'visible';\n var ariaexpandedstate = (nextstate == 'visible') ? true : false;\n var iconclassnow = (nextstate == 'visible') ? CLASSES.EXPAND : CLASSES.COLLAPSE;\n var iconclassnext = (nextstate == 'visible') ? CLASSES.COLLAPSE : CLASSES.EXPAND;\n var imagenow = (nextstate == 'visible') ? expandedImage.attr('src') : collapsedImage.attr('src');\n $('.' + currentstate).each(function() {\n $(this).removeClass(currentstate);\n $(this).addClass(nextstate);\n $(this).attr('aria-expanded', ariaexpandedstate);\n });\n $('.tool_dataprivacy-expand-all').data('visibilityState', currentstate);\n\n str.get_string(currentstate, 'tool_dataprivacy').then(function(langString) {\n $('.tool_dataprivacy-expand-all').html(langString);\n return;\n }).catch(Notification.exception);\n\n $(':header i.fa').each(function() {\n $(this).removeClass(iconclassnow);\n $(this).addClass(iconclassnext);\n });\n $(':header img.icon').each(function() {\n $(this).attr('src', imagenow);\n });\n }\n };\n});\n"],"file":"expand_contract.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/expand_contract.js"],"names":["define","$","url","str","expandedImage","imageUrl","collapsedImage","CLASSES","EXPAND","COLLAPSE","expandCollapse","targetnode","thisnode","hasClass","removeClass","addClass","attr","find","expandCollapseAll","nextstate","currentstate","ariaexpandedstate","iconclassnow","iconclassnext","imagenow","each","data","get_string","then","langString","html","catch","Notification","exception"],"mappings":"AAuBAA,OAAM,oCAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,UAAvB,CAAD,CAAqC,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAAsB,IAEzDC,CAAAA,CAAa,CAAGH,CAAC,CAAC,uBAAsBC,CAAG,CAACG,QAAJ,CAAa,YAAb,CAAtB,CAAmD,MAApD,CAFwC,CAGzDC,CAAc,CAAGL,CAAC,CAAC,uBAAsBC,CAAG,CAACG,QAAJ,CAAa,aAAb,CAAtB,CAAoD,MAArD,CAHuC,CAQzDE,CAAO,CAAG,CACVC,MAAM,CAAE,gBADE,CAEVC,QAAQ,CAAE,eAFA,CAR+C,CAa7D,MAA6D,CAOzDC,cAAc,CAAE,wBAASC,CAAT,CAAqBC,CAArB,CAA+B,CAC3C,GAAID,CAAU,CAACE,QAAX,CAAoB,MAApB,CAAJ,CAAiC,CAC7BF,CAAU,CAACG,WAAX,CAAuB,MAAvB,EACAH,CAAU,CAACI,QAAX,CAAoB,SAApB,EACAJ,CAAU,CAACK,IAAX,CAAgB,eAAhB,KACAJ,CAAQ,CAACK,IAAT,CAAc,cAA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B,CAA2B,UAAW,CAClCxB,CAAC,CAAC,IAAD,CAAD,CAAQa,WAAR,CAAoBM,CAApB,EACAnB,CAAC,CAAC,IAAD,CAAD,CAAQc,QAAR,CAAiBI,CAAjB,EACAlB,CAAC,CAAC,IAAD,CAAD,CAAQe,IAAR,CAAa,eAAb,CAA8BK,CAA9B,CACH,CAJD,EAKApB,CAAC,CAAC,8BAAD,CAAD,CAAkCyB,IAAlC,CAAuC,iBAAvC,CAA0DN,CAA1D,EAEAjB,CAAG,CAACwB,UAAJ,CAAeP,CAAf,CAA6B,kBAA7B,EAAiDQ,IAAjD,CAAsD,SAASC,CAAT,CAAqB,CACvE5B,CAAC,CAAC,8BAAD,CAAD,CAAkC6B,IAAlC,CAAuCD,CAAvC,CAEH,CAHD,EAGGE,KAHH,CAGSC,YAAY,CAACC,SAHtB,EAKAhC,CAAC,CAAC,cAAD,CAAD,CAAkBwB,IAAlB,CAAuB,UAAW,CAC9BxB,CAAC,CAAC,IAAD,CAAD,CAAQa,WAAR,CAAoBQ,CAApB,EACArB,CAAC,CAAC,IAAD,CAAD,CAAQc,QAAR,CAAiBQ,CAAjB,CACH,CAHD,EAIAtB,CAAC,CAAC,kBAAD,CAAD,CAAsBwB,IAAtB,CAA2B,UAAW,CAClCxB,CAAC,CAAC,IAAD,CAAD,CAAQe,IAAR,CAAa,KAAb,CAAoBQ,CAApB,CACH,CAFD,CAGH,CAvDwD,CAyDhE,CAtEK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Potential user selector module.\n *\n * @module tool_dataprivacy/expand_contract\n * @copyright 2018 Adrian Greeve\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/url', 'core/str'], function($, url, str) {\n\n var expandedImage = $('\"\"');\n var collapsedImage = $('\"\"');\n\n /*\n * Class names to apply when expanding/collapsing nodes.\n */\n var CLASSES = {\n EXPAND: 'fa-caret-right',\n COLLAPSE: 'fa-caret-down'\n };\n\n return /** @alias module:tool_dataprivacy/expand-collapse */ {\n /**\n * Expand or collapse a selected node.\n *\n * @param {object} targetnode The node that we want to expand / collapse\n * @param {object} thisnode The node that was clicked.\n */\n expandCollapse: function(targetnode, thisnode) {\n if (targetnode.hasClass('hide')) {\n targetnode.removeClass('hide');\n targetnode.addClass('visible');\n targetnode.attr('aria-expanded', true);\n thisnode.find(':header i.fa').removeClass(CLASSES.EXPAND);\n thisnode.find(':header i.fa').addClass(CLASSES.COLLAPSE);\n thisnode.find(':header img.icon').attr('src', expandedImage.attr('src'));\n } else {\n targetnode.removeClass('visible');\n targetnode.addClass('hide');\n targetnode.attr('aria-expanded', false);\n thisnode.find(':header i.fa').removeClass(CLASSES.COLLAPSE);\n thisnode.find(':header i.fa').addClass(CLASSES.EXPAND);\n thisnode.find(':header img.icon').attr('src', collapsedImage.attr('src'));\n }\n },\n\n /**\n * Expand or collapse all nodes on this page.\n *\n * @param {string} nextstate The next state to change to.\n */\n expandCollapseAll: function(nextstate) {\n var currentstate = (nextstate == 'visible') ? 'hide' : 'visible';\n var ariaexpandedstate = (nextstate == 'visible') ? true : false;\n var iconclassnow = (nextstate == 'visible') ? CLASSES.EXPAND : CLASSES.COLLAPSE;\n var iconclassnext = (nextstate == 'visible') ? CLASSES.COLLAPSE : CLASSES.EXPAND;\n var imagenow = (nextstate == 'visible') ? expandedImage.attr('src') : collapsedImage.attr('src');\n $('.' + currentstate).each(function() {\n $(this).removeClass(currentstate);\n $(this).addClass(nextstate);\n $(this).attr('aria-expanded', ariaexpandedstate);\n });\n $('.tool_dataprivacy-expand-all').data('visibilityState', currentstate);\n\n str.get_string(currentstate, 'tool_dataprivacy').then(function(langString) {\n $('.tool_dataprivacy-expand-all').html(langString);\n return;\n }).catch(Notification.exception);\n\n $(':header i.fa').each(function() {\n $(this).removeClass(iconclassnow);\n $(this).addClass(iconclassnext);\n });\n $(':header img.icon').each(function() {\n $(this).attr('src', imagenow);\n });\n }\n };\n});\n"],"file":"expand_contract.min.js"} \ No newline at end of file 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 index 84da21e00f3c6..1b0b75a503741 100644 --- a/admin/tool/dataprivacy/amd/build/form-user-selector.min.js.map +++ b/admin/tool/dataprivacy/amd/build/form-user-selector.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/form-user-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","promise","call","methodname","args","then","promises","i","render","when","apply","arguments","fail"],"mappings":"AAwBAA,OAAM,uCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAE3E,MAAgE,CAE5DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAK,CAAG,EAAZ,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCH,CAAK,CAACI,IAAN,CAAW,CACPC,KAAK,CAAEF,CAAI,CAACG,EADL,CAEPC,KAAK,CAAEJ,CAAI,CAACK,MAFL,CAAX,CAIH,CALD,EAMA,MAAOR,CAAAA,CACV,CAX2D,CAa5DS,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,CACnD,GAAIC,CAAAA,CAAO,CAEDlB,CAAI,CAACmB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,4BADK,CAEjBC,IAAI,CAAE,CACFN,KAAK,CAAEA,CADL,CAFW,CAAD,CAAV,CAFV,CASAG,CAAO,CAAC,CAAD,CAAP,CAAWI,IAAX,CAAgB,SAASlB,CAAT,CAAkB,CAC9B,GAAImB,CAAAA,CAAQ,CAAG,EAAf,CACIC,CAAC,CAAG,CADR,CAIAzB,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCe,CAAQ,CAACd,IAAT,CAAcR,CAAS,CAACwB,MAAV,CAAiB,gDAAjB,CAAmEjB,CAAnE,CAAd,CACH,CAFD,EAKA,MAAOT,CAAAA,CAAC,CAAC2B,IAAF,CAAOC,KAAP,CAAa5B,CAAC,CAAC2B,IAAf,CAAqBH,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAID,CAAAA,CAAI,CAAGO,SAAX,CACA7B,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCA,CAAI,CAACK,MAAL,CAAcQ,CAAI,CAACG,CAAD,CAAlB,CACAA,CAAC,EACJ,CAHD,EAIAR,CAAO,CAACZ,CAAD,CAEV,CARM,CAUV,CApBD,EAoBGyB,IApBH,CAoBQZ,CApBR,CAqBH,CA5C2D,CAgDnE,CAlDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Potential user selector module.\n *\n * @module tool_dataprivacy/form-user-selector\n * @class form-user-selector\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:tool_dataprivacy/form-user-selector */ {\n\n processResults: function(selector, results) {\n var users = [];\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n promise = Ajax.call([{\n methodname: 'tool_dataprivacy_get_users',\n args: {\n query: query\n }\n }]);\n\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results, function(index, user) {\n promises.push(Templates.render('tool_dataprivacy/form-user-selector-suggestion', user));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results, function(index, user) {\n user._label = args[i];\n i++;\n });\n success(results);\n return;\n });\n\n }).fail(failure);\n }\n\n };\n\n});\n"],"file":"form-user-selector.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/form-user-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","promise","call","methodname","args","then","promises","i","render","when","apply","arguments","fail"],"mappings":"AAuBAA,OAAM,uCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAE3E,MAAgE,CAE5DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAK,CAAG,EAAZ,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCH,CAAK,CAACI,IAAN,CAAW,CACPC,KAAK,CAAEF,CAAI,CAACG,EADL,CAEPC,KAAK,CAAEJ,CAAI,CAACK,MAFL,CAAX,CAIH,CALD,EAMA,MAAOR,CAAAA,CACV,CAX2D,CAa5DS,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,CACnD,GAAIC,CAAAA,CAAO,CAEDlB,CAAI,CAACmB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,4BADK,CAEjBC,IAAI,CAAE,CACFN,KAAK,CAAEA,CADL,CAFW,CAAD,CAAV,CAFV,CASAG,CAAO,CAAC,CAAD,CAAP,CAAWI,IAAX,CAAgB,SAASlB,CAAT,CAAkB,CAC9B,GAAImB,CAAAA,CAAQ,CAAG,EAAf,CACIC,CAAC,CAAG,CADR,CAIAzB,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCe,CAAQ,CAACd,IAAT,CAAcR,CAAS,CAACwB,MAAV,CAAiB,gDAAjB,CAAmEjB,CAAnE,CAAd,CACH,CAFD,EAKA,MAAOT,CAAAA,CAAC,CAAC2B,IAAF,CAAOC,KAAP,CAAa5B,CAAC,CAAC2B,IAAf,CAAqBH,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAID,CAAAA,CAAI,CAAGO,SAAX,CACA7B,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCA,CAAI,CAACK,MAAL,CAAcQ,CAAI,CAACG,CAAD,CAAlB,CACAA,CAAC,EACJ,CAHD,EAIAR,CAAO,CAACZ,CAAD,CAEV,CARM,CAUV,CApBD,EAoBGyB,IApBH,CAoBQZ,CApBR,CAqBH,CA5C2D,CAgDnE,CAlDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Potential user selector module.\n *\n * @module tool_dataprivacy/form-user-selector\n * @copyright 2018 Jun Pataleta\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:tool_dataprivacy/form-user-selector */ {\n\n processResults: function(selector, results) {\n var users = [];\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n promise = Ajax.call([{\n methodname: 'tool_dataprivacy_get_users',\n args: {\n query: query\n }\n }]);\n\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results, function(index, user) {\n promises.push(Templates.render('tool_dataprivacy/form-user-selector-suggestion', user));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results, function(index, user) {\n user._label = args[i];\n i++;\n });\n success(results);\n return;\n });\n\n }).fail(failure);\n }\n\n };\n\n});\n"],"file":"form-user-selector.min.js"} \ No newline at end of file diff --git a/admin/tool/dataprivacy/amd/src/events.js b/admin/tool/dataprivacy/amd/src/events.js index 6a09ca7a7b611..75de61dbb7106 100644 --- a/admin/tool/dataprivacy/amd/src/events.js +++ b/admin/tool/dataprivacy/amd/src/events.js @@ -17,7 +17,6 @@ * Contain the events the data privacy tool can fire. * * @module tool_dataprivacy/events - * @class events * @copyright 2018 Jun Pataleta * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/dataprivacy/amd/src/expand_contract.js b/admin/tool/dataprivacy/amd/src/expand_contract.js index 58c05a72b5583..23890086384c2 100644 --- a/admin/tool/dataprivacy/amd/src/expand_contract.js +++ b/admin/tool/dataprivacy/amd/src/expand_contract.js @@ -17,7 +17,6 @@ * Potential user selector module. * * @module tool_dataprivacy/expand_contract - * @class page-expand-contract * @copyright 2018 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/dataprivacy/amd/src/form-user-selector.js b/admin/tool/dataprivacy/amd/src/form-user-selector.js index e34fb363747af..5b15286eec5f7 100644 --- a/admin/tool/dataprivacy/amd/src/form-user-selector.js +++ b/admin/tool/dataprivacy/amd/src/form-user-selector.js @@ -17,7 +17,6 @@ * Potential user selector module. * * @module tool_dataprivacy/form-user-selector - * @class form-user-selector * @copyright 2018 Jun Pataleta * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/licensemanager/amd/build/delete_license.min.js.map b/admin/tool/licensemanager/amd/build/delete_license.min.js.map index 944ccca050dfa..ca10f407e8051 100644 --- a/admin/tool/licensemanager/amd/build/delete_license.min.js.map +++ b/admin/tool/licensemanager/amd/build/delete_license.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/delete_license.js"],"names":["define","$","ModalFactory","ModalEvents","Url","String","trigger","create","type","types","SAVE_CANCEL","title","get_string","body","preShowCallback","triggerElement","modal","params","data","deleteURL","relativeUrl","large","done","getRoot","on","save","e","preventDefault","window","location","href"],"mappings":"AAuBAA,OAAM,sCAAC,CAAC,QAAD,CAAW,oBAAX,CAAiC,mBAAjC,CAAsD,UAAtD,CAAkE,UAAlE,CAAD,CACF,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAuCC,CAAvC,CAA4CC,CAA5C,CAAoD,CAEhD,GAAIC,CAAAA,CAAO,CAAGL,CAAC,CAAC,iBAAD,CAAf,CACAC,CAAY,CAACK,MAAb,CAAoB,CAChBC,IAAI,CAAEN,CAAY,CAACO,KAAb,CAAmBC,WADT,CAEhBC,KAAK,CAAEN,CAAM,CAACO,UAAP,CAAkB,eAAlB,CAAmC,qBAAnC,CAFS,CAGhBC,IAAI,CAAER,CAAM,CAACO,UAAP,CAAkB,6BAAlB,CAAiD,qBAAjD,CAHU,CAIhBE,eAAe,CAAE,yBAASC,CAAT,CAAyBC,CAAzB,CAAgC,CAC7CD,CAAc,CAAGd,CAAC,CAACc,CAAD,CAAlB,CACA,GAAIE,CAAAA,CAAM,CAAG,CACT,OAAU,QADD,CAET,QAAWF,CAAc,CAACG,IAAf,CAAoB,SAApB,CAFF,CAAb,CAIAF,CAAK,CAACG,SAAN,CAAkBf,CAAG,CAACgB,WAAJ,CAAgB,sCAAhB,CAAwDH,CAAxD,IACrB,CAXe,CAYhBI,KAAK,GAZW,CAApB,CAaGf,CAbH,EAcKgB,IAdL,CAcU,SAASN,CAAT,CAAgB,CAClBA,CAAK,CAACO,OAAN,GAAgBC,EAAhB,CAAmBrB,CAAW,CAACsB,IAA/B,CAAqC,SAASC,CAAT,CAAY,CAE7CA,CAAC,CAACC,cAAF,GAEAC,MAAM,CAACC,QAAP,CAAgBC,IAAhB,CAAuBd,CAAK,CAACG,SAChC,CALD,CAMH,CArBL,CAsBH,CA1BC,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Modal for confirming deletion of a custom license.\n *\n * @module tool_licensemanager/delete_license\n * @class delete_license\n * @copyright 2019 Tom Dickman \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/modal_factory', 'core/modal_events', 'core/url', 'core/str'],\n function($, ModalFactory, ModalEvents, Url, String) {\n\n var trigger = $('.delete-license');\n ModalFactory.create({\n type: ModalFactory.types.SAVE_CANCEL,\n title: String.get_string('deletelicense', 'tool_licensemanager'),\n body: String.get_string('deletelicenseconfirmmessage', 'tool_licensemanager'),\n preShowCallback: function(triggerElement, modal) {\n triggerElement = $(triggerElement);\n let params = {\n 'action': 'delete',\n 'license': triggerElement.data('license')\n };\n modal.deleteURL = Url.relativeUrl('/admin/tool/licensemanager/index.php', params, true);\n },\n large: true,\n }, trigger)\n .done(function(modal) {\n modal.getRoot().on(ModalEvents.save, function(e) {\n // Stop the default save button behaviour which is to close the modal.\n e.preventDefault();\n // Redirect to delete url.\n window.location.href = modal.deleteURL;\n });\n });\n });\n"],"file":"delete_license.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/delete_license.js"],"names":["define","$","ModalFactory","ModalEvents","Url","String","trigger","create","type","types","SAVE_CANCEL","title","get_string","body","preShowCallback","triggerElement","modal","params","data","deleteURL","relativeUrl","large","done","getRoot","on","save","e","preventDefault","window","location","href"],"mappings":"AAsBAA,OAAM,sCAAC,CAAC,QAAD,CAAW,oBAAX,CAAiC,mBAAjC,CAAsD,UAAtD,CAAkE,UAAlE,CAAD,CACF,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAuCC,CAAvC,CAA4CC,CAA5C,CAAoD,CAEhD,GAAIC,CAAAA,CAAO,CAAGL,CAAC,CAAC,iBAAD,CAAf,CACAC,CAAY,CAACK,MAAb,CAAoB,CAChBC,IAAI,CAAEN,CAAY,CAACO,KAAb,CAAmBC,WADT,CAEhBC,KAAK,CAAEN,CAAM,CAACO,UAAP,CAAkB,eAAlB,CAAmC,qBAAnC,CAFS,CAGhBC,IAAI,CAAER,CAAM,CAACO,UAAP,CAAkB,6BAAlB,CAAiD,qBAAjD,CAHU,CAIhBE,eAAe,CAAE,yBAASC,CAAT,CAAyBC,CAAzB,CAAgC,CAC7CD,CAAc,CAAGd,CAAC,CAACc,CAAD,CAAlB,CACA,GAAIE,CAAAA,CAAM,CAAG,CACT,OAAU,QADD,CAET,QAAWF,CAAc,CAACG,IAAf,CAAoB,SAApB,CAFF,CAAb,CAIAF,CAAK,CAACG,SAAN,CAAkBf,CAAG,CAACgB,WAAJ,CAAgB,sCAAhB,CAAwDH,CAAxD,IACrB,CAXe,CAYhBI,KAAK,GAZW,CAApB,CAaGf,CAbH,EAcKgB,IAdL,CAcU,SAASN,CAAT,CAAgB,CAClBA,CAAK,CAACO,OAAN,GAAgBC,EAAhB,CAAmBrB,CAAW,CAACsB,IAA/B,CAAqC,SAASC,CAAT,CAAY,CAE7CA,CAAC,CAACC,cAAF,GAEAC,MAAM,CAACC,QAAP,CAAgBC,IAAhB,CAAuBd,CAAK,CAACG,SAChC,CALD,CAMH,CArBL,CAsBH,CA1BC,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Modal for confirming deletion of a custom license.\n *\n * @module tool_licensemanager/delete_license\n * @copyright 2019 Tom Dickman \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/modal_factory', 'core/modal_events', 'core/url', 'core/str'],\n function($, ModalFactory, ModalEvents, Url, String) {\n\n var trigger = $('.delete-license');\n ModalFactory.create({\n type: ModalFactory.types.SAVE_CANCEL,\n title: String.get_string('deletelicense', 'tool_licensemanager'),\n body: String.get_string('deletelicenseconfirmmessage', 'tool_licensemanager'),\n preShowCallback: function(triggerElement, modal) {\n triggerElement = $(triggerElement);\n let params = {\n 'action': 'delete',\n 'license': triggerElement.data('license')\n };\n modal.deleteURL = Url.relativeUrl('/admin/tool/licensemanager/index.php', params, true);\n },\n large: true,\n }, trigger)\n .done(function(modal) {\n modal.getRoot().on(ModalEvents.save, function(e) {\n // Stop the default save button behaviour which is to close the modal.\n e.preventDefault();\n // Redirect to delete url.\n window.location.href = modal.deleteURL;\n });\n });\n });\n"],"file":"delete_license.min.js"} \ No newline at end of file diff --git a/admin/tool/licensemanager/amd/src/delete_license.js b/admin/tool/licensemanager/amd/src/delete_license.js index 8f9f6525f6f42..aef31d6e022ce 100644 --- a/admin/tool/licensemanager/amd/src/delete_license.js +++ b/admin/tool/licensemanager/amd/src/delete_license.js @@ -17,7 +17,6 @@ * Modal for confirming deletion of a custom license. * * @module tool_licensemanager/delete_license - * @class delete_license * @copyright 2019 Tom Dickman * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/lp/amd/build/actionselector.min.js.map b/admin/tool/lp/amd/build/actionselector.min.js.map index 583b1ce3dcf67..f114d9ad75188 100644 --- a/admin/tool/lp/amd/build/actionselector.min.js.map +++ b/admin/tool/lp/amd/build/actionselector.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/actionselector.js"],"names":["define","$","Notification","Ajax","Templates","Dialogue","EventBase","ActionSelector","title","message","actions","confirm","cancel","self","prototype","constructor","apply","_title","_message","_actions","_confirm","_cancel","_selectedValue","_reset","Object","create","_popup","_afterRender","_find","attr","change","val","removeAttr","_refresh","bind","click","e","preventDefault","close","length","_trigger","action","display","_render","then","html","fail","exception","selector","getContent","find","replaceWith","choices","i","push","content","render"],"mappings":"AA0BAA,OAAM,0BAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,gBAHD,CAIC,kBAJD,CAKC,oBALD,CAAD,CAME,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAqDC,CAArD,CAAgE,CAUpE,GAAIC,CAAAA,CAAc,CAAG,SAASC,CAAT,CAAgBC,CAAhB,CAAyBC,CAAzB,CAAkCC,CAAlC,CA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ChD,MAAO/C,CAAAA,CAAC,CAAC,KAAKyB,MAAL,CAAYuB,UAAZ,EAAD,CAAD,CAA4BC,IAA5B,CAAiCF,CAAjC,CACV,CAFD,CAUAzC,CAAc,CAACO,SAAf,CAAyBmB,QAAzB,CAAoC,UAAW,CAC3C,GAAIpB,CAAAA,CAAI,CAAG,IAAX,CACA,MAAOA,CAAAA,CAAI,CAAC8B,OAAL,GAAeC,IAAf,CAAoB,SAASC,CAAT,CAAe,CACtChC,CAAI,CAACe,KAAL,CAAW,mCAAX,EAA8CuB,WAA9C,CAA0DN,CAA1D,EACAhC,CAAI,CAACc,YAAL,EAEH,CAJM,CAKV,CAPD,CAeApB,CAAc,CAACO,SAAf,CAAyB6B,OAAzB,CAAmC,UAAW,IACtC9B,CAAAA,CAAI,CAAG,IAD+B,CAEtCuC,CAAO,CAAG,EAF4B,CAG1C,IAAK,GAAIC,CAAAA,CAAT,GAAcxC,CAAAA,CAAI,CAACM,QAAnB,CAA6B,CACzBiC,CAAO,CAACE,IAAR,CAAazC,CAAI,CAACM,QAAL,CAAckC,CAAd,CAAb,CACH,CACD,GAAIE,CAAAA,CAAO,CAAG,CAAC,QAAW1C,CAAI,CAACK,QAAjB,CAA2B,QAAWkC,CAAtC,CACV,QAAWvC,CAAI,CAACO,QADN,CACgB,OAAUP,CAAI,CAACQ,OAD/B,CAAd,CAGA,MAAOjB,CAAAA,CAAS,CAACoD,MAAV,CAAiB,yBAAjB,CAA4CD,CAA5C,CACV,CAVD,CAmBAhD,CAAc,CAACO,SAAf,CAAyBS,MAAzB,CAAkC,UAAW,CACzC,KAAKG,MAAL,CAAc,IAAd,CACA,KAAKJ,cAAL,CAAsB,EACzB,CAHD,CAKA,MAAmDf,CAAAA,CAEtD,CAxKK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Action selector.\n *\n * To handle 'save' events use: actionselector.on('save')\n * This will receive the information to display in popup.\n * The actions have the format [{'text': sometext, 'value' : somevalue}].\n *\n * @copyright 2016 Serge Gauthier - \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/templates',\n 'tool_lp/dialogue',\n 'tool_lp/event_base'],\n function($, Notification, Ajax, Templates, Dialogue, EventBase) {\n\n /**\n * Action selector class.\n * @param {String} title The title of popup.\n * @param {String} message The message to display.\n * @param {object} actions The actions that can be selected.\n * @param {String} confirm Text for confirm button.\n * @param {String} cancel Text for cancel button.\n */\n var ActionSelector = function(title, message, actions, confirm, cancel) {\n var self = this;\n\n EventBase.prototype.constructor.apply(this, []);\n self._title = title;\n self._message = message;\n self._actions = actions;\n self._confirm = confirm;\n self._cancel = cancel;\n self._selectedValue = null;\n self._reset();\n };\n\n ActionSelector.prototype = Object.create(EventBase.prototype);\n\n /** @property {String} The value that was selected. */\n ActionSelector.prototype._selectedValue = null;\n /** @property {Dialogue} The reference to the dialogue. */\n ActionSelector.prototype._popup = null;\n /** @property {String} The title of popup. */\n ActionSelector.prototype._title = null;\n /** @property {String} The message in popup. */\n ActionSelector.prototype._message = null;\n /** @property {object} The information for radion buttons. */\n ActionSelector.prototype._actions = null;\n /** @property {String} The text for confirm button. */\n ActionSelector.prototype._confirm = null;\n /** @property {String} The text for cancel button. */\n ActionSelector.prototype._cancel = null;\n\n /**\n * Hook to executed after the view is rendered.\n *\n * @method _afterRender\n */\n ActionSelector.prototype._afterRender = function() {\n var self = this;\n\n // Confirm button is disabled until a choice is done.\n self._find('[data-action=\"action-selector-confirm\"]').attr('disabled', 'disabled');\n\n // Add listener for radio buttons change.\n self._find('[data-region=\"action-selector-radio-buttons\"]').change(function() {\n self._selectedValue = $(\"input[type='radio']:checked\").val();\n self._find('[data-action=\"action-selector-confirm\"]').removeAttr('disabled');\n self._refresh.bind(self);\n });\n\n // Add listener for cancel.\n self._find('[data-action=\"action-selector-cancel\"]').click(function(e) {\n e.preventDefault();\n self.close();\n });\n\n // Add listener for confirm.\n self._find('[data-action=\"action-selector-confirm\"]').click(function(e) {\n e.preventDefault();\n if (!self._selectedValue.length) {\n return;\n }\n self._trigger('save', {action: self._selectedValue});\n self.close();\n });\n };\n\n /**\n * Close the dialogue.\n *\n * @method close\n */\n ActionSelector.prototype.close = function() {\n var self = this;\n self._popup.close();\n self._reset();\n };\n\n /**\n * Opens the action selector.\n *\n * @method display\n * @return {Promise}\n */\n ActionSelector.prototype.display = function() {\n var self = this;\n return self._render().then(function(html) {\n self._popup = new Dialogue(\n self._title,\n html,\n self._afterRender.bind(self)\n );\n return;\n }).fail(Notification.exception);\n };\n\n /**\n * Find a node in the dialogue.\n *\n * @param {String} selector\n * @return {JQuery} The node\n * @method _find\n */\n ActionSelector.prototype._find = function(selector) {\n return $(this._popup.getContent()).find(selector);\n };\n\n /**\n * Refresh the view.\n *\n * @method _refresh\n * @return {Promise}\n */\n ActionSelector.prototype._refresh = function() {\n var self = this;\n return self._render().then(function(html) {\n self._find('[data-region=\"action-selector\"]').replaceWith(html);\n self._afterRender();\n return;\n });\n };\n\n /**\n * Render the dialogue.\n *\n * @method _render\n * @return {Promise}\n */\n ActionSelector.prototype._render = function() {\n var self = this;\n var choices = [];\n for (var i in self._actions) {\n choices.push(self._actions[i]);\n }\n var content = {'message': self._message, 'choices': choices,\n 'confirm': self._confirm, 'cancel': self._cancel};\n\n return Templates.render('tool_lp/action_selector', content);\n };\n\n /**\n * Reset the dialogue properties.\n *\n * This does not reset everything, just enough to reset the UI.\n *\n * @method _reset\n */\n ActionSelector.prototype._reset = function() {\n this._popup = null;\n this._selectedValue = '';\n };\n\n return /** @alias module:tool_lp/actionselector */ ActionSelector;\n\n});\n"],"file":"actionselector.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/actionselector.js"],"names":["define","$","Notification","Ajax","Templates","Dialogue","EventBase","ActionSelector","title","message","actions","confirm","cancel","self","prototype","constructor","apply","_title","_message","_actions","_confirm","_cancel","_selectedValue","_reset","Object","create","_popup","_afterRender","_find","attr","change","val","removeAttr","_refresh","bind","click","e","preventDefault","close","length","_trigger","action","display","_render","then","html","fail","exception","selector","getContent","find","replaceWith","choices","i","push","content","render"],"mappings":"AA2BAA,OAAM,0BAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,gBAHD,CAIC,kBAJD,CAKC,oBALD,CAAD,CAME,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAqDC,CAArD,CAAgE,CAYpE,GAAIC,CAAAA,CAAc,CAAG,SAASC,CAAT,CAAgBC,CAAhB,CAAyBC,CAAzB,CAAkCC,CAAlC,CAA2CC,CAA3C,CAAmD,CACpE,GAAIC,CAAAA,CAAI,CAAG,IAAX,CAEAP,CAAS,CAACQ,SAAV,CAAoBC,WAApB,CAAgCC,KAAhC,CAAsC,IAAtC,CAA4C,EAA5C,EACAH,CAAI,CAACI,MAAL,CAAcT,CAAd,CACAK,CAAI,CAACK,QAAL,CAAgBT,CAAhB,CACAI,CAAI,CAACM,QAAL,CAAgBT,CAAhB,CACAG,CAAI,CAACO,QAAL,CAAgBT,CAAhB,CACAE,CAAI,CAACQ,OAAL,CAAeT,CAAf,CACAC,CAAI,CAACS,cAAL,CAAsB,IAAtB,CACAT,CAAI,CAACU,MAAL,EACH,CAXD,CAaAhB,CAAc,CAACO,SAAf,CAA2BU,MAAM,CAACC,MAAP,CAAcnB,CAAS,CAACQ,SAAxB,CAA3B,CAGAP,CAAc,CAACO,SAAf,CAAyBQ,cAAzB,CAA0C,IAA1C,CAEAf,CAAc,C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CAAAA,CAAI,CAACM,QAAnB,CAA6B,CACzBiC,CAAO,CAACE,IAAR,CAAazC,CAAI,CAACM,QAAL,CAAckC,CAAd,CAAb,CACH,CACD,GAAIE,CAAAA,CAAO,CAAG,CAAC,QAAW1C,CAAI,CAACK,QAAjB,CAA2B,QAAWkC,CAAtC,CACV,QAAWvC,CAAI,CAACO,QADN,CACgB,OAAUP,CAAI,CAACQ,OAD/B,CAAd,CAGA,MAAOjB,CAAAA,CAAS,CAACoD,MAAV,CAAiB,yBAAjB,CAA4CD,CAA5C,CACV,CAVD,CAmBAhD,CAAc,CAACO,SAAf,CAAyBS,MAAzB,CAAkC,UAAW,CACzC,KAAKG,MAAL,CAAc,IAAd,CACA,KAAKJ,cAAL,CAAsB,EACzB,CAHD,CAKA,MAAOf,CAAAA,CAEV,CA1KK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Action selector.\n *\n * To handle 'save' events use: actionselector.on('save')\n * This will receive the information to display in popup.\n * The actions have the format [{'text': sometext, 'value' : somevalue}].\n *\n * @module tool_lp/actionselector\n * @copyright 2016 Serge Gauthier - \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/templates',\n 'tool_lp/dialogue',\n 'tool_lp/event_base'],\n function($, Notification, Ajax, Templates, Dialogue, EventBase) {\n\n /**\n * Action selector class.\n *\n * @class tool_lp/actionselector\n * @param {String} title The title of popup.\n * @param {String} message The message to display.\n * @param {object} actions The actions that can be selected.\n * @param {String} confirm Text for confirm button.\n * @param {String} cancel Text for cancel button.\n */\n var ActionSelector = function(title, message, actions, confirm, cancel) {\n var self = this;\n\n EventBase.prototype.constructor.apply(this, []);\n self._title = title;\n self._message = message;\n self._actions = actions;\n self._confirm = confirm;\n self._cancel = cancel;\n self._selectedValue = null;\n self._reset();\n };\n\n ActionSelector.prototype = Object.create(EventBase.prototype);\n\n /** @property {String} The value that was selected. */\n ActionSelector.prototype._selectedValue = null;\n /** @property {Dialogue} The reference to the dialogue. */\n ActionSelector.prototype._popup = null;\n /** @property {String} The title of popup. */\n ActionSelector.prototype._title = null;\n /** @property {String} The message in popup. */\n ActionSelector.prototype._message = null;\n /** @property {object} The information for radion buttons. */\n ActionSelector.prototype._actions = null;\n /** @property {String} The text for confirm button. */\n ActionSelector.prototype._confirm = null;\n /** @property {String} The text for cancel button. */\n ActionSelector.prototype._cancel = null;\n\n /**\n * Hook to executed after the view is rendered.\n *\n * @method _afterRender\n */\n ActionSelector.prototype._afterRender = function() {\n var self = this;\n\n // Confirm button is disabled until a choice is done.\n self._find('[data-action=\"action-selector-confirm\"]').attr('disabled', 'disabled');\n\n // Add listener for radio buttons change.\n self._find('[data-region=\"action-selector-radio-buttons\"]').change(function() {\n self._selectedValue = $(\"input[type='radio']:checked\").val();\n self._find('[data-action=\"action-selector-confirm\"]').removeAttr('disabled');\n self._refresh.bind(self);\n });\n\n // Add listener for cancel.\n self._find('[data-action=\"action-selector-cancel\"]').click(function(e) {\n e.preventDefault();\n self.close();\n });\n\n // Add listener for confirm.\n self._find('[data-action=\"action-selector-confirm\"]').click(function(e) {\n e.preventDefault();\n if (!self._selectedValue.length) {\n return;\n }\n self._trigger('save', {action: self._selectedValue});\n self.close();\n });\n };\n\n /**\n * Close the dialogue.\n *\n * @method close\n */\n ActionSelector.prototype.close = function() {\n var self = this;\n self._popup.close();\n self._reset();\n };\n\n /**\n * Opens the action selector.\n *\n * @method display\n * @return {Promise}\n */\n ActionSelector.prototype.display = function() {\n var self = this;\n return self._render().then(function(html) {\n self._popup = new Dialogue(\n self._title,\n html,\n self._afterRender.bind(self)\n );\n return;\n }).fail(Notification.exception);\n };\n\n /**\n * Find a node in the dialogue.\n *\n * @param {String} selector\n * @return {JQuery} The node\n * @method _find\n */\n ActionSelector.prototype._find = function(selector) {\n return $(this._popup.getContent()).find(selector);\n };\n\n /**\n * Refresh the view.\n *\n * @method _refresh\n * @return {Promise}\n */\n ActionSelector.prototype._refresh = function() {\n var self = this;\n return self._render().then(function(html) {\n self._find('[data-region=\"action-selector\"]').replaceWith(html);\n self._afterRender();\n return;\n });\n };\n\n /**\n * Render the dialogue.\n *\n * @method _render\n * @return {Promise}\n */\n ActionSelector.prototype._render = function() {\n var self = this;\n var choices = [];\n for (var i in self._actions) {\n choices.push(self._actions[i]);\n }\n var content = {'message': self._message, 'choices': choices,\n 'confirm': self._confirm, 'cancel': self._cancel};\n\n return Templates.render('tool_lp/action_selector', content);\n };\n\n /**\n * Reset the dialogue properties.\n *\n * This does not reset everything, just enough to reset the UI.\n *\n * @method _reset\n */\n ActionSelector.prototype._reset = function() {\n this._popup = null;\n this._selectedValue = '';\n };\n\n return ActionSelector;\n\n});\n"],"file":"actionselector.min.js"} \ No newline at end of file diff --git a/admin/tool/lp/amd/build/competencies.min.js.map b/admin/tool/lp/amd/build/competencies.min.js.map index 0e5bba456e0d4..fe7e6ed9854b3 100644 --- a/admin/tool/lp/amd/build/competencies.min.js.map +++ b/admin/tool/lp/amd/build/competencies.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/competencies.js"],"names":["define","$","notification","ajax","templates","str","Picker","dragdrop","Pending","competencies","itemid","itemtype","pagectxid","pageContextId","pickerInstance","prop","registerEvents","registerDragDrop","prototype","localthis","get_string","done","movestring","identifier","component","drag","drop","handleDrop","fail","exception","fromid","data","toid","requests","call","methodname","args","courseid","competencyidfrom","competencyidto","templateid","planid","pickCompetency","self","pagerender","pageregion","pageContextIncludes","on","e","compIds","competencyIds","pendingPromise","each","index","compId","push","competencyid","moduleid","pagecontext","contextid","length","then","context","render","html","js","replaceNode","resolve","catch","display","doDelete","deleteid","replaceWith","runTemplateJS","deleteHandler","message","id","competency","get_strings","key","param","shortname","strings","confirm","coursecompetencyid","target","ruleoutcome","val","click","preventDefault","closest"],"mappings":"AAsBAA,OAAM,wBAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,gBAHD,CAIC,UAJD,CAKC,0BALD,CAMC,0BAND,CAOC,cAPD,CAAD,CAQC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAgDC,CAAhD,CAAwDC,CAAxD,CAAkEC,CAAlE,CAA2E,CAS9E,GAAIC,CAAAA,CAAY,CAAG,SAASC,CAAT,CAAiBC,CAAjB,CAA2BC,CAA3B,CAAsC,CACrD,KAAKF,MAAL,CAAcA,CAAd,CACA,KAAKC,QAAL,CAAgBA,CAAhB,CACA,KAAKE,aAAL,CAAqBD,CAArB,CACA,KAAKE,cAAL,CAAsB,IAAtB,CAEAb,CAAC,CAAC,kCAAD,CAAD,CAAoCc,IAApC,CAAyC,UAAzC,KACA,KAAKC,cAAL,GACA,KAAKC,gBAAL,EACH,CATD,CAeAR,CAAY,CAACS,SAAb,CAAuBD,gBAAvB,CAA0C,UAAW,CACjD,GAAIE,CAAAA,CAAS,CAAG,IAAhB,CAEAd,CAAG,CAACe,UAAJ,CAAe,gBAAf,CAAiC,SAAjC,EAA4CC,IAA5C,CACI,SAASC,CAAT,CAAqB,CACjBf,CAAQ,CAACA,QAAT,CAAkB,gBAAlB,CACkBe,CADlB,CAEkB,CAACC,UAAU,CAAE,gBAAb,CAA+BC,SAAS,CAAE,SAA1C,CAFlB,CAGkB,CAACD,UAAU,CAAE,qBAAb,CAAoCC,SAAS,CAAE,SAA/C,CAHlB,CAIkB,eAJlB,CAKkB,iBALlB,CAMkB,sBANlB,CAOkB,SAASC,CAAT,CAAeC,CAAf,CAAqB,CACjBP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,CAAeC,CAAf,CAAmB,CACrB,MAAO7D,CAAAA,CAAS,CAAC8D,WAAV,CAAsBjE,CAAC,CAAC,kBAdlB,wBAckB,CAAgC,KAAjC,CAAvB,CAA+D+D,CAA/D,CAAqEC,CAArE,CACV,CALD,EAMCJ,IAND,CAMMV,CAAc,CAACgB,OANrB,EAOCC,KAPD,CAOOlE,CAAY,CAAC2B,SAPpB,CAQH,CAtBD,CAuBH,CAED5B,CAAC,CAAC,kCAAD,CAAD,CAAoCuF,KAApC,CAA0C,SAASxC,CAAT,CAAY,CAClD,GAAIG,CAAAA,CAAc,CAAG,GAAI3C,CAAAA,CAAzB,CACAwC,CAAC,CAACyC,cAAF,GAEAtE,CAAS,CAACuB,cAAV,GACKmB,IADL,CACUV,CAAc,CAACgB,OADzB,EAEKC,KAFL,EAGH,CAPD,EAQAnE,CAAC,CAAC,0CAAD,CAAD,CAA4CuF,KAA5C,CAAkD,SAASxC,CAAT,CAAY,CAC1DA,CAAC,CAACyC,cAAF,GAEA,GAAIlB,CAAAA,CAAQ,CAAGtE,CAAC,CAAC+C,CAAC,CAACqC,MAAH,CAAD,CAAYK,OAAZ,CAAoB,WAApB,EAAiC3D,IAAjC,CAAsC,IAAtC,CAAf,CACAZ,CAAS,CAACuD,aAAV,CAAwBH,CAAxB,CACH,CALD,CAMH,CA5CD,CA8CA,MAAiD9D,CAAAA,CACpD,CAxUK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Handle add/remove competency links.\n *\n * @module tool_lp/competencies\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/templates',\n 'core/str',\n 'tool_lp/competencypicker',\n 'tool_lp/dragdrop-reorder',\n 'core/pending'],\n function($, notification, ajax, templates, str, Picker, dragdrop, Pending) {\n\n /**\n * Constructor\n *\n * @param {Number} itemid\n * @param {String} itemtype\n * @param {Number} pagectxid\n */\n var competencies = function(itemid, itemtype, pagectxid) {\n this.itemid = itemid;\n this.itemtype = itemtype;\n this.pageContextId = pagectxid;\n this.pickerInstance = null;\n\n $('[data-region=\"actions\"] button').prop('disabled', false);\n this.registerEvents();\n this.registerDragDrop();\n };\n\n /**\n * Initialise the drag/drop code.\n * @method registerDragDrop\n */\n competencies.prototype.registerDragDrop = function() {\n var localthis = this;\n // Init this module.\n str.get_string('movecompetency', 'tool_lp').done(\n function(movestring) {\n dragdrop.dragdrop('movecompetency',\n movestring,\n {identifier: 'movecompetency', component: 'tool_lp'},\n {identifier: 'movecompetencyafter', component: 'tool_lp'},\n 'drag-samenode',\n 'drag-parentnode',\n 'drag-handlecontainer',\n function(drag, drop) {\n localthis.handleDrop(drag, drop);\n });\n }\n ).fail(notification.exception);\n\n };\n\n /**\n * Handle a drop from a drag/drop operation.\n *\n * @method handleDrop\n * @param {DOMNode} drag The dragged node.\n * @param {DOMNode} drop The dropped on node.\n */\n competencies.prototype.handleDrop = function(drag, drop) {\n var fromid = $(drag).data('id');\n var toid = $(drop).data('id');\n var localthis = this;\n var requests = [];\n\n if (localthis.itemtype == 'course') {\n requests = ajax.call([\n {\n methodname: 'core_competency_reorder_course_competency',\n args: {courseid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid}\n }\n ]);\n } else if (localthis.itemtype == 'template') {\n requests = ajax.call([\n {\n methodname: 'core_competency_reorder_template_competency',\n args: {templateid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid}\n }\n ]);\n } else if (localthis.itemtype == 'plan') {\n requests = ajax.call([\n {\n methodname: 'core_competency_reorder_plan_competency',\n args: {planid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid}\n }\n ]);\n } else {\n return;\n }\n\n requests[0].fail(notification.exception);\n };\n\n /**\n * Pick a competency\n *\n * @method pickCompetency\n * @return {Promise}\n */\n competencies.prototype.pickCompetency = function() {\n var self = this;\n var requests;\n var pagerender;\n var pageregion;\n var pageContextIncludes;\n\n if (!self.pickerInstance) {\n if (self.itemtype === 'template' || self.itemtype === 'course') {\n pageContextIncludes = 'parents';\n }\n self.pickerInstance = new Picker(self.pageContextId, false, pageContextIncludes);\n self.pickerInstance.on('save', function(e, data) {\n var compIds = data.competencyIds;\n var pendingPromise = new Pending();\n\n if (self.itemtype === \"course\") {\n requests = [];\n\n $.each(compIds, function(index, compId) {\n requests.push({\n methodname: 'core_competency_add_competency_to_course',\n args: {courseid: self.itemid, competencyid: compId}\n });\n });\n requests.push({\n methodname: 'tool_lp_data_for_course_competencies_page',\n args: {courseid: self.itemid, moduleid: 0}\n });\n\n pagerender = 'tool_lp/course_competencies_page';\n pageregion = 'coursecompetenciespage';\n\n } else if (self.itemtype === \"template\") {\n requests = [];\n\n $.each(compIds, function(index, compId) {\n requests.push({\n methodname: 'core_competency_add_competency_to_template',\n args: {templateid: self.itemid, competencyid: compId}\n });\n });\n requests.push({\n methodname: 'tool_lp_data_for_template_competencies_page',\n args: {templateid: self.itemid, pagecontext: {contextid: self.pageContextId}}\n });\n pagerender = 'tool_lp/template_competencies_page';\n pageregion = 'templatecompetenciespage';\n } else if (self.itemtype === \"plan\") {\n requests = [];\n\n $.each(compIds, function(index, compId) {\n requests.push({\n methodname: 'core_competency_add_competency_to_plan',\n args: {planid: self.itemid, competencyid: compId}\n });\n });\n requests.push({\n methodname: 'tool_lp_data_for_plan_page',\n args: {planid: self.itemid}\n });\n pagerender = 'tool_lp/plan_page';\n pageregion = 'plan-page';\n }\n ajax.call(requests)[requests.length - 1]\n .then(function(context) {\n return templates.render(pagerender, context);\n })\n .then(function(html, js) {\n templates.replaceNode($('[data-region=\"' + pageregion + '\"]'), html, js);\n return;\n })\n .then(pendingPromise.resolve)\n .catch(notification.exception);\n });\n }\n\n return self.pickerInstance.display();\n };\n\n /**\n * Delete the link between competency and course, template or plan. Reload the page.\n *\n * @method doDelete\n * @param {int} deleteid The id of record to delete.\n */\n competencies.prototype.doDelete = function(deleteid) {\n var localthis = this;\n var requests = [],\n pagerender = '',\n pageregion = '';\n\n // Delete the link and reload the page template.\n if (localthis.itemtype == 'course') {\n requests = ajax.call([\n {methodname: 'core_competency_remove_competency_from_course',\n args: {courseid: localthis.itemid, competencyid: deleteid}},\n {methodname: 'tool_lp_data_for_course_competencies_page',\n args: {courseid: localthis.itemid, moduleid: 0}}\n ]);\n pagerender = 'tool_lp/course_competencies_page';\n pageregion = 'coursecompetenciespage';\n } else if (localthis.itemtype == 'template') {\n requests = ajax.call([\n {methodname: 'core_competency_remove_competency_from_template',\n args: {templateid: localthis.itemid, competencyid: deleteid}},\n {methodname: 'tool_lp_data_for_template_competencies_page',\n args: {templateid: localthis.itemid, pagecontext: {contextid: localthis.pageContextId}}}\n ]);\n pagerender = 'tool_lp/template_competencies_page';\n pageregion = 'templatecompetenciespage';\n } else if (localthis.itemtype == 'plan') {\n requests = ajax.call([\n {methodname: 'core_competency_remove_competency_from_plan',\n args: {planid: localthis.itemid, competencyid: deleteid}},\n {methodname: 'tool_lp_data_for_plan_page',\n args: {planid: localthis.itemid}}\n ]);\n pagerender = 'tool_lp/plan_page';\n pageregion = 'plan-page';\n }\n\n requests[1].done(function(context) {\n templates.render(pagerender, context).done(function(html, js) {\n $('[data-region=\"' + pageregion + '\"]').replaceWith(html);\n templates.runTemplateJS(js);\n }).fail(notification.exception);\n }).fail(notification.exception);\n\n };\n\n /**\n * Show a confirm dialogue before deleting a competency.\n *\n * @method deleteHandler\n * @param {int} deleteid The id of record to delete.\n */\n competencies.prototype.deleteHandler = function(deleteid) {\n var localthis = this;\n var requests = [];\n var message;\n\n if (localthis.itemtype == 'course') {\n message = 'unlinkcompetencycourse';\n } else if (localthis.itemtype == 'template') {\n message = 'unlinkcompetencytemplate';\n } else if (localthis.itemtype == 'plan') {\n message = 'unlinkcompetencyplan';\n } else {\n return;\n }\n\n requests = ajax.call([{\n methodname: 'core_competency_read_competency',\n args: {id: deleteid}\n }]);\n\n requests[0].done(function(competency) {\n str.get_strings([\n {key: 'confirm', component: 'moodle'},\n {key: message, component: 'tool_lp', param: competency.shortname},\n {key: 'confirm', component: 'moodle'},\n {key: 'cancel', component: 'moodle'}\n ]).done(function(strings) {\n notification.confirm(\n strings[0], // Confirm.\n strings[1], // Unlink the competency X from the course?\n strings[2], // Confirm.\n strings[3], // Cancel.\n function() {\n localthis.doDelete(deleteid);\n }\n );\n }).fail(notification.exception);\n }).fail(notification.exception);\n };\n\n /**\n * Register the javascript event handlers for this page.\n *\n * @method registerEvents\n */\n competencies.prototype.registerEvents = function() {\n var localthis = this;\n\n if (localthis.itemtype == 'course') {\n // Course completion rule handling.\n $('[data-region=\"coursecompetenciespage\"]').on('change', 'select[data-field=\"ruleoutcome\"]', function(e) {\n var pendingPromise = new Pending();\n var requests = [];\n var pagerender = 'tool_lp/course_competencies_page';\n var pageregion = 'coursecompetenciespage';\n var coursecompetencyid = $(e.target).data('id');\n var ruleoutcome = $(e.target).val();\n requests = ajax.call([\n {methodname: 'core_competency_set_course_competency_ruleoutcome',\n args: {coursecompetencyid: coursecompetencyid, ruleoutcome: ruleoutcome}},\n {methodname: 'tool_lp_data_for_course_competencies_page',\n args: {courseid: localthis.itemid, moduleid: 0}}\n ]);\n\n requests[1].then(function(context) {\n return templates.render(pagerender, context);\n })\n .then(function(html, js) {\n return templates.replaceNode($('[data-region=\"' + pageregion + '\"]'), html, js);\n })\n .then(pendingPromise.resolve)\n .catch(notification.exception);\n });\n }\n\n $('[data-region=\"actions\"] button').click(function(e) {\n var pendingPromise = new Pending();\n e.preventDefault();\n\n localthis.pickCompetency()\n .then(pendingPromise.resolve)\n .catch();\n });\n $('[data-action=\"delete-competency-link\"]').click(function(e) {\n e.preventDefault();\n\n var deleteid = $(e.target).closest('[data-id]').data('id');\n localthis.deleteHandler(deleteid);\n });\n };\n\n return /** @alias module:tool_lp/competencies */ competencies;\n});\n"],"file":"competencies.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/competencies.js"],"names":["define","$","notification","ajax","templates","str","Picker","dragdrop","Pending","competencies","itemid","itemtype","pagectxid","pageContextId","pickerInstance","prop","registerEvents","registerDragDrop","prototype","localthis","get_string","done","movestring","identifier","component","drag","drop","handleDrop","fail","exception","fromid","data","toid","requests","call","methodname","args","courseid","competencyidfrom","competencyidto","templateid","planid","pickCompetency","self","pagerender","pageregion","pageContextIncludes","on","e","compIds","competencyIds","pendingPromise","each","index","compId","push","competencyid","moduleid","pagecontext","contextid","length","then","context","render","html","js","replaceNode","resolve","catch","display","doDelete","deleteid","replaceWith","runTemplateJS","deleteHandler","message","id","competency","get_strings","key","param","shortname","strings","confirm","coursecompetencyid","target","ruleoutcome","val","click","preventDefault","closest"],"mappings":"AAsBAA,OAAM,wBAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,gBAHD,CAIC,UAJD,CAKC,0BALD,CAMC,0BAND,CAOC,cAPD,CAAD,CAQC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAgDC,CAAhD,CAAwDC,CAAxD,CAAkEC,CAAlE,CAA2E,CAU9E,GAAIC,CAAAA,CAAY,CAAG,SAASC,CAAT,CAAiBC,CAAjB,CAA2BC,CAA3B,CAAsC,CACrD,KAAKF,MAAL,CAAcA,CAAd,CACA,KAAKC,QAAL,CAAgBA,CAAhB,CACA,KAAKE,aAAL,CAAqBD,CAArB,CACA,KAAKE,cAAL,CAAsB,IAAtB,CAEAb,CAAC,CAAC,kCAAD,CAAD,CAAoCc,IAApC,CAAyC,UAAzC,KACA,KAAKC,cAAL,GACA,KAAKC,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IAAtC,CAAf,CACAZ,CAAS,CAACuD,aAAV,CAAwBH,CAAxB,CACH,CALD,CAMH,CA5CD,CA8CA,MAAiD9D,CAAAA,CACpD,CAzUK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Handle add/remove competency links.\n *\n * @module tool_lp/competencies\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/templates',\n 'core/str',\n 'tool_lp/competencypicker',\n 'tool_lp/dragdrop-reorder',\n 'core/pending'],\n function($, notification, ajax, templates, str, Picker, dragdrop, Pending) {\n\n /**\n * Constructor\n *\n * @class tool_lp/competencies\n * @param {Number} itemid\n * @param {String} itemtype\n * @param {Number} pagectxid\n */\n var competencies = function(itemid, itemtype, pagectxid) {\n this.itemid = itemid;\n this.itemtype = itemtype;\n this.pageContextId = pagectxid;\n this.pickerInstance = null;\n\n $('[data-region=\"actions\"] button').prop('disabled', false);\n this.registerEvents();\n this.registerDragDrop();\n };\n\n /**\n * Initialise the drag/drop code.\n * @method registerDragDrop\n */\n competencies.prototype.registerDragDrop = function() {\n var localthis = this;\n // Init this module.\n str.get_string('movecompetency', 'tool_lp').done(\n function(movestring) {\n dragdrop.dragdrop('movecompetency',\n movestring,\n {identifier: 'movecompetency', component: 'tool_lp'},\n {identifier: 'movecompetencyafter', component: 'tool_lp'},\n 'drag-samenode',\n 'drag-parentnode',\n 'drag-handlecontainer',\n function(drag, drop) {\n localthis.handleDrop(drag, drop);\n });\n }\n ).fail(notification.exception);\n\n };\n\n /**\n * Handle a drop from a drag/drop operation.\n *\n * @method handleDrop\n * @param {DOMNode} drag The dragged node.\n * @param {DOMNode} drop The dropped on node.\n */\n competencies.prototype.handleDrop = function(drag, drop) {\n var fromid = $(drag).data('id');\n var toid = $(drop).data('id');\n var localthis = this;\n var requests = [];\n\n if (localthis.itemtype == 'course') {\n requests = ajax.call([\n {\n methodname: 'core_competency_reorder_course_competency',\n args: {courseid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid}\n }\n ]);\n } else if (localthis.itemtype == 'template') {\n requests = ajax.call([\n {\n methodname: 'core_competency_reorder_template_competency',\n args: {templateid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid}\n }\n ]);\n } else if (localthis.itemtype == 'plan') {\n requests = ajax.call([\n {\n methodname: 'core_competency_reorder_plan_competency',\n args: {planid: localthis.itemid, competencyidfrom: fromid, competencyidto: toid}\n }\n ]);\n } else {\n return;\n }\n\n requests[0].fail(notification.exception);\n };\n\n /**\n * Pick a competency\n *\n * @method pickCompetency\n * @return {Promise}\n */\n competencies.prototype.pickCompetency = function() {\n var self = this;\n var requests;\n var pagerender;\n var pageregion;\n var pageContextIncludes;\n\n if (!self.pickerInstance) {\n if (self.itemtype === 'template' || self.itemtype === 'course') {\n pageContextIncludes = 'parents';\n }\n self.pickerInstance = new Picker(self.pageContextId, false, pageContextIncludes);\n self.pickerInstance.on('save', function(e, data) {\n var compIds = data.competencyIds;\n var pendingPromise = new Pending();\n\n if (self.itemtype === \"course\") {\n requests = [];\n\n $.each(compIds, function(index, compId) {\n requests.push({\n methodname: 'core_competency_add_competency_to_course',\n args: {courseid: self.itemid, competencyid: compId}\n });\n });\n requests.push({\n methodname: 'tool_lp_data_for_course_competencies_page',\n args: {courseid: self.itemid, moduleid: 0}\n });\n\n pagerender = 'tool_lp/course_competencies_page';\n pageregion = 'coursecompetenciespage';\n\n } else if (self.itemtype === \"template\") {\n requests = [];\n\n $.each(compIds, function(index, compId) {\n requests.push({\n methodname: 'core_competency_add_competency_to_template',\n args: {templateid: self.itemid, competencyid: compId}\n });\n });\n requests.push({\n methodname: 'tool_lp_data_for_template_competencies_page',\n args: {templateid: self.itemid, pagecontext: {contextid: self.pageContextId}}\n });\n pagerender = 'tool_lp/template_competencies_page';\n pageregion = 'templatecompetenciespage';\n } else if (self.itemtype === \"plan\") {\n requests = [];\n\n $.each(compIds, function(index, compId) {\n requests.push({\n methodname: 'core_competency_add_competency_to_plan',\n args: {planid: self.itemid, competencyid: compId}\n });\n });\n requests.push({\n methodname: 'tool_lp_data_for_plan_page',\n args: {planid: self.itemid}\n });\n pagerender = 'tool_lp/plan_page';\n pageregion = 'plan-page';\n }\n ajax.call(requests)[requests.length - 1]\n .then(function(context) {\n return templates.render(pagerender, context);\n })\n .then(function(html, js) {\n templates.replaceNode($('[data-region=\"' + pageregion + '\"]'), html, js);\n return;\n })\n .then(pendingPromise.resolve)\n .catch(notification.exception);\n });\n }\n\n return self.pickerInstance.display();\n };\n\n /**\n * Delete the link between competency and course, template or plan. Reload the page.\n *\n * @method doDelete\n * @param {int} deleteid The id of record to delete.\n */\n competencies.prototype.doDelete = function(deleteid) {\n var localthis = this;\n var requests = [],\n pagerender = '',\n pageregion = '';\n\n // Delete the link and reload the page template.\n if (localthis.itemtype == 'course') {\n requests = ajax.call([\n {methodname: 'core_competency_remove_competency_from_course',\n args: {courseid: localthis.itemid, competencyid: deleteid}},\n {methodname: 'tool_lp_data_for_course_competencies_page',\n args: {courseid: localthis.itemid, moduleid: 0}}\n ]);\n pagerender = 'tool_lp/course_competencies_page';\n pageregion = 'coursecompetenciespage';\n } else if (localthis.itemtype == 'template') {\n requests = ajax.call([\n {methodname: 'core_competency_remove_competency_from_template',\n args: {templateid: localthis.itemid, competencyid: deleteid}},\n {methodname: 'tool_lp_data_for_template_competencies_page',\n args: {templateid: localthis.itemid, pagecontext: {contextid: localthis.pageContextId}}}\n ]);\n pagerender = 'tool_lp/template_competencies_page';\n pageregion = 'templatecompetenciespage';\n } else if (localthis.itemtype == 'plan') {\n requests = ajax.call([\n {methodname: 'core_competency_remove_competency_from_plan',\n args: {planid: localthis.itemid, competencyid: deleteid}},\n {methodname: 'tool_lp_data_for_plan_page',\n args: {planid: localthis.itemid}}\n ]);\n pagerender = 'tool_lp/plan_page';\n pageregion = 'plan-page';\n }\n\n requests[1].done(function(context) {\n templates.render(pagerender, context).done(function(html, js) {\n $('[data-region=\"' + pageregion + '\"]').replaceWith(html);\n templates.runTemplateJS(js);\n }).fail(notification.exception);\n }).fail(notification.exception);\n\n };\n\n /**\n * Show a confirm dialogue before deleting a competency.\n *\n * @method deleteHandler\n * @param {int} deleteid The id of record to delete.\n */\n competencies.prototype.deleteHandler = function(deleteid) {\n var localthis = this;\n var requests = [];\n var message;\n\n if (localthis.itemtype == 'course') {\n message = 'unlinkcompetencycourse';\n } else if (localthis.itemtype == 'template') {\n message = 'unlinkcompetencytemplate';\n } else if (localthis.itemtype == 'plan') {\n message = 'unlinkcompetencyplan';\n } else {\n return;\n }\n\n requests = ajax.call([{\n methodname: 'core_competency_read_competency',\n args: {id: deleteid}\n }]);\n\n requests[0].done(function(competency) {\n str.get_strings([\n {key: 'confirm', component: 'moodle'},\n {key: message, component: 'tool_lp', param: competency.shortname},\n {key: 'confirm', component: 'moodle'},\n {key: 'cancel', component: 'moodle'}\n ]).done(function(strings) {\n notification.confirm(\n strings[0], // Confirm.\n strings[1], // Unlink the competency X from the course?\n strings[2], // Confirm.\n strings[3], // Cancel.\n function() {\n localthis.doDelete(deleteid);\n }\n );\n }).fail(notification.exception);\n }).fail(notification.exception);\n };\n\n /**\n * Register the javascript event handlers for this page.\n *\n * @method registerEvents\n */\n competencies.prototype.registerEvents = function() {\n var localthis = this;\n\n if (localthis.itemtype == 'course') {\n // Course completion rule handling.\n $('[data-region=\"coursecompetenciespage\"]').on('change', 'select[data-field=\"ruleoutcome\"]', function(e) {\n var pendingPromise = new Pending();\n var requests = [];\n var pagerender = 'tool_lp/course_competencies_page';\n var pageregion = 'coursecompetenciespage';\n var coursecompetencyid = $(e.target).data('id');\n var ruleoutcome = $(e.target).val();\n requests = ajax.call([\n {methodname: 'core_competency_set_course_competency_ruleoutcome',\n args: {coursecompetencyid: coursecompetencyid, ruleoutcome: ruleoutcome}},\n {methodname: 'tool_lp_data_for_course_competencies_page',\n args: {courseid: localthis.itemid, moduleid: 0}}\n ]);\n\n requests[1].then(function(context) {\n return templates.render(pagerender, context);\n })\n .then(function(html, js) {\n return templates.replaceNode($('[data-region=\"' + pageregion + '\"]'), html, js);\n })\n .then(pendingPromise.resolve)\n .catch(notification.exception);\n });\n }\n\n $('[data-region=\"actions\"] button').click(function(e) {\n var pendingPromise = new Pending();\n e.preventDefault();\n\n localthis.pickCompetency()\n .then(pendingPromise.resolve)\n .catch();\n });\n $('[data-action=\"delete-competency-link\"]').click(function(e) {\n e.preventDefault();\n\n var deleteid = $(e.target).closest('[data-id]').data('id');\n localthis.deleteHandler(deleteid);\n });\n };\n\n return /** @alias module:tool_lp/competencies */ competencies;\n});\n"],"file":"competencies.min.js"} \ No newline at end of file diff --git a/admin/tool/lp/amd/build/competency_outcomes.min.js.map b/admin/tool/lp/amd/build/competency_outcomes.min.js.map index f53bc693d85b1..3a38fcdc31adc 100644 --- a/admin/tool/lp/amd/build/competency_outcomes.min.js.map +++ b/admin/tool/lp/amd/build/competency_outcomes.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/competency_outcomes.js"],"names":["define","$","Str","NONE","EVIDENCE","COMPLETE","RECOMMEND","getAll","self","get_strings","key","component","then","strings","outcomes","code","name","getString","id","all","Deferred","reject","promise"],"mappings":"AAsBAA,OAAM,+BAAC,CAAC,QAAD,CACC,UADD,CAAD,CAEE,SAASC,CAAT,CAAYC,CAAZ,CAAiB,CAOrB,MAAwD,CAEpDC,IAAI,EAFgD,CAGpDC,QAAQ,EAH4C,CAIpDC,QAAQ,EAJ4C,CAKpDC,SAAS,EAL2C,CAapDC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CAAS,SAASE,CAAT,CAAmB,CAC/B,GAA4B,WAAxB,QAAOA,CAAAA,CAAQ,CAACI,CAAD,CAAnB,CAAyC,CACrC,MAAOjB,CAAAA,CAAC,CAACmB,QAAF,GAAaC,MAAb,GAAsBC,OAAtB,EACV,CACD,MAAOR,CAAAA,CAAQ,CAACI,CAAD,CAAR,CAAaF,IACvB,CALM,CAMV,CA/CmD,CAkD3D,CA3DK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency rule config.\n *\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/str'],\n function($, Str) {\n\n var OUTCOME_NONE = 0,\n OUTCOME_EVIDENCE = 1,\n OUTCOME_COMPLETE = 2,\n OUTCOME_RECOMMEND = 3;\n\n return /** @alias module:tool_lp/competency_outcomes */ {\n\n NONE: OUTCOME_NONE,\n EVIDENCE: OUTCOME_EVIDENCE,\n COMPLETE: OUTCOME_COMPLETE,\n RECOMMEND: OUTCOME_RECOMMEND,\n\n /**\n * Get all the outcomes.\n *\n * @return {Object} Indexed by outcome code, contains code and name.\n * @method getAll\n */\n getAll: function() {\n var self = this;\n return Str.get_strings([\n {key: 'competencyoutcome_none', component: 'tool_lp'},\n {key: 'competencyoutcome_evidence', component: 'tool_lp'},\n {key: 'competencyoutcome_recommend', component: 'tool_lp'},\n {key: 'competencyoutcome_complete', component: 'tool_lp'},\n ]).then(function(strings) {\n var outcomes = {};\n outcomes[self.NONE] = {code: self.NONE, name: strings[0]};\n outcomes[self.EVIDENCE] = {code: self.EVIDENCE, name: strings[1]};\n outcomes[self.RECOMMEND] = {code: self.RECOMMEND, name: strings[2]};\n outcomes[self.COMPLETE] = {code: self.COMPLETE, name: strings[3]};\n return outcomes;\n });\n },\n\n /**\n * Get the string for an outcome.\n *\n * @param {Number} id The outcome code.\n * @return {Promise} Resolved with the string.\n * @method getString\n */\n getString: function(id) {\n var self = this,\n all = self.getAll();\n\n return all.then(function(outcomes) {\n if (typeof outcomes[id] === 'undefined') {\n return $.Deferred().reject().promise();\n }\n return outcomes[id].name;\n });\n }\n };\n\n});\n"],"file":"competency_outcomes.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/competency_outcomes.js"],"names":["define","$","Str","NONE","EVIDENCE","COMPLETE","RECOMMEND","getAll","self","get_strings","key","component","then","strings","outcomes","code","name","getString","id","all","Deferred","reject","promise"],"mappings":"AAuBAA,OAAM,+BAAC,CAAC,QAAD,CACC,UADD,CAAD,CAEE,SAASC,CAAT,CAAYC,CAAZ,CAAiB,CAOrB,MAAO,CAEHC,IAAI,EAFD,CAGHC,QAAQ,EAHL,CAIHC,QAAQ,EAJL,CAKHC,SAAS,EALN,CAaHC,MAAM,CAAE,iBAAW,CACf,GAAIC,CAAAA,CAAI,CAAG,IAAX,CACA,MAAON,CAAAA,CAAG,CAACO,WAAJ,CAAgB,CACnB,CAACC,GAAG,CAAE,wBAAN,CAAgCC,SAAS,CAAE,SAA3C,CADmB,CAEnB,CAACD,GAAG,CAAE,4BAAN,CAAoCC,SAAS,CAAE,SAA/C,CAFmB,CAGnB,CAACD,GAAG,CAAE,6BAAN,CAAqCC,SAAS,CAAE,SAAhD,CAHmB,CAInB,CAACD,GAAG,CAAE,4BAAN,CAAoCC,SAAS,CAAE,SAA/C,CAJmB,CAAhB,EAKJC,IALI,CAKC,SAASC,CAAT,CAAkB,CACtB,GAAIC,CAAAA,CAAQ,CAAG,EAAf,CACAA,CAAQ,CAACN,CAAI,CAACL,IAAN,CAAR,CAAsB,CAACY,IAAI,CAAEP,CAAI,CAACL,IAAZ,CAAkBa,IAAI,CAAEH,CAAO,CAAC,CAAD,CAA/B,CAAtB,CACAC,CAAQ,CAACN,CAAI,CAACJ,QAAN,CAAR,CAA0B,CAACW,IAAI,CAAEP,CAAI,CAACJ,QAAZ,CAAsBY,IAAI,CAAEH,CAAO,CAAC,CAAD,CAAnC,CAA1B,CACAC,CAAQ,CAACN,CAAI,CAACF,SAAN,CAAR,CAA2B,CAACS,IAAI,CAAEP,CAAI,CAACF,SAAZ,CAAuBU,IAAI,CAAEH,CAAO,CAAC,CAAD,CAApC,CAA3B,CACAC,CAAQ,CAACN,CAAI,CAACH,QAAN,CAAR,CAA0B,CAACU,IAAI,CAAEP,CAAI,CAACH,QAAZ,CAAsBW,IAAI,CAAEH,CAAO,CAAC,CAAD,CAAnC,CAA1B,CACA,MAAOC,CAAAA,CACV,CAZM,CAaV,CA5BE,CAqCHG,SAAS,CAAE,mBAASC,CAAT,CAAa,CACpB,GAAIV,CAAAA,CAAI,CAAG,IAAX,CACIW,CAAG,CAAGX,CAAI,CAACD,MAAL,EADV,CAGA,MAAOY,CAAAA,CAAG,CAACP,IAAJ,CAAS,SAASE,CAAT,CAAmB,CAC/B,GAA4B,WAAxB,QAAOA,CAAAA,CAAQ,CAACI,CAAD,CAAnB,CAAyC,CACrC,MAAOjB,CAAAA,CAAC,CAACmB,QAAF,GAAaC,MAAb,GAAsBC,OAAtB,EACV,CACD,MAAOR,CAAAA,CAAQ,CAACI,CAAD,CAAR,CAAaF,IACvB,CALM,CAMV,CA/CE,CAiDV,CA1DK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency rule config.\n *\n * @module tool_lp/competency_outcomes\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/str'],\n function($, Str) {\n\n var OUTCOME_NONE = 0,\n OUTCOME_EVIDENCE = 1,\n OUTCOME_COMPLETE = 2,\n OUTCOME_RECOMMEND = 3;\n\n return {\n\n NONE: OUTCOME_NONE,\n EVIDENCE: OUTCOME_EVIDENCE,\n COMPLETE: OUTCOME_COMPLETE,\n RECOMMEND: OUTCOME_RECOMMEND,\n\n /**\n * Get all the outcomes.\n *\n * @return {Object} Indexed by outcome code, contains code and name.\n * @method getAll\n */\n getAll: function() {\n var self = this;\n return Str.get_strings([\n {key: 'competencyoutcome_none', component: 'tool_lp'},\n {key: 'competencyoutcome_evidence', component: 'tool_lp'},\n {key: 'competencyoutcome_recommend', component: 'tool_lp'},\n {key: 'competencyoutcome_complete', component: 'tool_lp'},\n ]).then(function(strings) {\n var outcomes = {};\n outcomes[self.NONE] = {code: self.NONE, name: strings[0]};\n outcomes[self.EVIDENCE] = {code: self.EVIDENCE, name: strings[1]};\n outcomes[self.RECOMMEND] = {code: self.RECOMMEND, name: strings[2]};\n outcomes[self.COMPLETE] = {code: self.COMPLETE, name: strings[3]};\n return outcomes;\n });\n },\n\n /**\n * Get the string for an outcome.\n *\n * @param {Number} id The outcome code.\n * @return {Promise} Resolved with the string.\n * @method getString\n */\n getString: function(id) {\n var self = this,\n all = self.getAll();\n\n return all.then(function(outcomes) {\n if (typeof outcomes[id] === 'undefined') {\n return $.Deferred().reject().promise();\n }\n return outcomes[id].name;\n });\n }\n };\n});\n"],"file":"competency_outcomes.min.js"} \ No newline at end of file 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 index 9047a303b225f..8b9c63dd49fd2 100644 --- a/admin/tool/lp/amd/build/competency_plan_navigation.min.js.map +++ b/admin/tool/lp/amd/build/competency_plan_navigation.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/competency_plan_navigation.js"],"names":["define","$","CompetencyPlanNavigation","competencySelector","baseUrl","userId","competencyId","planId","_baseUrl","_userId","_competencyId","_planId","_ignoreFirstCompetency","on","_competencyChanged","bind","prototype","e","newCompetencyId","target","val","queryStr","document","location"],"mappings":"AAsBAA,OAAM,sCAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAW3B,GAAIC,CAAAA,CAAwB,CAAG,SAASC,CAAT,CAA6BC,CAA7B,CAAsCC,CAAtC,CAA8CC,CAA9C,CAA4DC,CAA5D,CAAoE,CAC/F,KAAKC,QAAL,CAAgBJ,CAAhB,CACA,KAAKK,OAAL,CAAeJ,CAAM,CAAG,EAAxB,CACA,KAAKK,aAAL,CAAqBJ,CAAY,CAAG,EAApC,CACA,KAAKK,OAAL,CAAeJ,CAAf,CACA,KAAKK,sBAAL,IAEAX,CAAC,CAACE,CAAD,CAAD,CAAsBU,EAAtB,CAAyB,QAAzB,CAAmC,KAAKC,kBAAL,CAAwBC,IAAxB,CAA6B,IAA7B,CAAnC,CACH,CARD,CAgBAb,CAAwB,CAACc,SAAzB,CAAmCF,kBAAnC,CAAwD,SAASG,CAAT,CAAY,CAChE,GAAI,KAAKL,sBAAT,CAAiC,CAC7B,KAAKA,sBAAL,IACA,MACH,CAJ+D,GAK5DM,CAAAA,CAAe,CAAGjB,CAAC,CAACgB,CAAC,CAACE,MAAH,CAAD,CAAYC,GAAZ,EAL0C,CAM5DC,CAAQ,CAAG,WAAa,KAAKZ,OAAlB,CAA4B,UAA5B,CAAyC,KAAKE,OAA9C,CAAwD,gBAAxD,CAA2EO,CAN1B,CAOhEI,QAAQ,CAACC,QAAT,CAAoB,KAAKf,QAAL,CAAgBa,CACvC,CARD,CAWAnB,CAAwB,CAACc,SAAzB,CAAmCN,aAAnC,CAAmD,IAAnD,CAEAR,CAAwB,CAACc,SAAzB,CAAmCP,OAAnC,CAA6C,IAA7C,CAEAP,CAAwB,CAACc,SAAzB,CAAmCL,OAAnC,CAA6C,IAA7C,CAEAT,CAAwB,CAACc,SAAzB,CAAmCR,QAAnC,CAA8C,IAA9C,CAEAN,CAAwB,CAACc,SAAzB,CAAmCJ,sBAAnC,CAA4D,IAA5D,CAEA,MAA+DV,CAAAA,CAElE,CAlDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Event click on selecting competency in the competency autocomplete.\n *\n * @copyright 2016 Issam Taboubi \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n /**\n * CompetencyPlanNavigation\n *\n * @param {String} competencySelector The selector of the competency element.\n * @param {String} baseUrl The base url for the page (no params).\n * @param {Number} userId The user id\n * @param {Number} competencyId The competency id\n * @param {Number} planId The plan id\n */\n var CompetencyPlanNavigation = function(competencySelector, baseUrl, userId, competencyId, planId) {\n this._baseUrl = baseUrl;\n this._userId = userId + '';\n this._competencyId = competencyId + '';\n this._planId = planId;\n this._ignoreFirstCompetency = true;\n\n $(competencySelector).on('change', this._competencyChanged.bind(this));\n };\n\n /**\n * The competency was changed in the select list.\n *\n * @method _competencyChanged\n * @param {Event} e\n */\n CompetencyPlanNavigation.prototype._competencyChanged = function(e) {\n if (this._ignoreFirstCompetency) {\n this._ignoreFirstCompetency = false;\n return;\n }\n var newCompetencyId = $(e.target).val();\n var queryStr = '?userid=' + this._userId + '&planid=' + this._planId + '&competencyid=' + newCompetencyId;\n document.location = this._baseUrl + queryStr;\n };\n\n /** @property {Number} The id of the competency. */\n CompetencyPlanNavigation.prototype._competencyId = null;\n /** @property {Number} The id of the user. */\n CompetencyPlanNavigation.prototype._userId = null;\n /** @property {Number} The id of the plan. */\n CompetencyPlanNavigation.prototype._planId = null;\n /** @property {String} Plugin base url. */\n CompetencyPlanNavigation.prototype._baseUrl = null;\n /** @property {Boolean} Ignore the first change event for competencies. */\n CompetencyPlanNavigation.prototype._ignoreFirstCompetency = null;\n\n return /** @alias module:tool_lp/competency_plan_navigation */ CompetencyPlanNavigation;\n\n});\n"],"file":"competency_plan_navigation.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/competency_plan_navigation.js"],"names":["define","$","CompetencyPlanNavigation","competencySelector","baseUrl","userId","competencyId","planId","_baseUrl","_userId","_competencyId","_planId","_ignoreFirstCompetency","on","_competencyChanged","bind","prototype","e","newCompetencyId","target","val","queryStr","document","location"],"mappings":"AAuBAA,OAAM,sCAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAY3B,GAAIC,CAAAA,CAAwB,CAAG,SAASC,CAAT,CAA6BC,CAA7B,CAAsCC,CAAtC,CAA8CC,CAA9C,CAA4DC,CAA5D,CAAoE,CAC/F,KAAKC,QAAL,CAAgBJ,CAAhB,CACA,KAAKK,OAAL,CAAeJ,CAAM,CAAG,EAAxB,CACA,KAAKK,aAAL,CAAqBJ,CAAY,CAAG,EAApC,CACA,KAAKK,OAAL,CAAeJ,CAAf,CACA,KAAKK,sBAAL,IAEAX,CAAC,CAACE,CAAD,CAAD,CAAsBU,EAAtB,CAAyB,QAAzB,CAAmC,KAAKC,kBAAL,CAAwBC,IAAxB,CAA6B,IAA7B,CAAnC,CACH,CARD,CAgBAb,CAAwB,CAACc,SAAzB,CAAmCF,kBAAnC,CAAwD,SAASG,CAAT,CAAY,CAChE,GAAI,KAAKL,sBAAT,CAAiC,CAC7B,KAAKA,sBAAL,IACA,MACH,CAJ+D,GAK5DM,CAAAA,CAAe,CAAGjB,CAAC,CAACgB,CAAC,CAACE,MAAH,CAAD,CAAYC,GAAZ,EAL0C,CAM5DC,CAAQ,CAAG,WAAa,KAAKZ,OAAlB,CAA4B,UAA5B,CAAyC,KAAKE,OAA9C,CAAwD,gBAAxD,CAA2EO,CAN1B,CAOhEI,QAAQ,CAACC,QAAT,CAAoB,KAAKf,QAAL,CAAgBa,CACvC,CARD,CAWAnB,CAAwB,CAACc,SAAzB,CAAmCN,aAAnC,CAAmD,IAAnD,CAEAR,CAAwB,CAACc,SAAzB,CAAmCP,OAAnC,CAA6C,IAA7C,CAEAP,CAAwB,CAACc,SAAzB,CAAmCL,OAAnC,CAA6C,IAA7C,CAEAT,CAAwB,CAACc,SAAzB,CAAmCR,QAAnC,CAA8C,IAA9C,CAEAN,CAAwB,CAACc,SAAzB,CAAmCJ,sBAAnC,CAA4D,IAA5D,CAEA,MAAOV,CAAAA,CACV,CAlDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Event click on selecting competency in the competency autocomplete.\n *\n * @module tool_lp/competency_plan_navigation\n * @copyright 2016 Issam Taboubi \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n /**\n * CompetencyPlanNavigation\n *\n * @class\n * @param {String} competencySelector The selector of the competency element.\n * @param {String} baseUrl The base url for the page (no params).\n * @param {Number} userId The user id\n * @param {Number} competencyId The competency id\n * @param {Number} planId The plan id\n */\n var CompetencyPlanNavigation = function(competencySelector, baseUrl, userId, competencyId, planId) {\n this._baseUrl = baseUrl;\n this._userId = userId + '';\n this._competencyId = competencyId + '';\n this._planId = planId;\n this._ignoreFirstCompetency = true;\n\n $(competencySelector).on('change', this._competencyChanged.bind(this));\n };\n\n /**\n * The competency was changed in the select list.\n *\n * @method _competencyChanged\n * @param {Event} e\n */\n CompetencyPlanNavigation.prototype._competencyChanged = function(e) {\n if (this._ignoreFirstCompetency) {\n this._ignoreFirstCompetency = false;\n return;\n }\n var newCompetencyId = $(e.target).val();\n var queryStr = '?userid=' + this._userId + '&planid=' + this._planId + '&competencyid=' + newCompetencyId;\n document.location = this._baseUrl + queryStr;\n };\n\n /** @property {Number} The id of the competency. */\n CompetencyPlanNavigation.prototype._competencyId = null;\n /** @property {Number} The id of the user. */\n CompetencyPlanNavigation.prototype._userId = null;\n /** @property {Number} The id of the plan. */\n CompetencyPlanNavigation.prototype._planId = null;\n /** @property {String} Plugin base url. */\n CompetencyPlanNavigation.prototype._baseUrl = null;\n /** @property {Boolean} Ignore the first change event for competencies. */\n CompetencyPlanNavigation.prototype._ignoreFirstCompetency = null;\n\n return CompetencyPlanNavigation;\n});\n"],"file":"competency_plan_navigation.min.js"} \ No newline at end of file diff --git a/admin/tool/lp/amd/build/competency_rule.min.js.map b/admin/tool/lp/amd/build/competency_rule.min.js.map index b0ef27547b474..c3ec4debeb38f 100644 --- a/admin/tool/lp/amd/build/competency_rule.min.js.map +++ b/admin/tool/lp/amd/build/competency_rule.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/competency_rule.js"],"names":["define","$","Rule","tree","_eventNode","_ready","Deferred","_tree","prototype","_competency","canConfig","hasChildren","id","getConfig","getType","Error","init","_load","injectTemplate","reject","promise","isValid","when","on","type","handler","setTargetCompetency","competency","_trigger","data","trigger","_triggerChange"],"mappings":"AAsBAA,OAAM,2BAAC,CAAC,QAAD,CAAD,CA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KrB,UAAL,CAAgBmB,EAAhB,CAAmBC,CAAnB,CAAyBC,CAAzB,CACH,CAFD,CAUAvB,CAAI,CAACM,SAAL,CAAekB,mBAAf,CAAqC,SAASC,CAAT,CAAqB,CACtD,KAAKlB,WAAL,CAAmBkB,CACtB,CAFD,CAYAzB,CAAI,CAACM,SAAL,CAAeoB,QAAf,CAA0B,SAASJ,CAAT,CAAeK,CAAf,CAAqB,CAC3C,KAAKzB,UAAL,CAAgB0B,OAAhB,CAAwBN,CAAxB,CAA8B,CAACK,CAAD,CAA9B,CACH,CAFD,CAUA3B,CAAI,CAACM,SAAL,CAAeuB,cAAf,CAAgC,UAAW,CACvC,KAAKH,QAAL,CAAc,QAAd,CAAwB,IAAxB,CACH,CAFD,CAIA,MAAoD1B,CAAAA,CAEvD,CAxJK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency rule base module.\n *\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n /**\n * Competency rule abstract class.\n *\n * Any competency rule should extend this object. The event 'change' should be\n * triggered on the instance when the configuration has changed. This will allow\n * the components using the rule to gather the config, or check its validity.\n *\n * this._triggerChange();\n *\n * @param {Tree} tree The competency tree.\n */\n var Rule = function(tree) {\n this._eventNode = $('
');\n this._ready = $.Deferred();\n this._tree = tree;\n };\n\n /** @property {Object} The current competency. */\n Rule.prototype._competency = null;\n /** @property {Node} The node we attach the events to. */\n Rule.prototype._eventNode = null;\n /** @property {Promise} Resolved when the object is ready. */\n Rule.prototype._ready = null;\n /** @property {Tree} The competency tree. */\n Rule.prototype._tree = null;\n\n /**\n * Whether or not the current competency can be configured using this rule.\n *\n * @return {Boolean}\n * @method canConfig\n */\n Rule.prototype.canConfig = function() {\n return this._tree.hasChildren(this._competency.id);\n };\n\n /**\n * The config established by this rule.\n *\n * To override in subclasses when relevant.\n *\n * @return {String|null}\n * @method getConfig\n */\n Rule.prototype.getConfig = function() {\n return null;\n };\n\n // eslint-disable-next-line valid-jsdoc\n /**\n * Return the type of the module.\n *\n * @return {String}\n * @method getType\n */\n Rule.prototype.getType = function() {\n throw new Error('Not implemented');\n };\n\n /**\n * The init process.\n *\n * Do not override this, instead override _load.\n *\n * @return {Promise} Revoled when the plugin is initialised.\n * @method init\n */\n Rule.prototype.init = function() {\n return this._load();\n };\n\n /**\n * Callback to inject the template.\n *\n * @param {Node} container Node to inject in.\n * @return {Promise} Resolved when done.\n * @method injectTemplate\n */\n Rule.prototype.injectTemplate = function() {\n return $.Deferred().reject().promise();\n };\n\n /**\n * Whether or not the current config is valid.\n *\n * Plugins should override this.\n *\n * @return {Boolean}\n * @method _isValid\n */\n Rule.prototype.isValid = function() {\n return false;\n };\n\n /**\n * Load the class.\n *\n * @return {Promise}\n * @method _load\n * @protected\n */\n Rule.prototype._load = function() {\n return $.when();\n };\n\n /**\n * Register an event listener.\n *\n * @param {String} type The event type.\n * @param {Function} handler The event listener.\n * @method on\n */\n Rule.prototype.on = function(type, handler) {\n this._eventNode.on(type, handler);\n };\n\n /**\n * Sets the current competency.\n *\n * @param {Competency} competency\n * @method setTargetCompetency\n */\n Rule.prototype.setTargetCompetency = function(competency) {\n this._competency = competency;\n };\n\n /**\n * Trigger an event.\n *\n * @param {String} type The type of event.\n * @param {Object} data The data to pass to the listeners.\n * @method _trigger\n * @protected\n */\n Rule.prototype._trigger = function(type, data) {\n this._eventNode.trigger(type, [data]);\n };\n\n /**\n * Trigger the change event.\n *\n * @method _triggerChange\n * @protected\n */\n Rule.prototype._triggerChange = function() {\n this._trigger('change', this);\n };\n\n return /** @alias module:tool_lp/competency_rule */ Rule;\n\n});\n"],"file":"competency_rule.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/competency_rule.js"],"names":["define","$","Rule","tree","_eventNode","_ready","Deferred","_tree","prototype","_competency","canConfig","hasChildren","id","getConfig","getType","Error","init","_load","injectTemplate","reject","promise","isValid","when","on","type","handler","setTargetCompetency","competency","_trigger","data","trigger","_triggerChange"],"mappings":"AAuBAA,OAAM,2BAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAa3B,GAAIC,CAAAA,CAAI,CAAG,SAASC,CAAT,CAAe,CACtB,KAAKC,UAAL,CAAkBH,CAAC,CAAC,OAAD,CAAnB,CACA,KAAKI,MAAL,CAAcJ,CAAC,CAACK,QAAF,EAAd,CACA,KAAKC,KAAL,CAAaJ,CAChB,CAJD,CAOAD,CAAI,CAACM,SAAL,CAAeC,WAAf,CAA6B,IAA7B,CAEAP,CAAI,CAACM,SAAL,CAAeJ,UAAf,CAA4B,IAA5B,CAEAF,CAAI,CAACM,SAAL,CAAeH,MAAf,CAAwB,IAAxB,CAEAH,CAAI,CAACM,SAAL,CAAeD,KAAf,CAAuB,IAAvB,CAQAL,CAAI,CAACM,SAAL,CAAeE,SAAf,CAA2B,UAAW,CAClC,MAAO,MAAKH,KAAL,CAAWI,WAAX,CAAuB,KAAKF,WAAL,CAAiBG,EAAxC,CACV,CAFD,CAYAV,CAAI,CAACM,SAAL,CAAeK,SAAf,CAA2B,UAAW,CAClC,MAAO,KACV,CAFD,CAYAX,CAAI,CAACM,SAAL,CAAeM,OAAf,CAAyB,UAAW,CAChC,KAAM,IAAIC,CAAAA,KAAJ,CAAU,iBAAV,CACT,CAFD,CAYAb,CAAI,CAACM,SAAL,CAAeQ,IAAf,CAAsB,UAAW,CAC7B,MAAO,MAAKC,KAAL,EACV,CAFD,CAWAf,CAAI,CAACM,SAAL,CAAeU,cAAf,CAAgC,UAAW,CACvC,MAAOjB,CAAAA,CAAC,CAACK,QAAF,GAAaa,MAAb,GAAsBC,OAAtB,EACV,CAFD,CAYAlB,CAAI,CAACM,SAAL,CAAea,OAAf,CAAyB,UAAW,CAChC,QACH,CAFD,CAWAnB,CAAI,CAACM,SAAL,CAAeS,KAAf,CAAuB,UAAW,CAC9B,MAAOhB,CAAAA,CAAC,CAACqB,IAAF,EACV,CAFD,CAWApB,CAAI,CAACM,SAAL,CAAee,EAAf,CAAoB,SAASC,CAAT,CAAeC,CAAf,CAAwB,CACxC,KAAKrB,UAAL,CAAgBmB,EAAhB,CAAmBC,CAAnB,CAAyBC,CAAzB,CACH,CAFD,CAUAvB,CAAI,CAACM,SAAL,CAAekB,mBAAf,CAAqC,SAASC,CAAT,CAAqB,CACtD,KAAKlB,WAAL,CAAmBkB,CACtB,CAFD,CAYAzB,CAAI,CAACM,SAAL,CAAeoB,QAAf,CAA0B,SAASJ,CAAT,CAAeK,CAAf,CAAqB,CAC3C,KAAKzB,UAAL,CAAgB0B,OAAhB,CAAwBN,CAAxB,CAA8B,CAACK,CAAD,CAA9B,CACH,CAFD,CAUA3B,CAAI,CAACM,SAAL,CAAeuB,cAAf,CAAgC,UAAW,CACvC,KAAKH,QAAL,CAAc,QAAd,CAAwB,IAAxB,CACH,CAFD,CAIA,MAAoD1B,CAAAA,CAEvD,CAzJK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency rule base module.\n *\n * @module tool_lp/competencyrule\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n /**\n * Competency rule abstract class.\n *\n * Any competency rule should extend this object. The event 'change' should be\n * triggered on the instance when the configuration has changed. This will allow\n * the components using the rule to gather the config, or check its validity.\n *\n * this._triggerChange();\n *\n * @param {Tree} tree The competency tree.\n */\n var Rule = function(tree) {\n this._eventNode = $('
');\n this._ready = $.Deferred();\n this._tree = tree;\n };\n\n /** @property {Object} The current competency. */\n Rule.prototype._competency = null;\n /** @property {Node} The node we attach the events to. */\n Rule.prototype._eventNode = null;\n /** @property {Promise} Resolved when the object is ready. */\n Rule.prototype._ready = null;\n /** @property {Tree} The competency tree. */\n Rule.prototype._tree = null;\n\n /**\n * Whether or not the current competency can be configured using this rule.\n *\n * @return {Boolean}\n * @method canConfig\n */\n Rule.prototype.canConfig = function() {\n return this._tree.hasChildren(this._competency.id);\n };\n\n /**\n * The config established by this rule.\n *\n * To override in subclasses when relevant.\n *\n * @return {String|null}\n * @method getConfig\n */\n Rule.prototype.getConfig = function() {\n return null;\n };\n\n // eslint-disable-line valid-jsdoc\n /**\n * Return the type of the module.\n *\n * @return {String}\n * @method getType\n */\n // eslint-enable-line valid-jsdoc\n Rule.prototype.getType = function() {\n throw new Error('Not implemented');\n };\n\n /**\n * The init process.\n *\n * Do not override this, instead override _load.\n *\n * @return {Promise} Revoled when the plugin is initialised.\n * @method init\n */\n Rule.prototype.init = function() {\n return this._load();\n };\n\n /**\n * Callback to inject the template.\n *\n * @param {Node} container Node to inject in.\n * @return {Promise} Resolved when done.\n * @method injectTemplate\n */\n Rule.prototype.injectTemplate = function() {\n return $.Deferred().reject().promise();\n };\n\n /**\n * Whether or not the current config is valid.\n *\n * Plugins should override this.\n *\n * @return {Boolean}\n * @method _isValid\n */\n Rule.prototype.isValid = function() {\n return false;\n };\n\n /**\n * Load the class.\n *\n * @return {Promise}\n * @method _load\n * @protected\n */\n Rule.prototype._load = function() {\n return $.when();\n };\n\n /**\n * Register an event listener.\n *\n * @param {String} type The event type.\n * @param {Function} handler The event listener.\n * @method on\n */\n Rule.prototype.on = function(type, handler) {\n this._eventNode.on(type, handler);\n };\n\n /**\n * Sets the current competency.\n *\n * @param {Competency} competency\n * @method setTargetCompetency\n */\n Rule.prototype.setTargetCompetency = function(competency) {\n this._competency = competency;\n };\n\n /**\n * Trigger an event.\n *\n * @param {String} type The type of event.\n * @param {Object} data The data to pass to the listeners.\n * @method _trigger\n * @protected\n */\n Rule.prototype._trigger = function(type, data) {\n this._eventNode.trigger(type, [data]);\n };\n\n /**\n * Trigger the change event.\n *\n * @method _triggerChange\n * @protected\n */\n Rule.prototype._triggerChange = function() {\n this._trigger('change', this);\n };\n\n return /** @alias module:tool_lp/competency_rule */ Rule;\n\n});\n"],"file":"competency_rule.min.js"} \ No newline at end of file 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 index 330530d766823..9e6113d704c00 100644 --- a/admin/tool/lp/amd/build/competency_rule_all.min.js.map +++ b/admin/tool/lp/amd/build/competency_rule_all.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/competency_rule_all.js"],"names":["define","$","Str","RuleBase","Rule","apply","arguments","prototype","Object","create","getType","isValid"],"mappings":"AAsBAA,OAAM,+BAAC,CAAC,QAAD,CACC,UADD,CAEC,yBAFD,CAAD,CAIE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA2B,CAK/B,GAAIC,CAAAA,CAAI,CAAG,UAAW,CAClBD,CAAQ,CAACE,KAAT,CAAe,IAAf,CAAqBC,SAArB,CACH,CAFD,CAGAF,CAAI,CAACG,SAAL,CAAiBC,MAAM,CAACC,MAAP,CAAcN,CAAQ,CAACI,SAAvB,CAAjB,CAQAH,CAAI,CAACG,SAAL,CAAeG,OAAf,CAAyB,UAAW,CAChC,MAAO,sCACV,CAFD,CAUAN,CAAI,CAACG,SAAL,CAAeI,OAAf,CAAyB,UAAW,CAChC,QACH,CAFD,CAIA,MAAwDP,CAAAA,CAE3D,CApCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency rule all module.\n *\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/str',\n 'tool_lp/competency_rule',\n ],\n function($, Str, RuleBase) {\n\n /**\n * Competency rule all class.\n */\n var Rule = function() {\n RuleBase.apply(this, arguments);\n };\n Rule.prototype = Object.create(RuleBase.prototype);\n\n /**\n * Return the type of the module.\n *\n * @return {String}\n * @method getType\n */\n Rule.prototype.getType = function() {\n return 'core_competency\\\\competency_rule_all';\n };\n\n /**\n * Whether or not the current config is valid.\n *\n * @return {Boolean}\n * @method isValid\n */\n Rule.prototype.isValid = function() {\n return true;\n };\n\n return /** @alias module:tool_lp/competency_rule_all */ Rule;\n\n});\n"],"file":"competency_rule_all.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/competency_rule_all.js"],"names":["define","$","Str","RuleBase","Rule","apply","arguments","prototype","Object","create","getType","isValid"],"mappings":"AAuBAA,OAAM,+BAAC,CAAC,QAAD,CACC,UADD,CAEC,yBAFD,CAAD,CAIE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA2B,CAO/B,GAAIC,CAAAA,CAAI,CAAG,UAAW,CAClBD,CAAQ,CAACE,KAAT,CAAe,IAAf,CAAqBC,SAArB,CACH,CAFD,CAGAF,CAAI,CAACG,SAAL,CAAiBC,MAAM,CAACC,MAAP,CAAcN,CAAQ,CAACI,SAAvB,CAAjB,CAQAH,CAAI,CAACG,SAAL,CAAeG,OAAf,CAAyB,UAAW,CAChC,MAAO,sCACV,CAFD,CAUAN,CAAI,CAACG,SAAL,CAAeI,OAAf,CAAyB,UAAW,CAChC,QACH,CAFD,CAIA,MAAOP,CAAAA,CACV,CArCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency rule all module.\n *\n * @module tool_lp/competency_rule_all\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/str',\n 'tool_lp/competency_rule',\n ],\n function($, Str, RuleBase) {\n\n /**\n * Competency rule all class.\n *\n * @class tool_lp/competency_rule_all\n */\n var Rule = function() {\n RuleBase.apply(this, arguments);\n };\n Rule.prototype = Object.create(RuleBase.prototype);\n\n /**\n * Return the type of the module.\n *\n * @return {String}\n * @method getType\n */\n Rule.prototype.getType = function() {\n return 'core_competency\\\\competency_rule_all';\n };\n\n /**\n * Whether or not the current config is valid.\n *\n * @return {Boolean}\n * @method isValid\n */\n Rule.prototype.isValid = function() {\n return true;\n };\n\n return Rule;\n});\n"],"file":"competency_rule_all.min.js"} \ No newline at end of file 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 index 7c71ec866e7b8..0402a73f950d2 100644 --- a/admin/tool/lp/amd/build/competency_rule_points.min.js.map +++ b/admin/tool/lp/amd/build/competency_rule_points.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/competency_rule_points.js"],"names":["define","$","Str","Templates","RuleBase","Rule","apply","arguments","prototype","Object","create","_container","_templateLoaded","getConfig","JSON","stringify","base","points","_getRequiredPoints","competencies","_getCompetenciesConfig","find","each","node","id","data","parseInt","val","required","prop","push","getType","injectTemplate","container","self","children","_tree","getChildren","_competency","context","config","ruletype","parse","ruleconfig","e","requiredpoints","competency","index","child","shortname","comp","render","then","html","change","_triggerChange","isValid","max","valid"],"mappings":"AAsBAA,OAAM,kCAAC,CAAC,QAAD,CACC,UADD,CAEC,gBAFD,CAGC,yBAHD,CAAD,CAKE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA4BC,CAA5B,CAAsC,CAK1C,GAAIC,CAAAA,CAAI,CAAG,UAAW,CAClBD,CAAQ,CAACE,KAAT,CAAe,IAAf,CAAqBC,SAArB,CACH,CAFD,CAGAF,CAAI,CAACG,SAAL,CAAiBC,MAAM,CAACC,MAAP,CAAcN,CAAQ,CAACI,SAAvB,CAAjB,CAGAH,CAAI,CAACG,SAAL,CAAeG,UAAf,CAA4B,IAA5B,CAEAN,CAAI,CAACG,SAAL,CAAeI,eAAf,IAQAP,CAAI,CAACG,SAAL,CAAeK,SAAf,CAA2B,UAAW,CAClC,MAAOC,CAAAA,IAAI,CAACC,SAAL,CAAe,CAClBC,IAAI,CAAE,CACFC,MAAM,CAAE,KAAKC,kBAAL,EADN,CADY,CAIlBC,YAAY,CAAE,KAAKC,sBAAL,EAJI,CAAf,CAMV,CAPD,CAgBAf,CAAI,CAACG,SAAL,CAAeY,sBAAf,CAAwC,UAAW,CAC/C,GAAID,CAAAA,CAAY,CAAG,EAAnB,CAEA,KAAKR,UAAL,CAAgBU,IAAhB,CAAqB,mBAArB,EAA0CC,IAA1C,CAA+C,UAAW,CACtD,GAAIC,CAAAA,CAAI,CAAGtB,CAAC,CAAC,IAAD,CAAZ,C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ACqB,cAAL,EAEH,CAXM,CAYV,CA1DD,CAkEAlD,CAAI,CAACG,SAAL,CAAegD,OAAf,CAAyB,UAAW,CAChC,GAAI,CAAC,KAAK5C,eAAV,CAA2B,CACvB,QACH,CAED,GAAIgB,CAAAA,CAAQ,CAAG,KAAKV,kBAAL,EAAf,CACIuC,CAAG,CAAG,CADV,CAEIC,CAAK,GAFT,CAIAzD,CAAC,CAACqB,IAAF,CAAO,KAAKF,sBAAL,EAAP,CAAsC,SAAS2B,CAAT,CAAgBD,CAAhB,CAA4B,CAC9D,GAAwB,CAApB,CAAAA,CAAU,CAAC7B,MAAf,CAA2B,CACvByC,CAAK,GACR,CACDD,CAAG,EAAIX,CAAU,CAAC7B,MACrB,CALD,EAOAyC,CAAK,CAAGA,CAAK,EAAID,CAAG,EAAI7B,CAAxB,CACA,MAAO8B,CAAAA,CACV,CAlBD,CAoBA,MAAwDrD,CAAAA,CAE3D,CAjLK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency rule points module.\n *\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/str',\n 'core/templates',\n 'tool_lp/competency_rule',\n ],\n function($, Str, Templates, RuleBase) {\n\n /**\n * Competency rule points class.\n */\n var Rule = function() {\n RuleBase.apply(this, arguments);\n };\n Rule.prototype = Object.create(RuleBase.prototype);\n\n /** @property {Node} Reference to the container in which the template was included. */\n Rule.prototype._container = null;\n /** @property {Boolean} Whether or not the template was included. */\n Rule.prototype._templateLoaded = false;\n\n /**\n * The config established by this rule.\n *\n * @return {String}\n * @method getConfig\n */\n Rule.prototype.getConfig = function() {\n return JSON.stringify({\n base: {\n points: this._getRequiredPoints(),\n },\n competencies: this._getCompetenciesConfig()\n });\n };\n\n /**\n * Gathers the input provided by the user for competencies.\n *\n * @return {Array} Containing id, points and required.\n * @method _getCompetenciesConfig\n * @protected\n */\n Rule.prototype._getCompetenciesConfig = function() {\n var competencies = [];\n\n this._container.find('[data-competency]').each(function() {\n var node = $(this),\n id = node.data('competency'),\n points = parseInt(node.find('[name=\"points\"]').val(), 10),\n required = node.find('[name=\"required\"]').prop('checked');\n\n competencies.push({\n id: id,\n points: points,\n required: required ? 1 : 0\n });\n });\n\n return competencies;\n };\n\n /**\n * Fetches the required points set by the user.\n *\n * @return {Number}\n * @method _getRequiredPoints\n * @protected\n */\n Rule.prototype._getRequiredPoints = function() {\n return parseInt(this._container.find('[name=\"requiredpoints\"]').val() || 1, 10);\n };\n\n /**\n * Return the type of the module.\n *\n * @return {String}\n * @method getType\n */\n Rule.prototype.getType = function() {\n return 'core_competency\\\\competency_rule_points';\n };\n\n /**\n * Callback to inject the template.\n *\n * @param {Node} container Node to inject in.\n * @return {Promise} Resolved when done.\n * @method injectTemplate\n */\n Rule.prototype.injectTemplate = function(container) {\n var self = this,\n children = this._tree.getChildren(this._competency.id),\n context,\n config = {\n base: {points: 2},\n competencies: []\n };\n\n this._templateLoaded = false;\n\n // Only pre-load the configuration when the competency is using this rule.\n if (self._competency.ruletype == self.getType()) {\n try {\n config = JSON.parse(self._competency.ruleconfig);\n } catch (e) {\n // eslint-disable-line no-empty\n }\n }\n\n context = {\n requiredpoints: (config && config.base) ? config.base.points : 2,\n competency: self._competency,\n children: []\n };\n\n $.each(children, function(index, child) {\n var competency = {\n id: child.id,\n shortname: child.shortname,\n required: false,\n points: 0\n };\n\n if (config) {\n $.each(config.competencies, function(index, comp) {\n if (comp.id == competency.id) {\n competency.required = comp.required ? true : false;\n competency.points = comp.points;\n }\n });\n }\n\n context.children.push(competency);\n });\n\n return Templates.render('tool_lp/competency_rule_points', context).then(function(html) {\n self._container = container;\n container.html(html);\n container.find('input').change(function() {\n self._triggerChange();\n });\n\n // We're done, let's trigger a change.\n self._templateLoaded = true;\n self._triggerChange();\n return;\n });\n };\n\n /**\n * Whether or not the current config is valid.\n *\n * @return {Boolean}\n * @method isValid\n */\n Rule.prototype.isValid = function() {\n if (!this._templateLoaded) {\n return false;\n }\n\n var required = this._getRequiredPoints(),\n max = 0,\n valid = true;\n\n $.each(this._getCompetenciesConfig(), function(index, competency) {\n if (competency.points < 0) {\n valid = false;\n }\n max += competency.points;\n });\n\n valid = valid && max >= required;\n return valid;\n };\n\n return /** @alias module:tool_lp/competency_rule_all */ Rule;\n\n});\n"],"file":"competency_rule_points.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/competency_rule_points.js"],"names":["define","$","Str","Templates","RuleBase","Rule","apply","arguments","prototype","Object","create","_container","_templateLoaded","getConfig","JSON","stringify","base","points","_getRequiredPoints","competencies","_getCompetenciesConfig","find","each","node","id","data","parseInt","val","required","prop","push","getType","injectTemplate","container","self","children","_tree","getChildren","_competency","context","config","ruletype","parse","ruleconfig","e","requiredpoints","competency","index","child","shortname","comp","render","then","html","change","_triggerChange","isValid","max","valid"],"mappings":"AAuBAA,OAAM,kCAAC,CAAC,QAAD,CACC,UADD,CAEC,gBAFD,CAGC,yBAHD,CAAD,CAKE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA4BC,CAA5B,CAAsC,CAK1C,GAAIC,CAAAA,CAAI,CAAG,UAAW,CAClBD,CAAQ,CAACE,KAAT,CAAe,IAAf,CAAqBC,SAArB,CACH,CAFD,CAGAF,CAAI,CAACG,SAAL,CAAiBC,MAAM,CAACC,MAAP,CAAcN,CAAQ,CAACI,SAAvB,CAAjB,CAGAH,CAAI,CAACG,SAAL,CAAeG,UAAf,CAA4B,IAA5B,CAEAN,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,CAAC7B,MAAX,CAAoBiC,CAAI,CAACjC,MAC5B,CACJ,CALD,CAMH,CAEDsB,CAAO,CAACJ,QAAR,CAAiBL,IAAjB,CAAsBgB,CAAtB,CACH,CAlBD,EAoBA,MAAO3C,CAAAA,CAAS,CAACgD,MAAV,CAAiB,gCAAjB,CAAmDZ,CAAnD,EAA4Da,IAA5D,CAAiE,SAASC,CAAT,CAAe,CACnFnB,CAAI,CAACvB,UAAL,CAAkBsB,CAAlB,CACAA,CAAS,CAACoB,IAAV,CAAeA,CAAf,EACApB,CAAS,CAACZ,IAAV,CAAe,OAAf,EAAwBiC,MAAxB,CAA+B,UAAW,CACtCpB,CAAI,CAACqB,cAAL,EACH,CAFD,EAKArB,CAAI,CAACtB,eAAL,IACAsB,CAAI,CAACqB,cAAL,EAEH,CAXM,CAYV,CA1DD,CAkEAlD,CAAI,CAACG,SAAL,CAAegD,OAAf,CAAyB,UAAW,CAChC,GAAI,CAAC,KAAK5C,eAAV,CAA2B,CACvB,QACH,CAED,GAAIgB,CAAAA,CAAQ,CAAG,KAAKV,kBAAL,EAAf,CACIuC,CAAG,CAAG,CADV,CAEIC,CAAK,GAFT,CAIAzD,CAAC,CAACqB,IAAF,CAAO,KAAKF,sBAAL,EAAP,CAAsC,SAAS2B,CAAT,CAAgBD,CAAhB,CAA4B,CAC9D,GAAwB,CAApB,CAAAA,CAAU,CAAC7B,MAAf,CAA2B,CACvByC,CAAK,GACR,CACDD,CAAG,EAAIX,CAAU,CAAC7B,MACrB,CALD,EAOAyC,CAAK,CAAGA,CAAK,EAAID,CAAG,EAAI7B,CAAxB,CACA,MAAO8B,CAAAA,CACV,CAlBD,CAoBA,MAAOrD,CAAAA,CACV,CAhLK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency rule points module.\n *\n * @module tool_lp/competency_rule_all\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/str',\n 'core/templates',\n 'tool_lp/competency_rule',\n ],\n function($, Str, Templates, RuleBase) {\n\n /**\n * Competency rule points class.\n */\n var Rule = function() {\n RuleBase.apply(this, arguments);\n };\n Rule.prototype = Object.create(RuleBase.prototype);\n\n /** @property {Node} Reference to the container in which the template was included. */\n Rule.prototype._container = null;\n /** @property {Boolean} Whether or not the template was included. */\n Rule.prototype._templateLoaded = false;\n\n /**\n * The config established by this rule.\n *\n * @return {String}\n * @method getConfig\n */\n Rule.prototype.getConfig = function() {\n return JSON.stringify({\n base: {\n points: this._getRequiredPoints(),\n },\n competencies: this._getCompetenciesConfig()\n });\n };\n\n /**\n * Gathers the input provided by the user for competencies.\n *\n * @return {Array} Containing id, points and required.\n * @method _getCompetenciesConfig\n * @protected\n */\n Rule.prototype._getCompetenciesConfig = function() {\n var competencies = [];\n\n this._container.find('[data-competency]').each(function() {\n var node = $(this),\n id = node.data('competency'),\n points = parseInt(node.find('[name=\"points\"]').val(), 10),\n required = node.find('[name=\"required\"]').prop('checked');\n\n competencies.push({\n id: id,\n points: points,\n required: required ? 1 : 0\n });\n });\n\n return competencies;\n };\n\n /**\n * Fetches the required points set by the user.\n *\n * @return {Number}\n * @method _getRequiredPoints\n * @protected\n */\n Rule.prototype._getRequiredPoints = function() {\n return parseInt(this._container.find('[name=\"requiredpoints\"]').val() || 1, 10);\n };\n\n /**\n * Return the type of the module.\n *\n * @return {String}\n * @method getType\n */\n Rule.prototype.getType = function() {\n return 'core_competency\\\\competency_rule_points';\n };\n\n /**\n * Callback to inject the template.\n *\n * @param {Node} container Node to inject in.\n * @return {Promise} Resolved when done.\n * @method injectTemplate\n */\n Rule.prototype.injectTemplate = function(container) {\n var self = this,\n children = this._tree.getChildren(this._competency.id),\n context,\n config = {\n base: {points: 2},\n competencies: []\n };\n\n this._templateLoaded = false;\n\n // Only pre-load the configuration when the competency is using this rule.\n if (self._competency.ruletype == self.getType()) {\n try {\n config = JSON.parse(self._competency.ruleconfig);\n } catch (e) {\n // eslint-disable-line no-empty\n }\n }\n\n context = {\n requiredpoints: (config && config.base) ? config.base.points : 2,\n competency: self._competency,\n children: []\n };\n\n $.each(children, function(index, child) {\n var competency = {\n id: child.id,\n shortname: child.shortname,\n required: false,\n points: 0\n };\n\n if (config) {\n $.each(config.competencies, function(index, comp) {\n if (comp.id == competency.id) {\n competency.required = comp.required ? true : false;\n competency.points = comp.points;\n }\n });\n }\n\n context.children.push(competency);\n });\n\n return Templates.render('tool_lp/competency_rule_points', context).then(function(html) {\n self._container = container;\n container.html(html);\n container.find('input').change(function() {\n self._triggerChange();\n });\n\n // We're done, let's trigger a change.\n self._templateLoaded = true;\n self._triggerChange();\n return;\n });\n };\n\n /**\n * Whether or not the current config is valid.\n *\n * @return {Boolean}\n * @method isValid\n */\n Rule.prototype.isValid = function() {\n if (!this._templateLoaded) {\n return false;\n }\n\n var required = this._getRequiredPoints(),\n max = 0,\n valid = true;\n\n $.each(this._getCompetenciesConfig(), function(index, competency) {\n if (competency.points < 0) {\n valid = false;\n }\n max += competency.points;\n });\n\n valid = valid && max >= required;\n return valid;\n };\n\n return Rule;\n});\n"],"file":"competency_rule_points.min.js"} \ No newline at end of file diff --git a/admin/tool/lp/amd/build/competencypicker.min.js.map b/admin/tool/lp/amd/build/competencypicker.min.js.map index fd6df4a9cb8be..24af47b42323a 100644 --- a/admin/tool/lp/amd/build/competencypicker.min.js.map +++ b/admin/tool/lp/amd/build/competencypicker.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/competencypicker.js"],"names":["define","$","Notification","Ajax","Templates","Dialogue","Str","Tree","Pending","Picker","pageContextId","singleFramework","pageContextIncludes","multiSelect","self","_eventNode","_frameworks","_reset","_pageContextId","_pageContextIncludes","_multiSelect","_frameworkId","_singleFramework","prototype","_competencies","_disallowedCompetencyIDs","_popup","_searchText","_selectedCompetencies","_onlyVisible","_afterRender","tree","_find","show","on","evt","params","selected","preventDefault","validIds","each","index","item","compId","data","valid","i","id","push","length","attr","removeAttr","change","e","target","val","_loadCompetencies","then","_refresh","bind","catch","exception","click","always","close","pendingPromise","_trigger","competencyIds","competencyId","resolve","currentItems","slice","node","toggleItem","updateFocus","display","when","get_string","_render","title","render","_fetchCompetencies","frameworkId","searchText","call","methodname","args","searchtext","competencyframeworkid","done","competencies","addCompetencyChildren","parent","parentid","haschildren","children","comp","fail","selector","getContent","find","_getFramework","fid","frm","f","_loadFrameworks","promise","framework","sort","context","contextid","includes","onlyvisible","frameworks","type","handler","_preRender","html","replaceWith","search","setDisallowedCompetencyIDs","ids","trigger"],"mappings":"AA0BAA,OAAM,4BAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,gBAHD,CAIC,kBAJD,CAKC,UALD,CAMC,cAND,CAOC,cAPD,CAAD,CASE,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAqDC,CAArD,CAA0DC,CAA1D,CAAgEC,CAAhE,CAAyE,CAS7E,GAAIC,CAAAA,CAAM,CAAG,SAASC,CAAT,CAAwBC,CAAxB,CAAyCC,CAAzC,CAA8DC,CAA9D,CAA2E,CACpF,GAAIC,CAAAA,CAAI,CAAG,IAAX,CACAA,CAAI,CAACC,UAAL,CAAkBd,CAAC,CAAC,aAAD,CAAnB,CACAa,CAAI,CAACE,WAAL,CAAmB,EAAnB,CACAF,CAAI,CAACG,MAAL,GAEAH,CAAI,CAACI,cAAL,CAAsBR,CAAtB,CACAI,CAAI,CAACK,oBAAL,CAA4BP,CAAmB,EAAI,UA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C4E,MAAV,CAAiB,2BAAjB,CAA8C6B,CAA9C,CACV,CArBM,CAsBV,CAxBD,CAiCApG,CAAM,CAACc,SAAP,CAAiBN,MAAjB,CAA0B,UAAW,CACjC,KAAKO,aAAL,CAAqB,EAArB,CACA,KAAKC,wBAAL,CAAgC,EAAhC,CACA,KAAKC,MAAL,CAAc,IAAd,CACA,KAAKC,WAAL,CAAmB,EAAnB,CACA,KAAKC,qBAAL,CAA6B,EAChC,CAND,CAgBAnB,CAAM,CAACc,SAAP,CAAiBiG,0BAAjB,CAA8C,SAASC,CAAT,CAAc,CACxD,KAAKhG,wBAAL,CAAgCgG,CACnC,CAFD,CAWAhH,CAAM,CAACc,SAAP,CAAiB2C,QAAjB,CAA4B,SAASgD,CAAT,CAAetE,CAAf,CAAqB,CAC7C,KAAK7B,UAAL,CAAgB2G,OAAhB,CAAwBR,CAAxB,CAA8B,CAACtE,CAAD,CAA9B,CACH,CAFD,CAIA,MAAqDnC,CAAAA,CAExD,CA7bK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency picker.\n *\n * To handle 'save' events use: picker.on('save')\n * This will receive a object with either a single 'competencyId', or an array in 'competencyIds'\n * depending on the value of multiSelect.\n *\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/templates',\n 'tool_lp/dialogue',\n 'core/str',\n 'tool_lp/tree',\n 'core/pending'\n ],\n function($, Notification, Ajax, Templates, Dialogue, Str, Tree, Pending) {\n\n /**\n * Competency picker class.\n * @param {Number} pageContextId The page context ID.\n * @param {Number|false} singleFramework The ID of the framework when limited to one.\n * @param {String} pageContextIncludes One of 'children', 'parents', 'self'.\n * @param {Boolean} multiSelect Support multi-select in the tree.\n */\n var Picker = function(pageContextId, singleFramework, pageContextIncludes, multiSelect) {\n var self = this;\n self._eventNode = $('
');\n self._frameworks = [];\n self._reset();\n\n self._pageContextId = pageContextId;\n self._pageContextIncludes = pageContextIncludes || 'children';\n self._multiSelect = (typeof multiSelect === 'undefined' || multiSelect === true);\n if (singleFramework) {\n self._frameworkId = singleFramework;\n self._singleFramework = true;\n }\n };\n\n /** @property {Array} The competencies fetched. */\n Picker.prototype._competencies = null;\n /** @property {Array} The competencies that cannot be picked. */\n Picker.prototype._disallowedCompetencyIDs = null;\n /** @property {Node} The node we attach the events to. */\n Picker.prototype._eventNode = null;\n /** @property {Array} The list of frameworks fetched. */\n Picker.prototype._frameworks = null;\n /** @property {Number} The current framework ID. */\n Picker.prototype._frameworkId = null;\n /** @property {Number} The page context ID. */\n Picker.prototype._pageContextId = null;\n /** @property {Number} Relevant contexts inclusion. */\n Picker.prototype._pageContextIncludes = null;\n /** @property {Dialogue} The reference to the dialogue. */\n Picker.prototype._popup = null;\n /** @property {String} The string we filter the competencies with. */\n Picker.prototype._searchText = '';\n /** @property {Object} The competency that was selected. */\n Picker.prototype._selectedCompetencies = null;\n /** @property {Boolean} Whether we can browse frameworks or not. */\n Picker.prototype._singleFramework = false;\n /** @property {Boolean} Do we allow multi select? */\n Picker.prototype._multiSelect = true;\n /** @property {Boolean} Do we allow to display hidden framework? */\n Picker.prototype._onlyVisible = true;\n\n /**\n * Hook to executed after the view is rendered.\n *\n * @method _afterRender\n */\n Picker.prototype._afterRender = function() {\n var self = this;\n\n // Initialise the tree.\n var tree = new Tree(self._find('[data-enhance=linktree]'), self._multiSelect);\n\n // To prevent jiggling we only show the tree after it is enhanced.\n self._find('[data-enhance=linktree]').show();\n\n tree.on('selectionchanged', function(evt, params) {\n var selected = params.selected;\n evt.preventDefault();\n var validIds = [];\n $.each(selected, function(index, item) {\n var compId = $(item).data('id'),\n valid = true;\n\n if (typeof compId === 'undefined') {\n // Do not allow picking nodes with no id.\n valid = false;\n } else {\n $.each(self._disallowedCompetencyIDs, function(i, id) {\n if (id == compId) {\n valid = false;\n }\n });\n }\n if (valid) {\n validIds.push(compId);\n }\n });\n\n self._selectedCompetencies = validIds;\n\n // TODO Implement disabling of nodes in the tree module somehow.\n if (!self._selectedCompetencies.length) {\n self._find('[data-region=\"competencylinktree\"] [data-action=\"add\"]').attr('disabled', 'disabled');\n } else {\n self._find('[data-region=\"competencylinktree\"] [data-action=\"add\"]').removeAttr('disabled');\n }\n });\n\n // Add listener for framework change.\n if (!self._singleFramework) {\n self._find('[data-action=\"chooseframework\"]').change(function(e) {\n self._frameworkId = $(e.target).val();\n self._loadCompetencies().then(self._refresh.bind(self)).catch(Notification.exception);\n });\n }\n\n // Add listener for search.\n self._find('[data-region=\"filtercompetencies\"] button').click(function(e) {\n e.preventDefault();\n $(e.target).attr('disabled', 'disabled');\n self._searchText = self._find('[data-region=\"filtercompetencies\"] input').val() || '';\n return self._refresh().always(function() {\n $(e.target).removeAttr('disabled');\n });\n });\n\n // Add listener for cancel.\n self._find('[data-region=\"competencylinktree\"] [data-action=\"cancel\"]').click(function(e) {\n e.preventDefault();\n self.close();\n });\n\n // Add listener for add.\n self._find('[data-region=\"competencylinktree\"] [data-action=\"add\"]').click(function(e) {\n e.preventDefault();\n var pendingPromise = new Pending();\n if (!self._selectedCompetencies.length) {\n return;\n }\n\n if (self._multiSelect) {\n self._trigger('save', {competencyIds: self._selectedCompetencies});\n } else {\n // We checked above that the array has at least one value.\n self._trigger('save', {competencyId: self._selectedCompetencies[0]});\n }\n\n // The dialogue here is a YUI dialogue and doesn't support Promises at all.\n // However, it is typically synchronous so this shoudl suffice.\n self.close();\n pendingPromise.resolve();\n });\n\n // The list of selected competencies will be modified while looping (because of the listeners above).\n var currentItems = self._selectedCompetencies.slice(0);\n\n $.each(currentItems, function(index, id) {\n var node = self._find('[data-id=' + id + ']');\n if (node.length) {\n tree.toggleItem(node);\n tree.updateFocus(node);\n }\n });\n\n };\n\n /**\n * Close the dialogue.\n *\n * @method close\n */\n Picker.prototype.close = function() {\n var self = this;\n self._popup.close();\n self._reset();\n };\n\n /**\n * Opens the picker.\n *\n * @method display\n * @return {Promise}\n */\n Picker.prototype.display = function() {\n var self = this;\n return $.when(Str.get_string('competencypicker', 'tool_lp'), self._render())\n .then(function(title, render) {\n self._popup = new Dialogue(\n title,\n render[0],\n self._afterRender.bind(self)\n );\n return;\n }).catch(Notification.exception);\n };\n\n /**\n * Fetch the competencies.\n *\n * @param {Number} frameworkId The frameworkId.\n * @param {String} searchText Limit the competencies to those matching the text.\n * @method _fetchCompetencies\n * @return {Promise}\n */\n Picker.prototype._fetchCompetencies = function(frameworkId, searchText) {\n var self = this;\n\n return Ajax.call([\n {methodname: 'core_competency_search_competencies', args: {\n searchtext: searchText,\n competencyframeworkid: frameworkId\n }}\n ])[0].done(function(competencies) {\n /**\n * @param {Object} parent\n * @param {Array} competencies\n */\n function addCompetencyChildren(parent, competencies) {\n for (var i = 0; i < competencies.length; i++) {\n if (competencies[i].parentid == parent.id) {\n parent.haschildren = true;\n competencies[i].children = [];\n competencies[i].haschildren = false;\n parent.children[parent.children.length] = competencies[i];\n addCompetencyChildren(competencies[i], competencies);\n }\n }\n }\n\n // Expand the list of competencies into a tree.\n var i, comp;\n var tree = [];\n for (i = 0; i < competencies.length; i++) {\n comp = competencies[i];\n if (comp.parentid == \"0\") { // Loose check for now, because WS returns a string.\n comp.children = [];\n comp.haschildren = 0;\n tree[tree.length] = comp;\n addCompetencyChildren(comp, competencies);\n }\n }\n\n self._competencies = tree;\n\n }).fail(Notification.exception);\n };\n\n /**\n * Find a node in the dialogue.\n *\n * @param {String} selector\n * @return {JQuery}\n * @method _find\n */\n Picker.prototype._find = function(selector) {\n return $(this._popup.getContent()).find(selector);\n };\n\n /**\n * Convenience method to get a framework object.\n *\n * @param {Number} fid The framework ID.\n * @return {Object}\n * @method _getFramework\n */\n Picker.prototype._getFramework = function(fid) {\n var frm;\n $.each(this._frameworks, function(i, f) {\n if (f.id == fid) {\n frm = f;\n return;\n }\n });\n return frm;\n };\n\n /**\n * Load the competencies.\n *\n * @method _loadCompetencies\n * @return {Promise}\n */\n Picker.prototype._loadCompetencies = function() {\n return this._fetchCompetencies(this._frameworkId, this._searchText);\n };\n\n /**\n * Load the frameworks.\n *\n * @method _loadFrameworks\n * @return {Promise}\n */\n Picker.prototype._loadFrameworks = function() {\n var promise,\n self = this;\n\n // Quit early because we already have the data.\n if (self._frameworks.length > 0) {\n return $.when();\n }\n\n if (self._singleFramework) {\n promise = Ajax.call([\n {methodname: 'core_competency_read_competency_framework', args: {\n id: this._frameworkId\n }}\n ])[0].then(function(framework) {\n return [framework];\n });\n } else {\n promise = Ajax.call([\n {methodname: 'core_competency_list_competency_frameworks', args: {\n sort: 'shortname',\n context: {contextid: self._pageContextId},\n includes: self._pageContextIncludes,\n onlyvisible: self._onlyVisible\n }}\n ])[0];\n }\n\n return promise.done(function(frameworks) {\n self._frameworks = frameworks;\n }).fail(Notification.exception);\n };\n\n /**\n * Register an event listener.\n *\n * @param {String} type The event type.\n * @param {Function} handler The event listener.\n * @method on\n */\n Picker.prototype.on = function(type, handler) {\n this._eventNode.on(type, handler);\n };\n\n /**\n * Hook to executed before render.\n *\n * @method _preRender\n * @return {Promise}\n */\n Picker.prototype._preRender = function() {\n var self = this;\n return self._loadFrameworks().then(function() {\n if (!self._frameworkId && self._frameworks.length > 0) {\n self._frameworkId = self._frameworks[0].id;\n }\n\n // We could not set a framework ID, that probably means there are no frameworks accessible.\n if (!self._frameworkId) {\n self._frameworks = [];\n return $.when();\n }\n\n return self._loadCompetencies();\n });\n };\n\n /**\n * Refresh the view.\n *\n * @method _refresh\n * @return {Promise}\n */\n Picker.prototype._refresh = function() {\n var self = this;\n return self._render().then(function(html) {\n self._find('[data-region=\"competencylinktree\"]').replaceWith(html);\n self._afterRender();\n return;\n });\n };\n\n /**\n * Render the dialogue.\n *\n * @method _render\n * @return {Promise}\n */\n Picker.prototype._render = function() {\n var self = this;\n return self._preRender().then(function() {\n\n if (!self._singleFramework) {\n $.each(self._frameworks, function(i, framework) {\n if (framework.id == self._frameworkId) {\n framework.selected = true;\n } else {\n framework.selected = false;\n }\n });\n }\n\n var context = {\n competencies: self._competencies,\n framework: self._getFramework(self._frameworkId),\n frameworks: self._frameworks,\n search: self._searchText,\n singleFramework: self._singleFramework,\n };\n\n return Templates.render('tool_lp/competency_picker', context);\n });\n };\n\n /**\n * Reset the dialogue properties.\n *\n * This does not reset everything, just enough to reset the UI.\n *\n * @method _reset\n */\n Picker.prototype._reset = function() {\n this._competencies = [];\n this._disallowedCompetencyIDs = [];\n this._popup = null;\n this._searchText = '';\n this._selectedCompetencies = [];\n };\n\n /**\n * Set what competencies cannot be picked.\n *\n * This needs to be set after reset/close.\n *\n * @param {Number[]} ids The IDs.\n * @method _setDisallowedCompetencyIDs\n */\n Picker.prototype.setDisallowedCompetencyIDs = function(ids) {\n this._disallowedCompetencyIDs = ids;\n };\n\n /**\n * Trigger an event.\n *\n * @param {String} type The type of event.\n * @param {Object} data The data to pass to the listeners.\n * @method _reset\n */\n Picker.prototype._trigger = function(type, data) {\n this._eventNode.trigger(type, [data]);\n };\n\n return /** @alias module:tool_lp/competencypicker */ Picker;\n\n});\n"],"file":"competencypicker.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/competencypicker.js"],"names":["define","$","Notification","Ajax","Templates","Dialogue","Str","Tree","Pending","Picker","pageContextId","singleFramework","pageContextIncludes","multiSelect","self","_eventNode","_frameworks","_reset","_pageContextId","_pageContextIncludes","_multiSelect","_frameworkId","_singleFramework","prototype","_competencies","_disallowedCompetencyIDs","_popup","_searchText","_selectedCompetencies","_onlyVisible","_afterRender","tree","_find","show","on","evt","params","selected","preventDefault","validIds","each","index","item","compId","data","valid","i","id","push","length","attr","removeAttr","change","e","target","val","_loadCompetencies","then","_refresh","bind","catch","exception","click","always","close","pendingPromise","_trigger","competencyIds","competencyId","resolve","currentItems","slice","node","toggleItem","updateFocus","display","when","get_string","_render","title","render","_fetchCompetencies","frameworkId","searchText","call","methodname","args","searchtext","competencyframeworkid","done","competencies","addCompetencyChildren","parent","parentid","haschildren","children","comp","fail","selector","getContent","find","_getFramework","fid","frm","f","_loadFrameworks","promise","framework","sort","context","contextid","includes","onlyvisible","frameworks","type","handler","_preRender","html","replaceWith","search","setDisallowedCompetencyIDs","ids","trigger"],"mappings":"AA2BAA,OAAM,4BAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,gBAHD,CAIC,kBAJD,CAKC,UALD,CAMC,cAND,CAOC,cAPD,CAAD,CASE,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAqDC,CAArD,CAA0DC,CAA1D,CAAgEC,CAAhE,CAAyE,CAS7E,GAAIC,CAAAA,CAAM,CAAG,SAASC,CAAT,CAAwBC,CAAxB,CAAyCC,CAAzC,CAA8DC,CAA9D,CAA2E,CACpF,GAAIC,CAAAA,CAAI,CAAG,IAAX,CACAA,CAAI,CAACC,UAAL,CAAkBd,CAAC,CAAC,aAAD,CAAnB,CACAa,CAAI,CAACE,WAAL,CAAmB,EAAnB,CACAF,CAAI,CAACG,MAAL,GAEAH,CAAI,CAACI,cAAL,CAAsBR,CAAtB,CACAI,CAAI,CAACK,oBAAL,CAA4BP,CAAmB,EAAI,UAAnD,CACAE,CAAI,CAACM,YAAL,CAA4C,WAAvB,QAAOP,CAAAA,CAAP,EAAsC,KAAAA,CAA3D,CACA,GAAIF,CAAJ,CAAqB,CACjBG,CAAI,CAACO,YAAL,CAAoBV,CAApB,CACAG,CAAI,CAACQ,gBAAL,GACH,CACJ,CAbD,CAgBAb,CAAM,CAACc,SAA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,CACA,KAAKC,WAAL,CAAmB,EAAnB,CACA,KAAKC,qBAAL,CAA6B,EAChC,CAND,CAgBAnB,CAAM,CAACc,SAAP,CAAiBiG,0BAAjB,CAA8C,SAASC,CAAT,CAAc,CACxD,KAAKhG,wBAAL,CAAgCgG,CACnC,CAFD,CAWAhH,CAAM,CAACc,SAAP,CAAiB2C,QAAjB,CAA4B,SAASgD,CAAT,CAAetE,CAAf,CAAqB,CAC7C,KAAK7B,UAAL,CAAgB2G,OAAhB,CAAwBR,CAAxB,CAA8B,CAACtE,CAAD,CAA9B,CACH,CAFD,CAIA,MAAOnC,CAAAA,CAEV,CA7bK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency picker.\n *\n * To handle 'save' events use: picker.on('save')\n * This will receive a object with either a single 'competencyId', or an array in 'competencyIds'\n * depending on the value of multiSelect.\n *\n * @module tool_lp/competencypicker\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/templates',\n 'tool_lp/dialogue',\n 'core/str',\n 'tool_lp/tree',\n 'core/pending'\n ],\n function($, Notification, Ajax, Templates, Dialogue, Str, Tree, Pending) {\n\n /**\n * Competency picker class.\n * @param {Number} pageContextId The page context ID.\n * @param {Number|false} singleFramework The ID of the framework when limited to one.\n * @param {String} pageContextIncludes One of 'children', 'parents', 'self'.\n * @param {Boolean} multiSelect Support multi-select in the tree.\n */\n var Picker = function(pageContextId, singleFramework, pageContextIncludes, multiSelect) {\n var self = this;\n self._eventNode = $('
');\n self._frameworks = [];\n self._reset();\n\n self._pageContextId = pageContextId;\n self._pageContextIncludes = pageContextIncludes || 'children';\n self._multiSelect = (typeof multiSelect === 'undefined' || multiSelect === true);\n if (singleFramework) {\n self._frameworkId = singleFramework;\n self._singleFramework = true;\n }\n };\n\n /** @property {Array} The competencies fetched. */\n Picker.prototype._competencies = null;\n /** @property {Array} The competencies that cannot be picked. */\n Picker.prototype._disallowedCompetencyIDs = null;\n /** @property {Node} The node we attach the events to. */\n Picker.prototype._eventNode = null;\n /** @property {Array} The list of frameworks fetched. */\n Picker.prototype._frameworks = null;\n /** @property {Number} The current framework ID. */\n Picker.prototype._frameworkId = null;\n /** @property {Number} The page context ID. */\n Picker.prototype._pageContextId = null;\n /** @property {Number} Relevant contexts inclusion. */\n Picker.prototype._pageContextIncludes = null;\n /** @property {Dialogue} The reference to the dialogue. */\n Picker.prototype._popup = null;\n /** @property {String} The string we filter the competencies with. */\n Picker.prototype._searchText = '';\n /** @property {Object} The competency that was selected. */\n Picker.prototype._selectedCompetencies = null;\n /** @property {Boolean} Whether we can browse frameworks or not. */\n Picker.prototype._singleFramework = false;\n /** @property {Boolean} Do we allow multi select? */\n Picker.prototype._multiSelect = true;\n /** @property {Boolean} Do we allow to display hidden framework? */\n Picker.prototype._onlyVisible = true;\n\n /**\n * Hook to executed after the view is rendered.\n *\n * @method _afterRender\n */\n Picker.prototype._afterRender = function() {\n var self = this;\n\n // Initialise the tree.\n var tree = new Tree(self._find('[data-enhance=linktree]'), self._multiSelect);\n\n // To prevent jiggling we only show the tree after it is enhanced.\n self._find('[data-enhance=linktree]').show();\n\n tree.on('selectionchanged', function(evt, params) {\n var selected = params.selected;\n evt.preventDefault();\n var validIds = [];\n $.each(selected, function(index, item) {\n var compId = $(item).data('id'),\n valid = true;\n\n if (typeof compId === 'undefined') {\n // Do not allow picking nodes with no id.\n valid = false;\n } else {\n $.each(self._disallowedCompetencyIDs, function(i, id) {\n if (id == compId) {\n valid = false;\n }\n });\n }\n if (valid) {\n validIds.push(compId);\n }\n });\n\n self._selectedCompetencies = validIds;\n\n // TODO Implement disabling of nodes in the tree module somehow.\n if (!self._selectedCompetencies.length) {\n self._find('[data-region=\"competencylinktree\"] [data-action=\"add\"]').attr('disabled', 'disabled');\n } else {\n self._find('[data-region=\"competencylinktree\"] [data-action=\"add\"]').removeAttr('disabled');\n }\n });\n\n // Add listener for framework change.\n if (!self._singleFramework) {\n self._find('[data-action=\"chooseframework\"]').change(function(e) {\n self._frameworkId = $(e.target).val();\n self._loadCompetencies().then(self._refresh.bind(self)).catch(Notification.exception);\n });\n }\n\n // Add listener for search.\n self._find('[data-region=\"filtercompetencies\"] button').click(function(e) {\n e.preventDefault();\n $(e.target).attr('disabled', 'disabled');\n self._searchText = self._find('[data-region=\"filtercompetencies\"] input').val() || '';\n return self._refresh().always(function() {\n $(e.target).removeAttr('disabled');\n });\n });\n\n // Add listener for cancel.\n self._find('[data-region=\"competencylinktree\"] [data-action=\"cancel\"]').click(function(e) {\n e.preventDefault();\n self.close();\n });\n\n // Add listener for add.\n self._find('[data-region=\"competencylinktree\"] [data-action=\"add\"]').click(function(e) {\n e.preventDefault();\n var pendingPromise = new Pending();\n if (!self._selectedCompetencies.length) {\n return;\n }\n\n if (self._multiSelect) {\n self._trigger('save', {competencyIds: self._selectedCompetencies});\n } else {\n // We checked above that the array has at least one value.\n self._trigger('save', {competencyId: self._selectedCompetencies[0]});\n }\n\n // The dialogue here is a YUI dialogue and doesn't support Promises at all.\n // However, it is typically synchronous so this shoudl suffice.\n self.close();\n pendingPromise.resolve();\n });\n\n // The list of selected competencies will be modified while looping (because of the listeners above).\n var currentItems = self._selectedCompetencies.slice(0);\n\n $.each(currentItems, function(index, id) {\n var node = self._find('[data-id=' + id + ']');\n if (node.length) {\n tree.toggleItem(node);\n tree.updateFocus(node);\n }\n });\n\n };\n\n /**\n * Close the dialogue.\n *\n * @method close\n */\n Picker.prototype.close = function() {\n var self = this;\n self._popup.close();\n self._reset();\n };\n\n /**\n * Opens the picker.\n *\n * @method display\n * @return {Promise}\n */\n Picker.prototype.display = function() {\n var self = this;\n return $.when(Str.get_string('competencypicker', 'tool_lp'), self._render())\n .then(function(title, render) {\n self._popup = new Dialogue(\n title,\n render[0],\n self._afterRender.bind(self)\n );\n return;\n }).catch(Notification.exception);\n };\n\n /**\n * Fetch the competencies.\n *\n * @param {Number} frameworkId The frameworkId.\n * @param {String} searchText Limit the competencies to those matching the text.\n * @method _fetchCompetencies\n * @return {Promise}\n */\n Picker.prototype._fetchCompetencies = function(frameworkId, searchText) {\n var self = this;\n\n return Ajax.call([\n {methodname: 'core_competency_search_competencies', args: {\n searchtext: searchText,\n competencyframeworkid: frameworkId\n }}\n ])[0].done(function(competencies) {\n /**\n * @param {Object} parent\n * @param {Array} competencies\n */\n function addCompetencyChildren(parent, competencies) {\n for (var i = 0; i < competencies.length; i++) {\n if (competencies[i].parentid == parent.id) {\n parent.haschildren = true;\n competencies[i].children = [];\n competencies[i].haschildren = false;\n parent.children[parent.children.length] = competencies[i];\n addCompetencyChildren(competencies[i], competencies);\n }\n }\n }\n\n // Expand the list of competencies into a tree.\n var i, comp;\n var tree = [];\n for (i = 0; i < competencies.length; i++) {\n comp = competencies[i];\n if (comp.parentid == \"0\") { // Loose check for now, because WS returns a string.\n comp.children = [];\n comp.haschildren = 0;\n tree[tree.length] = comp;\n addCompetencyChildren(comp, competencies);\n }\n }\n\n self._competencies = tree;\n\n }).fail(Notification.exception);\n };\n\n /**\n * Find a node in the dialogue.\n *\n * @param {String} selector\n * @return {JQuery}\n * @method _find\n */\n Picker.prototype._find = function(selector) {\n return $(this._popup.getContent()).find(selector);\n };\n\n /**\n * Convenience method to get a framework object.\n *\n * @param {Number} fid The framework ID.\n * @return {Object}\n * @method _getFramework\n */\n Picker.prototype._getFramework = function(fid) {\n var frm;\n $.each(this._frameworks, function(i, f) {\n if (f.id == fid) {\n frm = f;\n return;\n }\n });\n return frm;\n };\n\n /**\n * Load the competencies.\n *\n * @method _loadCompetencies\n * @return {Promise}\n */\n Picker.prototype._loadCompetencies = function() {\n return this._fetchCompetencies(this._frameworkId, this._searchText);\n };\n\n /**\n * Load the frameworks.\n *\n * @method _loadFrameworks\n * @return {Promise}\n */\n Picker.prototype._loadFrameworks = function() {\n var promise,\n self = this;\n\n // Quit early because we already have the data.\n if (self._frameworks.length > 0) {\n return $.when();\n }\n\n if (self._singleFramework) {\n promise = Ajax.call([\n {methodname: 'core_competency_read_competency_framework', args: {\n id: this._frameworkId\n }}\n ])[0].then(function(framework) {\n return [framework];\n });\n } else {\n promise = Ajax.call([\n {methodname: 'core_competency_list_competency_frameworks', args: {\n sort: 'shortname',\n context: {contextid: self._pageContextId},\n includes: self._pageContextIncludes,\n onlyvisible: self._onlyVisible\n }}\n ])[0];\n }\n\n return promise.done(function(frameworks) {\n self._frameworks = frameworks;\n }).fail(Notification.exception);\n };\n\n /**\n * Register an event listener.\n *\n * @param {String} type The event type.\n * @param {Function} handler The event listener.\n * @method on\n */\n Picker.prototype.on = function(type, handler) {\n this._eventNode.on(type, handler);\n };\n\n /**\n * Hook to executed before render.\n *\n * @method _preRender\n * @return {Promise}\n */\n Picker.prototype._preRender = function() {\n var self = this;\n return self._loadFrameworks().then(function() {\n if (!self._frameworkId && self._frameworks.length > 0) {\n self._frameworkId = self._frameworks[0].id;\n }\n\n // We could not set a framework ID, that probably means there are no frameworks accessible.\n if (!self._frameworkId) {\n self._frameworks = [];\n return $.when();\n }\n\n return self._loadCompetencies();\n });\n };\n\n /**\n * Refresh the view.\n *\n * @method _refresh\n * @return {Promise}\n */\n Picker.prototype._refresh = function() {\n var self = this;\n return self._render().then(function(html) {\n self._find('[data-region=\"competencylinktree\"]').replaceWith(html);\n self._afterRender();\n return;\n });\n };\n\n /**\n * Render the dialogue.\n *\n * @method _render\n * @return {Promise}\n */\n Picker.prototype._render = function() {\n var self = this;\n return self._preRender().then(function() {\n\n if (!self._singleFramework) {\n $.each(self._frameworks, function(i, framework) {\n if (framework.id == self._frameworkId) {\n framework.selected = true;\n } else {\n framework.selected = false;\n }\n });\n }\n\n var context = {\n competencies: self._competencies,\n framework: self._getFramework(self._frameworkId),\n frameworks: self._frameworks,\n search: self._searchText,\n singleFramework: self._singleFramework,\n };\n\n return Templates.render('tool_lp/competency_picker', context);\n });\n };\n\n /**\n * Reset the dialogue properties.\n *\n * This does not reset everything, just enough to reset the UI.\n *\n * @method _reset\n */\n Picker.prototype._reset = function() {\n this._competencies = [];\n this._disallowedCompetencyIDs = [];\n this._popup = null;\n this._searchText = '';\n this._selectedCompetencies = [];\n };\n\n /**\n * Set what competencies cannot be picked.\n *\n * This needs to be set after reset/close.\n *\n * @param {Number[]} ids The IDs.\n * @method _setDisallowedCompetencyIDs\n */\n Picker.prototype.setDisallowedCompetencyIDs = function(ids) {\n this._disallowedCompetencyIDs = ids;\n };\n\n /**\n * Trigger an event.\n *\n * @param {String} type The type of event.\n * @param {Object} data The data to pass to the listeners.\n * @method _reset\n */\n Picker.prototype._trigger = function(type, data) {\n this._eventNode.trigger(type, [data]);\n };\n\n return Picker;\n\n});\n"],"file":"competencypicker.min.js"} \ No newline at end of file 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 index 2581ebc875503..c84dcf7a316d4 100644 --- a/admin/tool/lp/amd/build/competencypicker_user_plans.min.js.map +++ b/admin/tool/lp/amd/build/competencypicker_user_plans.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/competencypicker_user_plans.js"],"names":["define","$","Notification","Ajax","Templates","Str","Tree","PickerBase","Picker","userId","singlePlan","multiSelect","prototype","constructor","apply","_userId","_plans","_planId","_singlePlan","Object","create","_afterRender","self","arguments","_find","change","e","target","val","_loadCompetencies","then","_refresh","bind","catch","exception","_fetchCompetencies","planId","searchText","call","methodname","args","id","done","competencies","i","comp","tree","length","competency","shortname","toLowerCase","indexOf","children","haschildren","push","_competencies","fail","_getPlan","plan","each","f","_searchText","_loadPlans","promise","when","userid","plans","_preRender","_render","selected","context","search","render"],"mappings":"AA2BAA,OAAM,uCAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,gBAHD,CAIC,UAJD,CAKC,cALD,CAMC,0BAND,CAAD,CAQE,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAgDC,CAAhD,CAAsDC,CAAtD,CAAkE,CAStE,GAAIC,CAAAA,CAAM,CAAG,SAASC,CAAT,CAAiBC,CAAjB,CAA6BC,CAA7B,CAA0C,CACnDJ,CAAU,CAACK,SAAX,CAAqBC,WAArB,CAAiCC,KAAjC,CAAuC,IAAvC,CAA6C,CAAC,CAAD,IAAW,MAAX,CAAmBH,CAAnB,CAA7C,EACA,KAAKI,OAAL,CAAeN,CAAf,CACA,KAAKO,MAAL,CAAc,EAAd,CAEA,GAAIN,CAAJ,CAAgB,CACZ,KAAKO,OAAL,CAAeP,CAAf,CACA,KAAKQ,WAAL,GACH,CACJ,CATD,CAUAV,CAAM,CAACI,SAAP,CAAmBO,MAAM,CAACC,MAAP,CAAcb,CAAU,CAACK,SAAzB,CAAnB,CAGAJ,CAAM,CAACI,SAAP,CAAiBI,MAAjB,CAA0B,IAA1B,CAEAR,CAAM,CAACI,SAAP,CAAiBK,OAAjB,CAA2B,IAA3B,CAEAT,CAAM,CAACI,SAAP,CAAiBM,WAAjB,IAEAV,CAAM,CAACI,SAAP,CAAiBG,OAAjB,CAA2B,IAA3B,CAOAP,CAAM,CAACI,SAAP,CAAiBS,YAAjB,CAAgC,UAAW,CACvC,GAAIC,CAAAA,CAAI,CAAG,IAAX,CACAf,CAAU,CAACK,SAAX,CAAqBS,YAArB,CAAkCP,KAAlC,CAAwCQ,CAAxC,CAA8CC,SAA9C,EAGA,GAAI,CAACD,CAAI,CAACJ,WAAV,CAAuB,CACnBI,CAAI,CAACE,KAAL,CAAW,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AAI,CAACN,MAHF,CAIVuD,MAAM,CAAEjD,CAAI,CAACuC,WAJH,CAKVnD,UAAU,CAAEY,CAAI,CAACJ,WALP,CAAd,CAQA,MAAOd,CAAAA,CAAS,CAACoE,MAAV,CAAiB,sCAAjB,CAAyDF,CAAzD,CACV,CArBM,CAsBV,CAxBD,CA0BA,MAAgE9D,CAAAA,CAEnE,CArNK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency picker from user plans.\n *\n * To handle 'save' events use: picker.on('save').\n *\n * This will receive a object with either a single 'competencyId', or an array in 'competencyIds'\n * depending on the value of multiSelect.\n *\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/templates',\n 'core/str',\n 'tool_lp/tree',\n 'tool_lp/competencypicker'\n ],\n function($, Notification, Ajax, Templates, Str, Tree, PickerBase) {\n\n /**\n * Competency picker in plan class.\n *\n * @param {Number} userId\n * @param {Number|false} singlePlan The ID of the plan when limited to one.\n * @param {Boolean} multiSelect Support multi-select in the tree.\n */\n var Picker = function(userId, singlePlan, multiSelect) {\n PickerBase.prototype.constructor.apply(this, [1, false, 'self', multiSelect]);\n this._userId = userId;\n this._plans = [];\n\n if (singlePlan) {\n this._planId = singlePlan;\n this._singlePlan = true;\n }\n };\n Picker.prototype = Object.create(PickerBase.prototype);\n\n /** @property {Array} The list of plans fetched. */\n Picker.prototype._plans = null;\n /** @property {Number} The current plan ID. */\n Picker.prototype._planId = null;\n /** @property {Boolean} Whether we can browse plans or not. */\n Picker.prototype._singlePlan = false;\n /** @property {Number} The user the plans belongs to. */\n Picker.prototype._userId = null;\n\n /**\n * Hook to executed after the view is rendered.\n *\n * @method _afterRender\n */\n Picker.prototype._afterRender = function() {\n var self = this;\n PickerBase.prototype._afterRender.apply(self, arguments);\n\n // Add listener for framework change.\n if (!self._singlePlan) {\n self._find('[data-action=\"chooseplan\"]').change(function(e) {\n self._planId = $(e.target).val();\n self._loadCompetencies().then(self._refresh.bind(self))\n .catch(Notification.exception);\n });\n }\n };\n\n /**\n * Fetch the competencies.\n *\n * @param {Number} planId The planId.\n * @param {String} searchText Limit the competencies to those matching the text.\n * @method _fetchCompetencies\n * @return {Promise} The promise object.\n */\n Picker.prototype._fetchCompetencies = function(planId, searchText) {\n var self = this;\n\n return Ajax.call([\n {methodname: 'core_competency_list_plan_competencies', args: {\n id: planId\n }}\n ])[0].done(function(competencies) {\n\n // Expand the list of competencies into a fake tree.\n var i, comp;\n var tree = [];\n for (i = 0; i < competencies.length; i++) {\n comp = competencies[i].competency;\n if (comp.shortname.toLowerCase().indexOf(searchText.toLowerCase()) < 0) {\n continue;\n }\n comp.children = [];\n comp.haschildren = 0;\n tree.push(comp);\n }\n\n self._competencies = tree;\n\n }).fail(Notification.exception);\n };\n\n /**\n * Convenience method to get a plan object.\n *\n * @param {Number} id The plan ID.\n * @return {Object|undefined} The plan.\n * @method _getPlan\n */\n Picker.prototype._getPlan = function(id) {\n var plan;\n $.each(this._plans, function(i, f) {\n if (f.id == id) {\n plan = f;\n return;\n }\n });\n return plan;\n };\n\n /**\n * Load the competencies.\n *\n * @method _loadCompetencies\n * @return {Promise}\n */\n Picker.prototype._loadCompetencies = function() {\n return this._fetchCompetencies(this._planId, this._searchText);\n };\n\n /**\n * Load the plans.\n *\n * @method _loadPlans\n * @return {Promise}\n */\n Picker.prototype._loadPlans = function() {\n var promise,\n self = this;\n\n // Quit early because we already have the data.\n if (self._plans.length > 0) {\n return $.when();\n }\n\n if (self._singlePlan) {\n promise = Ajax.call([\n {methodname: 'core_competency_read_plan', args: {\n id: this._planId\n }}\n ])[0].then(function(plan) {\n return [plan];\n });\n } else {\n promise = Ajax.call([\n {methodname: 'core_competency_list_user_plans', args: {\n userid: self._userId\n }}\n ])[0];\n }\n\n return promise.done(function(plans) {\n self._plans = plans;\n }).fail(Notification.exception);\n };\n\n /**\n * Hook to executed before render.\n *\n * @method _preRender\n * @return {Promise}\n */\n Picker.prototype._preRender = function() {\n var self = this;\n return self._loadPlans().then(function() {\n if (!self._planId && self._plans.length > 0) {\n self._planId = self._plans[0].id;\n }\n\n // We could not set a framework ID, that probably means there are no frameworks accessible.\n if (!self._planId) {\n self._plans = [];\n return $.when();\n }\n\n return self._loadCompetencies();\n });\n };\n\n /**\n * Render the dialogue.\n *\n * @method _render\n * @return {Promise}\n */\n Picker.prototype._render = function() {\n var self = this;\n return self._preRender().then(function() {\n\n if (!self._singlePlan) {\n $.each(self._plans, function(i, plan) {\n if (plan.id == self._planId) {\n plan.selected = true;\n } else {\n plan.selected = false;\n }\n });\n }\n\n var context = {\n competencies: self._competencies,\n plan: self._getPlan(self._planId),\n plans: self._plans,\n search: self._searchText,\n singlePlan: self._singlePlan,\n };\n\n return Templates.render('tool_lp/competency_picker_user_plans', context);\n });\n };\n\n return /** @alias module:tool_lp/competencypicker_user_plans */ Picker;\n\n});\n"],"file":"competencypicker_user_plans.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/competencypicker_user_plans.js"],"names":["define","$","Notification","Ajax","Templates","Str","Tree","PickerBase","Picker","userId","singlePlan","multiSelect","prototype","constructor","apply","_userId","_plans","_planId","_singlePlan","Object","create","_afterRender","self","arguments","_find","change","e","target","val","_loadCompetencies","then","_refresh","bind","catch","exception","_fetchCompetencies","planId","searchText","call","methodname","args","id","done","competencies","i","comp","tree","length","competency","shortname","toLowerCase","indexOf","children","haschildren","push","_competencies","fail","_getPlan","plan","each","f","_searchText","_loadPlans","promise","when","userid","plans","_preRender","_render","selected","context","search","render"],"mappings":"AA4BAA,OAAM,uCAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,gBAHD,CAIC,UAJD,CAKC,cALD,CAMC,0BAND,CAAD,CAQE,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAgDC,CAAhD,CAAsDC,CAAtD,CAAkE,CAUtE,GAAIC,CAAAA,CAAM,CAAG,SAASC,CAAT,CAAiBC,CAAjB,CAA6BC,CAA7B,CAA0C,CACnDJ,CAAU,CAACK,SAAX,CAAqBC,WAArB,CAAiCC,KAAjC,CAAuC,IAAvC,CAA6C,CAAC,CAAD,IAAW,MAAX,CAAmBH,CAAnB,CAA7C,EACA,KAAKI,OAAL,CAAeN,CAAf,CACA,KAAKO,MAAL,CAAc,EAAd,CAEA,GAAIN,CAAJ,CAAgB,CACZ,KAAKO,OAAL,CAAeP,CAAf,CACA,KAAKQ,WAAL,GACH,CACJ,CATD,CAUAV,CAAM,CAACI,SAAP,CAAmBO,MAAM,CAACC,MAAP,CAAcb,CAAU,CAACK,SAAzB,CAAnB,CAGAJ,CAAM,CAACI,SAAP,CAAiBI,MAAjB,CAA0B,IAA1B,CAEAR,CAAM,CAACI,SAAP,CAAiBK,OAAjB,CAA2B,IAA3B,CAEAT,CAAM,CAACI,SAAP,CAAiBM,WAAjB,IAEAV,CAAM,CAACI,SAAP,CAAiBG,OAAjB,CAA2B,IAA3B,CAOAP,CAAM,CAACI,SAAP,CAAiBS,YAAjB,CAAgC,UAAW,CACvC,GAAIC,CAAAA,CAAI,CAAG,IAAX,CACAf,CAAU,CAACK,SAAX,CAAqBS,YAArB,CAAkCP,KAAlC,CAAwCQ,CAAxC,CAA8CC,SAA9C,EAGA,GAAI,CAACD,CAAI,CAACJ,WAAV,CAAuB,CACnBI,CAAI,CAACE,KAAL,CAAW,8BAAX,EAAyCC,MAAzC,CAAgD,SAASC,CA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,CAAI,CAACuC,WAJH,CAKVnD,UAAU,CAAEY,CAAI,CAACJ,WALP,CAAd,CAQA,MAAOd,CAAAA,CAAS,CAACoE,MAAV,CAAiB,sCAAjB,CAAyDF,CAAzD,CACV,CArBM,CAsBV,CAxBD,CA0BA,MAAO9D,CAAAA,CACV,CArNK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency picker from user plans.\n *\n * To handle 'save' events use: picker.on('save').\n *\n * This will receive a object with either a single 'competencyId', or an array in 'competencyIds'\n * depending on the value of multiSelect.\n *\n * @module tool_lp/competencypicker_user_plans\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/templates',\n 'core/str',\n 'tool_lp/tree',\n 'tool_lp/competencypicker'\n ],\n function($, Notification, Ajax, Templates, Str, Tree, PickerBase) {\n\n /**\n * Competency picker in plan class.\n *\n * @class tool_lp/competencypicker_user_plans\n * @param {Number} userId\n * @param {Number|false} singlePlan The ID of the plan when limited to one.\n * @param {Boolean} multiSelect Support multi-select in the tree.\n */\n var Picker = function(userId, singlePlan, multiSelect) {\n PickerBase.prototype.constructor.apply(this, [1, false, 'self', multiSelect]);\n this._userId = userId;\n this._plans = [];\n\n if (singlePlan) {\n this._planId = singlePlan;\n this._singlePlan = true;\n }\n };\n Picker.prototype = Object.create(PickerBase.prototype);\n\n /** @property {Array} The list of plans fetched. */\n Picker.prototype._plans = null;\n /** @property {Number} The current plan ID. */\n Picker.prototype._planId = null;\n /** @property {Boolean} Whether we can browse plans or not. */\n Picker.prototype._singlePlan = false;\n /** @property {Number} The user the plans belongs to. */\n Picker.prototype._userId = null;\n\n /**\n * Hook to executed after the view is rendered.\n *\n * @method _afterRender\n */\n Picker.prototype._afterRender = function() {\n var self = this;\n PickerBase.prototype._afterRender.apply(self, arguments);\n\n // Add listener for framework change.\n if (!self._singlePlan) {\n self._find('[data-action=\"chooseplan\"]').change(function(e) {\n self._planId = $(e.target).val();\n self._loadCompetencies().then(self._refresh.bind(self))\n .catch(Notification.exception);\n });\n }\n };\n\n /**\n * Fetch the competencies.\n *\n * @param {Number} planId The planId.\n * @param {String} searchText Limit the competencies to those matching the text.\n * @method _fetchCompetencies\n * @return {Promise} The promise object.\n */\n Picker.prototype._fetchCompetencies = function(planId, searchText) {\n var self = this;\n\n return Ajax.call([\n {methodname: 'core_competency_list_plan_competencies', args: {\n id: planId\n }}\n ])[0].done(function(competencies) {\n\n // Expand the list of competencies into a fake tree.\n var i, comp;\n var tree = [];\n for (i = 0; i < competencies.length; i++) {\n comp = competencies[i].competency;\n if (comp.shortname.toLowerCase().indexOf(searchText.toLowerCase()) < 0) {\n continue;\n }\n comp.children = [];\n comp.haschildren = 0;\n tree.push(comp);\n }\n\n self._competencies = tree;\n\n }).fail(Notification.exception);\n };\n\n /**\n * Convenience method to get a plan object.\n *\n * @param {Number} id The plan ID.\n * @return {Object|undefined} The plan.\n * @method _getPlan\n */\n Picker.prototype._getPlan = function(id) {\n var plan;\n $.each(this._plans, function(i, f) {\n if (f.id == id) {\n plan = f;\n return;\n }\n });\n return plan;\n };\n\n /**\n * Load the competencies.\n *\n * @method _loadCompetencies\n * @return {Promise}\n */\n Picker.prototype._loadCompetencies = function() {\n return this._fetchCompetencies(this._planId, this._searchText);\n };\n\n /**\n * Load the plans.\n *\n * @method _loadPlans\n * @return {Promise}\n */\n Picker.prototype._loadPlans = function() {\n var promise,\n self = this;\n\n // Quit early because we already have the data.\n if (self._plans.length > 0) {\n return $.when();\n }\n\n if (self._singlePlan) {\n promise = Ajax.call([\n {methodname: 'core_competency_read_plan', args: {\n id: this._planId\n }}\n ])[0].then(function(plan) {\n return [plan];\n });\n } else {\n promise = Ajax.call([\n {methodname: 'core_competency_list_user_plans', args: {\n userid: self._userId\n }}\n ])[0];\n }\n\n return promise.done(function(plans) {\n self._plans = plans;\n }).fail(Notification.exception);\n };\n\n /**\n * Hook to executed before render.\n *\n * @method _preRender\n * @return {Promise}\n */\n Picker.prototype._preRender = function() {\n var self = this;\n return self._loadPlans().then(function() {\n if (!self._planId && self._plans.length > 0) {\n self._planId = self._plans[0].id;\n }\n\n // We could not set a framework ID, that probably means there are no frameworks accessible.\n if (!self._planId) {\n self._plans = [];\n return $.when();\n }\n\n return self._loadCompetencies();\n });\n };\n\n /**\n * Render the dialogue.\n *\n * @method _render\n * @return {Promise}\n */\n Picker.prototype._render = function() {\n var self = this;\n return self._preRender().then(function() {\n\n if (!self._singlePlan) {\n $.each(self._plans, function(i, plan) {\n if (plan.id == self._planId) {\n plan.selected = true;\n } else {\n plan.selected = false;\n }\n });\n }\n\n var context = {\n competencies: self._competencies,\n plan: self._getPlan(self._planId),\n plans: self._plans,\n search: self._searchText,\n singlePlan: self._singlePlan,\n };\n\n return Templates.render('tool_lp/competency_picker_user_plans', context);\n });\n };\n\n return Picker;\n});\n"],"file":"competencypicker_user_plans.min.js"} \ No newline at end of file diff --git a/admin/tool/lp/amd/build/competencyruleconfig.min.js.map b/admin/tool/lp/amd/build/competencyruleconfig.min.js.map index 87e5188845f6f..d4bd21fbe3d66 100644 --- a/admin/tool/lp/amd/build/competencyruleconfig.min.js.map +++ b/admin/tool/lp/amd/build/competencyruleconfig.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/competencyruleconfig.js"],"names":["define","$","Notification","Templates","Dialogue","Outcomes","Str","RuleConfig","tree","rulesModules","_eventNode","_tree","_rulesModules","_setUp","prototype","_competency","_outcomesOption","_popup","_ready","_rules","_afterChange","_isValid","_find","prop","_afterRuleConfigChange","e","rule","_getRule","_afterRender","self","on","_switchedOutcome","trigger","_switchedRule","_trigger","_getConfig","close","canBeConfigured","can","each","index","canConfig","display","when","get_string","_render","then","title","render","bind","fail","exception","selector","getContent","find","_getApplicableOutcomesOptions","options","outcome","push","code","name","selected","ruleoutcome","_getApplicableRulesOptions","_getRuleName","getType","type","ruletype","ruleconfig","getConfig","_getOutcome","val","result","modInfo","_initOutcomes","getAll","outcomes","_initRules","promises","promise","init","setTargetCompetency","splice","apply","NONE","isValid","handler","_preRender","ready","config","rules","context","competencyshortname","shortname","setTargetCompetencyId","competencyId","getCompetency","modules","Deferred","amd","require","arguments","Module","always","resolve","hide","empty","show","container","injectTemplate","catch","data"],"mappings":"AAsBAA,OAAM,gCAAC,CAAC,QAAD,CACC,mBADD,CAEC,gBAFD,CAGC,kBAHD,CAIC,6BAJD,CAKC,UALD,CAAD,CAME,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAqCC,CAArC,CAA+CC,CAA/C,CAAyDC,CAAzD,CAA8D,CAclE,GAAIC,CAAAA,CAAU,CAAG,SAASC,CAAT,CAAeC,CAAf,CAA6B,CAC1C,KAAKC,UAAL,CAAkBT,CAAC,CAAC,aAAD,CAAnB,CACA,KAAKU,KAAL,CAAaH,CAAb,CACA,KAAKI,aAAL,CAAqBH,CAArB,CACA,KAAKI,MAAL,EACH,CALD,CAQAN,CAAU,CAACO,SAAX,CAAqBC,WAArB,CAAmC,IAAnC,CAEAR,CAAU,CAACO,SAAX,CAAqBJ,UAArB,CAAkC,IAAlC,CAEAH,CAAU,CAACO,SAAX,CAAqBE,eAArB,CAAuC,IAAvC,CAEAT,CAAU,CAACO,SAAX,CAAqBG,MAArB,CAA8B,IAA9B,CAEAV,CAAU,CAACO,SAAX,CAAqBI,MAArB,CAA8B,IAA9B,CAEAX,CAAU,CAACO,SAAX,CAAqBK,MAArB,CAA8B,IAA9B,CAEAZ,CAAU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EAC2BiB,GAD3B,CAC+B,CAAC,CADhC,EAEA1C,CAAI,CAACP,KAAL,CAAW,+BAAX,EAA0CoF,KAA1C,GAAkDD,IAAlD,GACA5E,CAAI,CAACT,YAAL,GACA,MACH,CAEDS,CAAI,CAACP,KAAL,CAAW,6BAAX,EAAwCqF,IAAxC,GACA9E,CAAI,CAACP,KAAL,CAAW,+BAAX,EAA0CqF,IAA1C,GACA9E,CAAI,CAACT,YAAL,EACH,CAhBD,CAwBAb,CAAU,CAACO,SAAX,CAAqBmB,aAArB,CAAqC,UAAW,CAC5C,GAAIJ,CAAAA,CAAI,CAAG,IAAX,CACI+E,CAAS,CAAG/E,CAAI,CAACP,KAAL,CAAW,+BAAX,CADhB,CAEII,CAAI,CAAGG,CAAI,CAACF,QAAL,EAFX,CAIA,GAAI,CAACD,CAAL,CAAW,CACPkF,CAAS,CAACF,KAAV,GAAkBD,IAAlB,GACA5E,CAAI,CAACT,YAAL,GACA,MACH,CACDM,CAAI,CAACmF,cAAL,CAAoBD,CAApB,EAA+B9D,IAA/B,CAAoC,UAAW,CAC3C8D,CAAS,CAACD,IAAV,EAEH,CAHD,EAGGJ,MAHH,CAGU,UAAW,CACjB1E,CAAI,CAACT,YAAL,EACH,CALD,EAKG0F,KALH,CAKS,UAAW,CAChBF,CAAS,CAACF,KAAV,GAAkBD,IAAlB,EACH,CAPD,CAQH,CAlBD,CA4BAlG,CAAU,CAACO,SAAX,CAAqBoB,QAArB,CAAgC,SAASgC,CAAT,CAAe6C,CAAf,CAAqB,CACjD,KAAKrG,UAAL,CAAgBsB,OAAhB,CAAwBkC,CAAxB,CAA8B,CAAC6C,CAAD,CAA9B,CACH,CAFD,CAIA,MAAyDxG,CAAAA,CAE5D,CAzgBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency rule config.\n *\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/templates',\n 'tool_lp/dialogue',\n 'tool_lp/competency_outcomes',\n 'core/str'],\n function($, Notification, Templates, Dialogue, Outcomes, Str) {\n\n /**\n * Competency rule class.\n *\n * When implementing this you should attach a listener to the event 'save'\n * on the instance. E.g.\n *\n * var config = new RuleConfig(tree, modules);\n * config.on('save', function(e, config) { ... });\n *\n * @param {competencytree} tree The competency tree.\n * @param {Array} rulesModules The modules containing the rules: [{ typeName: { amd: amdModule, name: ruleName }}].\n */\n var RuleConfig = function(tree, rulesModules) {\n this._eventNode = $('
');\n this._tree = tree;\n this._rulesModules = rulesModules;\n this._setUp();\n };\n\n /** @property {Object} The current competency. */\n RuleConfig.prototype._competency = null;\n /** @property {Node} The node we attach the events to. */\n RuleConfig.prototype._eventNode = null;\n /** @property {Array} Outcomes options. */\n RuleConfig.prototype._outcomesOption = null;\n /** @property {Dialogue} The dialogue. */\n RuleConfig.prototype._popup = null;\n /** @property {Promise} Resolved when the module is ready. */\n RuleConfig.prototype._ready = null;\n /** @property {Array} The rules. */\n RuleConfig.prototype._rules = null;\n /** @property {Array} The rules modules. */\n RuleConfig.prototype._rulesModules = null;\n /** @property {competencytree} The competency tree. */\n RuleConfig.prototype._tree = null;\n\n /**\n * After change.\n *\n * Triggered when a change occured.\n *\n * @method _afterChange\n * @protected\n */\n RuleConfig.prototype._afterChange = function() {\n if (!this._isValid()) {\n this._find('[data-action=\"save\"]').prop('disabled', true);\n } else {\n this._find('[data-action=\"save\"]').prop('disabled', false);\n }\n };\n\n /**\n * After change in rule's config.\n *\n * Triggered when a change occured in a specific rule config.\n *\n * @method _afterRuleConfigChange\n * @protected\n * @param {Event} e\n * @param {Rule} rule\n */\n RuleConfig.prototype._afterRuleConfigChange = function(e, rule) {\n if (rule != this._getRule()) {\n // This rule is not the current one any more, we can ignore.\n return;\n }\n this._afterChange();\n };\n\n /**\n * After render hook.\n *\n * @method _afterRender\n * @protected\n */\n RuleConfig.prototype._afterRender = function() {\n var self = this;\n\n self._find('[name=\"outcome\"]').on('change', function() {\n self._switchedOutcome();\n }).trigger('change');\n\n self._find('[name=\"rule\"]').on('change', function() {\n self._switchedRule();\n }).trigger('change');\n\n self._find('[data-action=\"save\"]').on('click', function() {\n self._trigger('save', self._getConfig());\n self.close();\n });\n\n self._find('[data-action=\"cancel\"]').on('click', function() {\n self.close();\n });\n };\n\n /**\n * Whether the current competency can be configured.\n *\n * @return {Boolean}\n * @method canBeConfigured\n */\n RuleConfig.prototype.canBeConfigured = function() {\n var can = false;\n $.each(this._rules, function(index, rule) {\n if (rule.canConfig()) {\n can = true;\n return;\n }\n });\n return can;\n };\n\n /**\n * Close the dialogue.\n *\n * @method close\n */\n RuleConfig.prototype.close = function() {\n this._popup.close();\n this._popup = null;\n };\n\n /**\n * Opens the picker.\n *\n * @param {Number} competencyId The competency ID of the competency to work on.\n * @method display\n * @return {Promise}\n */\n RuleConfig.prototype.display = function() {\n var self = this;\n if (!self._competency) {\n return false;\n }\n return $.when(Str.get_string('competencyrule', 'tool_lp'), self._render())\n .then(function(title, render) {\n self._popup = new Dialogue(\n title,\n render[0],\n self._afterRender.bind(self)\n );\n return;\n }).fail(Notification.exception);\n };\n\n /**\n * Find a node in the dialogue.\n *\n * @param {String} selector\n * @return {JQuery}\n * @method _find\n * @protected\n */\n RuleConfig.prototype._find = function(selector) {\n return $(this._popup.getContent()).find(selector);\n };\n\n /**\n * Get the applicable outcome options.\n *\n * @return {Array}\n * @method _getApplicableOutcomesOptions\n * @protected\n */\n RuleConfig.prototype._getApplicableOutcomesOptions = function() {\n var self = this,\n options = [];\n\n $.each(self._outcomesOption, function(index, outcome) {\n options.push({\n code: outcome.code,\n name: outcome.name,\n selected: (outcome.code == self._competency.ruleoutcome) ? true : false,\n });\n });\n\n return options;\n };\n\n /**\n * Get the applicable rules options.\n *\n * @return {Array}\n * @method _getApplicableRulesOptions\n * @protected\n */\n RuleConfig.prototype._getApplicableRulesOptions = function() {\n var self = this,\n options = [];\n\n $.each(self._rules, function(index, rule) {\n if (!rule.canConfig()) {\n return;\n }\n options.push({\n name: self._getRuleName(rule.getType()),\n type: rule.getType(),\n selected: (rule.getType() == self._competency.ruletype) ? true : false,\n });\n });\n\n return options;\n };\n\n /**\n * Get the full config for the competency.\n *\n * @return {Object} Contains rule, ruleoutcome and ruleconfig.\n * @method _getConfig\n * @protected\n */\n RuleConfig.prototype._getConfig = function() {\n var rule = this._getRule();\n return {\n ruletype: rule ? rule.getType() : null,\n ruleconfig: rule ? rule.getConfig() : null,\n ruleoutcome: this._getOutcome()\n };\n };\n\n /**\n * Get the selected outcome code.\n *\n * @return {String}\n * @method _getOutcome\n * @protected\n */\n RuleConfig.prototype._getOutcome = function() {\n return this._find('[name=\"outcome\"]').val();\n };\n\n /**\n * Get the selected rule.\n *\n * @return {null|Rule}\n * @method _getRule\n * @protected\n */\n RuleConfig.prototype._getRule = function() {\n var result,\n type = this._find('[name=\"rule\"]').val();\n\n $.each(this._rules, function(index, rule) {\n if (rule.getType() == type) {\n result = rule;\n return;\n }\n });\n\n return result;\n };\n\n /**\n * Return the name of a rule.\n *\n * @param {String} type The type of a rule.\n * @return {String}\n * @method _getRuleName\n * @protected\n */\n RuleConfig.prototype._getRuleName = function(type) {\n var self = this,\n name;\n $.each(self._rulesModules, function(index, modInfo) {\n if (modInfo.type == type) {\n name = modInfo.name;\n return;\n }\n });\n return name;\n };\n\n /**\n * Initialise the outcomes.\n *\n * @return {Promise}\n * @method _initOutcomes\n * @protected\n */\n RuleConfig.prototype._initOutcomes = function() {\n var self = this;\n return Outcomes.getAll().then(function(outcomes) {\n self._outcomesOption = outcomes;\n return;\n });\n };\n\n /**\n * Initialise the rules.\n *\n * @return {Promise}\n * @method _initRules\n * @protected\n */\n RuleConfig.prototype._initRules = function() {\n var self = this,\n promises = [];\n $.each(self._rules, function(index, rule) {\n var promise = rule.init().then(function() {\n rule.setTargetCompetency(self._competency);\n rule.on('change', self._afterRuleConfigChange.bind(self));\n return;\n }, function() {\n // Upon failure remove the rule, and resolve the promise.\n self._rules.splice(index, 1);\n return $.when();\n });\n promises.push(promise);\n });\n\n return $.when.apply($.when, promises);\n };\n\n /**\n * Whether or not the current config is valid.\n *\n * @return {Boolean}\n * @method _isValid\n * @protected\n */\n RuleConfig.prototype._isValid = function() {\n var outcome = this._getOutcome(),\n rule = this._getRule();\n\n if (outcome == Outcomes.NONE) {\n return true;\n } else if (!rule) {\n return false;\n }\n\n return rule.isValid();\n };\n\n /**\n * Register an event listener.\n *\n * @param {String} type The event type.\n * @param {Function} handler The event listener.\n * @method on\n */\n RuleConfig.prototype.on = function(type, handler) {\n this._eventNode.on(type, handler);\n };\n\n /**\n * Hook to executed before render.\n *\n * @method _preRender\n * @protected\n * @return {Promise}\n */\n RuleConfig.prototype._preRender = function() {\n // We need to have all the information about the rule plugins first.\n return this.ready();\n };\n\n /**\n * Returns a promise that is resolved when the module is ready.\n *\n * @return {Promise}\n * @method ready\n * @protected\n */\n RuleConfig.prototype.ready = function() {\n return this._ready.promise();\n };\n\n /**\n * Render the dialogue.\n *\n * @method _render\n * @protected\n * @return {Promise}\n */\n RuleConfig.prototype._render = function() {\n var self = this;\n return this._preRender().then(function() {\n var config;\n\n if (!self.canBeConfigured()) {\n config = false;\n } else {\n config = {};\n config.outcomes = self._getApplicableOutcomesOptions();\n config.rules = self._getApplicableRulesOptions();\n }\n\n var context = {\n competencyshortname: self._competency.shortname,\n config: config\n };\n\n return Templates.render('tool_lp/competency_rule_config', context);\n });\n };\n\n /**\n * Set the target competency.\n *\n * @param {Number} competencyId The target competency Id.\n * @method setTargetCompetencyId\n */\n RuleConfig.prototype.setTargetCompetencyId = function(competencyId) {\n var self = this;\n self._competency = self._tree.getCompetency(competencyId);\n $.each(self._rules, function(index, rule) {\n rule.setTargetCompetency(self._competency);\n });\n };\n\n /**\n * Set up the instance.\n *\n * @method _setUp\n * @protected\n */\n RuleConfig.prototype._setUp = function() {\n var self = this,\n promises = [],\n modules = [];\n\n self._ready = $.Deferred();\n self._rules = [];\n\n $.each(self._rulesModules, function(index, rule) {\n modules.push(rule.amd);\n });\n\n // Load all the modules.\n require(modules, function() {\n $.each(arguments, function(index, Module) {\n // Instantiate the rule and listen to it.\n var rule = new Module(self._tree);\n self._rules.push(rule);\n });\n\n // Load all the option values.\n promises.push(self._initRules());\n promises.push(self._initOutcomes());\n\n // Ready when everything is done.\n $.when.apply($.when, promises).always(function() {\n self._ready.resolve();\n });\n });\n };\n\n /**\n * Called when the user switches outcome.\n *\n * @method _switchedOutcome\n * @protected\n */\n RuleConfig.prototype._switchedOutcome = function() {\n var self = this,\n type = self._getOutcome();\n\n if (type == Outcomes.NONE) {\n // Reset to defaults.\n self._find('[data-region=\"rule-type\"]').hide()\n .find('[name=\"rule\"]').val(-1);\n self._find('[data-region=\"rule-config\"]').empty().hide();\n self._afterChange();\n return;\n }\n\n self._find('[data-region=\"rule-type\"]').show();\n self._find('[data-region=\"rule-config\"]').show();\n self._afterChange();\n };\n\n /**\n * Called when the user switches rule.\n *\n * @method _switchedRule\n * @protected\n */\n RuleConfig.prototype._switchedRule = function() {\n var self = this,\n container = self._find('[data-region=\"rule-config\"]'),\n rule = self._getRule();\n\n if (!rule) {\n container.empty().hide();\n self._afterChange();\n return;\n }\n rule.injectTemplate(container).then(function() {\n container.show();\n return;\n }).always(function() {\n self._afterChange();\n }).catch(function() {\n container.empty().hide();\n });\n };\n\n /**\n * Trigger an event.\n *\n * @param {String} type The type of event.\n * @param {Object} data The data to pass to the listeners.\n * @method _trigger\n * @protected\n */\n RuleConfig.prototype._trigger = function(type, data) {\n this._eventNode.trigger(type, [data]);\n };\n\n return /** @alias module:tool_lp/competencyruleconfig */ RuleConfig;\n\n});\n"],"file":"competencyruleconfig.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/competencyruleconfig.js"],"names":["define","$","Notification","Templates","Dialogue","Outcomes","Str","RuleConfig","tree","rulesModules","_eventNode","_tree","_rulesModules","_setUp","prototype","_competency","_outcomesOption","_popup","_ready","_rules","_afterChange","_isValid","_find","prop","_afterRuleConfigChange","e","rule","_getRule","_afterRender","self","on","_switchedOutcome","trigger","_switchedRule","_trigger","_getConfig","close","canBeConfigured","can","each","index","canConfig","display","when","get_string","_render","then","title","render","bind","fail","exception","selector","getContent","find","_getApplicableOutcomesOptions","options","outcome","push","code","name","selected","ruleoutcome","_getApplicableRulesOptions","_getRuleName","getType","type","ruletype","ruleconfig","getConfig","_getOutcome","val","result","modInfo","_initOutcomes","getAll","outcomes","_initRules","promises","promise","init","setTargetCompetency","splice","apply","NONE","isValid","handler","_preRender","ready","config","rules","context","competencyshortname","shortname","setTargetCompetencyId","competencyId","getCompetency","modules","Deferred","amd","require","arguments","Module","always","resolve","hide","empty","show","container","injectTemplate","catch","data"],"mappings":"AAuBAA,OAAM,gCAAC,CAAC,QAAD,CACC,mBADD,CAEC,gBAFD,CAGC,kBAHD,CAIC,6BAJD,CAKC,UALD,CAAD,CAME,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAqCC,CAArC,CAA+CC,CAA/C,CAAyDC,CAAzD,CAA8D,CAclE,GAAIC,CAAAA,CAAU,CAAG,SAASC,CAAT,CAAeC,CAAf,CAA6B,CAC1C,KAAKC,UAAL,CAAkBT,CAAC,CAAC,aAAD,CAAnB,CACA,KAAKU,KAAL,CAAaH,CAAb,CACA,KAAKI,aAAL,CAAqBH,CAArB,CACA,KAAKI,MAAL,EACH,CALD,CAQAN,CAAU,CAACO,SAAX,CAAqBC,WAArB,CAAmC,IAAnC,CAEAR,CAAU,CAACO,SAAX,CAAqB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B,CAAwBkC,CAAxB,CAA8B,CAAC6C,CAAD,CAA9B,CACH,CAFD,CAIA,MAAyDxG,CAAAA,CAE5D,CAzgBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Competency rule config.\n *\n * @module tool_lp/competencyruleconfig\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/templates',\n 'tool_lp/dialogue',\n 'tool_lp/competency_outcomes',\n 'core/str'],\n function($, Notification, Templates, Dialogue, Outcomes, Str) {\n\n /**\n * Competency rule class.\n *\n * When implementing this you should attach a listener to the event 'save'\n * on the instance. E.g.\n *\n * var config = new RuleConfig(tree, modules);\n * config.on('save', function(e, config) { ... });\n *\n * @param {competencytree} tree The competency tree.\n * @param {Array} rulesModules The modules containing the rules: [{ typeName: { amd: amdModule, name: ruleName }}].\n */\n var RuleConfig = function(tree, rulesModules) {\n this._eventNode = $('
');\n this._tree = tree;\n this._rulesModules = rulesModules;\n this._setUp();\n };\n\n /** @property {Object} The current competency. */\n RuleConfig.prototype._competency = null;\n /** @property {Node} The node we attach the events to. */\n RuleConfig.prototype._eventNode = null;\n /** @property {Array} Outcomes options. */\n RuleConfig.prototype._outcomesOption = null;\n /** @property {Dialogue} The dialogue. */\n RuleConfig.prototype._popup = null;\n /** @property {Promise} Resolved when the module is ready. */\n RuleConfig.prototype._ready = null;\n /** @property {Array} The rules. */\n RuleConfig.prototype._rules = null;\n /** @property {Array} The rules modules. */\n RuleConfig.prototype._rulesModules = null;\n /** @property {competencytree} The competency tree. */\n RuleConfig.prototype._tree = null;\n\n /**\n * After change.\n *\n * Triggered when a change occured.\n *\n * @method _afterChange\n * @protected\n */\n RuleConfig.prototype._afterChange = function() {\n if (!this._isValid()) {\n this._find('[data-action=\"save\"]').prop('disabled', true);\n } else {\n this._find('[data-action=\"save\"]').prop('disabled', false);\n }\n };\n\n /**\n * After change in rule's config.\n *\n * Triggered when a change occured in a specific rule config.\n *\n * @method _afterRuleConfigChange\n * @protected\n * @param {Event} e\n * @param {Rule} rule\n */\n RuleConfig.prototype._afterRuleConfigChange = function(e, rule) {\n if (rule != this._getRule()) {\n // This rule is not the current one any more, we can ignore.\n return;\n }\n this._afterChange();\n };\n\n /**\n * After render hook.\n *\n * @method _afterRender\n * @protected\n */\n RuleConfig.prototype._afterRender = function() {\n var self = this;\n\n self._find('[name=\"outcome\"]').on('change', function() {\n self._switchedOutcome();\n }).trigger('change');\n\n self._find('[name=\"rule\"]').on('change', function() {\n self._switchedRule();\n }).trigger('change');\n\n self._find('[data-action=\"save\"]').on('click', function() {\n self._trigger('save', self._getConfig());\n self.close();\n });\n\n self._find('[data-action=\"cancel\"]').on('click', function() {\n self.close();\n });\n };\n\n /**\n * Whether the current competency can be configured.\n *\n * @return {Boolean}\n * @method canBeConfigured\n */\n RuleConfig.prototype.canBeConfigured = function() {\n var can = false;\n $.each(this._rules, function(index, rule) {\n if (rule.canConfig()) {\n can = true;\n return;\n }\n });\n return can;\n };\n\n /**\n * Close the dialogue.\n *\n * @method close\n */\n RuleConfig.prototype.close = function() {\n this._popup.close();\n this._popup = null;\n };\n\n /**\n * Opens the picker.\n *\n * @param {Number} competencyId The competency ID of the competency to work on.\n * @method display\n * @return {Promise}\n */\n RuleConfig.prototype.display = function() {\n var self = this;\n if (!self._competency) {\n return false;\n }\n return $.when(Str.get_string('competencyrule', 'tool_lp'), self._render())\n .then(function(title, render) {\n self._popup = new Dialogue(\n title,\n render[0],\n self._afterRender.bind(self)\n );\n return;\n }).fail(Notification.exception);\n };\n\n /**\n * Find a node in the dialogue.\n *\n * @param {String} selector\n * @return {JQuery}\n * @method _find\n * @protected\n */\n RuleConfig.prototype._find = function(selector) {\n return $(this._popup.getContent()).find(selector);\n };\n\n /**\n * Get the applicable outcome options.\n *\n * @return {Array}\n * @method _getApplicableOutcomesOptions\n * @protected\n */\n RuleConfig.prototype._getApplicableOutcomesOptions = function() {\n var self = this,\n options = [];\n\n $.each(self._outcomesOption, function(index, outcome) {\n options.push({\n code: outcome.code,\n name: outcome.name,\n selected: (outcome.code == self._competency.ruleoutcome) ? true : false,\n });\n });\n\n return options;\n };\n\n /**\n * Get the applicable rules options.\n *\n * @return {Array}\n * @method _getApplicableRulesOptions\n * @protected\n */\n RuleConfig.prototype._getApplicableRulesOptions = function() {\n var self = this,\n options = [];\n\n $.each(self._rules, function(index, rule) {\n if (!rule.canConfig()) {\n return;\n }\n options.push({\n name: self._getRuleName(rule.getType()),\n type: rule.getType(),\n selected: (rule.getType() == self._competency.ruletype) ? true : false,\n });\n });\n\n return options;\n };\n\n /**\n * Get the full config for the competency.\n *\n * @return {Object} Contains rule, ruleoutcome and ruleconfig.\n * @method _getConfig\n * @protected\n */\n RuleConfig.prototype._getConfig = function() {\n var rule = this._getRule();\n return {\n ruletype: rule ? rule.getType() : null,\n ruleconfig: rule ? rule.getConfig() : null,\n ruleoutcome: this._getOutcome()\n };\n };\n\n /**\n * Get the selected outcome code.\n *\n * @return {String}\n * @method _getOutcome\n * @protected\n */\n RuleConfig.prototype._getOutcome = function() {\n return this._find('[name=\"outcome\"]').val();\n };\n\n /**\n * Get the selected rule.\n *\n * @return {null|Rule}\n * @method _getRule\n * @protected\n */\n RuleConfig.prototype._getRule = function() {\n var result,\n type = this._find('[name=\"rule\"]').val();\n\n $.each(this._rules, function(index, rule) {\n if (rule.getType() == type) {\n result = rule;\n return;\n }\n });\n\n return result;\n };\n\n /**\n * Return the name of a rule.\n *\n * @param {String} type The type of a rule.\n * @return {String}\n * @method _getRuleName\n * @protected\n */\n RuleConfig.prototype._getRuleName = function(type) {\n var self = this,\n name;\n $.each(self._rulesModules, function(index, modInfo) {\n if (modInfo.type == type) {\n name = modInfo.name;\n return;\n }\n });\n return name;\n };\n\n /**\n * Initialise the outcomes.\n *\n * @return {Promise}\n * @method _initOutcomes\n * @protected\n */\n RuleConfig.prototype._initOutcomes = function() {\n var self = this;\n return Outcomes.getAll().then(function(outcomes) {\n self._outcomesOption = outcomes;\n return;\n });\n };\n\n /**\n * Initialise the rules.\n *\n * @return {Promise}\n * @method _initRules\n * @protected\n */\n RuleConfig.prototype._initRules = function() {\n var self = this,\n promises = [];\n $.each(self._rules, function(index, rule) {\n var promise = rule.init().then(function() {\n rule.setTargetCompetency(self._competency);\n rule.on('change', self._afterRuleConfigChange.bind(self));\n return;\n }, function() {\n // Upon failure remove the rule, and resolve the promise.\n self._rules.splice(index, 1);\n return $.when();\n });\n promises.push(promise);\n });\n\n return $.when.apply($.when, promises);\n };\n\n /**\n * Whether or not the current config is valid.\n *\n * @return {Boolean}\n * @method _isValid\n * @protected\n */\n RuleConfig.prototype._isValid = function() {\n var outcome = this._getOutcome(),\n rule = this._getRule();\n\n if (outcome == Outcomes.NONE) {\n return true;\n } else if (!rule) {\n return false;\n }\n\n return rule.isValid();\n };\n\n /**\n * Register an event listener.\n *\n * @param {String} type The event type.\n * @param {Function} handler The event listener.\n * @method on\n */\n RuleConfig.prototype.on = function(type, handler) {\n this._eventNode.on(type, handler);\n };\n\n /**\n * Hook to executed before render.\n *\n * @method _preRender\n * @protected\n * @return {Promise}\n */\n RuleConfig.prototype._preRender = function() {\n // We need to have all the information about the rule plugins first.\n return this.ready();\n };\n\n /**\n * Returns a promise that is resolved when the module is ready.\n *\n * @return {Promise}\n * @method ready\n * @protected\n */\n RuleConfig.prototype.ready = function() {\n return this._ready.promise();\n };\n\n /**\n * Render the dialogue.\n *\n * @method _render\n * @protected\n * @return {Promise}\n */\n RuleConfig.prototype._render = function() {\n var self = this;\n return this._preRender().then(function() {\n var config;\n\n if (!self.canBeConfigured()) {\n config = false;\n } else {\n config = {};\n config.outcomes = self._getApplicableOutcomesOptions();\n config.rules = self._getApplicableRulesOptions();\n }\n\n var context = {\n competencyshortname: self._competency.shortname,\n config: config\n };\n\n return Templates.render('tool_lp/competency_rule_config', context);\n });\n };\n\n /**\n * Set the target competency.\n *\n * @param {Number} competencyId The target competency Id.\n * @method setTargetCompetencyId\n */\n RuleConfig.prototype.setTargetCompetencyId = function(competencyId) {\n var self = this;\n self._competency = self._tree.getCompetency(competencyId);\n $.each(self._rules, function(index, rule) {\n rule.setTargetCompetency(self._competency);\n });\n };\n\n /**\n * Set up the instance.\n *\n * @method _setUp\n * @protected\n */\n RuleConfig.prototype._setUp = function() {\n var self = this,\n promises = [],\n modules = [];\n\n self._ready = $.Deferred();\n self._rules = [];\n\n $.each(self._rulesModules, function(index, rule) {\n modules.push(rule.amd);\n });\n\n // Load all the modules.\n require(modules, function() {\n $.each(arguments, function(index, Module) {\n // Instantiate the rule and listen to it.\n var rule = new Module(self._tree);\n self._rules.push(rule);\n });\n\n // Load all the option values.\n promises.push(self._initRules());\n promises.push(self._initOutcomes());\n\n // Ready when everything is done.\n $.when.apply($.when, promises).always(function() {\n self._ready.resolve();\n });\n });\n };\n\n /**\n * Called when the user switches outcome.\n *\n * @method _switchedOutcome\n * @protected\n */\n RuleConfig.prototype._switchedOutcome = function() {\n var self = this,\n type = self._getOutcome();\n\n if (type == Outcomes.NONE) {\n // Reset to defaults.\n self._find('[data-region=\"rule-type\"]').hide()\n .find('[name=\"rule\"]').val(-1);\n self._find('[data-region=\"rule-config\"]').empty().hide();\n self._afterChange();\n return;\n }\n\n self._find('[data-region=\"rule-type\"]').show();\n self._find('[data-region=\"rule-config\"]').show();\n self._afterChange();\n };\n\n /**\n * Called when the user switches rule.\n *\n * @method _switchedRule\n * @protected\n */\n RuleConfig.prototype._switchedRule = function() {\n var self = this,\n container = self._find('[data-region=\"rule-config\"]'),\n rule = self._getRule();\n\n if (!rule) {\n container.empty().hide();\n self._afterChange();\n return;\n }\n rule.injectTemplate(container).then(function() {\n container.show();\n return;\n }).always(function() {\n self._afterChange();\n }).catch(function() {\n container.empty().hide();\n });\n };\n\n /**\n * Trigger an event.\n *\n * @param {String} type The type of event.\n * @param {Object} data The data to pass to the listeners.\n * @method _trigger\n * @protected\n */\n RuleConfig.prototype._trigger = function(type, data) {\n this._eventNode.trigger(type, [data]);\n };\n\n return /** @alias module:tool_lp/competencyruleconfig */ RuleConfig;\n\n});\n"],"file":"competencyruleconfig.min.js"} \ No newline at end of file diff --git a/admin/tool/lp/amd/build/evidence_delete.min.js.map b/admin/tool/lp/amd/build/evidence_delete.min.js.map index 9462d66fa0c2d..285ff964b1d54 100644 --- a/admin/tool/lp/amd/build/evidence_delete.min.js.map +++ b/admin/tool/lp/amd/build/evidence_delete.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/evidence_delete.js"],"names":["define","$","Notification","Ajax","Str","Log","selectors","register","triggerSelector","containerSelector","delegate","e","parent","currentTarget","parents","length","error","evidenceId","data","preventDefault","stopPropagation","get_strings","key","component","done","strings","confirm","promise","call","methodname","args","id","then","remove","fail","exception"],"mappings":"AAsBAA,OAAM,2BAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,UAHD,CAIC,UAJD,CAAD,CAKE,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAAqCC,CAArC,CAA0C,IAE1CC,CAAAA,CAAS,CAAG,EAF8B,CA4D9C,MAAoD,CAShDC,QAAQ,CA3DG,QAAXA,CAAAA,QAAW,CAASC,CAAT,CAA0BC,CAA1B,CAA6C,CACxD,GAA0C,WAAtC,QAAOH,CAAAA,CAAS,CAACE,CAAD,CAApB,CAAuD,CACnD,MACH,CAEDF,CAAS,CAACE,CAAD,CAAT,CAA6BP,CAAC,CAAC,MAAD,CAAD,CAAUS,QAAV,CAAm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,EAEH,CAHD,EAGGC,IAHH,CAGQhC,CAAY,CAACiC,SAHrB,CAIH,CAhBL,CAkBH,CAxBD,EAwBGD,IAxBH,CAwBQhC,CAAY,CAACiC,SAxBrB,CA2BH,CA1C4B,CA2ChC,CAEmD,CAYvD,CA7EK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Evidence delete.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/str',\n 'core/log'],\n function($, Notification, Ajax, Str, Log) {\n\n var selectors = {};\n\n /**\n * Register an event listener.\n *\n * @param {String} triggerSelector The node on which the click will happen.\n * @param {String} containerSelector The parent node that will be removed and contains the evidence ID.\n */\n var register = function(triggerSelector, containerSelector) {\n if (typeof selectors[triggerSelector] !== 'undefined') {\n return;\n }\n\n selectors[triggerSelector] = $('body').delegate(triggerSelector, 'click', function(e) {\n var parent = $(e.currentTarget).parents(containerSelector);\n if (!parent.length || parent.length > 1) {\n Log.error('None or too many evidence container were found.');\n return;\n }\n var evidenceId = parent.data('id');\n if (!evidenceId) {\n Log.error('Evidence ID was not found.');\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n Str.get_strings([\n {key: 'confirm', component: 'moodle'},\n {key: 'areyousure', component: 'moodle'},\n {key: 'delete', component: 'moodle'},\n {key: 'cancel', component: 'moodle'}\n ]).done(function(strings) {\n Notification.confirm(\n strings[0], // Confirm.\n strings[1], // Are you sure?\n strings[2], // Delete.\n strings[3], // Cancel.\n function() {\n var promise = Ajax.call([{\n methodname: 'core_competency_delete_evidence',\n args: {\n id: evidenceId\n }\n }]);\n promise[0].then(function() {\n parent.remove();\n return;\n }).fail(Notification.exception);\n }\n );\n }).fail(Notification.exception);\n\n\n });\n };\n\n return /** @alias module:tool_lp/evidence_delete */ {\n\n /**\n * Register an event listener.\n *\n * @param {String} triggerSelector The node on which the click will happen.\n * @param {String} containerSelector The parent node that will be removed and contains the evidence ID.\n * @return {Void}\n */\n register: register\n };\n\n});\n"],"file":"evidence_delete.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/evidence_delete.js"],"names":["define","$","Notification","Ajax","Str","Log","selectors","register","triggerSelector","containerSelector","delegate","e","parent","currentTarget","parents","length","error","evidenceId","data","preventDefault","stopPropagation","get_strings","key","component","done","strings","confirm","promise","call","methodname","args","id","then","remove","fail","exception"],"mappings":"AAuBAA,OAAM,2BAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,UAHD,CAIC,UAJD,CAAD,CAKE,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAAqCC,CAArC,CAA0C,IAE1CC,CAAAA,CAAS,CAAG,EAF8B,CA4D9C,MAAoD,CAShDC,QAAQ,CA3DG,QAAXA,CAAAA,QAAW,CAASC,CAAT,CAA0BC,CAA1B,CAA6C,CACxD,GAA0C,WAAtC,QAAOH,CAAAA,CAAS,CAACE,CAAD,CAApB,CAAuD,CACnD,MACH,CAEDF,CAAS,CAACE,CAAD,CAAT,CAA6BP,CAAC,CAAC,MAAD,CAAD,CAAUS,QAAV,CAAmBF,CAAnB,CAAoC,OAApC,CAA6C,SAASG,CAAT,CAAY,CAClF,GAAIC,CAAAA,CAAM,CAAGX,CAAC,CAACU,CAAC,CAACE,aAAH,CAAD,CAAmBC,OAAnB,CAA2BL,CAA3B,CAAb,CACA,GAAI,CAACG,CAAM,CAACG,MAAR,EAAkC,CAA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le - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Evidence delete.\n *\n * @module tool_lp/evidence_delete\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/str',\n 'core/log'],\n function($, Notification, Ajax, Str, Log) {\n\n var selectors = {};\n\n /**\n * Register an event listener.\n *\n * @param {String} triggerSelector The node on which the click will happen.\n * @param {String} containerSelector The parent node that will be removed and contains the evidence ID.\n */\n var register = function(triggerSelector, containerSelector) {\n if (typeof selectors[triggerSelector] !== 'undefined') {\n return;\n }\n\n selectors[triggerSelector] = $('body').delegate(triggerSelector, 'click', function(e) {\n var parent = $(e.currentTarget).parents(containerSelector);\n if (!parent.length || parent.length > 1) {\n Log.error('None or too many evidence container were found.');\n return;\n }\n var evidenceId = parent.data('id');\n if (!evidenceId) {\n Log.error('Evidence ID was not found.');\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n Str.get_strings([\n {key: 'confirm', component: 'moodle'},\n {key: 'areyousure', component: 'moodle'},\n {key: 'delete', component: 'moodle'},\n {key: 'cancel', component: 'moodle'}\n ]).done(function(strings) {\n Notification.confirm(\n strings[0], // Confirm.\n strings[1], // Are you sure?\n strings[2], // Delete.\n strings[3], // Cancel.\n function() {\n var promise = Ajax.call([{\n methodname: 'core_competency_delete_evidence',\n args: {\n id: evidenceId\n }\n }]);\n promise[0].then(function() {\n parent.remove();\n return;\n }).fail(Notification.exception);\n }\n );\n }).fail(Notification.exception);\n\n\n });\n };\n\n return /** @alias module:tool_lp/evidence_delete */ {\n\n /**\n * Register an event listener.\n *\n * @param {String} triggerSelector The node on which the click will happen.\n * @param {String} containerSelector The parent node that will be removed and contains the evidence ID.\n * @return {Void}\n */\n register: register\n };\n\n});\n"],"file":"evidence_delete.min.js"} \ No newline at end of file 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 index 9a9b295409d17..df2182978b631 100644 --- a/admin/tool/lp/amd/build/form-cohort-selector.min.js.map +++ b/admin/tool/lp/amd/build/form-cohort-selector.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/form-cohort-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","cohorts","each","index","cohort","push","value","id","label","_label","transport","query","success","failure","promise","contextid","parseInt","data","includes","call","methodname","args","context","then","promises","i","render","when","apply","arguments","catch"],"mappings":"AAwBAA,OAAM,gCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAE3E,MAAyD,CAErDC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAO,CAAG,EAAd,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAwB,CACpCH,CAAO,CAACI,IAAR,CAAa,CACTC,KAAK,CAAEF,CAAM,CAACG,EADL,CAETC,KAAK,CAAEJ,CAAM,CAACK,MAFL,CAAb,CAIH,CALD,EAMA,MAAOR,CAAAA,CACV,CAXoD,CAarDS,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,CACnD,GAAIC,CAAAA,CAAJ,CACIC,CAAS,CAAGC,QAAQ,CAACrB,CAAC,CAACI,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,WAAjB,CAAD,CAAgC,EAAhC,CADxB,CAEIC,CAAQ,CAAGvB,CAAC,CAACI,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,UAAjB,CAFf,CAIAH,CAAO,CAAGlB,CAAI,CAACuB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,wBADK,CAEjBC,IAAI,CAAE,CACFV,KAAK,CAAEA,CADL,CAEFW,OAAO,CAAE,CAACP,SAAS,CAAEA,CAAZ,CAFP,CAGFG,QAAQ,CAAEA,CAHR,CAFW,CAAD,CAAV,CAAV,CAQAJ,CAAO,CAAC,CAAD,CAAP,CAAWS,IAAX,CAAgB,SAASvB,CAAT,CAAkB,CAC9B,GAAIwB,CAAAA,CAAQ,CAAG,EAAf,CACIC,CAAC,CAAG,CADR,CAIA9B,CAAC,CAACO,IAAF,CAAOF,CAAO,CAACC,OAAf,CAAwB,SAASE,CAAT,CAAgBC,CAAhB,CAAwB,CAC5CoB,CAAQ,CAACnB,IAAT,CAAcR,CAAS,CAAC6B,MAAV,CAAiB,yCAAjB,CAA4DtB,CAA5D,CAAd,CACH,CAFD,EAKA,MAAOT,CAAAA,CAAC,CAACgC,IAAF,CAAOC,KAAP,CAAajC,CAAC,CAACgC,IAAf,CAAqBH,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAIF,CAAAA,CAAI,CAAGQ,SAAX,CACAlC,CAAC,CAACO,IAAF,CAAOF,CAAO,CAACC,OAAf,CAAwB,SAASE,CAAT,CAAgBC,CAAhB,CAAwB,CAC5CA,CAAM,CAACK,MAAP,CAAgBY,CAAI,CAACI,CAAD,CAApB,CACAA,CAAC,EACJ,CAHD,EAIAb,CAAO,CAACZ,CAAO,CAACC,OAAT,CAEV,CARM,CAUV,CApBD,EAoBG6B,KApBH,CAoBSjB,CApBT,CAqBH,CA/CoD,CAmD5D,CArDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Cohort selector module.\n *\n * @module tool_lp/form-cohort-selector\n * @class form-cohort-selector\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:tool_lp/form-cohort-selector */ {\n\n processResults: function(selector, results) {\n var cohorts = [];\n $.each(results, function(index, cohort) {\n cohorts.push({\n value: cohort.id,\n label: cohort._label\n });\n });\n return cohorts;\n },\n\n transport: function(selector, query, success, failure) {\n var promise,\n contextid = parseInt($(selector).data('contextid'), 10),\n includes = $(selector).data('includes');\n\n promise = Ajax.call([{\n methodname: 'tool_lp_search_cohorts',\n args: {\n query: query,\n context: {contextid: contextid},\n includes: includes\n }\n }]);\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results.cohorts, function(index, cohort) {\n promises.push(Templates.render('tool_lp/form-cohort-selector-suggestion', cohort));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results.cohorts, function(index, cohort) {\n cohort._label = args[i];\n i++;\n });\n success(results.cohorts);\n return;\n });\n\n }).catch(failure);\n }\n\n };\n\n});\n"],"file":"form-cohort-selector.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/form-cohort-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","cohorts","each","index","cohort","push","value","id","label","_label","transport","query","success","failure","promise","contextid","parseInt","data","includes","call","methodname","args","context","then","promises","i","render","when","apply","arguments","catch"],"mappings":"AAuBAA,OAAM,gCAAC,CAAC,Q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IAAT,CAAcR,CAAS,CAAC6B,MAAV,CAAiB,yCAAjB,CAA4DtB,CAA5D,CAAd,CACH,CAFD,EAKA,MAAOT,CAAAA,CAAC,CAACgC,IAAF,CAAOC,KAAP,CAAajC,CAAC,CAACgC,IAAf,CAAqBH,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAIF,CAAAA,CAAI,CAAGQ,SAAX,CACAlC,CAAC,CAACO,IAAF,CAAOF,CAAO,CAACC,OAAf,CAAwB,SAASE,CAAT,CAAgBC,CAAhB,CAAwB,CAC5CA,CAAM,CAACK,MAAP,CAAgBY,CAAI,CAACI,CAAD,CAApB,CACAA,CAAC,EACJ,CAHD,EAIAb,CAAO,CAACZ,CAAO,CAACC,OAAT,CAEV,CARM,CAUV,CApBD,EAoBG6B,KApBH,CAoBSjB,CApBT,CAqBH,CA/CoD,CAmD5D,CArDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Cohort selector module.\n *\n * @module tool_lp/form-cohort-selector\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:tool_lp/form-cohort-selector */ {\n\n processResults: function(selector, results) {\n var cohorts = [];\n $.each(results, function(index, cohort) {\n cohorts.push({\n value: cohort.id,\n label: cohort._label\n });\n });\n return cohorts;\n },\n\n transport: function(selector, query, success, failure) {\n var promise,\n contextid = parseInt($(selector).data('contextid'), 10),\n includes = $(selector).data('includes');\n\n promise = Ajax.call([{\n methodname: 'tool_lp_search_cohorts',\n args: {\n query: query,\n context: {contextid: contextid},\n includes: includes\n }\n }]);\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results.cohorts, function(index, cohort) {\n promises.push(Templates.render('tool_lp/form-cohort-selector-suggestion', cohort));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results.cohorts, function(index, cohort) {\n cohort._label = args[i];\n i++;\n });\n success(results.cohorts);\n return;\n });\n\n }).catch(failure);\n }\n\n };\n\n});\n"],"file":"form-cohort-selector.min.js"} \ No newline at end of file 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 index c2b8b874430a4..2a6ef1014dd0d 100644 --- a/admin/tool/lp/amd/build/form-user-selector.min.js.map +++ b/admin/tool/lp/amd/build/form-user-selector.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/form-user-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","promise","capability","data","call","methodname","args","then","promises","i","ctx","identity","k","hasidentity","join","render","when","apply","arguments","catch"],"mappings":"AAwBAA,OAAM,8BAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAE3E,MAAuD,CAEnDC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAK,CAAG,EAAZ,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCH,CAAK,CAACI,IAAN,CAAW,CACPC,KAAK,CAAEF,CAAI,CAACG,EADL,CAEPC,KAAK,CAAEJ,CAAI,CAACK,MAFL,CAAX,CAIH,CALD,EAMA,MAA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B,IAAT,CAAcR,CAAS,CAAC+B,MAAV,CAAiB,uCAAjB,CAA0DL,CAA1D,CAAd,CACH,CAXD,EAcA,MAAO5B,CAAAA,CAAC,CAACkC,IAAF,CAAOC,KAAP,CAAanC,CAAC,CAACkC,IAAf,CAAqBR,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAID,CAAAA,CAAI,CAAGY,SAAX,CACApC,CAAC,CAACO,IAAF,CAAOF,CAAO,CAACC,KAAf,CAAsB,SAASE,CAAT,CAAgBC,CAAhB,CAAsB,CACxCA,CAAI,CAACK,MAAL,CAAcU,CAAI,CAACG,CAAD,CAAlB,CACAA,CAAC,EACJ,CAHD,EAIAV,CAAO,CAACZ,CAAO,CAACC,KAAT,CAEV,CARM,CAUV,CA7BD,EA6BG+B,KA7BH,CA6BSnB,CA7BT,CA8BH,CA1DkD,CA8D1D,CAhEK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * User selector module.\n *\n * @module tool_lp/form-user-selector\n * @class form-user-selector\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:tool_lp/form-user-selector */ {\n\n processResults: function(selector, results) {\n var users = [];\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n var capability = $(selector).data('capability');\n if (typeof capability === \"undefined\") {\n capability = '';\n }\n\n promise = Ajax.call([{\n methodname: 'tool_lp_search_users',\n args: {\n query: query,\n capability: capability\n }\n }]);\n\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results.users, function(index, user) {\n var ctx = user,\n identity = [];\n $.each(['idnumber', 'email', 'phone1', 'phone2', 'department', 'institution'], function(i, k) {\n if (typeof user[k] !== 'undefined' && user[k] !== '') {\n ctx.hasidentity = true;\n identity.push(user[k]);\n }\n });\n ctx.identity = identity.join(', ');\n promises.push(Templates.render('tool_lp/form-user-selector-suggestion', ctx));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results.users, function(index, user) {\n user._label = args[i];\n i++;\n });\n success(results.users);\n return;\n });\n\n }).catch(failure);\n }\n\n };\n\n});\n"],"file":"form-user-selector.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/form-user-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","promise","capability","data","call","methodname","args","then","promises","i","ctx","identity","k","hasidentity","join","render","when","apply","arguments","catch"],"mappings":"AAuBAA,OAAM,8BAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAE3E,MAAuD,CAEnDC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAK,CAAG,EAAZ,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCH,CAAK,CAACI,IAAN,CAAW,CACPC,KAAK,CAAEF,CAAI,CAACG,EADL,CAEPC,KAAK,CAAEJ,CAAI,CAACK,MAFL,CAAX,CAIH,CALD,EAMA,MAAOR,CAAAA,CACV,CAXkD,CAanDS,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB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Ad,CACH,CAXD,EAcA,MAAO5B,CAAAA,CAAC,CAACkC,IAAF,CAAOC,KAAP,CAAanC,CAAC,CAACkC,IAAf,CAAqBR,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAID,CAAAA,CAAI,CAAGY,SAAX,CACApC,CAAC,CAACO,IAAF,CAAOF,CAAO,CAACC,KAAf,CAAsB,SAASE,CAAT,CAAgBC,CAAhB,CAAsB,CACxCA,CAAI,CAACK,MAAL,CAAcU,CAAI,CAACG,CAAD,CAAlB,CACAA,CAAC,EACJ,CAHD,EAIAV,CAAO,CAACZ,CAAO,CAACC,KAAT,CAEV,CARM,CAUV,CA7BD,EA6BG+B,KA7BH,CA6BSnB,CA7BT,CA8BH,CA1DkD,CA8D1D,CAhEK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * User selector module.\n *\n * @module tool_lp/form-user-selector\n * @copyright 2015 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:tool_lp/form-user-selector */ {\n\n processResults: function(selector, results) {\n var users = [];\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n var capability = $(selector).data('capability');\n if (typeof capability === \"undefined\") {\n capability = '';\n }\n\n promise = Ajax.call([{\n methodname: 'tool_lp_search_users',\n args: {\n query: query,\n capability: capability\n }\n }]);\n\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results.users, function(index, user) {\n var ctx = user,\n identity = [];\n $.each(['idnumber', 'email', 'phone1', 'phone2', 'department', 'institution'], function(i, k) {\n if (typeof user[k] !== 'undefined' && user[k] !== '') {\n ctx.hasidentity = true;\n identity.push(user[k]);\n }\n });\n ctx.identity = identity.join(', ');\n promises.push(Templates.render('tool_lp/form-user-selector-suggestion', ctx));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results.users, function(index, user) {\n user._label = args[i];\n i++;\n });\n success(results.users);\n return;\n });\n\n }).catch(failure);\n }\n\n };\n\n});\n"],"file":"form-user-selector.min.js"} \ No newline at end of file diff --git a/admin/tool/lp/amd/build/frameworks_datasource.min.js.map b/admin/tool/lp/amd/build/frameworks_datasource.min.js.map index 0f8494d193cb3..1cfb8eecc1b17 100644 --- a/admin/tool/lp/amd/build/frameworks_datasource.min.js.map +++ b/admin/tool/lp/amd/build/frameworks_datasource.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/frameworks_datasource.js"],"names":["define","$","Ajax","Notification","list","contextId","options","args","context","contextid","extend","call","methodname","processResults","selector","results","each","index","data","push","value","id","label","shortname","idnumber","transport","query","callback","el","onlyVisible","Error","onlyvisible","then","catch","exception"],"mappings":"AAwBAA,OAAM,iCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAAD,CAA+C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgC,CAEjF,MAAiE,CAS7DC,IAAI,CAAE,cAASC,CAAT,CAAoBC,CAApB,CAA6B,CAC/B,GAAIC,CAAAA,CAAI,CAAG,CACHC,OAAO,CAAE,CACLC,SAAS,CAAEJ,CADN,CADN,CAAX,CAMAJ,CAAC,CAACS,MAAF,CAASH,CAAT,CAAkC,WAAnB,QAAOD,CAAAA,CAAP,CAAiC,EAAjC,CAAsCA,CAArD,EACA,MAAOJ,CAAAA,CAAI,CAACS,IAAL,CAAU,CAAC,CACdC,UAAU,CAAE,4CADE,CAEdL,IAAI,CAAEA,CAFQ,CAAD,CAAV,EAGH,CAHG,CAIV,CArB4D,CA8B7DM,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIT,CAAAA,CAAO,CAAG,EAAd,CACAL,CAAC,CAACe,IAAF,CAAOD,CAAP,CAAgB,SAASE,CAAT,CAAgBC,CAAhB,CAAsB,CAClCZ,CAAO,CAACa,IAAR,CAAa,CACTC,KAAK,CAAEF,CAAI,CAACG,EADH,CAETC,KAAK,CAAEJ,CAAI,CAACK,SAAL,CAAiB,GAAjB,CAAuBL,CAAI,CAACM,QAF1B,CAAb,CAIH,CALD,EAMA,MAAOlB,CAAAA,CACV,CAvC4D,CAiD7DmB,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAoC,CAC3C,GAAIC,CAAAA,CAAE,CAAG3B,CAAC,CAACa,CAAD,CAAV,CACIT,CAAS,CAAGuB,CAAE,CAACV,IAAH,CAAQ,WAAR,CADhB,CAEIW,CAAW,CAAGD,CAAE,CAACV,IAAH,CAAQ,aAAR,CAFlB,CAIA,GAAI,CAACb,CAAL,CAAgB,CACZ,KAAM,IAAIyB,CAAAA,KAAJ,CAAU,+CAAiDhB,CAA3D,CACT,CACD,KAAKV,IAAL,CAAUC,CAAV,CAAqB,CACjBqB,KAAK,CAAEA,CADU,CAEjBK,WAAW,CAAEF,CAFI,CAArB,EAGGG,IAHH,CAGQL,CAHR,EAGkBM,KAHlB,CAGwB9B,CAAY,CAAC+B,SAHrC,CAIH,CA7D4D,CAgEpE,CAlEK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Frameworks datasource.\n *\n * This module is compatible with core/form-autocomplete.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notification) {\n\n return /** @alias module:tool_lpmigrate/frameworks_datasource */ {\n\n /**\n * List frameworks.\n *\n * @param {Number} contextId The context ID.\n * @param {Object} options Additional parameters to pass to the external function.\n * @return {Promise}\n */\n list: function(contextId, options) {\n var args = {\n context: {\n contextid: contextId\n }\n };\n\n $.extend(args, typeof options === 'undefined' ? {} : options);\n return Ajax.call([{\n methodname: 'core_competency_list_competency_frameworks',\n args: args\n }])[0];\n },\n\n /**\n * Process the results for auto complete elements.\n *\n * @param {String} selector The selector of the auto complete element.\n * @param {Array} results An array or results.\n * @return {Array} New array of results.\n */\n processResults: function(selector, results) {\n var options = [];\n $.each(results, function(index, data) {\n options.push({\n value: data.id,\n label: data.shortname + ' ' + data.idnumber\n });\n });\n return options;\n },\n\n /**\n * Source of data for Ajax element.\n *\n * @param {String} selector The selector of the auto complete element.\n * @param {String} query The query string.\n * @param {Function} callback A callback function receiving an array of results.\n */\n /* eslint-disable promise/no-callback-in-promise */\n transport: function(selector, query, callback) {\n var el = $(selector),\n contextId = el.data('contextid'),\n onlyVisible = el.data('onlyvisible');\n\n if (!contextId) {\n throw new Error('The attribute data-contextid is required on ' + selector);\n }\n this.list(contextId, {\n query: query,\n onlyvisible: onlyVisible,\n }).then(callback).catch(Notification.exception);\n }\n };\n\n});\n"],"file":"frameworks_datasource.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/frameworks_datasource.js"],"names":["define","$","Ajax","Notification","list","contextId","options","args","context","contextid","extend","call","methodname","processResults","selector","results","each","index","data","push","value","id","label","shortname","idnumber","transport","query","callback","el","onlyVisible","Error","onlyvisible","then","catch","exception"],"mappings":"AAyBAA,OAAM,iCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAAD,CAA+C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgC,CAEjF,MAAiE,CAS7DC,IAAI,CAAE,cAASC,CAAT,CAAoBC,CAApB,CAA6B,CAC/B,GAAIC,CAAAA,CAAI,CAAG,CACHC,OAAO,CAAE,CACLC,SAAS,CAAEJ,CADN,CADN,CAAX,CAMAJ,CAAC,CAACS,MAAF,CAASH,CAAT,CAAkC,WAAnB,QAAOD,CAAAA,CAAP,CAAiC,EAAjC,CAAsCA,CAArD,EACA,MAAOJ,CAAAA,CAAI,CAACS,IAAL,CAAU,CAAC,CACdC,UAAU,CAAE,4CADE,CAEdL,IAAI,CAAEA,CAFQ,CAAD,CAAV,EAGH,CAHG,CAIV,CArB4D,CA8B7DM,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIT,CAAAA,CAAO,CAAG,EAAd,CACAL,CAAC,CAACe,IAAF,CAAOD,CAAP,CAAgB,SAASE,CAAT,CAAgBC,CAAhB,CAAsB,CAClCZ,CAAO,CAACa,IAAR,CAAa,CACTC,KAAK,CAAEF,CAAI,CAACG,EADH,CAETC,KAAK,CAAEJ,CAAI,CAACK,SAAL,CAAiB,GAAjB,CAAuBL,CAAI,CAACM,QAF1B,CAAb,CAIH,CALD,EAMA,MAAOlB,CAAAA,CACV,CAvC4D,CAiD7DmB,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAoC,CAC3C,GAAIC,CAAAA,CAAE,CAAG3B,CAAC,CAACa,CAAD,CAAV,CACIT,CAAS,CAAGuB,CAAE,CAACV,IAAH,CAAQ,WAAR,CADhB,CAEIW,CAAW,CAAGD,CAAE,CAACV,IAAH,CAAQ,aAAR,CAFlB,CAIA,GAAI,CAACb,CAAL,CAAgB,CACZ,KAAM,IAAIyB,CAAAA,KAAJ,CAAU,+CAAiDhB,CAA3D,CACT,CACD,KAAKV,IAAL,CAAUC,CAAV,CAAqB,CACjBqB,KAAK,CAAEA,CADU,CAEjBK,WAAW,CAAEF,CAFI,CAArB,EAGGG,IAHH,CAGQL,CAHR,EAGkBM,KAHlB,CAGwB9B,CAAY,CAAC+B,SAHrC,CAIH,CA7D4D,CAgEpE,CAlEK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Frameworks datasource.\n *\n * This module is compatible with core/form-autocomplete.\n *\n * @module tool_lp/frameworks_datasource\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notification) {\n\n return /** @alias module:tool_lpmigrate/frameworks_datasource */ {\n\n /**\n * List frameworks.\n *\n * @param {Number} contextId The context ID.\n * @param {Object} options Additional parameters to pass to the external function.\n * @return {Promise}\n */\n list: function(contextId, options) {\n var args = {\n context: {\n contextid: contextId\n }\n };\n\n $.extend(args, typeof options === 'undefined' ? {} : options);\n return Ajax.call([{\n methodname: 'core_competency_list_competency_frameworks',\n args: args\n }])[0];\n },\n\n /**\n * Process the results for auto complete elements.\n *\n * @param {String} selector The selector of the auto complete element.\n * @param {Array} results An array or results.\n * @return {Array} New array of results.\n */\n processResults: function(selector, results) {\n var options = [];\n $.each(results, function(index, data) {\n options.push({\n value: data.id,\n label: data.shortname + ' ' + data.idnumber\n });\n });\n return options;\n },\n\n /**\n * Source of data for Ajax element.\n *\n * @param {String} selector The selector of the auto complete element.\n * @param {String} query The query string.\n * @param {Function} callback A callback function receiving an array of results.\n */\n /* eslint-disable promise/no-callback-in-promise */\n transport: function(selector, query, callback) {\n var el = $(selector),\n contextId = el.data('contextid'),\n onlyVisible = el.data('onlyvisible');\n\n if (!contextId) {\n throw new Error('The attribute data-contextid is required on ' + selector);\n }\n this.list(contextId, {\n query: query,\n onlyvisible: onlyVisible,\n }).then(callback).catch(Notification.exception);\n }\n };\n\n});\n"],"file":"frameworks_datasource.min.js"} \ No newline at end of file diff --git a/admin/tool/lp/amd/build/grade_dialogue.min.js.map b/admin/tool/lp/amd/build/grade_dialogue.min.js.map index 5e0daf222614a..e8fb63a2ee1be 100644 --- a/admin/tool/lp/amd/build/grade_dialogue.min.js.map +++ b/admin/tool/lp/amd/build/grade_dialogue.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/grade_dialogue.js"],"names":["define","$","Notification","Templates","Dialogue","EventBase","Str","Grade","ratingOptions","prototype","constructor","apply","_ratingOptions","Object","create","_popup","_afterRender","btnRate","_find","lstRating","txtComment","click","e","preventDefault","_trigger","close","bind","change","node","val","prop","display","M","util","js_pending","when","get_string","_render","then","title","templateResult","js_complete","catch","exception","selector","getContent","find","context","cangrade","_canGrade","ratings","render"],"mappings":"AAsBAA,OAAM,0BAAC,CAAC,QAAD,CACC,mBADD,CAEC,gBAFD,CAGC,kBAHD,CAIC,oBAJD,CAKC,UALD,CAAD,CAME,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAqCC,CAArC,CAA+CC,CAA/C,CAA0DC,CAA1D,CAA+D,CAMnE,GAAIC,CAAAA,CAAK,CAAG,SAASC,CAAT,CAAwB,CAChCH,CAAS,CAACI,SAAV,CAAoBC,WAApB,CAAgCC,KAAhC,CAAsC,IAAtC,CAA4C,EAA5C,EACA,KAAKC,cAAL,CAAsBJ,C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,CAlIK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Grade dialogue.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/templates',\n 'tool_lp/dialogue',\n 'tool_lp/event_base',\n 'core/str'],\n function($, Notification, Templates, Dialogue, EventBase, Str) {\n\n /**\n * Grade dialogue class.\n * @param {Array} ratingOptions\n */\n var Grade = function(ratingOptions) {\n EventBase.prototype.constructor.apply(this, []);\n this._ratingOptions = ratingOptions;\n };\n Grade.prototype = Object.create(EventBase.prototype);\n\n /** @property {Dialogue} The dialogue. */\n Grade.prototype._popup = null;\n /** @property {Array} Array of objects containing, 'value', 'name' and optionally 'selected'. */\n Grade.prototype._ratingOptions = null;\n\n /**\n * After render hook.\n *\n * @method _afterRender\n * @protected\n */\n Grade.prototype._afterRender = function() {\n var btnRate = this._find('[data-action=\"rate\"]'),\n lstRating = this._find('[name=\"rating\"]'),\n txtComment = this._find('[name=\"comment\"]');\n\n this._find('[data-action=\"cancel\"]').click(function(e) {\n e.preventDefault();\n this._trigger('cancelled');\n this.close();\n }.bind(this));\n\n lstRating.change(function() {\n var node = $(this);\n if (!node.val()) {\n btnRate.prop('disabled', true);\n } else {\n btnRate.prop('disabled', false);\n }\n }).change();\n\n btnRate.click(function(e) {\n e.preventDefault();\n var val = lstRating.val();\n if (!val) {\n return;\n }\n this._trigger('rated', {\n 'rating': val,\n 'note': txtComment.val()\n });\n this.close();\n }.bind(this));\n };\n\n /**\n * Close the dialogue.\n *\n * @method close\n */\n Grade.prototype.close = function() {\n this._popup.close();\n this._popup = null;\n };\n\n /**\n * Opens the picker.\n *\n * @param {Number} competencyId The competency ID of the competency to work on.\n * @method display\n * @return {Promise}\n */\n Grade.prototype.display = function() {\n M.util.js_pending('tool_lp/grade_dialogue:display');\n return $.when(\n Str.get_string('rate', 'tool_lp'),\n this._render()\n )\n .then(function(title, templateResult) {\n this._popup = new Dialogue(\n title,\n templateResult[0],\n function() {\n this._afterRender();\n M.util.js_complete('tool_lp/grade_dialogue:display');\n }.bind(this)\n );\n\n return this._popup;\n }.bind(this))\n .catch(Notification.exception);\n };\n\n /**\n * Find a node in the dialogue.\n *\n * @param {String} selector\n * @method _find\n * @returns {node} The node\n * @protected\n */\n Grade.prototype._find = function(selector) {\n return $(this._popup.getContent()).find(selector);\n };\n\n /**\n * Render the dialogue.\n *\n * @method _render\n * @protected\n * @return {Promise}\n */\n Grade.prototype._render = function() {\n var context = {\n cangrade: this._canGrade,\n ratings: this._ratingOptions\n };\n return Templates.render('tool_lp/competency_grader', context);\n };\n\n return /** @alias module:tool_lp/grade_dialogue */ Grade;\n\n});\n"],"file":"grade_dialogue.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/grade_dialogue.js"],"names":["define","$","Notification","Templates","Dialogue","EventBase","Str","Grade","ratingOptions","prototype","constructor","apply","_ratingOptions","Object","create","_popup","_afterRender","btnRate","_find","lstRating","txtComment","click","e","preventDefault","_trigger","close","bind","change","node","val","prop","display","M","util","js_pending","when","get_string","_render","then","title","templateResult","js_complete","catch","exception","selector","getContent","find","context","cangrade","_canGrade","ratings","render"],"mappings":"AAuBAA,OAAM,0BAAC,CAAC,QAAD,CACC,mBADD,CAEC,gBAFD,CAGC,kBAHD,CAIC,oBAJD,CAKC,UALD,CAAD,CAME,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAqCC,CAArC,CAA+CC,CAA/C,CAA0DC,C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C,QAAQ,CAAE,KAAKC,SADL,CAEVC,OAAO,CAAE,KAAKtC,cAFJ,CAAd,CAIA,MAAOT,CAAAA,CAAS,CAACgD,MAAV,CAAiB,2BAAjB,CAA8CJ,CAA9C,CACV,CAND,CAQA,MAAOxC,CAAAA,CACV,CAnIK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Grade dialogue.\n *\n * @module tool_lp/grade_dialogue\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/templates',\n 'tool_lp/dialogue',\n 'tool_lp/event_base',\n 'core/str'],\n function($, Notification, Templates, Dialogue, EventBase, Str) {\n\n /**\n * Grade dialogue class.\n *\n * @class tool_lp/grade_dialogue\n * @param {Array} ratingOptions\n */\n var Grade = function(ratingOptions) {\n EventBase.prototype.constructor.apply(this, []);\n this._ratingOptions = ratingOptions;\n };\n Grade.prototype = Object.create(EventBase.prototype);\n\n /** @property {Dialogue} The dialogue. */\n Grade.prototype._popup = null;\n /** @property {Array} Array of objects containing, 'value', 'name' and optionally 'selected'. */\n Grade.prototype._ratingOptions = null;\n\n /**\n * After render hook.\n *\n * @method _afterRender\n * @protected\n */\n Grade.prototype._afterRender = function() {\n var btnRate = this._find('[data-action=\"rate\"]'),\n lstRating = this._find('[name=\"rating\"]'),\n txtComment = this._find('[name=\"comment\"]');\n\n this._find('[data-action=\"cancel\"]').click(function(e) {\n e.preventDefault();\n this._trigger('cancelled');\n this.close();\n }.bind(this));\n\n lstRating.change(function() {\n var node = $(this);\n if (!node.val()) {\n btnRate.prop('disabled', true);\n } else {\n btnRate.prop('disabled', false);\n }\n }).change();\n\n btnRate.click(function(e) {\n e.preventDefault();\n var val = lstRating.val();\n if (!val) {\n return;\n }\n this._trigger('rated', {\n 'rating': val,\n 'note': txtComment.val()\n });\n this.close();\n }.bind(this));\n };\n\n /**\n * Close the dialogue.\n *\n * @method close\n */\n Grade.prototype.close = function() {\n this._popup.close();\n this._popup = null;\n };\n\n /**\n * Opens the picker.\n *\n * @param {Number} competencyId The competency ID of the competency to work on.\n * @method display\n * @return {Promise}\n */\n Grade.prototype.display = function() {\n M.util.js_pending('tool_lp/grade_dialogue:display');\n return $.when(\n Str.get_string('rate', 'tool_lp'),\n this._render()\n )\n .then(function(title, templateResult) {\n this._popup = new Dialogue(\n title,\n templateResult[0],\n function() {\n this._afterRender();\n M.util.js_complete('tool_lp/grade_dialogue:display');\n }.bind(this)\n );\n\n return this._popup;\n }.bind(this))\n .catch(Notification.exception);\n };\n\n /**\n * Find a node in the dialogue.\n *\n * @param {String} selector\n * @method _find\n * @returns {node} The node\n * @protected\n */\n Grade.prototype._find = function(selector) {\n return $(this._popup.getContent()).find(selector);\n };\n\n /**\n * Render the dialogue.\n *\n * @method _render\n * @protected\n * @return {Promise}\n */\n Grade.prototype._render = function() {\n var context = {\n cangrade: this._canGrade,\n ratings: this._ratingOptions\n };\n return Templates.render('tool_lp/competency_grader', context);\n };\n\n return Grade;\n});\n"],"file":"grade_dialogue.min.js"} \ No newline at end of file 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 index 781e3f2be5205..e790eba7c9ea7 100644 --- 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 @@ -1 +1 @@ -{"version":3,"sources":["../src/grade_user_competency_inline.js"],"names":["define","$","notification","ajax","log","GradeDialogue","EventBase","ScaleValues","InlineEditor","selector","scaleId","competencyId","userId","planId","courseId","chooseStr","prototype","constructor","apply","trigger","length","Error","_scaleId","_competencyId","_userId","_planId","_courseId","_chooseStr","_setUp","click","e","preventDefault","_dialogue","display","bind","_methodName","_args","competencyid","planid","courseid","userid","Object","create","options","self","M","util","js_pending","promise","get_values","then","scalevalues","push","value","name","i","optionConfig","id","dialogue","on","data","args","grade","rating","note","call","methodname","done","evidence","_trigger","fail","exception","js_complete"],"mappings":"AAsBAA,OAAM,wCAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,UAHD,CAIC,wBAJD,CAKC,oBALD,CAMC,qBAND,CAAD,CAOC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAAqCC,CAArC,CAAoDC,CAApD,CAA+DC,CAA/D,CAA4E,CAa/E,GAAIC,CAAAA,CAAY,CAAG,SAASC,CAAT,CAAmBC,CAAnB,CAA4BC,CAA5B,CAA0CC,CAA1C,CAAkDC,CAAlD,CAA0DC,CAA1D,CAAoEC,CAApE,CAA+E,CAC9FT,CAAS,CAACU,SAAV,CAAoBC,WAApB,CAAgCC,KAAhC,CAAsC,IAAtC,CAA4C,EAA5C,EAEA,GAAIC,CAAAA,CAAO,CAAGlB,CAAC,CAACQ,CAAD,CAAf,CACA,GAAI,CAACU,CAAO,CAACC,MAAb,CAAqB,CACjB,KAAM,IAAIC,CAAAA,KAAJ,CAAU,4BAAV,CACT,CAED,KAAKC,QAAL,CAAgBZ,CAAhB,CACA,KAAKa,aAAL,CAAqBZ,CAArB,CACA,KAAKa,OAAL,CAAeZ,CAAf,CACA,KAAKa,OAAL,CAAeZ,CAAf,CACA,KAAKa,SAAL,CAAiBZ,CAAjB,CACA,KAAKa,UAAL,CAAkBZ,CAAlB,CACA,KAAKa,MAAL,GAEAT,CAAO,CAACU,KAAR,CAAc,SAASC,CAAT,CAAY,CACtBA,CAAC,CAACC,cAAF,GACA,KAA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aAAvB,CAAuC,IAAvC,CAEAf,CAAY,CAACQ,SAAb,CAAuBQ,OAAvB,CAAiC,IAAjC,CAEAhB,CAAY,CAACQ,SAAb,CAAuBS,OAAvB,CAAiC,IAAjC,CAEAjB,CAAY,CAACQ,SAAb,CAAuBU,SAAvB,CAAmC,IAAnC,CAEAlB,CAAY,CAACQ,SAAb,CAAuBW,UAAvB,CAAoC,IAApC,CAEAnB,CAAY,CAACQ,SAAb,CAAuBgB,SAAvB,CAAmC,IAAnC,CAEA,MAAiExB,CAAAA,CAEpE,CAzIK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to enable inline editing of a comptency grade.\n *\n * @copyright 2015 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/log',\n 'tool_lp/grade_dialogue',\n 'tool_lp/event_base',\n 'tool_lp/scalevalues',\n ], function($, notification, ajax, log, GradeDialogue, EventBase, ScaleValues) {\n\n /**\n * InlineEditor\n *\n * @param {String} selector The selector to trigger the grading.\n * @param {Number} scaleId The id of the scale for this competency.\n * @param {Number} competencyId The id of the competency.\n * @param {Number} userId The id of the user.\n * @param {Number} planId The id of the plan.\n * @param {Number} courseId The id of the course.\n * @param {String} chooseStr Language string for choose a rating.\n */\n var InlineEditor = function(selector, scaleId, competencyId, userId, planId, courseId, chooseStr) {\n EventBase.prototype.constructor.apply(this, []);\n\n var trigger = $(selector);\n if (!trigger.length) {\n throw new Error('Could not find the trigger');\n }\n\n this._scaleId = scaleId;\n this._competencyId = competencyId;\n this._userId = userId;\n this._planId = planId;\n this._courseId = courseId;\n this._chooseStr = chooseStr;\n this._setUp();\n\n trigger.click(function(e) {\n e.preventDefault();\n this._dialogue.display();\n }.bind(this));\n\n if (this._planId) {\n this._methodName = 'core_competency_grade_competency_in_plan';\n this._args = {\n competencyid: this._competencyId,\n planid: this._planId\n };\n } else if (this._courseId) {\n this._methodName = 'core_competency_grade_competency_in_course';\n this._args = {\n competencyid: this._competencyId,\n courseid: this._courseId,\n userid: this._userId\n };\n } else {\n this._methodName = 'core_competency_grade_competency';\n this._args = {\n userid: this._userId,\n competencyid: this._competencyId\n };\n }\n };\n InlineEditor.prototype = Object.create(EventBase.prototype);\n\n /**\n * Setup.\n *\n * @method _setUp\n */\n InlineEditor.prototype._setUp = function() {\n var options = [],\n self = this;\n\n M.util.js_pending('tool_lp/grade_user_competency_inline:_setUp');\n var promise = ScaleValues.get_values(self._scaleId);\n promise.then(function(scalevalues) {\n options.push({\n value: '',\n name: self._chooseStr\n });\n\n for (var i = 0; i < scalevalues.length; i++) {\n var optionConfig = scalevalues[i];\n options.push({\n value: optionConfig.id,\n name: optionConfig.name\n });\n }\n\n return options;\n })\n .then(function(options) {\n return new GradeDialogue(options);\n })\n .then(function(dialogue) {\n dialogue.on('rated', function(e, data) {\n var args = self._args;\n args.grade = data.rating;\n args.note = data.note;\n ajax.call([{\n methodname: self._methodName,\n args: args,\n done: function(evidence) {\n self._trigger('competencyupdated', {args: args, evidence: evidence});\n },\n fail: notification.exception\n }]);\n });\n\n return dialogue;\n })\n .then(function(dialogue) {\n self._dialogue = dialogue;\n\n M.util.js_complete('tool_lp/grade_user_competency_inline:_setUp');\n return;\n })\n .fail(notification.exception);\n };\n\n /** @property {Number} The scale id for this competency. */\n InlineEditor.prototype._scaleId = null;\n /** @property {Number} The id of the competency. */\n InlineEditor.prototype._competencyId = null;\n /** @property {Number} The id of the user. */\n InlineEditor.prototype._userId = null;\n /** @property {Number} The id of the plan. */\n InlineEditor.prototype._planId = null;\n /** @property {Number} The id of the course. */\n InlineEditor.prototype._courseId = null;\n /** @property {String} The text for Choose rating. */\n InlineEditor.prototype._chooseStr = null;\n /** @property {GradeDialogue} The grading dialogue. */\n InlineEditor.prototype._dialogue = null;\n\n return /** @alias module:tool_lp/grade_user_competency_inline */ InlineEditor;\n\n});\n"],"file":"grade_user_competency_inline.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/grade_user_competency_inline.js"],"names":["define","$","notification","ajax","log","GradeDialogue","EventBase","ScaleValues","InlineEditor","selector","scaleId","competencyId","userId","planId","courseId","chooseStr","prototype","constructor","apply","trigger","length","Error","_scaleId","_competencyId","_userId","_planId","_courseId","_chooseStr","_setUp","click","e","preventDefault","_dialogue","display","bind","_methodName","_args","competencyid","planid","courseid","userid","Object","create","options","self","M","util","js_pending","promise","get_values","then","scalevalues","push","value","name","i","optionConfig","id","dialogue","on","data","args","grade","rating","note","call","methodname","done","evidence","_trigger","fail","exception","js_complete"],"mappings":"AAuBAA,OAAM,wCAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,UAHD,CAIC,wBAJD,CAKC,oBALD,CAMC,qBAND,CAAD,CAOC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAAqCC,CAArC,CAAoDC,CAApD,CAA+DC,CAA/D,CAA4E,CAc/E,GAAIC,CAAAA,CAAY,CAAG,SAASC,CAAT,CAAmBC,CAAnB,CAA4BC,CAA5B,CAA0CC,CAA1C,CAAkDC,CAAlD,CAA0DC,CAA1D,CAAoEC,CAApE,CAA+E,CAC9FT,CAAS,CAACU,SAAV,CAAoBC,WAApB,CAAgCC,KAAhC,CAAsC,IAAtC,CAA4C,EAA5C,EAEA,GAAIC,CAAAA,CAAO,CAAGlB,CAAC,CAACQ,CAAD,CAAf,CACA,GAAI,CAACU,CAAO,CAACC,MAAb,CAAqB,CACjB,KAAM,IAAIC,CAAAA,KA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AAAA,CACV,CAnCD,EAoCCR,IApCD,CAoCM,SAASQ,CAAT,CAAmB,CACrBd,CAAI,CAACZ,SAAL,CAAiB0B,CAAjB,CAEAb,CAAC,CAACC,IAAF,CAAO0B,WAAP,CAAmB,6CAAnB,CAEH,CAzCD,EA0CCF,IA1CD,CA0CMpE,CAAY,CAACqE,SA1CnB,CA2CH,CAjDD,CAoDA/D,CAAY,CAACQ,SAAb,CAAuBM,QAAvB,CAAkC,IAAlC,CAEAd,CAAY,CAACQ,SAAb,CAAuBO,aAAvB,CAAuC,IAAvC,CAEAf,CAAY,CAACQ,SAAb,CAAuBQ,OAAvB,CAAiC,IAAjC,CAEAhB,CAAY,CAACQ,SAAb,CAAuBS,OAAvB,CAAiC,IAAjC,CAEAjB,CAAY,CAACQ,SAAb,CAAuBU,SAAvB,CAAmC,IAAnC,CAEAlB,CAAY,CAACQ,SAAb,CAAuBW,UAAvB,CAAoC,IAApC,CAEAnB,CAAY,CAACQ,SAAb,CAAuBgB,SAAvB,CAAmC,IAAnC,CAEA,MAAOxB,CAAAA,CACV,CAzIK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to enable inline editing of a comptency grade.\n *\n * @module tool_lp/grade_user_competency_inline\n * @copyright 2015 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/log',\n 'tool_lp/grade_dialogue',\n 'tool_lp/event_base',\n 'tool_lp/scalevalues',\n ], function($, notification, ajax, log, GradeDialogue, EventBase, ScaleValues) {\n\n /**\n * InlineEditor\n *\n * @class tool_lp/grade_user_competency_inline\n * @param {String} selector The selector to trigger the grading.\n * @param {Number} scaleId The id of the scale for this competency.\n * @param {Number} competencyId The id of the competency.\n * @param {Number} userId The id of the user.\n * @param {Number} planId The id of the plan.\n * @param {Number} courseId The id of the course.\n * @param {String} chooseStr Language string for choose a rating.\n */\n var InlineEditor = function(selector, scaleId, competencyId, userId, planId, courseId, chooseStr) {\n EventBase.prototype.constructor.apply(this, []);\n\n var trigger = $(selector);\n if (!trigger.length) {\n throw new Error('Could not find the trigger');\n }\n\n this._scaleId = scaleId;\n this._competencyId = competencyId;\n this._userId = userId;\n this._planId = planId;\n this._courseId = courseId;\n this._chooseStr = chooseStr;\n this._setUp();\n\n trigger.click(function(e) {\n e.preventDefault();\n this._dialogue.display();\n }.bind(this));\n\n if (this._planId) {\n this._methodName = 'core_competency_grade_competency_in_plan';\n this._args = {\n competencyid: this._competencyId,\n planid: this._planId\n };\n } else if (this._courseId) {\n this._methodName = 'core_competency_grade_competency_in_course';\n this._args = {\n competencyid: this._competencyId,\n courseid: this._courseId,\n userid: this._userId\n };\n } else {\n this._methodName = 'core_competency_grade_competency';\n this._args = {\n userid: this._userId,\n competencyid: this._competencyId\n };\n }\n };\n InlineEditor.prototype = Object.create(EventBase.prototype);\n\n /**\n * Setup.\n *\n * @method _setUp\n */\n InlineEditor.prototype._setUp = function() {\n var options = [],\n self = this;\n\n M.util.js_pending('tool_lp/grade_user_competency_inline:_setUp');\n var promise = ScaleValues.get_values(self._scaleId);\n promise.then(function(scalevalues) {\n options.push({\n value: '',\n name: self._chooseStr\n });\n\n for (var i = 0; i < scalevalues.length; i++) {\n var optionConfig = scalevalues[i];\n options.push({\n value: optionConfig.id,\n name: optionConfig.name\n });\n }\n\n return options;\n })\n .then(function(options) {\n return new GradeDialogue(options);\n })\n .then(function(dialogue) {\n dialogue.on('rated', function(e, data) {\n var args = self._args;\n args.grade = data.rating;\n args.note = data.note;\n ajax.call([{\n methodname: self._methodName,\n args: args,\n done: function(evidence) {\n self._trigger('competencyupdated', {args: args, evidence: evidence});\n },\n fail: notification.exception\n }]);\n });\n\n return dialogue;\n })\n .then(function(dialogue) {\n self._dialogue = dialogue;\n\n M.util.js_complete('tool_lp/grade_user_competency_inline:_setUp');\n return;\n })\n .fail(notification.exception);\n };\n\n /** @property {Number} The scale id for this competency. */\n InlineEditor.prototype._scaleId = null;\n /** @property {Number} The id of the competency. */\n InlineEditor.prototype._competencyId = null;\n /** @property {Number} The id of the user. */\n InlineEditor.prototype._userId = null;\n /** @property {Number} The id of the plan. */\n InlineEditor.prototype._planId = null;\n /** @property {Number} The id of the course. */\n InlineEditor.prototype._courseId = null;\n /** @property {String} The text for Choose rating. */\n InlineEditor.prototype._chooseStr = null;\n /** @property {GradeDialogue} The grading dialogue. */\n InlineEditor.prototype._dialogue = null;\n\n return InlineEditor;\n});\n"],"file":"grade_user_competency_inline.min.js"} \ No newline at end of file diff --git a/admin/tool/lp/amd/build/module_navigation.min.js.map b/admin/tool/lp/amd/build/module_navigation.min.js.map index 4d18c8cc7fd45..6b1405383eb20 100644 --- a/admin/tool/lp/amd/build/module_navigation.min.js.map +++ b/admin/tool/lp/amd/build/module_navigation.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/module_navigation.js"],"names":["define","$","ModuleNavigation","moduleSelector","baseUrl","courseId","moduleId","_baseUrl","_moduleId","_courseId","on","_moduleChanged","bind","prototype","e","newModuleId","target","val","queryStr","document","location"],"mappings":"AAsBAA,OAAM,6BAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAU3B,GAAIC,CAAAA,CAAgB,CAAG,SAASC,CAAT,CAAyBC,CAAzB,CAAkCC,CAAlC,CAA4CC,CAA5C,CAAsD,CACzE,KAAKC,QAAL,CAAgBH,CAAhB,CACA,KAAKI,SAAL,CAAiBF,CAAjB,CACA,KAAKG,SAAL,CAAiBJ,CAAjB,CAEAJ,CAAC,CAACE,CAAD,CAAD,CAAkBO,EAAlB,CAAqB,QAArB,CAA+B,KAAKC,cAAL,CAAoBC,IAApB,CAAyB,IAAzB,CAA/B,CACH,CAND,CAcAV,CAAgB,CAACW,SAAjB,CAA2BF,cAA3B,CAA4C,SAASG,CAAT,CAAY,IAChDC,CAAAA,CAAW,CAAGd,CAAC,CAACa,CAAC,CAACE,MAAH,CAAD,CAAYC,GAAZ,EADkC,CAEhDC,CAAQ,CAAG,QAAUH,CAAV,CAAwB,YAAxB,CAAuC,KAAKN,SAFP,CAGpDU,QAAQ,CAACC,QAAT,CAAoB,KAAKb,QAAL,CAAgBW,CACvC,CAJD,CAOAhB,CAAgB,CAACW,SAAjB,CAA2BJ,SAA3B,CAAuC,IAAvC,CAEAP,CAAgB,CAACW,SAAjB,CAA2BL,SAA3B,CAAuC,IAAvC,CAEAN,CAAgB,CAACW,SAAjB,CAA2BN,QAA3B,CAAsC,IAAtC,CAEA,MAAsDL,CAAAA,CACzD,CAtCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to navigation between users in a course.\n *\n * @copyright 2019 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n /**\n * ModuleNavigation\n *\n * @param {String} moduleSelector The selector of the module element.\n * @param {String} baseUrl The base url for the page (no params).\n * @param {Number} courseId The course id\n * @param {Number} moduleId The activity module (filter)\n */\n var ModuleNavigation = function(moduleSelector, baseUrl, courseId, moduleId) {\n this._baseUrl = baseUrl;\n this._moduleId = moduleId;\n this._courseId = courseId;\n\n $(moduleSelector).on('change', this._moduleChanged.bind(this));\n };\n\n /**\n * The module was changed in the select list.\n *\n * @method _moduleChanged\n * @param {Event} e the event\n */\n ModuleNavigation.prototype._moduleChanged = function(e) {\n var newModuleId = $(e.target).val();\n var queryStr = '?mod=' + newModuleId + '&courseid=' + this._courseId;\n document.location = this._baseUrl + queryStr;\n };\n\n /** @property {Number} The id of the course. */\n ModuleNavigation.prototype._courseId = null;\n /** @property {Number} The id of the module. */\n ModuleNavigation.prototype._moduleId = null;\n /** @property {String} Plugin base url. */\n ModuleNavigation.prototype._baseUrl = null;\n\n return /** @alias module:tool_lp/module_navigation */ ModuleNavigation;\n});\n"],"file":"module_navigation.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/module_navigation.js"],"names":["define","$","ModuleNavigation","moduleSelector","baseUrl","courseId","moduleId","_baseUrl","_moduleId","_courseId","on","_moduleChanged","bind","prototype","e","newModuleId","target","val","queryStr","document","location"],"mappings":"AAuBAA,OAAM,6BAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAW3B,GAAIC,CAAAA,CAAgB,CAAG,SAASC,CAAT,CAAyBC,CAAzB,CAAkCC,CAAlC,CAA4CC,CAA5C,CAAsD,CACzE,KAAKC,QAAL,CAAgBH,CAAhB,CACA,KAAKI,SAAL,CAAiBF,CAAjB,CACA,KAAKG,SAAL,CAAiBJ,CAAjB,CAEAJ,CAAC,CAACE,CAAD,CAAD,CAAkBO,EAAlB,CAAqB,QAArB,CAA+B,KAAKC,cAAL,CAAoBC,IAApB,CAAyB,IAAzB,CAA/B,CACH,CAND,CAcAV,CAAgB,CAACW,SAAjB,CAA2BF,cAA3B,CAA4C,SAASG,CAAT,CAAY,IAChDC,CAAAA,CAAW,CAAGd,CAAC,CAACa,CAAC,CAACE,MAAH,CAAD,CAAYC,GAAZ,EADkC,CAEhDC,CAAQ,CAAG,QAAUH,CAAV,CAAwB,YAAxB,CAAuC,KAAKN,SAFP,CAGpDU,QAAQ,CAACC,QAAT,CAAoB,KAAKb,QAAL,CAAgBW,CACvC,CAJD,CAOAhB,CAAgB,CAACW,SAAjB,CAA2BJ,SAA3B,CAAuC,IAAvC,CAEAP,CAAgB,CAACW,SAAjB,CAA2BL,SAA3B,CAAuC,IAAvC,CAEAN,CAAgB,CAACW,SAAjB,CAA2BN,QAA3B,CAAsC,IAAtC,CAEA,MAAOL,CAAAA,CACV,CAvCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to navigation between users in a course.\n *\n * @module tool_lp/module_navigation\n * @copyright 2019 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n /**\n * ModuleNavigation\n *\n * @class tool_lp/module_navigation\n * @param {String} moduleSelector The selector of the module element.\n * @param {String} baseUrl The base url for the page (no params).\n * @param {Number} courseId The course id\n * @param {Number} moduleId The activity module (filter)\n */\n var ModuleNavigation = function(moduleSelector, baseUrl, courseId, moduleId) {\n this._baseUrl = baseUrl;\n this._moduleId = moduleId;\n this._courseId = courseId;\n\n $(moduleSelector).on('change', this._moduleChanged.bind(this));\n };\n\n /**\n * The module was changed in the select list.\n *\n * @method _moduleChanged\n * @param {Event} e the event\n */\n ModuleNavigation.prototype._moduleChanged = function(e) {\n var newModuleId = $(e.target).val();\n var queryStr = '?mod=' + newModuleId + '&courseid=' + this._courseId;\n document.location = this._baseUrl + queryStr;\n };\n\n /** @property {Number} The id of the course. */\n ModuleNavigation.prototype._courseId = null;\n /** @property {Number} The id of the module. */\n ModuleNavigation.prototype._moduleId = null;\n /** @property {String} Plugin base url. */\n ModuleNavigation.prototype._baseUrl = null;\n\n return ModuleNavigation;\n});\n"],"file":"module_navigation.min.js"} \ No newline at end of file diff --git a/admin/tool/lp/amd/build/scalevalues.min.js.map b/admin/tool/lp/amd/build/scalevalues.min.js.map index 1911e3eea84ca..d652b9fb38df6 100644 --- a/admin/tool/lp/amd/build/scalevalues.min.js.map +++ b/admin/tool/lp/amd/build/scalevalues.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/scalevalues.js"],"names":["define","$","ajax","localCache","get_values","scaleid","deferred","Deferred","call","methodname","args","done","scaleinfo","resolve","fail","reject","promise"],"mappings":"AAqBAA,OAAM,uBAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAC9C,GAAIC,CAAAA,CAAU,CAAG,EAAjB,CAEA,MAAgD,CAU5CC,UAAU,CAAE,oBAASC,CAAT,CAAkB,CAE1B,GAAIC,CAAAA,CAAQ,CAAGL,CAAC,CAACM,QAAF,EAAf,CAEA,GAAmC,WAA/B,QAAOJ,CAAAA,CAAU,CAACE,CAAD,CAArB,CAAgD,CAC5CH,CAAI,CAACM,IAAL,CAAU,CAAC,CACPC,UAAU,CAAE,kCADL,CAEPC,IAAI,CAAE,CAACL,OAAO,CAAEA,CAAV,CAFC,CAGPM,IAAI,CAAE,cAASC,CAAT,CAAoB,CACtBT,CAAU,CAACE,CAAD,CAAV,CAAsBO,CAAtB,CACAN,CAAQ,CAACO,OAAT,CAAiBD,CAAjB,CACH,CANM,CAOPE,IAAI,CAAGR,CAAQ,CAACS,MAPT,CAAD,CAAV,CASH,CAVD,IAUO,CACHT,CAAQ,CAACO,OAAT,CAAiBV,CAAU,CAACE,CAAD,CAA3B,CACH,CAED,MAAOC,CAAAA,CAAQ,CAACU,OAAT,EACV,CA7B2C,CA+BnD,CAlCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to get the scale values.\n *\n * @copyright 2016 Serge Gauthier\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax'], function($, ajax) {\n var localCache = [];\n\n return /** @alias module:tool_lp/scalevalues */ {\n\n /**\n * Return a promise object that will be resolved into a string eventually (maybe immediately).\n *\n * @method get_values\n * @param {Number} scaleid The scale id\n * @return [] {Promise}\n */\n // eslint-disable-next-line camelcase\n get_values: function(scaleid) {\n\n var deferred = $.Deferred();\n\n if (typeof localCache[scaleid] === 'undefined') {\n ajax.call([{\n methodname: 'core_competency_get_scale_values',\n args: {scaleid: scaleid},\n done: function(scaleinfo) {\n localCache[scaleid] = scaleinfo;\n deferred.resolve(scaleinfo);\n },\n fail: (deferred.reject)\n }]);\n } else {\n deferred.resolve(localCache[scaleid]);\n }\n\n return deferred.promise();\n }\n };\n});\n"],"file":"scalevalues.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/scalevalues.js"],"names":["define","$","ajax","localCache","get_values","scaleid","deferred","Deferred","call","methodname","args","done","scaleinfo","resolve","fail","reject","promise"],"mappings":"AAsBAA,OAAM,uBAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAC9C,GAAIC,CAAAA,CAAU,CAAG,EAAjB,CAEA,MAAO,CAUHC,UAAU,CAAE,oBAASC,CAAT,CAAkB,CAE1B,GAAIC,CAAAA,CAAQ,CAAGL,CAAC,CAACM,QAAF,EAAf,CAEA,GAAmC,WAA/B,QAAOJ,CAAAA,CAAU,CAACE,CAAD,CAArB,CAAgD,CAC5CH,CAAI,CAACM,IAAL,CAAU,CAAC,CACPC,UAAU,CAAE,kCADL,CAEPC,IAAI,CAAE,CAACL,OAAO,CAAEA,CAAV,CAFC,CAGPM,IAAI,CAAE,cAASC,CAAT,CAAoB,CACtBT,CAAU,CAACE,CAAD,CAAV,CAAsBO,CAAtB,CACAN,CAAQ,CAACO,OAAT,CAAiBD,CAAjB,CACH,CANM,CAOPE,IAAI,CAAGR,CAAQ,CAACS,MAPT,CAAD,CAAV,CASH,CAVD,IAUO,CACHT,CAAQ,CAACO,OAAT,CAAiBV,CAAU,CAACE,CAAD,CAA3B,CACH,CAED,MAAOC,CAAAA,CAAQ,CAACU,OAAT,EACV,CA7BE,CA+BV,CAlCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to get the scale values.\n *\n * @module tool_lp/scalevalues\n * @copyright 2016 Serge Gauthier\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax'], function($, ajax) {\n var localCache = [];\n\n return {\n\n /**\n * Return a promise object that will be resolved into a string eventually (maybe immediately).\n *\n * @method get_values\n * @param {Number} scaleid The scale id\n * @return [] {Promise}\n */\n // eslint-disable-next-line camelcase\n get_values: function(scaleid) {\n\n var deferred = $.Deferred();\n\n if (typeof localCache[scaleid] === 'undefined') {\n ajax.call([{\n methodname: 'core_competency_get_scale_values',\n args: {scaleid: scaleid},\n done: function(scaleinfo) {\n localCache[scaleid] = scaleinfo;\n deferred.resolve(scaleinfo);\n },\n fail: (deferred.reject)\n }]);\n } else {\n deferred.resolve(localCache[scaleid]);\n }\n\n return deferred.promise();\n }\n };\n});\n"],"file":"scalevalues.min.js"} \ No newline at end of file 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 index 053fc4c27eeca..15007d6d46a10 100644 --- 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 @@ -1 +1 @@ -{"version":3,"sources":["../src/user_competency_course_navigation.js"],"names":["define","$","UserCompetencyCourseNavigation","userSelector","competencySelector","baseUrl","userId","competencyId","courseId","_baseUrl","_userId","_competencyId","_courseId","on","_userChanged","bind","_competencyChanged","prototype","e","newUserId","target","val","queryStr","document","location","newCompetencyId","_ignoreFirstCompetency"],"mappings":"AAsBAA,OAAM,6CAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAY3B,GAAIC,CAAAA,CAA8B,CAAG,SAASC,CAAT,CAAuBC,CAAvB,CAA2CC,CAA3C,CAAoDC,CAApD,CAA4DC,CAA5D,CAA0EC,CAA1E,CAAoF,CACrH,KAAKC,QAAL,CAAgBJ,CAAhB,CACA,KAAKK,OAAL,CAAeJ,CAAM,CAAG,EAAxB,CACA,KAAKK,aAAL,CAAqBJ,CAAY,CAAG,EAApC,CACA,KAAKK,SAAL,CAAiBJ,CAAjB,CAEAP,CAAC,CAACE,CAAD,CAAD,CAAgBU,EAAhB,CAAmB,QAAnB,CAA6B,KAAKC,YAAL,CAAkBC,IAAlB,CAAuB,IAAvB,CAA7B,EACAd,CAAC,CAACG,CAAD,CAAD,CAAsBS,EAAtB,CAAyB,QAAzB,CAAmC,KAAKG,kBAAL,CAAwBD,IAAxB,CAA6B,IAA7B,CAAnC,CACH,CARD,CAgBAb,CAA8B,CAACe,SAA/B,CAAyCH,YAAzC,CAAwD,SAASI,CAAT,CAAY,IAC5DC,CAAAA,CAAS,CAAGlB,CAAC,CAACiB,CAAC,CAACE,MAAH,CAAD,CAAYC,GAAZ,EADgD,CAE5DC,CAAQ,CAAG,WAAaH,CAAb,CAAyB,YAAzB,CAAwC,KAAKP,SAA7C,CAAyD,gBAAzD,CAA4E,KAAKD,aAFhC,CAGhEY,QAAQ,CAACC,QAAT,CAAoB,KAAKf,QAAL,CAAgBa,CACvC,CAJD,CAYApB,CAA8B,CAACe,SAA/B,CAAyCD,kBAAzC,CAA8D,SAASE,CAAT,CAAY,IAClEO,CAAAA,CAAe,CAAGxB,CAAC,CAACiB,CAAC,CAACE,MAAH,CAAD,CAAYC,GAAZ,EADgD,CAElEC,CAAQ,CAAG,WAAa,KAAKZ,OAAlB,CAA4B,YAA5B,CAA2C,KAAKE,SAAhD,CAA4D,gBAA5D,CAA+Ea,CAFxB,CAGtEF,QAAQ,CAACC,QAAT,CAAoB,KAAKf,QAAL,CAAgBa,CACvC,CAJD,CAOApB,CAA8B,CAACe,SAA/B,CAAyCN,aAAzC,CAAyD,IAAzD,CAEAT,CAA8B,CAACe,SAA/B,CAAyCP,OAAzC,CAAmD,IAAnD,CAEAR,CAA8B,CAACe,SAA/B,CAAyCL,SAAzC,CAAqD,IAArD,CAEAV,CAA8B,CAACe,SAA/B,CAAyCR,QAAzC,CAAoD,IAApD,CAEAP,CAA8B,CAACe,SAA/B,CAAyCS,sBAAzC,CAAkE,IAAlE,CAEA,MAAsExB,CAAAA,CAEzE,CA3DK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to enable inline editing of a comptency grade.\n *\n * @copyright 2015 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n /**\n * UserCompetencyCourseNavigation\n *\n * @param {String} userSelector The selector of the user element.\n * @param {String} competencySelector The selector of the competency element.\n * @param {String} baseUrl The base url for the page (no params).\n * @param {Number} userId The user id\n * @param {Number} competencyId The competency id\n * @param {Number} courseId The course id\n */\n var UserCompetencyCourseNavigation = function(userSelector, competencySelector, baseUrl, userId, competencyId, courseId) {\n this._baseUrl = baseUrl;\n this._userId = userId + '';\n this._competencyId = competencyId + '';\n this._courseId = courseId;\n\n $(userSelector).on('change', this._userChanged.bind(this));\n $(competencySelector).on('change', this._competencyChanged.bind(this));\n };\n\n /**\n * The user was changed in the select list.\n *\n * @method _userChanged\n * @param {Event} e\n */\n UserCompetencyCourseNavigation.prototype._userChanged = function(e) {\n var newUserId = $(e.target).val();\n var queryStr = '?userid=' + newUserId + '&courseid=' + this._courseId + '&competencyid=' + this._competencyId;\n document.location = this._baseUrl + queryStr;\n };\n\n /**\n * The competency was changed in the select list.\n *\n * @method _competencyChanged\n * @param {Event} e\n */\n UserCompetencyCourseNavigation.prototype._competencyChanged = function(e) {\n var newCompetencyId = $(e.target).val();\n var queryStr = '?userid=' + this._userId + '&courseid=' + this._courseId + '&competencyid=' + newCompetencyId;\n document.location = this._baseUrl + queryStr;\n };\n\n /** @property {Number} The id of the competency. */\n UserCompetencyCourseNavigation.prototype._competencyId = null;\n /** @property {Number} The id of the user. */\n UserCompetencyCourseNavigation.prototype._userId = null;\n /** @property {Number} The id of the course. */\n UserCompetencyCourseNavigation.prototype._courseId = null;\n /** @property {String} Plugin base url. */\n UserCompetencyCourseNavigation.prototype._baseUrl = null;\n /** @property {Boolean} Ignore the first change event for competencies. */\n UserCompetencyCourseNavigation.prototype._ignoreFirstCompetency = null;\n\n return /** @alias module:tool_lp/user_competency_course_navigation */ UserCompetencyCourseNavigation;\n\n});\n"],"file":"user_competency_course_navigation.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/user_competency_course_navigation.js"],"names":["define","$","UserCompetencyCourseNavigation","userSelector","competencySelector","baseUrl","userId","competencyId","courseId","_baseUrl","_userId","_competencyId","_courseId","on","_userChanged","bind","_competencyChanged","prototype","e","newUserId","target","val","queryStr","document","location","newCompetencyId","_ignoreFirstCompetency"],"mappings":"AAuBAA,OAAM,6CAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAa3B,GAAIC,CAAAA,CAA8B,CAAG,SAASC,CAAT,CAAuBC,CAAvB,CAA2CC,CAA3C,CAAoDC,CAApD,CAA4DC,CAA5D,CAA0EC,CAA1E,CAAoF,CACrH,KAAKC,QAAL,CAAgBJ,CAAhB,CACA,KAAKK,OAAL,CAAeJ,CAAM,CAAG,EAAxB,CACA,KAAKK,aAAL,CAAqBJ,CAAY,CAAG,EAApC,CACA,KAAKK,SAAL,CAAiBJ,CAAjB,CAEAP,CAAC,CAACE,CAAD,CAAD,CAAgBU,EAAhB,CAAmB,QAAnB,CAA6B,KAAKC,YAAL,CAAkBC,IAAlB,CAAuB,IAAvB,CAA7B,EACAd,CAAC,CAACG,CAAD,CAAD,CAAsBS,EAAtB,CAAyB,QAAzB,CAAmC,KAAKG,kBAAL,CAAwBD,IAAxB,CAA6B,IAA7B,CAAnC,CACH,CARD,CAgBAb,CAA8B,CAACe,SAA/B,CAAyCH,YAAzC,CAAwD,SAASI,CAAT,CAAY,IAC5DC,CAAAA,CAAS,CAAGlB,CAAC,CAACiB,CAAC,CAACE,MAAH,CAAD,CAAYC,GAAZ,EADgD,CAE5DC,CAAQ,CAAG,WAAaH,CAAb,CAAyB,YAAzB,CAAwC,KAAKP,SAA7C,CAAyD,gBAAzD,CAA4E,KAAKD,aAFhC,CAGhEY,QAAQ,CAACC,QAAT,CAAoB,KAAKf,QAAL,CAAgBa,CACvC,CAJD,CAYApB,CAA8B,CAACe,SAA/B,CAAyCD,kBAAzC,CAA8D,SAASE,CAAT,CAAY,IAClEO,CAAAA,CAAe,CAAGxB,CAAC,CAACiB,CAAC,CAACE,MAAH,CAAD,CAAYC,GAAZ,EADgD,CAElEC,CAAQ,CAAG,WAAa,KAAKZ,OAAlB,CAA4B,YAA5B,CAA2C,KAAKE,SAAhD,CAA4D,gBAA5D,CAA+Ea,CAFxB,CAGtEF,QAAQ,CAACC,QAAT,CAAoB,KAAKf,QAAL,CAAgBa,CACvC,CAJD,CAOApB,CAA8B,CAACe,SAA/B,CAAyCN,aAAzC,CAAyD,IAAzD,CAEAT,CAA8B,CAACe,SAA/B,CAAyCP,OAAzC,CAAmD,IAAnD,CAEAR,CAA8B,CAACe,SAA/B,CAAyCL,SAAzC,CAAqD,IAArD,CAEAV,CAA8B,CAACe,SAA/B,CAAyCR,QAAzC,CAAoD,IAApD,CAEAP,CAA8B,CAACe,SAA/B,CAAyCS,sBAAzC,CAAkE,IAAlE,CAEA,MAAOxB,CAAAA,CACV,CA3DK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to enable inline editing of a comptency grade.\n *\n * @module tool_lp/user_competency_course_navigation\n * @copyright 2015 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n /**\n * UserCompetencyCourseNavigation\n *\n * @class tool_lp/user_competency_course_navigation\n * @param {String} userSelector The selector of the user element.\n * @param {String} competencySelector The selector of the competency element.\n * @param {String} baseUrl The base url for the page (no params).\n * @param {Number} userId The user id\n * @param {Number} competencyId The competency id\n * @param {Number} courseId The course id\n */\n var UserCompetencyCourseNavigation = function(userSelector, competencySelector, baseUrl, userId, competencyId, courseId) {\n this._baseUrl = baseUrl;\n this._userId = userId + '';\n this._competencyId = competencyId + '';\n this._courseId = courseId;\n\n $(userSelector).on('change', this._userChanged.bind(this));\n $(competencySelector).on('change', this._competencyChanged.bind(this));\n };\n\n /**\n * The user was changed in the select list.\n *\n * @method _userChanged\n * @param {Event} e\n */\n UserCompetencyCourseNavigation.prototype._userChanged = function(e) {\n var newUserId = $(e.target).val();\n var queryStr = '?userid=' + newUserId + '&courseid=' + this._courseId + '&competencyid=' + this._competencyId;\n document.location = this._baseUrl + queryStr;\n };\n\n /**\n * The competency was changed in the select list.\n *\n * @method _competencyChanged\n * @param {Event} e\n */\n UserCompetencyCourseNavigation.prototype._competencyChanged = function(e) {\n var newCompetencyId = $(e.target).val();\n var queryStr = '?userid=' + this._userId + '&courseid=' + this._courseId + '&competencyid=' + newCompetencyId;\n document.location = this._baseUrl + queryStr;\n };\n\n /** @property {Number} The id of the competency. */\n UserCompetencyCourseNavigation.prototype._competencyId = null;\n /** @property {Number} The id of the user. */\n UserCompetencyCourseNavigation.prototype._userId = null;\n /** @property {Number} The id of the course. */\n UserCompetencyCourseNavigation.prototype._courseId = null;\n /** @property {String} Plugin base url. */\n UserCompetencyCourseNavigation.prototype._baseUrl = null;\n /** @property {Boolean} Ignore the first change event for competencies. */\n UserCompetencyCourseNavigation.prototype._ignoreFirstCompetency = null;\n\n return UserCompetencyCourseNavigation;\n});\n"],"file":"user_competency_course_navigation.min.js"} \ No newline at end of file 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 index cdbbc9541d1dc..2d7caa901c0f3 100644 --- a/admin/tool/lp/amd/build/user_competency_info.min.js.map +++ b/admin/tool/lp/amd/build/user_competency_info.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/user_competency_info.js"],"names":["define","$","notification","ajax","templates","Info","rootElement","competencyId","userId","planId","courseId","displayuser","_rootElement","_competencyId","_userId","_planId","_courseId","_valid","_displayuser","_methodName","_args","competencyid","planid","_templateName","userid","courseid","prototype","reload","self","promises","call","methodname","args","done","context","render","html","js","replaceNode","fail","exception"],"mappings":"AAsBAA,OAAM,gCAAC,CAAC,QAAD,CAAW,mBAAX,CAAgC,WAAhC,CAA6C,gBAA7C,CAAD,CAAiE,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAA2C,CAY9G,GAAIC,CAAAA,CAAI,CAAG,SAASC,CAAT,CAAsBC,CAAtB,CAAoCC,CAApC,CAA4CC,CAA5C,CAAoDC,CAApD,CAA8DC,CAA9D,CAA2E,CAClF,KAAKC,YAAL,CAAoBN,CAApB,CACA,KAAKO,aAAL,CAAqBN,CAArB,CACA,KAAKO,OAAL,CAAeN,CAAf,CACA,KAAKO,OAAL,CAAeN,CAAf,CACA,KAAKO,SAAL,CAAiBN,CAAjB,CACA,KAAKO,MAAL,IACA,KAAKC,YAAL,CAA4C,WAAvB,QAAOP,CAAAA,CAAR,CAAuCA,CAAvC,GAApB,CAEA,GAAI,KAAKI,OAAT,CAAkB,CACd,KAAKI,WAAL,CAAmB,kDAAnB,CACA,KAAKC,KAAL,CAAa,CAACC,YAAY,CAAE,KAAKR,aAApB,CAAmCS,MAAM,CAAE,KAAKP,OAAhD,CAAb,CACA,KAAKQ,aAAL,CAAqB,yCACxB,CAJD,IAIO,IAAI,KAAKP,SAAT,CAAoB,CACvB,KAAKG,WAAL,CAAmB,oDAAnB,CACA,KAAKC,KAAL,CAAa,CAACI,MAAM,CAAE,KAAKV,OAAd,CAAuBO,YAAY,CAAE,KAAKR,aAA1C,CAAyDY,QAAQ,CAAE,KAAKT,SAAxE,CAAb,CACA,KAAKO,aAAL,CAAqB,2CACxB,CAJM,IAI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B,CAEAR,CAAI,CAACqB,SAAL,CAAeZ,OAAf,CAAyB,IAAzB,CAEAT,CAAI,CAACqB,SAAL,CAAeP,WAAf,CAA6B,IAA7B,CAEAd,CAAI,CAACqB,SAAL,CAAeN,KAAf,CAAuB,IAAvB,CAEAf,CAAI,CAACqB,SAAL,CAAeH,aAAf,CAA+B,IAA/B,CAEAlB,CAAI,CAACqB,SAAL,CAAeR,YAAf,IAEA,MAAyDb,CAAAA,CAE5D,CAxFK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to refresh a user competency summary in a page.\n *\n * @copyright 2015 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/notification', 'core/ajax', 'core/templates'], function($, notification, ajax, templates) {\n\n /**\n * Info\n *\n * @param {JQuery} rootElement Selector to replace when the information needs updating.\n * @param {Number} competencyId The id of the competency.\n * @param {Number} userId The id of the user.\n * @param {Number} planId The id of the plan.\n * @param {Number} courseId The id of the course.\n * @param {Boolean} displayuser If we should display the user info.\n */\n var Info = function(rootElement, competencyId, userId, planId, courseId, displayuser) {\n this._rootElement = rootElement;\n this._competencyId = competencyId;\n this._userId = userId;\n this._planId = planId;\n this._courseId = courseId;\n this._valid = true;\n this._displayuser = (typeof displayuser !== 'undefined') ? displayuser : false;\n\n if (this._planId) {\n this._methodName = 'tool_lp_data_for_user_competency_summary_in_plan';\n this._args = {competencyid: this._competencyId, planid: this._planId};\n this._templateName = 'tool_lp/user_competency_summary_in_plan';\n } else if (this._courseId) {\n this._methodName = 'tool_lp_data_for_user_competency_summary_in_course';\n this._args = {userid: this._userId, competencyid: this._competencyId, courseid: this._courseId};\n this._templateName = 'tool_lp/user_competency_summary_in_course';\n } else {\n this._methodName = 'tool_lp_data_for_user_competency_summary';\n this._args = {userid: this._userId, competencyid: this._competencyId};\n this._templateName = 'tool_lp/user_competency_summary';\n }\n };\n\n /**\n * Reload the info for this user competency.\n *\n * @method reload\n */\n Info.prototype.reload = function() {\n var self = this,\n promises = [];\n\n if (!this._valid) {\n return;\n }\n\n promises = ajax.call([{\n methodname: this._methodName,\n args: this._args\n }]);\n\n promises[0].done(function(context) {\n // Check if we should also the user info.\n if (self._displayuser) {\n context.displayuser = true;\n }\n templates.render(self._templateName, context).done(function(html, js) {\n templates.replaceNode(self._rootElement, html, js);\n }).fail(notification.exception);\n }).fail(notification.exception);\n };\n\n /** @property {JQuery} The root element to replace in the DOM. */\n Info.prototype._rootElement = null;\n /** @property {Number} The id of the course. */\n Info.prototype._courseId = null;\n /** @property {Boolean} Is this module valid? */\n Info.prototype._valid = null;\n /** @property {Number} The id of the plan. */\n Info.prototype._planId = null;\n /** @property {Number} The id of the competency. */\n Info.prototype._competencyId = null;\n /** @property {Number} The id of the user. */\n Info.prototype._userId = null;\n /** @property {String} The method name to load the data. */\n Info.prototype._methodName = null;\n /** @property {Object} The arguments to load the data. */\n Info.prototype._args = null;\n /** @property {String} The template to reload the fragment. */\n Info.prototype._templateName = null;\n /** @property {Boolean} If we should display the user info? */\n Info.prototype._displayuser = false;\n\n return /** @alias module:tool_lp/user_competency_info */ Info;\n\n});\n"],"file":"user_competency_info.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/user_competency_info.js"],"names":["define","$","notification","ajax","templates","Info","rootElement","competencyId","userId","planId","courseId","displayuser","_rootElement","_competencyId","_userId","_planId","_courseId","_valid","_displayuser","_methodName","_args","competencyid","planid","_templateName","userid","courseid","prototype","reload","self","promises","call","methodname","args","done","context","render","html","js","replaceNode","f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CAACqB,SAAL,CAAeR,YAAf,IAEA,MAAyDb,CAAAA,CAE5D,CAxFK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to refresh a user competency summary in a page.\n *\n * @module tool_lp/user_competency_info\n * @copyright 2015 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/notification', 'core/ajax', 'core/templates'], function($, notification, ajax, templates) {\n\n /**\n * Info\n *\n * @param {JQuery} rootElement Selector to replace when the information needs updating.\n * @param {Number} competencyId The id of the competency.\n * @param {Number} userId The id of the user.\n * @param {Number} planId The id of the plan.\n * @param {Number} courseId The id of the course.\n * @param {Boolean} displayuser If we should display the user info.\n */\n var Info = function(rootElement, competencyId, userId, planId, courseId, displayuser) {\n this._rootElement = rootElement;\n this._competencyId = competencyId;\n this._userId = userId;\n this._planId = planId;\n this._courseId = courseId;\n this._valid = true;\n this._displayuser = (typeof displayuser !== 'undefined') ? displayuser : false;\n\n if (this._planId) {\n this._methodName = 'tool_lp_data_for_user_competency_summary_in_plan';\n this._args = {competencyid: this._competencyId, planid: this._planId};\n this._templateName = 'tool_lp/user_competency_summary_in_plan';\n } else if (this._courseId) {\n this._methodName = 'tool_lp_data_for_user_competency_summary_in_course';\n this._args = {userid: this._userId, competencyid: this._competencyId, courseid: this._courseId};\n this._templateName = 'tool_lp/user_competency_summary_in_course';\n } else {\n this._methodName = 'tool_lp_data_for_user_competency_summary';\n this._args = {userid: this._userId, competencyid: this._competencyId};\n this._templateName = 'tool_lp/user_competency_summary';\n }\n };\n\n /**\n * Reload the info for this user competency.\n *\n * @method reload\n */\n Info.prototype.reload = function() {\n var self = this,\n promises = [];\n\n if (!this._valid) {\n return;\n }\n\n promises = ajax.call([{\n methodname: this._methodName,\n args: this._args\n }]);\n\n promises[0].done(function(context) {\n // Check if we should also the user info.\n if (self._displayuser) {\n context.displayuser = true;\n }\n templates.render(self._templateName, context).done(function(html, js) {\n templates.replaceNode(self._rootElement, html, js);\n }).fail(notification.exception);\n }).fail(notification.exception);\n };\n\n /** @property {JQuery} The root element to replace in the DOM. */\n Info.prototype._rootElement = null;\n /** @property {Number} The id of the course. */\n Info.prototype._courseId = null;\n /** @property {Boolean} Is this module valid? */\n Info.prototype._valid = null;\n /** @property {Number} The id of the plan. */\n Info.prototype._planId = null;\n /** @property {Number} The id of the competency. */\n Info.prototype._competencyId = null;\n /** @property {Number} The id of the user. */\n Info.prototype._userId = null;\n /** @property {String} The method name to load the data. */\n Info.prototype._methodName = null;\n /** @property {Object} The arguments to load the data. */\n Info.prototype._args = null;\n /** @property {String} The template to reload the fragment. */\n Info.prototype._templateName = null;\n /** @property {Boolean} If we should display the user info? */\n Info.prototype._displayuser = false;\n\n return /** @alias module:tool_lp/user_competency_info */ Info;\n\n});\n"],"file":"user_competency_info.min.js"} \ No newline at end of file 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 index dadaf4cc3ba06..ec205079c83e4 100644 --- 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 @@ -1 +1 @@ -{"version":3,"sources":["../src/user_competency_plan_popup.js"],"names":["define","$","notification","str","ajax","templates","Dialogue","UserCompetencyPopup","regionSelector","userCompetencySelector","planId","_regionSelector","_userCompetencySelector","_planId","on","_handleClick","bind","prototype","e","preventDefault","tr","target","closest","competencyId","data","userId","requests","call","methodname","args","competencyid","planid","done","_contextLoaded","fail","exception","then","result","eventMethodName","plan","iscompleted","userid","catch","context","self","render","html","js","get_string","title","runTemplateJS","_refresh","_pageContextLoaded","replaceNode"],"mappings":"AAsBAA,OAAM,sCAAC,CAAC,QAAD,CAAW,mBAAX,CAAgC,UAAhC,CAA4C,WAA5C,CAAyD,gBAAzD,CAA2E,kBAA3E,CAAD,CACC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAA+BC,CAA/B,CAAqCC,CAArC,CAAgDC,CAAhD,CAA0D,CAS7D,GAAIC,CAAAA,CAAmB,CAAG,SAASC,CAAT,CAAyBC,CAAzB,CAAiDC,CAAjD,CAAyD,CAC/E,KAAKC,eAAL,CAAuBH,CAAvB,CACA,KAAKI,uBAAL,CAA+BH,CAA/B,CACA,KAAKI,OAAL,CAAeH,CAAf,CAEAT,CAAC,CAAC,KAAKU,eAAN,CAAD,CAAwBG,EAAxB,CAA2B,OAA3B,CAAoC,KAAKF,uBAAzC,CAAkE,KAAKG,YAAL,CAAkBC,IAAlB,CAAuB,IAAvB,CAAlE,CACH,CAND,CAcAT,CAAmB,CAACU,SAApB,CAA8BF,YAA9B,CAA6C,SAASG,CAAT,CAAY,CACrDA,CAAC,CAACC,cAAF,GADqD,GAEjDC,CAAAA,CAAE,CAAGnB,CAAC,CAACiB,CAAC,CAACG,MAAH,CAAD,CAAYC,OAAZ,CAAoB,IAApB,CAF4C,CAGjDC,CAAY,CAAGtB,CAAC,CAACmB,CAAD,CAAD,CAAMI,IAAN,CAAW,cAAX,CAHkC,CAIjDC,CAAM,CAAGxB,CAAC,CAACmB,CAAD,CAAD,CAAMI,IAAN,CAAW,QAAX,CAJwC,CAKjDd,CAAM,CAAG,KAAKG,OALmC,CAOjDa,CAAQ,CAAGtB,CAAI,CAACuB,IAAL,CAAU,CAAC,CACtBC,UAAU,CAAE,kDADU,CAEtBC,IAAI,CAAE,CAACC,YAAY,CAAEP,CAAf,CAA6BQ,MAAM,CAAErB,CAArC,CAFgB,CAGtBsB,IAA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SAJrB,CAKH,CAPD,CAcA5B,CAAmB,CAACU,SAApB,CAA8BkC,QAA9B,CAAyC,UAAW,CAChD,GAAIzC,CAAAA,CAAM,CAAG,KAAKG,OAAlB,CAEAT,CAAI,CAACuB,IAAL,CAAU,CAAC,CACPC,UAAU,CAAE,4BADL,CAEPC,IAAI,CAAE,CAACE,MAAM,CAAErB,CAAT,CAFC,CAGPsB,IAAI,CAAE,KAAKoB,kBAAL,CAAwBpC,IAAxB,CAA6B,IAA7B,CAHC,CAIPkB,IAAI,CAAEhC,CAAY,CAACiC,SAJZ,CAAD,CAAV,CAMH,CATD,CAiBA5B,CAAmB,CAACU,SAApB,CAA8BmC,kBAA9B,CAAmD,SAAST,CAAT,CAAkB,CACjE,GAAIC,CAAAA,CAAI,CAAG,IAAX,CACAvC,CAAS,CAACwC,MAAV,CAAiB,mBAAjB,CAAsCF,CAAtC,EAA+CX,IAA/C,CAAoD,SAASc,CAAT,CAAeC,CAAf,CAAmB,CACnE1C,CAAS,CAACgD,WAAV,CAAsBT,CAAI,CAACjC,eAA3B,CAA4CmC,CAA5C,CAAkDC,CAAlD,CACH,CAFD,EAEGb,IAFH,CAEQhC,CAAY,CAACiC,SAFrB,CAGH,CALD,CAQA5B,CAAmB,CAACU,SAApB,CAA8BN,eAA9B,CAAgD,IAAhD,CAEAJ,CAAmB,CAACU,SAApB,CAA8BL,uBAA9B,CAAwD,IAAxD,CAEAL,CAAmB,CAACU,SAApB,CAA8BJ,OAA9B,CAAwC,IAAxC,CAEA,MAA+DN,CAAAA,CAElE,CAxGK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to open user competency plan in popup\n *\n * @copyright 2016 Issam Taboubi \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/templates', 'tool_lp/dialogue'],\n function($, notification, str, ajax, templates, Dialogue) {\n\n /**\n * UserCompetencyPopup\n *\n * @param {String} regionSelector The regionSelector\n * @param {String} userCompetencySelector The userCompetencySelector\n * @param {Number} planId The plan ID\n */\n var UserCompetencyPopup = function(regionSelector, userCompetencySelector, planId) {\n this._regionSelector = regionSelector;\n this._userCompetencySelector = userCompetencySelector;\n this._planId = planId;\n\n $(this._regionSelector).on('click', this._userCompetencySelector, this._handleClick.bind(this));\n };\n\n /**\n * Get the data from the closest TR and open the popup.\n *\n * @method _handleClick\n * @param {Event} e\n */\n UserCompetencyPopup.prototype._handleClick = function(e) {\n e.preventDefault();\n var tr = $(e.target).closest('tr');\n var competencyId = $(tr).data('competencyid');\n var userId = $(tr).data('userid');\n var planId = this._planId;\n\n var requests = ajax.call([{\n methodname: 'tool_lp_data_for_user_competency_summary_in_plan',\n args: {competencyid: competencyId, planid: planId},\n done: this._contextLoaded.bind(this),\n fail: notification.exception\n }]);\n // Log the user competency viewed in plan event.\n requests[0].then(function(result) {\n var eventMethodName = 'core_competency_user_competency_viewed_in_plan';\n // Trigger core_competency_user_competency_plan_viewed event instead if plan is already completed.\n if (result.plan.iscompleted) {\n eventMethodName = 'core_competency_user_competency_plan_viewed';\n }\n return ajax.call([{\n methodname: eventMethodName,\n args: {competencyid: competencyId, userid: userId, planid: planId}\n }])[0];\n }).catch(notification.exception);\n };\n\n /**\n * We loaded the context, now render the template.\n *\n * @method _contextLoaded\n * @param {Object} context\n */\n UserCompetencyPopup.prototype._contextLoaded = function(context) {\n var self = this;\n templates.render('tool_lp/user_competency_summary_in_plan', context).done(function(html, js) {\n str.get_string('usercompetencysummary', 'report_competency').done(function(title) {\n (new Dialogue(title, html, templates.runTemplateJS.bind(templates, js), self._refresh.bind(self), true));\n }).fail(notification.exception);\n }).fail(notification.exception);\n };\n\n /**\n * Refresh the page.\n *\n * @method _refresh\n */\n UserCompetencyPopup.prototype._refresh = function() {\n var planId = this._planId;\n\n ajax.call([{\n methodname: 'tool_lp_data_for_plan_page',\n args: {planid: planId},\n done: this._pageContextLoaded.bind(this),\n fail: notification.exception\n }]);\n };\n\n /**\n * We loaded the context, now render the template.\n *\n * @method _pageContextLoaded\n * @param {Object} context\n */\n UserCompetencyPopup.prototype._pageContextLoaded = function(context) {\n var self = this;\n templates.render('tool_lp/plan_page', context).done(function(html, js) {\n templates.replaceNode(self._regionSelector, html, js);\n }).fail(notification.exception);\n };\n\n /** @property {String} The selector for the region with the user competencies */\n UserCompetencyPopup.prototype._regionSelector = null;\n /** @property {String} The selector for the region with a single user competencies */\n UserCompetencyPopup.prototype._userCompetencySelector = null;\n /** @property {Number} The plan Id */\n UserCompetencyPopup.prototype._planId = null;\n\n return /** @alias module:tool_lp/user_competency_plan_popup */ UserCompetencyPopup;\n\n});\n"],"file":"user_competency_plan_popup.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/user_competency_plan_popup.js"],"names":["define","$","notification","str","ajax","templates","Dialogue","UserCompetencyPopup","regionSelector","userCompetencySelector","planId","_regionSelector","_userCompetencySelector","_planId","on","_handleClick","bind","prototype","e","preventDefault","tr","target","closest","competencyId","data","userId","requests","call","methodname","args","competencyid","planid","done","_contextLoaded","fail","exception","then","result","eventMethodName","plan","iscompleted","userid","catch","context","self","render","html","js","get_string","title","runTemplateJS","_refresh","_pageContextLoaded","replaceNode"],"mappings":"AAuBAA,OAAM,sCAAC,CAAC,QAAD,CAAW,mBAAX,CAAgC,UAAhC,CAA4C,WAA5C,CAAyD,gBAAzD,CAA2E,kBAA3E,CAAD,CACC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAA+BC,CAA/B,CAAqCC,CAArC,CAA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6B,IAA7B,CAHC,CAIPkB,IAAI,CAAEhC,CAAY,CAACiC,SAJZ,CAAD,CAAV,CAMH,CATD,CAiBA5B,CAAmB,CAACU,SAApB,CAA8BmC,kBAA9B,CAAmD,SAAST,CAAT,CAAkB,CACjE,GAAIC,CAAAA,CAAI,CAAG,IAAX,CACAvC,CAAS,CAACwC,MAAV,CAAiB,mBAAjB,CAAsCF,CAAtC,EAA+CX,IAA/C,CAAoD,SAASc,CAAT,CAAeC,CAAf,CAAmB,CACnE1C,CAAS,CAACgD,WAAV,CAAsBT,CAAI,CAACjC,eAA3B,CAA4CmC,CAA5C,CAAkDC,CAAlD,CACH,CAFD,EAEGb,IAFH,CAEQhC,CAAY,CAACiC,SAFrB,CAGH,CALD,CAQA5B,CAAmB,CAACU,SAApB,CAA8BN,eAA9B,CAAgD,IAAhD,CAEAJ,CAAmB,CAACU,SAApB,CAA8BL,uBAA9B,CAAwD,IAAxD,CAEAL,CAAmB,CAACU,SAApB,CAA8BJ,OAA9B,CAAwC,IAAxC,CAEA,MAA+DN,CAAAA,CAElE,CAxGK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to open user competency plan in popup\n *\n * @module tool_lp/user_competency_plan_popup\n * @copyright 2016 Issam Taboubi \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/templates', 'tool_lp/dialogue'],\n function($, notification, str, ajax, templates, Dialogue) {\n\n /**\n * UserCompetencyPopup\n *\n * @param {String} regionSelector The regionSelector\n * @param {String} userCompetencySelector The userCompetencySelector\n * @param {Number} planId The plan ID\n */\n var UserCompetencyPopup = function(regionSelector, userCompetencySelector, planId) {\n this._regionSelector = regionSelector;\n this._userCompetencySelector = userCompetencySelector;\n this._planId = planId;\n\n $(this._regionSelector).on('click', this._userCompetencySelector, this._handleClick.bind(this));\n };\n\n /**\n * Get the data from the closest TR and open the popup.\n *\n * @method _handleClick\n * @param {Event} e\n */\n UserCompetencyPopup.prototype._handleClick = function(e) {\n e.preventDefault();\n var tr = $(e.target).closest('tr');\n var competencyId = $(tr).data('competencyid');\n var userId = $(tr).data('userid');\n var planId = this._planId;\n\n var requests = ajax.call([{\n methodname: 'tool_lp_data_for_user_competency_summary_in_plan',\n args: {competencyid: competencyId, planid: planId},\n done: this._contextLoaded.bind(this),\n fail: notification.exception\n }]);\n // Log the user competency viewed in plan event.\n requests[0].then(function(result) {\n var eventMethodName = 'core_competency_user_competency_viewed_in_plan';\n // Trigger core_competency_user_competency_plan_viewed event instead if plan is already completed.\n if (result.plan.iscompleted) {\n eventMethodName = 'core_competency_user_competency_plan_viewed';\n }\n return ajax.call([{\n methodname: eventMethodName,\n args: {competencyid: competencyId, userid: userId, planid: planId}\n }])[0];\n }).catch(notification.exception);\n };\n\n /**\n * We loaded the context, now render the template.\n *\n * @method _contextLoaded\n * @param {Object} context\n */\n UserCompetencyPopup.prototype._contextLoaded = function(context) {\n var self = this;\n templates.render('tool_lp/user_competency_summary_in_plan', context).done(function(html, js) {\n str.get_string('usercompetencysummary', 'report_competency').done(function(title) {\n (new Dialogue(title, html, templates.runTemplateJS.bind(templates, js), self._refresh.bind(self), true));\n }).fail(notification.exception);\n }).fail(notification.exception);\n };\n\n /**\n * Refresh the page.\n *\n * @method _refresh\n */\n UserCompetencyPopup.prototype._refresh = function() {\n var planId = this._planId;\n\n ajax.call([{\n methodname: 'tool_lp_data_for_plan_page',\n args: {planid: planId},\n done: this._pageContextLoaded.bind(this),\n fail: notification.exception\n }]);\n };\n\n /**\n * We loaded the context, now render the template.\n *\n * @method _pageContextLoaded\n * @param {Object} context\n */\n UserCompetencyPopup.prototype._pageContextLoaded = function(context) {\n var self = this;\n templates.render('tool_lp/plan_page', context).done(function(html, js) {\n templates.replaceNode(self._regionSelector, html, js);\n }).fail(notification.exception);\n };\n\n /** @property {String} The selector for the region with the user competencies */\n UserCompetencyPopup.prototype._regionSelector = null;\n /** @property {String} The selector for the region with a single user competencies */\n UserCompetencyPopup.prototype._userCompetencySelector = null;\n /** @property {Number} The plan Id */\n UserCompetencyPopup.prototype._planId = null;\n\n return /** @alias module:tool_lp/user_competency_plan_popup */ UserCompetencyPopup;\n\n});\n"],"file":"user_competency_plan_popup.min.js"} \ No newline at end of file diff --git a/admin/tool/lp/amd/src/actionselector.js b/admin/tool/lp/amd/src/actionselector.js index 03abcb5c416d3..fd4acf05b5dca 100644 --- a/admin/tool/lp/amd/src/actionselector.js +++ b/admin/tool/lp/amd/src/actionselector.js @@ -20,6 +20,7 @@ * This will receive the information to display in popup. * The actions have the format [{'text': sometext, 'value' : somevalue}]. * + * @module tool_lp/actionselector * @copyright 2016 Serge Gauthier - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -34,6 +35,8 @@ define(['jquery', /** * Action selector class. + * + * @class tool_lp/actionselector * @param {String} title The title of popup. * @param {String} message The message to display. * @param {object} actions The actions that can be selected. @@ -190,6 +193,6 @@ define(['jquery', this._selectedValue = ''; }; - return /** @alias module:tool_lp/actionselector */ ActionSelector; + return ActionSelector; }); diff --git a/admin/tool/lp/amd/src/competencies.js b/admin/tool/lp/amd/src/competencies.js index 4b758e5d885cd..a8e07059d19b4 100644 --- a/admin/tool/lp/amd/src/competencies.js +++ b/admin/tool/lp/amd/src/competencies.js @@ -33,6 +33,7 @@ define(['jquery', /** * Constructor * + * @class tool_lp/competencies * @param {Number} itemid * @param {String} itemtype * @param {Number} pagectxid diff --git a/admin/tool/lp/amd/src/competency_outcomes.js b/admin/tool/lp/amd/src/competency_outcomes.js index 5471649de5d03..909365cf1d5f9 100644 --- a/admin/tool/lp/amd/src/competency_outcomes.js +++ b/admin/tool/lp/amd/src/competency_outcomes.js @@ -16,6 +16,7 @@ /** * Competency rule config. * + * @module tool_lp/competency_outcomes * @copyright 2015 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -29,7 +30,7 @@ define(['jquery', OUTCOME_COMPLETE = 2, OUTCOME_RECOMMEND = 3; - return /** @alias module:tool_lp/competency_outcomes */ { + return { NONE: OUTCOME_NONE, EVIDENCE: OUTCOME_EVIDENCE, @@ -78,5 +79,4 @@ define(['jquery', }); } }; - }); diff --git a/admin/tool/lp/amd/src/competency_plan_navigation.js b/admin/tool/lp/amd/src/competency_plan_navigation.js index 5d2b4cf9d531f..0b2810c87d7bb 100644 --- a/admin/tool/lp/amd/src/competency_plan_navigation.js +++ b/admin/tool/lp/amd/src/competency_plan_navigation.js @@ -16,6 +16,7 @@ /** * Event click on selecting competency in the competency autocomplete. * + * @module tool_lp/competency_plan_navigation * @copyright 2016 Issam Taboubi * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,6 +26,7 @@ define(['jquery'], function($) { /** * CompetencyPlanNavigation * + * @class * @param {String} competencySelector The selector of the competency element. * @param {String} baseUrl The base url for the page (no params). * @param {Number} userId The user id @@ -68,6 +70,5 @@ define(['jquery'], function($) { /** @property {Boolean} Ignore the first change event for competencies. */ CompetencyPlanNavigation.prototype._ignoreFirstCompetency = null; - return /** @alias module:tool_lp/competency_plan_navigation */ CompetencyPlanNavigation; - + return CompetencyPlanNavigation; }); diff --git a/admin/tool/lp/amd/src/competency_rule.js b/admin/tool/lp/amd/src/competency_rule.js index f918c14b9acb1..130d6cbb9b469 100644 --- a/admin/tool/lp/amd/src/competency_rule.js +++ b/admin/tool/lp/amd/src/competency_rule.js @@ -16,6 +16,7 @@ /** * Competency rule base module. * + * @module tool_lp/competencyrule * @copyright 2015 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -70,13 +71,14 @@ define(['jquery'], function($) { return null; }; - // eslint-disable-next-line valid-jsdoc + // eslint-disable-line valid-jsdoc /** * Return the type of the module. * * @return {String} * @method getType */ + // eslint-enable-line valid-jsdoc Rule.prototype.getType = function() { throw new Error('Not implemented'); }; diff --git a/admin/tool/lp/amd/src/competency_rule_all.js b/admin/tool/lp/amd/src/competency_rule_all.js index b7acadbb3712c..5dfdcb03da567 100644 --- a/admin/tool/lp/amd/src/competency_rule_all.js +++ b/admin/tool/lp/amd/src/competency_rule_all.js @@ -16,6 +16,7 @@ /** * Competency rule all module. * + * @module tool_lp/competency_rule_all * @copyright 2015 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -28,6 +29,8 @@ define(['jquery', /** * Competency rule all class. + * + * @class tool_lp/competency_rule_all */ var Rule = function() { RuleBase.apply(this, arguments); @@ -54,6 +57,5 @@ define(['jquery', return true; }; - return /** @alias module:tool_lp/competency_rule_all */ Rule; - + return Rule; }); diff --git a/admin/tool/lp/amd/src/competency_rule_points.js b/admin/tool/lp/amd/src/competency_rule_points.js index 87d7e0b517e65..c49cb390cd8a2 100644 --- a/admin/tool/lp/amd/src/competency_rule_points.js +++ b/admin/tool/lp/amd/src/competency_rule_points.js @@ -16,6 +16,7 @@ /** * Competency rule points module. * + * @module tool_lp/competency_rule_all * @copyright 2015 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -195,6 +196,5 @@ define(['jquery', return valid; }; - return /** @alias module:tool_lp/competency_rule_all */ Rule; - + return Rule; }); diff --git a/admin/tool/lp/amd/src/competencypicker.js b/admin/tool/lp/amd/src/competencypicker.js index e21043cc0efdf..7e3be8593dffa 100644 --- a/admin/tool/lp/amd/src/competencypicker.js +++ b/admin/tool/lp/amd/src/competencypicker.js @@ -20,6 +20,7 @@ * This will receive a object with either a single 'competencyId', or an array in 'competencyIds' * depending on the value of multiSelect. * + * @module tool_lp/competencypicker * @copyright 2015 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -467,6 +468,6 @@ define(['jquery', this._eventNode.trigger(type, [data]); }; - return /** @alias module:tool_lp/competencypicker */ Picker; + return Picker; }); diff --git a/admin/tool/lp/amd/src/competencypicker_user_plans.js b/admin/tool/lp/amd/src/competencypicker_user_plans.js index cbda90f5b7f56..60d8a924ad7f5 100644 --- a/admin/tool/lp/amd/src/competencypicker_user_plans.js +++ b/admin/tool/lp/amd/src/competencypicker_user_plans.js @@ -21,6 +21,7 @@ * This will receive a object with either a single 'competencyId', or an array in 'competencyIds' * depending on the value of multiSelect. * + * @module tool_lp/competencypicker_user_plans * @copyright 2015 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -38,6 +39,7 @@ define(['jquery', /** * Competency picker in plan class. * + * @class tool_lp/competencypicker_user_plans * @param {Number} userId * @param {Number|false} singlePlan The ID of the plan when limited to one. * @param {Boolean} multiSelect Support multi-select in the tree. @@ -236,6 +238,5 @@ define(['jquery', }); }; - return /** @alias module:tool_lp/competencypicker_user_plans */ Picker; - + return Picker; }); diff --git a/admin/tool/lp/amd/src/competencyruleconfig.js b/admin/tool/lp/amd/src/competencyruleconfig.js index fb27c0edf92dc..0378ebc0d89d6 100644 --- a/admin/tool/lp/amd/src/competencyruleconfig.js +++ b/admin/tool/lp/amd/src/competencyruleconfig.js @@ -16,6 +16,7 @@ /** * Competency rule config. * + * @module tool_lp/competencyruleconfig * @copyright 2015 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/lp/amd/src/evidence_delete.js b/admin/tool/lp/amd/src/evidence_delete.js index f680b28e5fa02..8d638d337e241 100644 --- a/admin/tool/lp/amd/src/evidence_delete.js +++ b/admin/tool/lp/amd/src/evidence_delete.js @@ -16,6 +16,7 @@ /** * Evidence delete. * + * @module tool_lp/evidence_delete * @copyright 2016 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/lp/amd/src/form-cohort-selector.js b/admin/tool/lp/amd/src/form-cohort-selector.js index 772f3134c83bd..348a3d77f5563 100644 --- a/admin/tool/lp/amd/src/form-cohort-selector.js +++ b/admin/tool/lp/amd/src/form-cohort-selector.js @@ -17,7 +17,6 @@ * Cohort selector module. * * @module tool_lp/form-cohort-selector - * @class form-cohort-selector * @copyright 2015 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/lp/amd/src/form-user-selector.js b/admin/tool/lp/amd/src/form-user-selector.js index 9fcf1a14a1468..45051898147fc 100644 --- a/admin/tool/lp/amd/src/form-user-selector.js +++ b/admin/tool/lp/amd/src/form-user-selector.js @@ -17,7 +17,6 @@ * User selector module. * * @module tool_lp/form-user-selector - * @class form-user-selector * @copyright 2015 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/lp/amd/src/frameworks_datasource.js b/admin/tool/lp/amd/src/frameworks_datasource.js index 65d060f4c19ef..0f1b7f5308089 100644 --- a/admin/tool/lp/amd/src/frameworks_datasource.js +++ b/admin/tool/lp/amd/src/frameworks_datasource.js @@ -18,6 +18,7 @@ * * This module is compatible with core/form-autocomplete. * + * @module tool_lp/frameworks_datasource * @copyright 2016 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/lp/amd/src/grade_dialogue.js b/admin/tool/lp/amd/src/grade_dialogue.js index 9020612af49d4..ae6edb22f781a 100644 --- a/admin/tool/lp/amd/src/grade_dialogue.js +++ b/admin/tool/lp/amd/src/grade_dialogue.js @@ -16,6 +16,7 @@ /** * Grade dialogue. * + * @module tool_lp/grade_dialogue * @copyright 2016 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -30,6 +31,8 @@ define(['jquery', /** * Grade dialogue class. + * + * @class tool_lp/grade_dialogue * @param {Array} ratingOptions */ var Grade = function(ratingOptions) { @@ -148,6 +151,5 @@ define(['jquery', return Templates.render('tool_lp/competency_grader', context); }; - return /** @alias module:tool_lp/grade_dialogue */ Grade; - + return Grade; }); diff --git a/admin/tool/lp/amd/src/grade_user_competency_inline.js b/admin/tool/lp/amd/src/grade_user_competency_inline.js index b3ac64becd3d1..5acfa0236f08e 100644 --- a/admin/tool/lp/amd/src/grade_user_competency_inline.js +++ b/admin/tool/lp/amd/src/grade_user_competency_inline.js @@ -16,6 +16,7 @@ /** * Module to enable inline editing of a comptency grade. * + * @module tool_lp/grade_user_competency_inline * @copyright 2015 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -32,6 +33,7 @@ define(['jquery', /** * InlineEditor * + * @class tool_lp/grade_user_competency_inline * @param {String} selector The selector to trigger the grading. * @param {Number} scaleId The id of the scale for this competency. * @param {Number} competencyId The id of the competency. @@ -155,6 +157,5 @@ define(['jquery', /** @property {GradeDialogue} The grading dialogue. */ InlineEditor.prototype._dialogue = null; - return /** @alias module:tool_lp/grade_user_competency_inline */ InlineEditor; - + return InlineEditor; }); diff --git a/admin/tool/lp/amd/src/module_navigation.js b/admin/tool/lp/amd/src/module_navigation.js index 288568320f6af..4aa2ef3ecc019 100644 --- a/admin/tool/lp/amd/src/module_navigation.js +++ b/admin/tool/lp/amd/src/module_navigation.js @@ -16,6 +16,7 @@ /** * Module to navigation between users in a course. * + * @module tool_lp/module_navigation * @copyright 2019 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,6 +26,7 @@ define(['jquery'], function($) { /** * ModuleNavigation * + * @class tool_lp/module_navigation * @param {String} moduleSelector The selector of the module element. * @param {String} baseUrl The base url for the page (no params). * @param {Number} courseId The course id @@ -57,5 +59,5 @@ define(['jquery'], function($) { /** @property {String} Plugin base url. */ ModuleNavigation.prototype._baseUrl = null; - return /** @alias module:tool_lp/module_navigation */ ModuleNavigation; + return ModuleNavigation; }); diff --git a/admin/tool/lp/amd/src/scalevalues.js b/admin/tool/lp/amd/src/scalevalues.js index cc4fbc72fba96..7d2ada00f0f4c 100644 --- a/admin/tool/lp/amd/src/scalevalues.js +++ b/admin/tool/lp/amd/src/scalevalues.js @@ -16,13 +16,14 @@ /** * Module to get the scale values. * + * @module tool_lp/scalevalues * @copyright 2016 Serge Gauthier * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ define(['jquery', 'core/ajax'], function($, ajax) { var localCache = []; - return /** @alias module:tool_lp/scalevalues */ { + return { /** * Return a promise object that will be resolved into a string eventually (maybe immediately). diff --git a/admin/tool/lp/amd/src/user_competency_course_navigation.js b/admin/tool/lp/amd/src/user_competency_course_navigation.js index 97056b346869b..6a088697ff79b 100644 --- a/admin/tool/lp/amd/src/user_competency_course_navigation.js +++ b/admin/tool/lp/amd/src/user_competency_course_navigation.js @@ -16,6 +16,7 @@ /** * Module to enable inline editing of a comptency grade. * + * @module tool_lp/user_competency_course_navigation * @copyright 2015 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,6 +26,7 @@ define(['jquery'], function($) { /** * UserCompetencyCourseNavigation * + * @class tool_lp/user_competency_course_navigation * @param {String} userSelector The selector of the user element. * @param {String} competencySelector The selector of the competency element. * @param {String} baseUrl The base url for the page (no params). @@ -77,6 +79,5 @@ define(['jquery'], function($) { /** @property {Boolean} Ignore the first change event for competencies. */ UserCompetencyCourseNavigation.prototype._ignoreFirstCompetency = null; - return /** @alias module:tool_lp/user_competency_course_navigation */ UserCompetencyCourseNavigation; - + return UserCompetencyCourseNavigation; }); diff --git a/admin/tool/lp/amd/src/user_competency_info.js b/admin/tool/lp/amd/src/user_competency_info.js index 9cfccca231689..fe85cdfafd8bd 100644 --- a/admin/tool/lp/amd/src/user_competency_info.js +++ b/admin/tool/lp/amd/src/user_competency_info.js @@ -16,6 +16,7 @@ /** * Module to refresh a user competency summary in a page. * + * @module tool_lp/user_competency_info * @copyright 2015 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/lp/amd/src/user_competency_plan_popup.js b/admin/tool/lp/amd/src/user_competency_plan_popup.js index a5428f2f6e90a..b5f1144bdb88f 100644 --- a/admin/tool/lp/amd/src/user_competency_plan_popup.js +++ b/admin/tool/lp/amd/src/user_competency_plan_popup.js @@ -16,6 +16,7 @@ /** * Module to open user competency plan in popup * + * @module tool_lp/user_competency_plan_popup * @copyright 2016 Issam Taboubi * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/policy/amd/build/acceptmodal.min.js.map b/admin/tool/policy/amd/build/acceptmodal.min.js.map index 64600978a769a..6bf9fcd76fbea 100644 --- a/admin/tool/policy/amd/build/acceptmodal.min.js.map +++ b/admin/tool/policy/amd/build/acceptmodal.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/acceptmodal.js"],"names":["define","$","Str","ModalFactory","ModalEvents","Notification","Fragment","Ajax","Y","AcceptOnBehalf","contextid","init","prototype","modal","currentTrigger","triggers","SINGLE","BULK","on","e","preventDefault","currentTarget","href","attr","formData","slice","indexOf","showFormModal","bind","form","closest","find","length","serialize","get_strings","key","component","then","strings","alert","fail","exception","action","params","split","i","pair","title","saveText","create","type","types","SAVE_CANCEL","body","done","setupFormModal","catch","setLarge","setSaveButtonText","getRoot","hidden","destroy","setBody","getBody","save","submitForm","submitFormAjax","show","jsonformdata","JSON","stringify","loadFragment","requests","call","methodname","args","data","validationerrors","close","submit","document","location","reload","use","M","core_formchangechecker","reset_form_dirty_state","focus","getInstance"],"mappings":"AAuBAA,OAAM,2BAAC,CAAC,QAAD,CAAW,UAAX,C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AC,CAACC,sBAAF,CAAyBC,sBAAzB,EACH,CAFD,EAGA,KAAKzE,KAAL,CAAWgD,OAAX,GACA,KAAK/C,cAAL,CAAoByE,KAApB,EACH,CAND,CAQA,MAAoD,CAShDC,WAAW,CAAE,qBAAS9E,CAAT,CAAoB,CAC7B,MAAO,IAAID,CAAAA,CAAJ,CAAmBC,CAAnB,CACV,CAX+C,CAavD,CApPC,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Add policy consent modal to the page\n *\n * @module tool_policy/acceptmodal\n * @class AcceptOnBehalf\n * @copyright 2018 Marina Glancy\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/modal_events', 'core/notification', 'core/fragment',\n 'core/ajax', 'core/yui'],\n function($, Str, ModalFactory, ModalEvents, Notification, Fragment, Ajax, Y) {\n\n \"use strict\";\n\n /**\n * Constructor\n *\n * @param {int} contextid\n *\n * Each call to init gets it's own instance of this class.\n */\n var AcceptOnBehalf = function(contextid) {\n this.contextid = contextid;\n this.init();\n };\n\n /**\n * @var {Modal} modal\n * @private\n */\n AcceptOnBehalf.prototype.modal = null;\n\n /**\n * @var {int} contextid\n * @private\n */\n AcceptOnBehalf.prototype.contextid = -1;\n\n /**\n * @var {object} currentTrigger The triggered HTML jQuery object\n * @private\n */\n AcceptOnBehalf.prototype.currentTrigger = null;\n\n /**\n * @var {object} triggers The trigger selectors\n * @private\n */\n AcceptOnBehalf.prototype.triggers = {\n SINGLE: 'a[data-action=acceptmodal]',\n BULK: 'input[data-action=acceptmodal]'\n };\n\n /**\n * Initialise the class.\n *\n * @private\n */\n AcceptOnBehalf.prototype.init = function() {\n // Initialise for links accepting policies for individual users.\n $(this.triggers.SINGLE).on('click', function(e) {\n e.preventDefault();\n this.currentTrigger = $(e.currentTarget);\n var href = $(e.currentTarget).attr('href'),\n formData = href.slice(href.indexOf('?') + 1);\n this.showFormModal(formData);\n }.bind(this));\n\n // Initialise for multiple users acceptance form.\n $(this.triggers.BULK).on('click', function(e) {\n e.preventDefault();\n this.currentTrigger = $(e.currentTarget);\n var form = $(e.currentTarget).closest('form');\n if (form.find('input[type=checkbox][name=\"userids[]\"]:checked').length) {\n var formData = form.serialize();\n this.showFormModal(formData);\n } else {\n Str.get_strings([\n {key: 'notice'},\n {key: 'selectusersforconsent', component: 'tool_policy'},\n {key: 'ok'}\n ]).then(function(strings) {\n Notification.alert(strings[0], strings[1], strings[2]);\n return;\n }).fail(Notification.exception);\n }\n }.bind(this));\n };\n\n /**\n * Show modal with a form\n *\n * @param {String} formData\n */\n AcceptOnBehalf.prototype.showFormModal = function(formData) {\n var action;\n var params = formData.split('&');\n for (var i = 0; i < params.length; i++) {\n var pair = params[i].split('=');\n if (pair[0] == 'action') {\n action = pair[1];\n }\n }\n // Fetch the title string.\n Str.get_strings([\n {key: 'statusformtitleaccept', component: 'tool_policy'},\n {key: 'iagreetothepolicy', component: 'tool_policy'},\n {key: 'statusformtitlerevoke', component: 'tool_policy'},\n {key: 'irevokethepolicy', component: 'tool_policy'},\n {key: 'statusformtitledecline', component: 'tool_policy'},\n {key: 'declinethepolicy', component: 'tool_policy'}\n ]).then(function(strings) {\n var title;\n var saveText;\n if (action == 'accept') {\n title = strings[0];\n saveText = strings[1];\n } else if (action == 'revoke') {\n title = strings[2];\n saveText = strings[3];\n } else if (action == 'decline') {\n title = strings[4];\n saveText = strings[5];\n }\n // Create the modal.\n return ModalFactory.create({\n type: ModalFactory.types.SAVE_CANCEL,\n title: title,\n body: ''\n }).done(function(modal) {\n this.modal = modal;\n this.setupFormModal(formData, saveText);\n }.bind(this));\n }.bind(this))\n .catch(Notification.exception);\n };\n\n /**\n * Setup form inside a modal\n *\n * @param {String} formData\n * @param {String} saveText\n */\n AcceptOnBehalf.prototype.setupFormModal = function(formData, saveText) {\n var modal = this.modal;\n\n modal.setLarge();\n\n modal.setSaveButtonText(saveText);\n\n // We want to reset the form every time it is opened.\n modal.getRoot().on(ModalEvents.hidden, this.destroy.bind(this));\n\n modal.setBody(this.getBody(formData));\n\n // We catch the modal save event, and use it to submit the form inside the modal.\n // Triggering a form submission will give JS validation scripts a chance to check for errors.\n modal.getRoot().on(ModalEvents.save, this.submitForm.bind(this));\n // We also catch the form submit event and use it to submit the form with ajax.\n modal.getRoot().on('submit', 'form', this.submitFormAjax.bind(this));\n\n modal.show();\n };\n\n /**\n * Load the body of the modal (contains the form)\n *\n * @method getBody\n * @private\n * @param {String} formData\n * @return {Promise}\n */\n AcceptOnBehalf.prototype.getBody = function(formData) {\n if (typeof formData === \"undefined\") {\n formData = {};\n }\n // Get the content of the modal.\n var params = {jsonformdata: JSON.stringify(formData)};\n return Fragment.loadFragment('tool_policy', 'accept_on_behalf', this.contextid, params);\n };\n\n /**\n * Submit the form inside the modal via AJAX request\n *\n * @method submitFormAjax\n * @private\n * @param {Event} e Form submission event.\n */\n AcceptOnBehalf.prototype.submitFormAjax = function(e) {\n // We don't want to do a real form submission.\n e.preventDefault();\n\n // Convert all the form elements values to a serialised string.\n var formData = this.modal.getRoot().find('form').serialize();\n\n var requests = Ajax.call([{\n methodname: 'tool_policy_submit_accept_on_behalf',\n args: {jsonformdata: JSON.stringify(formData)}\n }]);\n requests[0].done(function(data) {\n if (data.validationerrors) {\n this.modal.setBody(this.getBody(formData));\n } else {\n this.close();\n }\n }.bind(this)).fail(Notification.exception);\n };\n\n /**\n * This triggers a form submission, so that any mform elements can do final tricks before the form submission is processed.\n *\n * @method submitForm\n * @param {Event} e Form submission event.\n * @private\n */\n AcceptOnBehalf.prototype.submitForm = function(e) {\n e.preventDefault();\n this.modal.getRoot().find('form').submit();\n };\n\n /**\n * Close the modal\n */\n AcceptOnBehalf.prototype.close = function() {\n this.destroy();\n document.location.reload();\n };\n\n /**\n * Destroy the modal\n */\n AcceptOnBehalf.prototype.destroy = function() {\n Y.use('moodle-core-formchangechecker', function() {\n M.core_formchangechecker.reset_form_dirty_state();\n });\n this.modal.destroy();\n this.currentTrigger.focus();\n };\n\n return /** @alias module:tool_policy/acceptmodal */ {\n // Public variables and functions.\n /**\n * Attach event listeners to initialise this module.\n *\n * @method init\n * @param {int} contextid The contextid for the course.\n * @return {AcceptOnBehalf}\n */\n getInstance: function(contextid) {\n return new AcceptOnBehalf(contextid);\n }\n };\n });\n"],"file":"acceptmodal.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/acceptmodal.js"],"names":["define","$","Str","ModalFactory","ModalEvents","Notification","Fragment","Ajax","Y","AcceptOnBehalf","contextid","init","prototype","modal","currentTrigger","triggers","SINGLE","BULK","on","e","preventDefault","currentTarget","href","attr","formData","slice","indexOf","showFormModal","bind","form","closest","find","length","serialize","get_strings","key","component","then","strings","alert","fail","exception","action","params","split","i","pair","title","saveText","create","type","types","SAVE_CANCEL","body","done","setupFormModal","catch","setLarge","setSaveButtonText","getRoot","hidden","destroy","setBody","getBody","save","submitForm","submitFormAjax","show","jsonformdata","JSON","stringify","loadFragment","requests","call","methodname","args","data","validationerrors","close","submit","document","location","reload","use","M","core_formchangechecker","reset_form_dirty_state","focus","getInstance"],"mappings":"AAsBAA,OAAM,2BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,oBAAvB,CAA6C,mBAA7C,CAAkE,mBAAlE,CAAuF,eAAvF,CACC,WADD,CACc,UADd,CAAD,CAEF,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA+BC,CAA/B,CAA4CC,CAA5C,CAA0DC,CAA1D,CAAoEC,CAApE,CAA0EC,CAA1E,CAA6E,CAEzE,a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,CACV,CAX+C,CAavD,CApPC,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Add policy consent modal to the page\n *\n * @module tool_policy/acceptmodal\n * @copyright 2018 Marina Glancy\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/modal_events', 'core/notification', 'core/fragment',\n 'core/ajax', 'core/yui'],\n function($, Str, ModalFactory, ModalEvents, Notification, Fragment, Ajax, Y) {\n\n \"use strict\";\n\n /**\n * Constructor\n *\n * @param {int} contextid\n *\n * Each call to init gets it's own instance of this class.\n */\n var AcceptOnBehalf = function(contextid) {\n this.contextid = contextid;\n this.init();\n };\n\n /**\n * @var {Modal} modal\n * @private\n */\n AcceptOnBehalf.prototype.modal = null;\n\n /**\n * @var {int} contextid\n * @private\n */\n AcceptOnBehalf.prototype.contextid = -1;\n\n /**\n * @var {object} currentTrigger The triggered HTML jQuery object\n * @private\n */\n AcceptOnBehalf.prototype.currentTrigger = null;\n\n /**\n * @var {object} triggers The trigger selectors\n * @private\n */\n AcceptOnBehalf.prototype.triggers = {\n SINGLE: 'a[data-action=acceptmodal]',\n BULK: 'input[data-action=acceptmodal]'\n };\n\n /**\n * Initialise the class.\n *\n * @private\n */\n AcceptOnBehalf.prototype.init = function() {\n // Initialise for links accepting policies for individual users.\n $(this.triggers.SINGLE).on('click', function(e) {\n e.preventDefault();\n this.currentTrigger = $(e.currentTarget);\n var href = $(e.currentTarget).attr('href'),\n formData = href.slice(href.indexOf('?') + 1);\n this.showFormModal(formData);\n }.bind(this));\n\n // Initialise for multiple users acceptance form.\n $(this.triggers.BULK).on('click', function(e) {\n e.preventDefault();\n this.currentTrigger = $(e.currentTarget);\n var form = $(e.currentTarget).closest('form');\n if (form.find('input[type=checkbox][name=\"userids[]\"]:checked').length) {\n var formData = form.serialize();\n this.showFormModal(formData);\n } else {\n Str.get_strings([\n {key: 'notice'},\n {key: 'selectusersforconsent', component: 'tool_policy'},\n {key: 'ok'}\n ]).then(function(strings) {\n Notification.alert(strings[0], strings[1], strings[2]);\n return;\n }).fail(Notification.exception);\n }\n }.bind(this));\n };\n\n /**\n * Show modal with a form\n *\n * @param {String} formData\n */\n AcceptOnBehalf.prototype.showFormModal = function(formData) {\n var action;\n var params = formData.split('&');\n for (var i = 0; i < params.length; i++) {\n var pair = params[i].split('=');\n if (pair[0] == 'action') {\n action = pair[1];\n }\n }\n // Fetch the title string.\n Str.get_strings([\n {key: 'statusformtitleaccept', component: 'tool_policy'},\n {key: 'iagreetothepolicy', component: 'tool_policy'},\n {key: 'statusformtitlerevoke', component: 'tool_policy'},\n {key: 'irevokethepolicy', component: 'tool_policy'},\n {key: 'statusformtitledecline', component: 'tool_policy'},\n {key: 'declinethepolicy', component: 'tool_policy'}\n ]).then(function(strings) {\n var title;\n var saveText;\n if (action == 'accept') {\n title = strings[0];\n saveText = strings[1];\n } else if (action == 'revoke') {\n title = strings[2];\n saveText = strings[3];\n } else if (action == 'decline') {\n title = strings[4];\n saveText = strings[5];\n }\n // Create the modal.\n return ModalFactory.create({\n type: ModalFactory.types.SAVE_CANCEL,\n title: title,\n body: ''\n }).done(function(modal) {\n this.modal = modal;\n this.setupFormModal(formData, saveText);\n }.bind(this));\n }.bind(this))\n .catch(Notification.exception);\n };\n\n /**\n * Setup form inside a modal\n *\n * @param {String} formData\n * @param {String} saveText\n */\n AcceptOnBehalf.prototype.setupFormModal = function(formData, saveText) {\n var modal = this.modal;\n\n modal.setLarge();\n\n modal.setSaveButtonText(saveText);\n\n // We want to reset the form every time it is opened.\n modal.getRoot().on(ModalEvents.hidden, this.destroy.bind(this));\n\n modal.setBody(this.getBody(formData));\n\n // We catch the modal save event, and use it to submit the form inside the modal.\n // Triggering a form submission will give JS validation scripts a chance to check for errors.\n modal.getRoot().on(ModalEvents.save, this.submitForm.bind(this));\n // We also catch the form submit event and use it to submit the form with ajax.\n modal.getRoot().on('submit', 'form', this.submitFormAjax.bind(this));\n\n modal.show();\n };\n\n /**\n * Load the body of the modal (contains the form)\n *\n * @method getBody\n * @private\n * @param {String} formData\n * @return {Promise}\n */\n AcceptOnBehalf.prototype.getBody = function(formData) {\n if (typeof formData === \"undefined\") {\n formData = {};\n }\n // Get the content of the modal.\n var params = {jsonformdata: JSON.stringify(formData)};\n return Fragment.loadFragment('tool_policy', 'accept_on_behalf', this.contextid, params);\n };\n\n /**\n * Submit the form inside the modal via AJAX request\n *\n * @method submitFormAjax\n * @private\n * @param {Event} e Form submission event.\n */\n AcceptOnBehalf.prototype.submitFormAjax = function(e) {\n // We don't want to do a real form submission.\n e.preventDefault();\n\n // Convert all the form elements values to a serialised string.\n var formData = this.modal.getRoot().find('form').serialize();\n\n var requests = Ajax.call([{\n methodname: 'tool_policy_submit_accept_on_behalf',\n args: {jsonformdata: JSON.stringify(formData)}\n }]);\n requests[0].done(function(data) {\n if (data.validationerrors) {\n this.modal.setBody(this.getBody(formData));\n } else {\n this.close();\n }\n }.bind(this)).fail(Notification.exception);\n };\n\n /**\n * This triggers a form submission, so that any mform elements can do final tricks before the form submission is processed.\n *\n * @method submitForm\n * @param {Event} e Form submission event.\n * @private\n */\n AcceptOnBehalf.prototype.submitForm = function(e) {\n e.preventDefault();\n this.modal.getRoot().find('form').submit();\n };\n\n /**\n * Close the modal\n */\n AcceptOnBehalf.prototype.close = function() {\n this.destroy();\n document.location.reload();\n };\n\n /**\n * Destroy the modal\n */\n AcceptOnBehalf.prototype.destroy = function() {\n Y.use('moodle-core-formchangechecker', function() {\n M.core_formchangechecker.reset_form_dirty_state();\n });\n this.modal.destroy();\n this.currentTrigger.focus();\n };\n\n return /** @alias module:tool_policy/acceptmodal */ {\n // Public variables and functions.\n /**\n * Attach event listeners to initialise this module.\n *\n * @method init\n * @param {int} contextid The contextid for the course.\n * @return {AcceptOnBehalf}\n */\n getInstance: function(contextid) {\n return new AcceptOnBehalf(contextid);\n }\n };\n });\n"],"file":"acceptmodal.min.js"} \ No newline at end of file diff --git a/admin/tool/policy/amd/src/acceptmodal.js b/admin/tool/policy/amd/src/acceptmodal.js index 254ac1abc0227..57808ae979fa5 100644 --- a/admin/tool/policy/amd/src/acceptmodal.js +++ b/admin/tool/policy/amd/src/acceptmodal.js @@ -17,7 +17,6 @@ * Add policy consent modal to the page * * @module tool_policy/acceptmodal - * @class AcceptOnBehalf * @copyright 2018 Marina Glancy * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/usertours/amd/build/filter_cssselector.min.js.map b/admin/tool/usertours/amd/build/filter_cssselector.min.js.map index f570cef73cf52..969f574c204c1 100644 --- a/admin/tool/usertours/amd/build/filter_cssselector.min.js.map +++ b/admin/tool/usertours/amd/build/filter_cssselector.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/filter_cssselector.js"],"names":["filterMatches","tourConfig","filterValues","filtervalues","cssselector","document","querySelector"],"mappings":"yKA8B6B,QAAhBA,CAAAA,aAAgB,CAASC,CAAT,CAAqB,CAC9C,GAAIC,CAAAA,CAAY,CAAGD,CAAU,CAACE,YAAX,CAAwBC,WAA3C,CACA,GAAIF,CAAY,CAAC,CAAD,CAAhB,CAAqB,CACjB,MAAO,CAAC,CAACG,QAAQ,CAACC,aAAT,CAAuBJ,CAAY,CAAC,CAAD,CAAnC,CACZ,CAED,QACH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * CSS selector client side filter.\n *\n * @module tool_usertours/filter_cssselector\n * @class filter_cssselector\n * @copyright 2020 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * Checks whether the configured CSS selector exists on this page.\n *\n * @param {array} tourConfig The tour configuration.\n * @returns {boolean}\n */\nexport const filterMatches = function(tourConfig) {\n let filterValues = tourConfig.filtervalues.cssselector;\n if (filterValues[0]) {\n return !!document.querySelector(filterValues[0]);\n }\n // If there is no CSS selector configured, this page matches.\n return true;\n};\n"],"file":"filter_cssselector.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/filter_cssselector.js"],"names":["filterMatches","tourConfig","filterValues","filtervalues","cssselector","document","querySelector"],"mappings":"yKA6B6B,QAAhBA,CAAAA,aAAgB,CAASC,CAAT,CAAqB,CAC9C,GAAIC,CAAAA,CAAY,CAAGD,CAAU,CAACE,YAAX,CAAwBC,WAA3C,CACA,GAAIF,CAAY,CAAC,CAAD,CAAhB,CAAqB,CACjB,MAAO,CAAC,CAACG,QAAQ,CAACC,aAAT,CAAuBJ,CAAY,CAAC,CAAD,CAAnC,CACZ,CAED,QACH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * CSS selector client side filter.\n *\n * @module tool_usertours/filter_cssselector\n * @copyright 2020 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * Checks whether the configured CSS selector exists on this page.\n *\n * @param {array} tourConfig The tour configuration.\n * @returns {boolean}\n */\nexport const filterMatches = function(tourConfig) {\n let filterValues = tourConfig.filtervalues.cssselector;\n if (filterValues[0]) {\n return !!document.querySelector(filterValues[0]);\n }\n // If there is no CSS selector configured, this page matches.\n return true;\n};\n"],"file":"filter_cssselector.min.js"} \ No newline at end of file diff --git a/admin/tool/usertours/amd/build/managesteps.min.js.map b/admin/tool/usertours/amd/build/managesteps.min.js.map index 44dc09e4f6342..5650182be3f42 100644 --- a/admin/tool/usertours/amd/build/managesteps.min.js.map +++ b/admin/tool/usertours/amd/build/managesteps.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/managesteps.js"],"names":["define","$","str","notification","manager","removeStep","e","preventDefault","targetUrl","currentTarget","attr","get_strings","key","component","then","s","confirm","window","location","catch","setup","delegate"],"mappings":"AAOAA,OAAM,8BACN,CAAC,QAAD,CAAW,UAAX,CAAuB,mBAAvB,CADM,CAEN,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA+B,CAC3B,GAAIC,CAAAA,CAAO,CAAG,CAOVC,UAAU,CAAE,oBAASC,CAAT,CAAY,CACpBA,CAAC,CAACC,cAAF,GACA,GAAIC,CAAAA,CAAS,CAAGP,CAAC,CAACK,CAAC,CAACG,aAAH,CAAD,CAAmBC,IAAnB,CAAwB,MAAxB,CAAhB,CACAR,CAAG,CAACS,WAAJ,CAAgB,CACZ,CACIC,GAAG,CAAS,yBADhB,CAEIC,SAAS,CAAG,gBAFhB,CADY,CAKZ,CACID,GAAG,CAAS,4BADhB,CAEIC,SAAS,CAAG,gBAFhB,CALY,CASZ,CACID,GAAG,CAAS,KADhB,CAEIC,SAAS,CAAG,QAFhB,CATY,CAaZ,CACID,GAAG,CAAS,IADhB,CAEIC,SAAS,CAAG,QAFhB,CAbY,CAAhB,EAkBCC,IAlBD,CAkBM,SAASC,CAAT,CAAY,CACdZ,CAAY,CAACa,OAAb,CAAqBD,CAAC,CAAC,CAAD,CAAtB,CAA2BA,CAAC,CAAC,CAAD,CAA5B,CAAiCA,CAAC,CAAC,CAAD,CAAlC,CAAuCA,CAAC,CAAC,CAAD,CAAxC,CAA6C,UAAW,CACpDE,MAAM,CAACC,QAAP,CAAkBV,CACrB,CAFD,CAKH,CAxBD,EAyBCW,KAzBD,EA0BH,CApCS,CA2CVC,KAAK,CAAE,gBAAW,CAEdnB,CAAC,CAAC,MAAD,CAAD,CAAUoB,QAAV,CAAmB,0BAAnB,CAA6C,OAA7C,CAAsDjB,CAAO,CAACC,UAA9D,CACH,CA9CS,CAAd,CAiDA,MAAuD,CAMnDe,KAAK,CAAEhB,CAAO,CAACgB,KANoC,CAQ1D,CA5DK,CAAN","sourcesContent":["/**\n * Step management code.\n *\n * @module tool_usertours/managesteps\n * @class managesteps\n * @copyright 2016 Andrew Nicols \n */\ndefine(\n['jquery', 'core/str', 'core/notification'],\nfunction($, str, notification) {\n var manager = {\n /**\n * Confirm removal of the specified step.\n *\n * @method removeStep\n * @param {EventFacade} e The EventFacade\n */\n removeStep: function(e) {\n e.preventDefault();\n var targetUrl = $(e.currentTarget).attr('href');\n str.get_strings([\n {\n key: 'confirmstepremovaltitle',\n component: 'tool_usertours'\n },\n {\n key: 'confirmstepremovalquestion',\n component: 'tool_usertours'\n },\n {\n key: 'yes',\n component: 'moodle'\n },\n {\n key: 'no',\n component: 'moodle'\n }\n ])\n .then(function(s) {\n notification.confirm(s[0], s[1], s[2], s[3], function() {\n window.location = targetUrl;\n });\n\n return;\n })\n .catch();\n },\n\n /**\n * Setup the step management UI.\n *\n * @method setup\n */\n setup: function() {\n\n $('body').delegate('[data-action=\"delete\"]', 'click', manager.removeStep);\n }\n };\n\n return /** @alias module:tool_usertours/managesteps */ {\n /**\n * Setup the step management UI.\n *\n * @method setup\n */\n setup: manager.setup\n };\n});\n"],"file":"managesteps.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/managesteps.js"],"names":["define","$","str","notification","manager","removeStep","e","preventDefault","targetUrl","currentTarget","attr","get_strings","key","component","then","s","confirm","window","location","catch","setup","delegate"],"mappings":"AAMAA,OAAM,8BACN,CAAC,QAAD,CAAW,UAAX,CAAuB,mBAAvB,CADM,CAEN,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA+B,CAC3B,GAAIC,CAAAA,CAAO,CAAG,CAOVC,UAAU,CAAE,oBAASC,CAAT,CAAY,CACpBA,CAAC,CAACC,cAAF,GACA,GAAIC,CAAAA,CAAS,CAAGP,CAAC,CAACK,CAAC,CAACG,aAAH,CAAD,CAAmBC,IAAnB,CAAwB,MAAxB,CAAhB,CACAR,CAAG,CAACS,WAAJ,CAAgB,CACZ,CACIC,GAAG,CAAS,yBADhB,CAEIC,SAAS,CAAG,gBAFhB,CADY,CAKZ,CACID,GAAG,CAAS,4BADhB,CAEIC,SAAS,CAAG,gBAFhB,CALY,CASZ,CACID,GAAG,CAAS,KADhB,CAEIC,SAAS,CAAG,QAFhB,CATY,CAaZ,CACID,GAAG,CAAS,IADhB,CAEIC,SAAS,CAAG,QAFhB,CAbY,CAAhB,EAkBCC,IAlBD,CAkBM,SAASC,CAAT,CAAY,CACdZ,CAAY,CAACa,OAAb,CAAqBD,CAAC,CAAC,CAAD,CAAtB,CAA2BA,CAAC,CAAC,CAAD,CAA5B,CAAiCA,CAAC,CAAC,CAAD,CAAlC,CAAuCA,CAAC,CAAC,CAAD,CAAxC,CAA6C,UAAW,CACpDE,MAAM,CAACC,QAAP,CAAkBV,CACrB,CAFD,CAKH,CAxBD,EAyBCW,KAzBD,EA0BH,CApCS,CA2CVC,KAAK,CAAE,gBAAW,CAEdnB,CAAC,CAAC,MAAD,CAAD,CAAUoB,QAAV,CAAmB,0BAAnB,CAA6C,OAA7C,CAAsDjB,CAAO,CAACC,UAA9D,CACH,CA9CS,CAAd,CAiDA,MAAuD,CAMnDe,KAAK,CAAEhB,CAAO,CAACgB,KANoC,CAQ1D,CA5DK,CAAN","sourcesContent":["/**\n * Step management code.\n *\n * @module tool_usertours/managesteps\n * @copyright 2016 Andrew Nicols \n */\ndefine(\n['jquery', 'core/str', 'core/notification'],\nfunction($, str, notification) {\n var manager = {\n /**\n * Confirm removal of the specified step.\n *\n * @method removeStep\n * @param {EventFacade} e The EventFacade\n */\n removeStep: function(e) {\n e.preventDefault();\n var targetUrl = $(e.currentTarget).attr('href');\n str.get_strings([\n {\n key: 'confirmstepremovaltitle',\n component: 'tool_usertours'\n },\n {\n key: 'confirmstepremovalquestion',\n component: 'tool_usertours'\n },\n {\n key: 'yes',\n component: 'moodle'\n },\n {\n key: 'no',\n component: 'moodle'\n }\n ])\n .then(function(s) {\n notification.confirm(s[0], s[1], s[2], s[3], function() {\n window.location = targetUrl;\n });\n\n return;\n })\n .catch();\n },\n\n /**\n * Setup the step management UI.\n *\n * @method setup\n */\n setup: function() {\n\n $('body').delegate('[data-action=\"delete\"]', 'click', manager.removeStep);\n }\n };\n\n return /** @alias module:tool_usertours/managesteps */ {\n /**\n * Setup the step management UI.\n *\n * @method setup\n */\n setup: manager.setup\n };\n});\n"],"file":"managesteps.min.js"} \ No newline at end of file diff --git a/admin/tool/usertours/amd/build/managetours.min.js.map b/admin/tool/usertours/amd/build/managetours.min.js.map index 6d38641cf929e..61afb441f14f5 100644 --- a/admin/tool/usertours/amd/build/managetours.min.js.map +++ b/admin/tool/usertours/amd/build/managetours.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/managetours.js"],"names":["define","$","ajax","str","notification","manager","removeTour","e","preventDefault","targetUrl","currentTarget","attr","get_strings","key","component","then","s","confirm","window","location","catch","setup","delegate"],"mappings":"AAOAA,OAAM,8BACN,CAAC,QAAD,CAAW,WAAX,CAAwB,UAAxB,CAAoC,mBAApC,CADM,CAEN,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAuBC,CAAvB,CAAqC,CACjC,GAAIC,CAAAA,CAAO,CAAG,CAOVC,UAAU,CAAE,oBAASC,CAAT,CAAY,CACpBA,CAAC,CAACC,cAAF,GACA,GAAIC,CAAAA,CAAS,CAAGR,CAAC,CAACM,CAAC,CAACG,aAAH,CAAD,CAAmBC,IAAnB,CAAwB,MAAxB,CAAhB,CACAR,CAAG,CAACS,WAAJ,CAAgB,CACZ,CACIC,GAAG,CAAS,yBADhB,CAEIC,SAAS,CAAG,gBAFhB,CADY,CAKZ,CACID,GAAG,CAAS,4BADhB,CAEIC,SAAS,CAAG,gBAFhB,CALY,CASZ,CACID,GAAG,CAAS,KADhB,CAEIC,SAAS,CAAG,QAFhB,CATY,CAaZ,CACID,GAAG,CAAS,IADhB,CAEIC,SAAS,CAAG,QAFhB,CAbY,CAAhB,EAkBCC,IAlBD,CAkBM,SAASC,CAAT,CAAY,CACdZ,CAAY,CAACa,OAAb,CAAqBD,CAAC,CAAC,CAAD,CAAtB,CAA2BA,CAAC,CAAC,CAAD,CAA5B,CAAiCA,CAAC,CAAC,CAAD,CAAlC,CAAuCA,CAAC,CAAC,CAAD,CAAxC,CAA6C,UAAW,CACpDE,MAAM,CAACC,QAAP,CAAkBV,CACrB,CAFD,CAKH,CAxBD,EAyBCW,KAzBD,EA0BH,CApCS,CA2CVC,KAAK,CAAE,gBAAW,CACdpB,CAAC,CAAC,MAAD,CAAD,CAAUqB,QAAV,CAAmB,0BAAnB,CAA6C,OAA7C,CAAsDjB,CAAO,CAACC,UAA9D,CACH,CA7CS,CAAd,CAgDA,MAAuD,CAMnDe,KAAK,CAAEhB,CAAO,CAACgB,KANoC,CAQ1D,CA3DK,CAAN","sourcesContent":["/**\n * Tour management code.\n *\n * @module tool_usertours/managetours\n * @class managetours\n * @copyright 2016 Andrew Nicols \n */\ndefine(\n['jquery', 'core/ajax', 'core/str', 'core/notification'],\nfunction($, ajax, str, notification) {\n var manager = {\n /**\n * Confirm removal of the specified tour.\n *\n * @method removeTour\n * @param {EventFacade} e The EventFacade\n */\n removeTour: function(e) {\n e.preventDefault();\n var targetUrl = $(e.currentTarget).attr('href');\n str.get_strings([\n {\n key: 'confirmtourremovaltitle',\n component: 'tool_usertours'\n },\n {\n key: 'confirmtourremovalquestion',\n component: 'tool_usertours'\n },\n {\n key: 'yes',\n component: 'moodle'\n },\n {\n key: 'no',\n component: 'moodle'\n }\n ])\n .then(function(s) {\n notification.confirm(s[0], s[1], s[2], s[3], function() {\n window.location = targetUrl;\n });\n\n return;\n })\n .catch();\n },\n\n /**\n * Setup the tour management UI.\n *\n * @method setup\n */\n setup: function() {\n $('body').delegate('[data-action=\"delete\"]', 'click', manager.removeTour);\n }\n };\n\n return /** @alias module:tool_usertours/managetours */ {\n /**\n * Setup the tour management UI.\n *\n * @method setup\n */\n setup: manager.setup\n };\n});\n"],"file":"managetours.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/managetours.js"],"names":["define","$","ajax","str","notification","manager","removeTour","e","preventDefault","targetUrl","currentTarget","attr","get_strings","key","component","then","s","confirm","window","location","catch","setup","delegate"],"mappings":"AAMAA,OAAM,8BACN,CAAC,QAAD,CAAW,WAAX,CAAwB,UAAxB,CAAoC,mBAApC,CADM,CAEN,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAuBC,CAAvB,CAAqC,CACjC,GAAIC,CAAAA,CAAO,CAAG,CAOVC,UAAU,CAAE,oBAASC,CAAT,CAAY,CACpBA,CAAC,CAACC,cAAF,GACA,GAAIC,CAAAA,CAAS,CAAGR,CAAC,CAACM,CAAC,CAACG,aAAH,CAAD,CAAmBC,IAAnB,CAAwB,MAAxB,CAAhB,CACAR,CAAG,CAACS,WAAJ,CAAgB,CACZ,CACIC,GAAG,CAAS,yBADhB,CAEIC,SAAS,CAAG,gBAFhB,CADY,CAKZ,CACID,GAAG,CAAS,4BADhB,CAEIC,SAAS,CAAG,gBAFhB,CALY,CASZ,CACID,GAAG,CAAS,KADhB,CAEIC,SAAS,CAAG,QAFhB,CATY,CAaZ,CACID,GAAG,CAAS,IADhB,CAEIC,SAAS,CAAG,QAFhB,CAbY,CAAhB,EAkBCC,IAlBD,CAkBM,SAASC,CAAT,CAAY,CACdZ,CAAY,CAACa,OAAb,CAAqBD,CAAC,CAAC,CAAD,CAAtB,CAA2BA,CAAC,CAAC,CAAD,CAA5B,CAAiCA,CAAC,CAAC,CAAD,CAAlC,CAAuCA,CAAC,CAAC,CAAD,CAAxC,CAA6C,UAAW,CACpDE,MAAM,CAACC,QAAP,CAAkBV,CACrB,CAFD,CAKH,CAxBD,EAyBCW,KAzBD,EA0BH,CApCS,CA2CVC,KAAK,CAAE,gBAAW,CACdpB,CAAC,CAAC,MAAD,CAAD,CAAUqB,QAAV,CAAmB,0BAAnB,CAA6C,OAA7C,CAAsDjB,CAAO,CAACC,UAA9D,CACH,CA7CS,CAAd,CAgDA,MAAuD,CAMnDe,KAAK,CAAEhB,CAAO,CAACgB,KANoC,CAQ1D,CA3DK,CAAN","sourcesContent":["/**\n * Tour management code.\n *\n * @module tool_usertours/managetours\n * @copyright 2016 Andrew Nicols \n */\ndefine(\n['jquery', 'core/ajax', 'core/str', 'core/notification'],\nfunction($, ajax, str, notification) {\n var manager = {\n /**\n * Confirm removal of the specified tour.\n *\n * @method removeTour\n * @param {EventFacade} e The EventFacade\n */\n removeTour: function(e) {\n e.preventDefault();\n var targetUrl = $(e.currentTarget).attr('href');\n str.get_strings([\n {\n key: 'confirmtourremovaltitle',\n component: 'tool_usertours'\n },\n {\n key: 'confirmtourremovalquestion',\n component: 'tool_usertours'\n },\n {\n key: 'yes',\n component: 'moodle'\n },\n {\n key: 'no',\n component: 'moodle'\n }\n ])\n .then(function(s) {\n notification.confirm(s[0], s[1], s[2], s[3], function() {\n window.location = targetUrl;\n });\n\n return;\n })\n .catch();\n },\n\n /**\n * Setup the tour management UI.\n *\n * @method setup\n */\n setup: function() {\n $('body').delegate('[data-action=\"delete\"]', 'click', manager.removeTour);\n }\n };\n\n return /** @alias module:tool_usertours/managetours */ {\n /**\n * Setup the tour management UI.\n *\n * @method setup\n */\n setup: manager.setup\n };\n});\n"],"file":"managetours.min.js"} \ No newline at end of file diff --git a/admin/tool/usertours/amd/build/tour.min.js.map b/admin/tool/usertours/amd/build/tour.min.js.map index 382273a337fe1..0a8ff6084f8b8 100644 --- a/admin/tool/usertours/amd/build/tour.min.js.map +++ b/admin/tool/usertours/amd/build/tour.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/tour.js"],"names":["Tour","config","init","eventHandlers","reset","originalConfiguration","configure","apply","arguments","storage","window","sessionStorage","storageKey","tourName","e","hide","resetStepListeners","steps","currentStepNumber","eventName","forEach","handler","addEventHandler","resetStepDefaults","template","templateContent","checkMinimumRequirements","Error","length","loadOriginalConfiguration","stepDefaults","setStepDefaults","$","extend","element","placement","delay","moveOnClick","moveAfterTime","orphan","direction","parseInt","stepNumber","setItem","code","DOMException","QUOTA_EXCEEDED_ERR","removeItem","getCurrentStepNumber","nextStepNumber","isStepPotentiallyVisible","getStepConfig","previousStepNumber","getNextStepNumber","getPreviousStepNumber","stepConfig","isStepActuallyVisible","target","getStepTarget","is","gotoStep","endTour","_gotoStep","delayed","setTimeout","bind","fn","fireEventHandlers","renderStep","normalizeStepConfig","reflex","moveAfterClick","content","body","attachTo","attachPoint","first","data","thisEvent","call","push","listeners","node","currentStepNode","args","proxy","next","previous","handleKeyDown","targetNode","parents","listener","on","off","currentStepConfig","setCurrentStepNumber","getTemplateContent","find","html","title","isFirstStep","prop","isLastStep","removeClass","addClass","attr","addStepToPage","processStepListeners","clone","animationTarget","stop","zIndex","calculateZIndex","css","positionBackdrop","document","append","top","left","animate","scrollTop","calculateScrollTop","promise","then","positionStep","revealStep","catch","isOrphan","offset","calculateStepPositionInPage","currentStepPopper","Popper","removeOnDestroy","arrowElement","modifiers","enabled","applyStyle","onLoad","fadeIn","announceStep","focus","stepId","bodyRegion","headerRegion","accessibilityShow","tabbableSelector","keyCode","hasBackdrop","activeElement","stepTarget","tabbableNodes","dialogContainer","currentIndex","filter","index","has","each","nextIndex","nextNode","focusRelevant","shiftKey","closest","last","preventDefault","startAt","storageStartValue","getItem","storageStartAt","startTour","previousTarget","transition","destroy","fadeTime","remove","removeAttr","fadeOut","currentStepElement","accessibilityHide","viewportHeight","height","Math","max","min","ceil","stepHeight","viewportWidth","width","stepWidth","flipBehavior","flip","behaviour","arrow","onCreate","recalculateArrowPosition","onUpdate","split","isVertical","indexOf","instance","popper","querySelector","stepElement","arrowHeight","parseFloat","getComputedStyle","arrowOffset","popperHeight","popperOffset","popperBorderWidth","popperBorderRadiusWidth","arrowPos","maxPos","minPos","newArrowPos","arrowWidth","popperWidth","background","backdrop","insertAfter","buffer","colorNode","outerWidth","outerHeight","backgroundColor","calculateInherittedBackgroundColor","targetRadius","targetPosition","calculatePosition","fader","opacity","elem","position","value","isNaN","parent","fakeNode","fakeElemColor","color","hideFunction","child","flexitourRole","hidden","Aria","siblings","parentsUntil","showFunction","unhide"],"mappings":"8KAsBA,OACA,OACA,O,kqCAOqBA,CAAAA,C,YAIjB,WAAYC,CAAZ,CAAoB,WAChB,KAAKC,IAAL,CAAUD,CAAV,CACH,C,qCAUIA,C,CAAQ,CAET,KAAKE,aAAL,CAAqB,EAArB,CAGA,KAAKC,KAAL,GAGA,KAAKC,qBAAL,CAA6BJ,CAAM,EAAI,EAAvC,CAGA,KAAKK,SAAL,CAAeC,KAAf,CAAqB,IAArB,CAA2BC,SAA3B,EAEA,GAAI,CACA,KAAKC,OAAL,CAAeC,MAAM,CAACC,cAAtB,CACA,KAAKC,UAAL,CAAkB,aAAe,KAAKC,QACzC,CAAC,MAAOC,CAAP,CAAU,CACR,KAAKL,OAAL,IACA,KAAKG,UAAL,CAAkB,EACrB,CAED,MAAO,KACV,C,qCASO,CAEJ,KAAKG,IAAL,GAGA,KAAKZ,aAAL,CAAqB,EAArB,CAGA,KAAKa,kBAAL,GAGA,KAAKX,qBAAL,CAA6B,EAA7B,CAGA,KAAKY,KAAL,CAAa,EAAb,CA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AGH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Manage user tours in Moodle.\n *\n * @copyright 2018 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport $ from 'jquery';\nimport * as Aria from 'core/aria';\nimport Popper from 'core/popper';\n\n/**\n * A Tour.\n *\n * @class Tour\n */\nexport default class Tour {\n /**\n * @param {object} config The configuration object.\n */\n constructor(config) {\n this.init(config);\n }\n\n /**\n * Initialise the tour.\n *\n * @method init\n * @param {Object} config The configuration object.\n * @chainable\n * @return {Object} this.\n */\n init(config) {\n // Unset all handlers.\n this.eventHandlers = {};\n\n // Reset the current tour states.\n this.reset();\n\n // Store the initial configuration.\n this.originalConfiguration = config || {};\n\n // Apply configuration.\n this.configure.apply(this, arguments);\n\n try {\n this.storage = window.sessionStorage;\n this.storageKey = 'tourstate_' + this.tourName;\n } catch (e) {\n this.storage = false;\n this.storageKey = '';\n }\n\n return this;\n }\n\n /**\n * Reset the current tour state.\n *\n * @method reset\n * @chainable\n * @return {Object} this.\n */\n reset() {\n // Hide the current step.\n this.hide();\n\n // Unset all handlers.\n this.eventHandlers = [];\n\n // Unset all listeners.\n this.resetStepListeners();\n\n // Unset the original configuration.\n this.originalConfiguration = {};\n\n // Reset the current step number and list of steps.\n this.steps = [];\n\n // Reset the current step number.\n this.currentStepNumber = 0;\n\n return this;\n }\n\n /**\n * Prepare tour configuration.\n *\n * @method configure\n * @param {Object} config The configuration object.\n * @chainable\n * @return {Object} this.\n */\n configure(config) {\n if (typeof config === 'object') {\n // Tour name.\n if (typeof config.tourName !== 'undefined') {\n this.tourName = config.tourName;\n }\n\n // Set up eventHandlers.\n if (config.eventHandlers) {\n for (let eventName in config.eventHandlers) {\n config.eventHandlers[eventName].forEach(function(handler) {\n this.addEventHandler(eventName, handler);\n }, this);\n }\n }\n\n // Reset the step configuration.\n this.resetStepDefaults(true);\n\n // Configure the steps.\n if (typeof config.steps === 'object') {\n this.steps = config.steps;\n }\n\n if (typeof config.template !== 'undefined') {\n this.templateContent = config.template;\n }\n }\n\n // Check that we have enough to start the tour.\n this.checkMinimumRequirements();\n\n return this;\n }\n\n /**\n * Check that the configuration meets the minimum requirements.\n *\n * @method checkMinimumRequirements\n */\n checkMinimumRequirements() {\n // Need a tourName.\n if (!this.tourName) {\n throw new Error(\"Tour Name required\");\n }\n\n // Need a minimum of one step.\n if (!this.steps || !this.steps.length) {\n throw new Error(\"Steps must be specified\");\n }\n }\n\n /**\n * Reset step default configuration.\n *\n * @method resetStepDefaults\n * @param {Boolean} loadOriginalConfiguration Whether to load the original configuration supplied with the Tour.\n * @chainable\n * @return {Object} this.\n */\n resetStepDefaults(loadOriginalConfiguration) {\n if (typeof loadOriginalConfiguration === 'undefined') {\n loadOriginalConfiguration = true;\n }\n\n this.stepDefaults = {};\n if (!loadOriginalConfiguration || typeof this.originalConfiguration.stepDefaults === 'undefined') {\n this.setStepDefaults({});\n } else {\n this.setStepDefaults(this.originalConfiguration.stepDefaults);\n }\n\n return this;\n }\n\n /**\n * Set the step defaults.\n *\n * @method setStepDefaults\n * @param {Object} stepDefaults The step defaults to apply to all steps\n * @chainable\n * @return {Object} this.\n */\n setStepDefaults(stepDefaults) {\n if (!this.stepDefaults) {\n this.stepDefaults = {};\n }\n $.extend(\n this.stepDefaults,\n {\n element: '',\n placement: 'top',\n delay: 0,\n moveOnClick: false,\n moveAfterTime: 0,\n orphan: false,\n direction: 1,\n },\n stepDefaults\n );\n\n return this;\n }\n\n /**\n * Retrieve the current step number.\n *\n * @method getCurrentStepNumber\n * @return {Integer} The current step number\n */\n getCurrentStepNumber() {\n return parseInt(this.currentStepNumber, 10);\n }\n\n /**\n * Store the current step number.\n *\n * @method setCurrentStepNumber\n * @param {Integer} stepNumber The current step number\n * @chainable\n */\n setCurrentStepNumber(stepNumber) {\n this.currentStepNumber = stepNumber;\n if (this.storage) {\n try {\n this.storage.setItem(this.storageKey, stepNumber);\n } catch (e) {\n if (e.code === DOMException.QUOTA_EXCEEDED_ERR) {\n this.storage.removeItem(this.storageKey);\n }\n }\n }\n }\n\n /**\n * Get the next step number after the currently displayed step.\n *\n * @method getNextStepNumber\n * @param {Integer} stepNumber The current step number\n * @return {Integer} The next step number to display\n */\n getNextStepNumber(stepNumber) {\n if (typeof stepNumber === 'undefined') {\n stepNumber = this.getCurrentStepNumber();\n }\n let nextStepNumber = stepNumber + 1;\n\n // Keep checking the remaining steps.\n while (nextStepNumber <= this.steps.length) {\n if (this.isStepPotentiallyVisible(this.getStepConfig(nextStepNumber))) {\n return nextStepNumber;\n }\n nextStepNumber++;\n }\n\n return null;\n }\n\n /**\n * Get the previous step number before the currently displayed step.\n *\n * @method getPreviousStepNumber\n * @param {Integer} stepNumber The current step number\n * @return {Integer} The previous step number to display\n */\n getPreviousStepNumber(stepNumber) {\n if (typeof stepNumber === 'undefined') {\n stepNumber = this.getCurrentStepNumber();\n }\n let previousStepNumber = stepNumber - 1;\n\n // Keep checking the remaining steps.\n while (previousStepNumber >= 0) {\n if (this.isStepPotentiallyVisible(this.getStepConfig(previousStepNumber))) {\n return previousStepNumber;\n }\n previousStepNumber--;\n }\n\n return null;\n }\n\n /**\n * Is the step the final step number?\n *\n * @method isLastStep\n * @param {Integer} stepNumber Step number to test\n * @return {Boolean} Whether the step is the final step\n */\n isLastStep(stepNumber) {\n let nextStepNumber = this.getNextStepNumber(stepNumber);\n\n return nextStepNumber === null;\n }\n\n /**\n * Is the step the first step number?\n *\n * @method isFirstStep\n * @param {Integer} stepNumber Step number to test\n * @return {Boolean} Whether the step is the first step\n */\n isFirstStep(stepNumber) {\n let previousStepNumber = this.getPreviousStepNumber(stepNumber);\n\n return previousStepNumber === null;\n }\n\n /**\n * Is this step potentially visible?\n *\n * @method isStepPotentiallyVisible\n * @param {Object} stepConfig The step configuration to normalise\n * @return {Boolean} Whether the step is the potentially visible\n */\n isStepPotentiallyVisible(stepConfig) {\n if (!stepConfig) {\n // Without step config, there can be no step.\n return false;\n }\n\n if (this.isStepActuallyVisible(stepConfig)) {\n // If it is actually visible, it is already potentially visible.\n return true;\n }\n\n if (typeof stepConfig.orphan !== 'undefined' && stepConfig.orphan) {\n // Orphan steps have no target. They are always visible.\n return true;\n }\n\n if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay) {\n // Only return true if the activated has not been used yet.\n return true;\n }\n\n // Not theoretically, or actually visible.\n return false;\n }\n\n /**\n * Is this step actually visible?\n *\n * @method isStepActuallyVisible\n * @param {Object} stepConfig The step configuration to normalise\n * @return {Boolean} Whether the step is actually visible\n */\n isStepActuallyVisible(stepConfig) {\n if (!stepConfig) {\n // Without step config, there can be no step.\n return false;\n }\n\n let target = this.getStepTarget(stepConfig);\n if (target && target.length && target.is(':visible')) {\n // Without a target, there can be no step.\n return !!target.length;\n }\n\n return false;\n }\n\n /**\n * Go to the next step in the tour.\n *\n * @method next\n * @chainable\n * @return {Object} this.\n */\n next() {\n return this.gotoStep(this.getNextStepNumber());\n }\n\n /**\n * Go to the previous step in the tour.\n *\n * @method previous\n * @chainable\n * @return {Object} this.\n */\n previous() {\n return this.gotoStep(this.getPreviousStepNumber(), -1);\n }\n\n /**\n * Go to the specified step in the tour.\n *\n * @method gotoStep\n * @param {Integer} stepNumber The step number to display\n * @param {Integer} direction Next or previous step\n * @chainable\n * @return {Object} this.\n */\n gotoStep(stepNumber, direction) {\n if (stepNumber < 0) {\n return this.endTour();\n }\n\n let stepConfig = this.getStepConfig(stepNumber);\n if (stepConfig === null) {\n return this.endTour();\n }\n\n return this._gotoStep(stepConfig, direction);\n }\n\n _gotoStep(stepConfig, direction) {\n if (!stepConfig) {\n return this.endTour();\n }\n\n if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay && !stepConfig.delayed) {\n stepConfig.delayed = true;\n window.setTimeout(this._gotoStep.bind(this), stepConfig.delay, stepConfig, direction);\n\n return this;\n } else if (!stepConfig.orphan && !this.isStepActuallyVisible(stepConfig)) {\n let fn = direction == -1 ? 'getPreviousStepNumber' : 'getNextStepNumber';\n return this.gotoStep(this[fn](stepConfig.stepNumber), direction);\n }\n\n this.hide();\n\n this.fireEventHandlers('beforeRender', stepConfig);\n this.renderStep(stepConfig);\n this.fireEventHandlers('afterRender', stepConfig);\n\n return this;\n }\n\n /**\n * Fetch the normalised step configuration for the specified step number.\n *\n * @method getStepConfig\n * @param {Integer} stepNumber The step number to fetch configuration for\n * @return {Object} The step configuration\n */\n getStepConfig(stepNumber) {\n if (stepNumber === null || stepNumber < 0 || stepNumber >= this.steps.length) {\n return null;\n }\n\n // Normalise the step configuration.\n let stepConfig = this.normalizeStepConfig(this.steps[stepNumber]);\n\n // Add the stepNumber to the stepConfig.\n stepConfig = $.extend(stepConfig, {stepNumber: stepNumber});\n\n return stepConfig;\n }\n\n /**\n * Normalise the supplied step configuration.\n *\n * @method normalizeStepConfig\n * @param {Object} stepConfig The step configuration to normalise\n * @return {Object} The normalised step configuration\n */\n normalizeStepConfig(stepConfig) {\n\n if (typeof stepConfig.reflex !== 'undefined' && typeof stepConfig.moveAfterClick === 'undefined') {\n stepConfig.moveAfterClick = stepConfig.reflex;\n }\n\n if (typeof stepConfig.element !== 'undefined' && typeof stepConfig.target === 'undefined') {\n stepConfig.target = stepConfig.element;\n }\n\n if (typeof stepConfig.content !== 'undefined' && typeof stepConfig.body === 'undefined') {\n stepConfig.body = stepConfig.content;\n }\n\n stepConfig = $.extend({}, this.stepDefaults, stepConfig);\n\n stepConfig = $.extend({}, {\n attachTo: stepConfig.target,\n attachPoint: 'after',\n }, stepConfig);\n\n if (stepConfig.attachTo) {\n stepConfig.attachTo = $(stepConfig.attachTo).first();\n }\n\n return stepConfig;\n }\n\n /**\n * Fetch the actual step target from the selector.\n *\n * This should not be called until after any delay has completed.\n *\n * @method getStepTarget\n * @param {Object} stepConfig The step configuration\n * @return {$}\n */\n getStepTarget(stepConfig) {\n if (stepConfig.target) {\n return $(stepConfig.target);\n }\n\n return null;\n }\n\n /**\n * Fire any event handlers for the specified event.\n *\n * @param {String} eventName The name of the event to handle\n * @param {Object} data Any data to pass to the event\n * @chainable\n * @return {Object} this.\n */\n fireEventHandlers(eventName, data) {\n if (typeof this.eventHandlers[eventName] === 'undefined') {\n return this;\n }\n\n this.eventHandlers[eventName].forEach(function(thisEvent) {\n thisEvent.call(this, data);\n }, this);\n\n return this;\n }\n\n /**\n * @method addEventHandler\n * @param {string} eventName The name of the event to listen for\n * @param {function} handler The event handler to call\n * @return {Object} this.\n */\n addEventHandler(eventName, handler) {\n if (typeof this.eventHandlers[eventName] === 'undefined') {\n this.eventHandlers[eventName] = [];\n }\n\n this.eventHandlers[eventName].push(handler);\n\n return this;\n }\n\n /**\n * Process listeners for the step being shown.\n *\n * @method processStepListeners\n * @param {object} stepConfig The configuration for the step\n * @chainable\n * @return {Object} this.\n */\n processStepListeners(stepConfig) {\n this.listeners.push(\n // Next/Previous buttons.\n {\n node: this.currentStepNode,\n args: ['click', '[data-role=\"next\"]', $.proxy(this.next, this)]\n }, {\n node: this.currentStepNode,\n args: ['click', '[data-role=\"previous\"]', $.proxy(this.previous, this)]\n },\n\n // Close and end tour buttons.\n {\n node: this.currentStepNode,\n args: ['click', '[data-role=\"end\"]', $.proxy(this.endTour, this)]\n },\n\n // Click backdrop and hide tour.\n {\n node: $('[data-flexitour=\"backdrop\"]'),\n args: ['click', $.proxy(this.hide, this)]\n },\n\n // Keypresses.\n {\n node: $('body'),\n args: ['keydown', $.proxy(this.handleKeyDown, this)]\n });\n\n if (stepConfig.moveOnClick) {\n var targetNode = this.getStepTarget(stepConfig);\n this.listeners.push({\n node: targetNode,\n args: ['click', $.proxy(function(e) {\n if ($(e.target).parents('[data-flexitour=\"container\"]').length === 0) {\n // Ignore clicks when they are in the flexitour.\n window.setTimeout($.proxy(this.next, this), 500);\n }\n }, this)]\n });\n }\n\n this.listeners.forEach(function(listener) {\n listener.node.on.apply(listener.node, listener.args);\n });\n\n return this;\n }\n\n /**\n * Reset step listeners.\n *\n * @method resetStepListeners\n * @chainable\n * @return {Object} this.\n */\n resetStepListeners() {\n // Stop listening to all external handlers.\n if (this.listeners) {\n this.listeners.forEach(function(listener) {\n listener.node.off.apply(listener.node, listener.args);\n });\n }\n this.listeners = [];\n\n return this;\n }\n\n /**\n * The standard step renderer.\n *\n * @method renderStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n renderStep(stepConfig) {\n // Store the current step configuration for later.\n this.currentStepConfig = stepConfig;\n this.setCurrentStepNumber(stepConfig.stepNumber);\n\n // Fetch the template and convert it to a $ object.\n let template = $(this.getTemplateContent());\n\n // Title.\n template.find('[data-placeholder=\"title\"]')\n .html(stepConfig.title);\n\n // Body.\n template.find('[data-placeholder=\"body\"]')\n .html(stepConfig.body);\n\n // Is this the first step?\n if (this.isFirstStep(stepConfig.stepNumber)) {\n template.find('[data-role=\"previous\"]').hide();\n } else {\n template.find('[data-role=\"previous\"]').prop('disabled', false);\n }\n\n // Is this the final step?\n if (this.isLastStep(stepConfig.stepNumber)) {\n template.find('[data-role=\"next\"]').hide();\n template.find('[data-role=\"end\"]').removeClass(\"btn-secondary\").addClass(\"btn-primary\");\n } else {\n template.find('[data-role=\"next\"]').prop('disabled', false);\n }\n\n template.find('[data-role=\"previous\"]').attr('role', 'button');\n template.find('[data-role=\"next\"]').attr('role', 'button');\n template.find('[data-role=\"end\"]').attr('role', 'button');\n\n // Replace the template with the updated version.\n stepConfig.template = template;\n\n // Add to the page.\n this.addStepToPage(stepConfig);\n\n // Process step listeners after adding to the page.\n // This uses the currentNode.\n this.processStepListeners(stepConfig);\n\n return this;\n }\n\n /**\n * Getter for the template content.\n *\n * @method getTemplateContent\n * @return {$}\n */\n getTemplateContent() {\n return $(this.templateContent).clone();\n }\n\n /**\n * Helper to add a step to the page.\n *\n * @method addStepToPage\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n addStepToPage(stepConfig) {\n // Create the stepNode from the template data.\n let currentStepNode = $('')\n .html(stepConfig.template)\n .hide();\n\n // The scroll animation occurs on the body or html.\n let animationTarget = $('body, html')\n .stop(true, true);\n\n if (this.isStepActuallyVisible(stepConfig)) {\n let targetNode = this.getStepTarget(stepConfig);\n\n targetNode.data('flexitour', 'target');\n\n let zIndex = this.calculateZIndex(targetNode);\n if (zIndex) {\n stepConfig.zIndex = zIndex + 1;\n }\n\n if (stepConfig.zIndex) {\n currentStepNode.css('zIndex', stepConfig.zIndex + 1);\n }\n\n // Add the backdrop.\n this.positionBackdrop(stepConfig);\n\n $(document.body).append(currentStepNode);\n this.currentStepNode = currentStepNode;\n\n // Ensure that the step node is positioned.\n // Some situations mean that the value is not properly calculated without this step.\n this.currentStepNode.css({\n top: 0,\n left: 0,\n });\n\n animationTarget\n .animate({\n scrollTop: this.calculateScrollTop(stepConfig),\n }).promise().then(function() {\n this.positionStep(stepConfig);\n this.revealStep(stepConfig);\n return;\n }.bind(this))\n .catch(function() {\n // Silently fail.\n });\n\n } else if (stepConfig.orphan) {\n stepConfig.isOrphan = true;\n\n // This will be appended to the body instead.\n stepConfig.attachTo = $('body').first();\n stepConfig.attachPoint = 'append';\n\n // Add the backdrop.\n this.positionBackdrop(stepConfig);\n\n // This is an orphaned step.\n currentStepNode.addClass('orphan');\n\n // It lives in the body.\n $(document.body).append(currentStepNode);\n this.currentStepNode = currentStepNode;\n\n this.currentStepNode.offset(this.calculateStepPositionInPage());\n this.currentStepNode.css('position', 'fixed');\n\n this.currentStepPopper = new Popper(\n $('body'),\n this.currentStepNode[0], {\n removeOnDestroy: true,\n placement: stepConfig.placement + '-start',\n arrowElement: '[data-role=\"arrow\"]',\n // Empty the modifiers. We've already placed the step and don't want it moved.\n modifiers: {\n hide: {\n enabled: false,\n },\n applyStyle: {\n onLoad: null,\n enabled: false,\n },\n }\n }\n );\n\n this.revealStep(stepConfig);\n }\n\n return this;\n }\n\n /**\n * Make the given step visible.\n *\n * @method revealStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n revealStep(stepConfig) {\n // Fade the step in.\n this.currentStepNode.fadeIn('', $.proxy(function() {\n // Announce via ARIA.\n this.announceStep(stepConfig);\n\n // Focus on the current step Node.\n this.currentStepNode.focus();\n window.setTimeout($.proxy(function() {\n // After a brief delay, focus again.\n // There seems to be an issue with Jaws where it only reads the dialogue title initially.\n // This second focus helps it to read the full dialogue.\n if (this.currentStepNode) {\n this.currentStepNode.focus();\n }\n }, this), 100);\n\n }, this));\n\n return this;\n }\n\n /**\n * Helper to announce the step on the page.\n *\n * @method announceStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n announceStep(stepConfig) {\n // Setup the step Dialogue as per:\n // * https://www.w3.org/TR/wai-aria-practices/#dialog_nonmodal\n // * https://www.w3.org/TR/wai-aria-practices/#dialog_modal\n\n // Generate an ID for the current step node.\n let stepId = 'tour-step-' + this.tourName + '-' + stepConfig.stepNumber;\n this.currentStepNode.attr('id', stepId);\n\n let bodyRegion = this.currentStepNode.find('[data-placeholder=\"body\"]').first();\n bodyRegion.attr('id', stepId + '-body');\n bodyRegion.attr('role', 'document');\n\n let headerRegion = this.currentStepNode.find('[data-placeholder=\"title\"]').first();\n headerRegion.attr('id', stepId + '-title');\n headerRegion.attr('aria-labelledby', stepId + '-body');\n\n // Generally, a modal dialog has a role of dialog.\n this.currentStepNode.attr('role', 'dialog');\n this.currentStepNode.attr('tabindex', 0);\n this.currentStepNode.attr('aria-labelledby', stepId + '-title');\n this.currentStepNode.attr('aria-describedby', stepId + '-body');\n\n // Configure ARIA attributes on the target.\n let target = this.getStepTarget(stepConfig);\n if (target) {\n if (!target.attr('tabindex')) {\n target.attr('tabindex', 0);\n }\n\n target\n .data('original-describedby', target.attr('aria-describedby'))\n .attr('aria-describedby', stepId + '-body')\n ;\n }\n\n this.accessibilityShow(stepConfig);\n\n return this;\n }\n\n /**\n * Handle key down events.\n *\n * @method handleKeyDown\n * @param {EventFacade} e\n */\n handleKeyDown(e) {\n let tabbableSelector = 'a[href], link[href], [draggable=true], [contenteditable=true], ';\n tabbableSelector += ':input:enabled, [tabindex], button:enabled';\n switch (e.keyCode) {\n case 27:\n this.endTour();\n break;\n\n // 9 == Tab - trap focus for items with a backdrop.\n case 9:\n // Tab must be handled on key up only in this instance.\n (function() {\n if (!this.currentStepConfig.hasBackdrop) {\n // Trapping tab focus is only handled for those steps with a backdrop.\n return;\n }\n\n // Find all tabbable locations.\n let activeElement = $(document.activeElement);\n let stepTarget = this.getStepTarget(this.currentStepConfig);\n let tabbableNodes = $(tabbableSelector);\n let dialogContainer = $('span[data-flexitour=\"container\"]');\n let currentIndex;\n // Filter out element which is not belong to target section or dialogue.\n if (stepTarget) {\n tabbableNodes = tabbableNodes.filter(function(index, element) {\n return stepTarget !== null\n && (stepTarget.has(element).length\n || dialogContainer.has(element).length\n || stepTarget.is(element)\n || dialogContainer.is(element));\n });\n }\n\n // Find index of focusing element.\n tabbableNodes.each(function(index, element) {\n if (activeElement.is(element)) {\n currentIndex = index;\n return false;\n }\n // Keep looping.\n return true;\n });\n\n let nextIndex;\n let nextNode;\n let focusRelevant;\n if (currentIndex != void 0) {\n let direction = 1;\n if (e.shiftKey) {\n direction = -1;\n }\n nextIndex = currentIndex;\n do {\n nextIndex += direction;\n nextNode = $(tabbableNodes[nextIndex]);\n } while (nextNode.length && nextNode.is(':disabled') || nextNode.is(':hidden'));\n if (nextNode.length) {\n // A new f\n focusRelevant = nextNode.closest(stepTarget).length;\n focusRelevant = focusRelevant || nextNode.closest(this.currentStepNode).length;\n } else {\n // Unable to find the target somehow.\n focusRelevant = false;\n }\n }\n\n if (focusRelevant) {\n nextNode.focus();\n } else {\n if (e.shiftKey) {\n // Focus on the last tabbable node in the step.\n this.currentStepNode.find(tabbableSelector).last().focus();\n } else {\n if (this.currentStepConfig.isOrphan) {\n // Focus on the step - there is no target.\n this.currentStepNode.focus();\n } else {\n // Focus on the step target.\n stepTarget.focus();\n }\n }\n }\n e.preventDefault();\n }).call(this);\n break;\n }\n }\n\n /**\n * Start the current tour.\n *\n * @method startTour\n * @param {Integer} startAt Which step number to start at. If not specified, starts at the last point.\n * @chainable\n * @return {Object} this.\n */\n startTour(startAt) {\n if (this.storage && typeof startAt === 'undefined') {\n let storageStartValue = this.storage.getItem(this.storageKey);\n if (storageStartValue) {\n let storageStartAt = parseInt(storageStartValue, 10);\n if (storageStartAt <= this.steps.length) {\n startAt = storageStartAt;\n }\n }\n }\n\n if (typeof startAt === 'undefined') {\n startAt = this.getCurrentStepNumber();\n }\n\n this.fireEventHandlers('beforeStart', startAt);\n this.gotoStep(startAt);\n this.fireEventHandlers('afterStart', startAt);\n\n return this;\n }\n\n /**\n * Restart the tour from the beginning, resetting the completionlag.\n *\n * @method restartTour\n * @chainable\n * @return {Object} this.\n */\n restartTour() {\n return this.startTour(0);\n }\n\n /**\n * End the current tour.\n *\n * @method endTour\n * @chainable\n * @return {Object} this.\n */\n endTour() {\n this.fireEventHandlers('beforeEnd');\n\n if (this.currentStepConfig) {\n let previousTarget = this.getStepTarget(this.currentStepConfig);\n if (previousTarget) {\n if (!previousTarget.attr('tabindex')) {\n previousTarget.attr('tabindex', '-1');\n }\n previousTarget.focus();\n }\n }\n\n this.hide(true);\n\n this.fireEventHandlers('afterEnd');\n\n return this;\n }\n\n /**\n * Hide any currently visible steps.\n *\n * @method hide\n * @param {Bool} transition Animate the visibility change\n * @chainable\n * @return {Object} this.\n */\n hide(transition) {\n this.fireEventHandlers('beforeHide');\n\n if (this.currentStepNode && this.currentStepNode.length) {\n this.currentStepNode.hide();\n if (this.currentStepPopper) {\n this.currentStepPopper.destroy();\n }\n }\n\n // Restore original target configuration.\n if (this.currentStepConfig) {\n let target = this.getStepTarget(this.currentStepConfig);\n if (target) {\n if (target.data('original-labelledby')) {\n target.attr('aria-labelledby', target.data('original-labelledby'));\n }\n\n if (target.data('original-describedby')) {\n target.attr('aria-describedby', target.data('original-describedby'));\n }\n\n if (target.data('original-tabindex')) {\n target.attr('tabindex', target.data('tabindex'));\n }\n }\n\n // Clear the step configuration.\n this.currentStepConfig = null;\n }\n\n let fadeTime = 0;\n if (transition) {\n fadeTime = 400;\n }\n\n // Remove the backdrop features.\n $('[data-flexitour=\"step-background\"]').remove();\n $('[data-flexitour=\"step-backdrop\"]').removeAttr('data-flexitour');\n $('[data-flexitour=\"backdrop\"]').fadeOut(fadeTime, function() {\n $(this).remove();\n });\n\n // Remove aria-describedby and tabindex attributes.\n if (this.currentStepNode && this.currentStepNode.length) {\n let stepId = this.currentStepNode.attr('id');\n if (stepId) {\n let currentStepElement = '[aria-describedby=\"' + stepId + '-body\"]';\n $(currentStepElement).removeAttr('tabindex');\n $(currentStepElement).removeAttr('aria-describedby');\n }\n }\n\n // Reset the listeners.\n this.resetStepListeners();\n\n this.accessibilityHide();\n\n this.fireEventHandlers('afterHide');\n\n this.currentStepNode = null;\n this.currentStepPopper = null;\n return this;\n }\n\n /**\n * Show the current steps.\n *\n * @method show\n * @chainable\n * @return {Object} this.\n */\n show() {\n // Show the current step.\n let startAt = this.getCurrentStepNumber();\n\n return this.gotoStep(startAt);\n }\n\n /**\n * Return the current step node.\n *\n * @method getStepContainer\n * @return {jQuery}\n */\n getStepContainer() {\n return $(this.currentStepNode);\n }\n\n /**\n * Calculate scrollTop.\n *\n * @method calculateScrollTop\n * @param {Object} stepConfig The step configuration of the step\n * @return {Number}\n */\n calculateScrollTop(stepConfig) {\n let scrollTop = $(window).scrollTop();\n let viewportHeight = $(window).height();\n let targetNode = this.getStepTarget(stepConfig);\n\n if (stepConfig.placement === 'top') {\n // If the placement is top, center scroll at the top of the target.\n scrollTop = targetNode.offset().top - (viewportHeight / 2);\n } else if (stepConfig.placement === 'bottom') {\n // If the placement is bottom, center scroll at the bottom of the target.\n scrollTop = targetNode.offset().top + targetNode.height() - (viewportHeight / 2);\n } else if (targetNode.height() <= (viewportHeight * 0.8)) {\n // If the placement is left/right, and the target fits in the viewport, centre screen on the target\n scrollTop = targetNode.offset().top - ((viewportHeight - targetNode.height()) / 2);\n } else {\n // If the placement is left/right, and the target is bigger than the viewport, set scrollTop to target.top + buffer\n // and change step attachmentTarget to top+.\n scrollTop = targetNode.offset().top - (viewportHeight * 0.2);\n }\n\n // Never scroll over the top.\n scrollTop = Math.max(0, scrollTop);\n\n // Never scroll beyond the bottom.\n scrollTop = Math.min($(document).height() - viewportHeight, scrollTop);\n\n return Math.ceil(scrollTop);\n }\n\n /**\n * Calculate dialogue position for page middle.\n *\n * @method calculateScrollTop\n * @return {Number}\n */\n calculateStepPositionInPage() {\n let viewportHeight = $(window).height();\n let stepHeight = this.currentStepNode.height();\n\n let viewportWidth = $(window).width();\n let stepWidth = this.currentStepNode.width();\n\n return {\n top: Math.ceil((viewportHeight - stepHeight) / 2),\n left: Math.ceil((viewportWidth - stepWidth) / 2)\n };\n }\n\n /**\n * Position the step on the page.\n *\n * @method positionStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n positionStep(stepConfig) {\n let content = this.currentStepNode;\n if (!content || !content.length) {\n // Unable to find the step node.\n return this;\n }\n\n let flipBehavior;\n switch (stepConfig.placement) {\n case 'left':\n flipBehavior = ['left', 'right', 'top', 'bottom'];\n break;\n case 'right':\n flipBehavior = ['right', 'left', 'top', 'bottom'];\n break;\n case 'top':\n flipBehavior = ['top', 'bottom', 'right', 'left'];\n break;\n case 'bottom':\n flipBehavior = ['bottom', 'top', 'right', 'left'];\n break;\n default:\n flipBehavior = 'flip';\n break;\n }\n\n let target = this.getStepTarget(stepConfig);\n var config = {\n placement: stepConfig.placement + '-start',\n removeOnDestroy: true,\n modifiers: {\n flip: {\n behaviour: flipBehavior,\n },\n arrow: {\n element: '[data-role=\"arrow\"]',\n },\n },\n onCreate: function(data) {\n recalculateArrowPosition(data);\n },\n onUpdate: function(data) {\n recalculateArrowPosition(data);\n },\n };\n\n let recalculateArrowPosition = function(data) {\n let placement = data.placement.split('-')[0];\n const isVertical = ['left', 'right'].indexOf(placement) !== -1;\n const arrowElement = data.instance.popper.querySelector('[data-role=\"arrow\"]');\n const stepElement = $(data.instance.popper.querySelector('[data-role=\"flexitour-step\"]'));\n if (isVertical) {\n let arrowHeight = parseFloat(window.getComputedStyle(arrowElement).height);\n let arrowOffset = parseFloat(window.getComputedStyle(arrowElement).top);\n let popperHeight = parseFloat(window.getComputedStyle(data.instance.popper).height);\n let popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).top);\n let popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));\n let popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;\n let arrowPos = arrowOffset + (arrowHeight / 2);\n let maxPos = popperHeight + popperOffset - popperBorderWidth - popperBorderRadiusWidth;\n let minPos = popperOffset + popperBorderWidth + popperBorderRadiusWidth;\n if (arrowPos >= maxPos || arrowPos <= minPos) {\n let newArrowPos = 0;\n if (arrowPos > (popperHeight / 2)) {\n newArrowPos = maxPos - arrowHeight;\n } else {\n newArrowPos = minPos + arrowHeight;\n }\n $(arrowElement).css('top', newArrowPos);\n }\n } else {\n let arrowWidth = parseFloat(window.getComputedStyle(arrowElement).width);\n let arrowOffset = parseFloat(window.getComputedStyle(arrowElement).left);\n let popperWidth = parseFloat(window.getComputedStyle(data.instance.popper).width);\n let popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).left);\n let popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));\n let popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;\n let arrowPos = arrowOffset + (arrowWidth / 2);\n let maxPos = popperWidth + popperOffset - popperBorderWidth - popperBorderRadiusWidth;\n let minPos = popperOffset + popperBorderWidth + popperBorderRadiusWidth;\n if (arrowPos >= maxPos || arrowPos <= minPos) {\n let newArrowPos = 0;\n if (arrowPos > (popperWidth / 2)) {\n newArrowPos = maxPos - arrowWidth;\n } else {\n newArrowPos = minPos + arrowWidth;\n }\n $(arrowElement).css('left', newArrowPos);\n }\n }\n };\n\n let background = $('[data-flexitour=\"step-background\"]');\n if (background.length) {\n target = background;\n }\n this.currentStepPopper = new Popper(target, content[0], config);\n\n return this;\n }\n\n /**\n * Add the backdrop.\n *\n * @method positionBackdrop\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n positionBackdrop(stepConfig) {\n if (stepConfig.backdrop) {\n this.currentStepConfig.hasBackdrop = true;\n let backdrop = $('
');\n\n if (stepConfig.zIndex) {\n if (stepConfig.attachPoint === 'append') {\n stepConfig.attachTo.append(backdrop);\n } else {\n backdrop.insertAfter(stepConfig.attachTo);\n }\n } else {\n $('body').append(backdrop);\n }\n\n if (this.isStepActuallyVisible(stepConfig)) {\n // The step has a visible target.\n // Punch a hole through the backdrop.\n let background = $('
');\n\n let targetNode = this.getStepTarget(stepConfig);\n\n let buffer = 10;\n\n let colorNode = targetNode;\n if (buffer) {\n colorNode = $('body');\n }\n\n background.css({\n width: targetNode.outerWidth() + buffer + buffer,\n height: targetNode.outerHeight() + buffer + buffer,\n left: targetNode.offset().left - buffer,\n top: targetNode.offset().top - buffer,\n backgroundColor: this.calculateInherittedBackgroundColor(colorNode),\n });\n\n if (targetNode.offset().left < buffer) {\n background.css({\n width: targetNode.outerWidth() + targetNode.offset().left + buffer,\n left: targetNode.offset().left,\n });\n }\n\n if (targetNode.offset().top < buffer) {\n background.css({\n height: targetNode.outerHeight() + targetNode.offset().top + buffer,\n top: targetNode.offset().top,\n });\n }\n\n let targetRadius = targetNode.css('borderRadius');\n if (targetRadius && targetRadius !== $('body').css('borderRadius')) {\n background.css('borderRadius', targetRadius);\n }\n\n let targetPosition = this.calculatePosition(targetNode);\n if (targetPosition === 'fixed') {\n background.css('top', 0);\n } else if (targetPosition === 'absolute') {\n background.css('position', 'fixed');\n }\n\n let fader = background.clone();\n fader.css({\n backgroundColor: backdrop.css('backgroundColor'),\n opacity: backdrop.css('opacity'),\n });\n fader.attr('data-flexitour', 'step-background-fader');\n\n if (stepConfig.zIndex) {\n if (stepConfig.attachPoint === 'append') {\n stepConfig.attachTo.append(background);\n } else {\n fader.insertAfter(stepConfig.attachTo);\n background.insertAfter(stepConfig.attachTo);\n }\n } else {\n $('body').append(fader);\n $('body').append(background);\n }\n\n // Add the backdrop data to the actual target.\n // This is the part which actually does the work.\n targetNode.attr('data-flexitour', 'step-backdrop');\n\n if (stepConfig.zIndex) {\n backdrop.css('zIndex', stepConfig.zIndex);\n background.css('zIndex', stepConfig.zIndex + 1);\n targetNode.css('zIndex', stepConfig.zIndex + 2);\n }\n\n fader.fadeOut('2000', function() {\n $(this).remove();\n });\n }\n }\n return this;\n }\n\n /**\n * Calculate the inheritted z-index.\n *\n * @method calculateZIndex\n * @param {jQuery} elem The element to calculate z-index for\n * @return {Number} Calculated z-index\n */\n calculateZIndex(elem) {\n elem = $(elem);\n while (elem.length && elem[0] !== document) {\n // Ignore z-index if position is set to a value where z-index is ignored by the browser\n // This makes behavior of this function consistent across browsers\n // WebKit always returns auto if the element is positioned.\n let position = elem.css(\"position\");\n if (position === \"absolute\" || position === \"relative\" || position === \"fixed\") {\n // IE returns 0 when zIndex is not specified\n // other browsers return a string\n // we ignore the case of nested elements with an explicit value of 0\n //
\n let value = parseInt(elem.css(\"zIndex\"), 10);\n if (!isNaN(value) && value !== 0) {\n return value;\n }\n }\n elem = elem.parent();\n }\n\n return 0;\n }\n\n /**\n * Calculate the inheritted background colour.\n *\n * @method calculateInherittedBackgroundColor\n * @param {jQuery} elem The element to calculate colour for\n * @return {String} Calculated background colour\n */\n calculateInherittedBackgroundColor(elem) {\n // Use a fake node to compare each element against.\n let fakeNode = $('
').hide();\n $('body').append(fakeNode);\n let fakeElemColor = fakeNode.css('backgroundColor');\n fakeNode.remove();\n\n elem = $(elem);\n while (elem.length && elem[0] !== document) {\n let color = elem.css('backgroundColor');\n if (color !== fakeElemColor) {\n return color;\n }\n elem = elem.parent();\n }\n\n return null;\n }\n\n /**\n * Calculate the inheritted position.\n *\n * @method calculatePosition\n * @param {jQuery} elem The element to calculate position for\n * @return {String} Calculated position\n */\n calculatePosition(elem) {\n elem = $(elem);\n while (elem.length && elem[0] !== document) {\n let position = elem.css('position');\n if (position !== 'static') {\n return position;\n }\n elem = elem.parent();\n }\n\n return null;\n }\n\n /**\n * Perform accessibility changes for step shown.\n *\n * This will add aria-hidden=\"true\" to all siblings and parent siblings.\n *\n * @method accessibilityShow\n */\n accessibilityShow() {\n let stateHolder = 'data-has-hidden';\n let attrName = 'aria-hidden';\n let hideFunction = function(child) {\n let flexitourRole = child.data('flexitour');\n if (flexitourRole) {\n switch (flexitourRole) {\n case 'container':\n case 'target':\n return;\n }\n }\n\n let hidden = child.attr(attrName);\n if (!hidden) {\n child.attr(stateHolder, true);\n Aria.hide(child);\n }\n };\n\n this.currentStepNode.siblings().each(function(index, node) {\n hideFunction($(node));\n });\n this.currentStepNode.parentsUntil('body').siblings().each(function(index, node) {\n hideFunction($(node));\n });\n }\n\n /**\n * Perform accessibility changes for step hidden.\n *\n * This will remove any newly added aria-hidden=\"true\".\n *\n * @method accessibilityHide\n */\n accessibilityHide() {\n let stateHolder = 'data-has-hidden';\n let showFunction = function(child) {\n let hidden = child.attr(stateHolder);\n if (typeof hidden !== 'undefined') {\n child.removeAttr(stateHolder);\n Aria.unhide(child);\n }\n };\n\n $('[' + stateHolder + ']').each(function(index, node) {\n showFunction($(node));\n });\n }\n}\n"],"file":"tour.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/tour.js"],"names":["Tour","config","init","eventHandlers","reset","originalConfiguration","configure","apply","arguments","storage","window","sessionStorage","storageKey","tourName","e","hide","resetStepListeners","steps","currentStepNumber","eventName","forEach","handler","addEventHandler","resetStepDefaults","template","templateContent","checkMinimumRequirements","Error","length","loadOriginalConfiguration","stepDefaults","setStepDefaults","$","extend","element","placement","delay","moveOnClick","moveAfterTime","orphan","direction","parseInt","stepNumber","setItem","code","DOMException","QUOTA_EXCEEDED_ERR","removeItem","getCurrentStepNumber","nextStepNumber","isStepPotentiallyVisible","getStepConfig","previousStepNumber","getNextStepNumber","getPreviousStepNumber","stepConfig","isStepActuallyVisible","target","getStepTarget","is","gotoStep","endTour","_gotoStep","delayed","setTimeout","bind","fn","fireEventHandlers","renderStep","normalizeStepConfig","reflex","moveAfterClick","content","body","attachTo","attachPoint","first","data","thisEvent","call","push","listeners","node","currentStepNode","args","proxy","next","previous","handleKeyDown","targetNode","parents","listener","on","off","currentStepConfig","setCurrentStepNumber","getTemplateContent","find","html","title","isFirstStep","prop","isLastStep","removeClass","addClass","attr","addStepToPage","processStepListeners","clone","animationTarget","stop","zIndex","calculateZIndex","css","positionBackdrop","document","append","top","left","animate","scrollTop","calculateScrollTop","promise","then","positionStep","revealStep","catch","isOrphan","offset","calculateStepPositionInPage","currentStepPopper","Popper","removeOnDestroy","arrowElement","modifiers","enabled","applyStyle","onLoad","fadeIn","announceStep","focus","stepId","bodyRegion","headerRegion","accessibilityShow","tabbableSelector","keyCode","hasBackdrop","activeElement","stepTarget","tabbableNodes","dialogContainer","currentIndex","filter","index","has","each","nextIndex","nextNode","focusRelevant","shiftKey","closest","last","preventDefault","startAt","storageStartValue","getItem","storageStartAt","startTour","previousTarget","transition","destroy","fadeTime","remove","removeAttr","fadeOut","currentStepElement","accessibilityHide","viewportHeight","height","Math","max","min","ceil","stepHeight","viewportWidth","width","stepWidth","flipBehavior","flip","behaviour","arrow","onCreate","recalculateArrowPosition","onUpdate","split","isVertical","indexOf","instance","popper","querySelector","stepElement","arrowHeight","parseFloat","getComputedStyle","arrowOffset","popperHeight","popperOffset","popperBorderWidth","popperBorderRadiusWidth","arrowPos","maxPos","minPos","newArrowPos","arrowWidth","popperWidth","background","backdrop","insertAfter","buffer","colorNode","outerWidth","outerHeight","backgroundColor","calculateInherittedBackgroundColor","targetRadius","targetPosition","calculatePosition","fader","opacity","elem","position","value","isNaN","parent","fakeNode","fakeElemColor","color","hideFunction","child","flexitourRole","hidden","Aria","siblings","parentsUntil","showFunction","unhide"],"mappings":"8KAuBA,OACA,OACA,O,kqCAOqBA,CAAAA,C,YAIjB,WAAYC,CAAZ,CAAoB,WAChB,KAAKC,IAAL,CAAUD,CAAV,CACH,C,qCAUIA,C,CAAQ,CAET,KAAKE,aAAL,CAAqB,EAArB,CAGA,KAAKC,KAAL,GAGA,KAAKC,qBAAL,CAA6BJ,CAAM,EAAI,EAAvC,CAGA,KAAKK,SAAL,CAAeC,KAAf,CAAqB,IAArB,CAA2BC,SAA3B,EAEA,GAAI,CACA,KAAKC,OAAL,CAAeC,MAAM,CAACC,cAAtB,CACA,KAAKC,UAAL,CAAkB,aAAe,KAAKC,QACzC,CAAC,MAAOC,CAAP,CAAU,CACR,KAAKL,OAAL,IACA,KAAKG,UAAL,CAAkB,EACrB,CAED,MAAO,KACV,C,qCASO,CAEJ,KAAKG,IAAL,GAGA,KAAKZ,aAAL,CAAqB,EAArB,CAGA,KAAKa,kBAAL,GAGA,KAAKX,qBAAL,CAA6B,EAA7B,CAGA,KAAKY,KAAL,CAAa,EAAb,CAGA,KAAKC,iBAAL,CAAyB,CAAzB,CAEA,MAAO,KACV,C,4CAUSjB,C,CAAQ,YACd,GAAsB,QAAlB,KAAOA,CAAP,CAAJ,CAAgC,CAE5B,GAA+B,WAA3B,QAAOA,CAAAA,CAAM,CAACY,QAAlB,CAA4C,CACxC,KAAKA,QAAL,CAAgBZ,CAAM,CAACY,QAC1B,CAGD,GAAIZ,CAAM,CAACE,aAAX,CAA0B,gBACbgB,CADa,EAElBlB,CAAM,CAACE,aAAP,CAAqBgB,CAArB,EAAgCC,OAAhC,CAAwC,SAASC,CAAT,CAAkB,CACtD,KAAKC,eAAL,CA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IAAN,CAXF,aAWE,CAAb,CACA,GAAI,CAACwI,CAAL,CAAa,CACTF,CAAK,CAACtI,IAAN,uBACAyI,CAAI,CAACnO,IAAL,CAAUgO,CAAV,CACH,CACJ,CAlBe,CAoBhB,KAAK5J,eAAL,CAAqBgK,QAArB,GAAgCvF,IAAhC,CAAqC,SAASF,CAAT,CAAgBxE,CAAhB,CAAsB,CACvD4J,CAAY,CAAC,cAAE5J,CAAF,CAAD,CACf,CAFD,EAGA,KAAKC,eAAL,CAAqBiK,YAArB,CAAkC,MAAlC,EAA0CD,QAA1C,GAAqDvF,IAArD,CAA0D,SAASF,CAAT,CAAgBxE,CAAhB,CAAsB,CAC5E4J,CAAY,CAAC,cAAE5J,CAAF,CAAD,CACf,CAFD,CAGH,C,6DASmB,IAEZmK,CAAAA,CAAY,CAAG,SAASN,CAAT,CAAgB,CAC/B,GAAIE,CAAAA,CAAM,CAAGF,CAAK,CAACtI,IAAN,mBAAb,CACA,GAAsB,WAAlB,QAAOwI,CAAAA,CAAX,CAAmC,CAC/BF,CAAK,CAACjE,UAAN,oBACAoE,CAAI,CAACI,MAAL,CAAYP,CAAZ,CACH,CACJ,CARe,CAUhB,mCAA2BnF,IAA3B,CAAgC,SAASF,CAAT,CAAgBxE,CAAhB,CAAsB,CAClDmK,CAAY,CAAC,cAAEnK,CAAF,CAAD,CACf,CAFD,CAGH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Manage user tours in Moodle.\n *\n * @module tool_usertours/tour\n * @copyright 2018 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport $ from 'jquery';\nimport * as Aria from 'core/aria';\nimport Popper from 'core/popper';\n\n/**\n * A Tour.\n *\n * @class\n */\nexport default class Tour {\n /**\n * @param {object} config The configuration object.\n */\n constructor(config) {\n this.init(config);\n }\n\n /**\n * Initialise the tour.\n *\n * @method init\n * @param {Object} config The configuration object.\n * @chainable\n * @return {Object} this.\n */\n init(config) {\n // Unset all handlers.\n this.eventHandlers = {};\n\n // Reset the current tour states.\n this.reset();\n\n // Store the initial configuration.\n this.originalConfiguration = config || {};\n\n // Apply configuration.\n this.configure.apply(this, arguments);\n\n try {\n this.storage = window.sessionStorage;\n this.storageKey = 'tourstate_' + this.tourName;\n } catch (e) {\n this.storage = false;\n this.storageKey = '';\n }\n\n return this;\n }\n\n /**\n * Reset the current tour state.\n *\n * @method reset\n * @chainable\n * @return {Object} this.\n */\n reset() {\n // Hide the current step.\n this.hide();\n\n // Unset all handlers.\n this.eventHandlers = [];\n\n // Unset all listeners.\n this.resetStepListeners();\n\n // Unset the original configuration.\n this.originalConfiguration = {};\n\n // Reset the current step number and list of steps.\n this.steps = [];\n\n // Reset the current step number.\n this.currentStepNumber = 0;\n\n return this;\n }\n\n /**\n * Prepare tour configuration.\n *\n * @method configure\n * @param {Object} config The configuration object.\n * @chainable\n * @return {Object} this.\n */\n configure(config) {\n if (typeof config === 'object') {\n // Tour name.\n if (typeof config.tourName !== 'undefined') {\n this.tourName = config.tourName;\n }\n\n // Set up eventHandlers.\n if (config.eventHandlers) {\n for (let eventName in config.eventHandlers) {\n config.eventHandlers[eventName].forEach(function(handler) {\n this.addEventHandler(eventName, handler);\n }, this);\n }\n }\n\n // Reset the step configuration.\n this.resetStepDefaults(true);\n\n // Configure the steps.\n if (typeof config.steps === 'object') {\n this.steps = config.steps;\n }\n\n if (typeof config.template !== 'undefined') {\n this.templateContent = config.template;\n }\n }\n\n // Check that we have enough to start the tour.\n this.checkMinimumRequirements();\n\n return this;\n }\n\n /**\n * Check that the configuration meets the minimum requirements.\n *\n * @method checkMinimumRequirements\n */\n checkMinimumRequirements() {\n // Need a tourName.\n if (!this.tourName) {\n throw new Error(\"Tour Name required\");\n }\n\n // Need a minimum of one step.\n if (!this.steps || !this.steps.length) {\n throw new Error(\"Steps must be specified\");\n }\n }\n\n /**\n * Reset step default configuration.\n *\n * @method resetStepDefaults\n * @param {Boolean} loadOriginalConfiguration Whether to load the original configuration supplied with the Tour.\n * @chainable\n * @return {Object} this.\n */\n resetStepDefaults(loadOriginalConfiguration) {\n if (typeof loadOriginalConfiguration === 'undefined') {\n loadOriginalConfiguration = true;\n }\n\n this.stepDefaults = {};\n if (!loadOriginalConfiguration || typeof this.originalConfiguration.stepDefaults === 'undefined') {\n this.setStepDefaults({});\n } else {\n this.setStepDefaults(this.originalConfiguration.stepDefaults);\n }\n\n return this;\n }\n\n /**\n * Set the step defaults.\n *\n * @method setStepDefaults\n * @param {Object} stepDefaults The step defaults to apply to all steps\n * @chainable\n * @return {Object} this.\n */\n setStepDefaults(stepDefaults) {\n if (!this.stepDefaults) {\n this.stepDefaults = {};\n }\n $.extend(\n this.stepDefaults,\n {\n element: '',\n placement: 'top',\n delay: 0,\n moveOnClick: false,\n moveAfterTime: 0,\n orphan: false,\n direction: 1,\n },\n stepDefaults\n );\n\n return this;\n }\n\n /**\n * Retrieve the current step number.\n *\n * @method getCurrentStepNumber\n * @return {Integer} The current step number\n */\n getCurrentStepNumber() {\n return parseInt(this.currentStepNumber, 10);\n }\n\n /**\n * Store the current step number.\n *\n * @method setCurrentStepNumber\n * @param {Integer} stepNumber The current step number\n * @chainable\n */\n setCurrentStepNumber(stepNumber) {\n this.currentStepNumber = stepNumber;\n if (this.storage) {\n try {\n this.storage.setItem(this.storageKey, stepNumber);\n } catch (e) {\n if (e.code === DOMException.QUOTA_EXCEEDED_ERR) {\n this.storage.removeItem(this.storageKey);\n }\n }\n }\n }\n\n /**\n * Get the next step number after the currently displayed step.\n *\n * @method getNextStepNumber\n * @param {Integer} stepNumber The current step number\n * @return {Integer} The next step number to display\n */\n getNextStepNumber(stepNumber) {\n if (typeof stepNumber === 'undefined') {\n stepNumber = this.getCurrentStepNumber();\n }\n let nextStepNumber = stepNumber + 1;\n\n // Keep checking the remaining steps.\n while (nextStepNumber <= this.steps.length) {\n if (this.isStepPotentiallyVisible(this.getStepConfig(nextStepNumber))) {\n return nextStepNumber;\n }\n nextStepNumber++;\n }\n\n return null;\n }\n\n /**\n * Get the previous step number before the currently displayed step.\n *\n * @method getPreviousStepNumber\n * @param {Integer} stepNumber The current step number\n * @return {Integer} The previous step number to display\n */\n getPreviousStepNumber(stepNumber) {\n if (typeof stepNumber === 'undefined') {\n stepNumber = this.getCurrentStepNumber();\n }\n let previousStepNumber = stepNumber - 1;\n\n // Keep checking the remaining steps.\n while (previousStepNumber >= 0) {\n if (this.isStepPotentiallyVisible(this.getStepConfig(previousStepNumber))) {\n return previousStepNumber;\n }\n previousStepNumber--;\n }\n\n return null;\n }\n\n /**\n * Is the step the final step number?\n *\n * @method isLastStep\n * @param {Integer} stepNumber Step number to test\n * @return {Boolean} Whether the step is the final step\n */\n isLastStep(stepNumber) {\n let nextStepNumber = this.getNextStepNumber(stepNumber);\n\n return nextStepNumber === null;\n }\n\n /**\n * Is the step the first step number?\n *\n * @method isFirstStep\n * @param {Integer} stepNumber Step number to test\n * @return {Boolean} Whether the step is the first step\n */\n isFirstStep(stepNumber) {\n let previousStepNumber = this.getPreviousStepNumber(stepNumber);\n\n return previousStepNumber === null;\n }\n\n /**\n * Is this step potentially visible?\n *\n * @method isStepPotentiallyVisible\n * @param {Object} stepConfig The step configuration to normalise\n * @return {Boolean} Whether the step is the potentially visible\n */\n isStepPotentiallyVisible(stepConfig) {\n if (!stepConfig) {\n // Without step config, there can be no step.\n return false;\n }\n\n if (this.isStepActuallyVisible(stepConfig)) {\n // If it is actually visible, it is already potentially visible.\n return true;\n }\n\n if (typeof stepConfig.orphan !== 'undefined' && stepConfig.orphan) {\n // Orphan steps have no target. They are always visible.\n return true;\n }\n\n if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay) {\n // Only return true if the activated has not been used yet.\n return true;\n }\n\n // Not theoretically, or actually visible.\n return false;\n }\n\n /**\n * Is this step actually visible?\n *\n * @method isStepActuallyVisible\n * @param {Object} stepConfig The step configuration to normalise\n * @return {Boolean} Whether the step is actually visible\n */\n isStepActuallyVisible(stepConfig) {\n if (!stepConfig) {\n // Without step config, there can be no step.\n return false;\n }\n\n let target = this.getStepTarget(stepConfig);\n if (target && target.length && target.is(':visible')) {\n // Without a target, there can be no step.\n return !!target.length;\n }\n\n return false;\n }\n\n /**\n * Go to the next step in the tour.\n *\n * @method next\n * @chainable\n * @return {Object} this.\n */\n next() {\n return this.gotoStep(this.getNextStepNumber());\n }\n\n /**\n * Go to the previous step in the tour.\n *\n * @method previous\n * @chainable\n * @return {Object} this.\n */\n previous() {\n return this.gotoStep(this.getPreviousStepNumber(), -1);\n }\n\n /**\n * Go to the specified step in the tour.\n *\n * @method gotoStep\n * @param {Integer} stepNumber The step number to display\n * @param {Integer} direction Next or previous step\n * @chainable\n * @return {Object} this.\n */\n gotoStep(stepNumber, direction) {\n if (stepNumber < 0) {\n return this.endTour();\n }\n\n let stepConfig = this.getStepConfig(stepNumber);\n if (stepConfig === null) {\n return this.endTour();\n }\n\n return this._gotoStep(stepConfig, direction);\n }\n\n _gotoStep(stepConfig, direction) {\n if (!stepConfig) {\n return this.endTour();\n }\n\n if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay && !stepConfig.delayed) {\n stepConfig.delayed = true;\n window.setTimeout(this._gotoStep.bind(this), stepConfig.delay, stepConfig, direction);\n\n return this;\n } else if (!stepConfig.orphan && !this.isStepActuallyVisible(stepConfig)) {\n let fn = direction == -1 ? 'getPreviousStepNumber' : 'getNextStepNumber';\n return this.gotoStep(this[fn](stepConfig.stepNumber), direction);\n }\n\n this.hide();\n\n this.fireEventHandlers('beforeRender', stepConfig);\n this.renderStep(stepConfig);\n this.fireEventHandlers('afterRender', stepConfig);\n\n return this;\n }\n\n /**\n * Fetch the normalised step configuration for the specified step number.\n *\n * @method getStepConfig\n * @param {Integer} stepNumber The step number to fetch configuration for\n * @return {Object} The step configuration\n */\n getStepConfig(stepNumber) {\n if (stepNumber === null || stepNumber < 0 || stepNumber >= this.steps.length) {\n return null;\n }\n\n // Normalise the step configuration.\n let stepConfig = this.normalizeStepConfig(this.steps[stepNumber]);\n\n // Add the stepNumber to the stepConfig.\n stepConfig = $.extend(stepConfig, {stepNumber: stepNumber});\n\n return stepConfig;\n }\n\n /**\n * Normalise the supplied step configuration.\n *\n * @method normalizeStepConfig\n * @param {Object} stepConfig The step configuration to normalise\n * @return {Object} The normalised step configuration\n */\n normalizeStepConfig(stepConfig) {\n\n if (typeof stepConfig.reflex !== 'undefined' && typeof stepConfig.moveAfterClick === 'undefined') {\n stepConfig.moveAfterClick = stepConfig.reflex;\n }\n\n if (typeof stepConfig.element !== 'undefined' && typeof stepConfig.target === 'undefined') {\n stepConfig.target = stepConfig.element;\n }\n\n if (typeof stepConfig.content !== 'undefined' && typeof stepConfig.body === 'undefined') {\n stepConfig.body = stepConfig.content;\n }\n\n stepConfig = $.extend({}, this.stepDefaults, stepConfig);\n\n stepConfig = $.extend({}, {\n attachTo: stepConfig.target,\n attachPoint: 'after',\n }, stepConfig);\n\n if (stepConfig.attachTo) {\n stepConfig.attachTo = $(stepConfig.attachTo).first();\n }\n\n return stepConfig;\n }\n\n /**\n * Fetch the actual step target from the selector.\n *\n * This should not be called until after any delay has completed.\n *\n * @method getStepTarget\n * @param {Object} stepConfig The step configuration\n * @return {$}\n */\n getStepTarget(stepConfig) {\n if (stepConfig.target) {\n return $(stepConfig.target);\n }\n\n return null;\n }\n\n /**\n * Fire any event handlers for the specified event.\n *\n * @param {String} eventName The name of the event to handle\n * @param {Object} data Any data to pass to the event\n * @chainable\n * @return {Object} this.\n */\n fireEventHandlers(eventName, data) {\n if (typeof this.eventHandlers[eventName] === 'undefined') {\n return this;\n }\n\n this.eventHandlers[eventName].forEach(function(thisEvent) {\n thisEvent.call(this, data);\n }, this);\n\n return this;\n }\n\n /**\n * @method addEventHandler\n * @param {string} eventName The name of the event to listen for\n * @param {function} handler The event handler to call\n * @return {Object} this.\n */\n addEventHandler(eventName, handler) {\n if (typeof this.eventHandlers[eventName] === 'undefined') {\n this.eventHandlers[eventName] = [];\n }\n\n this.eventHandlers[eventName].push(handler);\n\n return this;\n }\n\n /**\n * Process listeners for the step being shown.\n *\n * @method processStepListeners\n * @param {object} stepConfig The configuration for the step\n * @chainable\n * @return {Object} this.\n */\n processStepListeners(stepConfig) {\n this.listeners.push(\n // Next/Previous buttons.\n {\n node: this.currentStepNode,\n args: ['click', '[data-role=\"next\"]', $.proxy(this.next, this)]\n }, {\n node: this.currentStepNode,\n args: ['click', '[data-role=\"previous\"]', $.proxy(this.previous, this)]\n },\n\n // Close and end tour buttons.\n {\n node: this.currentStepNode,\n args: ['click', '[data-role=\"end\"]', $.proxy(this.endTour, this)]\n },\n\n // Click backdrop and hide tour.\n {\n node: $('[data-flexitour=\"backdrop\"]'),\n args: ['click', $.proxy(this.hide, this)]\n },\n\n // Keypresses.\n {\n node: $('body'),\n args: ['keydown', $.proxy(this.handleKeyDown, this)]\n });\n\n if (stepConfig.moveOnClick) {\n var targetNode = this.getStepTarget(stepConfig);\n this.listeners.push({\n node: targetNode,\n args: ['click', $.proxy(function(e) {\n if ($(e.target).parents('[data-flexitour=\"container\"]').length === 0) {\n // Ignore clicks when they are in the flexitour.\n window.setTimeout($.proxy(this.next, this), 500);\n }\n }, this)]\n });\n }\n\n this.listeners.forEach(function(listener) {\n listener.node.on.apply(listener.node, listener.args);\n });\n\n return this;\n }\n\n /**\n * Reset step listeners.\n *\n * @method resetStepListeners\n * @chainable\n * @return {Object} this.\n */\n resetStepListeners() {\n // Stop listening to all external handlers.\n if (this.listeners) {\n this.listeners.forEach(function(listener) {\n listener.node.off.apply(listener.node, listener.args);\n });\n }\n this.listeners = [];\n\n return this;\n }\n\n /**\n * The standard step renderer.\n *\n * @method renderStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n renderStep(stepConfig) {\n // Store the current step configuration for later.\n this.currentStepConfig = stepConfig;\n this.setCurrentStepNumber(stepConfig.stepNumber);\n\n // Fetch the template and convert it to a $ object.\n let template = $(this.getTemplateContent());\n\n // Title.\n template.find('[data-placeholder=\"title\"]')\n .html(stepConfig.title);\n\n // Body.\n template.find('[data-placeholder=\"body\"]')\n .html(stepConfig.body);\n\n // Is this the first step?\n if (this.isFirstStep(stepConfig.stepNumber)) {\n template.find('[data-role=\"previous\"]').hide();\n } else {\n template.find('[data-role=\"previous\"]').prop('disabled', false);\n }\n\n // Is this the final step?\n if (this.isLastStep(stepConfig.stepNumber)) {\n template.find('[data-role=\"next\"]').hide();\n template.find('[data-role=\"end\"]').removeClass(\"btn-secondary\").addClass(\"btn-primary\");\n } else {\n template.find('[data-role=\"next\"]').prop('disabled', false);\n }\n\n template.find('[data-role=\"previous\"]').attr('role', 'button');\n template.find('[data-role=\"next\"]').attr('role', 'button');\n template.find('[data-role=\"end\"]').attr('role', 'button');\n\n // Replace the template with the updated version.\n stepConfig.template = template;\n\n // Add to the page.\n this.addStepToPage(stepConfig);\n\n // Process step listeners after adding to the page.\n // This uses the currentNode.\n this.processStepListeners(stepConfig);\n\n return this;\n }\n\n /**\n * Getter for the template content.\n *\n * @method getTemplateContent\n * @return {$}\n */\n getTemplateContent() {\n return $(this.templateContent).clone();\n }\n\n /**\n * Helper to add a step to the page.\n *\n * @method addStepToPage\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n addStepToPage(stepConfig) {\n // Create the stepNode from the template data.\n let currentStepNode = $('')\n .html(stepConfig.template)\n .hide();\n\n // The scroll animation occurs on the body or html.\n let animationTarget = $('body, html')\n .stop(true, true);\n\n if (this.isStepActuallyVisible(stepConfig)) {\n let targetNode = this.getStepTarget(stepConfig);\n\n targetNode.data('flexitour', 'target');\n\n let zIndex = this.calculateZIndex(targetNode);\n if (zIndex) {\n stepConfig.zIndex = zIndex + 1;\n }\n\n if (stepConfig.zIndex) {\n currentStepNode.css('zIndex', stepConfig.zIndex + 1);\n }\n\n // Add the backdrop.\n this.positionBackdrop(stepConfig);\n\n $(document.body).append(currentStepNode);\n this.currentStepNode = currentStepNode;\n\n // Ensure that the step node is positioned.\n // Some situations mean that the value is not properly calculated without this step.\n this.currentStepNode.css({\n top: 0,\n left: 0,\n });\n\n animationTarget\n .animate({\n scrollTop: this.calculateScrollTop(stepConfig),\n }).promise().then(function() {\n this.positionStep(stepConfig);\n this.revealStep(stepConfig);\n return;\n }.bind(this))\n .catch(function() {\n // Silently fail.\n });\n\n } else if (stepConfig.orphan) {\n stepConfig.isOrphan = true;\n\n // This will be appended to the body instead.\n stepConfig.attachTo = $('body').first();\n stepConfig.attachPoint = 'append';\n\n // Add the backdrop.\n this.positionBackdrop(stepConfig);\n\n // This is an orphaned step.\n currentStepNode.addClass('orphan');\n\n // It lives in the body.\n $(document.body).append(currentStepNode);\n this.currentStepNode = currentStepNode;\n\n this.currentStepNode.offset(this.calculateStepPositionInPage());\n this.currentStepNode.css('position', 'fixed');\n\n this.currentStepPopper = new Popper(\n $('body'),\n this.currentStepNode[0], {\n removeOnDestroy: true,\n placement: stepConfig.placement + '-start',\n arrowElement: '[data-role=\"arrow\"]',\n // Empty the modifiers. We've already placed the step and don't want it moved.\n modifiers: {\n hide: {\n enabled: false,\n },\n applyStyle: {\n onLoad: null,\n enabled: false,\n },\n }\n }\n );\n\n this.revealStep(stepConfig);\n }\n\n return this;\n }\n\n /**\n * Make the given step visible.\n *\n * @method revealStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n revealStep(stepConfig) {\n // Fade the step in.\n this.currentStepNode.fadeIn('', $.proxy(function() {\n // Announce via ARIA.\n this.announceStep(stepConfig);\n\n // Focus on the current step Node.\n this.currentStepNode.focus();\n window.setTimeout($.proxy(function() {\n // After a brief delay, focus again.\n // There seems to be an issue with Jaws where it only reads the dialogue title initially.\n // This second focus helps it to read the full dialogue.\n if (this.currentStepNode) {\n this.currentStepNode.focus();\n }\n }, this), 100);\n\n }, this));\n\n return this;\n }\n\n /**\n * Helper to announce the step on the page.\n *\n * @method announceStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n announceStep(stepConfig) {\n // Setup the step Dialogue as per:\n // * https://www.w3.org/TR/wai-aria-practices/#dialog_nonmodal\n // * https://www.w3.org/TR/wai-aria-practices/#dialog_modal\n\n // Generate an ID for the current step node.\n let stepId = 'tour-step-' + this.tourName + '-' + stepConfig.stepNumber;\n this.currentStepNode.attr('id', stepId);\n\n let bodyRegion = this.currentStepNode.find('[data-placeholder=\"body\"]').first();\n bodyRegion.attr('id', stepId + '-body');\n bodyRegion.attr('role', 'document');\n\n let headerRegion = this.currentStepNode.find('[data-placeholder=\"title\"]').first();\n headerRegion.attr('id', stepId + '-title');\n headerRegion.attr('aria-labelledby', stepId + '-body');\n\n // Generally, a modal dialog has a role of dialog.\n this.currentStepNode.attr('role', 'dialog');\n this.currentStepNode.attr('tabindex', 0);\n this.currentStepNode.attr('aria-labelledby', stepId + '-title');\n this.currentStepNode.attr('aria-describedby', stepId + '-body');\n\n // Configure ARIA attributes on the target.\n let target = this.getStepTarget(stepConfig);\n if (target) {\n if (!target.attr('tabindex')) {\n target.attr('tabindex', 0);\n }\n\n target\n .data('original-describedby', target.attr('aria-describedby'))\n .attr('aria-describedby', stepId + '-body')\n ;\n }\n\n this.accessibilityShow(stepConfig);\n\n return this;\n }\n\n /**\n * Handle key down events.\n *\n * @method handleKeyDown\n * @param {EventFacade} e\n */\n handleKeyDown(e) {\n let tabbableSelector = 'a[href], link[href], [draggable=true], [contenteditable=true], ';\n tabbableSelector += ':input:enabled, [tabindex], button:enabled';\n switch (e.keyCode) {\n case 27:\n this.endTour();\n break;\n\n // 9 == Tab - trap focus for items with a backdrop.\n case 9:\n // Tab must be handled on key up only in this instance.\n (function() {\n if (!this.currentStepConfig.hasBackdrop) {\n // Trapping tab focus is only handled for those steps with a backdrop.\n return;\n }\n\n // Find all tabbable locations.\n let activeElement = $(document.activeElement);\n let stepTarget = this.getStepTarget(this.currentStepConfig);\n let tabbableNodes = $(tabbableSelector);\n let dialogContainer = $('span[data-flexitour=\"container\"]');\n let currentIndex;\n // Filter out element which is not belong to target section or dialogue.\n if (stepTarget) {\n tabbableNodes = tabbableNodes.filter(function(index, element) {\n return stepTarget !== null\n && (stepTarget.has(element).length\n || dialogContainer.has(element).length\n || stepTarget.is(element)\n || dialogContainer.is(element));\n });\n }\n\n // Find index of focusing element.\n tabbableNodes.each(function(index, element) {\n if (activeElement.is(element)) {\n currentIndex = index;\n return false;\n }\n // Keep looping.\n return true;\n });\n\n let nextIndex;\n let nextNode;\n let focusRelevant;\n if (currentIndex != void 0) {\n let direction = 1;\n if (e.shiftKey) {\n direction = -1;\n }\n nextIndex = currentIndex;\n do {\n nextIndex += direction;\n nextNode = $(tabbableNodes[nextIndex]);\n } while (nextNode.length && nextNode.is(':disabled') || nextNode.is(':hidden'));\n if (nextNode.length) {\n // A new f\n focusRelevant = nextNode.closest(stepTarget).length;\n focusRelevant = focusRelevant || nextNode.closest(this.currentStepNode).length;\n } else {\n // Unable to find the target somehow.\n focusRelevant = false;\n }\n }\n\n if (focusRelevant) {\n nextNode.focus();\n } else {\n if (e.shiftKey) {\n // Focus on the last tabbable node in the step.\n this.currentStepNode.find(tabbableSelector).last().focus();\n } else {\n if (this.currentStepConfig.isOrphan) {\n // Focus on the step - there is no target.\n this.currentStepNode.focus();\n } else {\n // Focus on the step target.\n stepTarget.focus();\n }\n }\n }\n e.preventDefault();\n }).call(this);\n break;\n }\n }\n\n /**\n * Start the current tour.\n *\n * @method startTour\n * @param {Integer} startAt Which step number to start at. If not specified, starts at the last point.\n * @chainable\n * @return {Object} this.\n */\n startTour(startAt) {\n if (this.storage && typeof startAt === 'undefined') {\n let storageStartValue = this.storage.getItem(this.storageKey);\n if (storageStartValue) {\n let storageStartAt = parseInt(storageStartValue, 10);\n if (storageStartAt <= this.steps.length) {\n startAt = storageStartAt;\n }\n }\n }\n\n if (typeof startAt === 'undefined') {\n startAt = this.getCurrentStepNumber();\n }\n\n this.fireEventHandlers('beforeStart', startAt);\n this.gotoStep(startAt);\n this.fireEventHandlers('afterStart', startAt);\n\n return this;\n }\n\n /**\n * Restart the tour from the beginning, resetting the completionlag.\n *\n * @method restartTour\n * @chainable\n * @return {Object} this.\n */\n restartTour() {\n return this.startTour(0);\n }\n\n /**\n * End the current tour.\n *\n * @method endTour\n * @chainable\n * @return {Object} this.\n */\n endTour() {\n this.fireEventHandlers('beforeEnd');\n\n if (this.currentStepConfig) {\n let previousTarget = this.getStepTarget(this.currentStepConfig);\n if (previousTarget) {\n if (!previousTarget.attr('tabindex')) {\n previousTarget.attr('tabindex', '-1');\n }\n previousTarget.focus();\n }\n }\n\n this.hide(true);\n\n this.fireEventHandlers('afterEnd');\n\n return this;\n }\n\n /**\n * Hide any currently visible steps.\n *\n * @method hide\n * @param {Bool} transition Animate the visibility change\n * @chainable\n * @return {Object} this.\n */\n hide(transition) {\n this.fireEventHandlers('beforeHide');\n\n if (this.currentStepNode && this.currentStepNode.length) {\n this.currentStepNode.hide();\n if (this.currentStepPopper) {\n this.currentStepPopper.destroy();\n }\n }\n\n // Restore original target configuration.\n if (this.currentStepConfig) {\n let target = this.getStepTarget(this.currentStepConfig);\n if (target) {\n if (target.data('original-labelledby')) {\n target.attr('aria-labelledby', target.data('original-labelledby'));\n }\n\n if (target.data('original-describedby')) {\n target.attr('aria-describedby', target.data('original-describedby'));\n }\n\n if (target.data('original-tabindex')) {\n target.attr('tabindex', target.data('tabindex'));\n }\n }\n\n // Clear the step configuration.\n this.currentStepConfig = null;\n }\n\n let fadeTime = 0;\n if (transition) {\n fadeTime = 400;\n }\n\n // Remove the backdrop features.\n $('[data-flexitour=\"step-background\"]').remove();\n $('[data-flexitour=\"step-backdrop\"]').removeAttr('data-flexitour');\n $('[data-flexitour=\"backdrop\"]').fadeOut(fadeTime, function() {\n $(this).remove();\n });\n\n // Remove aria-describedby and tabindex attributes.\n if (this.currentStepNode && this.currentStepNode.length) {\n let stepId = this.currentStepNode.attr('id');\n if (stepId) {\n let currentStepElement = '[aria-describedby=\"' + stepId + '-body\"]';\n $(currentStepElement).removeAttr('tabindex');\n $(currentStepElement).removeAttr('aria-describedby');\n }\n }\n\n // Reset the listeners.\n this.resetStepListeners();\n\n this.accessibilityHide();\n\n this.fireEventHandlers('afterHide');\n\n this.currentStepNode = null;\n this.currentStepPopper = null;\n return this;\n }\n\n /**\n * Show the current steps.\n *\n * @method show\n * @chainable\n * @return {Object} this.\n */\n show() {\n // Show the current step.\n let startAt = this.getCurrentStepNumber();\n\n return this.gotoStep(startAt);\n }\n\n /**\n * Return the current step node.\n *\n * @method getStepContainer\n * @return {jQuery}\n */\n getStepContainer() {\n return $(this.currentStepNode);\n }\n\n /**\n * Calculate scrollTop.\n *\n * @method calculateScrollTop\n * @param {Object} stepConfig The step configuration of the step\n * @return {Number}\n */\n calculateScrollTop(stepConfig) {\n let scrollTop = $(window).scrollTop();\n let viewportHeight = $(window).height();\n let targetNode = this.getStepTarget(stepConfig);\n\n if (stepConfig.placement === 'top') {\n // If the placement is top, center scroll at the top of the target.\n scrollTop = targetNode.offset().top - (viewportHeight / 2);\n } else if (stepConfig.placement === 'bottom') {\n // If the placement is bottom, center scroll at the bottom of the target.\n scrollTop = targetNode.offset().top + targetNode.height() - (viewportHeight / 2);\n } else if (targetNode.height() <= (viewportHeight * 0.8)) {\n // If the placement is left/right, and the target fits in the viewport, centre screen on the target\n scrollTop = targetNode.offset().top - ((viewportHeight - targetNode.height()) / 2);\n } else {\n // If the placement is left/right, and the target is bigger than the viewport, set scrollTop to target.top + buffer\n // and change step attachmentTarget to top+.\n scrollTop = targetNode.offset().top - (viewportHeight * 0.2);\n }\n\n // Never scroll over the top.\n scrollTop = Math.max(0, scrollTop);\n\n // Never scroll beyond the bottom.\n scrollTop = Math.min($(document).height() - viewportHeight, scrollTop);\n\n return Math.ceil(scrollTop);\n }\n\n /**\n * Calculate dialogue position for page middle.\n *\n * @method calculateScrollTop\n * @return {Number}\n */\n calculateStepPositionInPage() {\n let viewportHeight = $(window).height();\n let stepHeight = this.currentStepNode.height();\n\n let viewportWidth = $(window).width();\n let stepWidth = this.currentStepNode.width();\n\n return {\n top: Math.ceil((viewportHeight - stepHeight) / 2),\n left: Math.ceil((viewportWidth - stepWidth) / 2)\n };\n }\n\n /**\n * Position the step on the page.\n *\n * @method positionStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n positionStep(stepConfig) {\n let content = this.currentStepNode;\n if (!content || !content.length) {\n // Unable to find the step node.\n return this;\n }\n\n let flipBehavior;\n switch (stepConfig.placement) {\n case 'left':\n flipBehavior = ['left', 'right', 'top', 'bottom'];\n break;\n case 'right':\n flipBehavior = ['right', 'left', 'top', 'bottom'];\n break;\n case 'top':\n flipBehavior = ['top', 'bottom', 'right', 'left'];\n break;\n case 'bottom':\n flipBehavior = ['bottom', 'top', 'right', 'left'];\n break;\n default:\n flipBehavior = 'flip';\n break;\n }\n\n let target = this.getStepTarget(stepConfig);\n var config = {\n placement: stepConfig.placement + '-start',\n removeOnDestroy: true,\n modifiers: {\n flip: {\n behaviour: flipBehavior,\n },\n arrow: {\n element: '[data-role=\"arrow\"]',\n },\n },\n onCreate: function(data) {\n recalculateArrowPosition(data);\n },\n onUpdate: function(data) {\n recalculateArrowPosition(data);\n },\n };\n\n let recalculateArrowPosition = function(data) {\n let placement = data.placement.split('-')[0];\n const isVertical = ['left', 'right'].indexOf(placement) !== -1;\n const arrowElement = data.instance.popper.querySelector('[data-role=\"arrow\"]');\n const stepElement = $(data.instance.popper.querySelector('[data-role=\"flexitour-step\"]'));\n if (isVertical) {\n let arrowHeight = parseFloat(window.getComputedStyle(arrowElement).height);\n let arrowOffset = parseFloat(window.getComputedStyle(arrowElement).top);\n let popperHeight = parseFloat(window.getComputedStyle(data.instance.popper).height);\n let popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).top);\n let popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));\n let popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;\n let arrowPos = arrowOffset + (arrowHeight / 2);\n let maxPos = popperHeight + popperOffset - popperBorderWidth - popperBorderRadiusWidth;\n let minPos = popperOffset + popperBorderWidth + popperBorderRadiusWidth;\n if (arrowPos >= maxPos || arrowPos <= minPos) {\n let newArrowPos = 0;\n if (arrowPos > (popperHeight / 2)) {\n newArrowPos = maxPos - arrowHeight;\n } else {\n newArrowPos = minPos + arrowHeight;\n }\n $(arrowElement).css('top', newArrowPos);\n }\n } else {\n let arrowWidth = parseFloat(window.getComputedStyle(arrowElement).width);\n let arrowOffset = parseFloat(window.getComputedStyle(arrowElement).left);\n let popperWidth = parseFloat(window.getComputedStyle(data.instance.popper).width);\n let popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).left);\n let popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));\n let popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;\n let arrowPos = arrowOffset + (arrowWidth / 2);\n let maxPos = popperWidth + popperOffset - popperBorderWidth - popperBorderRadiusWidth;\n let minPos = popperOffset + popperBorderWidth + popperBorderRadiusWidth;\n if (arrowPos >= maxPos || arrowPos <= minPos) {\n let newArrowPos = 0;\n if (arrowPos > (popperWidth / 2)) {\n newArrowPos = maxPos - arrowWidth;\n } else {\n newArrowPos = minPos + arrowWidth;\n }\n $(arrowElement).css('left', newArrowPos);\n }\n }\n };\n\n let background = $('[data-flexitour=\"step-background\"]');\n if (background.length) {\n target = background;\n }\n this.currentStepPopper = new Popper(target, content[0], config);\n\n return this;\n }\n\n /**\n * Add the backdrop.\n *\n * @method positionBackdrop\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n positionBackdrop(stepConfig) {\n if (stepConfig.backdrop) {\n this.currentStepConfig.hasBackdrop = true;\n let backdrop = $('
');\n\n if (stepConfig.zIndex) {\n if (stepConfig.attachPoint === 'append') {\n stepConfig.attachTo.append(backdrop);\n } else {\n backdrop.insertAfter(stepConfig.attachTo);\n }\n } else {\n $('body').append(backdrop);\n }\n\n if (this.isStepActuallyVisible(stepConfig)) {\n // The step has a visible target.\n // Punch a hole through the backdrop.\n let background = $('
');\n\n let targetNode = this.getStepTarget(stepConfig);\n\n let buffer = 10;\n\n let colorNode = targetNode;\n if (buffer) {\n colorNode = $('body');\n }\n\n background.css({\n width: targetNode.outerWidth() + buffer + buffer,\n height: targetNode.outerHeight() + buffer + buffer,\n left: targetNode.offset().left - buffer,\n top: targetNode.offset().top - buffer,\n backgroundColor: this.calculateInherittedBackgroundColor(colorNode),\n });\n\n if (targetNode.offset().left < buffer) {\n background.css({\n width: targetNode.outerWidth() + targetNode.offset().left + buffer,\n left: targetNode.offset().left,\n });\n }\n\n if (targetNode.offset().top < buffer) {\n background.css({\n height: targetNode.outerHeight() + targetNode.offset().top + buffer,\n top: targetNode.offset().top,\n });\n }\n\n let targetRadius = targetNode.css('borderRadius');\n if (targetRadius && targetRadius !== $('body').css('borderRadius')) {\n background.css('borderRadius', targetRadius);\n }\n\n let targetPosition = this.calculatePosition(targetNode);\n if (targetPosition === 'fixed') {\n background.css('top', 0);\n } else if (targetPosition === 'absolute') {\n background.css('position', 'fixed');\n }\n\n let fader = background.clone();\n fader.css({\n backgroundColor: backdrop.css('backgroundColor'),\n opacity: backdrop.css('opacity'),\n });\n fader.attr('data-flexitour', 'step-background-fader');\n\n if (stepConfig.zIndex) {\n if (stepConfig.attachPoint === 'append') {\n stepConfig.attachTo.append(background);\n } else {\n fader.insertAfter(stepConfig.attachTo);\n background.insertAfter(stepConfig.attachTo);\n }\n } else {\n $('body').append(fader);\n $('body').append(background);\n }\n\n // Add the backdrop data to the actual target.\n // This is the part which actually does the work.\n targetNode.attr('data-flexitour', 'step-backdrop');\n\n if (stepConfig.zIndex) {\n backdrop.css('zIndex', stepConfig.zIndex);\n background.css('zIndex', stepConfig.zIndex + 1);\n targetNode.css('zIndex', stepConfig.zIndex + 2);\n }\n\n fader.fadeOut('2000', function() {\n $(this).remove();\n });\n }\n }\n return this;\n }\n\n /**\n * Calculate the inheritted z-index.\n *\n * @method calculateZIndex\n * @param {jQuery} elem The element to calculate z-index for\n * @return {Number} Calculated z-index\n */\n calculateZIndex(elem) {\n elem = $(elem);\n while (elem.length && elem[0] !== document) {\n // Ignore z-index if position is set to a value where z-index is ignored by the browser\n // This makes behavior of this function consistent across browsers\n // WebKit always returns auto if the element is positioned.\n let position = elem.css(\"position\");\n if (position === \"absolute\" || position === \"relative\" || position === \"fixed\") {\n // IE returns 0 when zIndex is not specified\n // other browsers return a string\n // we ignore the case of nested elements with an explicit value of 0\n //
\n let value = parseInt(elem.css(\"zIndex\"), 10);\n if (!isNaN(value) && value !== 0) {\n return value;\n }\n }\n elem = elem.parent();\n }\n\n return 0;\n }\n\n /**\n * Calculate the inheritted background colour.\n *\n * @method calculateInherittedBackgroundColor\n * @param {jQuery} elem The element to calculate colour for\n * @return {String} Calculated background colour\n */\n calculateInherittedBackgroundColor(elem) {\n // Use a fake node to compare each element against.\n let fakeNode = $('
').hide();\n $('body').append(fakeNode);\n let fakeElemColor = fakeNode.css('backgroundColor');\n fakeNode.remove();\n\n elem = $(elem);\n while (elem.length && elem[0] !== document) {\n let color = elem.css('backgroundColor');\n if (color !== fakeElemColor) {\n return color;\n }\n elem = elem.parent();\n }\n\n return null;\n }\n\n /**\n * Calculate the inheritted position.\n *\n * @method calculatePosition\n * @param {jQuery} elem The element to calculate position for\n * @return {String} Calculated position\n */\n calculatePosition(elem) {\n elem = $(elem);\n while (elem.length && elem[0] !== document) {\n let position = elem.css('position');\n if (position !== 'static') {\n return position;\n }\n elem = elem.parent();\n }\n\n return null;\n }\n\n /**\n * Perform accessibility changes for step shown.\n *\n * This will add aria-hidden=\"true\" to all siblings and parent siblings.\n *\n * @method accessibilityShow\n */\n accessibilityShow() {\n let stateHolder = 'data-has-hidden';\n let attrName = 'aria-hidden';\n let hideFunction = function(child) {\n let flexitourRole = child.data('flexitour');\n if (flexitourRole) {\n switch (flexitourRole) {\n case 'container':\n case 'target':\n return;\n }\n }\n\n let hidden = child.attr(attrName);\n if (!hidden) {\n child.attr(stateHolder, true);\n Aria.hide(child);\n }\n };\n\n this.currentStepNode.siblings().each(function(index, node) {\n hideFunction($(node));\n });\n this.currentStepNode.parentsUntil('body').siblings().each(function(index, node) {\n hideFunction($(node));\n });\n }\n\n /**\n * Perform accessibility changes for step hidden.\n *\n * This will remove any newly added aria-hidden=\"true\".\n *\n * @method accessibilityHide\n */\n accessibilityHide() {\n let stateHolder = 'data-has-hidden';\n let showFunction = function(child) {\n let hidden = child.attr(stateHolder);\n if (typeof hidden !== 'undefined') {\n child.removeAttr(stateHolder);\n Aria.unhide(child);\n }\n };\n\n $('[' + stateHolder + ']').each(function(index, node) {\n showFunction($(node));\n });\n }\n}\n"],"file":"tour.min.js"} \ No newline at end of file diff --git a/admin/tool/usertours/amd/build/usertours.min.js.map b/admin/tool/usertours/amd/build/usertours.min.js.map index 8d92c0f5c9984..1b17c025a3ae8 100644 --- a/admin/tool/usertours/amd/build/usertours.min.js.map +++ b/admin/tool/usertours/amd/build/usertours.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/usertours.js"],"names":["define","ajax","BootstrapTour","$","templates","str","log","notification","usertours","tourId","currentTour","init","tourDetails","filters","requirements","req","length","require","matchingTour","key","tour","i","filter","arguments","filterMatches","startTour","fetchTour","addResetLink","on","e","preventDefault","resetTourState","M","util","js_pending","call","methodname","args","tourid","context","cfg","contextid","pageurl","window","location","href","response","hasOwnProperty","renderForPromise","tourconfig","template","startBootstrapTour","html","exception","js_complete","ele","render","then","js","appendNodeContents","always","fail","tourConfig","onEnd","endTour","eventHandlers","afterEnd","markTourComplete","afterRender","markStepShown","tourName","name","steps","map","step","element","target","reflex","moveOnClick","content","body","stepConfig","getStepConfig","getCurrentStepNumber","when","stepid","stepindex","error"],"mappings":"kYAOAA,OAAM,4BACN,CAAC,WAAD,CAAc,qBAAd,CAAqC,QAArC,CAA+C,gBAA/C,CAAiE,UAAjE,CAA6E,UAA7E,CAAyF,mBAAzF,CADM,CAEN,SAASC,CAAT,CAAeC,CAAf,CAA8BC,CAA9B,CAAiCC,CAAjC,CAA4CC,CAA5C,CAAiDC,CAAjD,CAAsDC,CAAtD,CAAoE,CAChE,GAAIC,CAAAA,CAAS,CAAG,CACZC,MAAM,CAAE,IADI,CAGZC,WAAW,CAAE,IAHD,CAYZC,IAAI,CAAE,cAASC,CAAT,CAAsBC,CAAtB,CAA+B,CAEjC,OADIC,CAAAA,CAAY,CAAG,EACnB,CAASC,CAAG,CAAG,CAAf,CAAkBA,CAAG,CAAGF,CAAO,CAACG,MAAhC,CAAwCD,CAAG,EAA3C,CAA+C,CAC3CD,CAAY,CAACC,CAAD,CAAZ,CAAoB,yBAA2BF,CAAO,CAACE,CAAD,CACzD,CACDE,OAAO,CAACH,CAAD,CAAe,UAAW,CAE7B,GAAII,CAAAA,CAAY,CAAG,IAAnB,CACA,IAAK,GAAIC,CAAAA,CAAT,GAAgBP,CAAAA,CAAhB,CAA6B,CAEzB,OADIQ,CAAAA,CAAI,CAAGR,CAAW,CAACO,CAAD,CACtB,CAASE,CAAC,CAAG,CAAb,CACQC,CADR,CAAgBD,CAAC,CAAGR,CAAO,CAACG,MAA5B,CAAoCK,CAAC,EAArC,CAAyC,CACjCC,CADiC,CACxBC,SAAS,CAACF,CAAD,CADe,CAErC,GAAIC,CAAM,CAACE,aAAP,CAAqBJ,CAArB,CAAJ,CAAgC,CAC5BF,CAAY,CAAGE,CAClB,CAFD,IAEO,CAEHF,CAAY,CAAG,IAAf,CACA,KACH,CACJ,CAED,GAAIA,CAAJ,CAAkB,CACd,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B,CAAQ,CAACrB,SAA7B,CACH,CAEJ,CAhBD,EAgBGoC,IAhBH,CAgBQtD,CAAY,CAAC8C,SAhBrB,CAiBH,CA/PW,CAAhB,CAkQA,MAAqD,CAQjD1C,IAAI,CAAEH,CAAS,CAACG,IARiC,CAgBjDoB,cAAc,CAAEvB,CAAS,CAACuB,cAhBuB,CAkBxD,CAvRK,CAAN","sourcesContent":["/**\n * User tour control library.\n *\n * @module tool_usertours/usertours\n * @class usertours\n * @copyright 2016 Andrew Nicols \n */\ndefine(\n['core/ajax', 'tool_usertours/tour', 'jquery', 'core/templates', 'core/str', 'core/log', 'core/notification'],\nfunction(ajax, BootstrapTour, $, templates, str, log, notification) {\n var usertours = {\n tourId: null,\n\n currentTour: null,\n\n /**\n * Initialise the user tour for the current page.\n *\n * @method init\n * @param {Array} tourDetails The matching tours for this page.\n * @param {Array} filters The names of all client side filters.\n */\n init: function(tourDetails, filters) {\n let requirements = [];\n for (var req = 0; req < filters.length; req++) {\n requirements[req] = 'tool_usertours/filter_' + filters[req];\n }\n require(requirements, function() {\n // Run the client side filters to find the first matching tour.\n let matchingTour = null;\n for (let key in tourDetails) {\n let tour = tourDetails[key];\n for (let i = 0; i < filters.length; i++) {\n let filter = arguments[i];\n if (filter.filterMatches(tour)) {\n matchingTour = tour;\n } else {\n // If any filter doesn't match, move on to the next tour.\n matchingTour = null;\n break;\n }\n }\n // If all filters matched then use this tour.\n if (matchingTour) {\n break;\n }\n }\n\n if (matchingTour === null) {\n return;\n }\n\n // Only one tour per page is allowed.\n usertours.tourId = matchingTour.tourId;\n\n let startTour = matchingTour.startTour;\n if (typeof startTour === 'undefined') {\n startTour = true;\n }\n\n if (startTour) {\n // Fetch the tour configuration.\n usertours.fetchTour(usertours.tourId);\n }\n\n usertours.addResetLink();\n // Watch for the reset link.\n $('body').on('click', '[data-action=\"tool_usertours/resetpagetour\"]', function(e) {\n e.preventDefault();\n usertours.resetTourState(usertours.tourId);\n });\n });\n },\n\n /**\n * Fetch the configuration specified tour, and start the tour when it has been fetched.\n *\n * @method fetchTour\n * @param {Number} tourId The ID of the tour to start.\n */\n fetchTour: async function(tourId) {\n M.util.js_pending('admin_usertour_fetchTour' + tourId);\n\n try {\n const response = await ajax.call([\n {\n methodname: 'tool_usertours_fetch_and_start_tour',\n args: {\n tourid: tourId,\n context: M.cfg.contextid,\n pageurl: window.location.href,\n }\n }\n ])[0];\n if (response.hasOwnProperty('tourconfig')) {\n const template = await templates.renderForPromise('tool_usertours/tourstep', response.tourconfig);\n\n usertours.startBootstrapTour(tourId, template.html, response.tourconfig);\n }\n } catch (error) {\n notification.exception(error);\n }\n M.util.js_complete('admin_usertour_fetchTour' + tourId);\n },\n\n\n /**\n * Add a reset link to the page.\n *\n * @method addResetLink\n */\n addResetLink: function() {\n var ele;\n M.util.js_pending('admin_usertour_addResetLink');\n\n // Append the link to the most suitable place on the page\n // with fallback to legacy selectors and finally the body\n // if there is no better place.\n if ($('.tool_usertours-resettourcontainer').length) {\n ele = $('.tool_usertours-resettourcontainer');\n } else if ($('.logininfo').length) {\n ele = $('.logininfo');\n } else if ($('footer').length) {\n ele = $('footer');\n } else {\n ele = $('body');\n }\n templates.render('tool_usertours/resettour', {})\n .then(function(html, js) {\n templates.appendNodeContents(ele, html, js);\n\n return;\n })\n .always(function() {\n M.util.js_complete('admin_usertour_addResetLink');\n\n return;\n })\n .fail();\n },\n\n /**\n * Start the specified tour.\n *\n * @method startBootstrapTour\n * @param {Number} tourId The ID of the tour to start.\n * @param {String} template The template to use.\n * @param {Object} tourConfig The tour configuration.\n * @return {Object}\n */\n startBootstrapTour: function(tourId, template, tourConfig) {\n if (usertours.currentTour) {\n // End the current tour, but disable end tour handler.\n tourConfig.onEnd = null;\n usertours.currentTour.endTour();\n delete usertours.currentTour;\n }\n\n // Normalize for the new library.\n tourConfig.eventHandlers = {\n afterEnd: [usertours.markTourComplete],\n afterRender: [usertours.markStepShown],\n };\n\n // Sort out the tour name.\n tourConfig.tourName = tourConfig.name;\n delete tourConfig.name;\n\n // Add the template to the configuration.\n // This enables translations of the buttons.\n tourConfig.template = template;\n\n tourConfig.steps = tourConfig.steps.map(function(step) {\n if (typeof step.element !== 'undefined') {\n step.target = step.element;\n delete step.element;\n }\n\n if (typeof step.reflex !== 'undefined') {\n step.moveOnClick = !!step.reflex;\n delete step.reflex;\n }\n\n if (typeof step.content !== 'undefined') {\n step.body = step.content;\n delete step.content;\n }\n\n return step;\n });\n\n usertours.currentTour = new BootstrapTour(tourConfig);\n return usertours.currentTour.startTour();\n },\n\n /**\n * Mark the specified step as being shownd by the user.\n *\n * @method markStepShown\n */\n markStepShown: function() {\n var stepConfig = this.getStepConfig(this.getCurrentStepNumber());\n $.when(\n ajax.call([\n {\n methodname: 'tool_usertours_step_shown',\n args: {\n tourid: usertours.tourId,\n context: M.cfg.contextid,\n pageurl: window.location.href,\n stepid: stepConfig.stepid,\n stepindex: this.getCurrentStepNumber(),\n }\n }\n ])[0]\n ).fail(log.error);\n },\n\n /**\n * Mark the specified tour as being completed by the user.\n *\n * @method markTourComplete\n */\n markTourComplete: function() {\n var stepConfig = this.getStepConfig(this.getCurrentStepNumber());\n $.when(\n ajax.call([\n {\n methodname: 'tool_usertours_complete_tour',\n args: {\n tourid: usertours.tourId,\n context: M.cfg.contextid,\n pageurl: window.location.href,\n stepid: stepConfig.stepid,\n stepindex: this.getCurrentStepNumber(),\n }\n }\n ])[0]\n ).fail(log.error);\n },\n\n /**\n * Reset the state, and restart the the tour on the current page.\n *\n * @method resetTourState\n * @param {Number} tourId The ID of the tour to start.\n */\n resetTourState: function(tourId) {\n $.when(\n ajax.call([\n {\n methodname: 'tool_usertours_reset_tour',\n args: {\n tourid: tourId,\n context: M.cfg.contextid,\n pageurl: window.location.href,\n }\n }\n ])[0]\n ).then(function(response) {\n if (response.startTour) {\n usertours.fetchTour(response.startTour);\n }\n return;\n }).fail(notification.exception);\n }\n };\n\n return /** @alias module:tool_usertours/usertours */ {\n /**\n * Initialise the user tour for the current page.\n *\n * @method init\n * @param {Number} tourId The ID of the tour to start.\n * @param {Bool} startTour Attempt to start the tour now.\n */\n init: usertours.init,\n\n /**\n * Reset the state, and restart the the tour on the current page.\n *\n * @method resetTourState\n * @param {Number} tourId The ID of the tour to restart.\n */\n resetTourState: usertours.resetTourState\n };\n});\n"],"file":"usertours.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/usertours.js"],"names":["define","ajax","BootstrapTour","$","templates","str","log","notification","usertours","tourId","currentTour","init","tourDetails","filters","requirements","req","length","require","matchingTour","key","tour","i","filter","arguments","filterMatches","startTour","fetchTour","addResetLink","on","e","preventDefault","resetTourState","M","util","js_pending","call","methodname","args","tourid","context","cfg","contextid","pageurl","window","location","href","response","hasOwnProperty","renderForPromise","tourconfig","template","startBootstrapTour","html","exception","js_complete","ele","render","then","js","appendNodeContents","always","fail","tourConfig","onEnd","endTour","eventHandlers","afterEnd","markTourComplete","afterRender","markStepShown","tourName","name","steps","map","step","element","target","reflex","moveOnClick","content","body","stepConfig","getStepConfig","getCurrentStepNumber","when","stepid","stepindex","error"],"mappings":"kYAMAA,OAAM,4BACN,CAAC,WAAD,CAAc,qBAAd,CAAqC,QAArC,CAA+C,gBAA/C,CAAiE,UAAjE,CAA6E,UAA7E,CAAyF,mBAAzF,CADM,CAEN,SAASC,CAAT,CAAeC,CAAf,CAA8BC,CAA9B,CAAiCC,CAAjC,CAA4CC,CAA5C,CAAiDC,CAAjD,CAAsDC,CAAtD,CAAoE,CAChE,GAAIC,CAAAA,CAAS,CAAG,CACZC,MAAM,CAAE,IADI,CAGZC,WAAW,CAAE,IAHD,CAYZC,IAAI,CAAE,cAASC,CAAT,CAAsBC,CAAtB,CAA+B,CAEjC,OADIC,CAAAA,CAAY,CAAG,EACnB,CAASC,CAAG,CAAG,CAAf,CAAkBA,CAAG,CAAGF,CAAO,CAACG,MAAhC,CAAwCD,CAAG,EAA3C,CAA+C,CAC3CD,CAAY,CAACC,CAAD,CAAZ,CAAoB,yBAA2BF,CAAO,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oBAAL,EALV,CAFV,CADM,CAAV,EAWG,CAXH,CADJ,EAaEtB,IAbF,CAaOvD,CAAG,CAACiF,KAbX,CAcH,CArOW,CA6OZxD,cAAc,CAAE,wBAAStB,CAAT,CAAiB,CAC7BN,CAAC,CAACiF,IAAF,CACInF,CAAI,CAACkC,IAAL,CAAU,CACN,CACIC,UAAU,CAAE,2BADhB,CAEIC,IAAI,CAAE,CACFC,MAAM,CAAM7B,CADV,CAEF8B,OAAO,CAAKP,CAAC,CAACQ,GAAF,CAAMC,SAFhB,CAGFC,OAAO,CAAKC,MAAM,CAACC,QAAP,CAAgBC,IAH1B,CAFV,CADM,CAAV,EASG,CATH,CADJ,EAWEY,IAXF,CAWO,SAASX,CAAT,CAAmB,CACtB,GAAIA,CAAQ,CAACrB,SAAb,CAAwB,CACpBjB,CAAS,CAACkB,SAAV,CAAoBoB,CAAQ,CAACrB,SAA7B,CACH,CAEJ,CAhBD,EAgBGoC,IAhBH,CAgBQtD,CAAY,CAAC8C,SAhBrB,CAiBH,CA/PW,CAAhB,CAkQA,MAAqD,CAQjD1C,IAAI,CAAEH,CAAS,CAACG,IARiC,CAgBjDoB,cAAc,CAAEvB,CAAS,CAACuB,cAhBuB,CAkBxD,CAvRK,CAAN","sourcesContent":["/**\n * User tour control library.\n *\n * @module tool_usertours/usertours\n * @copyright 2016 Andrew Nicols \n */\ndefine(\n['core/ajax', 'tool_usertours/tour', 'jquery', 'core/templates', 'core/str', 'core/log', 'core/notification'],\nfunction(ajax, BootstrapTour, $, templates, str, log, notification) {\n var usertours = {\n tourId: null,\n\n currentTour: null,\n\n /**\n * Initialise the user tour for the current page.\n *\n * @method init\n * @param {Array} tourDetails The matching tours for this page.\n * @param {Array} filters The names of all client side filters.\n */\n init: function(tourDetails, filters) {\n let requirements = [];\n for (var req = 0; req < filters.length; req++) {\n requirements[req] = 'tool_usertours/filter_' + filters[req];\n }\n require(requirements, function() {\n // Run the client side filters to find the first matching tour.\n let matchingTour = null;\n for (let key in tourDetails) {\n let tour = tourDetails[key];\n for (let i = 0; i < filters.length; i++) {\n let filter = arguments[i];\n if (filter.filterMatches(tour)) {\n matchingTour = tour;\n } else {\n // If any filter doesn't match, move on to the next tour.\n matchingTour = null;\n break;\n }\n }\n // If all filters matched then use this tour.\n if (matchingTour) {\n break;\n }\n }\n\n if (matchingTour === null) {\n return;\n }\n\n // Only one tour per page is allowed.\n usertours.tourId = matchingTour.tourId;\n\n let startTour = matchingTour.startTour;\n if (typeof startTour === 'undefined') {\n startTour = true;\n }\n\n if (startTour) {\n // Fetch the tour configuration.\n usertours.fetchTour(usertours.tourId);\n }\n\n usertours.addResetLink();\n // Watch for the reset link.\n $('body').on('click', '[data-action=\"tool_usertours/resetpagetour\"]', function(e) {\n e.preventDefault();\n usertours.resetTourState(usertours.tourId);\n });\n });\n },\n\n /**\n * Fetch the configuration specified tour, and start the tour when it has been fetched.\n *\n * @method fetchTour\n * @param {Number} tourId The ID of the tour to start.\n */\n fetchTour: async function(tourId) {\n M.util.js_pending('admin_usertour_fetchTour' + tourId);\n\n try {\n const response = await ajax.call([\n {\n methodname: 'tool_usertours_fetch_and_start_tour',\n args: {\n tourid: tourId,\n context: M.cfg.contextid,\n pageurl: window.location.href,\n }\n }\n ])[0];\n if (response.hasOwnProperty('tourconfig')) {\n const template = await templates.renderForPromise('tool_usertours/tourstep', response.tourconfig);\n\n usertours.startBootstrapTour(tourId, template.html, response.tourconfig);\n }\n } catch (error) {\n notification.exception(error);\n }\n M.util.js_complete('admin_usertour_fetchTour' + tourId);\n },\n\n\n /**\n * Add a reset link to the page.\n *\n * @method addResetLink\n */\n addResetLink: function() {\n var ele;\n M.util.js_pending('admin_usertour_addResetLink');\n\n // Append the link to the most suitable place on the page\n // with fallback to legacy selectors and finally the body\n // if there is no better place.\n if ($('.tool_usertours-resettourcontainer').length) {\n ele = $('.tool_usertours-resettourcontainer');\n } else if ($('.logininfo').length) {\n ele = $('.logininfo');\n } else if ($('footer').length) {\n ele = $('footer');\n } else {\n ele = $('body');\n }\n templates.render('tool_usertours/resettour', {})\n .then(function(html, js) {\n templates.appendNodeContents(ele, html, js);\n\n return;\n })\n .always(function() {\n M.util.js_complete('admin_usertour_addResetLink');\n\n return;\n })\n .fail();\n },\n\n /**\n * Start the specified tour.\n *\n * @method startBootstrapTour\n * @param {Number} tourId The ID of the tour to start.\n * @param {String} template The template to use.\n * @param {Object} tourConfig The tour configuration.\n * @return {Object}\n */\n startBootstrapTour: function(tourId, template, tourConfig) {\n if (usertours.currentTour) {\n // End the current tour, but disable end tour handler.\n tourConfig.onEnd = null;\n usertours.currentTour.endTour();\n delete usertours.currentTour;\n }\n\n // Normalize for the new library.\n tourConfig.eventHandlers = {\n afterEnd: [usertours.markTourComplete],\n afterRender: [usertours.markStepShown],\n };\n\n // Sort out the tour name.\n tourConfig.tourName = tourConfig.name;\n delete tourConfig.name;\n\n // Add the template to the configuration.\n // This enables translations of the buttons.\n tourConfig.template = template;\n\n tourConfig.steps = tourConfig.steps.map(function(step) {\n if (typeof step.element !== 'undefined') {\n step.target = step.element;\n delete step.element;\n }\n\n if (typeof step.reflex !== 'undefined') {\n step.moveOnClick = !!step.reflex;\n delete step.reflex;\n }\n\n if (typeof step.content !== 'undefined') {\n step.body = step.content;\n delete step.content;\n }\n\n return step;\n });\n\n usertours.currentTour = new BootstrapTour(tourConfig);\n return usertours.currentTour.startTour();\n },\n\n /**\n * Mark the specified step as being shownd by the user.\n *\n * @method markStepShown\n */\n markStepShown: function() {\n var stepConfig = this.getStepConfig(this.getCurrentStepNumber());\n $.when(\n ajax.call([\n {\n methodname: 'tool_usertours_step_shown',\n args: {\n tourid: usertours.tourId,\n context: M.cfg.contextid,\n pageurl: window.location.href,\n stepid: stepConfig.stepid,\n stepindex: this.getCurrentStepNumber(),\n }\n }\n ])[0]\n ).fail(log.error);\n },\n\n /**\n * Mark the specified tour as being completed by the user.\n *\n * @method markTourComplete\n */\n markTourComplete: function() {\n var stepConfig = this.getStepConfig(this.getCurrentStepNumber());\n $.when(\n ajax.call([\n {\n methodname: 'tool_usertours_complete_tour',\n args: {\n tourid: usertours.tourId,\n context: M.cfg.contextid,\n pageurl: window.location.href,\n stepid: stepConfig.stepid,\n stepindex: this.getCurrentStepNumber(),\n }\n }\n ])[0]\n ).fail(log.error);\n },\n\n /**\n * Reset the state, and restart the the tour on the current page.\n *\n * @method resetTourState\n * @param {Number} tourId The ID of the tour to start.\n */\n resetTourState: function(tourId) {\n $.when(\n ajax.call([\n {\n methodname: 'tool_usertours_reset_tour',\n args: {\n tourid: tourId,\n context: M.cfg.contextid,\n pageurl: window.location.href,\n }\n }\n ])[0]\n ).then(function(response) {\n if (response.startTour) {\n usertours.fetchTour(response.startTour);\n }\n return;\n }).fail(notification.exception);\n }\n };\n\n return /** @alias module:tool_usertours/usertours */ {\n /**\n * Initialise the user tour for the current page.\n *\n * @method init\n * @param {Number} tourId The ID of the tour to start.\n * @param {Bool} startTour Attempt to start the tour now.\n */\n init: usertours.init,\n\n /**\n * Reset the state, and restart the the tour on the current page.\n *\n * @method resetTourState\n * @param {Number} tourId The ID of the tour to restart.\n */\n resetTourState: usertours.resetTourState\n };\n});\n"],"file":"usertours.min.js"} \ No newline at end of file diff --git a/admin/tool/usertours/amd/src/filter_cssselector.js b/admin/tool/usertours/amd/src/filter_cssselector.js index 469c2407a232a..9cf62597fe0f7 100644 --- a/admin/tool/usertours/amd/src/filter_cssselector.js +++ b/admin/tool/usertours/amd/src/filter_cssselector.js @@ -17,7 +17,6 @@ * CSS selector client side filter. * * @module tool_usertours/filter_cssselector - * @class filter_cssselector * @copyright 2020 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/admin/tool/usertours/amd/src/managesteps.js b/admin/tool/usertours/amd/src/managesteps.js index 665c95e889b3d..0f758e6a2a01d 100644 --- a/admin/tool/usertours/amd/src/managesteps.js +++ b/admin/tool/usertours/amd/src/managesteps.js @@ -2,7 +2,6 @@ * Step management code. * * @module tool_usertours/managesteps - * @class managesteps * @copyright 2016 Andrew Nicols */ define( diff --git a/admin/tool/usertours/amd/src/managetours.js b/admin/tool/usertours/amd/src/managetours.js index 47812009a94d9..4f4a67c3adf99 100644 --- a/admin/tool/usertours/amd/src/managetours.js +++ b/admin/tool/usertours/amd/src/managetours.js @@ -2,7 +2,6 @@ * Tour management code. * * @module tool_usertours/managetours - * @class managetours * @copyright 2016 Andrew Nicols */ define( diff --git a/admin/tool/usertours/amd/src/tour.js b/admin/tool/usertours/amd/src/tour.js index 4e6936aeebd37..a75dca2ef8779 100644 --- a/admin/tool/usertours/amd/src/tour.js +++ b/admin/tool/usertours/amd/src/tour.js @@ -16,6 +16,7 @@ /** * Manage user tours in Moodle. * + * @module tool_usertours/tour * @copyright 2018 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -27,7 +28,7 @@ import Popper from 'core/popper'; /** * A Tour. * - * @class Tour + * @class */ export default class Tour { /** diff --git a/admin/tool/usertours/amd/src/usertours.js b/admin/tool/usertours/amd/src/usertours.js index 9cf9991c377e4..4323673d21285 100644 --- a/admin/tool/usertours/amd/src/usertours.js +++ b/admin/tool/usertours/amd/src/usertours.js @@ -2,7 +2,6 @@ * User tour control library. * * @module tool_usertours/usertours - * @class usertours * @copyright 2016 Andrew Nicols */ define( diff --git a/backup/util/ui/amd/build/async_backup.min.js.map b/backup/util/ui/amd/build/async_backup.min.js.map index b098d8bb6c113..2e04c575e7e64 100644 --- a/backup/util/ui/amd/build/async_backup.min.js.map +++ b/backup/util/ui/amd/build/async_backup.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/async_backup.js"],"names":["define","$","ajax","Str","notification","Templates","STATUS_FINISHED_ERR","STATUS_FINISHED_OK","Asyncbackup","checkdelayoriginal","checkdelay","checkdelaymultipler","backupid","contextid","restoreurl","typeid","backupintervalid","allbackupintervalid","allcopyintervalid","timeout","updateElement","type","percentage","percentagewidth","Math","round","elementbar","document","querySelectorAll","CSS","escape","percentagetext","toFixed","setAttribute","style","width","innerHTML","updateInterval","intervalid","callback","value","clearInterval","setInterval","updateBackupTableRow","statuscell","parent","tablerow","cellsiblings","siblings","timecell","timevalue","text","filenamecell","filename","call","methodname","args","done","response","context","time","size","filesize","fileurl","render","then","html","js","replaceNodeContents","fail","exception","Error","updateRestoreTableRow","coursecell","resourcename","updateCopyTableRow","restorecourse","closest","children","coursename","courselink","createElement","elementbarparent","operation","previousElementSibling","get_string","content","catch","appendChild","updateProgress","progress","elementstatus","elementdetail","elementbutton","stringRequests","status","classList","add","strProcessing","title","remove","strStatus","strStatusDetail","key","component","get_strings","strings","removeClass","last","addClass","strComplete","strDetail","strButton","param","attr","updateProgressAll","forEach","element","updateProgressCopy","restorecell","getBackupProgress","getAllBackupProgress","backupids","progressbars","find","not","each","push","id","substring","length","getAllCopyProgress","copyids","progressvars","dataset","restoreid","asyncBackupAllStatus","asyncCopyAllStatus","asyncBackupStatus","backup","restore","removeAttr"],"mappings":"AAwBAA,OAAM,4BAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,UAAxB,CAAoC,mBAApC,CAAyD,gBAAzD,CAAD,CACE,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAuBC,CAAvB,CAAqCC,CAArC,CAAgD,IAQhDC,CAAAA,CAAmB,CAAG,GAR0B,CAShDC,CAAkB,CAAG,GAT2B,CAchDC,CAAW,CAAG,EAdkC,CAehDC,CAAkB,CAAG,IAf2B,CAgBhDC,CAAU,CAAG,IAhBmC,CAiBhDC,CAAmB,CAAG,GAjB0B,CAkBhDC,CAlBgD,CAmBhDC,CAnBgD,CAoBhDC,CApBgD,CAqBhDC,CArBgD,CAsBhDC,CAtBgD,CAuBhDC,CAvBgD,CAwBhDC,CAxBgD,CAyBhDC,CAAO,CAAG,GAzBsC,CAkCpD,QAASC,CAAAA,CAAT,CAAuBR,CAAvB,CAAiCS,CAAjC,CAAuCC,CAAvC,CAAmD,IAC3CC,CAAAA,CAAe,CAAGC,IAAI,CAAC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AZ,CAAiC,UAAW,CACxCvH,CAAiB,CAAGwB,WAAW,CAACyF,CAAD,CAAqBzH,CAArB,CAClC,CAFD,CAaAF,CAAW,CAACkI,iBAAZ,CAAgC,SAASC,CAAT,CAAiBhF,CAAjB,CAA0BiF,CAA1B,CAAmCvH,CAAnC,CAAyC,CACrET,CAAQ,CAAG+H,CAAX,CACA9H,CAAS,CAAG8C,CAAZ,CACA7C,CAAU,CAAG8H,CAAb,CAEA,GAAY,QAAR,EAAAvH,CAAJ,CAAsB,CAClBN,CAAM,CAAG,QACZ,CAFD,IAEO,CACHA,CAAM,CAAG,SACZ,CAGDd,CAAC,CAAC,kBAAD,CAAD,CAAsB6E,QAAtB,CAA+B,GAA/B,EAAoC+D,UAApC,CAA+C,MAA/C,EAGA7H,CAAgB,CAAG0B,WAAW,CAAC8E,CAAD,CAAoB9G,CAApB,CAE/B,CAjBH,CAmBE,MAAOF,CAAAA,CACZ,CArkBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * This module updates the UI during an asynchronous\n * backup or restore process.\n *\n * @module backup/util/async_backup\n * @copyright 2018 Matt Porritt \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.7\n */\ndefine(['jquery', 'core/ajax', 'core/str', 'core/notification', 'core/templates'],\n function($, ajax, Str, notification, Templates) {\n\n /**\n * Module level constants.\n *\n * Using var instead of const as ES6 isn't fully supported yet.\n */\n var STATUS_EXECUTING = 800;\n var STATUS_FINISHED_ERR = 900;\n var STATUS_FINISHED_OK = 1000;\n\n /**\n * Module level variables.\n */\n var Asyncbackup = {};\n var checkdelayoriginal = 15000; // This is the default time to use.\n var checkdelay = 15000; // How often we should check for progress updates.\n var checkdelaymultipler = 1.5; // If a request fails this multiplier will be used to increase the checkdelay value\n var backupid; // The backup id to get the progress for.\n var contextid; // The course this backup progress is for.\n var restoreurl; // The URL to view course restores.\n var typeid; // The type of operation backup or restore.\n var backupintervalid; // The id of the setInterval function.\n var allbackupintervalid; // The id of the setInterval function.\n var allcopyintervalid; // The id of the setInterval function.\n var timeout = 2000; // Timeout for ajax requests.\n\n /**\n * Helper function to update UI components.\n *\n * @param {string} backupid The id to match elements on.\n * @param {string} type The type of operation, backup or restore.\n * @param {number} percentage The completion percentage to apply.\n */\n function updateElement(backupid, type, percentage) {\n var percentagewidth = Math.round(percentage) + '%';\n var elementbar = document.querySelectorAll(\"[data-\" + type + \"id=\" + CSS.escape(backupid) + \"]\")[0];\n var percentagetext = percentage.toFixed(2) + '%';\n\n // Set progress bar percentage indicators\n elementbar.setAttribute('aria-valuenow', percentagewidth);\n elementbar.style.width = percentagewidth;\n elementbar.innerHTML = percentagetext;\n }\n\n /**\n * Updates the interval we use to check for backup progress.\n *\n * @param {Number} intervalid The id of the interval\n * @param {Function} callback The function to use in setInterval\n * @param {Number} value The specified interval (in milliseconds)\n * @returns {Number}\n */\n function updateInterval(intervalid, callback, value) {\n clearInterval(intervalid);\n return setInterval(callback, value);\n }\n\n /**\n * Update backup table row when an async backup completes.\n *\n * @param {string} backupid The id to match elements on.\n */\n function updateBackupTableRow(backupid) {\n var statuscell = $('#' + backupid + '_bar').parent().parent();\n var tablerow = statuscell.parent();\n var cellsiblings = statuscell.siblings();\n var timecell = cellsiblings[1];\n var timevalue = $(timecell).text();\n var filenamecell = cellsiblings[0];\n var filename = $(filenamecell).text();\n\n ajax.call([{\n // Get the table data via webservice.\n methodname: 'core_backup_get_async_backup_links_backup',\n args: {\n 'filename': filename,\n 'contextid': contextid\n },\n }])[0].done(function(response) {\n // We have the data now update the UI.\n var context = {\n filename: filename,\n time: timevalue,\n size: response.filesize,\n fileurl: response.fileurl,\n restoreurl: response.restoreurl\n };\n\n Templates.render('core/async_backup_progress_row', context).then(function(html, js) {\n Templates.replaceNodeContents(tablerow, html, js);\n return;\n }).fail(function() {\n notification.exception(new Error('Failed to load table row'));\n return;\n });\n });\n }\n\n /**\n * Update restore table row when an async restore completes.\n *\n * @param {string} backupid The id to match elements on.\n */\n function updateRestoreTableRow(backupid) {\n var statuscell = $('#' + backupid + '_bar').parent().parent();\n var tablerow = statuscell.parent();\n var cellsiblings = statuscell.siblings();\n var coursecell = cellsiblings[0];\n var timecell = cellsiblings[1];\n var timevalue = $(timecell).text();\n\n ajax.call([{\n // Get the table data via webservice.\n methodname: 'core_backup_get_async_backup_links_restore',\n args: {\n 'backupid': backupid,\n 'contextid': contextid\n },\n }])[0].done(function(response) {\n // We have the data now update the UI.\n var resourcename = $(coursecell).text();\n var context = {\n resourcename: resourcename,\n restoreurl: response.restoreurl,\n time: timevalue\n };\n\n Templates.render('core/async_restore_progress_row', context).then(function(html, js) {\n Templates.replaceNodeContents(tablerow, html, js);\n return;\n }).fail(function() {\n notification.exception(new Error('Failed to load table row'));\n return;\n });\n });\n }\n\n /**\n * Update copy table row when an course copy completes.\n *\n * @param {string} backupid The id to match elements on.\n */\n function updateCopyTableRow(backupid) {\n var elementbar = document.querySelectorAll(\"[data-restoreid=\" + CSS.escape(backupid) + \"]\")[0];\n var restorecourse = elementbar.closest('tr').children[1];\n var coursename = restorecourse.innerHTML;\n var courselink = document.createElement('a');\n var elementbarparent = elementbar.closest('td');\n var operation = elementbarparent.previousElementSibling;\n\n // Replace the prgress bar.\n Str.get_string('complete').then(function(content) {\n operation.innerHTML = content;\n return;\n }).catch(function() {\n notification.exception(new Error('Failed to load string: complete'));\n return;\n });\n\n Templates.render('core/async_copy_complete_cell', {}).then(function(html, js) {\n Templates.replaceNodeContents(elementbarparent, html, js);\n return;\n }).fail(function() {\n notification.exception(new Error('Failed to load table cell'));\n return;\n });\n\n // Update the destination course name to a link to that course.\n ajax.call([{\n methodname: 'core_backup_get_async_backup_links_restore',\n args: {\n 'backupid': backupid,\n 'contextid': 0\n },\n }])[0].done(function(response) {\n courselink.setAttribute('href', response.restoreurl);\n courselink.innerHTML = coursename;\n restorecourse.innerHTML = null;\n restorecourse.appendChild(courselink);\n\n return;\n }).fail(function() {\n notification.exception(new Error('Failed to update table row'));\n return;\n });\n }\n\n /**\n * Update the Moodle user interface with the progress of\n * the backup process.\n *\n * @param {object} progress The progress and status of the process.\n */\n function updateProgress(progress) {\n var percentage = progress.progress * 100;\n var type = 'backup';\n var elementbar = document.querySelectorAll(\"[data-\" + type + \"id=\" + CSS.escape(backupid) + \"]\")[0];\n var elementstatus = $('#' + backupid + '_status');\n var elementdetail = $('#' + backupid + '_detail');\n var elementbutton = $('#' + backupid + '_button');\n var stringRequests;\n\n if (progress.status == STATUS_EXECUTING) {\n // Process is in progress.\n // Add in progress class color to bar.\n elementbar.classList.add('bg-success');\n\n updateElement(backupid, type, percentage);\n\n // Change heading.\n var strProcessing = 'async' + typeid + 'processing';\n Str.get_string(strProcessing, 'backup').then(function(title) {\n elementstatus.text(title);\n return;\n }).catch(function() {\n notification.exception(new Error('Failed to load string: backup ' + strProcessing));\n });\n\n } else if (progress.status == STATUS_FINISHED_ERR) {\n // Process completed with error.\n\n // Add in fail class color to bar.\n elementbar.classList.add('bg-danger');\n\n // Remove in progress class color to bar.\n elementbar.classList.remove('bg-success');\n\n updateElement(backupid, type, 100);\n\n // Change heading and text.\n var strStatus = 'async' + typeid + 'error';\n var strStatusDetail = 'async' + typeid + 'errordetail';\n stringRequests = [\n {key: strStatus, component: 'backup'},\n {key: strStatusDetail, component: 'backup'}\n ];\n Str.get_strings(stringRequests).then(function(strings) {\n elementstatus.text(strings[0]);\n elementdetail.text(strings[1]);\n\n return;\n })\n .catch(function() {\n notification.exception(new Error('Failed to load string'));\n return;\n });\n\n $('.backup_progress').children('span').removeClass('backup_stage_current');\n $('.backup_progress').children('span').last().addClass('backup_stage_current');\n\n // Stop checking when we either have an error or a completion.\n clearInterval(backupintervalid);\n\n } else if (progress.status == STATUS_FINISHED_OK) {\n // Process completed successfully.\n\n // Add in progress class color to bar\n elementbar.classList.add('bg-success');\n\n updateElement(backupid, type, 100);\n\n // Change heading and text\n var strComplete = 'async' + typeid + 'complete';\n Str.get_string(strComplete, 'backup').then(function(title) {\n elementstatus.text(title);\n return;\n }).catch(function() {\n notification.exception(new Error('Failed to load string: backup ' + strComplete));\n });\n\n if (typeid == 'restore') {\n ajax.call([{\n // Get the table data via webservice.\n methodname: 'core_backup_get_async_backup_links_restore',\n args: {\n 'backupid': backupid,\n 'contextid': contextid\n },\n }])[0].done(function(response) {\n var strDetail = 'async' + typeid + 'completedetail';\n var strButton = 'async' + typeid + 'completebutton';\n var stringRequests = [\n {key: strDetail, component: 'backup', param: response.restoreurl},\n {key: strButton, component: 'backup'}\n ];\n Str.get_strings(stringRequests).then(function(strings) {\n elementdetail.html(strings[0]);\n elementbutton.text(strings[1]);\n elementbutton.attr('href', response.restoreurl);\n\n return;\n })\n .catch(function() {\n notification.exception(new Error('Failed to load string'));\n return;\n });\n\n });\n } else {\n var strDetail = 'async' + typeid + 'completedetail';\n var strButton = 'async' + typeid + 'completebutton';\n stringRequests = [\n {key: strDetail, component: 'backup', param: restoreurl},\n {key: strButton, component: 'backup'}\n ];\n Str.get_strings(stringRequests).then(function(strings) {\n elementdetail.html(strings[0]);\n elementbutton.text(strings[1]);\n elementbutton.attr('href', restoreurl);\n\n return;\n })\n .catch(function() {\n notification.exception(new Error('Failed to load string'));\n return;\n });\n\n }\n\n $('.backup_progress').children('span').removeClass('backup_stage_current');\n $('.backup_progress').children('span').last().addClass('backup_stage_current');\n\n // Stop checking when we either have an error or a completion.\n clearInterval(backupintervalid);\n }\n }\n\n /**\n * Update the Moodle user interface with the progress of\n * all the pending processes for backup and restore operations.\n *\n * @param {object} progress The progress and status of the process.\n */\n function updateProgressAll(progress) {\n progress.forEach(function(element) {\n var percentage = element.progress * 100;\n var backupid = element.backupid;\n var type = element.operation;\n var elementbar = document.querySelectorAll(\"[data-\" + type + \"id=\" + CSS.escape(backupid) + \"]\")[0];\n\n if (element.status == STATUS_EXECUTING) {\n // Process is in element.\n\n // Add in element class color to bar\n elementbar.classList.add('bg-success');\n\n updateElement(backupid, type, percentage);\n\n } else if (element.status == STATUS_FINISHED_ERR) {\n // Process completed with error.\n\n // Add in fail class color to bar\n elementbar.classList.add('bg-danger');\n elementbar.classList.add('complete');\n\n // Remove in element class color to bar\n elementbar.classList.remove('bg-success');\n\n updateElement(backupid, type, 100);\n\n } else if (element.status == STATUS_FINISHED_OK) {\n // Process completed successfully.\n\n // Add in element class color to bar\n elementbar.classList.add('bg-success');\n elementbar.classList.add('complete');\n\n updateElement(backupid, type, 100);\n\n // We have a successful backup. Update the UI with download and file details.\n if (type == 'backup') {\n updateBackupTableRow(backupid);\n } else {\n updateRestoreTableRow(backupid);\n }\n\n }\n\n });\n }\n\n /**\n * Update the Moodle user interface with the progress of\n * all the pending processes for copy operations.\n *\n * @param {object} progress The progress and status of the process.\n */\n function updateProgressCopy(progress) {\n progress.forEach(function(element) {\n var percentage = element.progress * 100;\n var backupid = element.backupid;\n var type = element.operation;\n var elementbar = document.querySelectorAll(\"[data-\" + type + \"id=\" + CSS.escape(backupid) + \"]\")[0];\n\n if (type == 'restore') {\n let restorecell = elementbar.closest('tr').children[3];\n Str.get_string('restore').then(function(content) {\n restorecell.innerHTML = content;\n return;\n }).catch(function() {\n notification.exception(new Error('Failed to load string: restore'));\n });\n }\n\n if (element.status == STATUS_EXECUTING) {\n // Process is in element.\n\n // Add in element class color to bar\n elementbar.classList.add('bg-success');\n\n updateElement(backupid, type, percentage);\n\n } else if (element.status == STATUS_FINISHED_ERR) {\n // Process completed with error.\n\n // Add in fail class color to bar\n elementbar.classList.add('bg-danger');\n elementbar.classList.add('complete');\n\n // Remove in element class color to bar\n elementbar.classList.remove('bg-success');\n\n updateElement(backupid, type, 100);\n\n } else if ((element.status == STATUS_FINISHED_OK) && (type == 'restore')) {\n // Process completed successfully.\n\n // Add in element class color to bar\n elementbar.classList.add('bg-success');\n elementbar.classList.add('complete');\n\n updateElement(backupid, type, 100);\n\n // We have a successful copy. Update the UI link to copied course.\n updateCopyTableRow(backupid);\n }\n\n });\n }\n\n /**\n * Get the progress of the backup process via ajax.\n */\n function getBackupProgress() {\n ajax.call([{\n // Get the backup progress via webservice.\n methodname: 'core_backup_get_async_backup_progress',\n args: {\n 'backupids': [backupid],\n 'contextid': contextid\n },\n }], true, true, false, timeout)[0].done(function(response) {\n // We have the progress now update the UI.\n updateProgress(response[0]);\n checkdelay = checkdelayoriginal;\n backupintervalid = updateInterval(backupintervalid, getBackupProgress, checkdelayoriginal);\n }).fail(function() {\n checkdelay = checkdelay * checkdelaymultipler;\n backupintervalid = updateInterval(backupintervalid, getBackupProgress, checkdelay);\n });\n }\n\n /**\n * Get the progress of all backup processes via ajax.\n */\n function getAllBackupProgress() {\n var backupids = [];\n var progressbars = $('.progress').find('.progress-bar').not('.complete');\n\n progressbars.each(function() {\n backupids.push((this.id).substring(0, 32));\n });\n\n if (backupids.length > 0) {\n ajax.call([{\n // Get the backup progress via webservice.\n methodname: 'core_backup_get_async_backup_progress',\n args: {\n 'backupids': backupids,\n 'contextid': contextid\n },\n }], true, true, false, timeout)[0].done(function(response) {\n updateProgressAll(response);\n checkdelay = checkdelayoriginal;\n allbackupintervalid = updateInterval(allbackupintervalid, getAllBackupProgress, checkdelayoriginal);\n }).fail(function() {\n checkdelay = checkdelay * checkdelaymultipler;\n allbackupintervalid = updateInterval(allbackupintervalid, getAllBackupProgress, checkdelay);\n });\n } else {\n clearInterval(allbackupintervalid); // No more progress bars to update, stop checking.\n }\n }\n\n /**\n * Get the progress of all copy processes via ajax.\n */\n function getAllCopyProgress() {\n var copyids = [];\n var progressbars = $('.progress').find('.progress-bar[data-operation][data-backupid][data-restoreid]').not('.complete');\n\n progressbars.each(function() {\n let progressvars = {\n 'backupid': this.dataset.backupid,\n 'restoreid': this.dataset.restoreid,\n 'operation': this.dataset.operation,\n };\n copyids.push(progressvars);\n });\n\n if (copyids.length > 0) {\n ajax.call([{\n // Get the copy progress via webservice.\n methodname: 'core_backup_get_copy_progress',\n args: {\n 'copies': copyids\n },\n }], true, true, false, timeout)[0].done(function(response) {\n updateProgressCopy(response);\n checkdelay = checkdelayoriginal;\n allcopyintervalid = updateInterval(allcopyintervalid, getAllCopyProgress, checkdelayoriginal);\n }).fail(function() {\n checkdelay = checkdelay * checkdelaymultipler;\n allcopyintervalid = updateInterval(allcopyintervalid, getAllCopyProgress, checkdelay);\n });\n } else {\n clearInterval(allcopyintervalid); // No more progress bars to update, stop checking.\n }\n }\n\n /**\n * Get status updates for all backups.\n *\n * @public\n * @param {number} context The context id.\n */\n Asyncbackup.asyncBackupAllStatus = function(context) {\n contextid = context;\n allbackupintervalid = setInterval(getAllBackupProgress, checkdelay);\n };\n\n /**\n * Get status updates for all course copies.\n *\n * @public\n */\n Asyncbackup.asyncCopyAllStatus = function() {\n allcopyintervalid = setInterval(getAllCopyProgress, checkdelay);\n };\n\n /**\n * Get status updates for backup.\n *\n * @public\n * @param {string} backup The backup record id.\n * @param {number} context The context id.\n * @param {string} restore The restore link.\n * @param {string} type The operation type (backup or restore).\n */\n Asyncbackup.asyncBackupStatus = function(backup, context, restore, type) {\n backupid = backup;\n contextid = context;\n restoreurl = restore;\n\n if (type == 'backup') {\n typeid = 'backup';\n } else {\n typeid = 'restore';\n }\n\n // Remove the links from the progress bar, no going back now.\n $('.backup_progress').children('a').removeAttr('href');\n\n // Periodically check for progress updates and update the UI as required.\n backupintervalid = setInterval(getBackupProgress, checkdelay);\n\n };\n\n return Asyncbackup;\n});\n"],"file":"async_backup.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/async_backup.js"],"names":["define","$","ajax","Str","notification","Templates","STATUS_FINISHED_ERR","STATUS_FINISHED_OK","Asyncbackup","checkdelayoriginal","checkdelay","checkdelaymultipler","backupid","contextid","restoreurl","typeid","backupintervalid","allbackupintervalid","allcopyintervalid","timeout","updateElement","type","percentage","percentagewidth","Math","round","elementbar","document","querySelectorAll","CSS","escape","percentagetext","toFixed","setAttribute","style","width","innerHTML","updateInterval","intervalid","callback","value","clearInterval","setInterval","updateBackupTableRow","statuscell","parent","tablerow","cellsiblings","siblings","timecell","timevalue","text","filenamecell","filename","call","methodname","args","done","response","context","time","size","filesize","fileurl","render","then","html","js","replaceNodeContents","fail","exception","Error","updateRestoreTableRow","coursecell","resourcename","updateCopyTableRow","restorecourse","closest","children","coursename","courselink","createElement","elementbarparent","operation","previousElementSibling","get_string","content","catch","appendChild","updateProgress","progress","elementstatus","elementdetail","elementbutton","stringRequests","status","classList","add","strProcessing","title","remove","strStatus","strStatusDetail","key","component","get_strings","strings","removeClass","last","addClass","strComplete","strDetail","strButton","param","attr","updateProgressAll","forEach","element","updateProgressCopy","restorecell","getBackupProgress","getAllBackupProgress","backupids","progressbars","find","not","each","push","id","substring","length","getAllCopyProgress","copyids","progressvars","dataset","restoreid","asyncBackupAllStatus","asyncCopyAllStatus","asyncBackupStatus","backup","restore","removeAttr"],"mappings":"AAwBAA,OAAM,4BAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,UAAxB,CAAoC,mBAApC,CAAyD,gBAAzD,CAAD,CACE,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAuBC,CAAvB,CAAqCC,CAArC,CAAgD,IAQhDC,CAAAA,CAAmB,CAAG,GAR0B,CAShDC,CAAkB,CAAG,GAT2B,CAchDC,CAAW,CAAG,EAdkC,CAehDC,CAAkB,CAAG,IAf2B,CAgBhDC,CAAU,CAAG,IAhBmC,CAiBhDC,CAAmB,CAAG,GAjB0B,CAkBhDC,CAlBgD,CAmBhDC,CAnBgD,CAoBhDC,CApBgD,CAqBhDC,CArBgD,CAsBhDC,CAtBgD,CAuBhDC,CAvBgD,CAwBhDC,CAxB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AAmC,SAAS7E,CAAT,CAAkB,CACjD9C,CAAS,CAAG8C,CAAZ,CACA1C,CAAmB,CAAGyB,WAAW,CAAC+E,CAAD,CAAuB/G,CAAvB,CACpC,CAHD,CAUAF,CAAW,CAACiI,kBAAZ,CAAiC,UAAW,CACxCvH,CAAiB,CAAGwB,WAAW,CAACyF,CAAD,CAAqBzH,CAArB,CAClC,CAFD,CAaAF,CAAW,CAACkI,iBAAZ,CAAgC,SAASC,CAAT,CAAiBhF,CAAjB,CAA0BiF,CAA1B,CAAmCvH,CAAnC,CAAyC,CACrET,CAAQ,CAAG+H,CAAX,CACA9H,CAAS,CAAG8C,CAAZ,CACA7C,CAAU,CAAG8H,CAAb,CAEA,GAAY,QAAR,EAAAvH,CAAJ,CAAsB,CAClBN,CAAM,CAAG,QACZ,CAFD,IAEO,CACHA,CAAM,CAAG,SACZ,CAGDd,CAAC,CAAC,kBAAD,CAAD,CAAsB6E,QAAtB,CAA+B,GAA/B,EAAoC+D,UAApC,CAA+C,MAA/C,EAGA7H,CAAgB,CAAG0B,WAAW,CAAC8E,CAAD,CAAoB9G,CAApB,CAE/B,CAjBH,CAmBE,MAAOF,CAAAA,CACZ,CArkBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * This module updates the UI during an asynchronous\n * backup or restore process.\n *\n * @module core_backup/async_backup\n * @copyright 2018 Matt Porritt \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.7\n */\ndefine(['jquery', 'core/ajax', 'core/str', 'core/notification', 'core/templates'],\n function($, ajax, Str, notification, Templates) {\n\n /**\n * Module level constants.\n *\n * Using var instead of const as ES6 isn't fully supported yet.\n */\n var STATUS_EXECUTING = 800;\n var STATUS_FINISHED_ERR = 900;\n var STATUS_FINISHED_OK = 1000;\n\n /**\n * Module level variables.\n */\n var Asyncbackup = {};\n var checkdelayoriginal = 15000; // This is the default time to use.\n var checkdelay = 15000; // How often we should check for progress updates.\n var checkdelaymultipler = 1.5; // If a request fails this multiplier will be used to increase the checkdelay value\n var backupid; // The backup id to get the progress for.\n var contextid; // The course this backup progress is for.\n var restoreurl; // The URL to view course restores.\n var typeid; // The type of operation backup or restore.\n var backupintervalid; // The id of the setInterval function.\n var allbackupintervalid; // The id of the setInterval function.\n var allcopyintervalid; // The id of the setInterval function.\n var timeout = 2000; // Timeout for ajax requests.\n\n /**\n * Helper function to update UI components.\n *\n * @param {string} backupid The id to match elements on.\n * @param {string} type The type of operation, backup or restore.\n * @param {number} percentage The completion percentage to apply.\n */\n function updateElement(backupid, type, percentage) {\n var percentagewidth = Math.round(percentage) + '%';\n var elementbar = document.querySelectorAll(\"[data-\" + type + \"id=\" + CSS.escape(backupid) + \"]\")[0];\n var percentagetext = percentage.toFixed(2) + '%';\n\n // Set progress bar percentage indicators\n elementbar.setAttribute('aria-valuenow', percentagewidth);\n elementbar.style.width = percentagewidth;\n elementbar.innerHTML = percentagetext;\n }\n\n /**\n * Updates the interval we use to check for backup progress.\n *\n * @param {Number} intervalid The id of the interval\n * @param {Function} callback The function to use in setInterval\n * @param {Number} value The specified interval (in milliseconds)\n * @returns {Number}\n */\n function updateInterval(intervalid, callback, value) {\n clearInterval(intervalid);\n return setInterval(callback, value);\n }\n\n /**\n * Update backup table row when an async backup completes.\n *\n * @param {string} backupid The id to match elements on.\n */\n function updateBackupTableRow(backupid) {\n var statuscell = $('#' + backupid + '_bar').parent().parent();\n var tablerow = statuscell.parent();\n var cellsiblings = statuscell.siblings();\n var timecell = cellsiblings[1];\n var timevalue = $(timecell).text();\n var filenamecell = cellsiblings[0];\n var filename = $(filenamecell).text();\n\n ajax.call([{\n // Get the table data via webservice.\n methodname: 'core_backup_get_async_backup_links_backup',\n args: {\n 'filename': filename,\n 'contextid': contextid\n },\n }])[0].done(function(response) {\n // We have the data now update the UI.\n var context = {\n filename: filename,\n time: timevalue,\n size: response.filesize,\n fileurl: response.fileurl,\n restoreurl: response.restoreurl\n };\n\n Templates.render('core/async_backup_progress_row', context).then(function(html, js) {\n Templates.replaceNodeContents(tablerow, html, js);\n return;\n }).fail(function() {\n notification.exception(new Error('Failed to load table row'));\n return;\n });\n });\n }\n\n /**\n * Update restore table row when an async restore completes.\n *\n * @param {string} backupid The id to match elements on.\n */\n function updateRestoreTableRow(backupid) {\n var statuscell = $('#' + backupid + '_bar').parent().parent();\n var tablerow = statuscell.parent();\n var cellsiblings = statuscell.siblings();\n var coursecell = cellsiblings[0];\n var timecell = cellsiblings[1];\n var timevalue = $(timecell).text();\n\n ajax.call([{\n // Get the table data via webservice.\n methodname: 'core_backup_get_async_backup_links_restore',\n args: {\n 'backupid': backupid,\n 'contextid': contextid\n },\n }])[0].done(function(response) {\n // We have the data now update the UI.\n var resourcename = $(coursecell).text();\n var context = {\n resourcename: resourcename,\n restoreurl: response.restoreurl,\n time: timevalue\n };\n\n Templates.render('core/async_restore_progress_row', context).then(function(html, js) {\n Templates.replaceNodeContents(tablerow, html, js);\n return;\n }).fail(function() {\n notification.exception(new Error('Failed to load table row'));\n return;\n });\n });\n }\n\n /**\n * Update copy table row when an course copy completes.\n *\n * @param {string} backupid The id to match elements on.\n */\n function updateCopyTableRow(backupid) {\n var elementbar = document.querySelectorAll(\"[data-restoreid=\" + CSS.escape(backupid) + \"]\")[0];\n var restorecourse = elementbar.closest('tr').children[1];\n var coursename = restorecourse.innerHTML;\n var courselink = document.createElement('a');\n var elementbarparent = elementbar.closest('td');\n var operation = elementbarparent.previousElementSibling;\n\n // Replace the prgress bar.\n Str.get_string('complete').then(function(content) {\n operation.innerHTML = content;\n return;\n }).catch(function() {\n notification.exception(new Error('Failed to load string: complete'));\n return;\n });\n\n Templates.render('core/async_copy_complete_cell', {}).then(function(html, js) {\n Templates.replaceNodeContents(elementbarparent, html, js);\n return;\n }).fail(function() {\n notification.exception(new Error('Failed to load table cell'));\n return;\n });\n\n // Update the destination course name to a link to that course.\n ajax.call([{\n methodname: 'core_backup_get_async_backup_links_restore',\n args: {\n 'backupid': backupid,\n 'contextid': 0\n },\n }])[0].done(function(response) {\n courselink.setAttribute('href', response.restoreurl);\n courselink.innerHTML = coursename;\n restorecourse.innerHTML = null;\n restorecourse.appendChild(courselink);\n\n return;\n }).fail(function() {\n notification.exception(new Error('Failed to update table row'));\n return;\n });\n }\n\n /**\n * Update the Moodle user interface with the progress of\n * the backup process.\n *\n * @param {object} progress The progress and status of the process.\n */\n function updateProgress(progress) {\n var percentage = progress.progress * 100;\n var type = 'backup';\n var elementbar = document.querySelectorAll(\"[data-\" + type + \"id=\" + CSS.escape(backupid) + \"]\")[0];\n var elementstatus = $('#' + backupid + '_status');\n var elementdetail = $('#' + backupid + '_detail');\n var elementbutton = $('#' + backupid + '_button');\n var stringRequests;\n\n if (progress.status == STATUS_EXECUTING) {\n // Process is in progress.\n // Add in progress class color to bar.\n elementbar.classList.add('bg-success');\n\n updateElement(backupid, type, percentage);\n\n // Change heading.\n var strProcessing = 'async' + typeid + 'processing';\n Str.get_string(strProcessing, 'backup').then(function(title) {\n elementstatus.text(title);\n return;\n }).catch(function() {\n notification.exception(new Error('Failed to load string: backup ' + strProcessing));\n });\n\n } else if (progress.status == STATUS_FINISHED_ERR) {\n // Process completed with error.\n\n // Add in fail class color to bar.\n elementbar.classList.add('bg-danger');\n\n // Remove in progress class color to bar.\n elementbar.classList.remove('bg-success');\n\n updateElement(backupid, type, 100);\n\n // Change heading and text.\n var strStatus = 'async' + typeid + 'error';\n var strStatusDetail = 'async' + typeid + 'errordetail';\n stringRequests = [\n {key: strStatus, component: 'backup'},\n {key: strStatusDetail, component: 'backup'}\n ];\n Str.get_strings(stringRequests).then(function(strings) {\n elementstatus.text(strings[0]);\n elementdetail.text(strings[1]);\n\n return;\n })\n .catch(function() {\n notification.exception(new Error('Failed to load string'));\n return;\n });\n\n $('.backup_progress').children('span').removeClass('backup_stage_current');\n $('.backup_progress').children('span').last().addClass('backup_stage_current');\n\n // Stop checking when we either have an error or a completion.\n clearInterval(backupintervalid);\n\n } else if (progress.status == STATUS_FINISHED_OK) {\n // Process completed successfully.\n\n // Add in progress class color to bar\n elementbar.classList.add('bg-success');\n\n updateElement(backupid, type, 100);\n\n // Change heading and text\n var strComplete = 'async' + typeid + 'complete';\n Str.get_string(strComplete, 'backup').then(function(title) {\n elementstatus.text(title);\n return;\n }).catch(function() {\n notification.exception(new Error('Failed to load string: backup ' + strComplete));\n });\n\n if (typeid == 'restore') {\n ajax.call([{\n // Get the table data via webservice.\n methodname: 'core_backup_get_async_backup_links_restore',\n args: {\n 'backupid': backupid,\n 'contextid': contextid\n },\n }])[0].done(function(response) {\n var strDetail = 'async' + typeid + 'completedetail';\n var strButton = 'async' + typeid + 'completebutton';\n var stringRequests = [\n {key: strDetail, component: 'backup', param: response.restoreurl},\n {key: strButton, component: 'backup'}\n ];\n Str.get_strings(stringRequests).then(function(strings) {\n elementdetail.html(strings[0]);\n elementbutton.text(strings[1]);\n elementbutton.attr('href', response.restoreurl);\n\n return;\n })\n .catch(function() {\n notification.exception(new Error('Failed to load string'));\n return;\n });\n\n });\n } else {\n var strDetail = 'async' + typeid + 'completedetail';\n var strButton = 'async' + typeid + 'completebutton';\n stringRequests = [\n {key: strDetail, component: 'backup', param: restoreurl},\n {key: strButton, component: 'backup'}\n ];\n Str.get_strings(stringRequests).then(function(strings) {\n elementdetail.html(strings[0]);\n elementbutton.text(strings[1]);\n elementbutton.attr('href', restoreurl);\n\n return;\n })\n .catch(function() {\n notification.exception(new Error('Failed to load string'));\n return;\n });\n\n }\n\n $('.backup_progress').children('span').removeClass('backup_stage_current');\n $('.backup_progress').children('span').last().addClass('backup_stage_current');\n\n // Stop checking when we either have an error or a completion.\n clearInterval(backupintervalid);\n }\n }\n\n /**\n * Update the Moodle user interface with the progress of\n * all the pending processes for backup and restore operations.\n *\n * @param {object} progress The progress and status of the process.\n */\n function updateProgressAll(progress) {\n progress.forEach(function(element) {\n var percentage = element.progress * 100;\n var backupid = element.backupid;\n var type = element.operation;\n var elementbar = document.querySelectorAll(\"[data-\" + type + \"id=\" + CSS.escape(backupid) + \"]\")[0];\n\n if (element.status == STATUS_EXECUTING) {\n // Process is in element.\n\n // Add in element class color to bar\n elementbar.classList.add('bg-success');\n\n updateElement(backupid, type, percentage);\n\n } else if (element.status == STATUS_FINISHED_ERR) {\n // Process completed with error.\n\n // Add in fail class color to bar\n elementbar.classList.add('bg-danger');\n elementbar.classList.add('complete');\n\n // Remove in element class color to bar\n elementbar.classList.remove('bg-success');\n\n updateElement(backupid, type, 100);\n\n } else if (element.status == STATUS_FINISHED_OK) {\n // Process completed successfully.\n\n // Add in element class color to bar\n elementbar.classList.add('bg-success');\n elementbar.classList.add('complete');\n\n updateElement(backupid, type, 100);\n\n // We have a successful backup. Update the UI with download and file details.\n if (type == 'backup') {\n updateBackupTableRow(backupid);\n } else {\n updateRestoreTableRow(backupid);\n }\n\n }\n\n });\n }\n\n /**\n * Update the Moodle user interface with the progress of\n * all the pending processes for copy operations.\n *\n * @param {object} progress The progress and status of the process.\n */\n function updateProgressCopy(progress) {\n progress.forEach(function(element) {\n var percentage = element.progress * 100;\n var backupid = element.backupid;\n var type = element.operation;\n var elementbar = document.querySelectorAll(\"[data-\" + type + \"id=\" + CSS.escape(backupid) + \"]\")[0];\n\n if (type == 'restore') {\n let restorecell = elementbar.closest('tr').children[3];\n Str.get_string('restore').then(function(content) {\n restorecell.innerHTML = content;\n return;\n }).catch(function() {\n notification.exception(new Error('Failed to load string: restore'));\n });\n }\n\n if (element.status == STATUS_EXECUTING) {\n // Process is in element.\n\n // Add in element class color to bar\n elementbar.classList.add('bg-success');\n\n updateElement(backupid, type, percentage);\n\n } else if (element.status == STATUS_FINISHED_ERR) {\n // Process completed with error.\n\n // Add in fail class color to bar\n elementbar.classList.add('bg-danger');\n elementbar.classList.add('complete');\n\n // Remove in element class color to bar\n elementbar.classList.remove('bg-success');\n\n updateElement(backupid, type, 100);\n\n } else if ((element.status == STATUS_FINISHED_OK) && (type == 'restore')) {\n // Process completed successfully.\n\n // Add in element class color to bar\n elementbar.classList.add('bg-success');\n elementbar.classList.add('complete');\n\n updateElement(backupid, type, 100);\n\n // We have a successful copy. Update the UI link to copied course.\n updateCopyTableRow(backupid);\n }\n\n });\n }\n\n /**\n * Get the progress of the backup process via ajax.\n */\n function getBackupProgress() {\n ajax.call([{\n // Get the backup progress via webservice.\n methodname: 'core_backup_get_async_backup_progress',\n args: {\n 'backupids': [backupid],\n 'contextid': contextid\n },\n }], true, true, false, timeout)[0].done(function(response) {\n // We have the progress now update the UI.\n updateProgress(response[0]);\n checkdelay = checkdelayoriginal;\n backupintervalid = updateInterval(backupintervalid, getBackupProgress, checkdelayoriginal);\n }).fail(function() {\n checkdelay = checkdelay * checkdelaymultipler;\n backupintervalid = updateInterval(backupintervalid, getBackupProgress, checkdelay);\n });\n }\n\n /**\n * Get the progress of all backup processes via ajax.\n */\n function getAllBackupProgress() {\n var backupids = [];\n var progressbars = $('.progress').find('.progress-bar').not('.complete');\n\n progressbars.each(function() {\n backupids.push((this.id).substring(0, 32));\n });\n\n if (backupids.length > 0) {\n ajax.call([{\n // Get the backup progress via webservice.\n methodname: 'core_backup_get_async_backup_progress',\n args: {\n 'backupids': backupids,\n 'contextid': contextid\n },\n }], true, true, false, timeout)[0].done(function(response) {\n updateProgressAll(response);\n checkdelay = checkdelayoriginal;\n allbackupintervalid = updateInterval(allbackupintervalid, getAllBackupProgress, checkdelayoriginal);\n }).fail(function() {\n checkdelay = checkdelay * checkdelaymultipler;\n allbackupintervalid = updateInterval(allbackupintervalid, getAllBackupProgress, checkdelay);\n });\n } else {\n clearInterval(allbackupintervalid); // No more progress bars to update, stop checking.\n }\n }\n\n /**\n * Get the progress of all copy processes via ajax.\n */\n function getAllCopyProgress() {\n var copyids = [];\n var progressbars = $('.progress').find('.progress-bar[data-operation][data-backupid][data-restoreid]').not('.complete');\n\n progressbars.each(function() {\n let progressvars = {\n 'backupid': this.dataset.backupid,\n 'restoreid': this.dataset.restoreid,\n 'operation': this.dataset.operation,\n };\n copyids.push(progressvars);\n });\n\n if (copyids.length > 0) {\n ajax.call([{\n // Get the copy progress via webservice.\n methodname: 'core_backup_get_copy_progress',\n args: {\n 'copies': copyids\n },\n }], true, true, false, timeout)[0].done(function(response) {\n updateProgressCopy(response);\n checkdelay = checkdelayoriginal;\n allcopyintervalid = updateInterval(allcopyintervalid, getAllCopyProgress, checkdelayoriginal);\n }).fail(function() {\n checkdelay = checkdelay * checkdelaymultipler;\n allcopyintervalid = updateInterval(allcopyintervalid, getAllCopyProgress, checkdelay);\n });\n } else {\n clearInterval(allcopyintervalid); // No more progress bars to update, stop checking.\n }\n }\n\n /**\n * Get status updates for all backups.\n *\n * @public\n * @param {number} context The context id.\n */\n Asyncbackup.asyncBackupAllStatus = function(context) {\n contextid = context;\n allbackupintervalid = setInterval(getAllBackupProgress, checkdelay);\n };\n\n /**\n * Get status updates for all course copies.\n *\n * @public\n */\n Asyncbackup.asyncCopyAllStatus = function() {\n allcopyintervalid = setInterval(getAllCopyProgress, checkdelay);\n };\n\n /**\n * Get status updates for backup.\n *\n * @public\n * @param {string} backup The backup record id.\n * @param {number} context The context id.\n * @param {string} restore The restore link.\n * @param {string} type The operation type (backup or restore).\n */\n Asyncbackup.asyncBackupStatus = function(backup, context, restore, type) {\n backupid = backup;\n contextid = context;\n restoreurl = restore;\n\n if (type == 'backup') {\n typeid = 'backup';\n } else {\n typeid = 'restore';\n }\n\n // Remove the links from the progress bar, no going back now.\n $('.backup_progress').children('a').removeAttr('href');\n\n // Periodically check for progress updates and update the UI as required.\n backupintervalid = setInterval(getBackupProgress, checkdelay);\n\n };\n\n return Asyncbackup;\n});\n"],"file":"async_backup.min.js"} \ No newline at end of file diff --git a/backup/util/ui/amd/src/async_backup.js b/backup/util/ui/amd/src/async_backup.js index 9ec219cc31af7..f13390b0a5f76 100644 --- a/backup/util/ui/amd/src/async_backup.js +++ b/backup/util/ui/amd/src/async_backup.js @@ -17,7 +17,7 @@ * This module updates the UI during an asynchronous * backup or restore process. * - * @module backup/util/async_backup + * @module core_backup/async_backup * @copyright 2018 Matt Porritt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.7 diff --git a/blocks/accessreview/amd/build/module.min.js.map b/blocks/accessreview/amd/build/module.min.js.map index 39717248cd4c9..e1e6084fc0778 100644 --- a/blocks/accessreview/amd/build/module.min.js.map +++ b/blocks/accessreview/amd/build/module.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/module.js"],"names":["toggleState","renderTemplate","element","errorCount","checkCount","displayFormat","minViews","viewDelta","weight","parseInt","context","resultPassed","classList","passRate","failureRate","Math","round","Promise","resolve","elementClassList","push","showIcons","showBackground","add","join","Templates","renderForPromise","then","html","js","appendNodeContents","catch","showAccessMap","courseId","updatePreference","all","fetchReviewData","sectionData","moduleData","getErrorTotals","forEach","section","document","querySelector","numerrors","numchecks","module","getElementById","cmid","remove","displayError","hideAccessMap","querySelectorAll","node","setToggleStatePreference","toggleAccessMap","totals","totalErrors","totalUsers","maxViews","concat","item","registerEventListeners","addEventListener","e","target","closest","preventDefault","getTogglePreferenceParams","methodname","args","preferences","type","value","courseid","calls","init","toggled"],"mappings":"keAuBA,O,qgDAaIA,CAAAA,CAAW,G,CAYTC,CAAc,CAAG,SAACC,CAAD,CAAUC,CAAV,CAAsBC,CAAtB,CAAkCC,CAAlC,CAAiDC,CAAjD,CAA2DC,CAA3D,CAAyE,IAEtFC,CAAAA,CAAM,CAAGC,QAAQ,CAAC,CAACN,CAAU,CAAGG,CAAd,EAA0BC,CAA1B,EAAD,CAFqE,CAItFG,CAAO,CAAG,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AAD,CADX,CAFH,CASV,C,CAEKsD,CAAwB,CAAG,SAAAtD,CAAW,QAAI,WAAU,CAACoE,CAAyB,CAACpE,CAAD,CAA1B,CAAV,CAAJ,C,CAStCoC,CAAe,CAAG,SAACsC,CAAD,CAAwC,IAA7BxC,CAAAA,CAA6B,2DACtDyC,CAAK,CAAG,CACV,CACIN,UAAU,CAAE,qCADhB,CAEIC,IAAI,CAAE,CAACI,QAAQ,CAARA,CAAD,CAFV,CADU,CAKV,CACIL,UAAU,CAAE,oCADhB,CAEIC,IAAI,CAAE,CAACI,QAAQ,CAARA,CAAD,CAFV,CALU,CAD8C,CAY5D,GAAIxC,CAAJ,CAAsB,CAClByC,CAAK,CAACvD,IAAN,CAAWgD,CAAyB,IAApC,CACH,CAED,MAAO,WAAUO,CAAV,CACV,C,CASYC,CAAI,CAAG,SAACC,CAAD,CAAUxE,CAAV,CAAyB4B,CAAzB,CAAsC,CAEtDjC,CAAW,CAAc,CAAX,EAAA6E,CAAd,CAEA,GAAI7E,CAAJ,CAAiB,CACbgC,CAAa,CAACC,CAAD,CAAW5B,CAAX,CAChB,CAEDyD,CAAsB,CAAC7B,CAAD,CAAW5B,CAAX,CACzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n *\n * @author Max Larkin \n * @copyright 2020 Brickfield Education Labs \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {call as fetchMany} from 'core/ajax';\nimport * as Templates from 'core/templates';\nimport {exception as displayError} from 'core/notification';\n\n/**\n * The number of colours used to represent the heatmap. (Indexed on 0.)\n * @type {number}\n */\nconst numColours = 2;\n\n/**\n * The toggle state of the heatmap.\n * @type {boolean}\n */\nlet toggleState = true;\n\n/**\n * Renders the HTML template onto a particular HTML element.\n * @param {HTMLElement} element The element to attach the HTML to.\n * @param {number} errorCount The number of errors on this module/section.\n * @param {number} checkCount The number of checks triggered on this module/section.\n * @param {String} displayFormat\n * @param {Number} minViews\n * @param {Number} viewDelta\n * @returns {Promise}\n */\nconst renderTemplate = (element, errorCount, checkCount, displayFormat, minViews, viewDelta) => {\n // Calculate a weight?\n const weight = parseInt((errorCount - minViews) / viewDelta * numColours);\n\n const context = {\n resultPassed: !errorCount,\n classList: '',\n passRate: {\n errorCount,\n checkCount,\n failureRate: Math.round(errorCount / checkCount * 100),\n },\n };\n\n if (!element) {\n return Promise.resolve();\n }\n\n const elementClassList = ['block_accessreview'];\n if (context.resultPassed) {\n elementClassList.push('block_accessreview_success');\n } else if (weight) {\n elementClassList.push('block_accessreview_danger');\n } else {\n elementClassList.push('block_accessreview_warning');\n }\n\n const showIcons = (displayFormat == 'showicons') || (displayFormat == 'showboth');\n const showBackground = (displayFormat == 'showbackground') || (displayFormat == 'showboth');\n\n if (showBackground && !showIcons) {\n // Only the background is displayed.\n // No need to display the template.\n // Note: The case where both the background and icons are shown is handled later to avoid jankiness.\n element.classList.add(...elementClassList, 'alert');\n\n return Promise.resolve();\n }\n\n if (showIcons && !showBackground) {\n context.classList = elementClassList.join(' ');\n }\n\n // The icons are displayed either with, or without, the background.\n return Templates.renderForPromise('block_accessreview/status', context)\n .then(({html, js}) => {\n Templates.appendNodeContents(element, html, js);\n\n if (showBackground) {\n element.classList.add(...elementClassList, 'alert');\n }\n\n return;\n })\n .catch();\n};\n\n/**\n * Applies the template to all sections and modules on the course page.\n *\n * @param {Number} courseId\n * @param {String} displayFormat\n * @param {Boolean} updatePreference\n * @returns {Promise}\n */\nconst showAccessMap = (courseId, displayFormat, updatePreference = false) => {\n // Get error data.\n return Promise.all(fetchReviewData(courseId, updatePreference))\n .then(([sectionData, moduleData]) => {\n // Get total data.\n const {minViews, viewDelta} = getErrorTotals(sectionData, moduleData);\n\n sectionData.forEach(section => {\n const element = document.querySelector(`#section-${section.section} .summary`);\n if (!element) {\n return;\n }\n\n renderTemplate(element, section.numerrors, section.numchecks, displayFormat, minViews, viewDelta);\n });\n\n moduleData.forEach(module => {\n const element = document.getElementById(`module-${module.cmid}`);\n if (!element) {\n return;\n }\n\n renderTemplate(element, module.numerrors, module.numchecks, displayFormat, minViews, viewDelta);\n });\n\n // Change the icon display.\n document.querySelector('.icon-accessmap').classList.remove(...['fa-eye-slash']);\n document.querySelector('.icon-accessmap').classList.add(...['fa-eye']);\n\n return {\n sectionData,\n moduleData,\n };\n })\n .catch(displayError);\n};\n\n\n/**\n * Hides or removes the templates from the HTML of the current page.\n *\n * @param {Boolean} updatePreference\n */\nconst hideAccessMap = (updatePreference = false) => {\n // Removes the added elements.\n document.querySelectorAll('.block_accessreview_view').forEach(node => node.remove());\n\n const classList = [\n 'block_accessreview',\n 'block_accessreview_success',\n 'block_accessreview_warning',\n 'block_accessreview_danger',\n 'block_accessreview_view',\n 'alert',\n ];\n\n // Removes the added classes.\n document.querySelectorAll('.block_accessreview').forEach(node => node.classList.remove(...classList));\n\n if (updatePreference) {\n setToggleStatePreference(false);\n }\n\n // Change the icon display.\n document.querySelector('.icon-accessmap').classList.remove(...['fa-eye']);\n document.querySelector('.icon-accessmap').classList.add(...['fa-eye-slash']);\n};\n\n\n/**\n * Toggles the heatmap on/off.\n *\n * @param {Number} courseId\n * @param {String} displayFormat\n */\nconst toggleAccessMap = (courseId, displayFormat) => {\n toggleState = !toggleState;\n if (!toggleState) {\n hideAccessMap(true);\n } else {\n showAccessMap(courseId, displayFormat, true);\n }\n};\n\n/**\n * Parses information on the errors, generating the min, max and totals.\n *\n * @param {Object[]} sectionData The error data for course sections.\n * @param {Object[]} moduleData The error data for course modules.\n * @returns {Object} An object representing the extra error information.\n*/\nconst getErrorTotals = (sectionData, moduleData) => {\n const totals = {\n totalErrors: 0,\n totalUsers: 0,\n minViews: 0,\n maxViews: 0,\n viewDelta: 0,\n };\n\n [].concat(sectionData, moduleData).forEach(item => {\n totals.totalErrors += item.numerrors;\n if (item.numerrors < totals.minViews) {\n totals.minViews = item.numerrors;\n }\n\n if (item.numerrors > totals.maxViews) {\n totals.maxViews = item.numerrors;\n }\n totals.totalUsers += item.numchecks;\n });\n\n totals.viewDelta = totals.maxViews - totals.minViews + 1;\n\n return totals;\n};\n\nconst registerEventListeners = (courseId, displayFormat) => {\n document.addEventListener('click', e => {\n if (e.target.closest('#toggle-accessmap')) {\n e.preventDefault();\n toggleAccessMap(courseId, displayFormat);\n }\n });\n};\n\n/**\n * Set the user preference for the toggle value.\n *\n * @param {Boolean} toggleState\n * @returns {Promise}\n */\nconst getTogglePreferenceParams = toggleState => {\n return {\n methodname: 'core_user_update_user_preferences',\n args: {\n preferences: [{\n type: 'block_accessreviewtogglestate',\n value: toggleState,\n }],\n }\n };\n};\n\nconst setToggleStatePreference = toggleState => fetchMany([getTogglePreferenceParams(toggleState)]);\n\n/**\n * Fetch the review data.\n *\n * @param {Number} courseid\n * @param {Boolean} updatePreference\n * @returns {Promise[]}\n */\nconst fetchReviewData = (courseid, updatePreference = false) => {\n const calls = [\n {\n methodname: 'block_accessreview_get_section_data',\n args: {courseid}\n },\n {\n methodname: 'block_accessreview_get_module_data',\n args: {courseid}\n },\n ];\n\n if (updatePreference) {\n calls.push(getTogglePreferenceParams(true));\n }\n\n return fetchMany(calls);\n};\n\n/**\n * Setting up the access review module.\n * @param {number} toggled A number represnting the state of the review toggle.\n * @param {string} displayFormat A string representing the display format for icons.\n * @param {number} courseId The course ID.\n * @param {number} userId The id of the currently logged-in user.\n */\nexport const init = (toggled, displayFormat, courseId) => {\n // Settings consts.\n toggleState = toggled == 1;\n\n if (toggleState) {\n showAccessMap(courseId, displayFormat);\n }\n\n registerEventListeners(courseId, displayFormat);\n};\n"],"file":"module.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/module.js"],"names":["toggleState","renderTemplate","element","errorCount","checkCount","displayFormat","minViews","viewDelta","weight","parseInt","context","resultPassed","classList","passRate","failureRate","Math","round","Promise","resolve","elementClassList","push","showIcons","showBackground","add","join","Templates","renderForPromise","then","html","js","appendNodeContents","catch","showAccessMap","courseId","updatePreference","all","fetchReviewData","sectionData","moduleData","getErrorTotals","forEach","section","document","querySelector","numerrors","numchecks","module","getElementById","cmid","remove","displayError","hideAccessMap","querySelectorAll","node","setToggleStatePreference","toggleAccessMap","totals","totalErrors","totalUsers","maxViews","concat","item","registerEventListeners","addEventListener","e","target","closest","preventDefault","getTogglePreferenceParams","methodname","args","preferences","type","value","courseid","calls","init","toggled"],"mappings":"keAyBA,O,qgDAaIA,CAAAA,CAAW,G,CAYTC,CAAc,CAAG,SAACC,CAAD,CAAUC,CAAV,CAAsBC,CAAtB,CAAkCC,CAAlC,CAAiDC,CAAjD,CAA2DC,CAA3D,CAAyE,IAEtFC,CAAAA,CAAM,CAAGC,QAAQ,CAAC,CAACN,CAAU,CAAGG,CAAd,EAA0BC,CAA1B,EAAD,CAFqE,CAItFG,CAAO,CAAG,CACZC,YAAY,CAAE,CAACR,CADH,CAEZS,SAAS,CAAE,EAFC,CAGZC,QAAQ,CAAE,CACNV,UAAU,CAAVA,CADM,CAENC,UAAU,CAAVA,CAFM,CAGNU,WAAW,CAAEC,IAAI,CAACC,KAAL,CAAqC,GAA1B,EAAAb,CAAU,CAAGC,CAAb,CAAX,CAHP,CAHE,CAJ4E,CAc5F,GAAI,CAACF,CAAL,CAAc,CACV,MAAOe,CAAAA,OAAO,CAACC,OAAR,EACV,CAED,GAAMC,CAAAA,CAAgB,CAAG,CAAC,oBAAD,CAAzB,CACA,GAAIT,CAAO,CAACC,YAAZ,CAA0B,CACtBQ,CAAgB,CAACC,IAAjB,CAAsB,4BAAtB,CACH,CAFD,IAEO,IAAIZ,CAAJ,CAAY,CACfW,CAAgB,CAAC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CACV,C,CASYC,CAAI,CAAG,SAACC,CAAD,CAAUxE,CAAV,CAAyB4B,CAAzB,CAAsC,CAEtDjC,CAAW,CAAc,CAAX,EAAA6E,CAAd,CAEA,GAAI7E,CAAJ,CAAiB,CACbgC,CAAa,CAACC,CAAD,CAAW5B,CAAX,CAChB,CAEDyD,CAAsB,CAAC7B,CAAD,CAAW5B,CAAX,CACzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Manager for the accessreview block.\n *\n * @module block_accessreview/module\n * @author Max Larkin \n * @copyright 2020 Brickfield Education Labs \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {call as fetchMany} from 'core/ajax';\nimport * as Templates from 'core/templates';\nimport {exception as displayError} from 'core/notification';\n\n/**\n * The number of colours used to represent the heatmap. (Indexed on 0.)\n * @type {number}\n */\nconst numColours = 2;\n\n/**\n * The toggle state of the heatmap.\n * @type {boolean}\n */\nlet toggleState = true;\n\n/**\n * Renders the HTML template onto a particular HTML element.\n * @param {HTMLElement} element The element to attach the HTML to.\n * @param {number} errorCount The number of errors on this module/section.\n * @param {number} checkCount The number of checks triggered on this module/section.\n * @param {String} displayFormat\n * @param {Number} minViews\n * @param {Number} viewDelta\n * @returns {Promise}\n */\nconst renderTemplate = (element, errorCount, checkCount, displayFormat, minViews, viewDelta) => {\n // Calculate a weight?\n const weight = parseInt((errorCount - minViews) / viewDelta * numColours);\n\n const context = {\n resultPassed: !errorCount,\n classList: '',\n passRate: {\n errorCount,\n checkCount,\n failureRate: Math.round(errorCount / checkCount * 100),\n },\n };\n\n if (!element) {\n return Promise.resolve();\n }\n\n const elementClassList = ['block_accessreview'];\n if (context.resultPassed) {\n elementClassList.push('block_accessreview_success');\n } else if (weight) {\n elementClassList.push('block_accessreview_danger');\n } else {\n elementClassList.push('block_accessreview_warning');\n }\n\n const showIcons = (displayFormat == 'showicons') || (displayFormat == 'showboth');\n const showBackground = (displayFormat == 'showbackground') || (displayFormat == 'showboth');\n\n if (showBackground && !showIcons) {\n // Only the background is displayed.\n // No need to display the template.\n // Note: The case where both the background and icons are shown is handled later to avoid jankiness.\n element.classList.add(...elementClassList, 'alert');\n\n return Promise.resolve();\n }\n\n if (showIcons && !showBackground) {\n context.classList = elementClassList.join(' ');\n }\n\n // The icons are displayed either with, or without, the background.\n return Templates.renderForPromise('block_accessreview/status', context)\n .then(({html, js}) => {\n Templates.appendNodeContents(element, html, js);\n\n if (showBackground) {\n element.classList.add(...elementClassList, 'alert');\n }\n\n return;\n })\n .catch();\n};\n\n/**\n * Applies the template to all sections and modules on the course page.\n *\n * @param {Number} courseId\n * @param {String} displayFormat\n * @param {Boolean} updatePreference\n * @returns {Promise}\n */\nconst showAccessMap = (courseId, displayFormat, updatePreference = false) => {\n // Get error data.\n return Promise.all(fetchReviewData(courseId, updatePreference))\n .then(([sectionData, moduleData]) => {\n // Get total data.\n const {minViews, viewDelta} = getErrorTotals(sectionData, moduleData);\n\n sectionData.forEach(section => {\n const element = document.querySelector(`#section-${section.section} .summary`);\n if (!element) {\n return;\n }\n\n renderTemplate(element, section.numerrors, section.numchecks, displayFormat, minViews, viewDelta);\n });\n\n moduleData.forEach(module => {\n const element = document.getElementById(`module-${module.cmid}`);\n if (!element) {\n return;\n }\n\n renderTemplate(element, module.numerrors, module.numchecks, displayFormat, minViews, viewDelta);\n });\n\n // Change the icon display.\n document.querySelector('.icon-accessmap').classList.remove(...['fa-eye-slash']);\n document.querySelector('.icon-accessmap').classList.add(...['fa-eye']);\n\n return {\n sectionData,\n moduleData,\n };\n })\n .catch(displayError);\n};\n\n\n/**\n * Hides or removes the templates from the HTML of the current page.\n *\n * @param {Boolean} updatePreference\n */\nconst hideAccessMap = (updatePreference = false) => {\n // Removes the added elements.\n document.querySelectorAll('.block_accessreview_view').forEach(node => node.remove());\n\n const classList = [\n 'block_accessreview',\n 'block_accessreview_success',\n 'block_accessreview_warning',\n 'block_accessreview_danger',\n 'block_accessreview_view',\n 'alert',\n ];\n\n // Removes the added classes.\n document.querySelectorAll('.block_accessreview').forEach(node => node.classList.remove(...classList));\n\n if (updatePreference) {\n setToggleStatePreference(false);\n }\n\n // Change the icon display.\n document.querySelector('.icon-accessmap').classList.remove(...['fa-eye']);\n document.querySelector('.icon-accessmap').classList.add(...['fa-eye-slash']);\n};\n\n\n/**\n * Toggles the heatmap on/off.\n *\n * @param {Number} courseId\n * @param {String} displayFormat\n */\nconst toggleAccessMap = (courseId, displayFormat) => {\n toggleState = !toggleState;\n if (!toggleState) {\n hideAccessMap(true);\n } else {\n showAccessMap(courseId, displayFormat, true);\n }\n};\n\n/**\n * Parses information on the errors, generating the min, max and totals.\n *\n * @param {Object[]} sectionData The error data for course sections.\n * @param {Object[]} moduleData The error data for course modules.\n * @returns {Object} An object representing the extra error information.\n*/\nconst getErrorTotals = (sectionData, moduleData) => {\n const totals = {\n totalErrors: 0,\n totalUsers: 0,\n minViews: 0,\n maxViews: 0,\n viewDelta: 0,\n };\n\n [].concat(sectionData, moduleData).forEach(item => {\n totals.totalErrors += item.numerrors;\n if (item.numerrors < totals.minViews) {\n totals.minViews = item.numerrors;\n }\n\n if (item.numerrors > totals.maxViews) {\n totals.maxViews = item.numerrors;\n }\n totals.totalUsers += item.numchecks;\n });\n\n totals.viewDelta = totals.maxViews - totals.minViews + 1;\n\n return totals;\n};\n\nconst registerEventListeners = (courseId, displayFormat) => {\n document.addEventListener('click', e => {\n if (e.target.closest('#toggle-accessmap')) {\n e.preventDefault();\n toggleAccessMap(courseId, displayFormat);\n }\n });\n};\n\n/**\n * Set the user preference for the toggle value.\n *\n * @param {Boolean} toggleState\n * @returns {Promise}\n */\nconst getTogglePreferenceParams = toggleState => {\n return {\n methodname: 'core_user_update_user_preferences',\n args: {\n preferences: [{\n type: 'block_accessreviewtogglestate',\n value: toggleState,\n }],\n }\n };\n};\n\nconst setToggleStatePreference = toggleState => fetchMany([getTogglePreferenceParams(toggleState)]);\n\n/**\n * Fetch the review data.\n *\n * @param {Number} courseid\n * @param {Boolean} updatePreference\n * @returns {Promise[]}\n */\nconst fetchReviewData = (courseid, updatePreference = false) => {\n const calls = [\n {\n methodname: 'block_accessreview_get_section_data',\n args: {courseid}\n },\n {\n methodname: 'block_accessreview_get_module_data',\n args: {courseid}\n },\n ];\n\n if (updatePreference) {\n calls.push(getTogglePreferenceParams(true));\n }\n\n return fetchMany(calls);\n};\n\n/**\n * Setting up the access review module.\n * @param {number} toggled A number represnting the state of the review toggle.\n * @param {string} displayFormat A string representing the display format for icons.\n * @param {number} courseId The course ID.\n * @param {number} userId The id of the currently logged-in user.\n */\nexport const init = (toggled, displayFormat, courseId) => {\n // Settings consts.\n toggleState = toggled == 1;\n\n if (toggleState) {\n showAccessMap(courseId, displayFormat);\n }\n\n registerEventListeners(courseId, displayFormat);\n};\n"],"file":"module.min.js"} \ No newline at end of file diff --git a/blocks/accessreview/amd/src/module.js b/blocks/accessreview/amd/src/module.js index b4d0205314e5f..58360bdcb43e2 100644 --- a/blocks/accessreview/amd/src/module.js +++ b/blocks/accessreview/amd/src/module.js @@ -14,7 +14,9 @@ // along with Moodle. If not, see . /** + * Manager for the accessreview block. * + * @module block_accessreview/module * @author Max Larkin * @copyright 2020 Brickfield Education Labs * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later diff --git a/blocks/amd/build/events.min.js.map b/blocks/amd/build/events.min.js.map index 87cecf926881d..b22688d2e09c8 100644 --- a/blocks/amd/build/events.min.js.map +++ b/blocks/amd/build/events.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/events.js"],"names":["eventTypes","blockContentUpdated","notifyBlockContentUpdated","element","instanceId","dataset","legacyEventsRegistered","Y","use","document","addEventListener","e","Global","fire","M","core","event","BLOCK_CONTENT_UPDATED","instanceid","detail"],"mappings":"4LA+BO,GAAMA,CAAAA,CAAU,CAAG,CAStBC,mBAAmB,CAAE,2BATC,CAAnB,C,2CAoBkC,QAA5BC,CAAAA,yBAA4B,CAAAC,CAAO,QAAI,oBAChDH,CAAU,CAACC,mBADqC,CAEhD,CACIG,UAAU,CAAED,CAAO,CAACE,OAAR,CAAgBD,UADhC,CAFgD,CAKhDD,CALgD,CAAJ,C,CAQhD,GAAIG,CAAAA,CAAsB,GAA1B,CACA,GAAI,CAACA,CAAL,CAA6B,CAKzBC,CAAC,CAACC,GAAF,CAAM,OAAN,CAAe,mBAAf,CAAoC,SAAAD,CAAC,CAAI,CAErCE,QAAQ,CAACC,gBAAT,CAA0BV,CAAU,CAACC,mBAArC,CAA0D,SAAAU,CAAC,CAAI,CAE3DJ,CAAC,CAACK,MAAF,CAASC,IAAT,CAAcC,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAaC,qBAA3B,CAAkD,CAACC,UAAU,CAAEP,CAAC,CAACQ,MAAF,CAASf,UAAtB,CAAlD,CACH,CAHD,CAIH,CAND,EAQAE,CAAsB,GACzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/ //\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript events for the `core_block` subsystem.\n *\n * @module core_block/events\n * @copyright 2021 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 4.0\n */\n\nimport {dispatchEvent} from 'core/event_dispatcher';\n\n/**\n * Events for `core_block`.\n *\n * @constant\n * @property {String} blockContentUpdated See {@link event:blockContentUpdated}\n */\nexport const eventTypes = {\n /**\n * An event triggered when the content of a block has changed.\n *\n * @event blockContentUpdated\n * @type {CustomEvent}\n * @property {HTMLElement} target The block element that was updated\n * @property {Number} instanceId The block instance id\n */\n blockContentUpdated: 'core_block/contentUpdated',\n};\n\n/**\n * Trigger an event to indicate that the content of a block was updated.\n *\n * @method notifyBlockContentUpdated\n * @param {HTMLElement} element The HTMLElement containing the updated block.\n * @returns {CustomEvent}\n * @fires blockContentUpdated\n */\nexport const notifyBlockContentUpdated = element => dispatchEvent(\n eventTypes.blockContentUpdated,\n {\n instanceId: element.dataset.instanceId,\n },\n element\n);\n\nlet legacyEventsRegistered = false;\nif (!legacyEventsRegistered) {\n // The following event triggers are legacy and will be removed in the future.\n // The following approach provides a backwards-compatability layer for the new events.\n // Code should be updated to make use of native events.\n\n Y.use('event', 'moodle-core-event', Y => {\n // Provide a backwards-compatability layer for YUI Events.\n document.addEventListener(eventTypes.blockContentUpdated, e => {\n // Trigger the legacy YUI event.\n Y.Global.fire(M.core.event.BLOCK_CONTENT_UPDATED, {instanceid: e.detail.instanceId});\n });\n });\n\n legacyEventsRegistered = true;\n}\n"],"file":"events.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/events.js"],"names":["eventTypes","blockContentUpdated","notifyBlockContentUpdated","element","instanceId","dataset","legacyEventsRegistered","Y","use","document","addEventListener","e","Global","fire","M","core","event","BLOCK_CONTENT_UPDATED","instanceid","detail"],"mappings":"4LAuCO,GAAMA,CAAAA,CAAU,CAAG,CAUtBC,mBAAmB,CAAE,2BAVC,CAAnB,C,2CAqBkC,QAA5BC,CAAAA,yBAA4B,CAAAC,CAAO,QAAI,oBAChDH,CAAU,CAACC,mBADqC,CAEhD,CACIG,UAAU,CAAED,CAAO,CAACE,OAAR,CAAgBD,UADhC,CAFgD,CAKhDD,CALgD,CAAJ,C,CAQhD,GAAIG,CAAAA,CAAsB,GAA1B,CACA,GAAI,CAACA,CAAL,CAA6B,CAKzBC,CAAC,CAACC,GAAF,CAAM,OAAN,CAAe,mBAAf,CAAoC,SAAAD,CAAC,CAAI,CAErCE,QAAQ,CAACC,gBAAT,CAA0BV,CAAU,CAACC,mBAArC,CAA0D,SAAAU,CAAC,CAAI,CAE3DJ,CAAC,CAACK,MAAF,CAASC,IAAT,CAAcC,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAaC,qBAA3B,CAAkD,CAACC,UAAU,CAAEP,CAAC,CAACQ,MAAF,CAASf,UAAtB,CAAlD,CACH,CAHD,CAIH,CAND,EAQAE,CAAsB,GACzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/ //\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript events for the `core_block` subsystem.\n *\n * @module core_block/events\n * @copyright 2021 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 4.0\n *\n * @example Example of listening to a block event.\n * import {eventTypes as blockEventTypes} from 'core_block/events';\n *\n * document.addEventListener(blockEventTypes.blockContentUpdated, e => {\n * window.console.log(e.target); // The HTMLElement relating to the block whose content was updated.\n * window.console.log(e.detail.instanceId); // The instanceId of the block that was updated.\n * });\n */\n\nimport {dispatchEvent} from 'core/event_dispatcher';\n\n/**\n * Events for `core_block`.\n *\n * @constant\n * @property {String} blockContentUpdated See {@link event:blockContentUpdated}\n */\nexport const eventTypes = {\n /**\n * An event triggered when the content of a block has changed.\n *\n * @event blockContentUpdated\n * @type {CustomEvent}\n * @property {HTMLElement} target The block element that was updated\n * @property {object} detail\n * @property {number} detail.instanceId The block instance id\n */\n blockContentUpdated: 'core_block/contentUpdated',\n};\n\n/**\n * Trigger an event to indicate that the content of a block was updated.\n *\n * @method notifyBlockContentUpdated\n * @param {HTMLElement} element The HTMLElement containing the updated block.\n * @returns {CustomEvent}\n * @fires blockContentUpdated\n */\nexport const notifyBlockContentUpdated = element => dispatchEvent(\n eventTypes.blockContentUpdated,\n {\n instanceId: element.dataset.instanceId,\n },\n element\n);\n\nlet legacyEventsRegistered = false;\nif (!legacyEventsRegistered) {\n // The following event triggers are legacy and will be removed in the future.\n // The following approach provides a backwards-compatability layer for the new events.\n // Code should be updated to make use of native events.\n\n Y.use('event', 'moodle-core-event', Y => {\n // Provide a backwards-compatability layer for YUI Events.\n document.addEventListener(eventTypes.blockContentUpdated, e => {\n // Trigger the legacy YUI event.\n Y.Global.fire(M.core.event.BLOCK_CONTENT_UPDATED, {instanceid: e.detail.instanceId});\n });\n });\n\n legacyEventsRegistered = true;\n}\n"],"file":"events.min.js"} \ No newline at end of file diff --git a/blocks/amd/src/events.js b/blocks/amd/src/events.js index 00ad89c2cf11a..81e00fd3e8868 100644 --- a/blocks/amd/src/events.js +++ b/blocks/amd/src/events.js @@ -19,6 +19,14 @@ * @copyright 2021 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 4.0 + * + * @example Example of listening to a block event. + * import {eventTypes as blockEventTypes} from 'core_block/events'; + * + * document.addEventListener(blockEventTypes.blockContentUpdated, e => { + * window.console.log(e.target); // The HTMLElement relating to the block whose content was updated. + * window.console.log(e.detail.instanceId); // The instanceId of the block that was updated. + * }); */ import {dispatchEvent} from 'core/event_dispatcher'; @@ -36,7 +44,8 @@ export const eventTypes = { * @event blockContentUpdated * @type {CustomEvent} * @property {HTMLElement} target The block element that was updated - * @property {Number} instanceId The block instance id + * @property {object} detail + * @property {number} detail.instanceId The block instance id */ blockContentUpdated: 'core_block/contentUpdated', }; diff --git a/blocks/myoverview/amd/build/repository.min.js.map b/blocks/myoverview/amd/build/repository.min.js.map index b7cb20a0fc8c9..9ad37fd4728c1 100644 --- a/blocks/myoverview/amd/build/repository.min.js.map +++ b/blocks/myoverview/amd/build/repository.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/repository.js"],"names":["define","Ajax","Notification","getEnrolledCoursesByTimeline","args","promise","call","methodname","setFavouriteCourses","updateUserPreferences","fail","exception"],"mappings":"AAqBAA,OAAM,+BAAC,CAAC,WAAD,CAAc,mBAAd,CAAD,CAAqC,SAASC,CAAT,CAAeC,CAAf,CAA6B,CAyEpE,MAAO,CACHC,4BAA4B,CA3DG,QAA/BA,CAAAA,4BAA+B,CAASC,CAAT,CAAe,IAO1CC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,6DADF,CAEVH,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CAPgC,CAS9C,MAAOC,CAAAA,CACV,CAgDM,CAEHG,mBAAmB,CAvCG,QAAtBA,CAAAA,mBAAsB,CAASJ,CAAT,CAAe,IAOjCC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,mCADF,CAEVH,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CAPuB,CASrC,MAAOC,CAAAA,CACV,CA2BM,CAGHI,qBAAqB,CAbG,QAAxBA,CAAAA,qBAAwB,CAASL,CAAT,CAAe,CAMvCH,CAAI,CAACK,IAAL,CAAU,CALI,CACVC,UAAU,CAAE,mCADF,CAEVH,IAAI,CAAEA,CAFI,CAKJ,CAAV,EAAqB,CAArB,EACKM,IADL,CACUR,CAAY,CAACS,SADvB,CAEH,CAEM,CAKV,CA9EK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to retrieve enrolled coruses from the server.\n *\n * @copyright 2018 Bas Brands \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['core/ajax', 'core/notification'], function(Ajax, Notification) {\n\n /**\n * Retrieve a list of enrolled courses.\n *\n * Valid args are:\n * string classification future, inprogress, past\n * int limit number of records to retreive\n * int Offset offset for pagination\n * int sort sort by lastaccess or name\n *\n * @method getEnrolledCoursesByTimeline\n * @param {object} args The request arguments\n * @return {promise} Resolved with an array of courses\n */\n var getEnrolledCoursesByTimeline = function(args) {\n\n var request = {\n methodname: 'core_course_get_enrolled_courses_by_timeline_classification',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n return promise;\n };\n\n /**\n * Set the favourite state on a list of courses.\n *\n * Valid args are:\n * Array courses list of course id numbers.\n *\n * @param {Object} args Arguments send to the webservice.\n * @return {Promise} Resolve with warnings.\n */\n var setFavouriteCourses = function(args) {\n\n var request = {\n methodname: 'core_course_set_favourite_courses',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n return promise;\n };\n\n /**\n * Update the user preferences.\n *\n * @param {Object} args Arguments send to the webservice.\n *\n * Sample args:\n * {\n * preferences: [\n * {\n * type: 'block_example_user_sort_preference'\n * value: 'title'\n * }\n * ]\n * }\n */\n var updateUserPreferences = function(args) {\n var request = {\n methodname: 'core_user_update_user_preferences',\n args: args\n };\n\n Ajax.call([request])[0]\n .fail(Notification.exception);\n };\n\n return {\n getEnrolledCoursesByTimeline: getEnrolledCoursesByTimeline,\n setFavouriteCourses: setFavouriteCourses,\n updateUserPreferences: updateUserPreferences\n };\n});\n"],"file":"repository.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/repository.js"],"names":["define","Ajax","Notification","getEnrolledCoursesByTimeline","args","promise","call","methodname","setFavouriteCourses","updateUserPreferences","fail","exception"],"mappings":"AAsBAA,OAAM,+BAAC,CAAC,WAAD,CAAc,mBAAd,CAAD,CAAqC,SAASC,CAAT,CAAeC,CAAf,CAA6B,CAyEpE,MAAO,CACHC,4BAA4B,CA3DG,QAA/BA,CAAAA,4BAA+B,CAASC,CAAT,CAAe,IAO1CC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,6DADF,CAEVH,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CAPgC,CAS9C,MAAOC,CAAAA,CACV,CAgDM,CAEHG,mBAAmB,CAvCG,QAAtBA,CAAAA,mBAAsB,CAASJ,CAAT,CAAe,IAOjCC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,mCADF,CAEVH,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CAPuB,CASrC,MAAOC,CAAAA,CACV,CA2BM,CAGHI,qBAAqB,CAbG,QAAxBA,CAAAA,qBAAwB,CAASL,CAAT,CAAe,CAMvCH,CAAI,CAACK,IAAL,CAAU,CALI,CACVC,UAAU,CAAE,mCADF,CAEVH,IAAI,CAAEA,CAFI,CAKJ,CAAV,EAAqB,CAArB,EACKM,IADL,CACUR,CAAY,CAACS,SADvB,CAEH,CAEM,CAKV,CA9EK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to retrieve enrolled coruses from the server.\n *\n * @module block_myoverview/repository\n * @copyright 2018 Bas Brands \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['core/ajax', 'core/notification'], function(Ajax, Notification) {\n\n /**\n * Retrieve a list of enrolled courses.\n *\n * Valid args are:\n * string classification future, inprogress, past\n * int limit number of records to retreive\n * int Offset offset for pagination\n * int sort sort by lastaccess or name\n *\n * @method getEnrolledCoursesByTimeline\n * @param {object} args The request arguments\n * @return {promise} Resolved with an array of courses\n */\n var getEnrolledCoursesByTimeline = function(args) {\n\n var request = {\n methodname: 'core_course_get_enrolled_courses_by_timeline_classification',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n return promise;\n };\n\n /**\n * Set the favourite state on a list of courses.\n *\n * Valid args are:\n * Array courses list of course id numbers.\n *\n * @param {Object} args Arguments send to the webservice.\n * @return {Promise} Resolve with warnings.\n */\n var setFavouriteCourses = function(args) {\n\n var request = {\n methodname: 'core_course_set_favourite_courses',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n return promise;\n };\n\n /**\n * Update the user preferences.\n *\n * @param {Object} args Arguments send to the webservice.\n *\n * Sample args:\n * {\n * preferences: [\n * {\n * type: 'block_example_user_sort_preference'\n * value: 'title'\n * }\n * ]\n * }\n */\n var updateUserPreferences = function(args) {\n var request = {\n methodname: 'core_user_update_user_preferences',\n args: args\n };\n\n Ajax.call([request])[0]\n .fail(Notification.exception);\n };\n\n return {\n getEnrolledCoursesByTimeline: getEnrolledCoursesByTimeline,\n setFavouriteCourses: setFavouriteCourses,\n updateUserPreferences: updateUserPreferences\n };\n});\n"],"file":"repository.min.js"} \ No newline at end of file diff --git a/blocks/myoverview/amd/src/repository.js b/blocks/myoverview/amd/src/repository.js index 816851c82f909..682a0996236f4 100644 --- a/blocks/myoverview/amd/src/repository.js +++ b/blocks/myoverview/amd/src/repository.js @@ -16,6 +16,7 @@ /** * A javascript module to retrieve enrolled coruses from the server. * + * @module block_myoverview/repository * @copyright 2018 Bas Brands * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/blocks/starredcourses/amd/build/main.min.js.map b/blocks/starredcourses/amd/build/main.min.js.map index 31c003a17d98d..23eeb0c8cca55 100644 --- a/blocks/starredcourses/amd/build/main.min.js.map +++ b/blocks/starredcourses/amd/build/main.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/main.js"],"names":["define","$","Notification","Repository","PubSub","Templates","CourseEvents","SELECTORS","BLOCK_CONTAINER","STARRED_COURSES_REGION_VIEW","STARRED_COURSES_REGION","renderCourses","root","courses","length","render","nocoursesimg","find","attr","reloadContent","content","getStarredCourses","limit","offset","then","showcoursecategory","data","map","course","html","js","replaceNodeContents","catch","exception","registerEventListeners","subscribe","favourited","unfavorited","init"],"mappings":"AAsBAA,OAAM,6BACN,CACI,QADJ,CAEI,mBAFJ,CAGI,iCAHJ,CAII,aAJJ,CAKI,gBALJ,CAMI,oBANJ,CADM,CASN,SACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,CALJ,CAMIC,CANJ,CAOE,IAEMC,CAAAA,CAAS,CAAG,CACZC,eAAe,CAAE,mCADL,CAEZC,2BAA2B,CAAE,wCAFjB,CAGZC,sBAAsB,CAAE,gDAHZ,CAFlB,CAgBMC,CAAa,CAAG,SAASC,CAAT,CAAeC,CAAf,CAAwB,CACxC,GAAqB,CAAjB,CAAAA,CAAO,CAACC,MAAZ,CAAwB,CACpB,MAAOT,CAAAA,CAAS,CAACU,MAAV,CAAiB,wBAAjB,CAA2C,CAC9CF,OAAO,CAAEA,CADqC,CAA3C,CAGV,CAJD,IAIO,CACH,GAAIG,CAAAA,CAAY,CAAGJ,CAAI,CAACK,IAAL,CAAUV,CAAS,CAACE,2BAApB,EAAiDS,IAAjD,CAAsD,mBAAtD,CAAnB,CACA,MAAOb,CAAAA,CAAS,CAACU,MAA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CAACW,CAAD,CAAR,CAEAsB,CAAsB,CAACtB,CAAD,CAAtB,CACAO,CAAa,CAACP,CAAD,CAChB,CAEM,CAGV,CAvGK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript to initialise the starred courses block.\n *\n * @copyright 2018 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(\n[\n 'jquery',\n 'core/notification',\n 'block_starredcourses/repository',\n 'core/pubsub',\n 'core/templates',\n 'core_course/events'\n],\nfunction(\n $,\n Notification,\n Repository,\n PubSub,\n Templates,\n CourseEvents\n) {\n\n var SELECTORS = {\n BLOCK_CONTAINER: '[data-region=\"starred-courses\"]',\n STARRED_COURSES_REGION_VIEW: '[data-region=\"starred-courses-view\"]',\n STARRED_COURSES_REGION: '[data-region=\"starred-courses-view-content\"]'\n };\n\n /**\n * Render the starred courses.\n *\n * @method renderCourses\n * @param {object} root The root element for the starred view.\n * @param {array} courses containing array of returned courses.\n * @returns {promise} Resolved with HTML and JS strings\n */\n var renderCourses = function(root, courses) {\n if (courses.length > 0) {\n return Templates.render('core_course/view-cards', {\n courses: courses\n });\n } else {\n var nocoursesimg = root.find(SELECTORS.STARRED_COURSES_REGION_VIEW).attr('data-nocoursesimg');\n return Templates.render('block_starredcourses/no-courses', {\n nocoursesimg: nocoursesimg\n });\n }\n };\n\n /**\n * Fetch user's starred courses and reload the content of the block.\n *\n * @param {object} root The root element for the starred view.\n * @returns {promise} The updated content for the block.\n */\n var reloadContent = function(root) {\n var content = root.find(SELECTORS.STARRED_COURSES_REGION);\n\n var args = {\n limit: 0,\n offset: 0,\n };\n\n return Repository.getStarredCourses(args)\n .then(function(courses) {\n // Whether the course category should be displayed in the course item.\n var showcoursecategory = $(SELECTORS.BLOCK_CONTAINER).data('displaycoursecategory');\n courses = courses.map(function(course) {\n course.showcoursecategory = showcoursecategory;\n return course;\n });\n return renderCourses(root, courses);\n }).then(function(html, js) {\n return Templates.replaceNodeContents(content, html, js);\n }).catch(Notification.exception);\n };\n\n /**\n * Register event listeners for the block.\n *\n * @param {object} root The calendar root element\n */\n var registerEventListeners = function(root) {\n PubSub.subscribe(CourseEvents.favourited, function() {\n reloadContent(root);\n });\n\n PubSub.subscribe(CourseEvents.unfavorited, function() {\n reloadContent(root);\n });\n };\n\n /**\n * Initialise all of the modules for the starred courses block.\n *\n * @param {object} root The root element for the block.\n */\n var init = function(root) {\n root = $(root);\n\n registerEventListeners(root);\n reloadContent(root);\n };\n\n return {\n init: init\n };\n});\n"],"file":"main.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/main.js"],"names":["define","$","Notification","Repository","PubSub","Templates","CourseEvents","SELECTORS","BLOCK_CONTAINER","STARRED_COURSES_REGION_VIEW","STARRED_COURSES_REGION","renderCourses","root","courses","length","render","nocoursesimg","find","attr","reloadContent","content","getStarredCourses","limit","offset","then","showcoursecategory","data","map","course","html","js","replaceNodeContents","catch","exception","registerEventListeners","subscribe","favourited","unfavorited","init"],"mappings":"AAuBAA,OAAM,6BACN,CACI,QADJ,CAEI,mBAFJ,CAGI,iCAHJ,CAII,aAJJ,CAKI,gBALJ,CAMI,oBANJ,CADM,CASN,SACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,CALJ,CAMIC,CANJ,CAOE,IAEMC,CAAAA,CAAS,CAAG,CACZC,eAAe,CAAE,mCADL,CAEZC,2BAA2B,CAAE,wCAFjB,CAGZC,sBAAsB,CAAE,gDAHZ,CAFlB,CAgBMC,CAAa,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CAAG,SAAStB,CAAT,CAAe,CACxCR,CAAM,CAAC+B,SAAP,CAAiB7B,CAAY,CAAC8B,UAA9B,CAA0C,UAAW,CACjDjB,CAAa,CAACP,CAAD,CAChB,CAFD,EAIAR,CAAM,CAAC+B,SAAP,CAAiB7B,CAAY,CAAC+B,WAA9B,CAA2C,UAAW,CAClDlB,CAAa,CAACP,CAAD,CAChB,CAFD,CAGH,CAtEH,CAoFE,MAAO,CACH0B,IAAI,CARG,QAAPA,CAAAA,IAAO,CAAS1B,CAAT,CAAe,CACtBA,CAAI,CAAGX,CAAC,CAACW,CAAD,CAAR,CAEAsB,CAAsB,CAACtB,CAAD,CAAtB,CACAO,CAAa,CAACP,CAAD,CAChB,CAEM,CAGV,CAvGK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript to initialise the starred courses block.\n *\n * @module block_starredcourses/main\n * @copyright 2018 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(\n[\n 'jquery',\n 'core/notification',\n 'block_starredcourses/repository',\n 'core/pubsub',\n 'core/templates',\n 'core_course/events'\n],\nfunction(\n $,\n Notification,\n Repository,\n PubSub,\n Templates,\n CourseEvents\n) {\n\n var SELECTORS = {\n BLOCK_CONTAINER: '[data-region=\"starred-courses\"]',\n STARRED_COURSES_REGION_VIEW: '[data-region=\"starred-courses-view\"]',\n STARRED_COURSES_REGION: '[data-region=\"starred-courses-view-content\"]'\n };\n\n /**\n * Render the starred courses.\n *\n * @method renderCourses\n * @param {object} root The root element for the starred view.\n * @param {array} courses containing array of returned courses.\n * @returns {promise} Resolved with HTML and JS strings\n */\n var renderCourses = function(root, courses) {\n if (courses.length > 0) {\n return Templates.render('core_course/view-cards', {\n courses: courses\n });\n } else {\n var nocoursesimg = root.find(SELECTORS.STARRED_COURSES_REGION_VIEW).attr('data-nocoursesimg');\n return Templates.render('block_starredcourses/no-courses', {\n nocoursesimg: nocoursesimg\n });\n }\n };\n\n /**\n * Fetch user's starred courses and reload the content of the block.\n *\n * @param {object} root The root element for the starred view.\n * @returns {promise} The updated content for the block.\n */\n var reloadContent = function(root) {\n var content = root.find(SELECTORS.STARRED_COURSES_REGION);\n\n var args = {\n limit: 0,\n offset: 0,\n };\n\n return Repository.getStarredCourses(args)\n .then(function(courses) {\n // Whether the course category should be displayed in the course item.\n var showcoursecategory = $(SELECTORS.BLOCK_CONTAINER).data('displaycoursecategory');\n courses = courses.map(function(course) {\n course.showcoursecategory = showcoursecategory;\n return course;\n });\n return renderCourses(root, courses);\n }).then(function(html, js) {\n return Templates.replaceNodeContents(content, html, js);\n }).catch(Notification.exception);\n };\n\n /**\n * Register event listeners for the block.\n *\n * @param {object} root The calendar root element\n */\n var registerEventListeners = function(root) {\n PubSub.subscribe(CourseEvents.favourited, function() {\n reloadContent(root);\n });\n\n PubSub.subscribe(CourseEvents.unfavorited, function() {\n reloadContent(root);\n });\n };\n\n /**\n * Initialise all of the modules for the starred courses block.\n *\n * @param {object} root The root element for the block.\n */\n var init = function(root) {\n root = $(root);\n\n registerEventListeners(root);\n reloadContent(root);\n };\n\n return {\n init: init\n };\n});\n"],"file":"main.min.js"} \ No newline at end of file diff --git a/blocks/starredcourses/amd/build/repository.min.js.map b/blocks/starredcourses/amd/build/repository.min.js.map index 2f04b4f633dcf..3b99a7bc1197d 100644 --- a/blocks/starredcourses/amd/build/repository.min.js.map +++ b/blocks/starredcourses/amd/build/repository.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/repository.js"],"names":["define","$","Ajax","Notification","getStarredCourses","args","promise","call","methodname","fail","exception"],"mappings":"AAqBAA,OAAM,mCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAAD,CAA+C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgC,CA2BjF,MAAO,CACHC,iBAAiB,CAfG,QAApBA,CAAAA,iBAAoB,CAASC,CAAT,CAAe,IAO/BC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,0CADF,CAEVH,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CAPqB,CASnCC,CAAO,CAACG,IAAR,CAAaN,CAAY,CAACO,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAEM,CAGV,CA9BK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to retrieve user's starred courses.\n *\n * @copyright 2018 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notification) {\n\n /**\n * Retrieve a list of starred courses.\n *\n * Valid args are:\n * int limit number of records to retrieve\n * int offset the offset of records to retrieve\n *\n * @method getStarredCourses\n * @param {object} args The request arguments\n * @return {promise} Resolved with an array of courses\n */\n var getStarredCourses = function(args) {\n\n var request = {\n methodname: 'block_starredcourses_get_starred_courses',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n return {\n getStarredCourses: getStarredCourses\n };\n});"],"file":"repository.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/repository.js"],"names":["define","$","Ajax","Notification","getStarredCourses","args","promise","call","methodname","fail","exception"],"mappings":"AAsBAA,OAAM,mCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAAD,CAA+C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgC,CA2BjF,MAAO,CACHC,iBAAiB,CAfG,QAApBA,CAAAA,iBAAoB,CAASC,CAAT,CAAe,IAO/BC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,0CADF,CAEVH,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CAPqB,CASnCC,CAAO,CAACG,IAAR,CAAaN,CAAY,CAACO,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAEM,CAGV,CA9BK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to retrieve user's starred courses.\n *\n * @module block_starredcourses/repository\n * @copyright 2018 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notification) {\n\n /**\n * Retrieve a list of starred courses.\n *\n * Valid args are:\n * int limit number of records to retrieve\n * int offset the offset of records to retrieve\n *\n * @method getStarredCourses\n * @param {object} args The request arguments\n * @return {promise} Resolved with an array of courses\n */\n var getStarredCourses = function(args) {\n\n var request = {\n methodname: 'block_starredcourses_get_starred_courses',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n return {\n getStarredCourses: getStarredCourses\n };\n});\n"],"file":"repository.min.js"} \ No newline at end of file diff --git a/blocks/starredcourses/amd/src/main.js b/blocks/starredcourses/amd/src/main.js index 5ad14b0e91d67..8689d7a2e680b 100644 --- a/blocks/starredcourses/amd/src/main.js +++ b/blocks/starredcourses/amd/src/main.js @@ -16,6 +16,7 @@ /** * Javascript to initialise the starred courses block. * + * @module block_starredcourses/main * @copyright 2018 Simey Lameze * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/blocks/starredcourses/amd/src/repository.js b/blocks/starredcourses/amd/src/repository.js index 761dd0a13fe92..c8179f2177507 100644 --- a/blocks/starredcourses/amd/src/repository.js +++ b/blocks/starredcourses/amd/src/repository.js @@ -16,6 +16,7 @@ /** * A javascript module to retrieve user's starred courses. * + * @module block_starredcourses/repository * @copyright 2018 Simey Lameze * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -49,4 +50,4 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat return { getStarredCourses: getStarredCourses }; -}); \ No newline at end of file +}); diff --git a/calendar/amd/build/events.min.js.map b/calendar/amd/build/events.min.js.map index bf94bc57696bb..93b0e06af5cc7 100644 --- a/calendar/amd/build/events.min.js.map +++ b/calendar/amd/build/events.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/events.js"],"names":["define","created","deleted","deleteAll","updated","editEvent","editActionEvent","eventMoved","dayChanged","monthChanged","moveEvent","filterChanged","viewUpdated"],"mappings":"AAuBAA,OAAM,wBAAC,EAAD,CAAK,UAAW,CAClB,MAAO,CACHC,OAAO,CAAE,yBADN,CAEHC,OAAO,CAAE,yBAFN,CAGHC,SAAS,CAAE,4BAHR,CAIHC,OAAO,CAAE,yBAJN,CAKHC,SAAS,CAAE,4BALR,CAMHC,eAAe,CAAE,mCANd,CAOHC,UAAU,CAAE,6BAPT,CAQHC,UAAU,CAAE,6BART,CASHC,YAAY,CAAE,+BATX,CAUHC,SAAS,CAAE,4BAVR,CAWHC,aAAa,CAAE,gCAXZ,CAYHC,WAAW,CAAE,8BAZV,CAcV,CAfK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the events the calendar component can fire.\n *\n * @module core_calendar/events\n * @class calendar_events\n * @copyright 2017 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([], function() {\n return {\n created: 'calendar-events:created',\n deleted: 'calendar-events:deleted',\n deleteAll: 'calendar-events:delete_all',\n updated: 'calendar-events:updated',\n editEvent: 'calendar-events:edit_event',\n editActionEvent: 'calendar-events:edit_action_event',\n eventMoved: 'calendar-events:event_moved',\n dayChanged: 'calendar-events:day_changed',\n monthChanged: 'calendar-events:month_changed',\n moveEvent: 'calendar-events:move_event',\n filterChanged: 'calendar-events:filter_changed',\n viewUpdated: 'calendar-events:view_updated',\n };\n});\n"],"file":"events.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/events.js"],"names":["define","created","deleted","deleteAll","updated","editEvent","editActionEvent","eventMoved","dayChanged","monthChanged","moveEvent","filterChanged","viewUpdated"],"mappings":"AAsBAA,OAAM,wBAAC,EAAD,CAAK,UAAW,CAClB,MAAO,CACHC,OAAO,CAAE,yBADN,CAEHC,OAAO,CAAE,yBAFN,CAGHC,SAAS,CAAE,4BAHR,CAIHC,OAAO,CAAE,yBAJN,CAKHC,SAAS,CAAE,4BALR,CAMHC,eAAe,CAAE,mCANd,CAOHC,UAAU,CAAE,6BAPT,CAQHC,UAAU,CAAE,6BART,CASHC,YAAY,CAAE,+BATX,CAUHC,SAAS,CAAE,4BAVR,CAWHC,aAAa,CAAE,gCAXZ,CAYHC,WAAW,CAAE,8BAZV,CAcV,CAfK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the events the calendar component can fire.\n *\n * @module core_calendar/events\n * @copyright 2017 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([], function() {\n return {\n created: 'calendar-events:created',\n deleted: 'calendar-events:deleted',\n deleteAll: 'calendar-events:delete_all',\n updated: 'calendar-events:updated',\n editEvent: 'calendar-events:edit_event',\n editActionEvent: 'calendar-events:edit_action_event',\n eventMoved: 'calendar-events:event_moved',\n dayChanged: 'calendar-events:day_changed',\n monthChanged: 'calendar-events:month_changed',\n moveEvent: 'calendar-events:move_event',\n filterChanged: 'calendar-events:filter_changed',\n viewUpdated: 'calendar-events:view_updated',\n };\n});\n"],"file":"events.min.js"} \ No newline at end of file diff --git a/calendar/amd/build/modal_delete.min.js.map b/calendar/amd/build/modal_delete.min.js.map index fd5b24cdfecf2..0d14145174bd9 100644 --- a/calendar/amd/build/modal_delete.min.js.map +++ b/calendar/amd/build/modal_delete.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/modal_delete.js"],"names":["define","$","Notification","CustomEvents","Modal","ModalEvents","ModalRegistry","CalendarEvents","registered","SELECTORS","DELETE_ONE_BUTTON","DELETE_ALL_BUTTON","CANCEL_BUTTON","ModalDelete","root","call","setRemoveOnClose","TYPE","prototype","Object","create","constructor","registerEventListeners","getModal","on","events","activate","e","data","saveEvent","Event","save","getRoot","trigger","isDefaultPrevented","hide","originalEvent","preventDefault","bind","deleteAll","cancelEvent","cancel","register"],"mappings":"AAuBAA,OAAM,8BAAC,CACH,QADG,CAEH,mBAFG,CAGH,gCAHG,CAIH,YAJG,CAKH,mBALG,CAMH,qBANG,CAOH,sBAPG,CAAD,CASN,SACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,CALJ,CAMIC,CANJ,CAOIC,CAPJ,CAQE,IAEMC,CAAAA,CAAU,GAFhB,CAGMC,CAAS,CAAG,CACZC,iBAAiB,CAAE,6BADP,CAEZC,iBAAiB,CAAE,6BAFP,CAGZC,aAAa,CAAE,0BAHH,CAHlB,CAcMC,CAAW,CAAG,SAASC,CAAT,CAAe,CAC7BV,CAAK,CAACW,IAAN,CAAW,IAAX,CAAiBD,CAAjB,EAEA,KAAKE,gBAAL,IACH,CAlBH,CAoBEH,CAAW,CAACI,IAAZ,CAAmB,4BAAnB,CACAJ,CAAW,CAACK,SAAZ,CAAwBC,MAAM,CAACC,MAAP,CAAchB,CAAK,CAACc,SAApB,CAAxB,CACAL,CAAW,CAACK,SAAZ,CAAsBG,WAAtB,CAAoCR,CAApC,CAOAA,CAAW,CAACK,SAAZ,CAAsBI,sBAAtB,CAA+C,UAAW,CAEtDlB,CAAK,CAACc,SAAN,CAAgBI,sBAAhB,CAAuCP,IAAvC,CAA4C,IAA5C,EAEA,KAAKQ,QAAL,GAAgBC,EAAhB,CAAmBrB,CAAY,CAACsB,MAAb,CAAoBC,QAAvC,CAAiDjB,CAAS,CAACC,iBAA3D,CAA8E,SAASiB,CAAT,CAAYC,CAAZ,CAAkB,CAC5F,GAAIC,CAAAA,CAAS,CAAG5B,CAAC,CAAC6B,KAAF,CAAQzB,CAAW,CAAC0B,IAApB,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AACoC,QAAd,CAAuB7B,CAAW,CAACI,IAAnC,CAAyCJ,CAAzC,CAAsD,6BAAtD,EACAL,CAAU,GACb,CAED,MAAOK,CAAAA,CACV,CAzFK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the logic for the save/cancel modal.\n *\n * @module core_calendar/modal_delete\n * @class modal_delete\n * @copyright 2017 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n 'jquery',\n 'core/notification',\n 'core/custom_interaction_events',\n 'core/modal',\n 'core/modal_events',\n 'core/modal_registry',\n 'core_calendar/events',\n],\nfunction(\n $,\n Notification,\n CustomEvents,\n Modal,\n ModalEvents,\n ModalRegistry,\n CalendarEvents\n) {\n\n var registered = false;\n var SELECTORS = {\n DELETE_ONE_BUTTON: '[data-action=\"deleteone\"]',\n DELETE_ALL_BUTTON: '[data-action=\"deleteall\"]',\n CANCEL_BUTTON: '[data-action=\"cancel\"]',\n };\n\n /**\n * Constructor for the Modal.\n *\n * @param {object} root The root jQuery element for the modal\n */\n var ModalDelete = function(root) {\n Modal.call(this, root);\n\n this.setRemoveOnClose(true);\n };\n\n ModalDelete.TYPE = 'core_calendar-modal_delete';\n ModalDelete.prototype = Object.create(Modal.prototype);\n ModalDelete.prototype.constructor = ModalDelete;\n\n /**\n * Set up all of the event handling for the modal.\n *\n * @method registerEventListeners\n */\n ModalDelete.prototype.registerEventListeners = function() {\n // Apply parent event listeners.\n Modal.prototype.registerEventListeners.call(this);\n\n this.getModal().on(CustomEvents.events.activate, SELECTORS.DELETE_ONE_BUTTON, function(e, data) {\n var saveEvent = $.Event(ModalEvents.save);\n this.getRoot().trigger(saveEvent, this);\n\n if (!saveEvent.isDefaultPrevented()) {\n this.hide();\n data.originalEvent.preventDefault();\n }\n }.bind(this));\n\n this.getModal().on(CustomEvents.events.activate, SELECTORS.DELETE_ALL_BUTTON, function(e, data) {\n var saveEvent = $.Event(CalendarEvents.deleteAll);\n this.getRoot().trigger(saveEvent, this);\n\n if (!saveEvent.isDefaultPrevented()) {\n this.hide();\n data.originalEvent.preventDefault();\n }\n }.bind(this));\n\n this.getModal().on(CustomEvents.events.activate, SELECTORS.CANCEL_BUTTON, function(e, data) {\n var cancelEvent = $.Event(ModalEvents.cancel);\n this.getRoot().trigger(cancelEvent, this);\n\n if (!cancelEvent.isDefaultPrevented()) {\n this.hide();\n data.originalEvent.preventDefault();\n }\n }.bind(this));\n };\n\n // Automatically register with the modal registry the first time this module is imported so that you can create modals\n // of this type using the modal factory.\n if (!registered) {\n ModalRegistry.register(ModalDelete.TYPE, ModalDelete, 'calendar/event_delete_modal');\n registered = true;\n }\n\n return ModalDelete;\n});\n"],"file":"modal_delete.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/modal_delete.js"],"names":["define","$","Notification","CustomEvents","Modal","ModalEvents","ModalRegistry","CalendarEvents","registered","SELECTORS","DELETE_ONE_BUTTON","DELETE_ALL_BUTTON","CANCEL_BUTTON","ModalDelete","root","call","setRemoveOnClose","TYPE","prototype","Object","create","constructor","registerEventListeners","getModal","on","events","activate","e","data","saveEvent","Event","save","getRoot","trigger","isDefaultPrevented","hide","originalEvent","preventDefault","bind","deleteAll","cancelEvent","cancel","register"],"mappings":"AAsBAA,OAAM,8BAAC,CACH,QADG,CAEH,mBAFG,CAGH,gCAHG,CAIH,YAJG,CAKH,mBALG,CAMH,qBANG,CAOH,sBAPG,CAAD,CASN,SACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKI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Z,CAAkB,CAC5F,GAAIC,CAAAA,CAAS,CAAG5B,CAAC,CAAC6B,KAAF,CAAQvB,CAAc,CAACgC,SAAvB,CAAhB,CACA,KAAKP,OAAL,GAAeC,OAAf,CAAuBJ,CAAvB,CAAkC,IAAlC,EAEA,GAAI,CAACA,CAAS,CAACK,kBAAV,EAAL,CAAqC,CACjC,KAAKC,IAAL,GACAP,CAAI,CAACQ,aAAL,CAAmBC,cAAnB,EACH,CACJ,CAR6E,CAQ5EC,IAR4E,CAQvE,IARuE,CAA9E,EAUA,KAAKf,QAAL,GAAgBC,EAAhB,CAAmBrB,CAAY,CAACsB,MAAb,CAAoBC,QAAvC,CAAiDjB,CAAS,CAACG,aAA3D,CAA0E,SAASe,CAAT,CAAYC,CAAZ,CAAkB,CACxF,GAAIY,CAAAA,CAAW,CAAGvC,CAAC,CAAC6B,KAAF,CAAQzB,CAAW,CAACoC,MAApB,CAAlB,CACA,KAAKT,OAAL,GAAeC,OAAf,CAAuBO,CAAvB,CAAoC,IAApC,EAEA,GAAI,CAACA,CAAW,CAACN,kBAAZ,EAAL,CAAuC,CACnC,KAAKC,IAAL,GACAP,CAAI,CAACQ,aAAL,CAAmBC,cAAnB,EACH,CACJ,CARyE,CAQxEC,IARwE,CAQnE,IARmE,CAA1E,CASH,CAjCD,CAqCA,GAAI,CAAC9B,CAAL,CAAiB,CACbF,CAAa,CAACoC,QAAd,CAAuB7B,CAAW,CAACI,IAAnC,CAAyCJ,CAAzC,CAAsD,6BAAtD,EACAL,CAAU,GACb,CAED,MAAOK,CAAAA,CACV,CA1FK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the logic for the delete modal.\n *\n * @module core_calendar/modal_delete\n * @copyright 2017 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n 'jquery',\n 'core/notification',\n 'core/custom_interaction_events',\n 'core/modal',\n 'core/modal_events',\n 'core/modal_registry',\n 'core_calendar/events',\n],\nfunction(\n $,\n Notification,\n CustomEvents,\n Modal,\n ModalEvents,\n ModalRegistry,\n CalendarEvents\n) {\n\n var registered = false;\n var SELECTORS = {\n DELETE_ONE_BUTTON: '[data-action=\"deleteone\"]',\n DELETE_ALL_BUTTON: '[data-action=\"deleteall\"]',\n CANCEL_BUTTON: '[data-action=\"cancel\"]',\n };\n\n /**\n * Constructor for the Modal.\n *\n * @class\n * @param {object} root The root jQuery element for the modal\n */\n var ModalDelete = function(root) {\n Modal.call(this, root);\n\n this.setRemoveOnClose(true);\n };\n\n ModalDelete.TYPE = 'core_calendar-modal_delete';\n ModalDelete.prototype = Object.create(Modal.prototype);\n ModalDelete.prototype.constructor = ModalDelete;\n\n /**\n * Set up all of the event handling for the modal.\n *\n * @method registerEventListeners\n */\n ModalDelete.prototype.registerEventListeners = function() {\n // Apply parent event listeners.\n Modal.prototype.registerEventListeners.call(this);\n\n this.getModal().on(CustomEvents.events.activate, SELECTORS.DELETE_ONE_BUTTON, function(e, data) {\n var saveEvent = $.Event(ModalEvents.save);\n this.getRoot().trigger(saveEvent, this);\n\n if (!saveEvent.isDefaultPrevented()) {\n this.hide();\n data.originalEvent.preventDefault();\n }\n }.bind(this));\n\n this.getModal().on(CustomEvents.events.activate, SELECTORS.DELETE_ALL_BUTTON, function(e, data) {\n var saveEvent = $.Event(CalendarEvents.deleteAll);\n this.getRoot().trigger(saveEvent, this);\n\n if (!saveEvent.isDefaultPrevented()) {\n this.hide();\n data.originalEvent.preventDefault();\n }\n }.bind(this));\n\n this.getModal().on(CustomEvents.events.activate, SELECTORS.CANCEL_BUTTON, function(e, data) {\n var cancelEvent = $.Event(ModalEvents.cancel);\n this.getRoot().trigger(cancelEvent, this);\n\n if (!cancelEvent.isDefaultPrevented()) {\n this.hide();\n data.originalEvent.preventDefault();\n }\n }.bind(this));\n };\n\n // Automatically register with the modal registry the first time this module is imported so that you can create modals\n // of this type using the modal factory.\n if (!registered) {\n ModalRegistry.register(ModalDelete.TYPE, ModalDelete, 'calendar/event_delete_modal');\n registered = true;\n }\n\n return ModalDelete;\n});\n"],"file":"modal_delete.min.js"} \ No newline at end of file diff --git a/calendar/amd/build/month_navigation_drag_drop.min.js.map b/calendar/amd/build/month_navigation_drag_drop.min.js.map index 54ea3a7c28a06..fcca9e5d45fb3 100644 --- a/calendar/amd/build/month_navigation_drag_drop.min.js.map +++ b/calendar/amd/build/month_navigation_drag_drop.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/month_navigation_drag_drop.js"],"names":["define","$","DataStore","SELECTORS","DRAGGABLE","DROP_ZONE","HOVER_CLASS","TARGET_CLASS","registered","hoverTimer","root","updateHoverState","target","hovered","addClass","removeClass","addDropZoneIndicator","find","removeDropZoneIndicator","getTargetFromEvent","e","closest","length","dragstartHandler","eventElement","dragoverHandler","hasEventId","preventDefault","setTimeout","click","dragleaveHandler","clearTimeout","dropHandler","init","rootElement","document","addEventListener"],"mappings":"AA4BAA,OAAM,4CAAC,CACK,QADL,CAEK,oCAFL,CAAD,CAIE,SACIC,CADJ,CAEIC,CAFJ,CAGE,IAEFC,CAAAA,CAAS,CAAG,CACZC,SAAS,CAAE,kDADC,CAEZC,SAAS,CAAE,+BAFC,CAFV,CAMFC,CAAW,CAAG,uBANZ,CAOFC,CAAY,CAAG,aAPb,CAeFC,CAAU,GAfR,CAiBFC,CAAU,CAAG,IAjBX,CAmBFC,CAAI,CAAG,IAnBL,CA4BFC,CAAgB,CAAG,SAASC,CAAT,CAAiBC,CAAjB,CAA0B,CAC7C,GAAIA,CAAJ,CAAa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4B,CACxBV,CAAoB,EACvB,CACJ,CA7BE,CA+BV,CA9MK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle calendar drag and drop in the calendar\n * month view navigation.\n *\n * This code is run each time the calendar month view is re-rendered. We\n * only register the event handlers once per page load so that the in place\n * DOM updates that happen on month change don't continue to register handlers.\n *\n * @module core_calendar/month_navigation_drag_drop\n * @class month_navigation_drag_drop\n * @copyright 2017 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n 'jquery',\n 'core_calendar/drag_drop_data_store',\n ],\n function(\n $,\n DataStore\n ) {\n\n var SELECTORS = {\n DRAGGABLE: '[draggable=\"true\"][data-region=\"event-item\"]',\n DROP_ZONE: '[data-drop-zone=\"nav-link\"]',\n };\n var HOVER_CLASS = 'bg-primary text-white';\n var TARGET_CLASS = 'drop-target';\n var HOVER_TIME = 1000; // 1 second hover to change month.\n\n // We store some static variables at the module level because this\n // module is called each time the calendar month view is reloaded but\n // we want some actions to only occur ones.\n\n /* @var {bool} registered If the event listeners have been added */\n var registered = false;\n /* @var {int} hoverTimer The timeout id of any timeout waiting for hover */\n var hoverTimer = null;\n /* @var {object} root The root nav element we're operating on */\n var root = null;\n\n /**\n * Add or remove the appropriate styling to indicate whether\n * the drop target is being hovered over.\n *\n * @param {object} target The target drop zone element\n * @param {bool} hovered If the element is hovered over ot not\n */\n var updateHoverState = function(target, hovered) {\n if (hovered) {\n target.addClass(HOVER_CLASS);\n } else {\n target.removeClass(HOVER_CLASS);\n }\n };\n\n /**\n * Add some styling to the UI to indicate that the nav links\n * are an acceptable drop target.\n */\n var addDropZoneIndicator = function() {\n root.find(SELECTORS.DROP_ZONE).addClass(TARGET_CLASS);\n };\n\n /**\n * Remove the styling from the nav links.\n */\n var removeDropZoneIndicator = function() {\n root.find(SELECTORS.DROP_ZONE).removeClass(TARGET_CLASS);\n };\n\n /**\n * Get the drop zone target from the event, if one is found.\n *\n * @param {event} e Javascript event\n * @return {object|null}\n */\n var getTargetFromEvent = function(e) {\n var target = $(e.target).closest(SELECTORS.DROP_ZONE);\n return (target.length) ? target : null;\n };\n\n /**\n * This will add a visual indicator to the calendar UI to\n * indicate which nav link is a valid drop zone.\n */\n var dragstartHandler = function(e) {\n // Make sure the drag event is for a calendar event.\n var eventElement = $(e.target).closest(SELECTORS.DRAGGABLE);\n\n if (eventElement.length) {\n addDropZoneIndicator();\n }\n };\n\n /**\n * Update the hover state of the target nav element when\n * the user is dragging an event over it.\n *\n * This will add a visual indicator to the calendar UI to\n * indicate which nav link is being hovered.\n *\n * @param {event} e The dragover event\n */\n var dragoverHandler = function(e) {\n // Ignore dragging of non calendar events.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n e.preventDefault();\n var target = getTargetFromEvent(e);\n\n if (!target) {\n return;\n }\n\n // If we're not draggin a calendar event then\n // ignore it.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n if (!hoverTimer) {\n hoverTimer = setTimeout(function() {\n target.click();\n hoverTimer = null;\n }, HOVER_TIME);\n }\n\n updateHoverState(target, true);\n removeDropZoneIndicator();\n };\n\n /**\n * Update the hover state of the target nav element that was\n * previously dragged over but has is no longer a drag target.\n *\n * This will remove the visual indicator from the calendar UI\n * that was added by the dragoverHandler.\n *\n * @param {event} e The dragstart event\n */\n var dragleaveHandler = function(e) {\n // Ignore dragging of non calendar events.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n var target = getTargetFromEvent(e);\n\n if (!target) {\n return;\n }\n\n if (hoverTimer) {\n clearTimeout(hoverTimer);\n hoverTimer = null;\n }\n\n updateHoverState(target, false);\n addDropZoneIndicator();\n e.preventDefault();\n };\n\n /**\n * Remove the visual indicator from the calendar UI that was\n * added by the dragoverHandler.\n *\n * @param {event} e The drop event\n */\n var dropHandler = function(e) {\n // Ignore dragging of non calendar events.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n removeDropZoneIndicator();\n var target = getTargetFromEvent(e);\n\n if (!target) {\n return;\n }\n\n updateHoverState(target, false);\n e.preventDefault();\n };\n\n return {\n /**\n * Initialise the event handlers for the drag events.\n *\n * @param {object} rootElement The element containing calendar nav links\n */\n init: function(rootElement) {\n // Only register the handlers once on the first load.\n if (!registered) {\n // These handlers are only added the first time the module\n // is loaded because we don't want to have a new listener\n // added each time the \"init\" function is called otherwise we'll\n // end up with lots of stale handlers.\n document.addEventListener('dragstart', dragstartHandler, false);\n document.addEventListener('dragover', dragoverHandler, false);\n document.addEventListener('dragleave', dragleaveHandler, false);\n document.addEventListener('drop', dropHandler, false);\n document.addEventListener('dragend', removeDropZoneIndicator, false);\n registered = true;\n }\n\n // Update the module variable to operate on the given\n // root element.\n root = $(rootElement);\n\n // If we're currently dragging then add the indicators.\n if (DataStore.hasEventId()) {\n addDropZoneIndicator();\n }\n },\n };\n});\n"],"file":"month_navigation_drag_drop.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/month_navigation_drag_drop.js"],"names":["define","$","DataStore","SELECTORS","DRAGGABLE","DROP_ZONE","HOVER_CLASS","TARGET_CLASS","registered","hoverTimer","root","updateHoverState","target","hovered","addClass","removeClass","addDropZoneIndicator","find","removeDropZoneIndicator","getTargetFromEvent","e","closest","length","dragstartHandler","eventElement","dragoverHandler","hasEventId","preventDefault","setTimeout","click","dragleaveHandler","clearTimeout","dropHandler","init","rootElement","document","addEventListener"],"mappings":"AA2BAA,OAAM,4CAAC,CACK,QADL,CAEK,oCAFL,CAAD,CAIE,SACIC,CADJ,CAEIC,CAFJ,CAGE,IAEFC,CAA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AtC,KACAU,QAAQ,CAACC,gBAAT,CAA0B,WAA1B,CAAuCN,CAAvC,KACAK,QAAQ,CAACC,gBAAT,CAA0B,MAA1B,CAAkCJ,CAAlC,KACAG,QAAQ,CAACC,gBAAT,CAA0B,SAA1B,CAAqClB,CAArC,KACAV,CAAU,GACb,CAIDE,CAAI,CAAGT,CAAC,CAACiC,CAAD,CAAR,CAGA,GAAIhC,CAAS,CAACwB,UAAV,EAAJ,CAA4B,CACxBV,CAAoB,EACvB,CACJ,CA7BE,CA+BV,CA9MK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle calendar drag and drop in the calendar\n * month view navigation.\n *\n * This code is run each time the calendar month view is re-rendered. We\n * only register the event handlers once per page load so that the in place\n * DOM updates that happen on month change don't continue to register handlers.\n *\n * @module core_calendar/month_navigation_drag_drop\n * @copyright 2017 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n 'jquery',\n 'core_calendar/drag_drop_data_store',\n ],\n function(\n $,\n DataStore\n ) {\n\n var SELECTORS = {\n DRAGGABLE: '[draggable=\"true\"][data-region=\"event-item\"]',\n DROP_ZONE: '[data-drop-zone=\"nav-link\"]',\n };\n var HOVER_CLASS = 'bg-primary text-white';\n var TARGET_CLASS = 'drop-target';\n var HOVER_TIME = 1000; // 1 second hover to change month.\n\n // We store some static variables at the module level because this\n // module is called each time the calendar month view is reloaded but\n // we want some actions to only occur ones.\n\n /* @var {bool} registered If the event listeners have been added */\n var registered = false;\n /* @var {int} hoverTimer The timeout id of any timeout waiting for hover */\n var hoverTimer = null;\n /* @var {object} root The root nav element we're operating on */\n var root = null;\n\n /**\n * Add or remove the appropriate styling to indicate whether\n * the drop target is being hovered over.\n *\n * @param {object} target The target drop zone element\n * @param {bool} hovered If the element is hovered over ot not\n */\n var updateHoverState = function(target, hovered) {\n if (hovered) {\n target.addClass(HOVER_CLASS);\n } else {\n target.removeClass(HOVER_CLASS);\n }\n };\n\n /**\n * Add some styling to the UI to indicate that the nav links\n * are an acceptable drop target.\n */\n var addDropZoneIndicator = function() {\n root.find(SELECTORS.DROP_ZONE).addClass(TARGET_CLASS);\n };\n\n /**\n * Remove the styling from the nav links.\n */\n var removeDropZoneIndicator = function() {\n root.find(SELECTORS.DROP_ZONE).removeClass(TARGET_CLASS);\n };\n\n /**\n * Get the drop zone target from the event, if one is found.\n *\n * @param {event} e Javascript event\n * @return {object|null}\n */\n var getTargetFromEvent = function(e) {\n var target = $(e.target).closest(SELECTORS.DROP_ZONE);\n return (target.length) ? target : null;\n };\n\n /**\n * This will add a visual indicator to the calendar UI to\n * indicate which nav link is a valid drop zone.\n */\n var dragstartHandler = function(e) {\n // Make sure the drag event is for a calendar event.\n var eventElement = $(e.target).closest(SELECTORS.DRAGGABLE);\n\n if (eventElement.length) {\n addDropZoneIndicator();\n }\n };\n\n /**\n * Update the hover state of the target nav element when\n * the user is dragging an event over it.\n *\n * This will add a visual indicator to the calendar UI to\n * indicate which nav link is being hovered.\n *\n * @param {event} e The dragover event\n */\n var dragoverHandler = function(e) {\n // Ignore dragging of non calendar events.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n e.preventDefault();\n var target = getTargetFromEvent(e);\n\n if (!target) {\n return;\n }\n\n // If we're not draggin a calendar event then\n // ignore it.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n if (!hoverTimer) {\n hoverTimer = setTimeout(function() {\n target.click();\n hoverTimer = null;\n }, HOVER_TIME);\n }\n\n updateHoverState(target, true);\n removeDropZoneIndicator();\n };\n\n /**\n * Update the hover state of the target nav element that was\n * previously dragged over but has is no longer a drag target.\n *\n * This will remove the visual indicator from the calendar UI\n * that was added by the dragoverHandler.\n *\n * @param {event} e The dragstart event\n */\n var dragleaveHandler = function(e) {\n // Ignore dragging of non calendar events.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n var target = getTargetFromEvent(e);\n\n if (!target) {\n return;\n }\n\n if (hoverTimer) {\n clearTimeout(hoverTimer);\n hoverTimer = null;\n }\n\n updateHoverState(target, false);\n addDropZoneIndicator();\n e.preventDefault();\n };\n\n /**\n * Remove the visual indicator from the calendar UI that was\n * added by the dragoverHandler.\n *\n * @param {event} e The drop event\n */\n var dropHandler = function(e) {\n // Ignore dragging of non calendar events.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n removeDropZoneIndicator();\n var target = getTargetFromEvent(e);\n\n if (!target) {\n return;\n }\n\n updateHoverState(target, false);\n e.preventDefault();\n };\n\n return {\n /**\n * Initialise the event handlers for the drag events.\n *\n * @param {object} rootElement The element containing calendar nav links\n */\n init: function(rootElement) {\n // Only register the handlers once on the first load.\n if (!registered) {\n // These handlers are only added the first time the module\n // is loaded because we don't want to have a new listener\n // added each time the \"init\" function is called otherwise we'll\n // end up with lots of stale handlers.\n document.addEventListener('dragstart', dragstartHandler, false);\n document.addEventListener('dragover', dragoverHandler, false);\n document.addEventListener('dragleave', dragleaveHandler, false);\n document.addEventListener('drop', dropHandler, false);\n document.addEventListener('dragend', removeDropZoneIndicator, false);\n registered = true;\n }\n\n // Update the module variable to operate on the given\n // root element.\n root = $(rootElement);\n\n // If we're currently dragging then add the indicators.\n if (DataStore.hasEventId()) {\n addDropZoneIndicator();\n }\n },\n };\n});\n"],"file":"month_navigation_drag_drop.min.js"} \ No newline at end of file diff --git a/calendar/amd/build/month_view_drag_drop.min.js.map b/calendar/amd/build/month_view_drag_drop.min.js.map index 65f3f5d8a5a0e..ef439dbbd148d 100644 --- a/calendar/amd/build/month_view_drag_drop.min.js.map +++ b/calendar/amd/build/month_view_drag_drop.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/month_view_drag_drop.js"],"names":["define","$","Notification","Str","CalendarEvents","DataStore","SELECTORS","ROOT","DRAGGABLE","DROP_ZONE","WEEK","INVALID_DROP_ZONE_CLASS","INVALID_HOVER_CLASS","VALID_HOVER_CLASS","ALL_CLASSES","registered","getDropZoneFromEvent","e","dropZone","target","closest","length","isValidDropZone","dropTimestamp","attr","minTimestart","getMinTimestart","maxTimestart","getMaxTimestart","getDropZoneError","getMinError","getMaxError","clearAllDropZonesState","find","each","index","removeClass","updateHoverState","hovered","count","getDurationDays","valid","addClass","nextDropZone","next","nextWeek","children","first","updateAllDropZonesState","dragstartHandler","draggableElement","eventElement","eventId","minError","maxError","eventsSelector","duration","setEventId","setDurationDays","setMinTimestart","setMaxTimestart","setMinError","setMaxError","dataTransfer","effectAllowed","dropEffect","setData","dragoverHandler","hasEventId","preventDefault","dragleaveHandler","dropHandler","clearAll","getEventId","eventElementSelector","origin","trigger","moveEvent","message","get_string","then","string","exception","name","dragendHandler","calendarMonthChangedHandler","init","document","addEventListener","on","monthChanged"],"mappings":"AAwBAA,OAAM,sCAAC,CACK,QADL,CAEK,mBAFL,CAGK,UAHL,CAIK,sBAJL,CAKK,oCALL,CAAD,CAOE,SACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,CALJ,CAME,IAEFC,CAAAA,CAAS,CAAG,CACZC,IAAI,CAAE,0BADM,CAEZC,SAAS,CAAE,kDAFC,CAGZC,SAAS,CAAE,qCAHC,CAIZC,IAAI,CAAE,mCAJM,CAFV,CAQFC,CAAuB,CAAG,UARxB,CASFC,CAAmB,CAAG,sBATpB,CAUFC,CAAiB,CAAG,uBAVlB,CAWFC,CAAW,CAAGH,CAAuB,CAAG,GAA1B,CAAgCC,CAAhC,CAAsD,GAAtD,CAA4DC,CAXxE,CAaFE,CAAU,GAbR,CAsBFC,CAAoB,CAAG,SAASC,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AACC,gBAAT,CAA0B,WAA1B,CAAuCvC,CAAvC,KACAsC,QAAQ,CAACC,gBAAT,CAA0B,UAA1B,CAAsCrB,CAAtC,KACAoB,QAAQ,CAACC,gBAAT,CAA0B,WAA1B,CAAuClB,CAAvC,KACAiB,QAAQ,CAACC,gBAAT,CAA0B,MAA1B,CAAkCjB,CAAlC,KACAgB,QAAQ,CAACC,gBAAT,CAA0B,SAA1B,CAAqCJ,CAArC,KACAnF,CAAC,CAAC,MAAD,CAAD,CAAUwF,EAAV,CAAarF,CAAc,CAACsF,YAA5B,CAA0CL,CAA1C,EACAtE,CAAU,GACb,CACJ,CAlBE,CAoBV,CA3XK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle calendar drag and drop in the calendar\n * month view.\n *\n * @module core_calendar/month_view_drag_drop\n * @class month_view_drag_drop\n * @copyright 2017 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n 'jquery',\n 'core/notification',\n 'core/str',\n 'core_calendar/events',\n 'core_calendar/drag_drop_data_store'\n ],\n function(\n $,\n Notification,\n Str,\n CalendarEvents,\n DataStore\n ) {\n\n var SELECTORS = {\n ROOT: \"[data-region='calendar']\",\n DRAGGABLE: '[draggable=\"true\"][data-region=\"event-item\"]',\n DROP_ZONE: '[data-drop-zone=\"month-view-day\"]',\n WEEK: '[data-region=\"month-view-week\"]',\n };\n var INVALID_DROP_ZONE_CLASS = 'bg-faded';\n var INVALID_HOVER_CLASS = 'bg-danger text-white';\n var VALID_HOVER_CLASS = 'bg-primary text-white';\n var ALL_CLASSES = INVALID_DROP_ZONE_CLASS + ' ' + INVALID_HOVER_CLASS + ' ' + VALID_HOVER_CLASS;\n /* @var {bool} registered If the event listeners have been added */\n var registered = false;\n\n /**\n * Get the correct drop zone element from the given javascript\n * event.\n *\n * @param {event} e The javascript event\n * @return {object|null}\n */\n var getDropZoneFromEvent = function(e) {\n var dropZone = $(e.target).closest(SELECTORS.DROP_ZONE);\n return (dropZone.length) ? dropZone : null;\n };\n\n /**\n * Determine if the given dropzone element is within the acceptable\n * time range.\n *\n * The drop zone timestamp is midnight on that day so we should check\n * that the event's acceptable timestart value\n *\n * @param {object} dropZone The drop zone day from the calendar\n * @return {bool}\n */\n var isValidDropZone = function(dropZone) {\n var dropTimestamp = dropZone.attr('data-day-timestamp');\n var minTimestart = DataStore.getMinTimestart();\n var maxTimestart = DataStore.getMaxTimestart();\n\n if (minTimestart && minTimestart > dropTimestamp) {\n return false;\n }\n\n if (maxTimestart && maxTimestart < dropTimestamp) {\n return false;\n }\n\n return true;\n };\n\n /**\n * Get the error string to display for a given drop zone element\n * if it is invalid.\n *\n * @param {object} dropZone The drop zone day from the calendar\n * @return {string}\n */\n var getDropZoneError = function(dropZone) {\n var dropTimestamp = dropZone.attr('data-day-timestamp');\n var minTimestart = DataStore.getMinTimestart();\n var maxTimestart = DataStore.getMaxTimestart();\n\n if (minTimestart && minTimestart > dropTimestamp) {\n return DataStore.getMinError();\n }\n\n if (maxTimestart && maxTimestart < dropTimestamp) {\n return DataStore.getMaxError();\n }\n\n return null;\n };\n\n /**\n * Remove all of the styling from each of the drop zones in the calendar.\n */\n var clearAllDropZonesState = function() {\n $(SELECTORS.ROOT).find(SELECTORS.DROP_ZONE).each(function(index, dropZone) {\n dropZone = $(dropZone);\n dropZone.removeClass(ALL_CLASSES);\n });\n };\n\n /**\n * Update the hover state for the event in the calendar to reflect\n * which days the event will be moved to.\n *\n * If the drop zone is not being hovered then it will apply some\n * styling to reflect whether the drop zone is a valid or invalid\n * drop place for the current dragging event.\n *\n * This funciton supports events spanning multiple days and will\n * recurse to highlight (or remove highlight) each of the days\n * that the event will be moved to.\n *\n * For example: An event with a duration of 3 days will have\n * 3 days highlighted when it's dragged elsewhere in the calendar.\n * The current drag target and the 2 days following it (including\n * wrapping to the next week if necessary).\n *\n * @param {string|object} target The drag target element\n * @param {bool} hovered If the target is hovered or not\n * @param {int} count How many days to highlight (default to duration)\n */\n var updateHoverState = function(dropZone, hovered, count) {\n if (typeof count === 'undefined') {\n // This is how many days we need to highlight.\n count = DataStore.getDurationDays();\n }\n\n var valid = isValidDropZone(dropZone);\n dropZone.removeClass(ALL_CLASSES);\n\n if (hovered) {\n\n if (valid) {\n dropZone.addClass(VALID_HOVER_CLASS);\n } else {\n dropZone.addClass(INVALID_HOVER_CLASS);\n }\n } else {\n dropZone.removeClass(VALID_HOVER_CLASS + ' ' + INVALID_HOVER_CLASS);\n\n if (!valid) {\n dropZone.addClass(INVALID_DROP_ZONE_CLASS);\n }\n }\n\n count--;\n\n // If we've still got days to highlight then we should\n // find the next day.\n if (count > 0) {\n var nextDropZone = dropZone.next();\n\n // If there are no more days in this week then we\n // need to move down to the next week in the calendar.\n if (!nextDropZone.length) {\n var nextWeek = dropZone.closest(SELECTORS.WEEK).next();\n\n if (nextWeek.length) {\n nextDropZone = nextWeek.children(SELECTORS.DROP_ZONE).first();\n }\n }\n\n // If we found another day then let's recursively\n // update it's hover state.\n if (nextDropZone.length) {\n updateHoverState(nextDropZone, hovered, count);\n }\n }\n };\n\n /**\n * Find all of the calendar event drop zones in the calendar and update the display\n * for the user to indicate which zones are valid and invalid.\n */\n var updateAllDropZonesState = function() {\n $(SELECTORS.ROOT).find(SELECTORS.DROP_ZONE).each(function(index, dropZone) {\n dropZone = $(dropZone);\n\n if (!isValidDropZone(dropZone)) {\n updateHoverState(dropZone, false);\n }\n });\n };\n\n\n /**\n * Set up the module level variables to track which event is being\n * dragged and how many days it spans.\n *\n * @param {event} e The dragstart event\n */\n var dragstartHandler = function(e) {\n var target = $(e.target);\n var draggableElement = target.closest(SELECTORS.DRAGGABLE);\n\n if (!draggableElement.length) {\n return;\n }\n\n var eventElement = draggableElement.find('[data-event-id]');\n var eventId = eventElement.attr('data-event-id');\n var minTimestart = draggableElement.attr('data-min-day-timestamp');\n var maxTimestart = draggableElement.attr('data-max-day-timestamp');\n var minError = draggableElement.attr('data-min-day-error');\n var maxError = draggableElement.attr('data-max-day-error');\n var eventsSelector = SELECTORS.ROOT + ' [data-event-id=\"' + eventId + '\"]';\n var duration = $(eventsSelector).length;\n\n DataStore.setEventId(eventId);\n DataStore.setDurationDays(duration);\n\n if (minTimestart) {\n DataStore.setMinTimestart(minTimestart);\n }\n\n if (maxTimestart) {\n DataStore.setMaxTimestart(maxTimestart);\n }\n\n if (minError) {\n DataStore.setMinError(minError);\n }\n\n if (maxError) {\n DataStore.setMaxError(maxError);\n }\n\n e.dataTransfer.effectAllowed = \"move\";\n e.dataTransfer.dropEffect = \"move\";\n // Firefox requires a value to be set here or the drag won't\n // work and the dragover handler won't fire.\n e.dataTransfer.setData('text/plain', eventId);\n e.dropEffect = \"move\";\n\n updateAllDropZonesState();\n };\n\n /**\n * Update the hover state of the target day element when\n * the user is dragging an event over it.\n *\n * This will add a visual indicator to the calendar UI to\n * indicate which day(s) the event will be moved to.\n *\n * @param {event} e The dragstart event\n */\n var dragoverHandler = function(e) {\n // Ignore dragging of non calendar events.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n e.preventDefault();\n\n var dropZone = getDropZoneFromEvent(e);\n\n if (!dropZone) {\n return;\n }\n\n updateHoverState(dropZone, true);\n };\n\n /**\n * Update the hover state of the target day element that was\n * previously dragged over but has is no longer a drag target.\n *\n * This will remove the visual indicator from the calendar UI\n * that was added by the dragoverHandler.\n *\n * @param {event} e The dragstart event\n */\n var dragleaveHandler = function(e) {\n // Ignore dragging of non calendar events.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n var dropZone = getDropZoneFromEvent(e);\n\n if (!dropZone) {\n return;\n }\n\n updateHoverState(dropZone, false);\n e.preventDefault();\n };\n\n /**\n * Determines the event element, origin day, and destination day\n * once the user drops the calendar event. These three bits of data\n * are provided as the payload to the \"moveEvent\" calendar javascript\n * event that is fired.\n *\n * This will remove the visual indicator from the calendar UI\n * that was added by the dragoverHandler.\n *\n * @param {event} e The dragstart event\n */\n var dropHandler = function(e) {\n // Ignore dragging of non calendar events.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n var dropZone = getDropZoneFromEvent(e);\n\n if (!dropZone) {\n DataStore.clearAll();\n clearAllDropZonesState();\n return;\n }\n\n if (isValidDropZone(dropZone)) {\n var eventId = DataStore.getEventId();\n var eventElementSelector = SELECTORS.ROOT + ' [data-event-id=\"' + eventId + '\"]';\n var eventElement = $(eventElementSelector);\n var origin = null;\n\n if (eventElement.length) {\n origin = eventElement.closest(SELECTORS.DROP_ZONE);\n }\n\n $('body').trigger(CalendarEvents.moveEvent, [eventId, origin, dropZone]);\n } else {\n // If the drop zone is not valid then there is not need for us to\n // try to process it. Instead we can just show an error to the user.\n var message = getDropZoneError(dropZone);\n Str.get_string('errorinvaliddate', 'calendar').then(function(string) {\n Notification.exception({\n name: string,\n message: message || string\n });\n });\n }\n\n DataStore.clearAll();\n clearAllDropZonesState();\n\n e.preventDefault();\n };\n\n /**\n * Clear the data store and remove the drag indicators from the UI\n * when the drag event has finished.\n */\n var dragendHandler = function() {\n DataStore.clearAll();\n clearAllDropZonesState();\n };\n\n /**\n * Re-render the drop zones in the new month to highlight\n * which areas are or aren't acceptable to drop the calendar\n * event.\n */\n var calendarMonthChangedHandler = function() {\n updateAllDropZonesState();\n };\n\n return {\n /**\n * Initialise the event handlers for the drag events.\n */\n init: function() {\n if (!registered) {\n // These handlers are only added the first time the module\n // is loaded because we don't want to have a new listener\n // added each time the \"init\" function is called otherwise we'll\n // end up with lots of stale handlers.\n document.addEventListener('dragstart', dragstartHandler, false);\n document.addEventListener('dragover', dragoverHandler, false);\n document.addEventListener('dragleave', dragleaveHandler, false);\n document.addEventListener('drop', dropHandler, false);\n document.addEventListener('dragend', dragendHandler, false);\n $('body').on(CalendarEvents.monthChanged, calendarMonthChangedHandler);\n registered = true;\n }\n },\n };\n});\n"],"file":"month_view_drag_drop.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/month_view_drag_drop.js"],"names":["define","$","Notification","Str","CalendarEvents","DataStore","SELECTORS","ROOT","DRAGGABLE","DROP_ZONE","WEEK","INVALID_DROP_ZONE_CLASS","INVALID_HOVER_CLASS","VALID_HOVER_CLASS","ALL_CLASSES","registered","getDropZoneFromEvent","e","dropZone","target","closest","length","isValidDropZone","dropTimestamp","attr","minTimestart","getMinTimestart","maxTimestart","getMaxTimestart","getDropZoneError","getMinError","getMaxError","clearAllDropZonesState","find","each","index","removeClass","updateHoverState","hovered","count","getDurationDays","valid","addClass","nextDropZone","next","nextWeek","children","first","updateAllDropZonesState","dragstartHandler","draggableElement","eventElement","eventId","minError","maxError","eventsSelector","duration","setEventId","setDurationDays","setMinTimestart","setMaxTimestart","setMinError","setMaxError","dataTransfer","effectAllowed","dropEffect","setData","dragoverHandler","hasEventId","preventDefault","dragleaveHandler","dropHandler","clearAll","getEventId","eventElementSelector","origin","trigger","moveEvent","message","get_string","then","string","exception","name","dragendHandler","calendarMonthChangedHandler","init","document","addEventListener","on","monthChanged"],"mappings":"AAuBAA,OAAM,sCAAC,CACK,QADL,CAEK,mBAFL,CAGK,UAHL,CAIK,sBAJL,CAKK,oCALL,CAAD,CAOE,SACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,CALJ,CAME,IAEFC,CAAAA,CAAS,CAAG,CACZC,IAAI,CAAE,0BADM,CAEZC,SAAS,CAAE,kDAFC,CAGZC,SAAS,CAAE,qCAHC,CAIZC,IAAI,CAAE,mCAJM,CAFV,CAQFC,CAAuB,CAAG,UARxB,CASFC,CAAmB,CAAG,sBATpB,CAUFC,CA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A/UK,CAsVFqD,CAA2B,CAAG,UAAW,CACzCrC,CAAuB,EAC1B,CAxVK,CA0VN,MAAO,CAIHsC,IAAI,CAAE,eAAW,CACb,GAAI,CAACvE,CAAL,CAAiB,CAKbwE,QAAQ,CAACC,gBAAT,CAA0B,WAA1B,CAAuCvC,CAAvC,KACAsC,QAAQ,CAACC,gBAAT,CAA0B,UAA1B,CAAsCrB,CAAtC,KACAoB,QAAQ,CAACC,gBAAT,CAA0B,WAA1B,CAAuClB,CAAvC,KACAiB,QAAQ,CAACC,gBAAT,CAA0B,MAA1B,CAAkCjB,CAAlC,KACAgB,QAAQ,CAACC,gBAAT,CAA0B,SAA1B,CAAqCJ,CAArC,KACAnF,CAAC,CAAC,MAAD,CAAD,CAAUwF,EAAV,CAAarF,CAAc,CAACsF,YAA5B,CAA0CL,CAA1C,EACAtE,CAAU,GACb,CACJ,CAlBE,CAoBV,CA3XK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle calendar drag and drop in the calendar\n * month view.\n *\n * @module core_calendar/month_view_drag_drop\n * @copyright 2017 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n 'jquery',\n 'core/notification',\n 'core/str',\n 'core_calendar/events',\n 'core_calendar/drag_drop_data_store'\n ],\n function(\n $,\n Notification,\n Str,\n CalendarEvents,\n DataStore\n ) {\n\n var SELECTORS = {\n ROOT: \"[data-region='calendar']\",\n DRAGGABLE: '[draggable=\"true\"][data-region=\"event-item\"]',\n DROP_ZONE: '[data-drop-zone=\"month-view-day\"]',\n WEEK: '[data-region=\"month-view-week\"]',\n };\n var INVALID_DROP_ZONE_CLASS = 'bg-faded';\n var INVALID_HOVER_CLASS = 'bg-danger text-white';\n var VALID_HOVER_CLASS = 'bg-primary text-white';\n var ALL_CLASSES = INVALID_DROP_ZONE_CLASS + ' ' + INVALID_HOVER_CLASS + ' ' + VALID_HOVER_CLASS;\n /* @var {bool} registered If the event listeners have been added */\n var registered = false;\n\n /**\n * Get the correct drop zone element from the given javascript\n * event.\n *\n * @param {event} e The javascript event\n * @return {object|null}\n */\n var getDropZoneFromEvent = function(e) {\n var dropZone = $(e.target).closest(SELECTORS.DROP_ZONE);\n return (dropZone.length) ? dropZone : null;\n };\n\n /**\n * Determine if the given dropzone element is within the acceptable\n * time range.\n *\n * The drop zone timestamp is midnight on that day so we should check\n * that the event's acceptable timestart value\n *\n * @param {object} dropZone The drop zone day from the calendar\n * @return {bool}\n */\n var isValidDropZone = function(dropZone) {\n var dropTimestamp = dropZone.attr('data-day-timestamp');\n var minTimestart = DataStore.getMinTimestart();\n var maxTimestart = DataStore.getMaxTimestart();\n\n if (minTimestart && minTimestart > dropTimestamp) {\n return false;\n }\n\n if (maxTimestart && maxTimestart < dropTimestamp) {\n return false;\n }\n\n return true;\n };\n\n /**\n * Get the error string to display for a given drop zone element\n * if it is invalid.\n *\n * @param {object} dropZone The drop zone day from the calendar\n * @return {string}\n */\n var getDropZoneError = function(dropZone) {\n var dropTimestamp = dropZone.attr('data-day-timestamp');\n var minTimestart = DataStore.getMinTimestart();\n var maxTimestart = DataStore.getMaxTimestart();\n\n if (minTimestart && minTimestart > dropTimestamp) {\n return DataStore.getMinError();\n }\n\n if (maxTimestart && maxTimestart < dropTimestamp) {\n return DataStore.getMaxError();\n }\n\n return null;\n };\n\n /**\n * Remove all of the styling from each of the drop zones in the calendar.\n */\n var clearAllDropZonesState = function() {\n $(SELECTORS.ROOT).find(SELECTORS.DROP_ZONE).each(function(index, dropZone) {\n dropZone = $(dropZone);\n dropZone.removeClass(ALL_CLASSES);\n });\n };\n\n /**\n * Update the hover state for the event in the calendar to reflect\n * which days the event will be moved to.\n *\n * If the drop zone is not being hovered then it will apply some\n * styling to reflect whether the drop zone is a valid or invalid\n * drop place for the current dragging event.\n *\n * This funciton supports events spanning multiple days and will\n * recurse to highlight (or remove highlight) each of the days\n * that the event will be moved to.\n *\n * For example: An event with a duration of 3 days will have\n * 3 days highlighted when it's dragged elsewhere in the calendar.\n * The current drag target and the 2 days following it (including\n * wrapping to the next week if necessary).\n *\n * @param {string|object} target The drag target element\n * @param {bool} hovered If the target is hovered or not\n * @param {int} count How many days to highlight (default to duration)\n */\n var updateHoverState = function(dropZone, hovered, count) {\n if (typeof count === 'undefined') {\n // This is how many days we need to highlight.\n count = DataStore.getDurationDays();\n }\n\n var valid = isValidDropZone(dropZone);\n dropZone.removeClass(ALL_CLASSES);\n\n if (hovered) {\n\n if (valid) {\n dropZone.addClass(VALID_HOVER_CLASS);\n } else {\n dropZone.addClass(INVALID_HOVER_CLASS);\n }\n } else {\n dropZone.removeClass(VALID_HOVER_CLASS + ' ' + INVALID_HOVER_CLASS);\n\n if (!valid) {\n dropZone.addClass(INVALID_DROP_ZONE_CLASS);\n }\n }\n\n count--;\n\n // If we've still got days to highlight then we should\n // find the next day.\n if (count > 0) {\n var nextDropZone = dropZone.next();\n\n // If there are no more days in this week then we\n // need to move down to the next week in the calendar.\n if (!nextDropZone.length) {\n var nextWeek = dropZone.closest(SELECTORS.WEEK).next();\n\n if (nextWeek.length) {\n nextDropZone = nextWeek.children(SELECTORS.DROP_ZONE).first();\n }\n }\n\n // If we found another day then let's recursively\n // update it's hover state.\n if (nextDropZone.length) {\n updateHoverState(nextDropZone, hovered, count);\n }\n }\n };\n\n /**\n * Find all of the calendar event drop zones in the calendar and update the display\n * for the user to indicate which zones are valid and invalid.\n */\n var updateAllDropZonesState = function() {\n $(SELECTORS.ROOT).find(SELECTORS.DROP_ZONE).each(function(index, dropZone) {\n dropZone = $(dropZone);\n\n if (!isValidDropZone(dropZone)) {\n updateHoverState(dropZone, false);\n }\n });\n };\n\n\n /**\n * Set up the module level variables to track which event is being\n * dragged and how many days it spans.\n *\n * @param {event} e The dragstart event\n */\n var dragstartHandler = function(e) {\n var target = $(e.target);\n var draggableElement = target.closest(SELECTORS.DRAGGABLE);\n\n if (!draggableElement.length) {\n return;\n }\n\n var eventElement = draggableElement.find('[data-event-id]');\n var eventId = eventElement.attr('data-event-id');\n var minTimestart = draggableElement.attr('data-min-day-timestamp');\n var maxTimestart = draggableElement.attr('data-max-day-timestamp');\n var minError = draggableElement.attr('data-min-day-error');\n var maxError = draggableElement.attr('data-max-day-error');\n var eventsSelector = SELECTORS.ROOT + ' [data-event-id=\"' + eventId + '\"]';\n var duration = $(eventsSelector).length;\n\n DataStore.setEventId(eventId);\n DataStore.setDurationDays(duration);\n\n if (minTimestart) {\n DataStore.setMinTimestart(minTimestart);\n }\n\n if (maxTimestart) {\n DataStore.setMaxTimestart(maxTimestart);\n }\n\n if (minError) {\n DataStore.setMinError(minError);\n }\n\n if (maxError) {\n DataStore.setMaxError(maxError);\n }\n\n e.dataTransfer.effectAllowed = \"move\";\n e.dataTransfer.dropEffect = \"move\";\n // Firefox requires a value to be set here or the drag won't\n // work and the dragover handler won't fire.\n e.dataTransfer.setData('text/plain', eventId);\n e.dropEffect = \"move\";\n\n updateAllDropZonesState();\n };\n\n /**\n * Update the hover state of the target day element when\n * the user is dragging an event over it.\n *\n * This will add a visual indicator to the calendar UI to\n * indicate which day(s) the event will be moved to.\n *\n * @param {event} e The dragstart event\n */\n var dragoverHandler = function(e) {\n // Ignore dragging of non calendar events.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n e.preventDefault();\n\n var dropZone = getDropZoneFromEvent(e);\n\n if (!dropZone) {\n return;\n }\n\n updateHoverState(dropZone, true);\n };\n\n /**\n * Update the hover state of the target day element that was\n * previously dragged over but has is no longer a drag target.\n *\n * This will remove the visual indicator from the calendar UI\n * that was added by the dragoverHandler.\n *\n * @param {event} e The dragstart event\n */\n var dragleaveHandler = function(e) {\n // Ignore dragging of non calendar events.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n var dropZone = getDropZoneFromEvent(e);\n\n if (!dropZone) {\n return;\n }\n\n updateHoverState(dropZone, false);\n e.preventDefault();\n };\n\n /**\n * Determines the event element, origin day, and destination day\n * once the user drops the calendar event. These three bits of data\n * are provided as the payload to the \"moveEvent\" calendar javascript\n * event that is fired.\n *\n * This will remove the visual indicator from the calendar UI\n * that was added by the dragoverHandler.\n *\n * @param {event} e The dragstart event\n */\n var dropHandler = function(e) {\n // Ignore dragging of non calendar events.\n if (!DataStore.hasEventId()) {\n return;\n }\n\n var dropZone = getDropZoneFromEvent(e);\n\n if (!dropZone) {\n DataStore.clearAll();\n clearAllDropZonesState();\n return;\n }\n\n if (isValidDropZone(dropZone)) {\n var eventId = DataStore.getEventId();\n var eventElementSelector = SELECTORS.ROOT + ' [data-event-id=\"' + eventId + '\"]';\n var eventElement = $(eventElementSelector);\n var origin = null;\n\n if (eventElement.length) {\n origin = eventElement.closest(SELECTORS.DROP_ZONE);\n }\n\n $('body').trigger(CalendarEvents.moveEvent, [eventId, origin, dropZone]);\n } else {\n // If the drop zone is not valid then there is not need for us to\n // try to process it. Instead we can just show an error to the user.\n var message = getDropZoneError(dropZone);\n Str.get_string('errorinvaliddate', 'calendar').then(function(string) {\n Notification.exception({\n name: string,\n message: message || string\n });\n });\n }\n\n DataStore.clearAll();\n clearAllDropZonesState();\n\n e.preventDefault();\n };\n\n /**\n * Clear the data store and remove the drag indicators from the UI\n * when the drag event has finished.\n */\n var dragendHandler = function() {\n DataStore.clearAll();\n clearAllDropZonesState();\n };\n\n /**\n * Re-render the drop zones in the new month to highlight\n * which areas are or aren't acceptable to drop the calendar\n * event.\n */\n var calendarMonthChangedHandler = function() {\n updateAllDropZonesState();\n };\n\n return {\n /**\n * Initialise the event handlers for the drag events.\n */\n init: function() {\n if (!registered) {\n // These handlers are only added the first time the module\n // is loaded because we don't want to have a new listener\n // added each time the \"init\" function is called otherwise we'll\n // end up with lots of stale handlers.\n document.addEventListener('dragstart', dragstartHandler, false);\n document.addEventListener('dragover', dragoverHandler, false);\n document.addEventListener('dragleave', dragleaveHandler, false);\n document.addEventListener('drop', dropHandler, false);\n document.addEventListener('dragend', dragendHandler, false);\n $('body').on(CalendarEvents.monthChanged, calendarMonthChangedHandler);\n registered = true;\n }\n },\n };\n});\n"],"file":"month_view_drag_drop.min.js"} \ No newline at end of file diff --git a/calendar/amd/build/repository.min.js.map b/calendar/amd/build/repository.min.js.map index 8792399bd7d01..fc47fa42e01d4 100644 --- a/calendar/amd/build/repository.min.js.map +++ b/calendar/amd/build/repository.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/repository.js"],"names":["deleteEvent","eventId","deleteSeries","Ajax","call","methodname","args","events","eventid","repeat","getEventById","submitCreateUpdateForm","formData","formdata","getCalendarMonthData","year","month","courseId","categoryId","includeNavigation","mini","day","courseid","categoryid","includenavigation","getCalendarDayData","updateEventStartDay","dayTimestamp","daytimestamp","getCalendarUpcomingData","getCourseGroupsData"],"mappings":"sTAuBA,uDAUO,GAAMA,CAAAA,CAAW,CAAG,SAACC,CAAD,CAAmC,IAAzBC,CAAAA,CAAyB,2DAW1D,MAAOC,WAAKC,IAAL,CAAU,CAVD,CACZC,UAAU,CAAE,sCADA,CAEZC,IAAI,CAAE,CACFC,MAAM,CAAE,CAAC,CACLC,OAAO,CAAEP,CADJ,CAELQ,MAAM,CAAEP,CAFH,CAAD,CADN,CAFM,CAUC,CAAV,EAAqB,CAArB,CACV,CAZM,C,gBAqBA,GAAMQ,CAAAA,CAAY,CAAG,SAACT,CAAD,CAAa,CASrC,MAAOE,WAAKC,IAAL,CAAU,CAPD,CACZC,UAAU,CAAE,wCADA,CAEZC,IAAI,CAAE,CACFE,OAAO,CAAEP,CADP,CAFM,CAOC,CAAV,EAAqB,CAArB,CACV,CAVM,C,iB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YAAY,CAAED,CAFZ,CAFM,CAQC,CAAV,EAAqB,CAArB,CACV,CAVM,C,wBAoBA,GAAME,CAAAA,CAAuB,CAAG,SAACZ,CAAD,CAAWC,CAAX,CAA0B,CAS7D,MAAOf,WAAKC,IAAL,CAAU,CARD,CACZC,UAAU,CAAE,0CADA,CAEZC,IAAI,CAAE,CACFgB,QAAQ,CAAEL,CADR,CAEFM,UAAU,CAAEL,CAFV,CAFM,CAQC,CAAV,EAAqB,CAArB,CACV,CAVM,C,4BAkBA,GAAMY,CAAAA,CAAmB,CAAG,SAACb,CAAD,CAAc,CAQ7C,MAAOd,WAAKC,IAAL,CAAU,CAPD,CACZC,UAAU,CAAE,8BADA,CAEZC,IAAI,CAAE,CACFgB,QAAQ,CAAEL,CADR,CAFM,CAOC,CAAV,EAAqB,CAArB,CACV,CATM,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle calendar ajax actions.\n *\n * @module core_calendar/repository\n * @class repository\n * @copyright 2017 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Ajax from 'core/ajax';\n\n/**\n * Delete a calendar event.\n *\n * @method deleteEvent\n * @param {number} eventId The event id.\n * @param {boolean} deleteSeries Whether to delete all events in the series\n * @return {promise} Resolved with requested calendar event\n */\nexport const deleteEvent = (eventId, deleteSeries = false) => {\n const request = {\n methodname: 'core_calendar_delete_calendar_events',\n args: {\n events: [{\n eventid: eventId,\n repeat: deleteSeries,\n }]\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Get a calendar event by id.\n *\n * @method getEventById\n * @param {number} eventId The event id.\n * @return {promise} Resolved with requested calendar event\n */\nexport const getEventById = (eventId) => {\n\n const request = {\n methodname: 'core_calendar_get_calendar_event_by_id',\n args: {\n eventid: eventId\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Submit the form data for the event form.\n *\n * @method submitCreateUpdateForm\n * @param {string} formData The URL encoded values from the form\n * @return {promise} Resolved with the new or edited event\n */\nexport const submitCreateUpdateForm = (formData) => {\n const request = {\n methodname: 'core_calendar_submit_create_update_form',\n args: {\n formdata: formData\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Get calendar data for the month view.\n *\n * @method getCalendarMonthData\n * @param {number} year Year\n * @param {number} month Month\n * @param {number} courseId The course id.\n * @param {number} categoryId The category id.\n * @param {boolean} includeNavigation Whether to include navigation.\n * @param {boolean} mini Whether the month is in mini view.\n * @param {number} day Day (optional)\n * @return {promise} Resolved with the month view data.\n */\nexport const getCalendarMonthData = (year, month, courseId, categoryId, includeNavigation, mini, day = 1) => {\n const request = {\n methodname: 'core_calendar_get_calendar_monthly_view',\n args: {\n year,\n month,\n courseid: courseId,\n categoryid: categoryId,\n includenavigation: includeNavigation,\n mini,\n day,\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Get calendar data for the day view.\n *\n * @method getCalendarDayData\n * @param {number} year Year\n * @param {number} month Month\n * @param {number} day Day\n * @param {number} courseId The course id.\n * @param {number} categoryId The id of the category whose events are shown\n * @return {promise} Resolved with the day view data.\n */\nexport const getCalendarDayData = (year, month, day, courseId, categoryId) => {\n const request = {\n methodname: 'core_calendar_get_calendar_day_view',\n args: {\n year,\n month,\n day,\n courseid: courseId,\n categoryid: categoryId,\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Change the start day for the given event id. The day timestamp\n * only has to be any time during the target day because only the\n * date information is extracted, the time of the day is ignored.\n *\n * @param {int} eventId The id of the event to update\n * @param {int} dayTimestamp A timestamp for some time during the target day\n * @return {promise}\n */\nexport const updateEventStartDay = (eventId, dayTimestamp) => {\n const request = {\n methodname: 'core_calendar_update_event_start_day',\n args: {\n eventid: eventId,\n daytimestamp: dayTimestamp\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Get calendar upcoming data.\n *\n * @method getCalendarUpcomingData\n * @param {number} courseId The course id.\n * @param {number} categoryId The category id.\n * @return {promise} Resolved with the month view data.\n */\nexport const getCalendarUpcomingData = (courseId, categoryId) => {\n const request = {\n methodname: 'core_calendar_get_calendar_upcoming_view',\n args: {\n courseid: courseId,\n categoryid: categoryId,\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Get the groups by course id.\n *\n * @param {Number} courseId The course id to fetch the groups from.\n * @return {promise} Resolved with the course groups.\n */\nexport const getCourseGroupsData = (courseId) => {\n const request = {\n methodname: 'core_group_get_course_groups',\n args: {\n courseid: courseId\n }\n };\n\n return Ajax.call([request])[0];\n};\n"],"file":"repository.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/repository.js"],"names":["deleteEvent","eventId","deleteSeries","Ajax","call","methodname","args","events","eventid","repeat","getEventById","submitCreateUpdateForm","formData","formdata","getCalendarMonthData","year","month","courseId","categoryId","includeNavigation","mini","day","courseid","categoryid","includenavigation","getCalendarDayData","updateEventStartDay","dayTimestamp","daytimestamp","getCalendarUpcomingData","getCourseGroupsData"],"mappings":"sTAsBA,uDAUO,GAAMA,CAAAA,CAAW,CAAG,SAACC,CAAD,CAAmC,IAAzBC,CAAAA,CAAyB,2DAW1D,MAAOC,WAAKC,IAAL,CAAU,CAVD,CACZC,UAAU,CAAE,sCADA,CAEZC,IAAI,CAAE,CACFC,MAAM,CAAE,CAAC,CACLC,OAAO,CAAEP,CADJ,CAELQ,MAAM,CAAEP,CAFH,CAAD,CADN,CAFM,CAUC,CAAV,EAAqB,CAArB,CACV,CAZM,C,gBAqBA,GAAMQ,CAAAA,CAAY,CAAG,SAACT,CAAD,CAAa,CAS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SAACzB,CAAD,CAAU0B,CAAV,CAA2B,CAS1D,MAAOxB,WAAKC,IAAL,CAAU,CARD,CACZC,UAAU,CAAE,sCADA,CAEZC,IAAI,CAAE,CACFE,OAAO,CAAEP,CADP,CAEF2B,YAAY,CAAED,CAFZ,CAFM,CAQC,CAAV,EAAqB,CAArB,CACV,CAVM,C,wBAoBA,GAAME,CAAAA,CAAuB,CAAG,SAACZ,CAAD,CAAWC,CAAX,CAA0B,CAS7D,MAAOf,WAAKC,IAAL,CAAU,CARD,CACZC,UAAU,CAAE,0CADA,CAEZC,IAAI,CAAE,CACFgB,QAAQ,CAAEL,CADR,CAEFM,UAAU,CAAEL,CAFV,CAFM,CAQC,CAAV,EAAqB,CAArB,CACV,CAVM,C,4BAkBA,GAAMY,CAAAA,CAAmB,CAAG,SAACb,CAAD,CAAc,CAQ7C,MAAOd,WAAKC,IAAL,CAAU,CAPD,CACZC,UAAU,CAAE,8BADA,CAEZC,IAAI,CAAE,CACFgB,QAAQ,CAAEL,CADR,CAFM,CAOC,CAAV,EAAqB,CAArB,CACV,CATM,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle calendar ajax actions.\n *\n * @module core_calendar/repository\n * @copyright 2017 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Ajax from 'core/ajax';\n\n/**\n * Delete a calendar event.\n *\n * @method deleteEvent\n * @param {number} eventId The event id.\n * @param {boolean} deleteSeries Whether to delete all events in the series\n * @return {promise} Resolved with requested calendar event\n */\nexport const deleteEvent = (eventId, deleteSeries = false) => {\n const request = {\n methodname: 'core_calendar_delete_calendar_events',\n args: {\n events: [{\n eventid: eventId,\n repeat: deleteSeries,\n }]\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Get a calendar event by id.\n *\n * @method getEventById\n * @param {number} eventId The event id.\n * @return {promise} Resolved with requested calendar event\n */\nexport const getEventById = (eventId) => {\n\n const request = {\n methodname: 'core_calendar_get_calendar_event_by_id',\n args: {\n eventid: eventId\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Submit the form data for the event form.\n *\n * @method submitCreateUpdateForm\n * @param {string} formData The URL encoded values from the form\n * @return {promise} Resolved with the new or edited event\n */\nexport const submitCreateUpdateForm = (formData) => {\n const request = {\n methodname: 'core_calendar_submit_create_update_form',\n args: {\n formdata: formData\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Get calendar data for the month view.\n *\n * @method getCalendarMonthData\n * @param {number} year Year\n * @param {number} month Month\n * @param {number} courseId The course id.\n * @param {number} categoryId The category id.\n * @param {boolean} includeNavigation Whether to include navigation.\n * @param {boolean} mini Whether the month is in mini view.\n * @param {number} day Day (optional)\n * @return {promise} Resolved with the month view data.\n */\nexport const getCalendarMonthData = (year, month, courseId, categoryId, includeNavigation, mini, day = 1) => {\n const request = {\n methodname: 'core_calendar_get_calendar_monthly_view',\n args: {\n year,\n month,\n courseid: courseId,\n categoryid: categoryId,\n includenavigation: includeNavigation,\n mini,\n day,\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Get calendar data for the day view.\n *\n * @method getCalendarDayData\n * @param {number} year Year\n * @param {number} month Month\n * @param {number} day Day\n * @param {number} courseId The course id.\n * @param {number} categoryId The id of the category whose events are shown\n * @return {promise} Resolved with the day view data.\n */\nexport const getCalendarDayData = (year, month, day, courseId, categoryId) => {\n const request = {\n methodname: 'core_calendar_get_calendar_day_view',\n args: {\n year,\n month,\n day,\n courseid: courseId,\n categoryid: categoryId,\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Change the start day for the given event id. The day timestamp\n * only has to be any time during the target day because only the\n * date information is extracted, the time of the day is ignored.\n *\n * @param {int} eventId The id of the event to update\n * @param {int} dayTimestamp A timestamp for some time during the target day\n * @return {promise}\n */\nexport const updateEventStartDay = (eventId, dayTimestamp) => {\n const request = {\n methodname: 'core_calendar_update_event_start_day',\n args: {\n eventid: eventId,\n daytimestamp: dayTimestamp\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Get calendar upcoming data.\n *\n * @method getCalendarUpcomingData\n * @param {number} courseId The course id.\n * @param {number} categoryId The category id.\n * @return {promise} Resolved with the month view data.\n */\nexport const getCalendarUpcomingData = (courseId, categoryId) => {\n const request = {\n methodname: 'core_calendar_get_calendar_upcoming_view',\n args: {\n courseid: courseId,\n categoryid: categoryId,\n }\n };\n\n return Ajax.call([request])[0];\n};\n\n/**\n * Get the groups by course id.\n *\n * @param {Number} courseId The course id to fetch the groups from.\n * @return {promise} Resolved with the course groups.\n */\nexport const getCourseGroupsData = (courseId) => {\n const request = {\n methodname: 'core_group_get_course_groups',\n args: {\n courseid: courseId\n }\n };\n\n return Ajax.call([request])[0];\n};\n"],"file":"repository.min.js"} \ No newline at end of file diff --git a/calendar/amd/src/events.js b/calendar/amd/src/events.js index 5ead82790e298..60838a4f3acdf 100644 --- a/calendar/amd/src/events.js +++ b/calendar/amd/src/events.js @@ -17,7 +17,6 @@ * Contain the events the calendar component can fire. * * @module core_calendar/events - * @class calendar_events * @copyright 2017 Simey Lameze * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/calendar/amd/src/modal_delete.js b/calendar/amd/src/modal_delete.js index 7e91b5f07d8c8..f1320b29bf81e 100644 --- a/calendar/amd/src/modal_delete.js +++ b/calendar/amd/src/modal_delete.js @@ -14,10 +14,9 @@ // along with Moodle. If not, see . /** - * Contain the logic for the save/cancel modal. + * Contain the logic for the delete modal. * * @module core_calendar/modal_delete - * @class modal_delete * @copyright 2017 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -50,6 +49,7 @@ function( /** * Constructor for the Modal. * + * @class * @param {object} root The root jQuery element for the modal */ var ModalDelete = function(root) { diff --git a/calendar/amd/src/month_navigation_drag_drop.js b/calendar/amd/src/month_navigation_drag_drop.js index cb88098316171..00db7ad2bdf69 100644 --- a/calendar/amd/src/month_navigation_drag_drop.js +++ b/calendar/amd/src/month_navigation_drag_drop.js @@ -22,7 +22,6 @@ * DOM updates that happen on month change don't continue to register handlers. * * @module core_calendar/month_navigation_drag_drop - * @class month_navigation_drag_drop * @copyright 2017 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/calendar/amd/src/month_view_drag_drop.js b/calendar/amd/src/month_view_drag_drop.js index a59df72e9a65e..fc09c10d6c7af 100644 --- a/calendar/amd/src/month_view_drag_drop.js +++ b/calendar/amd/src/month_view_drag_drop.js @@ -18,7 +18,6 @@ * month view. * * @module core_calendar/month_view_drag_drop - * @class month_view_drag_drop * @copyright 2017 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/calendar/amd/src/repository.js b/calendar/amd/src/repository.js index 06a9ac7b6efc3..1f2ff8ab9f303 100644 --- a/calendar/amd/src/repository.js +++ b/calendar/amd/src/repository.js @@ -17,7 +17,6 @@ * A javascript module to handle calendar ajax actions. * * @module core_calendar/repository - * @class repository * @copyright 2017 Simey Lameze * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/course/amd/build/copy_modal.min.js.map b/course/amd/build/copy_modal.min.js.map index 3f4c220cc241c..a6073d5c0e32f 100644 --- a/course/amd/build/copy_modal.min.js.map +++ b/course/amd/build/copy_modal.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/copy_modal.js"],"names":["define","$","Str","ModalFactory","ModalEvents","ajax","Fragment","Notification","Config","CopyModal","contextid","course","modalObj","spinner","createModal","get_string","then","title","create","type","types","DEFAULT","body","large","done","modal","getRoot","on","processModalForm","e","formredirect","preventDefault","setBody","hide","catch","exception","Error","updateModalBody","formdata","params","JSON","stringify","id","shortname","setTitle","loadFragment","copyform","find","serialize","formjson","invalid","merge","length","first","focus","call","methodname","args","jsonformdata","redirect","wwwroot","window","location","assign","fail","init","context","url","URL","getAttribute","URLSearchParams","search","courseid","get","response","show"],"mappings":"AA0BAA,OAAM,0BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,oBAAvB,CAA6C,mBAA7C,CACC,WADD,CACc,eADd,CAC+B,mBAD/B,CACoD,aADpD,CAAD,CAEE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA+BC,CAA/B,CAA4CC,CAA5C,CAAkDC,CAAlD,CAA4DC,CAA5D,CAA0EC,CAA1E,CAAkF,IAKlFC,CAAAA,CAAS,CAAG,EALsE,CAMlFC,CANkF,CAOlFC,CAPkF,CAQlFC,CARkF,CASlFC,CAAO,oFAT2E,CAkBtF,QAASC,CAAAA,CAAT,EAAuB,CAEnBZ,CAAG,CAACa,UAAJ,CAAe,SAAf,EAA0BC,IAA1B,CAA+B,SAASC,CAAT,CAAgB,CAE3Cd,CAAY,CAACe,MAAb,CAAoB,CAChBC,IAAI,CAAEhB,CAAY,CAACiB,KAAb,CAAmBC,OADT,CAEhBJ,KAAK,CAAEA,CAFS,CAGhBK,IAAI,CAAET,CAHU,CAIhBU,KAAK,GAJW,CAApB,EAMCC,IAND,CAMM,SAASC,CAAT,CAAgB,CAClBb,CAAQ,CAAGa,CAAX,CAEAb,CAAQ,CAACc,OAAT,GAAmBC,EAAnB,CAAsB,OAAtB,CAA+B,kBAA/B,CAAmDC,CAAnD,EACAhB,CAAQ,CAACc,OAAT,GAAmBC,EAAnB,CAAsB,OAAtB,CAA+B,mBAA/B,CAAoD,SAASE,CAAT,CAAY,CAC5DA,CAAC,CAACC,YAAF,IACAF,CAAgB,CAACC,CAAD,CAEnB,CAJ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+B,CAAAA,eAAJ,CAAoBH,CAAG,CAACI,MAAxB,CAHyB,CAIlCC,CAAQ,CAAGjC,CAAM,CAACkC,GAAP,CAAW,IAAX,CAJuB,CAMtCpE,CAAI,CAACkD,IAAL,CAAU,CAAC,CACPC,UAAU,CAAE,yBADL,CAEPC,IAAI,CAAE,CACF,QAAW,CAAC,IAAO,CAACe,CAAD,CAAR,CADT,CAFC,CAAD,CAAV,EAKI,CALJ,EAKOhD,IALP,CAKY,SAASkD,CAAT,CAAmB,CAE3B/D,CAAM,CAAG+D,CAAQ,CAAC,CAAD,CAAjB,CACArC,CAAe,EAElB,CAVD,EAUG2B,IAVH,CAUQ,UAAW,CACfzD,CAAY,CAAC4B,SAAb,CAAuB,GAAIC,CAAAA,KAAJ,CAAU,uBAAV,CAAvB,CACH,CAZD,EAcAxB,CAAQ,CAAC+D,IAAT,EACH,CArBD,CAuBH,CA7BD,CA+BA,MAAOlE,CAAAA,CACV,CAlKK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * This module provides the course copy modal from the course and\n * category management screen.\n *\n * @module course\n * @copyright 2020 onward The Moodle Users Association \n * @author Matt Porritt \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.9\n */\n\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/modal_events',\n 'core/ajax', 'core/fragment', 'core/notification', 'core/config'],\n function($, Str, ModalFactory, ModalEvents, ajax, Fragment, Notification, Config) {\n\n /**\n * Module level variables.\n */\n var CopyModal = {};\n var contextid;\n var course;\n var modalObj;\n var spinner = '

'\n + ''\n + '

';\n\n /**\n * Creates the modal for the course copy form\n *\n * @private\n */\n function createModal() {\n // Get the Title String.\n Str.get_string('loading').then(function(title) {\n // Create the Modal.\n ModalFactory.create({\n type: ModalFactory.types.DEFAULT,\n title: title,\n body: spinner,\n large: true\n })\n .done(function(modal) {\n modalObj = modal;\n // Explicitly handle form click events.\n modalObj.getRoot().on('click', '#id_submitreturn', processModalForm);\n modalObj.getRoot().on('click', '#id_submitdisplay', function(e) {\n e.formredirect = true;\n processModalForm(e);\n\n });\n modalObj.getRoot().on('click', '#id_cancel', function(e) {\n e.preventDefault();\n modalObj.setBody(spinner);\n modalObj.hide();\n });\n });\n return;\n }).catch(function() {\n Notification.exception(new Error('Failed to load string: loading'));\n });\n }\n\n /**\n * Updates the body of the modal window.\n *\n * @param {Object} formdata\n * @private\n */\n function updateModalBody(formdata) {\n if (typeof formdata === \"undefined\") {\n formdata = {};\n }\n\n var params = {\n 'jsonformdata': JSON.stringify(formdata),\n 'courseid': course.id\n };\n\n modalObj.setBody(spinner);\n Str.get_string('copycoursetitle', 'backup', course.shortname).then(function(title) {\n modalObj.setTitle(title);\n modalObj.setBody(Fragment.loadFragment('course', 'new_base_form', contextid, params));\n return;\n }).catch(function() {\n Notification.exception(new Error('Failed to load string: copycoursetitle'));\n });\n }\n\n /**\n * Updates Moodle form with selected information.\n *\n * @param {Object} e\n * @private\n */\n function processModalForm(e) {\n e.preventDefault(); // Stop modal from closing.\n\n // Form data.\n var copyform = modalObj.getRoot().find('form').serialize();\n var formjson = JSON.stringify(copyform);\n\n // Handle invalid form fields for better UX.\n var invalid = $.merge(\n modalObj.getRoot().find('[aria-invalid=\"true\"]'),\n modalObj.getRoot().find('.error')\n );\n\n if (invalid.length) {\n invalid.first().focus();\n return;\n }\n\n // Submit form via ajax.\n ajax.call([{\n methodname: 'core_backup_submit_copy_form',\n args: {\n jsonformdata: formjson\n },\n }])[0].done(function() {\n // For submission succeeded.\n modalObj.setBody(spinner);\n modalObj.hide();\n\n if (e.formredirect == true) {\n // We are redirecting to copy progress display.\n let redirect = Config.wwwroot + \"/backup/copyprogress.php?id=\" + course.id;\n window.location.assign(redirect);\n }\n\n }).fail(function() {\n // Form submission failed server side, redisplay with errors.\n updateModalBody(copyform);\n });\n }\n\n /**\n * Initialise the class.\n *\n * @param {Object} context\n * @public\n */\n CopyModal.init = function(context) {\n contextid = context;\n // Setup the initial Modal.\n createModal();\n\n // Setup the click handlers on the copy buttons.\n $('.action-copy').on('click', function(e) {\n e.preventDefault(); // Stop. Hammer time.\n let url = new URL(this.getAttribute('href'));\n let params = new URLSearchParams(url.search);\n let courseid = params.get('id');\n\n ajax.call([{ // Get the course information.\n methodname: 'core_course_get_courses',\n args: {\n 'options': {'ids': [courseid]},\n },\n }])[0].done(function(response) {\n // We have the course info get the modal content.\n course = response[0];\n updateModalBody();\n\n }).fail(function() {\n Notification.exception(new Error('Failed to load course'));\n });\n\n modalObj.show();\n });\n\n };\n\n return CopyModal;\n});\n"],"file":"copy_modal.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/copy_modal.js"],"names":["define","$","Str","ModalFactory","ModalEvents","ajax","Fragment","Notification","Config","CopyModal","contextid","course","modalObj","spinner","createModal","get_string","then","title","create","type","types","DEFAULT","body","large","done","modal","getRoot","on","processModalForm","e","formredirect","preventDefault","setBody","hide","catch","exception","Error","updateModalBody","formdata","params","JSON","stringify","id","shortname","setTitle","loadFragment","copyform","find","serialize","formjson","invalid","merge","length","first","focus","call","methodname","args","jsonformdata","redirect","wwwroot","window","location","assign","fail","init","context","url","URL","getAttribute","URLSearchParams","search","courseid","get","response","show"],"mappings":"AA0BAA,OAAM,0BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,oBAAvB,CAA6C,mBAA7C,CACC,WADD,CACc,eADd,CAC+B,mBAD/B,CACoD,aADpD,CAAD,CAEE,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA+BC,CAA/B,CAA4CC,CAA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CAAU,uBAAV,CAAvB,CACH,CAZD,EAcAxB,CAAQ,CAAC+D,IAAT,EACH,CArBD,CAuBH,CA7BD,CA+BA,MAAOlE,CAAAA,CACV,CAnKK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * This module provides the course copy modal from the course and\n * category management screen.\n *\n * @module core_course/copy_modal\n * @copyright 2020 onward The Moodle Users Association \n * @author Matt Porritt \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.9\n */\n\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/modal_events',\n 'core/ajax', 'core/fragment', 'core/notification', 'core/config'],\n function($, Str, ModalFactory, ModalEvents, ajax, Fragment, Notification, Config) {\n\n /**\n * Module level variables.\n */\n var CopyModal = {};\n var contextid;\n var course;\n var modalObj;\n var spinner = '

'\n + ''\n + '

';\n\n /**\n * Creates the modal for the course copy form\n *\n * @private\n */\n function createModal() {\n // Get the Title String.\n Str.get_string('loading').then(function(title) {\n // Create the Modal.\n ModalFactory.create({\n type: ModalFactory.types.DEFAULT,\n title: title,\n body: spinner,\n large: true\n })\n .done(function(modal) {\n modalObj = modal;\n // Explicitly handle form click events.\n modalObj.getRoot().on('click', '#id_submitreturn', processModalForm);\n modalObj.getRoot().on('click', '#id_submitdisplay', function(e) {\n e.formredirect = true;\n processModalForm(e);\n\n });\n modalObj.getRoot().on('click', '#id_cancel', function(e) {\n e.preventDefault();\n modalObj.setBody(spinner);\n modalObj.hide();\n });\n });\n return;\n }).catch(function() {\n Notification.exception(new Error('Failed to load string: loading'));\n });\n }\n\n /**\n * Updates the body of the modal window.\n *\n * @param {Object} formdata\n * @private\n */\n function updateModalBody(formdata) {\n if (typeof formdata === \"undefined\") {\n formdata = {};\n }\n\n var params = {\n 'jsonformdata': JSON.stringify(formdata),\n 'courseid': course.id\n };\n\n modalObj.setBody(spinner);\n Str.get_string('copycoursetitle', 'backup', course.shortname).then(function(title) {\n modalObj.setTitle(title);\n modalObj.setBody(Fragment.loadFragment('course', 'new_base_form', contextid, params));\n return;\n }).catch(function() {\n Notification.exception(new Error('Failed to load string: copycoursetitle'));\n });\n }\n\n /**\n * Updates Moodle form with selected information.\n *\n * @param {Object} e\n * @private\n */\n function processModalForm(e) {\n e.preventDefault(); // Stop modal from closing.\n\n // Form data.\n var copyform = modalObj.getRoot().find('form').serialize();\n var formjson = JSON.stringify(copyform);\n\n // Handle invalid form fields for better UX.\n var invalid = $.merge(\n modalObj.getRoot().find('[aria-invalid=\"true\"]'),\n modalObj.getRoot().find('.error')\n );\n\n if (invalid.length) {\n invalid.first().focus();\n return;\n }\n\n // Submit form via ajax.\n ajax.call([{\n methodname: 'core_backup_submit_copy_form',\n args: {\n jsonformdata: formjson\n },\n }])[0].done(function() {\n // For submission succeeded.\n modalObj.setBody(spinner);\n modalObj.hide();\n\n if (e.formredirect == true) {\n // We are redirecting to copy progress display.\n let redirect = Config.wwwroot + \"/backup/copyprogress.php?id=\" + course.id;\n window.location.assign(redirect);\n }\n\n }).fail(function() {\n // Form submission failed server side, redisplay with errors.\n updateModalBody(copyform);\n });\n }\n\n /**\n * Initialise the class.\n *\n * @method\n * @param {Object} context\n * @public\n */\n CopyModal.init = function(context) {\n contextid = context;\n // Setup the initial Modal.\n createModal();\n\n // Setup the click handlers on the copy buttons.\n $('.action-copy').on('click', function(e) {\n e.preventDefault(); // Stop. Hammer time.\n let url = new URL(this.getAttribute('href'));\n let params = new URLSearchParams(url.search);\n let courseid = params.get('id');\n\n ajax.call([{ // Get the course information.\n methodname: 'core_course_get_courses',\n args: {\n 'options': {'ids': [courseid]},\n },\n }])[0].done(function(response) {\n // We have the course info get the modal content.\n course = response[0];\n updateModalBody();\n\n }).fail(function() {\n Notification.exception(new Error('Failed to load course'));\n });\n\n modalObj.show();\n });\n\n };\n\n return CopyModal;\n});\n"],"file":"copy_modal.min.js"} \ No newline at end of file diff --git a/course/amd/src/copy_modal.js b/course/amd/src/copy_modal.js index 56c273371eee2..d4daa58421ad7 100644 --- a/course/amd/src/copy_modal.js +++ b/course/amd/src/copy_modal.js @@ -17,7 +17,7 @@ * This module provides the course copy modal from the course and * category management screen. * - * @module course + * @module core_course/copy_modal * @copyright 2020 onward The Moodle Users Association * @author Matt Porritt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -151,6 +151,7 @@ define(['jquery', 'core/str', 'core/modal_factory', 'core/modal_events', /** * Initialise the class. * + * @method * @param {Object} context * @public */ diff --git a/enrol/manual/amd/build/form-potential-user-selector.min.js.map b/enrol/manual/amd/build/form-potential-user-selector.min.js.map index e473e7376619f..776a1b58dbdf6 100644 --- a/enrol/manual/amd/build/form-potential-user-selector.min.js.map +++ b/enrol/manual/amd/build/form-potential-user-selector.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/form-potential-user-selector.js"],"names":["define","$","Ajax","Templates","Str","processResults","selector","results","users","isArray","each","index","user","push","value","id","label","_label","transport","query","success","failure","promise","courseid","attr","userfields","split","enrolid","perpage","parseInt","isNaN","call","methodname","args","search","searchanywhere","page","then","promises","i","length","ctx","identity","k","result","exec","customfields","forEach","customfield","shortname","hasidentity","join","render","when","apply","arguments","get_string","toomanyuserstoshow","fail"],"mappings":"AAwBAA,OAAM,6CAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAA0C,UAA1C,CAAD,CAAwD,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6BC,CAA7B,CAAkC,CAE5F,MAAsE,CAElEC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAn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AlBD,EAmBAF,CAAG,CAACC,QAAJ,CAAeA,CAAQ,CAACS,IAAT,CAAc,IAAd,CAAf,CACAb,CAAQ,CAACzB,IAAT,CAAcV,CAAS,CAACiD,MAAV,CAAiB,4CAAjB,CAA+DX,CAA/D,CAAd,CACH,CAxBD,EA2BA,MAAOxC,CAAAA,CAAC,CAACoD,IAAF,CAAOC,KAAP,CAAarD,CAAC,CAACoD,IAAf,CAAqBf,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAIJ,CAAAA,CAAI,CAAGsB,SAAX,CACAtD,CAAC,CAACS,IAAF,CAAOH,CAAP,CAAgB,SAASI,CAAT,CAAgBC,CAAhB,CAAsB,CAClCA,CAAI,CAACK,MAAL,CAAcgB,CAAI,CAACM,CAAD,CAAlB,CACAA,CAAC,EACJ,CAHD,EAIAnB,CAAO,CAACb,CAAD,CAEV,CARM,CAUV,CAxCD,IAwCO,CACH,MAAOH,CAAAA,CAAG,CAACoD,UAAJ,CAAe,oBAAf,CAAqC,MAArC,CAA6C,IAAM5B,CAAnD,EAA4DS,IAA5D,CAAiE,SAASoB,CAAT,CAA6B,CACjGrC,CAAO,CAACqC,CAAD,CAEV,CAHM,CAIV,CAEJ,CAnDD,EAmDGC,IAnDH,CAmDQrC,CAnDR,CAoDH,CAlGiE,CAsGzE,CAxGK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Potential user selector module.\n *\n * @module enrol_manual/form-potential-user-selector\n * @class form-potential-user-selector\n * @copyright 2016 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates', 'core/str'], function($, Ajax, Templates, Str) {\n\n return /** @alias module:enrol_manual/form-potential-user-selector */ {\n\n processResults: function(selector, results) {\n var users = [];\n if ($.isArray(results)) {\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n\n } else {\n return results;\n }\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n var courseid = $(selector).attr('courseid');\n var userfields = $(selector).attr('userfields').split(',');\n if (typeof courseid === \"undefined\") {\n courseid = '1';\n }\n var enrolid = $(selector).attr('enrolid');\n if (typeof enrolid === \"undefined\") {\n enrolid = '';\n }\n var perpage = parseInt($(selector).attr('perpage'));\n if (isNaN(perpage)) {\n perpage = 100;\n }\n\n promise = Ajax.call([{\n methodname: 'core_enrol_get_potential_users',\n args: {\n courseid: courseid,\n enrolid: enrolid,\n search: query,\n searchanywhere: true,\n page: 0,\n perpage: perpage + 1\n }\n }]);\n\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n if (results.length <= perpage) {\n // Render the label.\n const profileRegex = /^profile_field_(.*)$/;\n $.each(results, function(index, user) {\n var ctx = user,\n identity = [];\n $.each(userfields, function(i, k) {\n const result = profileRegex.exec(k);\n if (result) {\n if (user.customfields) {\n user.customfields.forEach(function(customfield) {\n if (customfield.shortname === result[1]) {\n ctx.hasidentity = true;\n identity.push(customfield.value);\n }\n\n });\n }\n } else {\n if (typeof user[k] !== 'undefined' && user[k] !== '') {\n ctx.hasidentity = true;\n identity.push(user[k]);\n }\n }\n });\n ctx.identity = identity.join(', ');\n promises.push(Templates.render('enrol_manual/form-user-selector-suggestion', ctx));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results, function(index, user) {\n user._label = args[i];\n i++;\n });\n success(results);\n return;\n });\n\n } else {\n return Str.get_string('toomanyuserstoshow', 'core', '>' + perpage).then(function(toomanyuserstoshow) {\n success(toomanyuserstoshow);\n return;\n });\n }\n\n }).fail(failure);\n }\n\n };\n\n});\n"],"file":"form-potential-user-selector.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/form-potential-user-selector.js"],"names":["define","$","Ajax","Templates","Str","processResults","selector","results","users","isArray","each","index","user","push","value","id","label","_label","transport","query","success","failure","promise","courseid","attr","userfields","split","enrolid","perpage","parseInt","isNaN","call","methodname","args","search","searchanywhere","page","then","promises","i","length","ctx","identity","k","result","exec","customfields","forEach","customfield","shortname","hasidentity","join","render","when","apply","arguments","get_string","toomanyuserstoshow","fail"],"mappings":"AAuBAA,OAAM,6CAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAA0C,UAA1C,CAAD,CAAwD,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6BC,CAA7B,CAAkC,CAE5F,MAAsE,CAElEC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAK,CAAG,EAAZ,CACA,GAAIP,CAAC,CAACQ,OAAF,CAAUF,CAAV,CAAJ,CAAwB,CACpBN,CAAC,CAACS,IAAF,CAAOH,CAAP,CAAgB,SAASI,CAAT,CAAgBC,CAAhB,CAAsB,CAClCJ,CAAK,CAACK,IAAN,CAAW,CACPC,KAAK,CAAEF,CAAI,CAACG,EADL,CAEPC,KAAK,CAAEJ,CAAI,CAACK,MAFL,CAAX,CAIH,CALD,EAMA,MAAOT,CAAAA,CAEV,CATD,IASO,CACH,MAAOD,CAAAA,CACV,CACJ,CAhBiE,CAkBlEW,SAAS,CAAE,mBAASZ,CAAT,CAAmBa,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,IAC/CC,CAAAA,CAD+C,CAE/CC,CAAQ,CAAGtB,CAAC,CAACK,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,UAAjB,CAFoC,CAG/CC,CAAU,CAAGxB,CAAC,CAACK,CAAD,CAAD,CA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AA6C,IAAM5B,CAAnD,EAA4DS,IAA5D,CAAiE,SAASoB,CAAT,CAA6B,CACjGrC,CAAO,CAACqC,CAAD,CAEV,CAHM,CAIV,CAEJ,CAnDD,EAmDGC,IAnDH,CAmDQrC,CAnDR,CAoDH,CAlGiE,CAsGzE,CAxGK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Potential user selector module.\n *\n * @module enrol_manual/form-potential-user-selector\n * @copyright 2016 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates', 'core/str'], function($, Ajax, Templates, Str) {\n\n return /** @alias module:enrol_manual/form-potential-user-selector */ {\n\n processResults: function(selector, results) {\n var users = [];\n if ($.isArray(results)) {\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n\n } else {\n return results;\n }\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n var courseid = $(selector).attr('courseid');\n var userfields = $(selector).attr('userfields').split(',');\n if (typeof courseid === \"undefined\") {\n courseid = '1';\n }\n var enrolid = $(selector).attr('enrolid');\n if (typeof enrolid === \"undefined\") {\n enrolid = '';\n }\n var perpage = parseInt($(selector).attr('perpage'));\n if (isNaN(perpage)) {\n perpage = 100;\n }\n\n promise = Ajax.call([{\n methodname: 'core_enrol_get_potential_users',\n args: {\n courseid: courseid,\n enrolid: enrolid,\n search: query,\n searchanywhere: true,\n page: 0,\n perpage: perpage + 1\n }\n }]);\n\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n if (results.length <= perpage) {\n // Render the label.\n const profileRegex = /^profile_field_(.*)$/;\n $.each(results, function(index, user) {\n var ctx = user,\n identity = [];\n $.each(userfields, function(i, k) {\n const result = profileRegex.exec(k);\n if (result) {\n if (user.customfields) {\n user.customfields.forEach(function(customfield) {\n if (customfield.shortname === result[1]) {\n ctx.hasidentity = true;\n identity.push(customfield.value);\n }\n\n });\n }\n } else {\n if (typeof user[k] !== 'undefined' && user[k] !== '') {\n ctx.hasidentity = true;\n identity.push(user[k]);\n }\n }\n });\n ctx.identity = identity.join(', ');\n promises.push(Templates.render('enrol_manual/form-user-selector-suggestion', ctx));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results, function(index, user) {\n user._label = args[i];\n i++;\n });\n success(results);\n return;\n });\n\n } else {\n return Str.get_string('toomanyuserstoshow', 'core', '>' + perpage).then(function(toomanyuserstoshow) {\n success(toomanyuserstoshow);\n return;\n });\n }\n\n }).fail(failure);\n }\n\n };\n\n});\n"],"file":"form-potential-user-selector.min.js"} \ No newline at end of file diff --git a/enrol/manual/amd/src/form-potential-user-selector.js b/enrol/manual/amd/src/form-potential-user-selector.js index 3776fc0821b7e..ed30e0b49ba60 100644 --- a/enrol/manual/amd/src/form-potential-user-selector.js +++ b/enrol/manual/amd/src/form-potential-user-selector.js @@ -17,7 +17,6 @@ * Potential user selector module. * * @module enrol_manual/form-potential-user-selector - * @class form-potential-user-selector * @copyright 2016 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/filter/amd/build/events.min.js.map b/filter/amd/build/events.min.js.map index 26a5d41821da8..d88914917485d 100644 --- a/filter/amd/build/events.min.js.map +++ b/filter/amd/build/events.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/events.js"],"names":["eventTypes","filterContentUpdated","notifyFilterContentUpdated","nodes","legacyEventsRegistered","Y","use","document","addEventListener","e","trigger","M","core","event","FILTER_CONTENT_UPDATED","detail","fire","NodeList"],"mappings":"6NAyBA,uDAQO,GAAMA,CAAAA,CAAU,CAAG,CAYtBC,oBAAoB,CAAE,6BAZA,CAAnB,C,4CAuBmC,QAA7BC,CAAAA,0BAA6B,CAAAC,CAAK,CAAI,CAG/CA,CAAK,CAAG,cAAkBA,CAAlB,CAAR,CAEA,MAAO,oBAAcH,CAAU,CAACC,oBAAzB,CAA+C,CAACE,KAAK,CAALA,CAAD,CAA/C,CACV,C,CAED,GAAIC,CAAAA,CAAsB,GAA1B,CACA,GAAI,CAACA,CAAL,CAA6B,CAKzBC,CAAC,CAACC,GAAF,CAAM,OAAN,CAAe,mBAAf,CAAoC,UAAM,CAEtCC,QAAQ,CAACC,gBAAT,CAA0BR,CAAU,CAACC,oBAArC,CAA2D,SAAAQ,CAAC,CAAI,CAE5D,cAAOF,QAAP,EAAiBG,OAAjB,CAAyBC,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAaC,sBAAtC,CAA8D,CAAC,cAAOL,CAAC,CAACM,MAAF,CAASZ,KAAhB,CAAD,CAA9D,EAGAE,CAAC,CAACW,IAAF,CAAOL,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAaC,sBAApB,CAA4C,CAACX,KAAK,CAAE,GAAIE,CAAAA,CAAC,CAACY,QAAN,CAAeR,CAAC,CAACM,MAAF,CAASZ,KAAxB,CAAR,CAA5C,CACH,CAND,CAOH,CATD,EAWAC,CAAsB,GACzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/ //\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript events for the `core_filter` subsystem.\n *\n * @module core_filters/events\n * @copyright 2021 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 4.0\n */\n\nimport {dispatchEvent} from 'core/event_dispatcher';\nimport {getList as normalistNodeList} from 'core/normalise';\nimport jQuery from 'jquery';\n\n/**\n * Events for the `core_filter` subsystem.\n *\n * @constant\n * @property {String} filterContentUpdated See {@link event:filterContentUpdated}\n */\nexport const eventTypes = {\n /**\n * An event triggered when page content is updated and must be processed by the filter system.\n *\n * An example of this is loading user text that could have equations in it. MathJax can typeset the equations but\n * only if it is notified that there are new nodes in the page that need processing.\n *\n * @event filterContentUpdated\n * @type {CustomEvent}\n * @property {object} detail\n * @property {NodeElement[]} detail.nodes The list of parent nodes which were updated\n */\n filterContentUpdated: 'core_filters/contentUpdated',\n};\n\n/**\n * Trigger an event to indicate that the specified nodes were updated and should be processed by the filter system.\n *\n * @method notifyFilterContentUpdated\n * @param {jQuery|Array} nodes\n * @returns {CustomEvent}\n * @fires filterContentUpdated\n */\nexport const notifyFilterContentUpdated = nodes => {\n // Historically this could be a jQuery Object.\n // Normalise the list of nodes to a NodeList.\n nodes = normalistNodeList(nodes);\n\n return dispatchEvent(eventTypes.filterContentUpdated, {nodes});\n};\n\nlet legacyEventsRegistered = false;\nif (!legacyEventsRegistered) {\n // The following event triggers are legacy and will be removed in the future.\n // The following approach provides a backwards-compatability layer for the new events.\n // Code should be updated to make use of native events.\n\n Y.use('event', 'moodle-core-event', () => {\n // Provide a backwards-compatability layer for YUI Events.\n document.addEventListener(eventTypes.filterContentUpdated, e => {\n // Trigger the legacy jQuery event.\n jQuery(document).trigger(M.core.event.FILTER_CONTENT_UPDATED, [jQuery(e.detail.nodes)]);\n\n // Trigger the legacy YUI event.\n Y.fire(M.core.event.FILTER_CONTENT_UPDATED, {nodes: new Y.NodeList(e.detail.nodes)});\n });\n });\n\n legacyEventsRegistered = true;\n}\n"],"file":"events.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/events.js"],"names":["eventTypes","filterContentUpdated","notifyFilterContentUpdated","nodes","legacyEventsRegistered","Y","use","document","addEventListener","e","trigger","M","core","event","FILTER_CONTENT_UPDATED","detail","fire","NodeList"],"mappings":"6NAgCA,uDAQO,GAAMA,CAAAA,CAAU,CAAG,CAYtBC,oBAAoB,CAAE,6BAZA,CAAnB,C,4CAuBmC,QAA7BC,CAAAA,0BAA6B,CAAAC,CAAK,CAAI,CAG/CA,CAAK,CAAG,cAAkBA,CAAlB,CAAR,CAEA,MAAO,oBAAcH,CAAU,CAACC,oBAAzB,CAA+C,CAACE,KAAK,CAALA,CAAD,CAA/C,CACV,C,CAED,GAAIC,CAAAA,CAAsB,GAA1B,CACA,GAAI,CAACA,CAAL,CAA6B,CAKzBC,CAAC,CAACC,GAAF,CAAM,OAAN,CAAe,mBAAf,CAAoC,UAAM,CAEtCC,QAAQ,CAACC,gBAAT,CAA0BR,CAAU,CAACC,oBAArC,CAA2D,SAAAQ,CAAC,CAAI,CAE5D,cAAOF,QAAP,EAAiBG,OAAjB,CAAyBC,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAaC,sBAAtC,CAA8D,CAAC,cAAOL,CAAC,CAACM,MAAF,CAASZ,KAAhB,CAAD,CAA9D,EAGAE,CAAC,CAACW,IAAF,CAAOL,CAAC,CAACC,IAAF,CAAOC,KAAP,CAAaC,sBAApB,CAA4C,CAACX,KAAK,CAAE,GAAIE,CAAAA,CAAC,CAACY,QAAN,CAAeR,CAAC,CAACM,MAAF,CAASZ,KAAxB,CAAR,CAA5C,CACH,CAND,CAOH,CATD,EAWAC,CAAsB,GACzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/ //\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript events for the `core_filter` subsystem.\n *\n * @module core_filters/events\n * @copyright 2021 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 4.0\n *\n * @example Example of listening to a filter event.\n * import {eventTypes as filterEventTypes} from 'core_filter/events';\n *\n * document.addEventListener(filterEventTypes.filterContentUpdated, e => {\n * window.console.log(e.detail.nodes); // A list of the HTMLElements whose content was updated\n * });\n */\n\nimport {dispatchEvent} from 'core/event_dispatcher';\nimport {getList as normalistNodeList} from 'core/normalise';\nimport jQuery from 'jquery';\n\n/**\n * Events for the `core_filter` subsystem.\n *\n * @constant\n * @property {String} filterContentUpdated See {@link event:filterContentUpdated}\n */\nexport const eventTypes = {\n /**\n * An event triggered when page content is updated and must be processed by the filter system.\n *\n * An example of this is loading user text that could have equations in it. MathJax can typeset the equations but\n * only if it is notified that there are new nodes in the page that need processing.\n *\n * @event filterContentUpdated\n * @type {CustomEvent}\n * @property {object} detail\n * @property {NodeElement[]} detail.nodes The list of parent nodes which were updated\n */\n filterContentUpdated: 'core_filters/contentUpdated',\n};\n\n/**\n * Trigger an event to indicate that the specified nodes were updated and should be processed by the filter system.\n *\n * @method notifyFilterContentUpdated\n * @param {jQuery|Array} nodes\n * @returns {CustomEvent}\n * @fires filterContentUpdated\n */\nexport const notifyFilterContentUpdated = nodes => {\n // Historically this could be a jQuery Object.\n // Normalise the list of nodes to a NodeList.\n nodes = normalistNodeList(nodes);\n\n return dispatchEvent(eventTypes.filterContentUpdated, {nodes});\n};\n\nlet legacyEventsRegistered = false;\nif (!legacyEventsRegistered) {\n // The following event triggers are legacy and will be removed in the future.\n // The following approach provides a backwards-compatability layer for the new events.\n // Code should be updated to make use of native events.\n\n Y.use('event', 'moodle-core-event', () => {\n // Provide a backwards-compatability layer for YUI Events.\n document.addEventListener(eventTypes.filterContentUpdated, e => {\n // Trigger the legacy jQuery event.\n jQuery(document).trigger(M.core.event.FILTER_CONTENT_UPDATED, [jQuery(e.detail.nodes)]);\n\n // Trigger the legacy YUI event.\n Y.fire(M.core.event.FILTER_CONTENT_UPDATED, {nodes: new Y.NodeList(e.detail.nodes)});\n });\n });\n\n legacyEventsRegistered = true;\n}\n"],"file":"events.min.js"} \ No newline at end of file diff --git a/filter/amd/src/events.js b/filter/amd/src/events.js index a5904f0be139f..0b6a4b17b6680 100644 --- a/filter/amd/src/events.js +++ b/filter/amd/src/events.js @@ -19,6 +19,13 @@ * @copyright 2021 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 4.0 + * + * @example Example of listening to a filter event. + * import {eventTypes as filterEventTypes} from 'core_filter/events'; + * + * document.addEventListener(filterEventTypes.filterContentUpdated, e => { + * window.console.log(e.detail.nodes); // A list of the HTMLElements whose content was updated + * }); */ import {dispatchEvent} from 'core/event_dispatcher'; diff --git a/grade/grading/form/guide/amd/build/comment_chooser.min.js.map b/grade/grading/form/guide/amd/build/comment_chooser.min.js.map index bd1cc93354c11..e1fbbeaa29bee 100644 --- a/grade/grading/form/guide/amd/build/comment_chooser.min.js.map +++ b/grade/grading/form/guide/amd/build/comment_chooser.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/comment_chooser.js"],"names":["define","$","templates","notification","initialise","criterionId","buttonId","remarkId","commentOptions","displayChooserDialog","compiledSource","comments","titleLabel","M","util","get_string","cancelButtonId","cancelButton","chooserDialog","core","dialogue","modal","headerContent","bodyContent","footerContent","focusAfterHide","id","click","hide","each","index","comment","commentOptionId","remarkTextArea","remarkText","val","trim","description","document","off","on","keyCode","event","which","after","e","prevVal","newVal","destroy","show","generateCommentsChooser","render","done","fail","exception","preventDefault"],"mappings":"AAuBAA,OAAM,qCAAC,CAAC,QAAD,CAAW,gBAAX,CAA6B,mBAA7B,CAAkD,UAAlD,CAAD,CAAgE,SAASC,CAAT,CAAYC,CAAZ,CAAuBC,CA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is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * AMD code for the frequently used comments chooser for the marking guide grading form.\n *\n * @module gradingform_guide/comment_chooser\n * @class comment_chooser\n * @copyright 2015 Jun Pataleta \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/templates', 'core/notification', 'core/yui'], function($, templates, notification) {\n\n // Private variables and functions.\n\n return /** @alias module:gradingform_guide/comment_chooser */ {\n // Public variables and functions.\n /**\n * Initialises the module.\n *\n * Basically, it performs the binding and handling of the button click event for\n * the 'Insert frequently used comment' button.\n *\n * @param {Integer} criterionId The criterion ID.\n * @param {String} buttonId The element ID of the button which the handler will be bound to.\n * @param {String} remarkId The element ID of the remark text area where the text of the selected comment will be copied to.\n * @param {Array} commentOptions The array of frequently used comments to be used as options.\n */\n initialise: function(criterionId, buttonId, remarkId, commentOptions) {\n /**\n * Display the chooser dialog using the compiled HTML from the mustache template\n * and binds onclick events for the generated comment options.\n *\n * @param {String} compiledSource The compiled HTML from the mustache template\n * @param {Array} comments Array containing comments.\n */\n function displayChooserDialog(compiledSource, comments) {\n var titleLabel = '';\n var cancelButtonId = 'comment-chooser-' + criterionId + '-cancel';\n var cancelButton = '';\n\n // Set dialog's body content.\n var chooserDialog = new M.core.dialogue({\n modal: true,\n headerContent: titleLabel,\n bodyContent: compiledSource,\n footerContent: cancelButton,\n focusAfterHide: '#' + remarkId,\n id: \"comments-chooser-dialog-\" + criterionId\n });\n\n // Bind click event to the cancel button.\n $(\"#\" + cancelButtonId).click(function() {\n chooserDialog.hide();\n });\n\n // Loop over each comment item and bind click events.\n $.each(comments, function(index, comment) {\n var commentOptionId = '#comment-option-' + criterionId + '-' + comment.id;\n\n // Delegate click event for the generated option link.\n $(commentOptionId).click(function() {\n var remarkTextArea = $('#' + remarkId);\n var remarkText = remarkTextArea.val();\n\n // Add line break if the current value of the remark text is not empty.\n if (remarkText.trim() !== '') {\n remarkText += '\\n';\n }\n remarkText += comment.description;\n\n remarkTextArea.val(remarkText);\n\n chooserDialog.hide();\n });\n\n // Handle keypress on list items.\n $(document).off('keypress', commentOptionId).on('keypress', commentOptionId, function() {\n var keyCode = event.which || event.keyCode;\n\n // Enter or space key.\n if (keyCode == 13 || keyCode == 32) {\n // Trigger click event.\n $(commentOptionId).click();\n }\n });\n });\n\n // Destroy the dialog when it is hidden to allow the grading section to\n // be loaded as a fragment multiple times within the same page.\n chooserDialog.after('visibleChange', function(e) {\n // Going from visible to hidden.\n if (e.prevVal && !e.newVal) {\n this.destroy();\n }\n }, chooserDialog);\n\n // Show dialog.\n chooserDialog.show();\n }\n\n /**\n * Generates the comments chooser dialog from the grading_form/comment_chooser mustache template.\n */\n function generateCommentsChooser() {\n // Template context.\n var context = {\n criterionId: criterionId,\n comments: commentOptions\n };\n\n // Render the template and display the comment chooser dialog.\n templates.render('gradingform_guide/comment_chooser', context)\n .done(function(compiledSource) {\n displayChooserDialog(compiledSource, commentOptions);\n })\n .fail(notification.exception);\n }\n\n // Bind click event for the comments chooser button.\n $(\"#\" + buttonId).click(function(e) {\n e.preventDefault();\n generateCommentsChooser();\n });\n }\n };\n});\n"],"file":"comment_chooser.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/comment_chooser.js"],"names":["define","$","templates","notification","initialise","criterionId","buttonId","remarkId","commentOptions","displayChooserDialog","compiledSource","comments","titleLabel","M","util","get_string","cancelButtonId","cancelButton","chooserDialog","core","dialogue","modal","headerContent","bodyContent","footerContent","focusAfterHide","id","click","hide","each","index","comment","commentOptionId","remarkTextArea","remarkText","val","trim","description","document","off","on","keyCode","event","which","after","e","prevVal","newVal","destroy","show","generateCommentsChooser","render","done","fail","exception","preventDefault"],"mappings":"AAsBAA,OAAM,qCAAC,CAAC,QAAD,CAAW,gBAAX,CAA6B,mBAA7B,CAAkD,UAAlD,CAAD,CAAgE,SAASC,CAAT,CAAYC,CAAZ,CAAuBC,CAAvB,CAAqC,CAIvG,MAA8D,CAa1DC,UAAU,CAAE,oBAASC,CAAT,CAAsBC,CAAtB,CAAgCC,CAAhC,CAA0CC,CAA1C,CAA0D,CAQlE,QAASC,CAAAA,CAAT,CAA8BC,CAA9B,CAA8CC,CAA9C,CAAwD,IAChDC,CAAAA,CAAU,CAAG,UAAYC,CAAC,CAACC,IAAF,CAAOC,UAAP,CAAkB,eAAlB,CAAmC,mBAAnC,CAAZ,CAAsE,UADnC,CAEhDC,CAAc,CAAG,mBAAqBX,CAArB,CAAmC,SAFJ,CAGhDY,CAAY,CAAG,gBAAiBD,CAAjB,CAAkC,KAAlC,CAAyCH,CAAC,CAACC,IAAF,CAAOC,UAAP,CAAkB,QAAlB,CAA4B,QAA5B,CAAzC,CAAiF,WAHhD,CAMhDG,CAAa,CAAG,GAAIL,CAAAA,CAAC,CAACM,IAAF,CAAOC,QAAX,CAAoB,CACpCC,KAAK,GAD+B,CAEpCC,aAAa,CAAEV,CAFqB,CAGpCW,WAAW,CAAEb,CAHuB,CAIpCc,aAAa,CAAEP,CAJqB,CAKpCQ,cAAc,CAAE,IAAMlB,CALc,CAMpCmB,EAAE,CAAE,2BAA6BrB,CANG,CAApB,CANgC,CAgBpDJ,CAAC,CAAC,IAAMe,CAAP,CAAD,CAAwBW,KAAxB,CAA8B,UAAW,CACrCT,CAAa,CAACU,IAAd,EACH,CAFD,EAKA3B,CAAC,CAAC4B,IAAF,CAAOlB,CAAP,CAAiB,SAASmB,CAAT,CAAgBC,CAAhB,CAAyB,CACtC,GAAIC,CAAAA,CAAe,CAAG,mBAAqB3B,CAArB,CAAmC,GAAnC,CAAyC0B,CAAO,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Y,CAACmD,SAJvB,CAKH,CAGDrD,CAAC,CAAC,IAAMK,CAAP,CAAD,CAAkBqB,KAAlB,CAAwB,SAASkB,CAAT,CAAY,CAChCA,CAAC,CAACU,cAAF,GACAL,CAAuB,EAC1B,CAHD,CAIH,CA7GyD,CA+GjE,CAnHK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * AMD code for the frequently used comments chooser for the marking guide grading form.\n *\n * @module gradingform_guide/comment_chooser\n * @copyright 2015 Jun Pataleta \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/templates', 'core/notification', 'core/yui'], function($, templates, notification) {\n\n // Private variables and functions.\n\n return /** @alias module:gradingform_guide/comment_chooser */ {\n // Public variables and functions.\n /**\n * Initialises the module.\n *\n * Basically, it performs the binding and handling of the button click event for\n * the 'Insert frequently used comment' button.\n *\n * @param {Integer} criterionId The criterion ID.\n * @param {String} buttonId The element ID of the button which the handler will be bound to.\n * @param {String} remarkId The element ID of the remark text area where the text of the selected comment will be copied to.\n * @param {Array} commentOptions The array of frequently used comments to be used as options.\n */\n initialise: function(criterionId, buttonId, remarkId, commentOptions) {\n /**\n * Display the chooser dialog using the compiled HTML from the mustache template\n * and binds onclick events for the generated comment options.\n *\n * @param {String} compiledSource The compiled HTML from the mustache template\n * @param {Array} comments Array containing comments.\n */\n function displayChooserDialog(compiledSource, comments) {\n var titleLabel = '';\n var cancelButtonId = 'comment-chooser-' + criterionId + '-cancel';\n var cancelButton = '';\n\n // Set dialog's body content.\n var chooserDialog = new M.core.dialogue({\n modal: true,\n headerContent: titleLabel,\n bodyContent: compiledSource,\n footerContent: cancelButton,\n focusAfterHide: '#' + remarkId,\n id: \"comments-chooser-dialog-\" + criterionId\n });\n\n // Bind click event to the cancel button.\n $(\"#\" + cancelButtonId).click(function() {\n chooserDialog.hide();\n });\n\n // Loop over each comment item and bind click events.\n $.each(comments, function(index, comment) {\n var commentOptionId = '#comment-option-' + criterionId + '-' + comment.id;\n\n // Delegate click event for the generated option link.\n $(commentOptionId).click(function() {\n var remarkTextArea = $('#' + remarkId);\n var remarkText = remarkTextArea.val();\n\n // Add line break if the current value of the remark text is not empty.\n if (remarkText.trim() !== '') {\n remarkText += '\\n';\n }\n remarkText += comment.description;\n\n remarkTextArea.val(remarkText);\n\n chooserDialog.hide();\n });\n\n // Handle keypress on list items.\n $(document).off('keypress', commentOptionId).on('keypress', commentOptionId, function() {\n var keyCode = event.which || event.keyCode;\n\n // Enter or space key.\n if (keyCode == 13 || keyCode == 32) {\n // Trigger click event.\n $(commentOptionId).click();\n }\n });\n });\n\n // Destroy the dialog when it is hidden to allow the grading section to\n // be loaded as a fragment multiple times within the same page.\n chooserDialog.after('visibleChange', function(e) {\n // Going from visible to hidden.\n if (e.prevVal && !e.newVal) {\n this.destroy();\n }\n }, chooserDialog);\n\n // Show dialog.\n chooserDialog.show();\n }\n\n /**\n * Generates the comments chooser dialog from the grading_form/comment_chooser mustache template.\n */\n function generateCommentsChooser() {\n // Template context.\n var context = {\n criterionId: criterionId,\n comments: commentOptions\n };\n\n // Render the template and display the comment chooser dialog.\n templates.render('gradingform_guide/comment_chooser', context)\n .done(function(compiledSource) {\n displayChooserDialog(compiledSource, commentOptions);\n })\n .fail(notification.exception);\n }\n\n // Bind click event for the comments chooser button.\n $(\"#\" + buttonId).click(function(e) {\n e.preventDefault();\n generateCommentsChooser();\n });\n }\n };\n});\n"],"file":"comment_chooser.min.js"} \ No newline at end of file diff --git a/grade/grading/form/guide/amd/src/comment_chooser.js b/grade/grading/form/guide/amd/src/comment_chooser.js index e13d33a9c1d94..48a3ebb3efba5 100644 --- a/grade/grading/form/guide/amd/src/comment_chooser.js +++ b/grade/grading/form/guide/amd/src/comment_chooser.js @@ -17,7 +17,6 @@ * AMD code for the frequently used comments chooser for the marking guide grading form. * * @module gradingform_guide/comment_chooser - * @class comment_chooser * @copyright 2015 Jun Pataleta * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib/amd/build/ajax.min.js.map b/lib/amd/build/ajax.min.js.map index b7caecfbaddd3..3937de72d9cd2 100644 --- a/lib/amd/build/ajax.min.js.map +++ b/lib/amd/build/ajax.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/ajax.js"],"names":["define","$","config","Log","URL","unloading","requestSuccess","responses","requests","exception","i","request","response","nosessionupdate","error","length","deferred","reject","resolve","data","Error","errorcode","window","location","relativeUrl","forEach","requestFail","jqXHR","textStatus","call","async","loginrequired","timeout","cachekey","bind","ajaxRequestData","promises","methodInfo","requestInfo","parseInt","push","index","methodname","args","Deferred","promise","done","fail","sort","join","JSON","stringify","settings","type","context","dataType","processData","contentType","script","url","wwwroot","sesskey","urlUseGet","encodeURIComponent","ajax","success"],"mappings":"AAyBAA,OAAM,aAAC,CAAC,QAAD,CAAW,aAAX,CAA0B,UAA1B,CAAsC,UAAtC,CAAD,CAAoD,SAASC,CAAT,CAAYC,CAAZ,CAAoBC,CAApB,CAAyBC,CAAzB,CAA8B,IAGhFC,CAAAA,CAAS,GAHuE,CAahFC,CAAc,CAAG,SAASC,CAAT,CAAoB,CAErC,GAAIC,CAAAA,CAAQ,CAAG,IAAf,CACIC,CAAS,CAAG,IADhB,CAEIC,CAAC,CAAG,CAFR,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,CALJ,CAOA,GAAIN,CAAS,CAACO,KAAd,CAAqB,CAIjB,KAAOJ,CAAC,CAAGF,CAAQ,CAACO,MAApB,CAA4BL,CAAC,EAA7B,CAAiC,CAC7BC,CA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,CAAOL,CAAP,CAAYP,CAAZ,CACH,CAED,MAAOhB,CAAAA,CACV,CA5IiC,CA8IzC,CA5OK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Standard Ajax wrapper for Moodle. It calls the central Ajax script,\n * which can call any existing webservice using the current session.\n * In addition, it can batch multiple requests and return multiple responses.\n *\n * @module core/ajax\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 2.9\n */\ndefine(['jquery', 'core/config', 'core/log', 'core/url'], function($, config, Log, URL) {\n\n // Keeps track of when the user leaves the page so we know not to show an error.\n var unloading = false;\n\n /**\n * Success handler. Called when the ajax call succeeds. Checks each response and\n * resolves or rejects the deferred from that request.\n *\n * @method requestSuccess\n * @private\n * @param {Object[]} responses Array of responses containing error, exception and data attributes.\n */\n var requestSuccess = function(responses) {\n // Call each of the success handlers.\n var requests = this,\n exception = null,\n i = 0,\n request,\n response,\n nosessionupdate;\n\n if (responses.error) {\n // There was an error with the request as a whole.\n // We need to reject each promise.\n // Unfortunately this may lead to duplicate dialogues, but each Promise must be rejected.\n for (; i < requests.length; i++) {\n request = requests[i];\n request.deferred.reject(responses);\n }\n\n return;\n }\n\n for (i = 0; i < requests.length; i++) {\n request = requests[i];\n\n response = responses[i];\n // We may not have responses for all the requests.\n if (typeof response !== \"undefined\") {\n if (response.error === false) {\n // Call the done handler if it was provided.\n request.deferred.resolve(response.data);\n } else {\n exception = response.exception;\n nosessionupdate = requests[i].nosessionupdate;\n break;\n }\n } else {\n // This is not an expected case.\n exception = new Error('missing response');\n break;\n }\n }\n // Something failed, reject the remaining promises.\n if (exception !== null) {\n // Redirect to the login page.\n if (exception.errorcode === \"servicerequireslogin\" && !nosessionupdate) {\n window.location = URL.relativeUrl(\"/login/index.php\");\n } else {\n requests.forEach(function(request) {\n request.deferred.reject(exception);\n });\n }\n }\n };\n\n /**\n * Fail handler. Called when the ajax call fails. Rejects all deferreds.\n *\n * @method requestFail\n * @private\n * @param {jqXHR} jqXHR The ajax object.\n * @param {string} textStatus The status string.\n * @param {Error|Object} exception The error thrown.\n */\n var requestFail = function(jqXHR, textStatus, exception) {\n // Reject all the promises.\n var requests = this;\n\n var i = 0;\n for (i = 0; i < requests.length; i++) {\n var request = requests[i];\n\n if (unloading) {\n // No need to trigger an error because we are already navigating.\n Log.error(\"Page unloaded.\");\n Log.error(exception);\n } else {\n request.deferred.reject(exception);\n }\n }\n };\n\n return /** @alias module:core/ajax */ {\n // Public variables and functions.\n /**\n * Make a series of ajax requests and return all the responses.\n *\n * @method call\n * @param {Object[]} requests Array of requests with each containing methodname and args properties.\n * done and fail callbacks can be set for each element in the array, or the\n * can be attached to the promises returned by this function.\n * @param {Boolean} async Optional, defaults to true.\n * If false - this function will not return until the promises are resolved.\n * @param {Boolean} loginrequired Optional, defaults to true.\n * If false - this function will call the faster nologin ajax script - but\n * will fail unless all functions have been marked as 'loginrequired' => false\n * in services.php\n * @param {Boolean} nosessionupdate Optional, defaults to false.\n * If true, the timemodified for the session will not be updated.\n * @param {Integer} timeout number of milliseconds to wait for a response. Defaults to no limit.\n * @param {Integer} cachekey This is used in order to identify the request. If this id changes then we\n * will be sending a different URL and any caching (eg. browser, proxy) knows that it\n * should perform another request and not use the cache. Note - this variable is only\n * used when we are calling 'service-nologin.php'. See MDL-65794.\n * @return {Promise[]} Array of promises that will be resolved when the ajax call returns.\n */\n call: function(requests, async, loginrequired, nosessionupdate, timeout, cachekey) {\n $(window).bind('beforeunload', function() {\n unloading = true;\n });\n var ajaxRequestData = [],\n i,\n promises = [],\n methodInfo = [],\n requestInfo = '';\n\n var maxUrlLength = 2000;\n\n if (typeof loginrequired === \"undefined\") {\n loginrequired = true;\n }\n if (typeof async === \"undefined\") {\n async = true;\n }\n if (typeof timeout === 'undefined') {\n timeout = 0;\n }\n if (typeof cachekey === 'undefined') {\n cachekey = null;\n } else {\n cachekey = parseInt(cachekey);\n if (cachekey <= 0) {\n cachekey = null;\n } else if (!cachekey) {\n cachekey = null;\n }\n }\n\n if (typeof nosessionupdate === \"undefined\") {\n nosessionupdate = false;\n }\n for (i = 0; i < requests.length; i++) {\n var request = requests[i];\n ajaxRequestData.push({\n index: i,\n methodname: request.methodname,\n args: request.args\n });\n request.nosessionupdate = nosessionupdate;\n request.deferred = $.Deferred();\n promises.push(request.deferred.promise());\n // Allow setting done and fail handlers as arguments.\n // This is just a shortcut for the calling code.\n if (typeof request.done !== \"undefined\") {\n request.deferred.done(request.done);\n }\n if (typeof request.fail !== \"undefined\") {\n request.deferred.fail(request.fail);\n }\n request.index = i;\n methodInfo.push(request.methodname);\n }\n\n if (methodInfo.length <= 5) {\n requestInfo = methodInfo.sort().join();\n } else {\n requestInfo = methodInfo.length + '-method-calls';\n }\n\n ajaxRequestData = JSON.stringify(ajaxRequestData);\n var settings = {\n type: 'POST',\n context: requests,\n dataType: 'json',\n processData: false,\n async: async,\n contentType: \"application/json\",\n timeout: timeout\n };\n\n var script = 'service.php';\n var url = config.wwwroot + '/lib/ajax/';\n if (!loginrequired) {\n script = 'service-nologin.php';\n url += script + '?info=' + requestInfo;\n if (cachekey) {\n url += '&cachekey=' + cachekey;\n settings.type = 'GET';\n }\n } else {\n url += script + '?sesskey=' + config.sesskey + '&info=' + requestInfo;\n }\n\n if (nosessionupdate) {\n url += '&nosessionupdate=true';\n }\n\n if (settings.type === 'POST') {\n settings.data = ajaxRequestData;\n } else {\n var urlUseGet = url + '&args=' + encodeURIComponent(ajaxRequestData);\n\n if (urlUseGet.length > maxUrlLength) {\n settings.type = 'POST';\n settings.data = ajaxRequestData;\n } else {\n url = urlUseGet;\n }\n }\n\n // Jquery deprecated done and fail with async=false so we need to do this 2 ways.\n if (async) {\n $.ajax(url, settings)\n .done(requestSuccess)\n .fail(requestFail);\n } else {\n settings.success = requestSuccess;\n settings.error = requestFail;\n $.ajax(url, settings);\n }\n\n return promises;\n }\n };\n});\n"],"file":"ajax.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/ajax.js"],"names":["define","$","config","Log","URL","unloading","requestSuccess","responses","requests","exception","i","request","response","nosessionupdate","error","length","deferred","reject","resolve","data","Error","errorcode","window","location","relativeUrl","forEach","requestFail","jqXHR","textStatus","call","async","loginrequired","timeout","cachekey","bind","ajaxRequestData","promises","methodInfo","requestInfo","parseInt","push","index","methodname","args","Deferred","promise","done","fail","sort","join","JSON","stringify","settings","type","context","dataType","processData","contentType","script","url","wwwroot","sesskey","urlUseGet","encodeURIComponent","ajax","success"],"mappings":"AAyBAA,OAAM,aAAC,CAAC,QAAD,CAAW,aAAX,CAA0B,UAA1B,CAAsC,UAAtC,CAAD,CAAoD,SAASC,CAAT,CAAYC,CAAZ,CAAoBC,CAApB,CAAyBC,CAAzB,CAA8B,IAWhFC,CAAAA,CAAS,GAXuE,CAqBhFC,CAAc,CAAG,SAASC,CAAT,CAAoB,CAErC,GAAIC,CAAAA,CAAQ,CAAG,IAAf,CACIC,CAAS,CAAG,IADhB,CAEIC,CAAC,CAAG,CAFR,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,CALJ,CAOA,GAAIN,CAAS,CAACO,KAAd,CAAqB,CAIjB,KAAOJ,CAAC,CAAGF,CAAQ,CAACO,MAApB,CAA4BL,CAAC,EAA7B,CAAiC,CAC7BC,CAAO,CAAGH,CAAQ,CAACE,CAAD,CAAlB,CACAC,CAAO,CAACK,QAAR,CAAiBC,MAAjB,CAAwBV,CAAxB,CACH,CAED,MACH,CAED,IAAKG,CAAC,CAAG,CAAT,CAAYA,CAAC,CAAGF,CAAQ,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AAC0D,OAAP,CAAiB,YA3EoD,CA4E/E,GAAI,CAAC7B,CAAL,CAAoB,CAChB2B,CAAM,CAAG,qBAAT,CACAC,CAAG,EAAID,CAAM,CAAG,QAAT,CAAoBpB,CAA3B,CACA,GAAIL,CAAJ,CAAc,CACV0B,CAAG,EAAI,aAAe1B,CAAtB,CACAmB,CAAQ,CAACC,IAAT,CAAgB,KACnB,CACJ,CAPD,IAOO,CACHM,CAAG,EAAID,CAAM,CAAG,WAAT,CAAuBxD,CAAM,CAAC2D,OAA9B,CAAwC,QAAxC,CAAmDvB,CAC7D,CAED,GAAIzB,CAAJ,CAAqB,CACjB8C,CAAG,EAAI,uBACV,CAED,GAAsB,MAAlB,GAAAP,CAAQ,CAACC,IAAb,CAA8B,CAC1BD,CAAQ,CAACjC,IAAT,CAAgBgB,CACnB,CAFD,IAEO,CACH,GAAI2B,CAAAA,CAAS,CAAGH,CAAG,CAAG,QAAN,CAAiBI,kBAAkB,CAAC5B,CAAD,CAAnD,CAEA,GAAI2B,CAAS,CAAC/C,MAAV,CAtFW,GAsFf,CAAqC,CACjCqC,CAAQ,CAACC,IAAT,CAAgB,MAAhB,CACAD,CAAQ,CAACjC,IAAT,CAAgBgB,CACnB,CAHD,IAGO,CACHwB,CAAG,CAAGG,CACT,CACJ,CAGD,GAAIhC,CAAJ,CAAW,CACP7B,CAAC,CAAC+D,IAAF,CAAOL,CAAP,CAAYP,CAAZ,EACKN,IADL,CACUxC,CADV,EAEKyC,IAFL,CAEUrB,CAFV,CAGH,CAJD,IAIO,CACH0B,CAAQ,CAACa,OAAT,CAAmB3D,CAAnB,CACA8C,CAAQ,CAACtC,KAAT,CAAiBY,CAAjB,CACAzB,CAAC,CAAC+D,IAAF,CAAOL,CAAP,CAAYP,CAAZ,CACH,CAED,MAAOhB,CAAAA,CACV,CArKiC,CAuKzC,CA7QK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Standard Ajax wrapper for Moodle. It calls the central Ajax script,\n * which can call any existing webservice using the current session.\n * In addition, it can batch multiple requests and return multiple responses.\n *\n * @module core/ajax\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 2.9\n */\ndefine(['jquery', 'core/config', 'core/log', 'core/url'], function($, config, Log, URL) {\n\n/**\n * A request to be performed.\n *\n * @typedef {object} request\n * @property {string} methodname The remote method to be called\n * @property {object} args The arguments to pass when fetching the remote content\n */\n\n // Keeps track of when the user leaves the page so we know not to show an error.\n var unloading = false;\n\n /**\n * Success handler. Called when the ajax call succeeds. Checks each response and\n * resolves or rejects the deferred from that request.\n *\n * @method requestSuccess\n * @private\n * @param {Object[]} responses Array of responses containing error, exception and data attributes.\n */\n var requestSuccess = function(responses) {\n // Call each of the success handlers.\n var requests = this,\n exception = null,\n i = 0,\n request,\n response,\n nosessionupdate;\n\n if (responses.error) {\n // There was an error with the request as a whole.\n // We need to reject each promise.\n // Unfortunately this may lead to duplicate dialogues, but each Promise must be rejected.\n for (; i < requests.length; i++) {\n request = requests[i];\n request.deferred.reject(responses);\n }\n\n return;\n }\n\n for (i = 0; i < requests.length; i++) {\n request = requests[i];\n\n response = responses[i];\n // We may not have responses for all the requests.\n if (typeof response !== \"undefined\") {\n if (response.error === false) {\n // Call the done handler if it was provided.\n request.deferred.resolve(response.data);\n } else {\n exception = response.exception;\n nosessionupdate = requests[i].nosessionupdate;\n break;\n }\n } else {\n // This is not an expected case.\n exception = new Error('missing response');\n break;\n }\n }\n // Something failed, reject the remaining promises.\n if (exception !== null) {\n // Redirect to the login page.\n if (exception.errorcode === \"servicerequireslogin\" && !nosessionupdate) {\n window.location = URL.relativeUrl(\"/login/index.php\");\n } else {\n requests.forEach(function(request) {\n request.deferred.reject(exception);\n });\n }\n }\n };\n\n /**\n * Fail handler. Called when the ajax call fails. Rejects all deferreds.\n *\n * @method requestFail\n * @private\n * @param {jqXHR} jqXHR The ajax object.\n * @param {string} textStatus The status string.\n * @param {Error|Object} exception The error thrown.\n */\n var requestFail = function(jqXHR, textStatus, exception) {\n // Reject all the promises.\n var requests = this;\n\n var i = 0;\n for (i = 0; i < requests.length; i++) {\n var request = requests[i];\n\n if (unloading) {\n // No need to trigger an error because we are already navigating.\n Log.error(\"Page unloaded.\");\n Log.error(exception);\n } else {\n request.deferred.reject(exception);\n }\n }\n };\n\n return /** @alias module:core/ajax */ {\n // Public variables and functions.\n /**\n * Make a series of ajax requests and return all the responses.\n *\n * @method call\n * @param {request[]} requests Array of requests with each containing methodname and args properties.\n * done and fail callbacks can be set for each element in the array, or the\n * can be attached to the promises returned by this function.\n * @param {Boolean} [async=true] If false this function will not return until the promises are resolved.\n * @param {Boolean} [loginrequired=true] When false this function calls an endpoint which does not use the\n * session.\n * Note: This may only be used with external functions which have been marked as\n * `'loginrequired' => false`\n * @param {Boolean} [nosessionupdate=false] If true, the timemodified for the session will not be updated.\n * @param {Number} [timeout] number of milliseconds to wait for a response. Defaults to no limit.\n * @param {Number} [cachekey] A cache key used to improve browser-side caching.\n * Typically the same `cachekey` is used for all function calls.\n * When the key changes, this causes the URL used to perform the fetch to change, which\n * prevents the existing browser cache from being used.\n * Note: This option is only availbale when `loginrequired` is `false`.\n * See {@link https://tracker.moodle.org/browser/MDL-65794} for more information.\n * @return {Promise[]} The Promises for each of the supplied requests.\n * The order of the Promise matches the order of requests exactly.\n *\n * @example An example of fetching a string using the cachekey parameter\n * import {call as fetchMany} from 'core/ajax';\n * import * as Notification from 'core/notification';\n *\n * export const performAction = (some, args) => {\n * Promises.all(fetchMany('core_get_string', {\n * stringid: 'do_not_copy',\n * component: 'core',\n * lang: 'en',\n * stringparams: [],\n * }, true, false, false, undefined, M.cfg.langrev))\n * .then(([doNotCopyString]) => {\n * window.console.log(doNotCopyString);\n * })\n * .catch(Notification.exception);\n * };\n *\n * @example A simple example that you might find in a repository function\n *\n * import {call as fetchMany} from 'core/ajax';\n *\n * export const fetchMessages = timeSince => fetchMany('core_message_get_messages', {timeSince}})[0];\n * export const fetchNotifications = timeSince => fetchMany('core_message_get_notifications', {timeSince}})[0];\n */\n call: function(requests, async, loginrequired, nosessionupdate, timeout, cachekey) {\n $(window).bind('beforeunload', function() {\n unloading = true;\n });\n var ajaxRequestData = [],\n i,\n promises = [],\n methodInfo = [],\n requestInfo = '';\n\n var maxUrlLength = 2000;\n\n if (typeof loginrequired === \"undefined\") {\n loginrequired = true;\n }\n if (typeof async === \"undefined\") {\n async = true;\n }\n if (typeof timeout === 'undefined') {\n timeout = 0;\n }\n if (typeof cachekey === 'undefined') {\n cachekey = null;\n } else {\n cachekey = parseInt(cachekey);\n if (cachekey <= 0) {\n cachekey = null;\n } else if (!cachekey) {\n cachekey = null;\n }\n }\n\n if (typeof nosessionupdate === \"undefined\") {\n nosessionupdate = false;\n }\n for (i = 0; i < requests.length; i++) {\n var request = requests[i];\n ajaxRequestData.push({\n index: i,\n methodname: request.methodname,\n args: request.args\n });\n request.nosessionupdate = nosessionupdate;\n request.deferred = $.Deferred();\n promises.push(request.deferred.promise());\n // Allow setting done and fail handlers as arguments.\n // This is just a shortcut for the calling code.\n if (typeof request.done !== \"undefined\") {\n request.deferred.done(request.done);\n }\n if (typeof request.fail !== \"undefined\") {\n request.deferred.fail(request.fail);\n }\n request.index = i;\n methodInfo.push(request.methodname);\n }\n\n if (methodInfo.length <= 5) {\n requestInfo = methodInfo.sort().join();\n } else {\n requestInfo = methodInfo.length + '-method-calls';\n }\n\n ajaxRequestData = JSON.stringify(ajaxRequestData);\n var settings = {\n type: 'POST',\n context: requests,\n dataType: 'json',\n processData: false,\n async: async,\n contentType: \"application/json\",\n timeout: timeout\n };\n\n var script = 'service.php';\n var url = config.wwwroot + '/lib/ajax/';\n if (!loginrequired) {\n script = 'service-nologin.php';\n url += script + '?info=' + requestInfo;\n if (cachekey) {\n url += '&cachekey=' + cachekey;\n settings.type = 'GET';\n }\n } else {\n url += script + '?sesskey=' + config.sesskey + '&info=' + requestInfo;\n }\n\n if (nosessionupdate) {\n url += '&nosessionupdate=true';\n }\n\n if (settings.type === 'POST') {\n settings.data = ajaxRequestData;\n } else {\n var urlUseGet = url + '&args=' + encodeURIComponent(ajaxRequestData);\n\n if (urlUseGet.length > maxUrlLength) {\n settings.type = 'POST';\n settings.data = ajaxRequestData;\n } else {\n url = urlUseGet;\n }\n }\n\n // Jquery deprecated done and fail with async=false so we need to do this 2 ways.\n if (async) {\n $.ajax(url, settings)\n .done(requestSuccess)\n .fail(requestFail);\n } else {\n settings.success = requestSuccess;\n settings.error = requestFail;\n $.ajax(url, settings);\n }\n\n return promises;\n }\n };\n});\n"],"file":"ajax.min.js"} \ No newline at end of file diff --git a/lib/amd/build/auto_rows.min.js.map b/lib/amd/build/auto_rows.min.js.map index 6c6b66eaf6463..c81eceb5ebbcb 100644 --- a/lib/amd/build/auto_rows.min.js.map +++ b/lib/amd/build/auto_rows.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/auto_rows.js"],"names":["define","$","SELECTORS","ELEMENT","EVENTS","ROW_CHANGE","calculateRows","element","currentRows","attr","minRows","data","maxRows","height","innerHeight","scrollHeight","rows","css","changeListener","e","target","trigger","init","root","on","bind","events"],"mappings":"AAwBAA,OAAM,kBAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,IACvBC,CAAAA,CAAS,CAAG,CACZC,OAAO,CAAE,kBADG,CADW,CAKvBC,CAAM,CAAG,CACTC,UAAU,CAAE,oBADH,CALc,CAiBvBC,CAAa,CAAG,SAASC,CAAT,CAAkB,IAC9BC,CAAAA,CAAW,CAAGD,CAAO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B,CACH,CACJ,CAnE0B,CAoF3B,MAAqC,CACjCiB,IAAI,CATG,QAAPA,CAAAA,IAAO,CAASC,CAAT,CAAe,CACtB,GAAItB,CAAC,CAACsB,CAAD,CAAD,CAAQZ,IAAR,CAAa,WAAb,CAAJ,CAA+B,CAC3BV,CAAC,CAACsB,CAAD,CAAD,CAAQC,EAAR,CAAW,sBAAX,CAAmCN,CAAc,CAACO,IAAf,CAAoB,IAApB,CAAnC,CACH,CAFD,IAEO,CACHxB,CAAC,CAACsB,CAAD,CAAD,CAAQC,EAAR,CAAW,sBAAX,CAAmCtB,CAAS,CAACC,OAA7C,CAAsDe,CAAc,CAACO,IAAf,CAAoB,IAApB,CAAtD,CACH,CACJ,CAEoC,CAEjCC,MAAM,CAAEtB,CAFyB,CAIxC,CAxFK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Enhance a textarea with auto growing rows to fit the content.\n *\n * @module core/auto_rows\n * @class auto_rows\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.2\n */\ndefine(['jquery'], function($) {\n var SELECTORS = {\n ELEMENT: '[data-auto-rows]'\n };\n\n var EVENTS = {\n ROW_CHANGE: 'autorows:rowchange',\n };\n\n /**\n * Determine how many rows should be set for the given element.\n *\n * @method calculateRows\n * @param {jQuery} element The textarea element\n * @return {int} The number of rows for the element\n * @private\n */\n var calculateRows = function(element) {\n var currentRows = element.attr('rows');\n var minRows = element.data('min-rows');\n var maxRows = element.attr('data-max-rows');\n\n var height = element.height();\n var innerHeight = element.innerHeight();\n var padding = innerHeight - height;\n\n var scrollHeight = element[0].scrollHeight;\n var rows = (scrollHeight - padding) / (height / currentRows);\n\n // Remove the height styling to let the height be calculated automatically\n // based on the row attribute.\n element.css('height', '');\n\n if (rows < minRows) {\n return minRows;\n } else if (maxRows && rows >= maxRows) {\n return maxRows;\n } else {\n return rows;\n }\n };\n\n /**\n * Listener for change events to trigger resizing of the element.\n *\n * @method changeListener\n * @param {Event} e The triggered event.\n * @private\n */\n var changeListener = function(e) {\n var element = $(e.target);\n var minRows = element.data('min-rows');\n var currentRows = element.attr('rows');\n\n if (typeof minRows === \"undefined\") {\n element.data('min-rows', currentRows);\n }\n\n // Reset element to single row so that the scroll height of the\n // element is correctly calculated each time.\n element.attr('rows', 1);\n var rows = calculateRows(element);\n element.attr('rows', rows);\n\n if (rows != currentRows) {\n element.trigger(EVENTS.ROW_CHANGE);\n }\n };\n\n /**\n * Add the event listeners for all text areas within the given element.\n *\n * @method init\n * @param {jQuery|selector} root The container element of all enhanced text areas\n * @public\n */\n var init = function(root) {\n if ($(root).data('auto-rows')) {\n $(root).on('input propertychange', changeListener.bind(this));\n } else {\n $(root).on('input propertychange', SELECTORS.ELEMENT, changeListener.bind(this));\n }\n };\n\n return /** @module core/auto_rows */ {\n init: init,\n events: EVENTS,\n };\n});\n"],"file":"auto_rows.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/auto_rows.js"],"names":["define","$","SELECTORS","ELEMENT","EVENTS","ROW_CHANGE","calculateRows","element","currentRows","attr","minRows","data","maxRows","height","innerHeight","scrollHeight","rows","css","changeListener","e","target","trigger","init","root","on","bind","events"],"mappings":"AAuBAA,OAAM,kBAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,IACvBC,CAAAA,CAAS,CAAG,CACZC,OAAO,CAAE,kBADG,CADW,CAKvBC,CAAM,CAAG,CACTC,UAAU,CAAE,oBADH,CALc,CAiBvBC,CAAa,CAAG,SAASC,C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,CAAO,CAACc,OAAR,CAAgBjB,CAAM,CAACC,UAAvB,CACH,CACJ,CAnE0B,CAoF3B,MAAqC,CACjCiB,IAAI,CATG,QAAPA,CAAAA,IAAO,CAASC,CAAT,CAAe,CACtB,GAAItB,CAAC,CAACsB,CAAD,CAAD,CAAQZ,IAAR,CAAa,WAAb,CAAJ,CAA+B,CAC3BV,CAAC,CAACsB,CAAD,CAAD,CAAQC,EAAR,CAAW,sBAAX,CAAmCN,CAAc,CAACO,IAAf,CAAoB,IAApB,CAAnC,CACH,CAFD,IAEO,CACHxB,CAAC,CAACsB,CAAD,CAAD,CAAQC,EAAR,CAAW,sBAAX,CAAmCtB,CAAS,CAACC,OAA7C,CAAsDe,CAAc,CAACO,IAAf,CAAoB,IAApB,CAAtD,CACH,CACJ,CAEoC,CAEjCC,MAAM,CAAEtB,CAFyB,CAIxC,CAxFK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Enhance a textarea with auto growing rows to fit the content.\n *\n * @module core/auto_rows\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.2\n */\ndefine(['jquery'], function($) {\n var SELECTORS = {\n ELEMENT: '[data-auto-rows]'\n };\n\n var EVENTS = {\n ROW_CHANGE: 'autorows:rowchange',\n };\n\n /**\n * Determine how many rows should be set for the given element.\n *\n * @method calculateRows\n * @param {jQuery} element The textarea element\n * @return {int} The number of rows for the element\n * @private\n */\n var calculateRows = function(element) {\n var currentRows = element.attr('rows');\n var minRows = element.data('min-rows');\n var maxRows = element.attr('data-max-rows');\n\n var height = element.height();\n var innerHeight = element.innerHeight();\n var padding = innerHeight - height;\n\n var scrollHeight = element[0].scrollHeight;\n var rows = (scrollHeight - padding) / (height / currentRows);\n\n // Remove the height styling to let the height be calculated automatically\n // based on the row attribute.\n element.css('height', '');\n\n if (rows < minRows) {\n return minRows;\n } else if (maxRows && rows >= maxRows) {\n return maxRows;\n } else {\n return rows;\n }\n };\n\n /**\n * Listener for change events to trigger resizing of the element.\n *\n * @method changeListener\n * @param {Event} e The triggered event.\n * @private\n */\n var changeListener = function(e) {\n var element = $(e.target);\n var minRows = element.data('min-rows');\n var currentRows = element.attr('rows');\n\n if (typeof minRows === \"undefined\") {\n element.data('min-rows', currentRows);\n }\n\n // Reset element to single row so that the scroll height of the\n // element is correctly calculated each time.\n element.attr('rows', 1);\n var rows = calculateRows(element);\n element.attr('rows', rows);\n\n if (rows != currentRows) {\n element.trigger(EVENTS.ROW_CHANGE);\n }\n };\n\n /**\n * Add the event listeners for all text areas within the given element.\n *\n * @method init\n * @param {jQuery|selector} root The container element of all enhanced text areas\n * @public\n */\n var init = function(root) {\n if ($(root).data('auto-rows')) {\n $(root).on('input propertychange', changeListener.bind(this));\n } else {\n $(root).on('input propertychange', SELECTORS.ELEMENT, changeListener.bind(this));\n }\n };\n\n return /** @module core/auto_rows */ {\n init: init,\n events: EVENTS,\n };\n});\n"],"file":"auto_rows.min.js"} \ No newline at end of file diff --git a/lib/amd/build/autoscroll.min.js.map b/lib/amd/build/autoscroll.min.js.map index 4b28e791c6805..881c180a5c96c 100644 --- a/lib/amd/build/autoscroll.min.js.map +++ b/lib/amd/build/autoscroll.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/autoscroll.js"],"names":["define","$","autoscroll","SCROLL_THRESHOLD","SCROLL_FREQUENCY","SCROLL_SPEED","scrollingId","scrollAmount","callback","start","window","on","mouseMove","touchMove","stop","off","stopScrolling","e","i","changedTouches","length","handleMove","clientX","clientY","Math","min","height","startScrolling","maxScroll","document","setInterval","y","scrollTop","offset","round","realOffset","clearInterval"],"mappings":"AA6BAA,OAAM,mBAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAI3B,GAAIC,CAAAA,CAAU,CAAG,CAKbC,gBAAgB,CAAE,EALL,CAWbC,gBAAgB,CAAE,IAAO,EAXZ,CAiBbC,YAAY,CAAE,EAjBD,CAuBbC,WAAW,CAAE,IAvBA,CA6BbC,YAAY,CAAE,CA7BD,CAmCbC,QAAQ,CAAE,IAnCG,CA4CbC,KAAK,CAAE,eAASD,CAAT,CAAmB,CACtBP,CAAC,CAACS,MAAD,CAAD,CAAUC,EAAV,CAAa,WAAb,CAA0BT,CAAU,CAACU,SAArC,EACAX,CAAC,CAACS,MAAD,CAAD,CAAUC,EAAV,CAAa,WAAb,CAA0BT,CAAU,CAACW,SAArC,EACAX,CAAU,CAACM,QAAX,CAAsBA,CACzB,CAhDY,CAuDbM,IAAI,CAAE,eAAW,CACbb,CAAC,CAACS,MAAD,CAAD,CAAUK,GAAV,CAAc,WAAd,CAA2Bb,CAAU,CAACU,SAAtC,EACAX,CAAC,CAACS,MAAD,CAAD,CAAUK,GAAV,CAAc,WAAd,CAA2Bb,CAAU,CAACW,SAAtC,EACA,GAA+B,IAA3B,GAAAX,CAAU,CAACI,WAAf,CAAqC,CACjCJ,CAAU,CAACc,aAAX,EACH,CACJ,CA7DY,CAqEbH,SAAS,CAAE,mBAASI,CAAT,CAAY,CACnB,IAAK,GAAIC,CAAAA,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGD,CAAC,CAACE,cAAF,CAAiBC,MAArC,CAA6CF,CAAC,EAA9C,CAAkD,CAC9ChB,CAAU,CAACmB,UAAX,CAAsBJ,CAAC,CAACE,cAAF,CAAiBD,CAAjB,EAAoBI,OAA1C,CAAmDL,CAAC,CAACE,cAAF,CAAiBD,CAAjB,EAAoBK,OAAvE,CACH,CACJ,CAzEY,CAiFbX,SAAS,CAAE,m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CAAUsB,SAAV,EAF2C,CAG/CC,CAAM,CAAGT,IAAI,CAACU,KAAL,CAAWhC,CAAU,CAACK,YAAX,CAA0BL,CAAU,CAACG,YAAhD,CAHsC,CAInD,GAAiB,CAAb,CAAA0B,CAAC,CAAGE,CAAR,CAAoB,CAChBA,CAAM,CAAG,CAACF,CACb,CACD,GAAIA,CAAC,CAAGE,CAAJ,CAAaL,CAAjB,CAA4B,CACxBK,CAAM,CAAGL,CAAS,CAAGG,CACxB,CACD,GAAe,CAAX,GAAAE,CAAJ,CAAkB,CACd,MACH,CAGDhC,CAAC,CAACS,MAAD,CAAD,CAAUsB,SAAV,CAAoBD,CAAC,CAAGE,CAAxB,EACA,GAAIE,CAAAA,CAAU,CAAGlC,CAAC,CAACS,MAAD,CAAD,CAAUsB,SAAV,GAAwBD,CAAzC,CACA,GAAmB,CAAf,EAAAI,CAAJ,CAAsB,CAClB,MACH,CAGD,GAAIjC,CAAU,CAACM,QAAf,CAAyB,CACrBN,CAAU,CAACM,QAAX,CAAoB2B,CAApB,CACH,CAEJ,CA1BwB,CA0BtBjC,CAAU,CAACE,gBA1BW,CA2B5B,CA/IY,CAsJbY,aAAa,CAAE,wBAAW,CACtBN,MAAM,CAAC0B,aAAP,CAAqBlC,CAAU,CAACI,WAAhC,EACAJ,CAAU,CAACI,WAAX,CAAyB,IAC5B,CAzJY,CAAjB,CA4JA,MAAO,CAQHG,KAAK,CAAEP,CAAU,CAACO,KARf,CAeHK,IAAI,CAAEZ,CAAU,CAACY,IAfd,CAkBV,CAlLK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/*\n * JavaScript to provide automatic scrolling, e.g. during a drag operation.\n *\n * Note: this module is defined statically. It is a singleton. You\n * can only have one use of it active at any time. However, since this\n * is usually used in relation to drag-drop, and since you only ever\n * drag one thing at a time, this is not a problem in practice.\n *\n * @module core/autoscroll\n * @class autoscroll\n * @copyright 2016 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.6\n */\ndefine(['jquery'], function($) {\n /**\n * @alias module:core/autoscroll\n */\n var autoscroll = {\n /**\n * Size of area near edge of screen that triggers scrolling.\n * @private\n */\n SCROLL_THRESHOLD: 30,\n\n /**\n * How frequently to scroll window.\n * @private\n */\n SCROLL_FREQUENCY: 1000 / 60,\n\n /**\n * How many pixels to scroll per unit (1 = max scroll 30).\n * @private\n */\n SCROLL_SPEED: 0.5,\n\n /**\n * Set if currently scrolling up/down.\n * @private\n */\n scrollingId: null,\n\n /**\n * Speed we are supposed to scroll (range 1 to SCROLL_THRESHOLD).\n * @private\n */\n scrollAmount: 0,\n\n /**\n * Optional callback called when it scrolls\n * @private\n */\n callback: null,\n\n /**\n * Starts automatically scrolling if user moves near edge of window.\n * This should be called in response to mouse down or touch start.\n *\n * @public\n * @param {Function} callback Optional callback that is called every time it scrolls\n */\n start: function(callback) {\n $(window).on('mousemove', autoscroll.mouseMove);\n $(window).on('touchmove', autoscroll.touchMove);\n autoscroll.callback = callback;\n },\n\n /**\n * Stops automatically scrolling. This should be called in response to mouse up or touch end.\n *\n * @public\n */\n stop: function() {\n $(window).off('mousemove', autoscroll.mouseMove);\n $(window).off('touchmove', autoscroll.touchMove);\n if (autoscroll.scrollingId !== null) {\n autoscroll.stopScrolling();\n }\n },\n\n /**\n * Event handler for touch move.\n *\n * @private\n * @param {Object} e Event\n */\n touchMove: function(e) {\n for (var i = 0; i < e.changedTouches.length; i++) {\n autoscroll.handleMove(e.changedTouches[i].clientX, e.changedTouches[i].clientY);\n }\n },\n\n /**\n * Event handler for mouse move.\n *\n * @private\n * @param {Object} e Event\n */\n mouseMove: function(e) {\n autoscroll.handleMove(e.clientX, e.clientY);\n },\n\n /**\n * Handles user moving.\n *\n * @private\n * @param {number} clientX X\n * @param {number} clientY Y\n */\n handleMove: function(clientX, clientY) {\n // If near the bottom or top, start auto-scrolling.\n if (clientY < autoscroll.SCROLL_THRESHOLD) {\n autoscroll.scrollAmount = -Math.min(autoscroll.SCROLL_THRESHOLD - clientY, autoscroll.SCROLL_THRESHOLD);\n } else if (clientY > $(window).height() - autoscroll.SCROLL_THRESHOLD) {\n autoscroll.scrollAmount = Math.min(clientY - ($(window).height() - autoscroll.SCROLL_THRESHOLD),\n autoscroll.SCROLL_THRESHOLD);\n } else {\n autoscroll.scrollAmount = 0;\n }\n if (autoscroll.scrollAmount && autoscroll.scrollingId === null) {\n autoscroll.startScrolling();\n } else if (!autoscroll.scrollAmount && autoscroll.scrollingId !== null) {\n autoscroll.stopScrolling();\n }\n },\n\n /**\n * Starts automatic scrolling.\n *\n * @private\n */\n startScrolling: function() {\n var maxScroll = $(document).height() - $(window).height();\n autoscroll.scrollingId = window.setInterval(function() {\n // Work out how much to scroll.\n var y = $(window).scrollTop();\n var offset = Math.round(autoscroll.scrollAmount * autoscroll.SCROLL_SPEED);\n if (y + offset < 0) {\n offset = -y;\n }\n if (y + offset > maxScroll) {\n offset = maxScroll - y;\n }\n if (offset === 0) {\n return;\n }\n\n // Scroll.\n $(window).scrollTop(y + offset);\n var realOffset = $(window).scrollTop() - y;\n if (realOffset === 0) {\n return;\n }\n\n // Inform callback\n if (autoscroll.callback) {\n autoscroll.callback(realOffset);\n }\n\n }, autoscroll.SCROLL_FREQUENCY);\n },\n\n /**\n * Stops the automatic scrolling.\n *\n * @private\n */\n stopScrolling: function() {\n window.clearInterval(autoscroll.scrollingId);\n autoscroll.scrollingId = null;\n }\n };\n\n return {\n /**\n * Starts automatic scrolling if user moves near edge of window.\n * This should be called in response to mouse down or touch start.\n *\n * @public\n * @param {Function} callback Optional callback that is called every time it scrolls\n */\n start: autoscroll.start,\n\n /**\n * Stops automatic scrolling. This should be called in response to mouse up or touch end.\n *\n * @public\n */\n stop: autoscroll.stop\n };\n\n});\n"],"file":"autoscroll.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/autoscroll.js"],"names":["define","$","autoscroll","SCROLL_THRESHOLD","SCROLL_FREQUENCY","SCROLL_SPEED","scrollingId","scrollAmount","callback","start","window","on","mouseMove","touchMove","stop","off","stopScrolling","e","i","changedTouches","length","handleMove","clientX","clientY","Math","min","height","startScrolling","maxScroll","document","setInterval","y","scrollTop","offset","round","realOffset","clearInterval"],"mappings":"AA4BAA,OAAM,mBAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAI3B,GAAIC,CAAAA,CAAU,CAAG,CAKbC,gBAAgB,CAAE,EALL,CAWbC,gBAAgB,CAAE,IAAO,EAXZ,CAiBbC,YAAY,CAAE,EAjBD,CAuBbC,WAAW,CAAE,IAvBA,CA6BbC,YAAY,CAAE,CA7BD,CAmCbC,QAAQ,CAAE,IAnCG,CA4CbC,KAAK,CAAE,eAASD,CAAT,CAAmB,CACtBP,CAAC,CAACS,MAAD,CAAD,CAAUC,EAAV,CAAa,WAAb,CAA0BT,CAAU,CAACU,SAArC,EACAX,CAAC,CAACS,MAAD,CAAD,CAAUC,EAAV,CAAa,WAAb,CAA0BT,CAAU,CAACW,SAArC,EACAX,CAAU,CAACM,QAAX,CAAsBA,CACzB,CAhDY,CAuDbM,IAAI,CAAE,eAAW,CACbb,CAAC,CAACS,MAAD,CAAD,CAAUK,GAAV,CAAc,WAAd,CAA2Bb,CAAU,CAACU,SAAtC,EACAX,CAAC,CAACS,MAAD,CAAD,CAAUK,GAAV,CAAc,WAAd,CAA2Bb,CAAU,CAACW,SAAtC,EACA,GAA+B,IAA3B,GAAAX,CAAU,CAACI,WAAf,CAAqC,CACjCJ,CAAU,CAACc,aAAX,EACH,CACJ,CA7DY,CAqEbH,SAA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ACO,KARf,CAeHK,IAAI,CAAEZ,CAAU,CAACY,IAfd,CAkBV,CAlLK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/*\n * JavaScript to provide automatic scrolling, e.g. during a drag operation.\n *\n * Note: this module is defined statically. It is a singleton. You\n * can only have one use of it active at any time. However, since this\n * is usually used in relation to drag-drop, and since you only ever\n * drag one thing at a time, this is not a problem in practice.\n *\n * @module core/autoscroll\n * @copyright 2016 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.6\n */\ndefine(['jquery'], function($) {\n /**\n * @alias module:core/autoscroll\n */\n var autoscroll = {\n /**\n * Size of area near edge of screen that triggers scrolling.\n * @private\n */\n SCROLL_THRESHOLD: 30,\n\n /**\n * How frequently to scroll window.\n * @private\n */\n SCROLL_FREQUENCY: 1000 / 60,\n\n /**\n * How many pixels to scroll per unit (1 = max scroll 30).\n * @private\n */\n SCROLL_SPEED: 0.5,\n\n /**\n * Set if currently scrolling up/down.\n * @private\n */\n scrollingId: null,\n\n /**\n * Speed we are supposed to scroll (range 1 to SCROLL_THRESHOLD).\n * @private\n */\n scrollAmount: 0,\n\n /**\n * Optional callback called when it scrolls\n * @private\n */\n callback: null,\n\n /**\n * Starts automatically scrolling if user moves near edge of window.\n * This should be called in response to mouse down or touch start.\n *\n * @public\n * @param {Function} callback Optional callback that is called every time it scrolls\n */\n start: function(callback) {\n $(window).on('mousemove', autoscroll.mouseMove);\n $(window).on('touchmove', autoscroll.touchMove);\n autoscroll.callback = callback;\n },\n\n /**\n * Stops automatically scrolling. This should be called in response to mouse up or touch end.\n *\n * @public\n */\n stop: function() {\n $(window).off('mousemove', autoscroll.mouseMove);\n $(window).off('touchmove', autoscroll.touchMove);\n if (autoscroll.scrollingId !== null) {\n autoscroll.stopScrolling();\n }\n },\n\n /**\n * Event handler for touch move.\n *\n * @private\n * @param {Object} e Event\n */\n touchMove: function(e) {\n for (var i = 0; i < e.changedTouches.length; i++) {\n autoscroll.handleMove(e.changedTouches[i].clientX, e.changedTouches[i].clientY);\n }\n },\n\n /**\n * Event handler for mouse move.\n *\n * @private\n * @param {Object} e Event\n */\n mouseMove: function(e) {\n autoscroll.handleMove(e.clientX, e.clientY);\n },\n\n /**\n * Handles user moving.\n *\n * @private\n * @param {number} clientX X\n * @param {number} clientY Y\n */\n handleMove: function(clientX, clientY) {\n // If near the bottom or top, start auto-scrolling.\n if (clientY < autoscroll.SCROLL_THRESHOLD) {\n autoscroll.scrollAmount = -Math.min(autoscroll.SCROLL_THRESHOLD - clientY, autoscroll.SCROLL_THRESHOLD);\n } else if (clientY > $(window).height() - autoscroll.SCROLL_THRESHOLD) {\n autoscroll.scrollAmount = Math.min(clientY - ($(window).height() - autoscroll.SCROLL_THRESHOLD),\n autoscroll.SCROLL_THRESHOLD);\n } else {\n autoscroll.scrollAmount = 0;\n }\n if (autoscroll.scrollAmount && autoscroll.scrollingId === null) {\n autoscroll.startScrolling();\n } else if (!autoscroll.scrollAmount && autoscroll.scrollingId !== null) {\n autoscroll.stopScrolling();\n }\n },\n\n /**\n * Starts automatic scrolling.\n *\n * @private\n */\n startScrolling: function() {\n var maxScroll = $(document).height() - $(window).height();\n autoscroll.scrollingId = window.setInterval(function() {\n // Work out how much to scroll.\n var y = $(window).scrollTop();\n var offset = Math.round(autoscroll.scrollAmount * autoscroll.SCROLL_SPEED);\n if (y + offset < 0) {\n offset = -y;\n }\n if (y + offset > maxScroll) {\n offset = maxScroll - y;\n }\n if (offset === 0) {\n return;\n }\n\n // Scroll.\n $(window).scrollTop(y + offset);\n var realOffset = $(window).scrollTop() - y;\n if (realOffset === 0) {\n return;\n }\n\n // Inform callback\n if (autoscroll.callback) {\n autoscroll.callback(realOffset);\n }\n\n }, autoscroll.SCROLL_FREQUENCY);\n },\n\n /**\n * Stops the automatic scrolling.\n *\n * @private\n */\n stopScrolling: function() {\n window.clearInterval(autoscroll.scrollingId);\n autoscroll.scrollingId = null;\n }\n };\n\n return {\n /**\n * Starts automatic scrolling if user moves near edge of window.\n * This should be called in response to mouse down or touch start.\n *\n * @public\n * @param {Function} callback Optional callback that is called every time it scrolls\n */\n start: autoscroll.start,\n\n /**\n * Stops automatic scrolling. This should be called in response to mouse up or touch end.\n *\n * @public\n */\n stop: autoscroll.stop\n };\n\n});\n"],"file":"autoscroll.min.js"} \ No newline at end of file diff --git a/lib/amd/build/backoff_timer.min.js.map b/lib/amd/build/backoff_timer.min.js.map index 9dda8c082f7cc..fb2c7ac286b35 100644 --- a/lib/amd/build/backoff_timer.min.js.map +++ b/lib/amd/build/backoff_timer.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/backoff_timer.js"],"names":["define","BackoffTimer","callback","backoffFunction","backOffFunction","prototype","time","timeout","generateNextTime","newTime","reset","stop","window","clearTimeout","start","setTimeout","bind","restart","getIncrementalCallback","minamount","incrementamount","maxamount","timeoutamount"],"mappings":"AAwBAA,OAAM,sBAAC,UAAW,CAQd,GAAIC,CAAAA,CAAY,CAAG,SAASC,CAAT,CAAmBC,CAAnB,CAAoC,CACnD,KAAKD,QAAL,CAAgBA,CAAhB,CACA,KAAKE,eAAL,CAAuBD,CAC1B,CAHD,CAQAF,CAAY,CAACI,SAAb,CAAuBH,QAAvB,CAAkC,IAAlC,CAKAD,CAAY,CAACI,SAAb,CAAuBD,eAAvB,CAAyC,IAAzC,CAKAH,CAAY,CAACI,SAAb,CAAuBC,IAAvB,CAA8B,IAA9B,CAKAL,CAAY,CAACI,SAAb,CAAuBE,OAAvB,CAAiC,IAAjC,CAYAN,CAAY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CAAI,CAAGc,CACjB,CACJ,CApBA,CAsBD,MAAOnB,CAAAA,CACV,CArJK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A timer that will execute a callback with decreasing frequency. Useful for\n * doing polling on the server without overwhelming it with requests.\n *\n * @module core/backoff_timer\n * @class backoff_timer\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(function() {\n\n /**\n * Constructor for the back off timer.\n *\n * @param {function} callback The function to execute after each tick\n * @param {function} backoffFunction The function to determine what the next timeout value should be\n */\n var BackoffTimer = function(callback, backoffFunction) {\n this.callback = callback;\n this.backOffFunction = backoffFunction;\n };\n\n /**\n * @property {function} callback The function to execute after each tick\n */\n BackoffTimer.prototype.callback = null;\n\n /**\n * @property {function} backoffFunction The function to determine what the next timeout value should be\n */\n BackoffTimer.prototype.backOffFunction = null;\n\n /**\n * @property {int} time The timeout value to use\n */\n BackoffTimer.prototype.time = null;\n\n /**\n * @property {numeric} timeout The timeout identifier\n */\n BackoffTimer.prototype.timeout = null;\n\n /**\n * Generate the next timeout in the back off time sequence\n * for the timer.\n *\n * The back off function is called to calculate the next value.\n * It is given the current value and an array of all previous values.\n *\n * @method generateNextTime\n * @return {int} The new timeout value (in milliseconds)\n */\n BackoffTimer.prototype.generateNextTime = function() {\n var newTime = this.backOffFunction(this.time);\n this.time = newTime;\n\n return newTime;\n };\n\n /**\n * Stop the current timer and clear the previous time values\n *\n * @method reset\n * @return {object} this\n */\n BackoffTimer.prototype.reset = function() {\n this.time = null;\n this.stop();\n\n return this;\n };\n\n /**\n * Clear the current timeout, if one is set.\n *\n * @method stop\n * @return {object} this\n */\n BackoffTimer.prototype.stop = function() {\n if (this.timeout) {\n window.clearTimeout(this.timeout);\n this.timeout = null;\n }\n\n return this;\n };\n\n /**\n * Start the current timer by generating the new timeout value and\n * starting the ticks.\n *\n * This function recurses after each tick with a new timeout value\n * generated each time.\n *\n * The callback function is called after each tick.\n *\n * @method start\n * @return {object} this\n */\n BackoffTimer.prototype.start = function() {\n // If we haven't already started.\n if (!this.timeout) {\n var time = this.generateNextTime();\n this.timeout = window.setTimeout(function() {\n this.callback();\n // Clear the existing timer.\n this.stop();\n // Start the next timer.\n this.start();\n }.bind(this), time);\n }\n\n return this;\n };\n\n /**\n * Reset the timer and start it again from the initial timeout\n * values\n *\n * @method restart\n * @return {object} this\n */\n BackoffTimer.prototype.restart = function() {\n return this.reset().start();\n };\n\n /**\n * Returns an incremental function for the timer.\n *\n * @param {int} minamount The minimum amount of time we wait before checking\n * @param {int} incrementamount The amount to increment the timer by\n * @param {int} maxamount The max amount to ever increment to\n * @param {int} timeoutamount The timeout to use once we reach the max amount\n * @return {function}\n */\n BackoffTimer.getIncrementalCallback = function(minamount, incrementamount, maxamount, timeoutamount) {\n\n /**\n * An incremental function for the timer.\n *\n * @param {(int|null)} time The current timeout value or null if none set\n * @return {int} The new timeout value\n */\n return function(time) {\n if (!time) {\n return minamount;\n }\n\n // Don't go over the max amount.\n if (time + incrementamount > maxamount) {\n return timeoutamount;\n }\n\n return time + incrementamount;\n };\n };\n\n return BackoffTimer;\n});\n"],"file":"backoff_timer.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/backoff_timer.js"],"names":["define","BackoffTimer","callback","backoffFunction","backOffFunction","prototype","time","timeout","generateNextTime","newTime","reset","stop","window","clearTimeout","start","setTimeout","bind","restart","getIncrementalCallback","minamount","incrementamount","maxamount","timeoutamount"],"mappings":"AAuBAA,OAAM,sBAAC,UAAW,CASd,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AAb,CAAuBY,OAAvB,CAAiC,UAAW,CACxC,MAAO,MAAKP,KAAL,GAAaI,KAAb,EACV,CAFD,CAaCb,CAAY,CAACiB,sBAAb,CAAsC,SAASC,CAAT,CAAoBC,CAApB,CAAqCC,CAArC,CAAgDC,CAAhD,CAA+D,CAQlG,MAAO,UAAShB,CAAT,CAAe,CAClB,GAAI,CAACA,CAAL,CAAW,CACP,MAAOa,CAAAA,CACV,CAGD,GAAIb,CAAI,CAAGc,CAAP,CAAyBC,CAA7B,CAAwC,CACpC,MAAOC,CAAAA,CACV,CAED,MAAOhB,CAAAA,CAAI,CAAGc,CACjB,CACJ,CApBA,CAsBD,MAAOnB,CAAAA,CACV,CAjJK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A timer that will execute a callback with decreasing frequency. Useful for\n * doing polling on the server without overwhelming it with requests.\n *\n * @module core/backoff_timer\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(function() {\n\n /**\n * Constructor for the back off timer.\n *\n * @class\n * @param {function} callback The function to execute after each tick\n * @param {function} backoffFunction The function to determine what the next timeout value should be\n */\n var BackoffTimer = function(callback, backoffFunction) {\n this.callback = callback;\n this.backOffFunction = backoffFunction;\n };\n\n /**\n * @property {function} callback The function to execute after each tick\n */\n BackoffTimer.prototype.callback = null;\n\n /**\n * @property {function} backoffFunction The function to determine what the next timeout value should be\n */\n BackoffTimer.prototype.backOffFunction = null;\n\n /**\n * @property {int} time The timeout value to use\n */\n BackoffTimer.prototype.time = null;\n\n /**\n * @property {numeric} timeout The timeout identifier\n */\n BackoffTimer.prototype.timeout = null;\n\n /**\n * Generate the next timeout in the back off time sequence\n * for the timer.\n *\n * The back off function is called to calculate the next value.\n * It is given the current value and an array of all previous values.\n *\n * @return {int} The new timeout value (in milliseconds)\n */\n BackoffTimer.prototype.generateNextTime = function() {\n var newTime = this.backOffFunction(this.time);\n this.time = newTime;\n\n return newTime;\n };\n\n /**\n * Stop the current timer and clear the previous time values\n *\n * @return {object} this\n */\n BackoffTimer.prototype.reset = function() {\n this.time = null;\n this.stop();\n\n return this;\n };\n\n /**\n * Clear the current timeout, if one is set.\n *\n * @return {object} this\n */\n BackoffTimer.prototype.stop = function() {\n if (this.timeout) {\n window.clearTimeout(this.timeout);\n this.timeout = null;\n }\n\n return this;\n };\n\n /**\n * Start the current timer by generating the new timeout value and\n * starting the ticks.\n *\n * This function recurses after each tick with a new timeout value\n * generated each time.\n *\n * The callback function is called after each tick.\n *\n * @return {object} this\n */\n BackoffTimer.prototype.start = function() {\n // If we haven't already started.\n if (!this.timeout) {\n var time = this.generateNextTime();\n this.timeout = window.setTimeout(function() {\n this.callback();\n // Clear the existing timer.\n this.stop();\n // Start the next timer.\n this.start();\n }.bind(this), time);\n }\n\n return this;\n };\n\n /**\n * Reset the timer and start it again from the initial timeout\n * values\n *\n * @return {object} this\n */\n BackoffTimer.prototype.restart = function() {\n return this.reset().start();\n };\n\n /**\n * Returns an incremental function for the timer.\n *\n * @param {int} minamount The minimum amount of time we wait before checking\n * @param {int} incrementamount The amount to increment the timer by\n * @param {int} maxamount The max amount to ever increment to\n * @param {int} timeoutamount The timeout to use once we reach the max amount\n * @return {function}\n */\n BackoffTimer.getIncrementalCallback = function(minamount, incrementamount, maxamount, timeoutamount) {\n\n /**\n * An incremental function for the timer.\n *\n * @param {(int|null)} time The current timeout value or null if none set\n * @return {int} The new timeout value\n */\n return function(time) {\n if (!time) {\n return minamount;\n }\n\n // Don't go over the max amount.\n if (time + incrementamount > maxamount) {\n return timeoutamount;\n }\n\n return time + incrementamount;\n };\n };\n\n return BackoffTimer;\n});\n"],"file":"backoff_timer.min.js"} \ No newline at end of file diff --git a/lib/amd/build/chart_axis.min.js.map b/lib/amd/build/chart_axis.min.js.map index c579e4ab1ef8f..6d2cdbce9731a 100644 --- a/lib/amd/build/chart_axis.min.js.map +++ b/lib/amd/build/chart_axis.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/chart_axis.js"],"names":["define","Axis","prototype","POS_DEFAULT","POS_BOTTOM","POS_LEFT","POS_RIGHT","POS_TOP","_label","_labels","_max","_min","_position","_stepSize","create","obj","s","setPosition","position","setLabel","label","setStepSize","stepSize","setMax","max","setMin","min","setLabels","labels","getLabel","getLabels","getMax","getMin","getPosition","getStepSize","length","Error","isNaN"],"mappings":"AAsBAA,OAAM,mBAAC,EAAD,CAAK,UAAW,CAUlB,QAASC,CAAAA,CAAT,EAAgB,CAEf,CAMDA,CAAI,CAACC,SAAL,CAAeC,WAAf,CAA6B,IAA7B,CAMAF,CAAI,CAACC,SAAL,CAAeE,UAAf,CAA4B,QAA5B,CAMAH,CAAI,CAACC,SAAL,CAAeG,QAAf,CAA0B,MAA1B,CAMAJ,CAAI,CAACC,SAAL,CAAeI,SAAf,CAA2B,OAA3B,CAMAL,CAAI,CAACC,SAAL,CAAeK,OAAf,CAAyB,KAAzB,CAOAN,CAAI,CAACC,SAAL,CAAeM,MAAf,CAAwB,IAAxB,CAOAP,CAAI,CAACC,SAAL,CAAeO,OAAf,CAAyB,IAAzB,CAOAR,CAAI,CAACC,SAAL,CAAeQ,IAAf,CAAsB,IAAtB,CAOAT,CAAI,CAACC,SAAL,CAAeS,IAAf,CAAsB,IAAtB,CAOAV,CAAI,CAACC,SAAL,CAAeU,SAAf,CAA2B,IAA3B,CAOAX,CAAI,CAACC,SAAL,CAAeW,SAAf,CAA2B,IAA3B,CAUAZ,CAAI,CAACC,SAAL,CAAeY,MAAf,CAAwB,SAASC,CA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AnRK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart axis.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_axis\n */\ndefine([], function() {\n\n /**\n * Chart axis class.\n *\n * This is used to represent an axis, whether X or Y.\n *\n * @alias module:core/chart_axis\n * @class\n */\n function Axis() {\n // Please eslint no-empty-function.\n }\n\n /**\n * Default axis position.\n * @const {Null}\n */\n Axis.prototype.POS_DEFAULT = null;\n\n /**\n * Bottom axis position.\n * @const {String}\n */\n Axis.prototype.POS_BOTTOM = 'bottom';\n\n /**\n * Left axis position.\n * @const {String}\n */\n Axis.prototype.POS_LEFT = 'left';\n\n /**\n * Right axis position.\n * @const {String}\n */\n Axis.prototype.POS_RIGHT = 'right';\n\n /**\n * Top axis position.\n * @const {String}\n */\n Axis.prototype.POS_TOP = 'top';\n\n /**\n * Label of the axis.\n * @type {String}\n * @protected\n */\n Axis.prototype._label = null;\n\n /**\n * Labels of the ticks.\n * @type {String[]}\n * @protected\n */\n Axis.prototype._labels = null;\n\n /**\n * Maximum value of the axis.\n * @type {Number}\n * @protected\n */\n Axis.prototype._max = null;\n\n /**\n * Minimum value of the axis.\n * @type {Number}\n * @protected\n */\n Axis.prototype._min = null;\n\n /**\n * Position of the axis.\n * @type {String}\n * @protected\n */\n Axis.prototype._position = null;\n\n /**\n * Steps on the axis.\n * @type {Number}\n * @protected\n */\n Axis.prototype._stepSize = null;\n\n /**\n * Create a new instance of an axis from serialised data.\n *\n * @static\n * @method create\n * @param {Object} obj The data of the axis.\n * @return {module:core/chart_axis}\n */\n Axis.prototype.create = function(obj) {\n var s = new Axis();\n s.setPosition(obj.position);\n s.setLabel(obj.label);\n s.setStepSize(obj.stepSize);\n s.setMax(obj.max);\n s.setMin(obj.min);\n s.setLabels(obj.labels);\n return s;\n };\n\n /**\n * Get the label of the axis.\n *\n * @method getLabel\n * @return {String}\n */\n Axis.prototype.getLabel = function() {\n return this._label;\n };\n\n /**\n * Get the labels of the ticks of the axis.\n *\n * @method getLabels\n * @return {String[]}\n */\n Axis.prototype.getLabels = function() {\n return this._labels;\n };\n\n /**\n * Get the maximum value of the axis.\n *\n * @method getMax\n * @return {Number}\n */\n Axis.prototype.getMax = function() {\n return this._max;\n };\n\n /**\n * Get the minimum value of the axis.\n *\n * @method getMin\n * @return {Number}\n */\n Axis.prototype.getMin = function() {\n return this._min;\n };\n\n /**\n * Get the position of the axis.\n *\n * @method getPosition\n * @return {String}\n */\n Axis.prototype.getPosition = function() {\n return this._position;\n };\n\n /**\n * Get the step size of the axis.\n *\n * @method getStepSize\n * @return {Number}\n */\n Axis.prototype.getStepSize = function() {\n return this._stepSize;\n };\n\n /**\n * Set the label of the axis.\n *\n * @method setLabel\n * @param {String} label The label.\n */\n Axis.prototype.setLabel = function(label) {\n this._label = label || null;\n };\n\n /**\n * Set the labels of the values on the axis.\n *\n * This automatically sets the [_stepSize]{@link module:core/chart_axis#_stepSize},\n * [_min]{@link module:core/chart_axis#_min} and [_max]{@link module:core/chart_axis#_max}\n * to define a scale from 0 to the number of labels when none of the previously\n * mentioned values have been modified.\n *\n * You can use other values so long that your values in a series are mapped\n * to the values represented by your _min, _max and _stepSize.\n *\n * @method setLabels\n * @param {String[]} labels The labels.\n */\n Axis.prototype.setLabels = function(labels) {\n this._labels = labels || null;\n\n // By default we set the grid according to the labels.\n if (this._labels !== null\n && this._stepSize === null\n && (this._min === null || this._min === 0)\n && this._max === null) {\n this.setStepSize(1);\n this.setMin(0);\n this.setMax(labels.length - 1);\n }\n };\n\n /**\n * Set the maximum value on the axis.\n *\n * When this is not set (or set to null) it is left for the output\n * library to best guess what should be used.\n *\n * @method setMax\n * @param {Number} max The value.\n */\n Axis.prototype.setMax = function(max) {\n this._max = typeof max !== 'undefined' ? max : null;\n };\n\n /**\n * Set the minimum value on the axis.\n *\n * When this is not set (or set to null) it is left for the output\n * library to best guess what should be used.\n *\n * @method setMin\n * @param {Number} min The value.\n */\n Axis.prototype.setMin = function(min) {\n this._min = typeof min !== 'undefined' ? min : null;\n };\n\n /**\n * Set the position of the axis.\n *\n * This does not validate whether or not the constant used is valid\n * as the axis itself is not aware whether it represents the X or Y axis.\n *\n * The output library has to have a fallback in case the values are incorrect.\n * When this is not set to {@link module:core/chart_axis#POS_DEFAULT} it is up\n * to the output library to choose what position fits best.\n *\n * @method setPosition\n * @param {String} position The value.\n */\n Axis.prototype.setPosition = function(position) {\n if (position != this.POS_DEFAULT\n && position != this.POS_BOTTOM\n && position != this.POS_LEFT\n && position != this.POS_RIGHT\n && position != this.POS_TOP) {\n throw new Error('Invalid axis position.');\n }\n this._position = position;\n };\n\n /**\n * Set the stepSize on the axis.\n *\n * This is used to determine where ticks are displayed on the axis between min and max.\n *\n * @method setStepSize\n * @param {Number} stepSize The value.\n */\n Axis.prototype.setStepSize = function(stepSize) {\n if (typeof stepSize === 'undefined' || stepSize === null) {\n stepSize = null;\n } else if (isNaN(Number(stepSize))) {\n throw new Error('Value for stepSize is not a number.');\n } else {\n stepSize = Number(stepSize);\n }\n\n this._stepSize = stepSize;\n };\n\n return Axis;\n\n});\n"],"file":"chart_axis.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/chart_axis.js"],"names":["define","Axis","prototype","POS_DEFAULT","POS_BOTTOM","POS_LEFT","POS_RIGHT","POS_TOP","_label","_labels","_max","_min","_position","_stepSize","create","obj","s","setPosition","position","setLabel","label","setStepSize","stepSize","setMax","max","setMin","min","setLabels","labels","getLabel","getLabels","get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,CAA6BA,CAA7B,CAAmC,IAClD,CAFD,CAiBAzB,CAAI,CAACC,SAAL,CAAee,WAAf,CAA6B,SAASC,CAAT,CAAmB,CAC5C,GAAIA,CAAQ,EAAI,KAAKf,WAAjB,EACOe,CAAQ,EAAI,KAAKd,UADxB,EAEOc,CAAQ,EAAI,KAAKb,QAFxB,EAGOa,CAAQ,EAAI,KAAKZ,SAHxB,EAIOY,CAAQ,EAAI,KAAKX,OAJ5B,CAIqC,CACjC,KAAM,IAAI6B,CAAAA,KAAJ,CAAU,wBAAV,CACT,CACD,KAAKxB,SAAL,CAAiBM,CACpB,CATD,CAmBAjB,CAAI,CAACC,SAAL,CAAemB,WAAf,CAA6B,SAASC,CAAT,CAAmB,CAC5C,GAAwB,WAApB,QAAOA,CAAAA,CAAP,EAAgD,IAAb,GAAAA,CAAvC,CAA0D,CACtDA,CAAQ,CAAG,IACd,CAFD,IAEO,IAAIe,KAAK,EAAQf,CAAR,CAAT,CAA6B,CAChC,KAAM,IAAIc,CAAAA,KAAJ,CAAU,qCAAV,CACT,CAFM,IAEA,CACHd,CAAQ,EAAUA,CACrB,CAED,KAAKT,SAAL,CAAiBS,CACpB,CAVD,CAYA,MAAOrB,CAAAA,CAEV,CAlRK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart axis.\n *\n * @module core/chart_axis\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([], function() {\n\n /**\n * Chart axis class.\n *\n * This is used to represent an axis, whether X or Y.\n *\n * @class core/chart_axis\n */\n function Axis() {\n // Please eslint no-empty-function.\n }\n\n /**\n * Default axis position.\n * @const {Null}\n */\n Axis.prototype.POS_DEFAULT = null;\n\n /**\n * Bottom axis position.\n * @const {String}\n */\n Axis.prototype.POS_BOTTOM = 'bottom';\n\n /**\n * Left axis position.\n * @const {String}\n */\n Axis.prototype.POS_LEFT = 'left';\n\n /**\n * Right axis position.\n * @const {String}\n */\n Axis.prototype.POS_RIGHT = 'right';\n\n /**\n * Top axis position.\n * @const {String}\n */\n Axis.prototype.POS_TOP = 'top';\n\n /**\n * Label of the axis.\n * @type {String}\n * @protected\n */\n Axis.prototype._label = null;\n\n /**\n * Labels of the ticks.\n * @type {String[]}\n * @protected\n */\n Axis.prototype._labels = null;\n\n /**\n * Maximum value of the axis.\n * @type {Number}\n * @protected\n */\n Axis.prototype._max = null;\n\n /**\n * Minimum value of the axis.\n * @type {Number}\n * @protected\n */\n Axis.prototype._min = null;\n\n /**\n * Position of the axis.\n * @type {String}\n * @protected\n */\n Axis.prototype._position = null;\n\n /**\n * Steps on the axis.\n * @type {Number}\n * @protected\n */\n Axis.prototype._stepSize = null;\n\n /**\n * Create a new instance of an axis from serialised data.\n *\n * @static\n * @method create\n * @param {Object} obj The data of the axis.\n * @return {module:core/chart_axis}\n */\n Axis.prototype.create = function(obj) {\n var s = new Axis();\n s.setPosition(obj.position);\n s.setLabel(obj.label);\n s.setStepSize(obj.stepSize);\n s.setMax(obj.max);\n s.setMin(obj.min);\n s.setLabels(obj.labels);\n return s;\n };\n\n /**\n * Get the label of the axis.\n *\n * @method getLabel\n * @return {String}\n */\n Axis.prototype.getLabel = function() {\n return this._label;\n };\n\n /**\n * Get the labels of the ticks of the axis.\n *\n * @method getLabels\n * @return {String[]}\n */\n Axis.prototype.getLabels = function() {\n return this._labels;\n };\n\n /**\n * Get the maximum value of the axis.\n *\n * @method getMax\n * @return {Number}\n */\n Axis.prototype.getMax = function() {\n return this._max;\n };\n\n /**\n * Get the minimum value of the axis.\n *\n * @method getMin\n * @return {Number}\n */\n Axis.prototype.getMin = function() {\n return this._min;\n };\n\n /**\n * Get the position of the axis.\n *\n * @method getPosition\n * @return {String}\n */\n Axis.prototype.getPosition = function() {\n return this._position;\n };\n\n /**\n * Get the step size of the axis.\n *\n * @method getStepSize\n * @return {Number}\n */\n Axis.prototype.getStepSize = function() {\n return this._stepSize;\n };\n\n /**\n * Set the label of the axis.\n *\n * @method setLabel\n * @param {String} label The label.\n */\n Axis.prototype.setLabel = function(label) {\n this._label = label || null;\n };\n\n /**\n * Set the labels of the values on the axis.\n *\n * This automatically sets the [_stepSize]{@link module:core/chart_axis#_stepSize},\n * [_min]{@link module:core/chart_axis#_min} and [_max]{@link module:core/chart_axis#_max}\n * to define a scale from 0 to the number of labels when none of the previously\n * mentioned values have been modified.\n *\n * You can use other values so long that your values in a series are mapped\n * to the values represented by your _min, _max and _stepSize.\n *\n * @method setLabels\n * @param {String[]} labels The labels.\n */\n Axis.prototype.setLabels = function(labels) {\n this._labels = labels || null;\n\n // By default we set the grid according to the labels.\n if (this._labels !== null\n && this._stepSize === null\n && (this._min === null || this._min === 0)\n && this._max === null) {\n this.setStepSize(1);\n this.setMin(0);\n this.setMax(labels.length - 1);\n }\n };\n\n /**\n * Set the maximum value on the axis.\n *\n * When this is not set (or set to null) it is left for the output\n * library to best guess what should be used.\n *\n * @method setMax\n * @param {Number} max The value.\n */\n Axis.prototype.setMax = function(max) {\n this._max = typeof max !== 'undefined' ? max : null;\n };\n\n /**\n * Set the minimum value on the axis.\n *\n * When this is not set (or set to null) it is left for the output\n * library to best guess what should be used.\n *\n * @method setMin\n * @param {Number} min The value.\n */\n Axis.prototype.setMin = function(min) {\n this._min = typeof min !== 'undefined' ? min : null;\n };\n\n /**\n * Set the position of the axis.\n *\n * This does not validate whether or not the constant used is valid\n * as the axis itself is not aware whether it represents the X or Y axis.\n *\n * The output library has to have a fallback in case the values are incorrect.\n * When this is not set to {@link module:core/chart_axis#POS_DEFAULT} it is up\n * to the output library to choose what position fits best.\n *\n * @method setPosition\n * @param {String} position The value.\n */\n Axis.prototype.setPosition = function(position) {\n if (position != this.POS_DEFAULT\n && position != this.POS_BOTTOM\n && position != this.POS_LEFT\n && position != this.POS_RIGHT\n && position != this.POS_TOP) {\n throw new Error('Invalid axis position.');\n }\n this._position = position;\n };\n\n /**\n * Set the stepSize on the axis.\n *\n * This is used to determine where ticks are displayed on the axis between min and max.\n *\n * @method setStepSize\n * @param {Number} stepSize The value.\n */\n Axis.prototype.setStepSize = function(stepSize) {\n if (typeof stepSize === 'undefined' || stepSize === null) {\n stepSize = null;\n } else if (isNaN(Number(stepSize))) {\n throw new Error('Value for stepSize is not a number.');\n } else {\n stepSize = Number(stepSize);\n }\n\n this._stepSize = stepSize;\n };\n\n return Axis;\n\n});\n"],"file":"chart_axis.min.js"} \ No newline at end of file diff --git a/lib/amd/build/chart_bar.min.js.map b/lib/amd/build/chart_bar.min.js.map index ae1ccf94f425b..ddf48e122312c 100644 --- a/lib/amd/build/chart_bar.min.js.map +++ b/lib/amd/build/chart_bar.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/chart_bar.js"],"names":["define","Base","Bar","prototype","constructor","apply","arguments","Object","create","_horizontal","_stacked","TYPE","Klass","data","chart","setHorizontal","horizontal","setStacked","stacked","_setDefaults","axis","getYAxis","setMin","getHorizontal","getStacked","getXAxis","getMin"],"mappings":"AAsBAA,OAAM,kBAAC,CAAC,iBAAD,CAAD,CAAsB,SAASC,CAAT,CAAe,CASvC,QAASC,CAAAA,CAAT,EAAe,CACXD,CAAI,CAACE,SAAL,CAAeC,WAAf,CAA2BC,KAA3B,CAAiC,IAAjC,CAAuCC,SAAvC,CACH,CACDJ,CAAG,CAACC,SAAJ,CAAgBI,MAAM,CAACC,MAAP,CAAcP,CAAI,CAACE,SAAnB,CAAhB,CAQAD,CAAG,CAACC,SAAJ,CAAcM,WAAd,IAQAP,CAAG,CAACC,SAAJ,CAAcO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AN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart bar.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_bar\n */\ndefine(['core/chart_base'], function(Base) {\n\n /**\n * Bar chart.\n *\n * @alias module:core/chart_bar\n * @extends {module:core/chart_base}\n * @class\n */\n function Bar() {\n Base.prototype.constructor.apply(this, arguments);\n }\n Bar.prototype = Object.create(Base.prototype);\n\n /**\n * Whether the bars should be displayed horizontally or not.\n *\n * @type {Bool}\n * @protected\n */\n Bar.prototype._horizontal = false;\n\n /**\n * Whether the bars should be stacked or not.\n *\n * @type {Bool}\n * @protected\n */\n Bar.prototype._stacked = false;\n\n /** @override */\n Bar.prototype.TYPE = 'bar';\n\n /** @override */\n Bar.prototype.create = function(Klass, data) {\n var chart = Base.prototype.create.apply(this, arguments);\n chart.setHorizontal(data.horizontal);\n chart.setStacked(data.stacked);\n return chart;\n };\n\n /** @override */\n Bar.prototype._setDefaults = function() {\n Base.prototype._setDefaults.apply(this, arguments);\n var axis = this.getYAxis(0, true);\n axis.setMin(0);\n };\n\n /**\n * Get whether the bars should be displayed horizontally or not.\n *\n * @returns {Bool}\n */\n Bar.prototype.getHorizontal = function() {\n return this._horizontal;\n };\n\n /**\n * Get whether the bars should be stacked or not.\n *\n * @returns {Bool}\n */\n Bar.prototype.getStacked = function() {\n return this._stacked;\n };\n\n /**\n * Set whether the bars should be displayed horizontally or not.\n *\n * It sets the X Axis to zero if the min value is null.\n *\n * @param {Bool} horizontal True if the bars should be displayed horizontally, false otherwise.\n */\n Bar.prototype.setHorizontal = function(horizontal) {\n var axis = this.getXAxis(0, true);\n if (axis.getMin() === null) {\n axis.setMin(0);\n }\n this._horizontal = Boolean(horizontal);\n };\n\n /**\n * Set whether the bars should be stacked or not.\n *\n * @method setStacked\n * @param {Bool} stacked True if the chart should be stacked or false otherwise.\n */\n Bar.prototype.setStacked = function(stacked) {\n this._stacked = Boolean(stacked);\n };\n\n return Bar;\n\n});\n"],"file":"chart_bar.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/chart_bar.js"],"names":["define","Base","Bar","prototype","constructor","apply","arguments","Object","create","_horizontal","_stacked","TYPE","Klass","data","chart","setHorizontal","horizontal","setStacked","stacked","_setDefaults","axis","getYAxis","setMin","getHorizontal","getStacked","getXAxis","getMin"],"mappings":"AAsBAA,OAAM,kBAAC,CAAC,iBAAD,CAAD,CAAsB,SAASC,CAAT,CAAe,CAQvC,QAASC,CAAAA,CAAT,EAAe,CACXD,CAAI,CAACE,SAAL,CAAeC,WAAf,CAA2BC,KAA3B,CAAiC,IAAjC,CAAuCC,SAAvC,CACH,CACDJ,CAAG,CAACC,SAAJ,CAAgBI,MAAM,CAACC,MAAP,CAAcP,CAAI,CAACE,SAAnB,CAAhB,CAQAD,CAAG,CAACC,SAAJ,CAAcM,WAAd,IAQAP,CAAG,CAACC,SAAJ,CAAcO,QAAd,IAGAR,CAAG,CAACC,SAAJ,CAAcQ,IAAd,CAAqB,KAArB,CAGAT,CAAG,CAACC,SAAJ,CAAcK,MAAd,CAAuB,SAASI,CAAT,CAAgBC,CAAhB,CAAsB,CACzC,GAAIC,CAAAA,CAAK,CAAGb,CAAI,CAACE,SAAL,CAAeK,MAAf,CAAsBH,KAAtB,CAA4B,IAA5B,CAAkCC,SAAlC,CAAZ,CACAQ,CAAK,CAACC,aAAN,CAAoBF,CAAI,CAACG,UAAzB,EACAF,CAAK,CAACG,UAAN,CAAiBJ,CAAI,CAACK,OAAtB,EACA,MAAOJ,CAAAA,CACV,CALD,CAQAZ,CAAG,CAACC,SAAJ,CAAcgB,YAAd,CAA6B,UAAW,CACpClB,CAAI,CAACE,SAAL,CAAegB,YAAf,CAA4Bd,KAA5B,CAAkC,IAAlC,CAAwCC,SAAxC,EACA,GAAIc,CAAAA,CAAI,CAAG,KAAKC,QAAL,CAAc,CAAd,IAAX,CACAD,CAAI,CAACE,MAAL,CAAY,CAAZ,CACH,CAJD,CAWApB,CAAG,CAACC,SAAJ,CAAcoB,aAAd,CAA8B,UAAW,CACrC,MAAO,MAAKd,WACf,CAFD,CASAP,CAAG,CAACC,SAAJ,CAAcqB,UAAd,CAA2B,UAAW,CAClC,MAAO,MAAKd,QACf,CAFD,CAWAR,CAAG,CAACC,SAAJ,CAAcY,aAAd,CAA8B,SAASC,CAAT,CAAqB,CAC/C,GAAII,CAAAA,CAAI,CAAG,KAAKK,QAAL,CAAc,CAAd,IAAX,CACA,GAAsB,IAAlB,GAAAL,CAAI,CAACM,MAAL,EAAJ,CAA4B,CACxBN,CAAI,CAACE,MAAL,CAAY,CAAZ,CACH,CACD,KAAKb,WAAL,GAA2BO,CAC9B,CAND,CAcAd,CAAG,CAACC,SAAJ,CAAcc,UAAd,CAA2B,SAASC,CAAT,CAAkB,CACzC,KAAKR,QAAL,GAAwBQ,CAC3B,CAFD,CAIA,MAAOhB,CAAAA,CAEV,CA5FK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart bar.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_bar\n */\ndefine(['core/chart_base'], function(Base) {\n\n /**\n * Bar chart.\n *\n * @extends {module:core/chart_base}\n * @class\n */\n function Bar() {\n Base.prototype.constructor.apply(this, arguments);\n }\n Bar.prototype = Object.create(Base.prototype);\n\n /**\n * Whether the bars should be displayed horizontally or not.\n *\n * @type {Bool}\n * @protected\n */\n Bar.prototype._horizontal = false;\n\n /**\n * Whether the bars should be stacked or not.\n *\n * @type {Bool}\n * @protected\n */\n Bar.prototype._stacked = false;\n\n /** @override */\n Bar.prototype.TYPE = 'bar';\n\n /** @override */\n Bar.prototype.create = function(Klass, data) {\n var chart = Base.prototype.create.apply(this, arguments);\n chart.setHorizontal(data.horizontal);\n chart.setStacked(data.stacked);\n return chart;\n };\n\n /** @override */\n Bar.prototype._setDefaults = function() {\n Base.prototype._setDefaults.apply(this, arguments);\n var axis = this.getYAxis(0, true);\n axis.setMin(0);\n };\n\n /**\n * Get whether the bars should be displayed horizontally or not.\n *\n * @returns {Bool}\n */\n Bar.prototype.getHorizontal = function() {\n return this._horizontal;\n };\n\n /**\n * Get whether the bars should be stacked or not.\n *\n * @returns {Bool}\n */\n Bar.prototype.getStacked = function() {\n return this._stacked;\n };\n\n /**\n * Set whether the bars should be displayed horizontally or not.\n *\n * It sets the X Axis to zero if the min value is null.\n *\n * @param {Bool} horizontal True if the bars should be displayed horizontally, false otherwise.\n */\n Bar.prototype.setHorizontal = function(horizontal) {\n var axis = this.getXAxis(0, true);\n if (axis.getMin() === null) {\n axis.setMin(0);\n }\n this._horizontal = Boolean(horizontal);\n };\n\n /**\n * Set whether the bars should be stacked or not.\n *\n * @method setStacked\n * @param {Bool} stacked True if the chart should be stacked or false otherwise.\n */\n Bar.prototype.setStacked = function(stacked) {\n this._stacked = Boolean(stacked);\n };\n\n return Bar;\n\n});\n"],"file":"chart_bar.min.js"} \ No newline at end of file diff --git a/lib/amd/build/chart_base.min.js.map b/lib/amd/build/chart_base.min.js.map index a0883a425d3d1..7bb8488d8bf77 100644 --- a/lib/amd/build/chart_base.min.js.map +++ b/lib/amd/build/chart_base.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/chart_base.js"],"names":["define","Series","Axis","Base","_series","_labels","_xaxes","_yaxes","_setDefaults","prototype","_legendOptions","_title","COLORSET","_configColorSet","TYPE","addSeries","series","_validateSeries","push","getColor","configColorSet","getConfigColorSet","setColor","length","create","Klass","data","Chart","setConfigColorSet","config_colorset","setLabels","labels","setTitle","title","legend_options","setLegendOptions","forEach","seriesData","axes","x","axisData","i","setXAxis","y","setYAxis","__getAxis","xy","index","createIfNotExists","setAxis","bind","axis","Error","getLabels","getLegendOptions","getSeries","getTitle","getType","getXAxes","getXAxis","getYAxes","getYAxis","colorset","legendOptions","_validateAxis","getCount"],"mappings":"mSAsBAA,OAAM,mBAAC,CAAC,mBAAD,CAAsB,iBAAtB,CAAD,CAA2C,SAASC,CAAT,CAAiBC,CAAjB,CAAuB,CAYpE,QAASC,CAAAA,CAAT,EAAgB,CACZ,KAAKC,OAAL,CAAe,EAAf,CACA,KAAKC,OAAL,CAAe,EAAf,CACA,KAAKC,MAAL,CAAc,EAAd,CACA,KAAKC,MAAL,CAAc,EAAd,CAEA,KAAKC,YAAL,EACH,CAQDL,CAAI,CAACM,SAAL,CAAeL,OAAf,CAAyB,IAAzB,CAQAD,CAAI,CAACM,SAAL,CAAeJ,OAAf,CAAyB,IAAzB,CAQAF,CAAI,CAACM,SAAL,CAAeC,cAAf,CAAgC,IAAhC,CAQAP,CAAI,CAACM,SAAL,CAAeE,MAAf,CAAwB,IAAxB,CAQAR,CAAI,CAACM,SAAL,CAAeH,MAAf,CAAwB,IAAxB,CAQAH,CAAI,CAACM,SAAL,CAAeF,MAAf,CAAwB,IAAxB,CAQAJ,CAAI,CAACM,SAAL,CAAeG,QAAf,CAA0B,CAAC,SAAD,CAAY,SAAZ,CAAuB,SAAvB,CAAkC,SAAlC,CAA6C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AA0B,CACrDA,CAAK,CAAoB,WAAjB,QAAOA,CAAAA,CAAP,CAA+B,CAA/B,CAAmCA,CAA3C,CACA,GAAY,CAAR,CAAAA,CAAJ,CAAe,CACX,GAAIT,CAAAA,CAAI,CAAS,GAAN,EAAAQ,CAAE,CAAU,KAAKxC,MAAf,CAAwB,KAAKC,MAA1C,CACA,GAA+B,WAA3B,QAAO+B,CAAAA,CAAI,CAACS,CAAK,CAAG,CAAT,CAAf,CAA4C,CACxC,KAAM,IAAIK,CAAAA,KAAJ,CAAU,WAAaN,CAAb,CAAkB,4BAAlB,CAAiDC,CAA3D,CACT,CACJ,CACJ,CARD,CAgBA5C,CAAI,CAACM,SAAL,CAAeQ,eAAf,CAAiC,SAASD,CAAT,CAAiB,CAC9C,GAAI,KAAKZ,OAAL,CAAamB,MAAb,EAAuB,KAAKnB,OAAL,CAAa,CAAb,EAAgB6D,QAAhB,IAA8BjD,CAAM,CAACiD,QAAP,EAAzD,CAA4E,CACxE,KAAM,IAAIb,CAAAA,KAAJ,CAAU,+CAAV,CAET,CAHD,IAGO,IAAI,KAAK/C,OAAL,CAAakB,MAAb,EAAuB,KAAKlB,OAAL,CAAakB,MAAb,EAAuBP,CAAM,CAACiD,QAAP,EAAlD,CAAqE,CACxE,KAAM,IAAIb,CAAAA,KAAJ,CAAU,iCAAV,CACT,CACJ,CAPD,CASA,MAAOjD,CAAAA,CAEV,CA3YK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart base.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_base\n */\ndefine(['core/chart_series', 'core/chart_axis'], function(Series, Axis) {\n\n /**\n * Chart base.\n *\n * The constructor of a chart must never take any argument.\n *\n * {@link module:core/chart_base#_setDefault} to set the defaults on instantiation.\n *\n * @alias module:core/chart_base\n * @class\n */\n function Base() {\n this._series = [];\n this._labels = [];\n this._xaxes = [];\n this._yaxes = [];\n\n this._setDefaults();\n }\n\n /**\n * The series constituting this chart.\n *\n * @protected\n * @type {module:core/chart_series[]}\n */\n Base.prototype._series = null;\n\n /**\n * The labels of the X axis when categorised.\n *\n * @protected\n * @type {String[]}\n */\n Base.prototype._labels = null;\n\n /**\n * Options for chart legend display.\n *\n * @protected\n * @type {Object}\n */\n Base.prototype._legendOptions = null;\n\n /**\n * The title of the chart.\n *\n * @protected\n * @type {String}\n */\n Base.prototype._title = null;\n\n /**\n * The X axes.\n *\n * @protected\n * @type {module:core/chart_axis[]}\n */\n Base.prototype._xaxes = null;\n\n /**\n * The Y axes.\n *\n * @protected\n * @type {module:core/chart_axis[]}\n */\n Base.prototype._yaxes = null;\n\n /**\n * Colours to pick from when automatically assigning them.\n *\n * @const\n * @type {String[]}\n */\n Base.prototype.COLORSET = ['#f3c300', '#875692', '#f38400', '#a1caf1', '#be0032', '#c2b280', '#7f180d', '#008856',\n '#e68fac', '#0067a5'];\n\n /**\n * Set of colours defined by setting $CFG->chart_colorset to be picked when automatically assigning them.\n *\n * @type {String[]}\n * @protected\n */\n Base.prototype._configColorSet = null;\n\n /**\n * The type of chart.\n *\n * @abstract\n * @type {String}\n * @const\n */\n Base.prototype.TYPE = null;\n\n /**\n * Add a series to the chart.\n *\n * This will automatically assign a color to the series if it does not have one.\n *\n * @param {module:core/chart_series} series The series to add.\n */\n Base.prototype.addSeries = function(series) {\n this._validateSeries(series);\n this._series.push(series);\n\n // Give a default color from the set.\n if (series.getColor() === null) {\n var configColorSet = this.getConfigColorSet() || Base.prototype.COLORSET;\n series.setColor(configColorSet[this._series.length % configColorSet.length]);\n }\n };\n\n /**\n * Create a new instance of a chart from serialised data.\n *\n * the serialised attributes they offer and support.\n *\n * @static\n * @method create\n * @param {module:core/chart_base} Klass The class oject representing the type of chart to instantiate.\n * @param {Object} data The data of the chart.\n * @return {module:core/chart_base}\n */\n Base.prototype.create = function(Klass, data) {\n // TODO Not convinced about the usage of Klass here but I can't figure out a way\n // to have a reference to the class in the sub classes, in PHP I'd do new self().\n var Chart = new Klass();\n Chart.setConfigColorSet(data.config_colorset);\n Chart.setLabels(data.labels);\n Chart.setTitle(data.title);\n if (data.legend_options) {\n Chart.setLegendOptions(data.legend_options);\n }\n data.series.forEach(function(seriesData) {\n Chart.addSeries(Series.prototype.create(seriesData));\n });\n data.axes.x.forEach(function(axisData, i) {\n Chart.setXAxis(Axis.prototype.create(axisData), i);\n });\n data.axes.y.forEach(function(axisData, i) {\n Chart.setYAxis(Axis.prototype.create(axisData), i);\n });\n return Chart;\n };\n\n /**\n * Get an axis.\n *\n * @private\n * @param {String} xy Accepts the values 'x' or 'y'.\n * @param {Number} [index=0] The index of the axis of its type.\n * @param {Bool} [createIfNotExists=false] When true, create an instance if it does not exist.\n * @return {module:core/chart_axis}\n */\n Base.prototype.__getAxis = function(xy, index, createIfNotExists) {\n var axes = xy === 'x' ? this._xaxes : this._yaxes,\n setAxis = (xy === 'x' ? this.setXAxis : this.setYAxis).bind(this),\n axis;\n\n index = typeof index === 'undefined' ? 0 : index;\n createIfNotExists = typeof createIfNotExists === 'undefined' ? false : createIfNotExists;\n axis = axes[index];\n\n if (typeof axis === 'undefined') {\n if (!createIfNotExists) {\n throw new Error('Unknown axis.');\n }\n axis = new Axis();\n setAxis(axis, index);\n }\n\n return axis;\n };\n\n /**\n * Get colours defined by setting.\n *\n * @return {String[]}\n */\n Base.prototype.getConfigColorSet = function() {\n return this._configColorSet;\n };\n\n /**\n * Get the labels of the X axis.\n *\n * @return {String[]}\n */\n Base.prototype.getLabels = function() {\n return this._labels;\n };\n\n /**\n * Get whether to display the chart legend.\n *\n * @return {Bool}\n */\n Base.prototype.getLegendOptions = function() {\n return this._legendOptions;\n };\n\n /**\n * Get the series.\n *\n * @return {module:core/chart_series[]}\n */\n Base.prototype.getSeries = function() {\n return this._series;\n };\n\n /**\n * Get the title of the chart.\n *\n * @return {String}\n */\n Base.prototype.getTitle = function() {\n return this._title;\n };\n\n /**\n * Get the type of chart.\n *\n * @see module:core/chart_base#TYPE\n * @return {String}\n */\n Base.prototype.getType = function() {\n if (!this.TYPE) {\n throw new Error('The TYPE property has not been set.');\n }\n return this.TYPE;\n };\n\n /**\n * Get the X axes.\n *\n * @return {module:core/chart_axis[]}\n */\n Base.prototype.getXAxes = function() {\n return this._xaxes;\n };\n\n /**\n * Get an X axis.\n *\n * @param {Number} [index=0] The index of the axis.\n * @param {Bool} [createIfNotExists=false] Create the instance of it does not exist at index.\n * @return {module:core/chart_axis}\n */\n Base.prototype.getXAxis = function(index, createIfNotExists) {\n return this.__getAxis('x', index, createIfNotExists);\n };\n\n /**\n * Get the Y axes.\n *\n * @return {module:core/chart_axis[]}\n */\n Base.prototype.getYAxes = function() {\n return this._yaxes;\n };\n\n /**\n * Get an Y axis.\n *\n * @param {Number} [index=0] The index of the axis.\n * @param {Bool} [createIfNotExists=false] Create the instance of it does not exist at index.\n * @return {module:core/chart_axis}\n */\n Base.prototype.getYAxis = function(index, createIfNotExists) {\n return this.__getAxis('y', index, createIfNotExists);\n };\n\n /**\n * Set colours defined by setting.\n *\n * @param {String[]} colorset An array of css colours.\n * @protected\n */\n Base.prototype.setConfigColorSet = function(colorset) {\n this._configColorSet = colorset;\n };\n\n /**\n * Set the defaults for this chart type.\n *\n * Child classes can extend this to set defaults values on instantiation.\n *\n * emphasize and self-document the defaults values set by the chart type.\n *\n * @protected\n */\n Base.prototype._setDefaults = function() {\n // For the children to extend.\n };\n\n /**\n * Set the labels of the X axis.\n *\n * This requires for each series to contain strictly as many values as there\n * are labels.\n *\n * @param {String[]} labels The labels.\n */\n Base.prototype.setLabels = function(labels) {\n if (labels.length && this._series.length && this._series[0].length != labels.length) {\n throw new Error('Series must match label values.');\n }\n this._labels = labels;\n };\n\n /**\n * Set options for chart legend display.\n *\n * @param {Object} legendOptions\n */\n Base.prototype.setLegendOptions = function(legendOptions) {\n if (typeof legendOptions !== 'object') {\n throw new Error('Setting legend with non-object value:' + legendOptions);\n }\n this._legendOptions = legendOptions;\n };\n\n /**\n * Set the title of the chart.\n *\n * @param {String} title The title.\n */\n Base.prototype.setTitle = function(title) {\n this._title = title;\n };\n\n /**\n * Set an X axis.\n *\n * Note that this will override any predefined axis without warning.\n *\n * @param {module:core/chart_axis} axis The axis.\n * @param {Number} [index=0] The index of the axis.\n */\n Base.prototype.setXAxis = function(axis, index) {\n index = typeof index === 'undefined' ? 0 : index;\n this._validateAxis('x', axis, index);\n this._xaxes[index] = axis;\n };\n\n /**\n * Set a Y axis.\n *\n * Note that this will override any predefined axis without warning.\n *\n * @param {module:core/chart_axis} axis The axis.\n * @param {Number} [index=0] The index of the axis.\n */\n Base.prototype.setYAxis = function(axis, index) {\n index = typeof index === 'undefined' ? 0 : index;\n this._validateAxis('y', axis, index);\n this._yaxes[index] = axis;\n };\n\n /**\n * Validate an axis.\n *\n * @protected\n * @param {String} xy X or Y axis.\n * @param {module:core/chart_axis} axis The axis to validate.\n * @param {Number} [index=0] The index of the axis.\n */\n Base.prototype._validateAxis = function(xy, axis, index) {\n index = typeof index === 'undefined' ? 0 : index;\n if (index > 0) {\n var axes = xy == 'x' ? this._xaxes : this._yaxes;\n if (typeof axes[index - 1] === 'undefined') {\n throw new Error('Missing ' + xy + ' axis at index lower than ' + index);\n }\n }\n };\n\n /**\n * Validate a series.\n *\n * @protected\n * @param {module:core/chart_series} series The series to validate.\n */\n Base.prototype._validateSeries = function(series) {\n if (this._series.length && this._series[0].getCount() != series.getCount()) {\n throw new Error('Series do not have an equal number of values.');\n\n } else if (this._labels.length && this._labels.length != series.getCount()) {\n throw new Error('Series must match label values.');\n }\n };\n\n return Base;\n\n});\n"],"file":"chart_base.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/chart_base.js"],"names":["define","Series","Axis","Base","_series","_labels","_xaxes","_yaxes","_setDefaults","prototype","_legendOptions","_title","COLORSET","_configColorSet","TYPE","addSeries","series","_validateSeries","push","getColor","configColorSet","getConfigColorSet","setColor","length","create","Klass","data","Chart","setConfigColorSet","config_colorset","setLabels","labels","setTitle","title","legend_options","setLegendOptions","forEach","seriesData","axes","x","axisData","i","setXAxis","y","setYAxis","__getAxis","xy","index","createIfNotExists","setAxis","bind","axis","Error","getLabels","getLegendOptions","getSeries","getTitle","getType","getXAxes","getXAxis","getYAxes","getYAxis","colorset","legendOptions","_validateAxis","getCount"],"mappings":"mSAsBAA,OAAM,mBAAC,CAAC,mBAAD,CAAsB,iBAAtB,CAAD,CAA2C,SAASC,CAAT,CAAiBC,CAAjB,CAAuB,CAWpE,QAASC,CAAAA,CAAT,EAAgB,CACZ,KAAKC,OAAL,CAAe,EAAf,CACA,KAAKC,OAAL,CAAe,EAAf,CACA,KAAKC,MAAL,CAAc,EAAd,CACA,KAAKC,MAAL,CAAc,EAAd,CAEA,KAAKC,YAAL,EACH,CAQDL,CAAI,CAACM,SAAL,CAAeL,OAAf,CAAyB,IAAzB,CAQAD,CAAI,CAACM,SAAL,CAAeJ,OAAf,CAAyB,IAAzB,CAQAF,CAAI,CAACM,SAAL,CAAeC,cAAf,CAAgC,IAAhC,CAQAP,CAAI,CAACM,SAAL,CAAeE,MAAf,CAAwB,IAAxB,CAQAR,CAAI,CAACM,SAAL,CAAeH,MAAf,CAAwB,IAAxB,CAQAH,CAAI,CAACM,SAAL,CAAeF,MAAf,CAAwB,IAAxB,CAQAJ,CAAI,CAACM,SAAL,CAAeG,QAAf,CAA0B,CAAC,SAAD,CAAY,SAAZ,CAAuB,SAAvB,CAAkC,SAAlC,CAA6C,SAA7C,CAAwD,SAAxD,CAAmE,SAAnE,CAA8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AAAA,CAAP,CAA+B,CAA/B,CAAmCA,CAA3C,CACA,GAAY,CAAR,CAAAA,CAAJ,CAAe,CACX,GAAIT,CAAAA,CAAI,CAAS,GAAN,EAAAQ,CAAE,CAAU,KAAKxC,MAAf,CAAwB,KAAKC,MAA1C,CACA,GAA+B,WAA3B,QAAO+B,CAAAA,CAAI,CAACS,CAAK,CAAG,CAAT,CAAf,CAA4C,CACxC,KAAM,IAAIK,CAAAA,KAAJ,CAAU,WAAaN,CAAb,CAAkB,4BAAlB,CAAiDC,CAA3D,CACT,CACJ,CACJ,CARD,CAgBA5C,CAAI,CAACM,SAAL,CAAeQ,eAAf,CAAiC,SAASD,CAAT,CAAiB,CAC9C,GAAI,KAAKZ,OAAL,CAAamB,MAAb,EAAuB,KAAKnB,OAAL,CAAa,CAAb,EAAgB6D,QAAhB,IAA8BjD,CAAM,CAACiD,QAAP,EAAzD,CAA4E,CACxE,KAAM,IAAIb,CAAAA,KAAJ,CAAU,+CAAV,CAET,CAHD,IAGO,IAAI,KAAK/C,OAAL,CAAakB,MAAb,EAAuB,KAAKlB,OAAL,CAAakB,MAAb,EAAuBP,CAAM,CAACiD,QAAP,EAAlD,CAAqE,CACxE,KAAM,IAAIb,CAAAA,KAAJ,CAAU,iCAAV,CACT,CACJ,CAPD,CASA,MAAOjD,CAAAA,CAEV,CA1YK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart base.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_base\n */\ndefine(['core/chart_series', 'core/chart_axis'], function(Series, Axis) {\n\n /**\n * Chart base.\n *\n * The constructor of a chart must never take any argument.\n *\n * {@link module:core/chart_base#_setDefault} to set the defaults on instantiation.\n *\n * @class\n */\n function Base() {\n this._series = [];\n this._labels = [];\n this._xaxes = [];\n this._yaxes = [];\n\n this._setDefaults();\n }\n\n /**\n * The series constituting this chart.\n *\n * @protected\n * @type {module:core/chart_series[]}\n */\n Base.prototype._series = null;\n\n /**\n * The labels of the X axis when categorised.\n *\n * @protected\n * @type {String[]}\n */\n Base.prototype._labels = null;\n\n /**\n * Options for chart legend display.\n *\n * @protected\n * @type {Object}\n */\n Base.prototype._legendOptions = null;\n\n /**\n * The title of the chart.\n *\n * @protected\n * @type {String}\n */\n Base.prototype._title = null;\n\n /**\n * The X axes.\n *\n * @protected\n * @type {module:core/chart_axis[]}\n */\n Base.prototype._xaxes = null;\n\n /**\n * The Y axes.\n *\n * @protected\n * @type {module:core/chart_axis[]}\n */\n Base.prototype._yaxes = null;\n\n /**\n * Colours to pick from when automatically assigning them.\n *\n * @const\n * @type {String[]}\n */\n Base.prototype.COLORSET = ['#f3c300', '#875692', '#f38400', '#a1caf1', '#be0032', '#c2b280', '#7f180d', '#008856',\n '#e68fac', '#0067a5'];\n\n /**\n * Set of colours defined by setting $CFG->chart_colorset to be picked when automatically assigning them.\n *\n * @type {String[]}\n * @protected\n */\n Base.prototype._configColorSet = null;\n\n /**\n * The type of chart.\n *\n * @abstract\n * @type {String}\n * @const\n */\n Base.prototype.TYPE = null;\n\n /**\n * Add a series to the chart.\n *\n * This will automatically assign a color to the series if it does not have one.\n *\n * @param {module:core/chart_series} series The series to add.\n */\n Base.prototype.addSeries = function(series) {\n this._validateSeries(series);\n this._series.push(series);\n\n // Give a default color from the set.\n if (series.getColor() === null) {\n var configColorSet = this.getConfigColorSet() || Base.prototype.COLORSET;\n series.setColor(configColorSet[this._series.length % configColorSet.length]);\n }\n };\n\n /**\n * Create a new instance of a chart from serialised data.\n *\n * the serialised attributes they offer and support.\n *\n * @static\n * @method create\n * @param {module:core/chart_base} Klass The class oject representing the type of chart to instantiate.\n * @param {Object} data The data of the chart.\n * @return {module:core/chart_base}\n */\n Base.prototype.create = function(Klass, data) {\n // TODO Not convinced about the usage of Klass here but I can't figure out a way\n // to have a reference to the class in the sub classes, in PHP I'd do new self().\n var Chart = new Klass();\n Chart.setConfigColorSet(data.config_colorset);\n Chart.setLabels(data.labels);\n Chart.setTitle(data.title);\n if (data.legend_options) {\n Chart.setLegendOptions(data.legend_options);\n }\n data.series.forEach(function(seriesData) {\n Chart.addSeries(Series.prototype.create(seriesData));\n });\n data.axes.x.forEach(function(axisData, i) {\n Chart.setXAxis(Axis.prototype.create(axisData), i);\n });\n data.axes.y.forEach(function(axisData, i) {\n Chart.setYAxis(Axis.prototype.create(axisData), i);\n });\n return Chart;\n };\n\n /**\n * Get an axis.\n *\n * @private\n * @param {String} xy Accepts the values 'x' or 'y'.\n * @param {Number} [index=0] The index of the axis of its type.\n * @param {Bool} [createIfNotExists=false] When true, create an instance if it does not exist.\n * @return {module:core/chart_axis}\n */\n Base.prototype.__getAxis = function(xy, index, createIfNotExists) {\n var axes = xy === 'x' ? this._xaxes : this._yaxes,\n setAxis = (xy === 'x' ? this.setXAxis : this.setYAxis).bind(this),\n axis;\n\n index = typeof index === 'undefined' ? 0 : index;\n createIfNotExists = typeof createIfNotExists === 'undefined' ? false : createIfNotExists;\n axis = axes[index];\n\n if (typeof axis === 'undefined') {\n if (!createIfNotExists) {\n throw new Error('Unknown axis.');\n }\n axis = new Axis();\n setAxis(axis, index);\n }\n\n return axis;\n };\n\n /**\n * Get colours defined by setting.\n *\n * @return {String[]}\n */\n Base.prototype.getConfigColorSet = function() {\n return this._configColorSet;\n };\n\n /**\n * Get the labels of the X axis.\n *\n * @return {String[]}\n */\n Base.prototype.getLabels = function() {\n return this._labels;\n };\n\n /**\n * Get whether to display the chart legend.\n *\n * @return {Bool}\n */\n Base.prototype.getLegendOptions = function() {\n return this._legendOptions;\n };\n\n /**\n * Get the series.\n *\n * @return {module:core/chart_series[]}\n */\n Base.prototype.getSeries = function() {\n return this._series;\n };\n\n /**\n * Get the title of the chart.\n *\n * @return {String}\n */\n Base.prototype.getTitle = function() {\n return this._title;\n };\n\n /**\n * Get the type of chart.\n *\n * @see module:core/chart_base#TYPE\n * @return {String}\n */\n Base.prototype.getType = function() {\n if (!this.TYPE) {\n throw new Error('The TYPE property has not been set.');\n }\n return this.TYPE;\n };\n\n /**\n * Get the X axes.\n *\n * @return {module:core/chart_axis[]}\n */\n Base.prototype.getXAxes = function() {\n return this._xaxes;\n };\n\n /**\n * Get an X axis.\n *\n * @param {Number} [index=0] The index of the axis.\n * @param {Bool} [createIfNotExists=false] Create the instance of it does not exist at index.\n * @return {module:core/chart_axis}\n */\n Base.prototype.getXAxis = function(index, createIfNotExists) {\n return this.__getAxis('x', index, createIfNotExists);\n };\n\n /**\n * Get the Y axes.\n *\n * @return {module:core/chart_axis[]}\n */\n Base.prototype.getYAxes = function() {\n return this._yaxes;\n };\n\n /**\n * Get an Y axis.\n *\n * @param {Number} [index=0] The index of the axis.\n * @param {Bool} [createIfNotExists=false] Create the instance of it does not exist at index.\n * @return {module:core/chart_axis}\n */\n Base.prototype.getYAxis = function(index, createIfNotExists) {\n return this.__getAxis('y', index, createIfNotExists);\n };\n\n /**\n * Set colours defined by setting.\n *\n * @param {String[]} colorset An array of css colours.\n * @protected\n */\n Base.prototype.setConfigColorSet = function(colorset) {\n this._configColorSet = colorset;\n };\n\n /**\n * Set the defaults for this chart type.\n *\n * Child classes can extend this to set defaults values on instantiation.\n *\n * emphasize and self-document the defaults values set by the chart type.\n *\n * @protected\n */\n Base.prototype._setDefaults = function() {\n // For the children to extend.\n };\n\n /**\n * Set the labels of the X axis.\n *\n * This requires for each series to contain strictly as many values as there\n * are labels.\n *\n * @param {String[]} labels The labels.\n */\n Base.prototype.setLabels = function(labels) {\n if (labels.length && this._series.length && this._series[0].length != labels.length) {\n throw new Error('Series must match label values.');\n }\n this._labels = labels;\n };\n\n /**\n * Set options for chart legend display.\n *\n * @param {Object} legendOptions\n */\n Base.prototype.setLegendOptions = function(legendOptions) {\n if (typeof legendOptions !== 'object') {\n throw new Error('Setting legend with non-object value:' + legendOptions);\n }\n this._legendOptions = legendOptions;\n };\n\n /**\n * Set the title of the chart.\n *\n * @param {String} title The title.\n */\n Base.prototype.setTitle = function(title) {\n this._title = title;\n };\n\n /**\n * Set an X axis.\n *\n * Note that this will override any predefined axis without warning.\n *\n * @param {module:core/chart_axis} axis The axis.\n * @param {Number} [index=0] The index of the axis.\n */\n Base.prototype.setXAxis = function(axis, index) {\n index = typeof index === 'undefined' ? 0 : index;\n this._validateAxis('x', axis, index);\n this._xaxes[index] = axis;\n };\n\n /**\n * Set a Y axis.\n *\n * Note that this will override any predefined axis without warning.\n *\n * @param {module:core/chart_axis} axis The axis.\n * @param {Number} [index=0] The index of the axis.\n */\n Base.prototype.setYAxis = function(axis, index) {\n index = typeof index === 'undefined' ? 0 : index;\n this._validateAxis('y', axis, index);\n this._yaxes[index] = axis;\n };\n\n /**\n * Validate an axis.\n *\n * @protected\n * @param {String} xy X or Y axis.\n * @param {module:core/chart_axis} axis The axis to validate.\n * @param {Number} [index=0] The index of the axis.\n */\n Base.prototype._validateAxis = function(xy, axis, index) {\n index = typeof index === 'undefined' ? 0 : index;\n if (index > 0) {\n var axes = xy == 'x' ? this._xaxes : this._yaxes;\n if (typeof axes[index - 1] === 'undefined') {\n throw new Error('Missing ' + xy + ' axis at index lower than ' + index);\n }\n }\n };\n\n /**\n * Validate a series.\n *\n * @protected\n * @param {module:core/chart_series} series The series to validate.\n */\n Base.prototype._validateSeries = function(series) {\n if (this._series.length && this._series[0].getCount() != series.getCount()) {\n throw new Error('Series do not have an equal number of values.');\n\n } else if (this._labels.length && this._labels.length != series.getCount()) {\n throw new Error('Series must match label values.');\n }\n };\n\n return Base;\n\n});\n"],"file":"chart_base.min.js"} \ No newline at end of file diff --git a/lib/amd/build/chart_line.min.js.map b/lib/amd/build/chart_line.min.js.map index 6187fc3013a2f..fe2e242c8ba14 100644 --- a/lib/amd/build/chart_line.min.js.map +++ b/lib/amd/build/chart_line.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/chart_line.js"],"names":["define","Base","Line","prototype","constructor","apply","arguments","Object","create","TYPE","_smooth","Klass","data","chart","setSmooth","smooth","getSmooth"],"mappings":"AAsBAA,OAAM,mBAAC,CAAC,iBAAD,CAAD,CAAsB,SAASC,CAAT,CAAe,CASvC,QAASC,CAAAA,CAAT,EAAgB,CACZD,CAAI,CAACE,SAAL,CAAeC,WAAf,CAA2BC,KAA3B,CAAiC,IAAjC,CAAuCC,SAAvC,CACH,CACDJ,CAAI,CAACC,SAAL,CAAiBI,MAAM,CAACC,MAAP,CAAcP,CAAI,CAACE,SAAnB,CAAjB,CAGAD,CAAI,CAACC,SAAL,CAAeM,IAAf,CAAsB,MAAtB,CAUAP,CAAI,CAACC,SAAL,CAAeO,OAAf,IAGAR,CAAI,CAACC,SAAL,CAAeK,MAAf,CAAwB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAC1C,GAAIC,CAAAA,CAAK,CAAGZ,CAAI,CAACE,SAAL,CAAeK,MAAf,CAAsBH,KAAtB,CAA4B,IAA5B,CAAkCC,SAAlC,CAAZ,CACAO,CAAK,CAACC,SAAN,CAAgBF,CAAI,CAACG,MAArB,EACA,MAAOF,CAAAA,CACV,CAJD,CAYAX,CAAI,CAACC,SAAL,CAAea,SAAf,CAA2B,UAAW,CAClC,MAAO,MAAKN,OACf,CAFD,CAUAR,CAAI,CAACC,SAAL,CAAeW,SAAf,CAA2B,SAASC,CAAT,CAAiB,CACxC,KAAKL,OAAL,GAAuBK,CAC1B,CAFD,CAIA,MAAOb,CAAAA,CAEV,CAxDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart line.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_line\n */\ndefine(['core/chart_base'], function(Base) {\n\n /**\n * Line chart.\n *\n * @alias module:core/chart_line\n * @extends {module:core/chart_base}\n * @class\n */\n function Line() {\n Base.prototype.constructor.apply(this, arguments);\n }\n Line.prototype = Object.create(Base.prototype);\n\n /** @override */\n Line.prototype.TYPE = 'line';\n\n /**\n * Whether the line should be smooth or not.\n *\n * By default the chart lines are not smooth.\n *\n * @type {Bool}\n * @protected\n */\n Line.prototype._smooth = false;\n\n /** @override */\n Line.prototype.create = function(Klass, data) {\n var chart = Base.prototype.create.apply(this, arguments);\n chart.setSmooth(data.smooth);\n return chart;\n };\n\n /**\n * Get whether the line should be smooth or not.\n *\n * @method getSmooth\n * @returns {Bool}\n */\n Line.prototype.getSmooth = function() {\n return this._smooth;\n };\n\n /**\n * Set whether the line should be smooth or not.\n *\n * @method setSmooth\n * @param {Bool} smooth True if the line chart should be smooth, false otherwise.\n */\n Line.prototype.setSmooth = function(smooth) {\n this._smooth = Boolean(smooth);\n };\n\n return Line;\n\n});\n"],"file":"chart_line.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/chart_line.js"],"names":["define","Base","Line","prototype","constructor","apply","arguments","Object","create","TYPE","_smooth","Klass","data","chart","setSmooth","smooth","getSmooth"],"mappings":"AAsBAA,OAAM,mBAAC,CAAC,iBAAD,CAAD,CAAsB,SAASC,CAAT,CAAe,CAQvC,QAASC,CAAAA,CAAT,EAAgB,CACZD,CAAI,CAACE,SAAL,CAAeC,WAAf,CAA2BC,KAA3B,CAAiC,IAAjC,CAAuCC,SAAvC,CACH,CACDJ,CAAI,CAACC,SAAL,CAAiBI,MAAM,CAACC,MAAP,CAAcP,CAAI,CAACE,SAAnB,CAAjB,CAGAD,CAAI,CAACC,SAAL,CAAeM,IAAf,CAAsB,MAAtB,CAUAP,CAAI,CAACC,SAAL,CAAeO,OAAf,IAGAR,CAAI,CAACC,SAAL,CAAeK,MAAf,CAAwB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAC1C,GAAIC,CAAAA,CAAK,CAAGZ,CAAI,CAACE,SAAL,CAAeK,MAAf,CAAsBH,KAAtB,CAA4B,IAA5B,CAAkCC,SAAlC,CAAZ,CACAO,CAAK,CAACC,SAAN,CAAgBF,CAAI,CAACG,MAArB,EACA,MAAOF,CAAAA,CACV,CAJD,CAYAX,CAAI,CAACC,SAAL,CAAea,SAAf,CAA2B,UAAW,CAClC,MAAO,MAAKN,OACf,CAFD,CAUAR,CAAI,CAACC,SAAL,CAAeW,SAAf,CAA2B,SAASC,CAAT,CAAiB,CACxC,KAAKL,OAAL,GAAuBK,CAC1B,CAFD,CAIA,MAAOb,CAAAA,CAEV,CAvDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart line.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_line\n */\ndefine(['core/chart_base'], function(Base) {\n\n /**\n * Line chart.\n *\n * @extends {module:core/chart_base}\n * @class\n */\n function Line() {\n Base.prototype.constructor.apply(this, arguments);\n }\n Line.prototype = Object.create(Base.prototype);\n\n /** @override */\n Line.prototype.TYPE = 'line';\n\n /**\n * Whether the line should be smooth or not.\n *\n * By default the chart lines are not smooth.\n *\n * @type {Bool}\n * @protected\n */\n Line.prototype._smooth = false;\n\n /** @override */\n Line.prototype.create = function(Klass, data) {\n var chart = Base.prototype.create.apply(this, arguments);\n chart.setSmooth(data.smooth);\n return chart;\n };\n\n /**\n * Get whether the line should be smooth or not.\n *\n * @method getSmooth\n * @returns {Bool}\n */\n Line.prototype.getSmooth = function() {\n return this._smooth;\n };\n\n /**\n * Set whether the line should be smooth or not.\n *\n * @method setSmooth\n * @param {Bool} smooth True if the line chart should be smooth, false otherwise.\n */\n Line.prototype.setSmooth = function(smooth) {\n this._smooth = Boolean(smooth);\n };\n\n return Line;\n\n});\n"],"file":"chart_line.min.js"} \ No newline at end of file diff --git a/lib/amd/build/chart_output_base.min.js.map b/lib/amd/build/chart_output_base.min.js.map index 601154647c5ca..8544252062b81 100644 --- a/lib/amd/build/chart_output_base.min.js.map +++ b/lib/amd/build/chart_output_base.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/chart_output_base.js"],"names":["define","$","Base","node","chart","_node","_chart","prototype","update","Error"],"mappings":"AAwBAA,OAAM,0BAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAmB3B,QAASC,CAAAA,CAAT,CAAcC,CAAd,CAAoBC,CAApB,CAA2B,CACvB,KAAKC,KAAL,CAAaJ,CAAC,CAACE,CAAD,CAAd,CACA,KAAKG,MAAL,CAAcF,CACjB,CAYDF,CAAI,CAACK,SAAL,CAAeC,MAAf,CAAwB,UAAW,CAC/B,KAAM,IAAIC,CAAAA,KAAJ,CAAU,gBAAV,CACT,CAFD,CAIA,MAAOP,CAAAA,CAEV,CAxCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart output base.\n *\n * This takes a chart object and draws it.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_output_base\n */\ndefine(['jquery'], function($) {\n\n /**\n * Chart output base.\n *\n * The constructor of an output class must instantly generate and display the\n * chart. It is also the responsability of the output module to check that\n * the node received is of the appropriate type, if not a new node can be\n * added within.\n *\n * The output module has total control over the content of the node and can\n * clear it or output anything to it at will. A node should not be shared by\n * two simultaneous output modules.\n *\n * @class\n * @alias module:core/chart_output_base\n * @param {Node} node The node to output with/in.\n * @param {Chart} chart A chart object.\n */\n function Base(node, chart) {\n this._node = $(node);\n this._chart = chart;\n }\n\n /**\n * Update method.\n *\n * This is the public method through which an output instance in informed\n * that the chart instance has been updated and they need to update the\n * chart rendering.\n *\n * @abstract\n * @return {Void}\n */\n Base.prototype.update = function() {\n throw new Error('Not supported.');\n };\n\n return Base;\n\n});\n"],"file":"chart_output_base.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/chart_output_base.js"],"names":["define","$","Base","node","chart","_node","_chart","prototype","update","Error"],"mappings":"AAwBAA,OAAM,0BAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAkB3B,QAASC,CAAAA,CAAT,CAAcC,CAAd,CAAoBC,CAApB,CAA2B,CACvB,KAAKC,KAAL,CAAaJ,CAAC,CAACE,CAAD,CAAd,CACA,KAAKG,MAAL,CAAcF,CACjB,CAYDF,CAAI,CAACK,SAAL,CAAeC,MAAf,CAAwB,UAAW,CAC/B,KAAM,IAAIC,CAAAA,KAAJ,CAAU,gBAAV,CACT,CAFD,CAIA,MAAOP,CAAAA,CAEV,CAvCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart output base.\n *\n * This takes a chart object and draws it.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_output_base\n */\ndefine(['jquery'], function($) {\n\n /**\n * Chart output base.\n *\n * The constructor of an output class must instantly generate and display the\n * chart. It is also the responsability of the output module to check that\n * the node received is of the appropriate type, if not a new node can be\n * added within.\n *\n * The output module has total control over the content of the node and can\n * clear it or output anything to it at will. A node should not be shared by\n * two simultaneous output modules.\n *\n * @class\n * @param {Node} node The node to output with/in.\n * @param {Chart} chart A chart object.\n */\n function Base(node, chart) {\n this._node = $(node);\n this._chart = chart;\n }\n\n /**\n * Update method.\n *\n * This is the public method through which an output instance in informed\n * that the chart instance has been updated and they need to update the\n * chart rendering.\n *\n * @abstract\n * @return {Void}\n */\n Base.prototype.update = function() {\n throw new Error('Not supported.');\n };\n\n return Base;\n\n});\n"],"file":"chart_output_base.min.js"} \ No newline at end of file diff --git a/lib/amd/build/chart_output_chartjs.min.js.map b/lib/amd/build/chart_output_chartjs.min.js.map index 81b805a84e039..ae0a6821c0c6b 100644 --- a/lib/amd/build/chart_output_chartjs.min.js.map +++ b/lib/amd/build/chart_output_chartjs.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/chart_output_chartjs.js"],"names":["define","$","Chartjs","Axis","Bar","Base","Line","Pie","Series","makeAxisId","xy","index","Output","prototype","constructor","apply","arguments","_canvas","_node","prop","append","_build","Object","create","_config","_chartjs","_makeConfig","_cleanData","data","Array","map","value","html","text","_getChartType","type","_chart","getType","TYPE","getHorizontal","getDoughnut","_makeAxisConfig","axis","scaleData","id","getPosition","POS_DEFAULT","position","getLabel","scaleLabel","display","labelString","getStepSize","ticks","stepSize","getMax","max","getMin","min","config","labels","getLabels","datasets","_makeDatasetsConfig","options","title","getTitle","legendOptions","getLegendOptions","legend","getXAxes","forEach","i","axisLabels","scales","xAxes","callback","stacked","_isStacked","bind","getYAxes","yAxes","parseInt","tooltips","callbacks","label","_makeTooltip","sets","getSeries","series","colors","hasColoredValues","getColors","getColor","dataset","getValues","fill","getFill","backgroundColor","borderColor","lineTension","_isSmooth","getXAxis","xAxisID","getYAxis","yAxisID","tooltipItem","datasetIndex","serieLabel","serieLabels","chartData","tooltipData","tooltip","xLabel","yLabel","chartLabels","push","smooth","getSmooth","TYPE_LINE","getStacked","update","extend"],"mappings":"AAsBAA,OAAM,6BAAC,CACH,QADG,CAEH,cAFG,CAGH,iBAHG,CAIH,gBAJG,CAKH,wBALG,CAMH,iBANG,CAOH,gBAPG,CAQH,mBARG,CAAD,CASH,SAASC,CAAT,CAAYC,CAAZ,CAAqBC,CAArB,CAA2BC,CAA3B,CAAgCC,CAAhC,CAAsCC,CAAtC,CAA4CC,CAA5C,CAAiDC,CAAjD,CAAyD,CASxD,GAAIC,CAAAA,CAAU,CAAG,SAASC,CAAT,CAAaC,CAAb,CAAoB,CACjC,MAAO,QAAUD,CAAV,CAAe,GAAf,CAAqBC,CAC/B,CAFD,CAWA,QAASC,CAAAA,CAAT,EAAkB,CACdP,CAAI,CAACQ,SAAL,CAAeC,WAAf,CAA2BC,KAA3B,CAAiC,IAAjC,CAAuCC,SAAvC,EAGA,KAAKC,OAAL,CAAe,KAAKC,KAApB,CACA,GAAoC,QAAhC,OAAKD,OAAL,CAAaE,IAAb,CAAkB,SA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CAAO,CAACI,IAAR,CAAa,KAAKzF,UAAL,CAAgBiF,CAAhB,EAA8B,IAA9B,CAAqCG,CAAlD,CACH,CAED,MAAOC,CAAAA,CACV,CA1BD,CAmCApG,CAAM,CAACC,SAAP,CAAiBwF,SAAjB,CAA6B,SAASZ,CAAT,CAAiB,CAC1C,GAAI4B,CAAAA,CAAM,GAAV,CACA,GAAI,KAAKjF,MAAL,CAAYC,OAAZ,KAA0B/B,CAAI,CAACO,SAAL,CAAeyB,IAA7C,CAAmD,CAC/C+E,CAAM,CAAG5B,CAAM,CAAC6B,SAAP,EAAT,CACA,GAAe,IAAX,GAAAD,CAAJ,CAAqB,CACjBA,CAAM,CAAG,KAAKjF,MAAL,CAAYkF,SAAZ,EACZ,CACJ,CALD,IAKO,IAAI7B,CAAM,CAACpD,OAAP,KAAqB7B,CAAM,CAACK,SAAP,CAAiB0G,SAA1C,CAAqD,CACxDF,CAAM,CAAG5B,CAAM,CAAC6B,SAAP,EACZ,CAED,MAAOD,CAAAA,CACV,CAZD,CAoBAzG,CAAM,CAACC,SAAP,CAAiBiE,UAAjB,CAA8B,UAAW,CACrC,GAAID,CAAAA,CAAO,GAAX,CAGA,GAAI,KAAKzC,MAAL,CAAYC,OAAZ,KAA0BjC,CAAG,CAACS,SAAJ,CAAcyB,IAA5C,CAAkD,CAC9CuC,CAAO,CAAG,KAAKzC,MAAL,CAAYoF,UAAZ,EACb,CAED,MAAO3C,CAAAA,CACV,CATD,CAYAjE,CAAM,CAACC,SAAP,CAAiB4G,MAAjB,CAA0B,UAAW,CACjCxH,CAAC,CAACyH,MAAF,IAAe,KAAKlG,OAApB,CAA6B,KAAKE,WAAL,EAA7B,EACA,KAAKD,QAAL,CAAcgG,MAAd,EACH,CAHD,CAKA,MAAO7G,CAAAA,CAEV,CArVK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart output for chart.js.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_output_chartjs\n */\ndefine([\n 'jquery',\n 'core/chartjs',\n 'core/chart_axis',\n 'core/chart_bar',\n 'core/chart_output_base',\n 'core/chart_line',\n 'core/chart_pie',\n 'core/chart_series'\n], function($, Chartjs, Axis, Bar, Base, Line, Pie, Series) {\n\n /**\n * Makes an axis ID.\n *\n * @param {String} xy Accepts 'x' and 'y'.\n * @param {Number} index The axis index.\n * @return {String}\n */\n var makeAxisId = function(xy, index) {\n return 'axis-' + xy + '-' + index;\n };\n\n /**\n * Chart output for Chart.js.\n *\n * @class\n * @alias module:core/chart_output_chartjs\n * @extends {module:core/chart_output_base}\n */\n function Output() {\n Base.prototype.constructor.apply(this, arguments);\n\n // Make sure that we've got a canvas tag.\n this._canvas = this._node;\n if (this._canvas.prop('tagName') != 'CANVAS') {\n this._canvas = $('');\n this._node.append(this._canvas);\n }\n\n this._build();\n }\n Output.prototype = Object.create(Base.prototype);\n\n /**\n * Reference to the chart config object.\n *\n * @type {Object}\n * @protected\n */\n Output.prototype._config = null;\n\n /**\n * Reference to the instance of chart.js.\n *\n * @type {Object}\n * @protected\n */\n Output.prototype._chartjs = null;\n\n /**\n * Reference to the canvas node.\n *\n * @type {Jquery}\n * @protected\n */\n Output.prototype._canvas = null;\n\n /**\n * Builds the config and the chart.\n *\n * @protected\n */\n Output.prototype._build = function() {\n this._config = this._makeConfig();\n this._chartjs = new Chartjs(this._canvas[0], this._config);\n };\n\n /**\n * Clean data.\n *\n * @param {(String|String[])} data A single string or an array of strings.\n * @returns {(String|String[])}\n * @protected\n */\n Output.prototype._cleanData = function(data) {\n if (data instanceof Array) {\n return data.map(function(value) {\n return $('').html(value).text();\n });\n } else {\n return $('').html(data).text();\n }\n };\n\n /**\n * Get the chart type and handles the Chart.js specific chart types.\n *\n * By default returns the current chart TYPE value. Also does the handling of specific chart types, for example\n * check if the bar chart should be horizontal and the pie chart should be displayed as a doughnut.\n *\n * @method getChartType\n * @returns {String} the chart type.\n * @protected\n */\n Output.prototype._getChartType = function() {\n var type = this._chart.getType();\n\n // Bars can be displayed vertically and horizontally, defining horizontalBar type.\n if (this._chart.getType() === Bar.prototype.TYPE && this._chart.getHorizontal() === true) {\n type = 'horizontalBar';\n } else if (this._chart.getType() === Pie.prototype.TYPE && this._chart.getDoughnut() === true) {\n // Pie chart can be displayed as doughnut.\n type = 'doughnut';\n }\n\n return type;\n };\n\n /**\n * Make the axis config.\n *\n * @protected\n * @param {module:core/chart_axis} axis The axis.\n * @param {String} xy Accepts 'x' or 'y'.\n * @param {Number} index The axis index.\n * @return {Object} The axis config.\n */\n Output.prototype._makeAxisConfig = function(axis, xy, index) {\n var scaleData = {\n id: makeAxisId(xy, index)\n };\n\n if (axis.getPosition() !== Axis.prototype.POS_DEFAULT) {\n scaleData.position = axis.getPosition();\n }\n\n if (axis.getLabel() !== null) {\n scaleData.scaleLabel = {\n display: true,\n labelString: this._cleanData(axis.getLabel())\n };\n }\n\n if (axis.getStepSize() !== null) {\n scaleData.ticks = scaleData.ticks || {};\n scaleData.ticks.stepSize = axis.getStepSize();\n }\n\n if (axis.getMax() !== null) {\n scaleData.ticks = scaleData.ticks || {};\n scaleData.ticks.max = axis.getMax();\n }\n\n if (axis.getMin() !== null) {\n scaleData.ticks = scaleData.ticks || {};\n scaleData.ticks.min = axis.getMin();\n }\n\n return scaleData;\n };\n\n /**\n * Make the config config.\n *\n * @protected\n * @param {module:core/chart_axis} axis The axis.\n * @return {Object} The axis config.\n */\n Output.prototype._makeConfig = function() {\n var config = {\n type: this._getChartType(),\n data: {\n labels: this._cleanData(this._chart.getLabels()),\n datasets: this._makeDatasetsConfig()\n },\n options: {\n title: {\n display: this._chart.getTitle() !== null,\n text: this._cleanData(this._chart.getTitle())\n }\n }\n };\n var legendOptions = this._chart.getLegendOptions();\n if (legendOptions) {\n config.options.legend = legendOptions;\n }\n\n\n this._chart.getXAxes().forEach(function(axis, i) {\n var axisLabels = axis.getLabels();\n\n config.options.scales = config.options.scales || {};\n config.options.scales.xAxes = config.options.scales.xAxes || [];\n config.options.scales.xAxes[i] = this._makeAxisConfig(axis, 'x', i);\n\n if (axisLabels !== null) {\n config.options.scales.xAxes[i].ticks.callback = function(value, index) {\n return axisLabels[index] || '';\n };\n }\n config.options.scales.xAxes[i].stacked = this._isStacked();\n }.bind(this));\n\n this._chart.getYAxes().forEach(function(axis, i) {\n var axisLabels = axis.getLabels();\n\n config.options.scales = config.options.scales || {};\n config.options.scales.yAxes = config.options.scales.yAxes || [];\n config.options.scales.yAxes[i] = this._makeAxisConfig(axis, 'y', i);\n\n if (axisLabels !== null) {\n config.options.scales.yAxes[i].ticks.callback = function(value) {\n return axisLabels[parseInt(value, 10)] || '';\n };\n }\n config.options.scales.yAxes[i].stacked = this._isStacked();\n }.bind(this));\n\n config.options.tooltips = {\n callbacks: {\n label: this._makeTooltip.bind(this)\n }\n };\n\n return config;\n };\n\n /**\n * Get the datasets configurations.\n *\n * @protected\n * @return {Object[]}\n */\n Output.prototype._makeDatasetsConfig = function() {\n var sets = this._chart.getSeries().map(function(series) {\n var colors = series.hasColoredValues() ? series.getColors() : series.getColor();\n var dataset = {\n label: this._cleanData(series.getLabel()),\n data: series.getValues(),\n type: series.getType(),\n fill: series.getFill(),\n backgroundColor: colors,\n // Pie charts look better without borders.\n borderColor: this._chart.getType() == Pie.prototype.TYPE ? '#fff' : colors,\n lineTension: this._isSmooth(series) ? 0.3 : 0\n };\n\n if (series.getXAxis() !== null) {\n dataset.xAxisID = makeAxisId('x', series.getXAxis());\n }\n if (series.getYAxis() !== null) {\n dataset.yAxisID = makeAxisId('y', series.getYAxis());\n }\n\n return dataset;\n }.bind(this));\n return sets;\n };\n\n /**\n * Get the chart data, add labels and rebuild the tooltip.\n *\n * @param {Object[]} tooltipItem The tooltip item data.\n * @param {Object[]} data The chart data.\n * @returns {String}\n * @protected\n */\n Output.prototype._makeTooltip = function(tooltipItem, data) {\n\n // Get series and chart data to rebuild the tooltip and add labels.\n var series = this._chart.getSeries()[tooltipItem.datasetIndex];\n var serieLabel = series.getLabel();\n var serieLabels = series.getLabels();\n var chartData = data.datasets[tooltipItem.datasetIndex].data;\n var tooltipData = chartData[tooltipItem.index];\n\n // Build default tooltip.\n var tooltip = [];\n\n // Pie and doughnut charts does not have axis.\n if (tooltipItem.xLabel == '' && tooltipItem.yLabel == '') {\n var chartLabels = this._cleanData(this._chart.getLabels());\n tooltip.push(chartLabels[tooltipItem.index]);\n }\n\n // Add series labels to the tooltip if any.\n if (serieLabels !== null) {\n tooltip.push(this._cleanData(serieLabels[tooltipItem.index]));\n } else {\n tooltip.push(this._cleanData(serieLabel) + ': ' + tooltipData);\n }\n\n return tooltip;\n };\n\n /**\n * Verify if the chart line is smooth or not.\n *\n * @protected\n * @param {module:core/chart_series} series The series.\n * @returns {Bool}\n */\n Output.prototype._isSmooth = function(series) {\n var smooth = false;\n if (this._chart.getType() === Line.prototype.TYPE) {\n smooth = series.getSmooth();\n if (smooth === null) {\n smooth = this._chart.getSmooth();\n }\n } else if (series.getType() === Series.prototype.TYPE_LINE) {\n smooth = series.getSmooth();\n }\n\n return smooth;\n };\n\n /**\n * Verify if the bar chart is stacked or not.\n *\n * @protected\n * @returns {Bool}\n */\n Output.prototype._isStacked = function() {\n var stacked = false;\n\n // Stacking is (currently) only supported for bar charts.\n if (this._chart.getType() === Bar.prototype.TYPE) {\n stacked = this._chart.getStacked();\n }\n\n return stacked;\n };\n\n /** @override */\n Output.prototype.update = function() {\n $.extend(true, this._config, this._makeConfig());\n this._chartjs.update();\n };\n\n return Output;\n\n});\n"],"file":"chart_output_chartjs.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/chart_output_chartjs.js"],"names":["define","$","Chartjs","Axis","Bar","Base","Line","Pie","Series","makeAxisId","xy","index","Output","prototype","constructor","apply","arguments","_canvas","_node","prop","append","_build","Object","create","_config","_chartjs","_makeConfig","_cleanData","data","Array","map","value","html","text","_getChartType","type","_chart","getType","TYPE","getHorizontal","getDoughnut","_makeAxisConfig","axis","scaleData","id","getPosition","POS_DEFAULT","position","getLabel","scaleLabel","display","labelString","getStepSize","ticks","stepSize","getMax","max","getMin","min","config","labels","getLabels","datasets","_makeDatasetsConfig","options","title","getTitle","legendOptions","getLegendOptions","legend","getXAxes","forEach","i","axisLabels","scales","xAxes","callback","stacked","_isStacked","bind","getYAxes","yAxes","parseInt","tooltips","callbacks","label","_makeTooltip","sets","getSeries","series","colors","hasColoredValues","getColors","getColor","dataset","getValues","fill","getFill","backgroundColor","borderColor","lineTension","_isSmooth","getXAxis","xAxisID","getYAxis","yAxisID","tooltipItem","datasetIndex","serieLabel","serieLabels","chartData","tooltipData","tooltip","xLabel","yLabel","chartLabels","push","smooth","getSmooth","TYPE_LINE","getStacked","update","extend"],"mappings":"AAsBAA,OAAM,6BAAC,CACH,QADG,CAEH,cAFG,CAGH,iBAHG,CAIH,gBAJG,CAKH,wBALG,CAMH,iBANG,CAOH,gBAPG,CAQH,mBARG,CAAD,CASH,SAASC,CAAT,CAAYC,CAAZ,CAAqBC,CAArB,CAA2BC,CAA3B,CAAgCC,CAAhC,CAAsCC,CAAtC,CAA4CC,CAA5C,CAAiDC,CAAjD,CAAyD,CASxD,GAAIC,CAAAA,CAAU,CAAG,SAASC,CAAT,CAAaC,CAAb,CAAoB,CACjC,MAAO,QAAUD,CAAV,CAAe,GAAf,CAAqBC,CAC/B,CAFD,CAUA,QAASC,CAAAA,CAAT,EAAkB,CACdP,CAAI,CAACQ,SAAL,CAAeC,WAAf,CAA2BC,KAA3B,CAAiC,IAAjC,CAA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ent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart output for chart.js.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_output_chartjs\n */\ndefine([\n 'jquery',\n 'core/chartjs',\n 'core/chart_axis',\n 'core/chart_bar',\n 'core/chart_output_base',\n 'core/chart_line',\n 'core/chart_pie',\n 'core/chart_series'\n], function($, Chartjs, Axis, Bar, Base, Line, Pie, Series) {\n\n /**\n * Makes an axis ID.\n *\n * @param {String} xy Accepts 'x' and 'y'.\n * @param {Number} index The axis index.\n * @return {String}\n */\n var makeAxisId = function(xy, index) {\n return 'axis-' + xy + '-' + index;\n };\n\n /**\n * Chart output for Chart.js.\n *\n * @class\n * @extends {module:core/chart_output_base}\n */\n function Output() {\n Base.prototype.constructor.apply(this, arguments);\n\n // Make sure that we've got a canvas tag.\n this._canvas = this._node;\n if (this._canvas.prop('tagName') != 'CANVAS') {\n this._canvas = $('');\n this._node.append(this._canvas);\n }\n\n this._build();\n }\n Output.prototype = Object.create(Base.prototype);\n\n /**\n * Reference to the chart config object.\n *\n * @type {Object}\n * @protected\n */\n Output.prototype._config = null;\n\n /**\n * Reference to the instance of chart.js.\n *\n * @type {Object}\n * @protected\n */\n Output.prototype._chartjs = null;\n\n /**\n * Reference to the canvas node.\n *\n * @type {Jquery}\n * @protected\n */\n Output.prototype._canvas = null;\n\n /**\n * Builds the config and the chart.\n *\n * @protected\n */\n Output.prototype._build = function() {\n this._config = this._makeConfig();\n this._chartjs = new Chartjs(this._canvas[0], this._config);\n };\n\n /**\n * Clean data.\n *\n * @param {(String|String[])} data A single string or an array of strings.\n * @returns {(String|String[])}\n * @protected\n */\n Output.prototype._cleanData = function(data) {\n if (data instanceof Array) {\n return data.map(function(value) {\n return $('').html(value).text();\n });\n } else {\n return $('').html(data).text();\n }\n };\n\n /**\n * Get the chart type and handles the Chart.js specific chart types.\n *\n * By default returns the current chart TYPE value. Also does the handling of specific chart types, for example\n * check if the bar chart should be horizontal and the pie chart should be displayed as a doughnut.\n *\n * @method getChartType\n * @returns {String} the chart type.\n * @protected\n */\n Output.prototype._getChartType = function() {\n var type = this._chart.getType();\n\n // Bars can be displayed vertically and horizontally, defining horizontalBar type.\n if (this._chart.getType() === Bar.prototype.TYPE && this._chart.getHorizontal() === true) {\n type = 'horizontalBar';\n } else if (this._chart.getType() === Pie.prototype.TYPE && this._chart.getDoughnut() === true) {\n // Pie chart can be displayed as doughnut.\n type = 'doughnut';\n }\n\n return type;\n };\n\n /**\n * Make the axis config.\n *\n * @protected\n * @param {module:core/chart_axis} axis The axis.\n * @param {String} xy Accepts 'x' or 'y'.\n * @param {Number} index The axis index.\n * @return {Object} The axis config.\n */\n Output.prototype._makeAxisConfig = function(axis, xy, index) {\n var scaleData = {\n id: makeAxisId(xy, index)\n };\n\n if (axis.getPosition() !== Axis.prototype.POS_DEFAULT) {\n scaleData.position = axis.getPosition();\n }\n\n if (axis.getLabel() !== null) {\n scaleData.scaleLabel = {\n display: true,\n labelString: this._cleanData(axis.getLabel())\n };\n }\n\n if (axis.getStepSize() !== null) {\n scaleData.ticks = scaleData.ticks || {};\n scaleData.ticks.stepSize = axis.getStepSize();\n }\n\n if (axis.getMax() !== null) {\n scaleData.ticks = scaleData.ticks || {};\n scaleData.ticks.max = axis.getMax();\n }\n\n if (axis.getMin() !== null) {\n scaleData.ticks = scaleData.ticks || {};\n scaleData.ticks.min = axis.getMin();\n }\n\n return scaleData;\n };\n\n /**\n * Make the config config.\n *\n * @protected\n * @param {module:core/chart_axis} axis The axis.\n * @return {Object} The axis config.\n */\n Output.prototype._makeConfig = function() {\n var config = {\n type: this._getChartType(),\n data: {\n labels: this._cleanData(this._chart.getLabels()),\n datasets: this._makeDatasetsConfig()\n },\n options: {\n title: {\n display: this._chart.getTitle() !== null,\n text: this._cleanData(this._chart.getTitle())\n }\n }\n };\n var legendOptions = this._chart.getLegendOptions();\n if (legendOptions) {\n config.options.legend = legendOptions;\n }\n\n\n this._chart.getXAxes().forEach(function(axis, i) {\n var axisLabels = axis.getLabels();\n\n config.options.scales = config.options.scales || {};\n config.options.scales.xAxes = config.options.scales.xAxes || [];\n config.options.scales.xAxes[i] = this._makeAxisConfig(axis, 'x', i);\n\n if (axisLabels !== null) {\n config.options.scales.xAxes[i].ticks.callback = function(value, index) {\n return axisLabels[index] || '';\n };\n }\n config.options.scales.xAxes[i].stacked = this._isStacked();\n }.bind(this));\n\n this._chart.getYAxes().forEach(function(axis, i) {\n var axisLabels = axis.getLabels();\n\n config.options.scales = config.options.scales || {};\n config.options.scales.yAxes = config.options.scales.yAxes || [];\n config.options.scales.yAxes[i] = this._makeAxisConfig(axis, 'y', i);\n\n if (axisLabels !== null) {\n config.options.scales.yAxes[i].ticks.callback = function(value) {\n return axisLabels[parseInt(value, 10)] || '';\n };\n }\n config.options.scales.yAxes[i].stacked = this._isStacked();\n }.bind(this));\n\n config.options.tooltips = {\n callbacks: {\n label: this._makeTooltip.bind(this)\n }\n };\n\n return config;\n };\n\n /**\n * Get the datasets configurations.\n *\n * @protected\n * @return {Object[]}\n */\n Output.prototype._makeDatasetsConfig = function() {\n var sets = this._chart.getSeries().map(function(series) {\n var colors = series.hasColoredValues() ? series.getColors() : series.getColor();\n var dataset = {\n label: this._cleanData(series.getLabel()),\n data: series.getValues(),\n type: series.getType(),\n fill: series.getFill(),\n backgroundColor: colors,\n // Pie charts look better without borders.\n borderColor: this._chart.getType() == Pie.prototype.TYPE ? '#fff' : colors,\n lineTension: this._isSmooth(series) ? 0.3 : 0\n };\n\n if (series.getXAxis() !== null) {\n dataset.xAxisID = makeAxisId('x', series.getXAxis());\n }\n if (series.getYAxis() !== null) {\n dataset.yAxisID = makeAxisId('y', series.getYAxis());\n }\n\n return dataset;\n }.bind(this));\n return sets;\n };\n\n /**\n * Get the chart data, add labels and rebuild the tooltip.\n *\n * @param {Object[]} tooltipItem The tooltip item data.\n * @param {Object[]} data The chart data.\n * @returns {String}\n * @protected\n */\n Output.prototype._makeTooltip = function(tooltipItem, data) {\n\n // Get series and chart data to rebuild the tooltip and add labels.\n var series = this._chart.getSeries()[tooltipItem.datasetIndex];\n var serieLabel = series.getLabel();\n var serieLabels = series.getLabels();\n var chartData = data.datasets[tooltipItem.datasetIndex].data;\n var tooltipData = chartData[tooltipItem.index];\n\n // Build default tooltip.\n var tooltip = [];\n\n // Pie and doughnut charts does not have axis.\n if (tooltipItem.xLabel == '' && tooltipItem.yLabel == '') {\n var chartLabels = this._cleanData(this._chart.getLabels());\n tooltip.push(chartLabels[tooltipItem.index]);\n }\n\n // Add series labels to the tooltip if any.\n if (serieLabels !== null) {\n tooltip.push(this._cleanData(serieLabels[tooltipItem.index]));\n } else {\n tooltip.push(this._cleanData(serieLabel) + ': ' + tooltipData);\n }\n\n return tooltip;\n };\n\n /**\n * Verify if the chart line is smooth or not.\n *\n * @protected\n * @param {module:core/chart_series} series The series.\n * @returns {Bool}\n */\n Output.prototype._isSmooth = function(series) {\n var smooth = false;\n if (this._chart.getType() === Line.prototype.TYPE) {\n smooth = series.getSmooth();\n if (smooth === null) {\n smooth = this._chart.getSmooth();\n }\n } else if (series.getType() === Series.prototype.TYPE_LINE) {\n smooth = series.getSmooth();\n }\n\n return smooth;\n };\n\n /**\n * Verify if the bar chart is stacked or not.\n *\n * @protected\n * @returns {Bool}\n */\n Output.prototype._isStacked = function() {\n var stacked = false;\n\n // Stacking is (currently) only supported for bar charts.\n if (this._chart.getType() === Bar.prototype.TYPE) {\n stacked = this._chart.getStacked();\n }\n\n return stacked;\n };\n\n /** @override */\n Output.prototype.update = function() {\n $.extend(true, this._config, this._makeConfig());\n this._chartjs.update();\n };\n\n return Output;\n\n});\n"],"file":"chart_output_chartjs.min.js"} \ No newline at end of file diff --git a/lib/amd/build/chart_output_htmltable.min.js.map b/lib/amd/build/chart_output_htmltable.min.js.map index 4fdca4c0a93e6..e1bc371a043b3 100644 --- a/lib/amd/build/chart_output_htmltable.min.js.map +++ b/lib/amd/build/chart_output_htmltable.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/chart_output_htmltable.js"],"names":["define","$","Base","Output","prototype","constructor","apply","arguments","_build","Object","create","_node","empty","append","_makeTable","tbl","c","_chart","node","value","labels","getLabels","hasLabel","length","series","getSeries","seriesLabels","rowCount","getCount","addClass","getTitle","text","forEach","serie","getLabel","attr","rowId","serieId","getValues","update"],"mappings":"AAsBAA,OAAM,+BAAC,CACH,QADG,CAEH,wBAFG,CAAD,CAGH,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CASjB,QAASC,CAAAA,CAAT,EAAkB,CACdD,CAAI,CAACE,SAAL,CAAeC,WAAf,CAA2BC,KAA3B,CAAiC,IAAjC,CAAuCC,SAAvC,EACA,KAAKC,MAAL,EACH,CACDL,CAAM,CAACC,SAAP,CAAmBK,MAAM,CAACC,MAAP,CAAcR,CAAI,CAACE,SAAnB,CAAnB,CAOAD,CAAM,CAACC,SAAP,CAAiBI,MAAjB,CAA0B,UAAW,CACjC,KAAKG,KAAL,CAAWC,KAAX,GACA,KAAKD,KAAL,CAAWE,MAAX,CAAkB,KAAKC,UAAL,EAAlB,CACH,CAHD,CAWAX,CAAM,CAACC,SAAP,CAAiBU,UAAjB,CAA8B,UAAW,CACrC,GAAIC,CAAAA,CAAG,CAAGd,CAAC,CAAC,SAAD,CAAX,CACIe,CAAC,CAAG,KAAKC,MADb,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAAM,CAAGJ,CAAC,CAACK,SAAF,EAJb,CAKIC,CAAQ,CAAmB,C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CAAGK,CAAM,CAACa,CAAD,CAAN,CAAgBC,SAAhB,GAA4BF,CAA5B,CAAR,CACAV,CAAY,CAAGF,CAAM,CAACa,CAAD,CAAN,CAAgBhB,SAAhB,EAAf,CACA,GAAqB,IAAjB,GAAAK,CAAJ,CAA2B,CACvBP,CAAK,CAAGK,CAAM,CAACa,CAAD,CAAN,CAAgBhB,SAAhB,GAA4Be,CAA5B,CACX,CACDlB,CAAI,CAACL,MAAL,CAAYZ,CAAC,CAAC,MAAD,CAAD,CAAU8B,IAAV,CAAeZ,CAAf,CAAZ,CACH,CACDJ,CAAG,CAACF,MAAJ,CAAWK,CAAX,CACH,CAED,MAAOH,CAAAA,CACV,CAvDD,CA0DAZ,CAAM,CAACC,SAAP,CAAiBmC,MAAjB,CAA0B,UAAW,CACjC,KAAK/B,MAAL,EACH,CAFD,CAIA,MAAOL,CAAAA,CAEV,CAlGK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart output for HTML table.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_output_htmltable\n */\ndefine([\n 'jquery',\n 'core/chart_output_base',\n], function($, Base) {\n\n /**\n * Render a chart as an HTML table.\n *\n * @class\n * @extends {module:core/chart_output_base}\n * @alias module:core/chart_output_htmltable\n */\n function Output() {\n Base.prototype.constructor.apply(this, arguments);\n this._build();\n }\n Output.prototype = Object.create(Base.prototype);\n\n /**\n * Attach the table to the document.\n *\n * @protected\n */\n Output.prototype._build = function() {\n this._node.empty();\n this._node.append(this._makeTable());\n };\n\n /**\n * Builds the table node.\n *\n * @protected\n * @return {Jquery}\n */\n Output.prototype._makeTable = function() {\n var tbl = $(''),\n c = this._chart,\n node,\n value,\n labels = c.getLabels(),\n hasLabel = labels.length > 0,\n series = c.getSeries(),\n seriesLabels,\n rowCount = series[0].getCount();\n\n // Identify the table.\n tbl.addClass('chart-output-htmltable generaltable');\n\n // Set the caption.\n if (c.getTitle() !== null) {\n tbl.append($('');\n if (hasLabel) {\n node.append($('');\n if (labels.length > 0) {\n node.append(\n $('
').text(c.getTitle()));\n }\n\n // Write the column headers.\n node = $('
'));\n }\n series.forEach(function(serie) {\n node.append(\n $('')\n .text(serie.getLabel())\n .attr('scope', 'col')\n );\n });\n tbl.append(node);\n\n // Write rows.\n for (var rowId = 0; rowId < rowCount; rowId++) {\n node = $('
')\n .text(labels[rowId])\n .attr('scope', 'row')\n );\n }\n for (var serieId = 0; serieId < series.length; serieId++) {\n value = series[serieId].getValues()[rowId];\n seriesLabels = series[serieId].getLabels();\n if (seriesLabels !== null) {\n value = series[serieId].getLabels()[rowId];\n }\n node.append($('').text(value));\n }\n tbl.append(node);\n }\n\n return tbl;\n };\n\n /** @override */\n Output.prototype.update = function() {\n this._build();\n };\n\n return Output;\n\n});\n"],"file":"chart_output_htmltable.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/chart_output_htmltable.js"],"names":["define","$","Base","Output","prototype","constructor","apply","arguments","_build","Object","create","_node","empty","append","_makeTable","tbl","c","_chart","node","value","labels","getLabels","hasLabel","length","series","getSeries","seriesLabels","rowCount","getCount","addClass","getTitle","text","forEach","serie","getLabel","attr","rowId","serieId","getValues","update"],"mappings":"AAsBAA,OAAM,+BAAC,CACH,QADG,CAEH,wBAFG,CAAD,CAGH,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAQjB,QAASC,CAAAA,CAAT,EAAkB,CACdD,CAAI,CAACE,SAAL,CAAeC,WAAf,CAA2BC,KAA3B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CAKH,CAND,EAOApB,CAAG,CAACF,MAAJ,CAAWK,CAAX,EAGA,IAAK,GAAIkB,CAAAA,CAAK,CAAG,CAAjB,CAAoBA,CAAK,CAAGT,CAA5B,CAAsCS,CAAK,EAA3C,CAA+C,CAC3ClB,CAAI,CAAGjB,CAAC,CAAC,MAAD,CAAR,CACA,GAAoB,CAAhB,CAAAmB,CAAM,CAACG,MAAX,CAAuB,CACnBL,CAAI,CAACL,MAAL,CACIZ,CAAC,CAAC,MAAD,CAAD,CACC8B,IADD,CACMX,CAAM,CAACgB,CAAD,CADZ,EAECD,IAFD,CAEM,OAFN,CAEe,KAFf,CADJ,CAKH,CACD,IAAK,GAAIE,CAAAA,CAAO,CAAG,CAAnB,CAAsBA,CAAO,CAAGb,CAAM,CAACD,MAAvC,CAA+Cc,CAAO,EAAtD,CAA0D,CACtDlB,CAAK,CAAGK,CAAM,CAACa,CAAD,CAAN,CAAgBC,SAAhB,GAA4BF,CAA5B,CAAR,CACAV,CAAY,CAAGF,CAAM,CAACa,CAAD,CAAN,CAAgBhB,SAAhB,EAAf,CACA,GAAqB,IAAjB,GAAAK,CAAJ,CAA2B,CACvBP,CAAK,CAAGK,CAAM,CAACa,CAAD,CAAN,CAAgBhB,SAAhB,GAA4Be,CAA5B,CACX,CACDlB,CAAI,CAACL,MAAL,CAAYZ,CAAC,CAAC,MAAD,CAAD,CAAU8B,IAAV,CAAeZ,CAAf,CAAZ,CACH,CACDJ,CAAG,CAACF,MAAJ,CAAWK,CAAX,CACH,CAED,MAAOH,CAAAA,CACV,CAvDD,CA0DAZ,CAAM,CAACC,SAAP,CAAiBmC,MAAjB,CAA0B,UAAW,CACjC,KAAK/B,MAAL,EACH,CAFD,CAIA,MAAOL,CAAAA,CAEV,CAjGK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart output for HTML table.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_output_htmltable\n */\ndefine([\n 'jquery',\n 'core/chart_output_base',\n], function($, Base) {\n\n /**\n * Render a chart as an HTML table.\n *\n * @class\n * @extends {module:core/chart_output_base}\n */\n function Output() {\n Base.prototype.constructor.apply(this, arguments);\n this._build();\n }\n Output.prototype = Object.create(Base.prototype);\n\n /**\n * Attach the table to the document.\n *\n * @protected\n */\n Output.prototype._build = function() {\n this._node.empty();\n this._node.append(this._makeTable());\n };\n\n /**\n * Builds the table node.\n *\n * @protected\n * @return {Jquery}\n */\n Output.prototype._makeTable = function() {\n var tbl = $(''),\n c = this._chart,\n node,\n value,\n labels = c.getLabels(),\n hasLabel = labels.length > 0,\n series = c.getSeries(),\n seriesLabels,\n rowCount = series[0].getCount();\n\n // Identify the table.\n tbl.addClass('chart-output-htmltable generaltable');\n\n // Set the caption.\n if (c.getTitle() !== null) {\n tbl.append($('');\n if (hasLabel) {\n node.append($('');\n if (labels.length > 0) {\n node.append(\n $('\n * // mod/example/amd/src/events.js\n *\n * import {dispatchEvent} from 'core/event_dispatcher';\n *\n * export const eventTypes = {\n * exampleDataDisplayed: 'mod_example/exampleDataDisplayed',\n * };\n *\n * export const notifyExampleDisplayed = someArgument => dispatchEvent(eventTypes.exampleDataDisplayed, {\n * someArgument,\n * }, document, {\n * cancelable: false,\n * });\n */\nexport const dispatchEvent = (\n eventName,\n detail = {},\n container = document,\n {\n bubbles = true,\n cancelable = false,\n composed = false,\n } = {}\n) => {\n const customEvent = new CustomEvent(\n eventName,\n {\n bubbles,\n cancelable,\n composed,\n detail,\n }\n );\n\n container.dispatchEvent(customEvent);\n\n return customEvent;\n};\n"],"file":"event_dispatcher.min.js"} \ No newline at end of file diff --git a/lib/amd/build/form-autocomplete.min.js.map b/lib/amd/build/form-autocomplete.min.js.map index 634fd1fbb64aa..60630f6b80b5d 100644 --- a/lib/amd/build/form-autocomplete.min.js.map +++ b/lib/amd/build/form-autocomplete.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/form-autocomplete.js"],"names":["define","$","log","str","templates","notification","LoadingIcon","Aria","KEYS","DOWN","ENTER","SPACE","ESCAPE","COMMA","UP","LEFT","RIGHT","uniqueId","Date","now","activateSelection","index","state","selectionElement","document","getElementById","selectionId","length","children","element","get","itemId","attr","Deferred","resolve","getActiveElementFromState","selectionRegion","activeId","activeElement","activeValue","find","updateActiveSelectionFromState","activeIndex","updateSelectionList","options","originalSelect","pendingKey","inputId","M","util","js_pending","items","newSelection","each","ele","prop","label","data","html","push","value","hasItemListChanged","js_complete","Promise","context","extend","render","then","js","replaceNodeContents","catch","exception","filter","item","indexOf","notifyChange","core_formchangechecker","set_form_changed","dispatchEvent","Event","deselectItem","selectedItemValue","remove","activateItem","inputElement","suggestionsElement","suggestionsId","globalIndex","scrollPos","offset","top","scrollTop","height","animate","promise","activateNextItem","current","activatePreviousSelection","selectionsElement","activateNextSelection","activatePreviousItem","closeSuggestions","hide","updateSuggestions","query","matchingElements","suggestions","option","innerHTML","searchquery","caseSensitive","toLocaleLowerCase","returnVal","replaceNode","unhide","show","node","text","tags","get_string","done","nosuggestionsstr","createItem","val","split","found","tagindex","tag","trim","multiple","append","createTextNode","selectCurrentItem","closeSuggestionsOnSelect","focus","updateAjax","e","ajaxHandler","pendingPromise","addPendingJSPromise","parentElement","selectId","parent","addIconToContainerRemoveOnCompletion","currentTarget","transport","selector","results","processedResults","processResults","existingValues","optionIndex","isArray","resultIndex","result","error","reject","addNavigation","on","pendingJsPromise","keyCode","showSuggestions","ajax","require","preventDefault","closest","window","setTimeout","focusElement","timeoutPromise","is","arrowElement","downArrowId","off","selectedItem","throttleTimeout","inProgress","handler","arguments","throttledHandler","clearTimeout","bind","last","key","enhance","placeholder","noSelectionString","templateOverrides","input","layout","selection","fail","debug","css","prepend","originalLabel","collectedjs","renderLayout","renderInput","renderDatalist","renderSelection","when","container","replaceWith","runTemplateJS"],"mappings":"AAyBAA,OAAM,0BACF,CAAC,QAAD,CAAW,UAAX,CAAuB,UAAvB,CAAmC,gBAAnC,CAAqD,mBAArD,CAA0E,kBAA1E,CAA8F,WAA9F,CADE,CAEN,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAAsBC,CAAtB,CAAiCC,CAAjC,CAA+CC,CAA/C,CAA4DC,CAA5D,CAAkE,IAI1DC,CAAAA,CAAI,CAAG,CACPC,IAAI,CAAE,EADC,CAEPC,KAAK,CAAE,EAFA,CAGPC,KAAK,CAAE,EAHA,CAIPC,MAAM,CAAE,EAJD,CAKPC,KAAK,CAAE,EALA,CAMPC,EAAE,CAAE,EANG,CAOPC,IAAI,CAAE,EAPC,CAQPC,KAAK,CAAE,EARA,CAJmD,CAe1DC,CAAQ,CAAGC,IAAI,CAACC,GAAL,EAf+C,CA0B1DC,CAAiB,CAAG,SAASC,CAAT,CAAgBC,CAAhB,CAAuB,IAEvCC,CAAAA,CAAgB,CAAGtB,CAAC,CAACuB,QAAQ,CAACC,cAAT,CAAwBH,CAAK,CAACI,WAA9B,CAAD,CAFmB,CAKvCC,CAAM,CAAGJ,CAAgB,CAACK,QAAjB,CAA0B,sBAA1B,EAAkDD,MALpB,CAO3CN,CAAK,CAAGA,CAAK,CAAGM,CAAhB,CACA,MAAe,CAAR,CAAAN,CAAP,CAAkB,CACdA,CAAK,EAAIM,CACZ,CAV0C,GAYvCE,CAAAA,CAAO,CAAG5B,CAAC,CAACsB,CAAgB,CAACK,QAAjB,CAA0B,sBAA1B,EAAkDE,GAAlD,CAAsDT,CAAtD,CAAD,CAZ4B,CAcvCU,CAAM,CAAGT,CAAK,CAACI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CAAf,EAA0DmK,WAA1D,CAAsEf,CAAtE,EACAc,CAAS,CAAClK,IAAV,CAAe,iDAAf,EAAgEmK,WAAhE,CAA4EjG,CAA5E,EACAgG,CAAS,CAAClK,IAAV,CAAe,+CAAf,EAA8DmK,WAA9D,CAA0Eb,CAA1E,EAEA1L,CAAS,CAACwM,aAAV,CAAwBR,CAAxB,EAGAD,CAAa,CAACnK,IAAd,CAAmB,KAAnB,CAA0BV,CAAK,CAACyB,OAAhC,EAEA8G,CAAa,CAACjH,CAAD,CAAUtB,CAAV,CAAiBuB,CAAjB,CAAb,CAEA,GAAIwC,CAAAA,CAAkB,CAAGpF,CAAC,CAACuB,QAAQ,CAACC,cAAT,CAAwBH,CAAK,CAACgE,aAA9B,CAAD,CAA1B,CAEAD,CAAkB,CAACiB,IAAnB,GACA/F,CAAI,CAAC+F,IAAL,CAAUjB,CAAkB,CAACvD,GAAnB,EAAV,CAGH,CA1BM,EA2BNqC,IA3BM,CA2BD,UAAW,CAEb,MAAOxB,CAAAA,CAAmB,CAACC,CAAD,CAAUtB,CAAV,CAAiBuB,CAAjB,CAC7B,CA9BM,EA+BNsB,IA/BM,CA+BD,UAAW,CACb,MAAOnB,CAAAA,CAAC,CAACC,IAAF,CAAOa,WAAP,CAAmBhB,CAAnB,CACV,CAjCM,EAkCNwB,KAlCM,CAkCA,SAASqF,CAAT,CAAgB,CACnB3G,CAAC,CAACC,IAAF,CAAOa,WAAP,CAAmBhB,CAAnB,EACAzC,CAAY,CAACkE,SAAb,CAAuBoF,CAAvB,CACH,CArCM,CAsCV,CA5K8C,CA8KtD,CAhqCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Autocomplete wrapper for select2 library.\n *\n * @module core/form-autocomplete\n * @class autocomplete\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.0\n */\n/* globals require: false */\ndefine(\n ['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification', 'core/loadingicon', 'core/aria'],\nfunction($, log, str, templates, notification, LoadingIcon, Aria) {\n\n // Private functions and variables.\n /** @var {Object} KEYS - List of keycode constants. */\n var KEYS = {\n DOWN: 40,\n ENTER: 13,\n SPACE: 32,\n ESCAPE: 27,\n COMMA: 44,\n UP: 38,\n LEFT: 37,\n RIGHT: 39\n };\n\n var uniqueId = Date.now();\n\n /**\n * Make an item in the selection list \"active\".\n *\n * @method activateSelection\n * @private\n * @param {Number} index The index in the current (visible) list of selection.\n * @param {Object} state State variables for this autocomplete element.\n * @return {Promise}\n */\n var activateSelection = function(index, state) {\n // Find the elements in the DOM.\n var selectionElement = $(document.getElementById(state.selectionId));\n\n // Count the visible items.\n var length = selectionElement.children('[aria-selected=true]').length;\n // Limit the index to the upper/lower bounds of the list (wrap in both directions).\n index = index % length;\n while (index < 0) {\n index += length;\n }\n // Find the specified element.\n var element = $(selectionElement.children('[aria-selected=true]').get(index));\n // Create an id we can assign to this element.\n var itemId = state.selectionId + '-' + index;\n\n // Deselect all the selections.\n selectionElement.children().attr('data-active-selection', null).attr('id', '');\n\n // Select only this suggestion and assign it the id.\n element.attr('data-active-selection', true).attr('id', itemId);\n\n // Tell the input field it has a new active descendant so the item is announced.\n selectionElement.attr('aria-activedescendant', itemId);\n selectionElement.attr('data-active-value', element.attr('data-value'));\n\n return $.Deferred().resolve();\n };\n\n /**\n * Get the actively selected element from the state object.\n *\n * @param {Object} state\n * @returns {jQuery}\n */\n var getActiveElementFromState = function(state) {\n var selectionRegion = $(document.getElementById(state.selectionId));\n var activeId = selectionRegion.attr('aria-activedescendant');\n\n if (activeId) {\n var activeElement = $(document.getElementById(activeId));\n if (activeElement.length) {\n // The active descendent still exists.\n return activeElement;\n }\n }\n\n var activeValue = selectionRegion.attr('data-active-value');\n return selectionRegion.find('[data-value=\"' + activeValue + '\"]');\n };\n\n /**\n * Update the active selection from the given state object.\n *\n * @param {Object} state\n */\n var updateActiveSelectionFromState = function(state) {\n var activeElement = getActiveElementFromState(state);\n var activeValue = activeElement.attr('data-value');\n\n var selectionRegion = $(document.getElementById(state.selectionId));\n if (activeValue) {\n // Find the index of the currently selected index.\n var activeIndex = selectionRegion.find('[aria-selected=true]').index(activeElement);\n\n if (activeIndex !== -1) {\n activateSelection(activeIndex, state);\n return;\n }\n }\n\n // Either the active index was not set, or it could not be found.\n // Select the first value instead.\n activateSelection(0, state);\n };\n\n /**\n * Update the element that shows the currently selected items.\n *\n * @method updateSelectionList\n * @private\n * @param {Object} options Original options for this autocomplete element.\n * @param {Object} state State variables for this autocomplete element.\n * @param {JQuery} originalSelect The JQuery object matching the hidden select list.\n * @return {Promise}\n */\n var updateSelectionList = function(options, state, originalSelect) {\n var pendingKey = 'form-autocomplete-updateSelectionList-' + state.inputId;\n M.util.js_pending(pendingKey);\n\n // Build up a valid context to re-render the template.\n var items = [];\n var newSelection = $(document.getElementById(state.selectionId));\n originalSelect.children('option').each(function(index, ele) {\n if ($(ele).prop('selected')) {\n var label;\n if ($(ele).data('html')) {\n label = $(ele).data('html');\n } else {\n label = $(ele).html();\n }\n if (label !== '') {\n items.push({label: label, value: $(ele).attr('value')});\n }\n }\n });\n\n if (!hasItemListChanged(state, items)) {\n M.util.js_complete(pendingKey);\n return Promise.resolve();\n }\n\n state.items = items;\n\n var context = $.extend(options, state);\n // Render the template.\n return templates.render(options.templates.items, context)\n .then(function(html, js) {\n // Add it to the page.\n templates.replaceNodeContents(newSelection, html, js);\n\n updateActiveSelectionFromState(state);\n\n return;\n })\n .then(function() {\n return M.util.js_complete(pendingKey);\n })\n .catch(notification.exception);\n };\n\n /**\n * Check whether the list of items stored in the state has changed.\n *\n * @param {Object} state\n * @param {Array} items\n */\n var hasItemListChanged = function(state, items) {\n if (state.items.length !== items.length) {\n return true;\n }\n\n // Check for any items in the state items which are not present in the new items list.\n return state.items.filter(item => items.indexOf(item) === -1).length > 0;\n };\n\n /**\n * Notify of a change in the selection.\n *\n * @param {jQuery} originalSelect The jQuery object matching the hidden select list.\n */\n var notifyChange = function(originalSelect) {\n if (typeof M.core_formchangechecker !== 'undefined') {\n M.core_formchangechecker.set_form_changed();\n }\n\n // Note, jQuery .change() was not working here. Better to\n // use plain JavaScript anyway.\n originalSelect[0].dispatchEvent(new Event('change'));\n };\n\n /**\n * Remove the given item from the list of selected things.\n *\n * @method deselectItem\n * @private\n * @param {Object} options Original options for this autocomplete element.\n * @param {Object} state State variables for this autocomplete element.\n * @param {Element} item The item to be deselected.\n * @param {Element} originalSelect The original select list.\n * @return {Promise}\n */\n var deselectItem = function(options, state, item, originalSelect) {\n var selectedItemValue = $(item).attr('data-value');\n\n // Look for a match, and toggle the selected property if there is a match.\n originalSelect.children('option').each(function(index, ele) {\n if ($(ele).attr('value') == selectedItemValue) {\n $(ele).prop('selected', false);\n // We remove newly created custom tags from the suggestions list when they are deselected.\n if ($(ele).attr('data-iscustom')) {\n $(ele).remove();\n }\n }\n });\n // Rerender the selection list.\n return updateSelectionList(options, state, originalSelect)\n .then(function() {\n // Notify that the selection changed.\n notifyChange(originalSelect);\n\n return;\n });\n };\n\n /**\n * Make an item in the suggestions \"active\" (about to be selected).\n *\n * @method activateItem\n * @private\n * @param {Number} index The index in the current (visible) list of suggestions.\n * @param {Object} state State variables for this instance of autocomplete.\n * @return {Promise}\n */\n var activateItem = function(index, state) {\n // Find the elements in the DOM.\n var inputElement = $(document.getElementById(state.inputId));\n var suggestionsElement = $(document.getElementById(state.suggestionsId));\n\n // Count the visible items.\n var length = suggestionsElement.children(':not([aria-hidden])').length;\n // Limit the index to the upper/lower bounds of the list (wrap in both directions).\n index = index % length;\n while (index < 0) {\n index += length;\n }\n // Find the specified element.\n var element = $(suggestionsElement.children(':not([aria-hidden])').get(index));\n // Find the index of this item in the full list of suggestions (including hidden).\n var globalIndex = $(suggestionsElement.children('[role=option]')).index(element);\n // Create an id we can assign to this element.\n var itemId = state.suggestionsId + '-' + globalIndex;\n\n // Deselect all the suggestions.\n suggestionsElement.children().attr('aria-selected', false).attr('id', '');\n // Select only this suggestion and assign it the id.\n element.attr('aria-selected', true).attr('id', itemId);\n // Tell the input field it has a new active descendant so the item is announced.\n inputElement.attr('aria-activedescendant', itemId);\n\n // Scroll it into view.\n var scrollPos = element.offset().top\n - suggestionsElement.offset().top\n + suggestionsElement.scrollTop()\n - (suggestionsElement.height() / 2);\n return suggestionsElement.animate({\n scrollTop: scrollPos\n }, 100).promise();\n };\n\n /**\n * Find the index of the current active suggestion, and activate the next one.\n *\n * @method activateNextItem\n * @private\n * @param {Object} state State variable for this auto complete element.\n * @return {Promise}\n */\n var activateNextItem = function(state) {\n // Find the list of suggestions.\n var suggestionsElement = $(document.getElementById(state.suggestionsId));\n // Find the active one.\n var element = suggestionsElement.children('[aria-selected=true]');\n // Find it's index.\n var current = suggestionsElement.children(':not([aria-hidden])').index(element);\n // Activate the next one.\n return activateItem(current + 1, state);\n };\n\n /**\n * Find the index of the current active selection, and activate the previous one.\n *\n * @method activatePreviousSelection\n * @private\n * @param {Object} state State variables for this instance of autocomplete.\n * @return {Promise}\n */\n var activatePreviousSelection = function(state) {\n // Find the list of selections.\n var selectionsElement = $(document.getElementById(state.selectionId));\n // Find the active one.\n var element = selectionsElement.children('[data-active-selection]');\n if (!element) {\n return activateSelection(0, state);\n }\n // Find it's index.\n var current = selectionsElement.children('[aria-selected=true]').index(element);\n // Activate the next one.\n return activateSelection(current - 1, state);\n };\n\n /**\n * Find the index of the current active selection, and activate the next one.\n *\n * @method activateNextSelection\n * @private\n * @param {Object} state State variables for this instance of autocomplete.\n * @return {Promise}\n */\n var activateNextSelection = function(state) {\n // Find the list of selections.\n var selectionsElement = $(document.getElementById(state.selectionId));\n\n // Find the active one.\n var element = selectionsElement.children('[data-active-selection]');\n var current = 0;\n\n if (element) {\n // The element was found. Determine the index and move to the next one.\n current = selectionsElement.children('[aria-selected=true]').index(element);\n current = current + 1;\n } else {\n // No selected item found. Move to the first.\n current = 0;\n }\n\n return activateSelection(current, state);\n };\n\n /**\n * Find the index of the current active suggestion, and activate the previous one.\n *\n * @method activatePreviousItem\n * @private\n * @param {Object} state State variables for this autocomplete element.\n * @return {Promise}\n */\n var activatePreviousItem = function(state) {\n // Find the list of suggestions.\n var suggestionsElement = $(document.getElementById(state.suggestionsId));\n\n // Find the active one.\n var element = suggestionsElement.children('[aria-selected=true]');\n\n // Find it's index.\n var current = suggestionsElement.children(':not([aria-hidden])').index(element);\n\n // Activate the previous one.\n return activateItem(current - 1, state);\n };\n\n /**\n * Close the list of suggestions.\n *\n * @method closeSuggestions\n * @private\n * @param {Object} state State variables for this autocomplete element.\n * @return {Promise}\n */\n var closeSuggestions = function(state) {\n // Find the elements in the DOM.\n var inputElement = $(document.getElementById(state.inputId));\n var suggestionsElement = $(document.getElementById(state.suggestionsId));\n\n if (inputElement.attr('aria-expanded') === \"true\") {\n // Announce the list of suggestions was closed.\n inputElement.attr('aria-expanded', false);\n }\n // Read the current list of selections.\n inputElement.attr('aria-activedescendant', state.selectionId);\n\n // Hide the suggestions list (from screen readers too).\n Aria.hide(suggestionsElement.get());\n suggestionsElement.hide();\n\n return $.Deferred().resolve();\n };\n\n /**\n * Rebuild the list of suggestions based on the current values in the select list, and the query.\n *\n * @method updateSuggestions\n * @private\n * @param {Object} options The original options for this autocomplete.\n * @param {Object} state The state variables for this autocomplete.\n * @param {String} query The current text for the search string.\n * @param {JQuery} originalSelect The JQuery object matching the hidden select list.\n * @return {Promise}\n */\n var updateSuggestions = function(options, state, query, originalSelect) {\n var pendingKey = 'form-autocomplete-updateSuggestions-' + state.inputId;\n M.util.js_pending(pendingKey);\n\n // Find the elements in the DOM.\n var inputElement = $(document.getElementById(state.inputId));\n var suggestionsElement = $(document.getElementById(state.suggestionsId));\n\n // Used to track if we found any visible suggestions.\n var matchingElements = false;\n // Options is used by the context when rendering the suggestions from a template.\n var suggestions = [];\n originalSelect.children('option').each(function(index, option) {\n if ($(option).prop('selected') !== true) {\n suggestions[suggestions.length] = {label: option.innerHTML, value: $(option).attr('value')};\n }\n });\n\n // Re-render the list of suggestions.\n var searchquery = state.caseSensitive ? query : query.toLocaleLowerCase();\n var context = $.extend({options: suggestions}, options, state);\n var returnVal = templates.render(\n 'core/form_autocomplete_suggestions',\n context\n )\n .then(function(html, js) {\n // We have the new template, insert it in the page.\n templates.replaceNode(suggestionsElement, html, js);\n\n // Get the element again.\n suggestionsElement = $(document.getElementById(state.suggestionsId));\n\n // Show it if it is hidden.\n Aria.unhide(suggestionsElement.get());\n suggestionsElement.show();\n\n // For each option in the list, hide it if it doesn't match the query.\n suggestionsElement.children().each(function(index, node) {\n node = $(node);\n if ((options.caseSensitive && node.text().indexOf(searchquery) > -1) ||\n (!options.caseSensitive && node.text().toLocaleLowerCase().indexOf(searchquery) > -1)) {\n Aria.unhide(node.get());\n node.show();\n matchingElements = true;\n } else {\n node.hide();\n Aria.hide(node.get());\n }\n });\n // If we found any matches, show the list.\n inputElement.attr('aria-expanded', true);\n if (originalSelect.attr('data-notice')) {\n // Display a notice rather than actual suggestions.\n suggestionsElement.html(originalSelect.attr('data-notice'));\n } else if (matchingElements) {\n // We only activate the first item in the list if tags is false,\n // because otherwise \"Enter\" would select the first item, instead of\n // creating a new tag.\n if (!options.tags) {\n activateItem(0, state);\n }\n } else {\n // Nothing matches. Tell them that.\n str.get_string('nosuggestions', 'form').done(function(nosuggestionsstr) {\n suggestionsElement.html(nosuggestionsstr);\n });\n }\n\n return suggestionsElement;\n })\n .then(function() {\n return M.util.js_complete(pendingKey);\n })\n .catch(notification.exception);\n\n return returnVal;\n };\n\n /**\n * Create a new item for the list (a tag).\n *\n * @method createItem\n * @private\n * @param {Object} options The original options for the autocomplete.\n * @param {Object} state State variables for the autocomplete.\n * @param {JQuery} originalSelect The JQuery object matching the hidden select list.\n * @return {Promise}\n */\n var createItem = function(options, state, originalSelect) {\n // Find the element in the DOM.\n var inputElement = $(document.getElementById(state.inputId));\n // Get the current text in the input field.\n var query = inputElement.val();\n var tags = query.split(',');\n var found = false;\n\n $.each(tags, function(tagindex, tag) {\n // If we can only select one at a time, deselect any current value.\n tag = tag.trim();\n if (tag !== '') {\n if (!options.multiple) {\n originalSelect.children('option').prop('selected', false);\n }\n // Look for an existing option in the select list that matches this new tag.\n originalSelect.children('option').each(function(index, ele) {\n if ($(ele).attr('value') == tag) {\n found = true;\n $(ele).prop('selected', true);\n }\n });\n // Only create the item if it's new.\n if (!found) {\n var option = $('\n *\n * import prefetch from 'core/prefetch';\n *\n * // A single string prefetch.\n * prefetch.prefetchString('error', 'cannotfindteacher');\n *\n * // Prefetch multiple strings in the same component.\n * prefetch.prefetchStrings('core', [\n * 'yes',\n * 'no',\n * ]);\n *\n * // Use the strings.\n * import {get_string as getString, get_strings as getStrings} from 'core/str';\n * getString('cannotfindteacher', 'error')\n * .then(str => {\n * window.console.log(str); // Cannot find teacher\n * })\n * .catch();\n * getStrings([\n * {\n * key: 'cannotfindteacher',\n * component: 'error',\n * },\n * {\n * key: 'yes',\n * component: 'core',\n * },\n * {\n * key: 'no',\n * component: 'core',\n * },\n * ])\n * .then((cannotFindTeacher, yes, no) => {\n * window.console.log(cannotFindTeacher); // Cannot find teacher\n * window.console.log(yes); // Yes\n * window.console.log(no); // No\n * })\n * .catch();\n */\nimport Config from 'core/config';\n\n// Keep track of whether the initial prefetch has occurred.\nlet initialPrefetchComplete = false;\n\n// Prefetch templates.\nlet templateList = [];\n\n// Prefetch strings.\nlet stringList = {};\n\nlet prefetchTimer;\n\n/**\n * Fetch all queued items in the queue.\n *\n * Should only be called via processQueue.\n * @private\n */\nconst fetchQueue = () => {\n // Prefetch templates.\n if (templateList) {\n const templatesToLoad = templateList.slice();\n templateList = [];\n import('core/templates')\n .then(Templates => Templates.prefetchTemplates(templatesToLoad))\n .catch();\n }\n\n // Prefetch strings.\n const mappedStringsToFetch = stringList;\n stringList = {};\n\n const stringsToFetch = [];\n Object.keys(mappedStringsToFetch).forEach(component => {\n stringsToFetch.push(...mappedStringsToFetch[component].map(key => {\n return {component, key};\n }));\n });\n\n if (stringsToFetch) {\n import('core/str')\n .then(Str => Str.get_strings(stringsToFetch))\n .catch();\n }\n};\n\n/**\n * Process the prefetch queues as required.\n *\n * The initial call will queue the first fetch after a delay.\n * Subsequent fetches are immediate.\n *\n * @private\n */\nconst processQueue = () => {\n if (prefetchTimer) {\n // There is a live prefetch timer. The initial prefetch has been scheduled but is not complete.\n return;\n }\n\n // The initial prefetch has compelted. Just queue as normal.\n if (initialPrefetchComplete) {\n fetchQueue();\n\n return;\n }\n\n // Queue the initial prefetch in a short while.\n prefetchTimer = setTimeout(() => {\n initialPrefetchComplete = true;\n prefetchTimer = null;\n\n // Ensure that the icon system is loaded.\n // This can be quite slow and delay UI interactions if it is loaded on demand.\n import(Config.iconsystemmodule)\n .then(IconSystem => {\n const iconSystem = new IconSystem();\n prefetchTemplate(iconSystem.getTemplateName());\n\n return iconSystem;\n })\n .then(iconSystem => {\n fetchQueue();\n iconSystem.init();\n\n return;\n })\n .catch();\n }, 500);\n};\n\n/**\n * Add a set of templates to the prefetch queue.\n *\n * @param {Array} templatesNames A list of the template names to fetch\n * @static\n */\nconst prefetchTemplates = templatesNames => {\n templateList = templateList.concat(templatesNames);\n\n processQueue();\n};\n\n/**\n * Add a single template to the prefetch queue.\n *\n * @param {String} templateName The template names to fetch\n * @static\n */\nconst prefetchTemplate = templateName => {\n prefetchTemplates([templateName]);\n};\n\n/**\n * Add a set of strings from the same component to the prefetch queue.\n *\n * @param {String} component The component that all of the strings belongs to\n * @param {String[]} keys An array of string identifiers.\n * @static\n */\nconst prefetchStrings = (component, keys) => {\n if (!stringList[component]) {\n stringList[component] = [];\n }\n\n stringList[component] = stringList[component].concat(keys);\n\n processQueue();\n};\n\n/**\n * Add a single string to the prefetch queue.\n *\n * @param {String} component The component that the string belongs to\n * @param {String} key The string identifier\n * @static\n */\nconst prefetchString = (component, key) => {\n if (!stringList[component]) {\n stringList[component] = [];\n }\n\n stringList[component].push(key);\n\n processQueue();\n};\n\n// Prefetch some commonly-used templates.\nprefetchTemplates([].concat(\n ['core/loading'],\n ['core/modal'],\n ['core/modal_backdrop'],\n));\n\n// And some commonly used strings.\nprefetchStrings('core', [\n 'cancel',\n 'closebuttontitle',\n 'loading',\n 'savechanges',\n]);\nprefetchStrings('core_form', [\n 'showless',\n 'showmore',\n]);\n\nexport default {\n prefetchTemplate,\n prefetchTemplates,\n prefetchString,\n prefetchStrings,\n};\n"],"file":"prefetch.min.js"} \ No newline at end of file diff --git a/lib/amd/build/sortable_list.min.js.map b/lib/amd/build/sortable_list.min.js.map index 39d14f001cc31..1c0d3dde72ce4 100644 --- a/lib/amd/build/sortable_list.min.js.map +++ b/lib/amd/build/sortable_list.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/sortable_list.js"],"names":["define","$","log","autoScroll","str","ModalFactory","ModalEvents","Notification","defaultParameters","targetListSelector","moveHandlerSelector","isHorizontal","CSS","keyboardDragClass","isDraggedClass","currentPositionClass","sourceListClass","targetListClass","overElementClass","registerNotPassiveListeners","eventname","setup","x","ns","handle","includes","addEventListener","passive","eventListenerOptionsSupported","passivesupported","options","Object","defineProperty","get","document","removeEventListener","err","event","special","touchstart","touchmove","touchend","SortableList","root","config","info","proxy","proxyDelta","dragCounter","lastEvent","extend","listSelector","on","dragStartHandler","clickHandler","EVENTS","DRAGSTART","DRAG","DROP","DRAGEND","prototype","resetDraggedClasses","classes","i","removeClass","remove","calculatePositionOnPage","evt","originalEvent","touches","touch","pageX","pageY","clientX","Math","round","window","scrollLeft","clientY","scrollTop","type","moveElement","sourceList","sourceNextElement","finishDragging","which","movedElement","target","closest","currentTarget","children","length","stopPropagation","preventDefault","element","next","parent","targetNextElement","targetList","dropped","startX","startY","startTime","Date","getTime","addClass","offset","left","y","top","thisDragCounter","setTimeout","createProxy","dragHandler","dragcancelHandler","start","trigger","executeCallback","clone","append","removeAttr","css","position","keyCode","clickedElement","displayMoveDialogue","getPositionInNode","node","rect","getBoundingClientRect","scrollY","scrollX","width","height","xRatio","yRatio","isListHorizontal","elementFromPoint","mainElement","isNotSelf","current","filter","currentList","isNotProxy","find","coordinates","ratio","subList","subListEmpty","endX","endY","endTime","positionChanged","hasPositionChanged","oldinfo","parentElement","beforeElement","dragEl","insertBefore","appendChild","stop","off","eventName","getElementName","Deferred","resolve","text","getDestinationName","afterElement","get_string","then","name","getMoveDialogueTitle","handler","attr","getDestinationsList","addedLists","targets","destinations","result","when","createLink","is","contains","txt","li","appendTo","a","data","addList","inArray","push","list","each","prev","last","create","types","CANCEL","title","body","modal","quickMoveHandler","e","focus","hide","getRoot","hidden","destroy","setLarge","show","catch","exception"],"mappings":"mSA2DAA,OAAM,sBAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,iBAAvB,CAA0C,UAA1C,CAAsD,oBAAtD,CAA4E,mBAA5E,CAAiG,mBAAjG,CAAD,CACN,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA6BC,CAA7B,CAAkCC,CAAlC,CAAgDC,CAAhD,CAA6DC,CAA7D,CAA2E,IAQnEC,CAAAA,CAAiB,CAAG,CACpBC,kBAAkB,CAAE,IADA,CAEpBC,mBAAmB,CAAE,uBAFD,CAGpBC,YAAY,GAHQ,CAIpBR,UAAU,GAJU,CAR+C,CAqBnES,CAAG,CAAG,CACNC,iBAAiB,CAAE,wBADb,CAENC,cAAc,CAAE,0BAFV,CAGNC,oBAAoB,CAAE,gCAHhB,CAINC,eAAe,CAAE,sBAJX,CAKNC,eAAe,CAAE,sBALX,CAMNC,gBAAgB,CAAE,4BANZ,CArB6D,CAkEnEC,CAA2B,CAAG,SAASC,CA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,IACAyB,CAAc,CAACgF,KAAf,GACA,KAAKvF,eAAL,CAAqB3E,CAAY,CAACa,MAAb,CAAoBG,IAAzC,EACA+I,CAAK,CAACI,IAAN,EACH,CAVsB,CAUpB,IAVoB,CAAvB,CAWAJ,CAAK,CAACK,OAAN,GAAgB1J,EAAhB,CAAmB,OAAnB,CAA4B,qCAA5B,CAAmEsJ,CAAnE,EACAD,CAAK,CAACK,OAAN,GAAgB1J,EAAhB,CAAmB9C,CAAW,CAACyM,MAA/B,CAAuC9M,CAAC,CAAC6C,KAAF,CAAQ,UAAW,CAEtD2J,CAAK,CAACK,OAAN,GAAgB7C,GAAhB,CAAoB,OAApB,CAA6B,qCAA7B,CAAoEyC,CAApE,EACAD,CAAK,CAACO,OAAN,GACA,KAAK5H,cAAL,EACH,CALsC,CAKpC,IALoC,CAAvC,EAMAqH,CAAK,CAACQ,QAAN,GACAR,CAAK,CAACS,IAAN,GACA,MAAOT,CAAAA,CACV,CAtBO,CAsBL,IAtBK,CAJR,EA0BUU,KA1BV,CA0BgB5M,CAAY,CAAC6M,SA1B7B,CA2BH,CA5BD,CA8BA,MAAO1K,CAAAA,CAEV,CA5rBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle list items drag and drop\n *\n * Example of usage:\n *\n * Create a list (for example
    or
) where each draggable element has a drag handle.\n * The best practice is to use the template core/drag_handle:\n * $OUTPUT->render_from_template('core/drag_handle', ['movetitle' => get_string('movecontent', 'moodle', ELEMENTNAME)]);\n *\n * Attach this JS module to this list:\n *\n * Space between define and ( critical in comment but not allowed in code in order to function\n * correctly with Moodle's requirejs.php\n *\n * define (['jquery', 'core/sortable_list'], function($, SortableList) {\n * var list = new SortableList('ul.my-awesome-list'); // source list (usually
    or
) - selector or element\n *\n * // Listen to the events when element is dragged.\n * $('ul.my-awesome-list > *').on(SortableList.EVENTS.DROP, function(evt, info) {\n * console.log(info);\n * });\n *\n * // Advanced usage. Overwrite methods getElementName, getDestinationName, moveDialogueTitle, for example:\n * list.getElementName = function(element) {\n * return $.Deferred().resolve(element.attr('data-name'));\n * }\n * }\n *\n * More details: https://docs.moodle.org/dev/Sortable_list\n *\n * For the full list of possible parameters see var defaultParameters below.\n *\n * The following jQuery events are fired:\n * - SortableList.EVENTS.DRAGSTART : when user started dragging a list element\n * - SortableList.EVENTS.DRAG : when user dragged a list element to a new position\n * - SortableList.EVENTS.DROP : when user dropped a list element\n * - SortableList.EVENTS.DROPEND : when user finished dragging - either fired right after dropping or\n * if \"Esc\" was pressed during dragging\n *\n * @module core/sortable_list\n * @class sortable_list\n * @copyright 2018 Marina Glancy\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/log', 'core/autoscroll', 'core/str', 'core/modal_factory', 'core/modal_events', 'core/notification'],\nfunction($, log, autoScroll, str, ModalFactory, ModalEvents, Notification) {\n\n /**\n * Default parameters\n *\n * @private\n * @type {Object}\n */\n var defaultParameters = {\n targetListSelector: null,\n moveHandlerSelector: '[data-drag-type=move]',\n isHorizontal: false,\n autoScroll: true\n };\n\n /**\n * Class names for different elements that may be changed during sorting\n *\n * @private\n * @type {Object}\n */\n var CSS = {\n keyboardDragClass: 'dragdrop-keyboard-drag',\n isDraggedClass: 'sortable-list-is-dragged',\n currentPositionClass: 'sortable-list-current-position',\n sourceListClass: 'sortable-list-source',\n targetListClass: 'sortable-list-target',\n overElementClass: 'sortable-list-over-element'\n };\n\n /**\n * Test the browser support for options objects on event listeners.\n * @return {Boolean}\n */\n var eventListenerOptionsSupported = function() {\n var passivesupported = false,\n options,\n testeventname = \"testpassiveeventoptions\";\n\n // Options support testing example from:\n // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n\n try {\n options = Object.defineProperty({}, \"passive\", {\n get: function() {\n passivesupported = true;\n }\n });\n\n // We use an event name that is not likely to conflict with any real event.\n document.addEventListener(testeventname, options, options);\n // We remove the event listener as we have tested the options already.\n document.removeEventListener(testeventname, options, options);\n } catch (err) {\n // It's already false.\n passivesupported = false;\n }\n return passivesupported;\n };\n\n /**\n * Allow to create non-passive touchstart listeners and prevent page scrolling when dragging\n * From: https://stackoverflow.com/a/48098097\n *\n * @type {Object}\n */\n var registerNotPassiveListeners = function(eventname) {\n return {\n setup: function(x, ns, handle) {\n if (ns.includes('notPassive')) {\n this.addEventListener(eventname, handle, {passive: false});\n return true;\n } else {\n return false;\n }\n }\n };\n };\n\n if (eventListenerOptionsSupported) {\n $.event.special.touchstart = registerNotPassiveListeners('touchstart');\n $.event.special.touchmove = registerNotPassiveListeners('touchmove');\n $.event.special.touchend = registerNotPassiveListeners('touchend');\n }\n\n /**\n * Initialise sortable list.\n *\n * @param {(String|jQuery|Element)} root JQuery/DOM element representing sortable list (i.e.
    ,
) or CSS selector\n * @param {Object} config Parameters for the list. See defaultParameters above for examples.\n * @property {(String|jQuery|Element)} config.targetListSelector target lists, by default same as root\n * @property {String} config.moveHandlerSelector CSS selector for a drag handle. By default '[data-drag-type=move]'\n * @property {String} config.targetListSelector CSS selector for target lists. By default the same as root\n * @property {(Boolean|Function)} config.isHorizontal Set to true if the list is horizontal\n * (can also be a callback with list as an argument)\n * @property {Boolean} config.autoScroll Engages autoscroll module for automatic vertical scrolling of the\n * whole page, by default true\n */\n var SortableList = function(root, config) {\n\n this.info = null;\n this.proxy = null;\n this.proxyDelta = null;\n this.dragCounter = 0;\n this.lastEvent = null;\n\n this.config = $.extend({}, defaultParameters, config || {});\n this.config.listSelector = root;\n if (!this.config.targetListSelector) {\n this.config.targetListSelector = root;\n }\n if (typeof this.config.listSelector === 'object') {\n // The root is an element on the page. Register a listener for this element.\n $(this.config.listSelector).on('mousedown touchstart.notPassive', $.proxy(this.dragStartHandler, this));\n } else {\n // The root is a CSS selector. Register a listener that picks up the element dynamically.\n $('body').on('mousedown touchstart.notPassive', this.config.listSelector, $.proxy(this.dragStartHandler, this));\n }\n if (this.config.moveHandlerSelector !== null) {\n $('body').on('click keypress', this.config.moveHandlerSelector, $.proxy(this.clickHandler, this));\n }\n\n };\n\n /**\n * Events fired by this entity\n *\n * @public\n * @type {Object}\n */\n SortableList.EVENTS = {\n DRAGSTART: 'sortablelist-dragstart',\n DRAG: 'sortablelist-drag',\n DROP: 'sortablelist-drop',\n DRAGEND: 'sortablelist-dragend'\n };\n\n /**\n * Resets the temporary classes assigned during dragging\n * @private\n */\n SortableList.prototype.resetDraggedClasses = function() {\n var classes = [\n CSS.isDraggedClass,\n CSS.currentPositionClass,\n CSS.overElementClass,\n CSS.targetListClass,\n ];\n for (var i in classes) {\n $('.' + classes[i]).removeClass(classes[i]);\n }\n if (this.proxy) {\n this.proxy.remove();\n this.proxy = $();\n }\n };\n\n /**\n * Calculates evt.pageX, evt.pageY, evt.clientX and evt.clientY\n *\n * For touch events pageX and pageY are taken from the first touch;\n * For the emulated mousemove event they are taken from the last real event.\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.calculatePositionOnPage = function(evt) {\n\n if (evt.originalEvent && evt.originalEvent.touches && evt.originalEvent.touches[0] !== undefined) {\n // This is a touchmove or touchstart event, get position from the first touch position.\n var touch = evt.originalEvent.touches[0];\n evt.pageX = touch.pageX;\n evt.pageY = touch.pageY;\n }\n\n if (evt.pageX === undefined) {\n // Information is not present in case of touchend or when event was emulated by autoScroll.\n // Take the absolute mouse position from the last event.\n evt.pageX = this.lastEvent.pageX;\n evt.pageY = this.lastEvent.pageY;\n } else {\n this.lastEvent = evt;\n }\n\n if (evt.clientX === undefined) {\n // If not provided in event calculate relative mouse position.\n evt.clientX = Math.round(evt.pageX - $(window).scrollLeft());\n evt.clientY = Math.round(evt.pageY - $(window).scrollTop());\n }\n };\n\n /**\n * Handler from dragstart event\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.dragStartHandler = function(evt) {\n if (this.info !== null) {\n if (this.info.type === 'click' || this.info.type === 'touchend') {\n // Ignore double click.\n return;\n }\n // Mouse down or touch while already dragging, cancel previous dragging.\n this.moveElement(this.info.sourceList, this.info.sourceNextElement);\n this.finishDragging();\n }\n\n if (evt.type === 'mousedown' && evt.which !== 1) {\n // We only need left mouse click. If this is a mousedown event with right/middle click ignore it.\n return;\n }\n\n this.calculatePositionOnPage(evt);\n var movedElement = $(evt.target).closest($(evt.currentTarget).children());\n if (!movedElement.length) {\n // Can't find the element user wants to drag. They clicked on the list but outside of any element of the list.\n return;\n }\n\n // Check that we grabbed the element by the handle.\n if (this.config.moveHandlerSelector !== null) {\n if (!$(evt.target).closest(this.config.moveHandlerSelector, movedElement).length) {\n return;\n }\n }\n\n evt.stopPropagation();\n evt.preventDefault();\n\n // Information about moved element with original location.\n // This object is passed to event observers.\n this.dragCounter++;\n this.info = {\n element: movedElement,\n sourceNextElement: movedElement.next(),\n sourceList: movedElement.parent(),\n targetNextElement: movedElement.next(),\n targetList: movedElement.parent(),\n type: evt.type,\n dropped: false,\n startX: evt.pageX,\n startY: evt.pageY,\n startTime: new Date().getTime()\n };\n\n $(this.config.targetListSelector).addClass(CSS.targetListClass);\n\n var offset = movedElement.offset();\n movedElement.addClass(CSS.currentPositionClass);\n this.proxyDelta = {x: offset.left - evt.pageX, y: offset.top - evt.pageY};\n this.proxy = $();\n var thisDragCounter = this.dragCounter;\n setTimeout($.proxy(function() {\n // This mousedown event may in fact be a beginning of a 'click' event. Use timeout before showing the\n // dragged object so we can catch click event. When timeout finishes make sure that click event\n // has not happened during this half a second.\n // Verify dragcounter to make sure the user did not manage to do two very fast drag actions one after another.\n if (this.info === null || this.info.type === 'click' || this.info.type === 'keypress'\n || this.dragCounter !== thisDragCounter) {\n return;\n }\n\n // Create a proxy - the copy of the dragged element that moves together with a mouse.\n this.createProxy();\n }, this), 500);\n\n // Start drag.\n $(window).on('mousemove touchmove.notPassive mouseup touchend.notPassive', $.proxy(this.dragHandler, this));\n $(window).on('keypress', $.proxy(this.dragcancelHandler, this));\n\n // Start autoscrolling. Every time the page is scrolled emulate the mousemove event.\n if (this.config.autoScroll) {\n autoScroll.start(function() {\n $(window).trigger('mousemove');\n });\n }\n\n this.executeCallback(SortableList.EVENTS.DRAGSTART);\n };\n\n /**\n * Creates a \"proxy\" object - a copy of the element that is being moved that always follows the mouse\n * @private\n */\n SortableList.prototype.createProxy = function() {\n this.proxy = this.info.element.clone();\n this.info.sourceList.append(this.proxy);\n this.proxy.removeAttr('id').removeClass(CSS.currentPositionClass)\n .addClass(CSS.isDraggedClass).css({position: 'fixed'});\n this.proxy.offset({top: this.proxyDelta.y + this.lastEvent.pageY, left: this.proxyDelta.x + this.lastEvent.pageX});\n };\n\n /**\n * Handler for click event - when user clicks on the drag handler or presses Enter on keyboard\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.clickHandler = function(evt) {\n if (evt.type === 'keypress' && evt.originalEvent.keyCode !== 13 && evt.originalEvent.keyCode !== 32) {\n return;\n }\n if (this.info !== null) {\n // Ignore double click.\n return;\n }\n\n // Find the element that this draghandle belongs to.\n var clickedElement = $(evt.target).closest(this.config.moveHandlerSelector),\n sourceList = clickedElement.closest(this.config.listSelector),\n movedElement = clickedElement.closest(sourceList.children());\n if (!movedElement.length) {\n return;\n }\n\n evt.preventDefault();\n evt.stopPropagation();\n\n // Store information about moved element with original location.\n this.dragCounter++;\n this.info = {\n element: movedElement,\n sourceNextElement: movedElement.next(),\n sourceList: sourceList,\n targetNextElement: movedElement.next(),\n targetList: sourceList,\n dropped: false,\n type: evt.type,\n startTime: new Date().getTime()\n };\n\n this.executeCallback(SortableList.EVENTS.DRAGSTART);\n this.displayMoveDialogue(clickedElement);\n };\n\n /**\n * Finds the position of the mouse inside the element - on the top, on the bottom, on the right or on the left\\\n *\n * Used to determine if the moved element should be moved after or before the current element\n *\n * @private\n * @param {Number} pageX\n * @param {Number} pageY\n * @param {jQuery} element\n * @returns {(Object|null)}\n */\n SortableList.prototype.getPositionInNode = function(pageX, pageY, element) {\n if (!element.length) {\n return null;\n }\n var node = element[0],\n offset = 0,\n rect = node.getBoundingClientRect(),\n y = pageY - (rect.top + window.scrollY),\n x = pageX - (rect.left + window.scrollX);\n if (x >= -offset && x <= rect.width + offset && y >= -offset && y <= rect.height + offset) {\n return {\n x: x,\n y: y,\n xRatio: rect.width ? (x / rect.width) : 0,\n yRatio: rect.height ? (y / rect.height) : 0\n };\n }\n return null;\n };\n\n /**\n * Check if list is horizontal\n *\n * @param {jQuery} element\n * @return {Boolean}\n */\n SortableList.prototype.isListHorizontal = function(element) {\n var isHorizontal = this.config.isHorizontal;\n if (isHorizontal === true || isHorizontal === false) {\n return isHorizontal;\n }\n return isHorizontal(element);\n };\n\n /**\n * Handler for events mousemove touchmove mouseup touchend\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.dragHandler = function(evt) {\n\n evt.preventDefault();\n evt.stopPropagation();\n\n this.calculatePositionOnPage(evt);\n\n // We can not use evt.target here because it will most likely be our proxy.\n // Move the proxy out of the way so we can find the element at the current mouse position.\n this.proxy.offset({top: -1000, left: -1000});\n // Find the element at the current mouse position.\n var element = $(document.elementFromPoint(evt.clientX, evt.clientY));\n\n // Find the list element and the list over the mouse position.\n var mainElement = this.info.element[0],\n isNotSelf = function() {\n return this !== mainElement;\n },\n current = element.closest('.' + CSS.targetListClass + ' > :not(.' + CSS.isDraggedClass + ')').filter(isNotSelf),\n currentList = element.closest('.' + CSS.targetListClass),\n proxy = this.proxy,\n isNotProxy = function() {\n return !proxy || !proxy.length || this !== proxy[0];\n };\n\n // Add the specified class to the list element we are hovering.\n $('.' + CSS.overElementClass).removeClass(CSS.overElementClass);\n current.addClass(CSS.overElementClass);\n\n // Move proxy to the current position.\n this.proxy.offset({top: this.proxyDelta.y + evt.pageY, left: this.proxyDelta.x + evt.pageX});\n\n if (currentList.length && !currentList.children().filter(isNotProxy).length) {\n // Mouse is over an empty list.\n this.moveElement(currentList, $());\n } else if (current.length === 1 && !this.info.element.find(current[0]).length) {\n // Mouse is over an element in a list - find whether we should move the current position\n // above or below this element.\n var coordinates = this.getPositionInNode(evt.pageX, evt.pageY, current);\n if (coordinates) {\n var parent = current.parent(),\n ratio = this.isListHorizontal(parent) ? coordinates.xRatio : coordinates.yRatio,\n subList = current.find('.' + CSS.targetListClass),\n subListEmpty = !subList.children().filter(isNotProxy).filter(isNotSelf).length;\n if (subList.length && subListEmpty && ratio > 0.2 && ratio < 0.8) {\n // This is an element that is a parent of an empty list and we are around the middle of this element.\n // Treat it as if we are over this empty list.\n this.moveElement(subList, $());\n } else if (ratio > 0.5) {\n // Insert after this element.\n this.moveElement(parent, current.next().filter(isNotProxy));\n } else {\n // Insert before this element.\n this.moveElement(parent, current);\n }\n }\n }\n\n if (evt.type === 'mouseup' || evt.type === 'touchend') {\n // Drop the moved element.\n this.info.endX = evt.pageX;\n this.info.endY = evt.pageY;\n this.info.endTime = new Date().getTime();\n this.info.dropped = true;\n this.info.positionChanged = this.hasPositionChanged(this.info);\n var oldinfo = this.info;\n this.executeCallback(SortableList.EVENTS.DROP);\n this.finishDragging();\n\n if (evt.type === 'touchend'\n && this.config.moveHandlerSelector !== null\n && (oldinfo.endTime - oldinfo.startTime < 500)\n && !oldinfo.positionChanged) {\n // The click event is not triggered on touch screens because we call preventDefault in touchstart handler.\n // If the touchend quickly followed touchstart without moving, consider it a \"click\".\n this.clickHandler(evt);\n }\n }\n };\n\n /**\n * Checks if the position of the dragged element in the list has changed\n *\n * @private\n * @param {Object} info\n * @return {Boolean}\n */\n SortableList.prototype.hasPositionChanged = function(info) {\n return info.sourceList[0] !== info.targetList[0] ||\n info.sourceNextElement.length !== info.targetNextElement.length ||\n (info.sourceNextElement.length && info.sourceNextElement[0] !== info.targetNextElement[0]);\n };\n\n /**\n * Moves the current position of the dragged element\n *\n * @private\n * @param {jQuery} parentElement\n * @param {jQuery} beforeElement\n */\n SortableList.prototype.moveElement = function(parentElement, beforeElement) {\n var dragEl = this.info.element;\n if (beforeElement.length && beforeElement[0] === dragEl[0]) {\n // Insert before the current position of the dragged element - nothing to do.\n return;\n }\n if (parentElement[0] === this.info.targetList[0] &&\n beforeElement.length === this.info.targetNextElement.length &&\n beforeElement[0] === this.info.targetNextElement[0]) {\n // Insert in the same location as the current position - nothing to do.\n return;\n }\n\n if (beforeElement.length) {\n // Move the dragged element before the specified element.\n parentElement[0].insertBefore(dragEl[0], beforeElement[0]);\n } else if (this.proxy && this.proxy.parent().length && this.proxy.parent()[0] === parentElement[0]) {\n // We need to move to the end of the list but the last element in this list is a proxy.\n // Always leave the proxy in the end of the list.\n parentElement[0].insertBefore(dragEl[0], this.proxy[0]);\n } else {\n // Insert in the end of a list (when proxy is in another list).\n parentElement[0].appendChild(dragEl[0]);\n }\n\n // Save the current position of the dragged element in the list.\n this.info.targetList = parentElement;\n this.info.targetNextElement = beforeElement;\n this.executeCallback(SortableList.EVENTS.DRAG);\n };\n\n /**\n * Finish dragging (when dropped or cancelled).\n * @private\n */\n SortableList.prototype.finishDragging = function() {\n this.resetDraggedClasses();\n if (this.config.autoScroll) {\n autoScroll.stop();\n }\n $(window).off('mousemove touchmove.notPassive mouseup touchend.notPassive', $.proxy(this.dragHandler, this));\n $(window).off('keypress', $.proxy(this.dragcancelHandler, this));\n this.executeCallback(SortableList.EVENTS.DRAGEND);\n this.info = null;\n };\n\n /**\n * Executes callback specified in sortable list parameters\n *\n * @private\n * @param {String} eventName\n */\n SortableList.prototype.executeCallback = function(eventName) {\n this.info.element.trigger(eventName, this.info);\n };\n\n /**\n * Handler from keypress event (cancel dragging when Esc is pressed)\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.dragcancelHandler = function(evt) {\n if (evt.type !== 'keypress' || evt.originalEvent.keyCode !== 27) {\n // Only cancel dragging when Esc was pressed.\n return;\n }\n // Dragging was cancelled. Return item to the original position.\n this.moveElement(this.info.sourceList, this.info.sourceNextElement);\n this.finishDragging();\n };\n\n /**\n * Returns the name of the current element to be used in the move dialogue\n *\n * @public\n * @param {jQuery} element\n * @return {Promise}\n */\n SortableList.prototype.getElementName = function(element) {\n return $.Deferred().resolve(element.text());\n };\n\n /**\n * Returns the label for the potential move destination, i.e. \"After ElementX\" or \"To the top of the list\"\n *\n * Note that we use \"after\" in the label for better UX\n *\n * @public\n * @param {jQuery} parentElement\n * @param {jQuery} afterElement\n * @return {Promise}\n */\n SortableList.prototype.getDestinationName = function(parentElement, afterElement) {\n if (!afterElement.length) {\n return str.get_string('movecontenttothetop', 'moodle');\n } else {\n return this.getElementName(afterElement)\n .then(function(name) {\n return str.get_string('movecontentafter', 'moodle', name);\n });\n }\n };\n\n /**\n * Returns the title for the move dialogue (\"Move elementY\")\n *\n * @public\n * @param {jQuery} element\n * @param {jQuery} handler\n * @return {Promise}\n */\n SortableList.prototype.getMoveDialogueTitle = function(element, handler) {\n if (handler.attr('title')) {\n return $.Deferred().resolve(handler.attr('title'));\n }\n return this.getElementName(element).then(function(name) {\n return str.get_string('movecontent', 'moodle', name);\n });\n };\n\n /**\n * Returns the list of possible move destinations\n *\n * @private\n * @return {Promise}\n */\n SortableList.prototype.getDestinationsList = function() {\n var addedLists = [],\n targets = $(this.config.targetListSelector),\n destinations = $('`) where each draggable element has a drag handle.\n * The best practice is to use the template core/drag_handle:\n * $OUTPUT->render_from_template('core/drag_handle', ['movetitle' => get_string('movecontent', 'moodle', ELEMENTNAME)]);\n *\n * Attach this JS module to this list:\n *\n * Space between define and ( critical in comment but not allowed in code in order to function\n * correctly with Moodle's requirejs.php\n *\n * More details: https://docs.moodle.org/dev/Sortable_list\n *\n * For the full list of possible parameters see var defaultParameters below.\n *\n * The following jQuery events are fired:\n * - SortableList.EVENTS.DRAGSTART : when user started dragging a list element\n * - SortableList.EVENTS.DRAG : when user dragged a list element to a new position\n * - SortableList.EVENTS.DROP : when user dropped a list element\n * - SortableList.EVENTS.DROPEND : when user finished dragging - either fired right after dropping or\n * if \"Esc\" was pressed during dragging\n *\n * @example\n * define (['jquery', 'core/sortable_list'], function($, SortableList) {\n * var list = new SortableList('ul.my-awesome-list'); // source list (usually
    or
) - selector or element\n *\n * // Listen to the events when element is dragged.\n * $('ul.my-awesome-list > *').on(SortableList.EVENTS.DROP, function(evt, info) {\n * console.log(info);\n * });\n *\n * // Advanced usage. Overwrite methods getElementName, getDestinationName, moveDialogueTitle, for example:\n * list.getElementName = function(element) {\n * return $.Deferred().resolve(element.attr('data-name'));\n * }\n * });\n *\n * @module core/sortable_list\n * @class core/sortable_list\n * @copyright 2018 Marina Glancy\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/log', 'core/autoscroll', 'core/str', 'core/modal_factory', 'core/modal_events', 'core/notification'],\nfunction($, log, autoScroll, str, ModalFactory, ModalEvents, Notification) {\n\n /**\n * Default parameters\n *\n * @private\n * @type {Object}\n */\n var defaultParameters = {\n targetListSelector: null,\n moveHandlerSelector: '[data-drag-type=move]',\n isHorizontal: false,\n autoScroll: true\n };\n\n /**\n * Class names for different elements that may be changed during sorting\n *\n * @private\n * @type {Object}\n */\n var CSS = {\n keyboardDragClass: 'dragdrop-keyboard-drag',\n isDraggedClass: 'sortable-list-is-dragged',\n currentPositionClass: 'sortable-list-current-position',\n sourceListClass: 'sortable-list-source',\n targetListClass: 'sortable-list-target',\n overElementClass: 'sortable-list-over-element'\n };\n\n /**\n * Test the browser support for options objects on event listeners.\n * @return {Boolean}\n */\n var eventListenerOptionsSupported = function() {\n var passivesupported = false,\n options,\n testeventname = \"testpassiveeventoptions\";\n\n // Options support testing example from:\n // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n\n try {\n options = Object.defineProperty({}, \"passive\", {\n get: function() {\n passivesupported = true;\n }\n });\n\n // We use an event name that is not likely to conflict with any real event.\n document.addEventListener(testeventname, options, options);\n // We remove the event listener as we have tested the options already.\n document.removeEventListener(testeventname, options, options);\n } catch (err) {\n // It's already false.\n passivesupported = false;\n }\n return passivesupported;\n };\n\n /**\n * Allow to create non-passive touchstart listeners and prevent page scrolling when dragging\n * From: https://stackoverflow.com/a/48098097\n *\n * @type {Object}\n */\n var registerNotPassiveListeners = function(eventname) {\n return {\n setup: function(x, ns, handle) {\n if (ns.includes('notPassive')) {\n this.addEventListener(eventname, handle, {passive: false});\n return true;\n } else {\n return false;\n }\n }\n };\n };\n\n if (eventListenerOptionsSupported) {\n $.event.special.touchstart = registerNotPassiveListeners('touchstart');\n $.event.special.touchmove = registerNotPassiveListeners('touchmove');\n $.event.special.touchend = registerNotPassiveListeners('touchend');\n }\n\n /**\n * Initialise sortable list.\n *\n * @param {(String|jQuery|Element)} root JQuery/DOM element representing sortable list (i.e.
    ,
) or CSS selector\n * @param {Object} config Parameters for the list. See defaultParameters above for examples.\n * @property {(String|jQuery|Element)} config.targetListSelector target lists, by default same as root\n * @property {String} config.moveHandlerSelector CSS selector for a drag handle. By default '[data-drag-type=move]'\n * @property {String} config.targetListSelector CSS selector for target lists. By default the same as root\n * @property {(Boolean|Function)} config.isHorizontal Set to true if the list is horizontal\n * (can also be a callback with list as an argument)\n * @property {Boolean} config.autoScroll Engages autoscroll module for automatic vertical scrolling of the\n * whole page, by default true\n */\n var SortableList = function(root, config) {\n\n this.info = null;\n this.proxy = null;\n this.proxyDelta = null;\n this.dragCounter = 0;\n this.lastEvent = null;\n\n this.config = $.extend({}, defaultParameters, config || {});\n this.config.listSelector = root;\n if (!this.config.targetListSelector) {\n this.config.targetListSelector = root;\n }\n if (typeof this.config.listSelector === 'object') {\n // The root is an element on the page. Register a listener for this element.\n $(this.config.listSelector).on('mousedown touchstart.notPassive', $.proxy(this.dragStartHandler, this));\n } else {\n // The root is a CSS selector. Register a listener that picks up the element dynamically.\n $('body').on('mousedown touchstart.notPassive', this.config.listSelector, $.proxy(this.dragStartHandler, this));\n }\n if (this.config.moveHandlerSelector !== null) {\n $('body').on('click keypress', this.config.moveHandlerSelector, $.proxy(this.clickHandler, this));\n }\n\n };\n\n /**\n * Events fired by this entity\n *\n * @public\n * @type {Object}\n */\n SortableList.EVENTS = {\n DRAGSTART: 'sortablelist-dragstart',\n DRAG: 'sortablelist-drag',\n DROP: 'sortablelist-drop',\n DRAGEND: 'sortablelist-dragend'\n };\n\n /**\n * Resets the temporary classes assigned during dragging\n * @private\n */\n SortableList.prototype.resetDraggedClasses = function() {\n var classes = [\n CSS.isDraggedClass,\n CSS.currentPositionClass,\n CSS.overElementClass,\n CSS.targetListClass,\n ];\n for (var i in classes) {\n $('.' + classes[i]).removeClass(classes[i]);\n }\n if (this.proxy) {\n this.proxy.remove();\n this.proxy = $();\n }\n };\n\n /**\n * Calculates evt.pageX, evt.pageY, evt.clientX and evt.clientY\n *\n * For touch events pageX and pageY are taken from the first touch;\n * For the emulated mousemove event they are taken from the last real event.\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.calculatePositionOnPage = function(evt) {\n\n if (evt.originalEvent && evt.originalEvent.touches && evt.originalEvent.touches[0] !== undefined) {\n // This is a touchmove or touchstart event, get position from the first touch position.\n var touch = evt.originalEvent.touches[0];\n evt.pageX = touch.pageX;\n evt.pageY = touch.pageY;\n }\n\n if (evt.pageX === undefined) {\n // Information is not present in case of touchend or when event was emulated by autoScroll.\n // Take the absolute mouse position from the last event.\n evt.pageX = this.lastEvent.pageX;\n evt.pageY = this.lastEvent.pageY;\n } else {\n this.lastEvent = evt;\n }\n\n if (evt.clientX === undefined) {\n // If not provided in event calculate relative mouse position.\n evt.clientX = Math.round(evt.pageX - $(window).scrollLeft());\n evt.clientY = Math.round(evt.pageY - $(window).scrollTop());\n }\n };\n\n /**\n * Handler from dragstart event\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.dragStartHandler = function(evt) {\n if (this.info !== null) {\n if (this.info.type === 'click' || this.info.type === 'touchend') {\n // Ignore double click.\n return;\n }\n // Mouse down or touch while already dragging, cancel previous dragging.\n this.moveElement(this.info.sourceList, this.info.sourceNextElement);\n this.finishDragging();\n }\n\n if (evt.type === 'mousedown' && evt.which !== 1) {\n // We only need left mouse click. If this is a mousedown event with right/middle click ignore it.\n return;\n }\n\n this.calculatePositionOnPage(evt);\n var movedElement = $(evt.target).closest($(evt.currentTarget).children());\n if (!movedElement.length) {\n // Can't find the element user wants to drag. They clicked on the list but outside of any element of the list.\n return;\n }\n\n // Check that we grabbed the element by the handle.\n if (this.config.moveHandlerSelector !== null) {\n if (!$(evt.target).closest(this.config.moveHandlerSelector, movedElement).length) {\n return;\n }\n }\n\n evt.stopPropagation();\n evt.preventDefault();\n\n // Information about moved element with original location.\n // This object is passed to event observers.\n this.dragCounter++;\n this.info = {\n element: movedElement,\n sourceNextElement: movedElement.next(),\n sourceList: movedElement.parent(),\n targetNextElement: movedElement.next(),\n targetList: movedElement.parent(),\n type: evt.type,\n dropped: false,\n startX: evt.pageX,\n startY: evt.pageY,\n startTime: new Date().getTime()\n };\n\n $(this.config.targetListSelector).addClass(CSS.targetListClass);\n\n var offset = movedElement.offset();\n movedElement.addClass(CSS.currentPositionClass);\n this.proxyDelta = {x: offset.left - evt.pageX, y: offset.top - evt.pageY};\n this.proxy = $();\n var thisDragCounter = this.dragCounter;\n setTimeout($.proxy(function() {\n // This mousedown event may in fact be a beginning of a 'click' event. Use timeout before showing the\n // dragged object so we can catch click event. When timeout finishes make sure that click event\n // has not happened during this half a second.\n // Verify dragcounter to make sure the user did not manage to do two very fast drag actions one after another.\n if (this.info === null || this.info.type === 'click' || this.info.type === 'keypress'\n || this.dragCounter !== thisDragCounter) {\n return;\n }\n\n // Create a proxy - the copy of the dragged element that moves together with a mouse.\n this.createProxy();\n }, this), 500);\n\n // Start drag.\n $(window).on('mousemove touchmove.notPassive mouseup touchend.notPassive', $.proxy(this.dragHandler, this));\n $(window).on('keypress', $.proxy(this.dragcancelHandler, this));\n\n // Start autoscrolling. Every time the page is scrolled emulate the mousemove event.\n if (this.config.autoScroll) {\n autoScroll.start(function() {\n $(window).trigger('mousemove');\n });\n }\n\n this.executeCallback(SortableList.EVENTS.DRAGSTART);\n };\n\n /**\n * Creates a \"proxy\" object - a copy of the element that is being moved that always follows the mouse\n * @private\n */\n SortableList.prototype.createProxy = function() {\n this.proxy = this.info.element.clone();\n this.info.sourceList.append(this.proxy);\n this.proxy.removeAttr('id').removeClass(CSS.currentPositionClass)\n .addClass(CSS.isDraggedClass).css({position: 'fixed'});\n this.proxy.offset({top: this.proxyDelta.y + this.lastEvent.pageY, left: this.proxyDelta.x + this.lastEvent.pageX});\n };\n\n /**\n * Handler for click event - when user clicks on the drag handler or presses Enter on keyboard\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.clickHandler = function(evt) {\n if (evt.type === 'keypress' && evt.originalEvent.keyCode !== 13 && evt.originalEvent.keyCode !== 32) {\n return;\n }\n if (this.info !== null) {\n // Ignore double click.\n return;\n }\n\n // Find the element that this draghandle belongs to.\n var clickedElement = $(evt.target).closest(this.config.moveHandlerSelector),\n sourceList = clickedElement.closest(this.config.listSelector),\n movedElement = clickedElement.closest(sourceList.children());\n if (!movedElement.length) {\n return;\n }\n\n evt.preventDefault();\n evt.stopPropagation();\n\n // Store information about moved element with original location.\n this.dragCounter++;\n this.info = {\n element: movedElement,\n sourceNextElement: movedElement.next(),\n sourceList: sourceList,\n targetNextElement: movedElement.next(),\n targetList: sourceList,\n dropped: false,\n type: evt.type,\n startTime: new Date().getTime()\n };\n\n this.executeCallback(SortableList.EVENTS.DRAGSTART);\n this.displayMoveDialogue(clickedElement);\n };\n\n /**\n * Finds the position of the mouse inside the element - on the top, on the bottom, on the right or on the left\\\n *\n * Used to determine if the moved element should be moved after or before the current element\n *\n * @private\n * @param {Number} pageX\n * @param {Number} pageY\n * @param {jQuery} element\n * @returns {(Object|null)}\n */\n SortableList.prototype.getPositionInNode = function(pageX, pageY, element) {\n if (!element.length) {\n return null;\n }\n var node = element[0],\n offset = 0,\n rect = node.getBoundingClientRect(),\n y = pageY - (rect.top + window.scrollY),\n x = pageX - (rect.left + window.scrollX);\n if (x >= -offset && x <= rect.width + offset && y >= -offset && y <= rect.height + offset) {\n return {\n x: x,\n y: y,\n xRatio: rect.width ? (x / rect.width) : 0,\n yRatio: rect.height ? (y / rect.height) : 0\n };\n }\n return null;\n };\n\n /**\n * Check if list is horizontal\n *\n * @param {jQuery} element\n * @return {Boolean}\n */\n SortableList.prototype.isListHorizontal = function(element) {\n var isHorizontal = this.config.isHorizontal;\n if (isHorizontal === true || isHorizontal === false) {\n return isHorizontal;\n }\n return isHorizontal(element);\n };\n\n /**\n * Handler for events mousemove touchmove mouseup touchend\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.dragHandler = function(evt) {\n\n evt.preventDefault();\n evt.stopPropagation();\n\n this.calculatePositionOnPage(evt);\n\n // We can not use evt.target here because it will most likely be our proxy.\n // Move the proxy out of the way so we can find the element at the current mouse position.\n this.proxy.offset({top: -1000, left: -1000});\n // Find the element at the current mouse position.\n var element = $(document.elementFromPoint(evt.clientX, evt.clientY));\n\n // Find the list element and the list over the mouse position.\n var mainElement = this.info.element[0],\n isNotSelf = function() {\n return this !== mainElement;\n },\n current = element.closest('.' + CSS.targetListClass + ' > :not(.' + CSS.isDraggedClass + ')').filter(isNotSelf),\n currentList = element.closest('.' + CSS.targetListClass),\n proxy = this.proxy,\n isNotProxy = function() {\n return !proxy || !proxy.length || this !== proxy[0];\n };\n\n // Add the specified class to the list element we are hovering.\n $('.' + CSS.overElementClass).removeClass(CSS.overElementClass);\n current.addClass(CSS.overElementClass);\n\n // Move proxy to the current position.\n this.proxy.offset({top: this.proxyDelta.y + evt.pageY, left: this.proxyDelta.x + evt.pageX});\n\n if (currentList.length && !currentList.children().filter(isNotProxy).length) {\n // Mouse is over an empty list.\n this.moveElement(currentList, $());\n } else if (current.length === 1 && !this.info.element.find(current[0]).length) {\n // Mouse is over an element in a list - find whether we should move the current position\n // above or below this element.\n var coordinates = this.getPositionInNode(evt.pageX, evt.pageY, current);\n if (coordinates) {\n var parent = current.parent(),\n ratio = this.isListHorizontal(parent) ? coordinates.xRatio : coordinates.yRatio,\n subList = current.find('.' + CSS.targetListClass),\n subListEmpty = !subList.children().filter(isNotProxy).filter(isNotSelf).length;\n if (subList.length && subListEmpty && ratio > 0.2 && ratio < 0.8) {\n // This is an element that is a parent of an empty list and we are around the middle of this element.\n // Treat it as if we are over this empty list.\n this.moveElement(subList, $());\n } else if (ratio > 0.5) {\n // Insert after this element.\n this.moveElement(parent, current.next().filter(isNotProxy));\n } else {\n // Insert before this element.\n this.moveElement(parent, current);\n }\n }\n }\n\n if (evt.type === 'mouseup' || evt.type === 'touchend') {\n // Drop the moved element.\n this.info.endX = evt.pageX;\n this.info.endY = evt.pageY;\n this.info.endTime = new Date().getTime();\n this.info.dropped = true;\n this.info.positionChanged = this.hasPositionChanged(this.info);\n var oldinfo = this.info;\n this.executeCallback(SortableList.EVENTS.DROP);\n this.finishDragging();\n\n if (evt.type === 'touchend'\n && this.config.moveHandlerSelector !== null\n && (oldinfo.endTime - oldinfo.startTime < 500)\n && !oldinfo.positionChanged) {\n // The click event is not triggered on touch screens because we call preventDefault in touchstart handler.\n // If the touchend quickly followed touchstart without moving, consider it a \"click\".\n this.clickHandler(evt);\n }\n }\n };\n\n /**\n * Checks if the position of the dragged element in the list has changed\n *\n * @private\n * @param {Object} info\n * @return {Boolean}\n */\n SortableList.prototype.hasPositionChanged = function(info) {\n return info.sourceList[0] !== info.targetList[0] ||\n info.sourceNextElement.length !== info.targetNextElement.length ||\n (info.sourceNextElement.length && info.sourceNextElement[0] !== info.targetNextElement[0]);\n };\n\n /**\n * Moves the current position of the dragged element\n *\n * @private\n * @param {jQuery} parentElement\n * @param {jQuery} beforeElement\n */\n SortableList.prototype.moveElement = function(parentElement, beforeElement) {\n var dragEl = this.info.element;\n if (beforeElement.length && beforeElement[0] === dragEl[0]) {\n // Insert before the current position of the dragged element - nothing to do.\n return;\n }\n if (parentElement[0] === this.info.targetList[0] &&\n beforeElement.length === this.info.targetNextElement.length &&\n beforeElement[0] === this.info.targetNextElement[0]) {\n // Insert in the same location as the current position - nothing to do.\n return;\n }\n\n if (beforeElement.length) {\n // Move the dragged element before the specified element.\n parentElement[0].insertBefore(dragEl[0], beforeElement[0]);\n } else if (this.proxy && this.proxy.parent().length && this.proxy.parent()[0] === parentElement[0]) {\n // We need to move to the end of the list but the last element in this list is a proxy.\n // Always leave the proxy in the end of the list.\n parentElement[0].insertBefore(dragEl[0], this.proxy[0]);\n } else {\n // Insert in the end of a list (when proxy is in another list).\n parentElement[0].appendChild(dragEl[0]);\n }\n\n // Save the current position of the dragged element in the list.\n this.info.targetList = parentElement;\n this.info.targetNextElement = beforeElement;\n this.executeCallback(SortableList.EVENTS.DRAG);\n };\n\n /**\n * Finish dragging (when dropped or cancelled).\n * @private\n */\n SortableList.prototype.finishDragging = function() {\n this.resetDraggedClasses();\n if (this.config.autoScroll) {\n autoScroll.stop();\n }\n $(window).off('mousemove touchmove.notPassive mouseup touchend.notPassive', $.proxy(this.dragHandler, this));\n $(window).off('keypress', $.proxy(this.dragcancelHandler, this));\n this.executeCallback(SortableList.EVENTS.DRAGEND);\n this.info = null;\n };\n\n /**\n * Executes callback specified in sortable list parameters\n *\n * @private\n * @param {String} eventName\n */\n SortableList.prototype.executeCallback = function(eventName) {\n this.info.element.trigger(eventName, this.info);\n };\n\n /**\n * Handler from keypress event (cancel dragging when Esc is pressed)\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.dragcancelHandler = function(evt) {\n if (evt.type !== 'keypress' || evt.originalEvent.keyCode !== 27) {\n // Only cancel dragging when Esc was pressed.\n return;\n }\n // Dragging was cancelled. Return item to the original position.\n this.moveElement(this.info.sourceList, this.info.sourceNextElement);\n this.finishDragging();\n };\n\n /**\n * Returns the name of the current element to be used in the move dialogue\n *\n * @public\n * @param {jQuery} element\n * @return {Promise}\n */\n SortableList.prototype.getElementName = function(element) {\n return $.Deferred().resolve(element.text());\n };\n\n /**\n * Returns the label for the potential move destination, i.e. \"After ElementX\" or \"To the top of the list\"\n *\n * Note that we use \"after\" in the label for better UX\n *\n * @public\n * @param {jQuery} parentElement\n * @param {jQuery} afterElement\n * @return {Promise}\n */\n SortableList.prototype.getDestinationName = function(parentElement, afterElement) {\n if (!afterElement.length) {\n return str.get_string('movecontenttothetop', 'moodle');\n } else {\n return this.getElementName(afterElement)\n .then(function(name) {\n return str.get_string('movecontentafter', 'moodle', name);\n });\n }\n };\n\n /**\n * Returns the title for the move dialogue (\"Move elementY\")\n *\n * @public\n * @param {jQuery} element\n * @param {jQuery} handler\n * @return {Promise}\n */\n SortableList.prototype.getMoveDialogueTitle = function(element, handler) {\n if (handler.attr('title')) {\n return $.Deferred().resolve(handler.attr('title'));\n }\n return this.getElementName(element).then(function(name) {\n return str.get_string('movecontent', 'moodle', name);\n });\n };\n\n /**\n * Returns the list of possible move destinations\n *\n * @private\n * @return {Promise}\n */\n SortableList.prototype.getDestinationsList = function() {\n var addedLists = [],\n targets = $(this.config.targetListSelector),\n destinations = $('\n *\n * import {get_string as getString} from 'core/str';\n * get_string('cannotfindteacher', 'error')\n * .then(str => {\n * window.console.log(str); // Cannot find teacher\n * })\n * .catch();\n */\n// eslint-disable-next-line camelcase\nexport const get_string = (key, component, param, lang) => {\n return get_strings([{key, component, param, lang}])\n .then(results => results[0]);\n};\n\n/**\n * Make a batch request to load a set of strings.\n *\n * Any missing string will be fetched from the server.\n * The Promise will only be resolved once all strings are available, or an attempt has been made to fetch them.\n *\n * @method get_strings\n * @param {Object[]} requests List of strings to fetch\n * @param {string} requests.key The string identifer to fetch\n * @param {string} [requests.component='core'] The componet to fetch from\n * @param {string} [requests.lang] The language to fetch a string for. Defaults to current page language.\n * @param {object|string} [requests.param] The param for variable expansion in the string.\n * @return {Promise[]}\n *\n * @example \n *\n * import {get_strings as getStrings} from 'core/str';\n * get_strings([\n * {\n * key: 'cannotfindteacher',\n * component: 'error',\n * },\n * {\n * key: 'yes',\n * component: 'core',\n * },\n * {\n * key: 'no',\n * component: 'core',\n * },\n * ])\n * .then((cannotFindTeacher, yes, no) => {\n * window.console.log(cannotFindTeacher); // Cannot find teacher\n * window.console.log(yes); // Yes\n * window.console.log(no); // No\n * })\n * .catch();\n */\n// eslint-disable-next-line camelcase\nexport const get_strings = (requests) => {\n let requestData = [];\n const pageLang = $('html').attr('lang').replace(/-/g, '_');\n // Helper function to construct the cache key.\n const getCacheKey = ({key, component, lang = pageLang}) => {\n if (!component) {\n component = 'core';\n }\n return `core_str/${key}/${component}/${lang}`;\n };\n\n const stringPromises = requests.map((request) => {\n const cacheKey = getCacheKey(request);\n const {component, key, param, lang = pageLang} = request;\n // Helper function to add the promise to cache.\n const buildReturn = (promise) => {\n // Make sure the promise cache contains our promise.\n promiseCache[cacheKey] = promise;\n return promise;\n };\n\n // Check if we can serve the string straight from M.str.\n if (component in M.str && key in M.str[component]) {\n return buildReturn(new Promise((resolve) => {\n resolve(M.util.get_string(key, component, param, lang));\n }));\n }\n\n // Check if the string is in the browser's local storage.\n const cached = LocalStorage.get(cacheKey);\n if (cached) {\n M.str[component] = {...M.str[component], [key]: cached};\n return buildReturn(new Promise((resolve) => {\n resolve(M.util.get_string(key, component, param, lang));\n }));\n }\n\n // Check if we've already loaded this string from the server.\n if (cacheKey in promiseCache) {\n return buildReturn(promiseCache[cacheKey]).then(() => {\n return M.util.get_string(key, component, param, lang);\n });\n } else {\n // We're going to have to ask the server for the string so\n // add this string to the list of requests to be sent.\n return buildReturn(new Promise((resolve, reject) => {\n requestData.push({\n methodname: 'core_get_string',\n args: {\n stringid: key,\n stringparams: [],\n component,\n lang,\n },\n done: (str) => {\n // When we get the response from the server\n // we should update M.str and the browser's\n // local storage before resolving this promise.\n M.str[component] = {...M.str[component], [key]: str};\n LocalStorage.set(cacheKey, str);\n resolve(M.util.get_string(key, component, param, lang));\n },\n fail: reject\n });\n }));\n }\n });\n\n if (requestData.length) {\n // If we need to load any strings from the server then send\n // off the request.\n Ajax.call(requestData, true, false, false, 0, M.cfg.langrev);\n }\n\n // We need to use jQuery here because some calling code uses the\n // .done handler instead of the .then handler.\n return $.when.apply($, stringPromises)\n .then((...strings) => strings);\n};\n\n/**\n * Add a list of strings to the caches.\n *\n * This function should typically only be called from core APIs to pre-cache values.\n *\n * @method cache_strings\n * @protected\n * @param {Object[]} strings List of strings to fetch\n * @param {string} strings.key The string identifer to fetch\n * @param {string} strings.value The string value\n * @param {string} [strings.component='core'] The componet to fetch from\n * @param {string} [strings.lang] The language to fetch a string for. Defaults to current page language.\n */\n// eslint-disable-next-line camelcase\nexport const cache_strings = (strings) => {\n const defaultLang = $('html').attr('lang').replace(/-/g, '_');\n\n strings.forEach(({key, component, value, lang = defaultLang}) => {\n const cacheKey = ['core_str', key, component, lang].join('/');\n\n // Check M.str caching.\n if (!(component in M.str) || !(key in M.str[component])) {\n if (!(component in M.str)) {\n M.str[component] = {};\n }\n\n M.str[component][key] = value;\n }\n\n // Check local storage.\n if (!LocalStorage.get(cacheKey)) {\n LocalStorage.set(cacheKey, value);\n }\n\n // Check the promises cache.\n if (!(cacheKey in promiseCache)) {\n promiseCache[cacheKey] = $.Deferred().resolve(value).promise();\n }\n });\n};\n/* eslint-enable no-restricted-properties */\n"],"file":"str.min.js"} \ No newline at end of file diff --git a/lib/amd/build/toast.min.js.map b/lib/amd/build/toast.min.js.map index b8838e638923d..5979ea3f26248 100644 --- a/lib/amd/build/toast.min.js.map +++ b/lib/amd/build/toast.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/toast.js"],"names":["addToastRegion","parent","pendingPromise","Pending","Templates","renderForPromise","html","js","prependNodeContents","Notification","exception","resolve","add","message","configuration","closeButton","autohide","delay","templateName","getTargetNode","targetNode","regions","document","querySelectorAll","length","body"],"mappings":"mMAsBA,OACA,OACA,O,6jCAOO,GAAMA,CAAAA,CAAc,4CAAG,WAAMC,CAAN,+FACpBC,CADoB,CACH,GAAIC,UAAJ,CAAY,gBAAZ,CADG,yBAIGC,WAAUC,gBAAV,CAA2B,0BAA3B,CAAuD,EAAvD,CAJH,iBAIfC,CAJe,GAIfA,IAJe,CAITC,CAJS,GAITA,EAJS,CAKtBH,UAAUI,mBAAV,CAA8BP,CAA9B,CAAsCK,CAAtC,CAA4CC,CAA5C,EALsB,qDAOtBE,UAAaC,SAAb,OAPsB,QAU1BR,CAAc,CAACS,OAAf,GAV0B,uDAAH,uDAApB,C,mBAyBA,GAAMC,CAAAA,CAAG,4CAAG,WAAMC,CAAN,CAAeC,CAAf,mGACTZ,CADS,CACQ,GAAIC,UAAJ,CAAY,gBAAZ,CADR,CAEfW,CAAa,IACTC,WAAW,GADF,CAETC,QAAQ,GAFC,CAGTC,KAAK,CAAE,GAHE,EAINH,CAJM,CAAb,CAOMI,CATS,oDAWcC,CAAAA,CAAa,EAX3B,QAWLC,CAXK,uBAYchB,WAAUC,gBAAV,CAA2Ba,CAA3B,IACrBL,OAAO,CAAPA,CADqB,EAElBC,CAFkB,EAZd,iBAYJR,CAZI,GAYJA,IAZI,CAYEC,CAZF,GAYEA,EAZF,CAgBXH,UAAUI,mBAAV,CAA8BY,CAA9B,CAA0Cd,CAA1C,CAAgDC,CAAhD,EAhBW,qDAkBXE,UAAaC,SAAb,OAlBW,QAqBfR,CAAc,CAACS,OAAf,GArBe,uDAAH,uDAAT,C,QAwBP,GAAMQ,CAAAA,CAAa,4CAAG,oGACZE,CADY,CACFC,QAAQ,CAACC,gBAAT,CAA0B,gBAA1B,CADE,KAGdF,CAAO,CAACG,MAHM,0CAIPH,CAAO,CAACA,CAAO,CAACG,MAAR,CAAiB,CAAlB,CAJA,wBAOZxB,CAAAA,CAAc,CAACsB,QAAQ,CAACG,IAAV,CAAgB,cAAhB,CAPF,iCAQXN,CAAa,EARF,0CAAH,uD","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A system for displaying small snackbar notifications to users which disappear shortly after they are shown.\n *\n * @module core/toast\n * @copyright 2019 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Templates from 'core/templates';\nimport Notification from 'core/notification';\nimport Pending from 'core/pending';\n\n/**\n * Add a new region to place toasts in, taking in a parent element.\n *\n * @param {Element} parent\n */\nexport const addToastRegion = async(parent) => {\n const pendingPromise = new Pending('addToastRegion');\n\n try {\n const {html, js} = await Templates.renderForPromise('core/local/toast/wrapper', {});\n Templates.prependNodeContents(parent, html, js);\n } catch (e) {\n Notification.exception(e);\n }\n\n pendingPromise.resolve();\n};\n\n/**\n * Add a new toast or snackbar notification to the page.\n *\n * @param {String} message\n * @param {Object} configuration\n * @param {String} [configuration.title]\n * @param {String} [configuration.subtitle]\n * @param {String} [configuration.type] Optional type of the toast notification ('success', 'info', 'warning' or 'danger')\n * @param {Boolean} [configuration.autohide=true]\n * @param {Boolean} [configuration.closeButton=false]\n * @param {Number} [configuration.delay=4000]\n */\nexport const add = async(message, configuration) => {\n const pendingPromise = new Pending('addToastRegion');\n configuration = {\n closeButton: false,\n autohide: true,\n delay: 4000,\n ...configuration,\n };\n\n const templateName = `core/local/toast/message`;\n try {\n const targetNode = await getTargetNode();\n const {html, js} = await Templates.renderForPromise(templateName, {\n message,\n ...configuration\n });\n Templates.prependNodeContents(targetNode, html, js);\n } catch (e) {\n Notification.exception(e);\n }\n\n pendingPromise.resolve();\n};\n\nconst getTargetNode = async() => {\n const regions = document.querySelectorAll('.toast-wrapper');\n\n if (regions.length) {\n return regions[regions.length - 1];\n }\n\n await addToastRegion(document.body, 'fixed-bottom');\n return getTargetNode();\n};\n"],"file":"toast.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/toast.js"],"names":["addToastRegion","parent","pendingPromise","Pending","Templates","renderForPromise","html","js","prependNodeContents","Notification","exception","resolve","add","message","configuration","closeButton","autohide","delay","templateName","getTargetNode","targetNode","regions","document","querySelectorAll","length","body"],"mappings":"mMAsBA,OACA,OACA,O,6jCAQO,GAAMA,CAAAA,CAAc,4CAAG,WAAMC,CAAN,+FACpBC,CADoB,CACH,GAAIC,UAAJ,CAAY,gBAAZ,CADG,yBAIGC,WAAUC,gBAAV,CAA2B,0BAA3B,CAAuD,EAAvD,CAJH,iBAIfC,CAJe,GAIfA,IAJe,CAITC,CAJS,GAITA,EAJS,CAKtBH,UAAUI,mBAAV,CAA8BP,CAA9B,CAAsCK,CAAtC,CAA4CC,CAA5C,EALsB,qDAOtBE,UAAaC,SAAb,OAPsB,QAU1BR,CAAc,CAACS,OAAf,GAV0B,uDAAH,uDAApB,C,mBAyCA,GAAMC,CAAAA,CAAG,4CAAG,WAAMC,CAAN,CAAeC,CAAf,mGACTZ,CADS,CACQ,GAAIC,UAAJ,CAAY,gBAAZ,CADR,CAEfW,CAAa,IACTC,WAAW,GADF,CAETC,QAAQ,GAFC,CAGTC,KAAK,CAAE,GAHE,EAINH,CAJM,CAAb,CAOMI,CATS,oDAWcC,CAAAA,CAAa,EAX3B,QAWLC,CAXK,uBAYchB,WAAUC,gBAAV,CAA2Ba,CAA3B,IACrBL,OAAO,CAAPA,CADqB,EAElBC,CAFkB,EAZd,iBAYJR,CAZI,GAYJA,IAZI,CAYEC,CAZF,GAYEA,EAZF,CAgBXH,UAAUI,mBAAV,CAA8BY,CAA9B,CAA0Cd,CAA1C,CAAgDC,CAAhD,EAhBW,qDAkBXE,UAAaC,SAAb,OAlBW,QAqBfR,CAAc,CAACS,OAAf,GArBe,uDAAH,uDAAT,C,QAwBP,GAAMQ,CAAAA,CAAa,4CAAG,oGACZE,CADY,CACFC,QAAQ,CAACC,gBAAT,CAA0B,gBAA1B,CADE,KAGdF,CAAO,CAACG,MAHM,0CAIPH,CAAO,CAACA,CAAO,CAACG,MAAR,CAAiB,CAAlB,CAJA,wBAOZxB,CAAAA,CAAc,CAACsB,QAAQ,CAACG,IAAV,CAAgB,cAAhB,CAPF,iCAQXN,CAAa,EARF,0CAAH,uD","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A system for displaying small snackbar notifications to users which disappear shortly after they are shown.\n *\n * @module core/toast\n * @copyright 2019 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Templates from 'core/templates';\nimport Notification from 'core/notification';\nimport Pending from 'core/pending';\n\n/**\n * Add a new region to place toasts in, taking in a parent element.\n *\n * @method\n * @param {HTMLElement} parent\n */\nexport const addToastRegion = async(parent) => {\n const pendingPromise = new Pending('addToastRegion');\n\n try {\n const {html, js} = await Templates.renderForPromise('core/local/toast/wrapper', {});\n Templates.prependNodeContents(parent, html, js);\n } catch (e) {\n Notification.exception(e);\n }\n\n pendingPromise.resolve();\n};\n\n/**\n * Add a new toast or snackbar notification to the page.\n *\n * @method\n * @param {String} message\n * @param {Object} configuration\n * @param {String} [configuration.title]\n * @param {String} [configuration.subtitle]\n * @param {String} [configuration.type] Optional type of the toast notification ('success', 'info', 'warning' or 'danger')\n * @param {Boolean} [configuration.autohide=true]\n * @param {Boolean} [configuration.closeButton=false]\n * @param {Number} [configuration.delay=4000]\n *\n * @example\n * import {add as addToast} from 'core/toast';\n * import {get_string as getString} from 'core/str';\n *\n * getString('example', 'mod_myexample')\n * .then(str => {\n * addToast(str, {\n * type: 'warning',\n * autohide: false,\n * closeButton: true,\n * });\n * return;\n * })\n * .catch();\n */\nexport const add = async(message, configuration) => {\n const pendingPromise = new Pending('addToastRegion');\n configuration = {\n closeButton: false,\n autohide: true,\n delay: 4000,\n ...configuration,\n };\n\n const templateName = `core/local/toast/message`;\n try {\n const targetNode = await getTargetNode();\n const {html, js} = await Templates.renderForPromise(templateName, {\n message,\n ...configuration\n });\n Templates.prependNodeContents(targetNode, html, js);\n } catch (e) {\n Notification.exception(e);\n }\n\n pendingPromise.resolve();\n};\n\nconst getTargetNode = async() => {\n const regions = document.querySelectorAll('.toast-wrapper');\n\n if (regions.length) {\n return regions[regions.length - 1];\n }\n\n await addToastRegion(document.body, 'fixed-bottom');\n return getTargetNode();\n};\n"],"file":"toast.min.js"} \ No newline at end of file diff --git a/lib/amd/build/truncate.min.js.map b/lib/amd/build/truncate.min.js.map index f920774023204..9c7e128458b82 100644 --- a/lib/amd/build/truncate.min.js.map +++ b/lib/amd/build/truncate.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/truncate.js"],"names":["define","$","charLengthAt","text","position","string","size","length","index","cuFirst","charCodeAt","cuSecond","nextIndex","len","lengthMultiByte","count","i","getSliceLength","amount","truncate","html","options","append","fn","isNaN","parseFloat","o","extend","defaults","each","self","noBreaks","find","replaceWith","ellipsisLength","ellipsis","textLength","excess","stripTags","words","sliced","slice","replaced","replace","truncated","oneWord","match","keepFirstWord","exec","contents","get","reverse","el","$el","remove","nodeType","splitAmount","splitText"],"mappings":"AAoCAA,OAAM,iBAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,IAczBC,CAAAA,CAAY,CAAG,SAASC,CAAT,CAAeC,CAAf,CAAyB,IACtCC,CAAAA,CAAM,CAAUF,CAAV,GADgC,CAEtCG,CAAI,CAAGD,CAAM,CAACE,MAFwB,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CAAD,CAH0B,CAMtD,GAAII,CAAM,EAAI8B,CAAd,CAAsB,CACpBX,CAAC,CAACkB,SAAF,IACAP,CAAM,EAAI9B,CAAV,CACA8C,CAAG,CAACC,MAAJ,GACA,MACD,CAGD,GAAoB,CAAhB,GAAAF,CAAE,CAACG,QAAP,CAAuB,CACrB,GAAIC,CAAAA,CAAW,CAAGjD,CAAM,CAAG8B,CAA3B,CACAmB,CAAW,CAAkB,CAAf,EAAAA,CAAW,CAAQvC,CAAc,CAACd,CAAD,CAAOqD,CAAP,CAAtB,CAA4C,CAArE,CACAvD,CAAC,CAACmD,CAAE,CAACK,SAAH,CAAaD,CAAb,CAAD,CAAD,CAA6BvB,WAA7B,CAAyCP,CAAC,CAACS,QAA3C,EACA,QACD,CAGDkB,CAAG,CAAClC,QAAJ,CAAalB,CAAC,CAAC0B,MAAF,CAASD,CAAT,CAAY,CAACnB,MAAM,CAAEA,CAAM,CAAG8B,CAAT,CAAkBH,CAA3B,CAAZ,CAAb,EACA,QACD,CAxBD,CAyBD,CA9DM,CA+DR,CAnED,CAqEAjC,CAAC,CAACkB,QAAF,CAAWS,QAAX,CAAsB,CAGpBU,SAAS,GAHW,CAMpBC,KAAK,GANe,CAUpBQ,aAAa,GAVO,CAapBhB,QAAQ,GAbY,CAgBpBxB,MAAM,IAhBc,CAuBpB4B,QAAQ,CAAE,QAvBU,CAAtB,CA2BE,MAAO,CACHhB,QAAQ,CAAElB,CAAC,CAACkB,QADT,CAGV,CAlLK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Description of import/upgrade into Moodle:\n * 1.) Download from https://github.com/pathable/truncate\n * 2.) Copy jquery.truncate.js into lib/amd/src/truncate.js\n * 3.) Edit truncate.js to return the $.truncate function as truncate\n * 4.) Apply Moodle changes from git commit 7172b33e241c4d42cff01f78bf8570408f43fdc2\n */\n\n/**\n * Module for text truncation.\n *\n * Implementation provided by Pathable (thanks!).\n * See: https://github.com/pathable/truncate\n *\n * @module core/truncate\n * @class truncate\n * @copyright 2017 Pathable\n * 2017 Mathias Bynens\n * 2017 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'], function($) {\n\n // Matches trailing non-space characters.\n var chop = /(\\s*\\S+|\\s)$/;\n\n // Matches the first word in the string.\n var start = /^(\\S*)/;\n\n // Matches any space characters.\n var space = /\\s/;\n\n // Special thanks to Mathias Bynens for the multi-byte char\n // implementation. Much love.\n // see: https://github.com/mathiasbynens/String.prototype.at/blob/master/at.js\n var charLengthAt = function(text, position) {\n var string = String(text);\n var size = string.length;\n // `ToInteger`\n var index = position ? Number(position) : 0;\n if (index != index) { // better `isNaN`\n index = 0;\n }\n // Account for out-of-bounds indices\n // The odd lower bound is because the ToInteger operation is\n // going to round `n` to `0` for `-1 < n <= 0`.\n if (index <= -1 || index >= size) {\n return '';\n }\n // Second half of `ToInteger`\n index = index | 0;\n // Get the first code unit and code unit value\n var cuFirst = string.charCodeAt(index);\n var cuSecond;\n var nextIndex = index + 1;\n var len = 1;\n if ( // Check if it’s the start of a surrogate pair.\n cuFirst >= 0xD800 && cuFirst <= 0xDBFF && // high surrogate\n size > nextIndex // there is a next code unit\n ) {\n cuSecond = string.charCodeAt(nextIndex);\n if (cuSecond >= 0xDC00 && cuSecond <= 0xDFFF) { // low surrogate\n len = 2;\n }\n }\n return len;\n };\n\n var lengthMultiByte = function(text) {\n var count = 0;\n\n for (var i = 0; i < text.length; i += charLengthAt(text, i)) {\n count++;\n }\n\n return count;\n };\n\n var getSliceLength = function(text, amount) {\n if (!text.length) {\n return 0;\n }\n\n var length = 0;\n var count = 0;\n\n do {\n length += charLengthAt(text, length);\n count++;\n } while (length < text.length && count < amount);\n\n return length;\n };\n\n // Return a truncated html string. Delegates to $.fn.truncate.\n $.truncate = function(html, options) {\n return $('
').append(html).truncate(options).html();\n };\n\n // Truncate the contents of an element in place.\n $.fn.truncate = function(options) {\n if (!isNaN(parseFloat(options))) options = {length: options};\n var o = $.extend({}, $.truncate.defaults, options);\n\n return this.each(function() {\n var self = $(this);\n\n if (o.noBreaks) self.find('br').replaceWith(' ');\n\n var ellipsisLength = o.ellipsis.length;\n var text = self.text();\n var textLength = lengthMultiByte(text);\n var excess = textLength - o.length + ellipsisLength;\n\n if (textLength < o.length) return;\n if (o.stripTags) self.text(text);\n\n // Chop off any partial words if appropriate.\n if (o.words && excess > 0) {\n var sliced = text.slice(0, getSliceLength(text, o.length - ellipsisLength) + 1);\n var replaced = sliced.replace(chop, '');\n var truncated = lengthMultiByte(replaced);\n var oneWord = sliced.match(space) ? false : true;\n\n if (o.keepFirstWord && truncated === 0) {\n excess = textLength - lengthMultiByte(start.exec(text)[0]) - ellipsisLength;\n } else if (oneWord && truncated === 0) {\n excess = textLength - o.length + ellipsisLength;\n } else {\n excess = textLength - truncated - 1;\n }\n }\n\n // The requested length is larger than the text. No need for ellipsis.\n if (excess > textLength) {\n excess = textLength - o.length;\n }\n\n if (excess < 0 || !excess && !o.truncated) return;\n\n // Iterate over each child node in reverse, removing excess text.\n $.each(self.contents().get().reverse(), function(i, el) {\n var $el = $(el);\n var text = $el.text();\n var length = lengthMultiByte(text);\n\n // If the text is longer than the excess, remove the node and continue.\n if (length <= excess) {\n o.truncated = true;\n excess -= length;\n $el.remove();\n return;\n }\n\n // Remove the excess text and append the ellipsis.\n if (el.nodeType === 3) {\n var splitAmount = length - excess;\n splitAmount = splitAmount >= 0 ? getSliceLength(text, splitAmount) : 0;\n $(el.splitText(splitAmount)).replaceWith(o.ellipsis);\n return false;\n }\n\n // Recursively truncate child nodes.\n $el.truncate($.extend(o, {length: length - excess + ellipsisLength}));\n return false;\n });\n });\n };\n\n $.truncate.defaults = {\n\n // Strip all html elements, leaving only plain text.\n stripTags: false,\n\n // Only truncate at word boundaries.\n words: false,\n\n // When 'words' is active, keeps the first word in the string\n // even if it's longer than a target length.\n keepFirstWord: false,\n\n // Replace instances of
with a single space.\n noBreaks: false,\n\n // The maximum length of the truncated html.\n length: Infinity,\n\n // The character to use as the ellipsis. The word joiner (U+2060) can be\n // used to prevent a hanging ellipsis, but displays incorrectly in Chrome\n // on Windows 7.\n // http://code.google.com/p/chromium/issues/detail?id=68323\n //ellipsis: '\\u2026' // '\\u2060\\u2026'\n ellipsis: '\\u2026' // '\\u2060\\u2026'\n\n };\n\n return {\n truncate: $.truncate,\n };\n});\n"],"file":"truncate.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/truncate.js"],"names":["define","$","charLengthAt","text","position","string","size","length","index","cuFirst","charCodeAt","cuSecond","nextIndex","len","lengthMultiByte","count","i","getSliceLength","amount","truncate","html","options","append","fn","isNaN","parseFloat","o","extend","defaults","each","self","noBreaks","find","replaceWith","ellipsisLength","ellipsis","textLength","excess","stripTags","words","sliced","slice","replaced","replace","truncated","oneWord","match","keepFirstWord","exec","contents","get","reverse","el","$el","remove","nodeType","splitAmount","splitText"],"mappings":"AAmCAA,OAAM,iBAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,IAczBC,CAAAA,CAAY,CAAG,SAASC,CAAT,CAAeC,CAAf,CAAyB,IACtCC,CAAAA,CAAM,CAAUF,CAAV,GADgC,CAEtCG,CAAI,CAAGD,CAAM,CAACE,MAFwB,CAItCC,CAAK,CAAGJ,CAAQ,EAAUA,CAAV,CAAsB,CAJA,CAK1C,GAAII,CAAK,EAAIA,CAAb,CAAoB,CAClBA,CAAK,CAAG,CACT,CAID,GAAa,CAAC,CAAV,EAAAA,CAAK,EAAUA,CAAK,EAAIF,CAA5B,CAAkC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CAAuB,CACrB,GAAIC,CAAAA,CAAW,CAAGjD,CAAM,CAAG8B,CAA3B,CACAmB,CAAW,CAAkB,CAAf,EAAAA,CAAW,CAAQvC,CAAc,CAACd,CAAD,CAAOqD,CAAP,CAAtB,CAA4C,CAArE,CACAvD,CAAC,CAACmD,CAAE,CAACK,SAAH,CAAaD,CAAb,CAAD,CAAD,CAA6BvB,WAA7B,CAAyCP,CAAC,CAACS,QAA3C,EACA,QACD,CAGDkB,CAAG,CAAClC,QAAJ,CAAalB,CAAC,CAAC0B,MAAF,CAASD,CAAT,CAAY,CAACnB,MAAM,CAAEA,CAAM,CAAG8B,CAAT,CAAkBH,CAA3B,CAAZ,CAAb,EACA,QACD,CAxBD,CAyBD,CA9DM,CA+DR,CAnED,CAqEAjC,CAAC,CAACkB,QAAF,CAAWS,QAAX,CAAsB,CAGpBU,SAAS,GAHW,CAMpBC,KAAK,GANe,CAUpBQ,aAAa,GAVO,CAapBhB,QAAQ,GAbY,CAgBpBxB,MAAM,IAhBc,CAuBpB4B,QAAQ,CAAE,QAvBU,CAAtB,CA2BE,MAAO,CACHhB,QAAQ,CAAElB,CAAC,CAACkB,QADT,CAGV,CAlLK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Description of import/upgrade into Moodle:\n * 1.) Download from https://github.com/pathable/truncate\n * 2.) Copy jquery.truncate.js into lib/amd/src/truncate.js\n * 3.) Edit truncate.js to return the $.truncate function as truncate\n * 4.) Apply Moodle changes from git commit 7172b33e241c4d42cff01f78bf8570408f43fdc2\n */\n\n/**\n * Module for text truncation.\n *\n * Implementation provided by Pathable (thanks!).\n * See: https://github.com/pathable/truncate\n *\n * @module core/truncate\n * @copyright 2017 Pathable\n * 2017 Mathias Bynens\n * 2017 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'], function($) {\n\n // Matches trailing non-space characters.\n var chop = /(\\s*\\S+|\\s)$/;\n\n // Matches the first word in the string.\n var start = /^(\\S*)/;\n\n // Matches any space characters.\n var space = /\\s/;\n\n // Special thanks to Mathias Bynens for the multi-byte char\n // implementation. Much love.\n // see: https://github.com/mathiasbynens/String.prototype.at/blob/master/at.js\n var charLengthAt = function(text, position) {\n var string = String(text);\n var size = string.length;\n // `ToInteger`\n var index = position ? Number(position) : 0;\n if (index != index) { // better `isNaN`\n index = 0;\n }\n // Account for out-of-bounds indices\n // The odd lower bound is because the ToInteger operation is\n // going to round `n` to `0` for `-1 < n <= 0`.\n if (index <= -1 || index >= size) {\n return '';\n }\n // Second half of `ToInteger`\n index = index | 0;\n // Get the first code unit and code unit value\n var cuFirst = string.charCodeAt(index);\n var cuSecond;\n var nextIndex = index + 1;\n var len = 1;\n if ( // Check if it’s the start of a surrogate pair.\n cuFirst >= 0xD800 && cuFirst <= 0xDBFF && // high surrogate\n size > nextIndex // there is a next code unit\n ) {\n cuSecond = string.charCodeAt(nextIndex);\n if (cuSecond >= 0xDC00 && cuSecond <= 0xDFFF) { // low surrogate\n len = 2;\n }\n }\n return len;\n };\n\n var lengthMultiByte = function(text) {\n var count = 0;\n\n for (var i = 0; i < text.length; i += charLengthAt(text, i)) {\n count++;\n }\n\n return count;\n };\n\n var getSliceLength = function(text, amount) {\n if (!text.length) {\n return 0;\n }\n\n var length = 0;\n var count = 0;\n\n do {\n length += charLengthAt(text, length);\n count++;\n } while (length < text.length && count < amount);\n\n return length;\n };\n\n // Return a truncated html string. Delegates to $.fn.truncate.\n $.truncate = function(html, options) {\n return $('
').append(html).truncate(options).html();\n };\n\n // Truncate the contents of an element in place.\n $.fn.truncate = function(options) {\n if (!isNaN(parseFloat(options))) options = {length: options};\n var o = $.extend({}, $.truncate.defaults, options);\n\n return this.each(function() {\n var self = $(this);\n\n if (o.noBreaks) self.find('br').replaceWith(' ');\n\n var ellipsisLength = o.ellipsis.length;\n var text = self.text();\n var textLength = lengthMultiByte(text);\n var excess = textLength - o.length + ellipsisLength;\n\n if (textLength < o.length) return;\n if (o.stripTags) self.text(text);\n\n // Chop off any partial words if appropriate.\n if (o.words && excess > 0) {\n var sliced = text.slice(0, getSliceLength(text, o.length - ellipsisLength) + 1);\n var replaced = sliced.replace(chop, '');\n var truncated = lengthMultiByte(replaced);\n var oneWord = sliced.match(space) ? false : true;\n\n if (o.keepFirstWord && truncated === 0) {\n excess = textLength - lengthMultiByte(start.exec(text)[0]) - ellipsisLength;\n } else if (oneWord && truncated === 0) {\n excess = textLength - o.length + ellipsisLength;\n } else {\n excess = textLength - truncated - 1;\n }\n }\n\n // The requested length is larger than the text. No need for ellipsis.\n if (excess > textLength) {\n excess = textLength - o.length;\n }\n\n if (excess < 0 || !excess && !o.truncated) return;\n\n // Iterate over each child node in reverse, removing excess text.\n $.each(self.contents().get().reverse(), function(i, el) {\n var $el = $(el);\n var text = $el.text();\n var length = lengthMultiByte(text);\n\n // If the text is longer than the excess, remove the node and continue.\n if (length <= excess) {\n o.truncated = true;\n excess -= length;\n $el.remove();\n return;\n }\n\n // Remove the excess text and append the ellipsis.\n if (el.nodeType === 3) {\n var splitAmount = length - excess;\n splitAmount = splitAmount >= 0 ? getSliceLength(text, splitAmount) : 0;\n $(el.splitText(splitAmount)).replaceWith(o.ellipsis);\n return false;\n }\n\n // Recursively truncate child nodes.\n $el.truncate($.extend(o, {length: length - excess + ellipsisLength}));\n return false;\n });\n });\n };\n\n $.truncate.defaults = {\n\n // Strip all html elements, leaving only plain text.\n stripTags: false,\n\n // Only truncate at word boundaries.\n words: false,\n\n // When 'words' is active, keeps the first word in the string\n // even if it's longer than a target length.\n keepFirstWord: false,\n\n // Replace instances of
with a single space.\n noBreaks: false,\n\n // The maximum length of the truncated html.\n length: Infinity,\n\n // The character to use as the ellipsis. The word joiner (U+2060) can be\n // used to prevent a hanging ellipsis, but displays incorrectly in Chrome\n // on Windows 7.\n // http://code.google.com/p/chromium/issues/detail?id=68323\n //ellipsis: '\\u2026' // '\\u2060\\u2026'\n ellipsis: '\\u2026' // '\\u2060\\u2026'\n\n };\n\n return {\n truncate: $.truncate,\n };\n});\n"],"file":"truncate.min.js"} \ No newline at end of file diff --git a/lib/amd/build/url.min.js.map b/lib/amd/build/url.min.js.map index 0862cdbe423fe..93e38742fe239 100644 --- a/lib/amd/build/url.min.js.map +++ b/lib/amd/build/url.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/url.js"],"names":["define","$","config","fileUrl","relativeScript","slashArg","url","wwwroot","charAt","slasharguments","encodeURIComponent","relativeUrl","relativePath","params","includeSessKey","indexOf","Error","admin","replace","sesskey","queryString","Object","keys","length","map","value","param","join","imageUrl","imagename","component","M","util","image_url"],"mappings":"AAwBAA,OAAM,YAAC,CAAC,QAAD,CAAW,aAAX,CAAD,CAA4B,SAASC,CAAT,CAAYC,CAAZ,CAAoB,CAGlD,MAAqC,CAUjCC,OAAO,CAAE,iBAASC,CAAT,CAAyBC,CAAzB,CAAmC,CAExC,GAAIC,CAAAA,CAAG,CAAGJ,CAAM,CAACK,OAAP,CAAiBH,CAA3B,CAGA,GAA0B,GAAtB,EAAAC,CAAQ,CAACG,MAAT,CAAgB,CAAhB,CAAJ,CAA+B,CAC3BH,CAAQ,CAAG,IAAMA,CACpB,CACD,GAAIH,CAAM,CAACO,cAAX,CAA2B,CACvBH,CAAG,EAAID,CACV,CAFD,IAEO,CACHC,CAAG,EAAI,SAAWI,kBAAkB,CAACL,CAAD,CACvC,CACD,MAAOC,CAAAA,CACV,CAxBgC,CAmCjCK,WAAW,CAAE,qBAASC,CAAT,CAAuBC,CAAvB,CAA+BC,CAA/B,C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,CAAOC,SAAP,CAAiBJ,CAAjB,CAA4BC,CAA5B,CACV,CAhFgC,CAkFxC,CArFK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * URL utility functions.\n *\n * @module core/url\n * @class url\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 2.9\n */\ndefine(['jquery', 'core/config'], function($, config) {\n\n\n return /** @alias module:core/url */ {\n // Public variables and functions.\n /**\n * Construct a file url\n *\n * @method fileUrl\n * @param {string} relativeScript\n * @param {string} slashArg\n * @return {string}\n */\n fileUrl: function(relativeScript, slashArg) {\n\n var url = config.wwwroot + relativeScript;\n\n // Force a /\n if (slashArg.charAt(0) != '/') {\n slashArg = '/' + slashArg;\n }\n if (config.slasharguments) {\n url += slashArg;\n } else {\n url += '?file=' + encodeURIComponent(slashArg);\n }\n return url;\n },\n\n /**\n * Take a path relative to the moodle basedir and do some fixing (see class moodle_url in php).\n *\n * @method relativeUrl\n * @param {string} relativePath The path relative to the moodle basedir.\n * @param {object} params The query parameters for the URL.\n * @param {bool} includeSessKey Add the session key to the query params.\n * @return {string}\n */\n relativeUrl: function(relativePath, params, includeSessKey) {\n\n if (relativePath.indexOf('http:') === 0 || relativePath.indexOf('https:') === 0 || relativePath.indexOf('://') >= 0) {\n throw new Error('relativeUrl function does not accept absolute urls');\n }\n\n // Fix non-relative paths;\n if (relativePath.charAt(0) != '/') {\n relativePath = '/' + relativePath;\n }\n\n // Fix admin urls.\n if (config.admin !== 'admin') {\n relativePath = relativePath.replace(/^\\/admin\\//, '/' + config.admin + '/');\n }\n\n params = params || {};\n if (includeSessKey) {\n params.sesskey = config.sesskey;\n }\n\n var queryString = '';\n if (Object.keys(params).length) {\n queryString = $.map(params, function(value, param) {\n return param + '=' + value;\n }).join('&');\n }\n\n if (queryString !== '') {\n return config.wwwroot + relativePath + '?' + queryString;\n } else {\n return config.wwwroot + relativePath;\n }\n },\n\n /**\n * Wrapper for image_url function.\n *\n * @method imageUrl\n * @param {string} imagename The image name (e.g. t/edit).\n * @param {string} component The component (e.g. mod_feedback).\n * @return {string}\n */\n imageUrl: function(imagename, component) {\n return M.util.image_url(imagename, component);\n }\n };\n});\n"],"file":"url.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/url.js"],"names":["define","$","config","fileUrl","relativeScript","slashArg","url","wwwroot","charAt","slasharguments","encodeURIComponent","relativeUrl","relativePath","params","includeSessKey","indexOf","Error","admin","replace","sesskey","queryString","Object","keys","length","map","value","param","join","imageUrl","imagename","component","M","util","image_url"],"mappings":"AAuBAA,OAAM,YAAC,CAAC,QAAD,CAAW,aAAX,CAAD,CAA4B,SAASC,CAAT,CAAYC,CAAZ,CAAoB,CAGlD,MAAqC,CAUjCC,OAAO,CAAE,iBAASC,CAAT,CAAyBC,CAAzB,CAAmC,CAExC,GAAIC,CAAAA,CAAG,CAAGJ,CAAM,CAACK,OAAP,CAAiBH,CAA3B,CAGA,GAA0B,GAAtB,EAAAC,CAAQ,CAACG,MAAT,CAAgB,CAAhB,CAAJ,CAA+B,CAC3BH,CAAQ,CAAG,IAAMA,CACpB,CACD,GAAIH,CAAM,CAACO,cAAX,CAA2B,CACvBH,CAAG,EAAID,CACV,CAFD,IAEO,CACHC,CAAG,EAAI,SAAWI,kBAAkB,CAACL,CAAD,CACvC,CACD,MAAOC,CAAAA,CACV,CAxBgC,CAmCjCK,WAAW,CAAE,qBAASC,CAAT,CAAuBC,CAAvB,CAA+BC,CAA/B,CAA+C,CAExD,GAAsC,CAAlC,GA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B,CAA4BC,CAA5B,CACV,CAhFgC,CAkFxC,CArFK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * URL utility functions.\n *\n * @module core/url\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 2.9\n */\ndefine(['jquery', 'core/config'], function($, config) {\n\n\n return /** @alias module:core/url */ {\n // Public variables and functions.\n /**\n * Construct a file url\n *\n * @method fileUrl\n * @param {string} relativeScript\n * @param {string} slashArg\n * @return {string}\n */\n fileUrl: function(relativeScript, slashArg) {\n\n var url = config.wwwroot + relativeScript;\n\n // Force a /\n if (slashArg.charAt(0) != '/') {\n slashArg = '/' + slashArg;\n }\n if (config.slasharguments) {\n url += slashArg;\n } else {\n url += '?file=' + encodeURIComponent(slashArg);\n }\n return url;\n },\n\n /**\n * Take a path relative to the moodle basedir and do some fixing (see class moodle_url in php).\n *\n * @method relativeUrl\n * @param {string} relativePath The path relative to the moodle basedir.\n * @param {object} params The query parameters for the URL.\n * @param {bool} includeSessKey Add the session key to the query params.\n * @return {string}\n */\n relativeUrl: function(relativePath, params, includeSessKey) {\n\n if (relativePath.indexOf('http:') === 0 || relativePath.indexOf('https:') === 0 || relativePath.indexOf('://') >= 0) {\n throw new Error('relativeUrl function does not accept absolute urls');\n }\n\n // Fix non-relative paths;\n if (relativePath.charAt(0) != '/') {\n relativePath = '/' + relativePath;\n }\n\n // Fix admin urls.\n if (config.admin !== 'admin') {\n relativePath = relativePath.replace(/^\\/admin\\//, '/' + config.admin + '/');\n }\n\n params = params || {};\n if (includeSessKey) {\n params.sesskey = config.sesskey;\n }\n\n var queryString = '';\n if (Object.keys(params).length) {\n queryString = $.map(params, function(value, param) {\n return param + '=' + value;\n }).join('&');\n }\n\n if (queryString !== '') {\n return config.wwwroot + relativePath + '?' + queryString;\n } else {\n return config.wwwroot + relativePath;\n }\n },\n\n /**\n * Wrapper for image_url function.\n *\n * @method imageUrl\n * @param {string} imagename The image name (e.g. t/edit).\n * @param {string} component The component (e.g. mod_feedback).\n * @return {string}\n */\n imageUrl: function(imagename, component) {\n return M.util.image_url(imagename, component);\n }\n };\n});\n"],"file":"url.min.js"} \ No newline at end of file diff --git a/lib/amd/build/utils.min.js.map b/lib/amd/build/utils.min.js.map index 5d083626c27c4..8733312d8cebd 100644 --- a/lib/amd/build/utils.min.js.map +++ b/lib/amd/build/utils.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/utils.js"],"names":["throttle","func","wait","onCooldown","runAgain","run","args","apply","setTimeout","recurse","debounce","timeout","clearTimeout"],"mappings":"mJAkCwB,QAAXA,CAAAA,QAAW,CAACC,CAAD,CAAOC,CAAP,CAAgB,IAChCC,CAAAA,CAAU,GADsB,CAEhCC,CAAQ,CAAG,IAFqB,CAG9BC,CAAG,CAAG,UAAkB,4BAANC,CAAM,uBAANA,CAAM,iBAC1B,GAAiB,IAAb,GAAAF,CAAJ,CAAuB,CAEnBA,CAAQ,GACX,CAHD,IAGO,CAGHA,CAAQ,GACX,CAED,GAAID,CAAJ,CAAgB,CAEZ,MACH,CAEDF,CAAI,CAACM,KAAL,CAAW,IAAX,CAAiBD,CAAjB,EACAH,CAAU,GAAV,CAEAK,UAAU,CAAC,UAAM,CACb,GAAMC,CAAAA,CAAO,CAAGL,CAAhB,CACAD,CAAU,GAAV,CACAC,CAAQ,CAAG,IAAX,CAEA,GAAIK,CAAJ,CAAa,CACTJ,CAAG,CAACC,CAAD,CACN,CACJ,CARS,CAQPJ,CARO,CASb,CA9BmC,CAgCpC,MAAOG,CAAAA,CACV,C,YAWuB,QAAXK,CAAAA,QAAW,CAACT,CAAD,CAAOC,CAAP,CAAgB,CACpC,GAAIS,CAAAA,CAAO,CAAG,IAAd,CACA,MAAO,WAAkB,mCAANL,CAAM,uBAANA,CAAM,iBACrBM,YAAY,CAACD,CAAD,CAAZ,CACAA,CAAO,CAAGH,UAAU,CAAC,UAAM,CACvBP,CAAI,CAACM,KAAL,CAAW,CAAX,CAAiBD,CAAjB,CACH,CAFmB,CAEjBJ,CAFiB,CAGvB,CACJ,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Utility functions.\n *\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n /**\n * Create a wrapper function to throttle the execution of the given\n * function to at most once every specified period.\n *\n * If the function is attempted to be executed while it's in cooldown\n * (during the wait period) then it'll immediately execute again as\n * soon as the cooldown is over.\n *\n * @param {Function} func The function to throttle\n * @param {Number} wait The number of milliseconds to wait between executions\n * @return {Function}\n */\nexport const throttle = (func, wait) => {\n let onCooldown = false;\n let runAgain = null;\n const run = function(...args) {\n if (runAgain === null) {\n // This is the first time the function has been called.\n runAgain = false;\n } else {\n // This function has been called a second time during the wait period\n // so re-run it once the wait period is over.\n runAgain = true;\n }\n\n if (onCooldown) {\n // Function has already run for this wait period.\n return;\n }\n\n func.apply(this, args);\n onCooldown = true;\n\n setTimeout(() => {\n const recurse = runAgain;\n onCooldown = false;\n runAgain = null;\n\n if (recurse) {\n run(args);\n }\n }, wait);\n };\n\n return run;\n};\n\n/**\n * Create a wrapper function to debounce the execution of the given\n * function. Each attempt to execute the function will reset the cooldown\n * period.\n *\n * @param {Function} func The function to debounce\n * @param {Number} wait The number of milliseconds to wait after the final attempt to execute\n * @return {Function}\n */\nexport const debounce = (func, wait) => {\n let timeout = null;\n return function(...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n func.apply(this, args);\n }, wait);\n };\n};\n"],"file":"utils.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/utils.js"],"names":["throttle","func","wait","onCooldown","runAgain","run","args","apply","setTimeout","recurse","debounce","timeout","clearTimeout"],"mappings":"mJAoCwB,QAAXA,CAAAA,QAAW,CAACC,CAAD,CAAOC,CAAP,CAAgB,IAChCC,CAAAA,CAAU,GADsB,CAEhCC,CAAQ,CAAG,IAFqB,CAG9BC,CAAG,CAAG,UAAkB,4BAANC,CAAM,uBAANA,CAAM,iBAC1B,GAAiB,IAAb,GAAAF,CAAJ,CAAuB,CAEnBA,CAAQ,GACX,CAHD,IAGO,CAGHA,CAAQ,GACX,CAED,GAAID,CAAJ,CAAgB,CAEZ,MACH,CAEDF,CAAI,CAACM,KAAL,CAAW,IAAX,CAAiBD,CAAjB,EACAH,CAAU,GAAV,CAEAK,UAAU,CAAC,UAAM,CACb,GAAMC,CAAAA,CAAO,CAAGL,CAAhB,CACAD,CAAU,GAAV,CACAC,CAAQ,CAAG,IAAX,CAEA,GAAIK,CAAJ,CAAa,CACTJ,CAAG,CAACC,CAAD,CACN,CACJ,CARS,CAQPJ,CARO,CASb,CA9BmC,CAgCpC,MAAOG,CAAAA,CACV,C,YAYuB,QAAXK,CAAAA,QAAW,CAACT,CAAD,CAAOC,CAAP,CAAgB,CACpC,GAAIS,CAAAA,CAAO,CAAG,IAAd,CACA,MAAO,WAAkB,mCAANL,CAAM,uBAANA,CAAM,iBACrBM,YAAY,CAACD,CAAD,CAAZ,CACAA,CAAO,CAAGH,UAAU,CAAC,UAAM,CACvBP,CAAI,CAACM,KAAL,CAAW,CAAX,CAAiBD,CAAjB,CACH,CAFmB,CAEjBJ,CAFiB,CAGvB,CACJ,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Utility functions.\n *\n * @module core/utils\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n /**\n * Create a wrapper function to throttle the execution of the given\n * function to at most once every specified period.\n *\n * If the function is attempted to be executed while it's in cooldown\n * (during the wait period) then it'll immediately execute again as\n * soon as the cooldown is over.\n *\n * @method\n * @param {Function} func The function to throttle\n * @param {Number} wait The number of milliseconds to wait between executions\n * @return {Function}\n */\nexport const throttle = (func, wait) => {\n let onCooldown = false;\n let runAgain = null;\n const run = function(...args) {\n if (runAgain === null) {\n // This is the first time the function has been called.\n runAgain = false;\n } else {\n // This function has been called a second time during the wait period\n // so re-run it once the wait period is over.\n runAgain = true;\n }\n\n if (onCooldown) {\n // Function has already run for this wait period.\n return;\n }\n\n func.apply(this, args);\n onCooldown = true;\n\n setTimeout(() => {\n const recurse = runAgain;\n onCooldown = false;\n runAgain = null;\n\n if (recurse) {\n run(args);\n }\n }, wait);\n };\n\n return run;\n};\n\n/**\n * Create a wrapper function to debounce the execution of the given\n * function. Each attempt to execute the function will reset the cooldown\n * period.\n *\n * @method\n * @param {Function} func The function to debounce\n * @param {Number} wait The number of milliseconds to wait after the final attempt to execute\n * @return {Function}\n */\nexport const debounce = (func, wait) => {\n let timeout = null;\n return function(...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n func.apply(this, args);\n }, wait);\n };\n};\n"],"file":"utils.min.js"} \ No newline at end of file diff --git a/lib/amd/src/ajax.js b/lib/amd/src/ajax.js index eee1a143e03f3..761c686e18800 100644 --- a/lib/amd/src/ajax.js +++ b/lib/amd/src/ajax.js @@ -25,6 +25,14 @@ */ define(['jquery', 'core/config', 'core/log', 'core/url'], function($, config, Log, URL) { +/** + * A request to be performed. + * + * @typedef {object} request + * @property {string} methodname The remote method to be called + * @property {object} args The arguments to pass when fetching the remote content + */ + // Keeps track of when the user leaves the page so we know not to show an error. var unloading = false; @@ -123,23 +131,48 @@ define(['jquery', 'core/config', 'core/log', 'core/url'], function($, config, Lo * Make a series of ajax requests and return all the responses. * * @method call - * @param {Object[]} requests Array of requests with each containing methodname and args properties. + * @param {request[]} requests Array of requests with each containing methodname and args properties. * done and fail callbacks can be set for each element in the array, or the * can be attached to the promises returned by this function. - * @param {Boolean} async Optional, defaults to true. - * If false - this function will not return until the promises are resolved. - * @param {Boolean} loginrequired Optional, defaults to true. - * If false - this function will call the faster nologin ajax script - but - * will fail unless all functions have been marked as 'loginrequired' => false - * in services.php - * @param {Boolean} nosessionupdate Optional, defaults to false. - * If true, the timemodified for the session will not be updated. - * @param {Integer} timeout number of milliseconds to wait for a response. Defaults to no limit. - * @param {Integer} cachekey This is used in order to identify the request. If this id changes then we - * will be sending a different URL and any caching (eg. browser, proxy) knows that it - * should perform another request and not use the cache. Note - this variable is only - * used when we are calling 'service-nologin.php'. See MDL-65794. - * @return {Promise[]} Array of promises that will be resolved when the ajax call returns. + * @param {Boolean} [async=true] If false this function will not return until the promises are resolved. + * @param {Boolean} [loginrequired=true] When false this function calls an endpoint which does not use the + * session. + * Note: This may only be used with external functions which have been marked as + * `'loginrequired' => false` + * @param {Boolean} [nosessionupdate=false] If true, the timemodified for the session will not be updated. + * @param {Number} [timeout] number of milliseconds to wait for a response. Defaults to no limit. + * @param {Number} [cachekey] A cache key used to improve browser-side caching. + * Typically the same `cachekey` is used for all function calls. + * When the key changes, this causes the URL used to perform the fetch to change, which + * prevents the existing browser cache from being used. + * Note: This option is only availbale when `loginrequired` is `false`. + * See {@link https://tracker.moodle.org/browser/MDL-65794} for more information. + * @return {Promise[]} The Promises for each of the supplied requests. + * The order of the Promise matches the order of requests exactly. + * + * @example
+ * import {call as fetchMany} from 'core/ajax'; + * import * as Notification from 'core/notification'; + * + * export const performAction = (some, args) => { + * Promises.all(fetchMany('core_get_string', { + * stringid: 'do_not_copy', + * component: 'core', + * lang: 'en', + * stringparams: [], + * }, true, false, false, undefined, M.cfg.langrev)) + * .then(([doNotCopyString]) => { + * window.console.log(doNotCopyString); + * }) + * .catch(Notification.exception); + * }; + * + * @example + * + * import {call as fetchMany} from 'core/ajax'; + * + * export const fetchMessages = timeSince => fetchMany('core_message_get_messages', {timeSince}})[0]; + * export const fetchNotifications = timeSince => fetchMany('core_message_get_notifications', {timeSince}})[0]; */ call: function(requests, async, loginrequired, nosessionupdate, timeout, cachekey) { $(window).bind('beforeunload', function() { diff --git a/lib/amd/src/aria.js b/lib/amd/src/aria.js index 883dc593cc2a6..baa0c1a0d45a3 100644 --- a/lib/amd/src/aria.js +++ b/lib/amd/src/aria.js @@ -17,7 +17,6 @@ * Helpers to perform ARIA compliance changes to the DOM. * * @module core/aria - * @class aria * @copyright 2020 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib/amd/src/auto_rows.js b/lib/amd/src/auto_rows.js index 394c37dd36cbe..86e367664ff53 100644 --- a/lib/amd/src/auto_rows.js +++ b/lib/amd/src/auto_rows.js @@ -17,7 +17,6 @@ * Enhance a textarea with auto growing rows to fit the content. * * @module core/auto_rows - * @class auto_rows * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.2 diff --git a/lib/amd/src/autoscroll.js b/lib/amd/src/autoscroll.js index a1c887860ff97..4d5f084179dd7 100644 --- a/lib/amd/src/autoscroll.js +++ b/lib/amd/src/autoscroll.js @@ -22,7 +22,6 @@ * drag one thing at a time, this is not a problem in practice. * * @module core/autoscroll - * @class autoscroll * @copyright 2016 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.6 diff --git a/lib/amd/src/backoff_timer.js b/lib/amd/src/backoff_timer.js index 07e822cc48180..887ebf1106a9e 100644 --- a/lib/amd/src/backoff_timer.js +++ b/lib/amd/src/backoff_timer.js @@ -18,7 +18,6 @@ * doing polling on the server without overwhelming it with requests. * * @module core/backoff_timer - * @class backoff_timer * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -27,6 +26,7 @@ define(function() { /** * Constructor for the back off timer. * + * @class * @param {function} callback The function to execute after each tick * @param {function} backoffFunction The function to determine what the next timeout value should be */ @@ -62,7 +62,6 @@ define(function() { * The back off function is called to calculate the next value. * It is given the current value and an array of all previous values. * - * @method generateNextTime * @return {int} The new timeout value (in milliseconds) */ BackoffTimer.prototype.generateNextTime = function() { @@ -75,7 +74,6 @@ define(function() { /** * Stop the current timer and clear the previous time values * - * @method reset * @return {object} this */ BackoffTimer.prototype.reset = function() { @@ -88,7 +86,6 @@ define(function() { /** * Clear the current timeout, if one is set. * - * @method stop * @return {object} this */ BackoffTimer.prototype.stop = function() { @@ -109,7 +106,6 @@ define(function() { * * The callback function is called after each tick. * - * @method start * @return {object} this */ BackoffTimer.prototype.start = function() { @@ -132,7 +128,6 @@ define(function() { * Reset the timer and start it again from the initial timeout * values * - * @method restart * @return {object} this */ BackoffTimer.prototype.restart = function() { diff --git a/lib/amd/src/chart_axis.js b/lib/amd/src/chart_axis.js index 53a5057241a59..09dd497d52c8d 100644 --- a/lib/amd/src/chart_axis.js +++ b/lib/amd/src/chart_axis.js @@ -16,9 +16,9 @@ /** * Chart axis. * + * @module core/chart_axis * @copyright 2016 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @module core/chart_axis */ define([], function() { @@ -27,8 +27,7 @@ define([], function() { * * This is used to represent an axis, whether X or Y. * - * @alias module:core/chart_axis - * @class + * @class core/chart_axis */ function Axis() { // Please eslint no-empty-function. diff --git a/lib/amd/src/chart_bar.js b/lib/amd/src/chart_bar.js index ac3d8de055138..fc11a9a3f026f 100644 --- a/lib/amd/src/chart_bar.js +++ b/lib/amd/src/chart_bar.js @@ -25,7 +25,6 @@ define(['core/chart_base'], function(Base) { /** * Bar chart. * - * @alias module:core/chart_bar * @extends {module:core/chart_base} * @class */ diff --git a/lib/amd/src/chart_base.js b/lib/amd/src/chart_base.js index b33486e28273a..fa4000797b209 100644 --- a/lib/amd/src/chart_base.js +++ b/lib/amd/src/chart_base.js @@ -29,7 +29,6 @@ define(['core/chart_series', 'core/chart_axis'], function(Series, Axis) { * * {@link module:core/chart_base#_setDefault} to set the defaults on instantiation. * - * @alias module:core/chart_base * @class */ function Base() { diff --git a/lib/amd/src/chart_line.js b/lib/amd/src/chart_line.js index 185b0c33eca33..6967dabc6f6bf 100644 --- a/lib/amd/src/chart_line.js +++ b/lib/amd/src/chart_line.js @@ -25,7 +25,6 @@ define(['core/chart_base'], function(Base) { /** * Line chart. * - * @alias module:core/chart_line * @extends {module:core/chart_base} * @class */ diff --git a/lib/amd/src/chart_output_base.js b/lib/amd/src/chart_output_base.js index 25a809caff6f6..bebebfe7d0ce6 100644 --- a/lib/amd/src/chart_output_base.js +++ b/lib/amd/src/chart_output_base.js @@ -37,7 +37,6 @@ define(['jquery'], function($) { * two simultaneous output modules. * * @class - * @alias module:core/chart_output_base * @param {Node} node The node to output with/in. * @param {Chart} chart A chart object. */ diff --git a/lib/amd/src/chart_output_chartjs.js b/lib/amd/src/chart_output_chartjs.js index 84f44cc938fe5..64ad2112f4c38 100644 --- a/lib/amd/src/chart_output_chartjs.js +++ b/lib/amd/src/chart_output_chartjs.js @@ -46,7 +46,6 @@ define([ * Chart output for Chart.js. * * @class - * @alias module:core/chart_output_chartjs * @extends {module:core/chart_output_base} */ function Output() { diff --git a/lib/amd/src/chart_output_htmltable.js b/lib/amd/src/chart_output_htmltable.js index ca6c2b0f619a1..eb082e4252a07 100644 --- a/lib/amd/src/chart_output_htmltable.js +++ b/lib/amd/src/chart_output_htmltable.js @@ -30,7 +30,6 @@ define([ * * @class * @extends {module:core/chart_output_base} - * @alias module:core/chart_output_htmltable */ function Output() { Base.prototype.constructor.apply(this, arguments); diff --git a/lib/amd/src/chart_pie.js b/lib/amd/src/chart_pie.js index d5df4f3c7413a..dd68756556407 100644 --- a/lib/amd/src/chart_pie.js +++ b/lib/amd/src/chart_pie.js @@ -26,7 +26,6 @@ define(['core/chart_base'], function(Base) { * Pie chart. * * @class - * @alias module:core/chart_pie * @extends {module:core/chart_base} */ function Pie() { diff --git a/lib/amd/src/chart_series.js b/lib/amd/src/chart_series.js index 0444d3a414f1f..a048855c0c306 100644 --- a/lib/amd/src/chart_series.js +++ b/lib/amd/src/chart_series.js @@ -26,7 +26,6 @@ define([], function() { * Chart data series. * * @class - * @alias module:core/chart_series * @param {String} label The series label. * @param {Number[]} values The values. */ diff --git a/lib/amd/src/config.js b/lib/amd/src/config.js index 046cc3500174a..82084bfcab08c 100644 --- a/lib/amd/src/config.js +++ b/lib/amd/src/config.js @@ -17,13 +17,11 @@ * Expose the M.cfg global variable. * * @module core/config - * @class config * @copyright 2015 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 2.9 */ define(function() { - // This module exposes only the raw data from M.cfg; - return /** @alias module:core/config */ M.cfg; + return M.cfg; }); diff --git a/lib/amd/src/custom_interaction_events.js b/lib/amd/src/custom_interaction_events.js index 4288de96d3577..c5ae065f29a07 100644 --- a/lib/amd/src/custom_interaction_events.js +++ b/lib/amd/src/custom_interaction_events.js @@ -18,7 +18,6 @@ * user interaction we use in Moodle. * * @module core/custom_interaction_events - * @class custom_interaction_events * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.2 @@ -573,7 +572,7 @@ define(['jquery', 'core/key_codes'], function($, keyCodes) { }); }; - return /** @module core/custom_interaction_events */ { + return { define: define, events: events, }; diff --git a/lib/amd/src/dragdrop.js b/lib/amd/src/dragdrop.js index cf5531514a8d8..6e050ebd53aab 100644 --- a/lib/amd/src/dragdrop.js +++ b/lib/amd/src/dragdrop.js @@ -21,15 +21,11 @@ * can only drag one thing at a time, this is not a problem in practice. * * @module core/dragdrop - * @class dragdrop * @copyright 2016 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.6 */ define(['jquery', 'core/autoscroll'], function($, autoScroll) { - /** - * @alias module:core/dragdrop - */ var dragdrop = { /** * A boolean or options argument depending on whether browser supports passive events. diff --git a/lib/amd/src/emoji/auto_complete.js b/lib/amd/src/emoji/auto_complete.js index 5b4c003577df3..4fb407f1ced9f 100644 --- a/lib/amd/src/emoji/auto_complete.js +++ b/lib/amd/src/emoji/auto_complete.js @@ -16,6 +16,7 @@ /** * Emoji auto complete. * + * @module core/emoji/auto_complete * @copyright 2019 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -89,7 +90,7 @@ const getEmojiTextFromShortName = (shortName) => { * @param {Element} root The root container for the emoji auto complete * @param {Array} shortNames The list of short names for emoji suggestions to show */ -const render = async (root, shortNames) => { +const render = async(root, shortNames) => { const renderContext = { emojis: shortNames.map((shortName, index) => { return { @@ -233,6 +234,7 @@ const selectEmojiElement = (element, selectCallback) => { /** * Initialise the emoji auto complete. * + * @method * @param {Element} root The root container element for the auto complete * @param {Element} textArea The text area element to monitor for auto complete * @param {Function} hasSuggestionCallback Callback for when there are auto-complete suggestions @@ -323,4 +325,4 @@ export default (root, textArea, hasSuggestionCallback, selectCallback) => { selectEmojiElement(target, selectCallback); } }); -}; \ No newline at end of file +}; diff --git a/lib/amd/src/emoji/data.js b/lib/amd/src/emoji/data.js index 5cb1bbe90e081..aad55b3b84c8f 100644 --- a/lib/amd/src/emoji/data.js +++ b/lib/amd/src/emoji/data.js @@ -16,6 +16,7 @@ /** * Emoji data based on the data available from https://github.com/iamcal/emoji-data. * + * @module core/emoji/data * @copyright 2019 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib/amd/src/emoji/picker.js b/lib/amd/src/emoji/picker.js index e9dc85c057d69..2b489a136a5bf 100644 --- a/lib/amd/src/emoji/picker.js +++ b/lib/amd/src/emoji/picker.js @@ -16,13 +16,14 @@ /** * Emoji picker. * + * @module core/emoji/picker * @copyright 2019 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ import LocalStorage from 'core/localstorage'; import * as EmojiData from 'core/emoji/data'; import {throttle, debounce} from 'core/utils'; -import {get_string} from 'core/str'; +import {get_string as getString} from 'core/str'; import {render as renderTemplate} from 'core/templates'; const VISIBLE_ROW_COUNT = 10; @@ -48,6 +49,7 @@ const SELECTORS = { /** * Create the row data for a category. * + * @method * @param {String} categoryName The category name * @param {String} categoryDisplayName The category display name * @param {Array} emojis The emoji data @@ -80,6 +82,7 @@ const createRowDataForCategory = (categoryName, categoryDisplayName, emojis, tot /** * Add each row's index to it's value in the row data. * + * @method * @param {Array} rowData List of emoji row data * @return {Array} */ @@ -93,6 +96,7 @@ const addIndexesToRowData = (rowData) => { * Calculate the scroll position for the beginning of each category from * the row data. * + * @method * @param {Array} rowData List of emoji row data * @return {Object} */ @@ -108,11 +112,12 @@ const getCategoryScrollPositionsFromRowData = (rowData) => { /** * Create a header row element for the category name. * + * @method * @param {Number} rowIndex Index of the row in the row data * @param {String} name The category display name * @return {Element} */ -const createHeaderRow = async (rowIndex, name) => { +const createHeaderRow = async(rowIndex, name) => { const context = { index: rowIndex, text: name @@ -126,11 +131,12 @@ const createHeaderRow = async (rowIndex, name) => { /** * Create an emoji row element. * + * @method * @param {Number} rowIndex Index of the row in the row data * @param {Array} emojis The list of emoji data for the row * @return {Element} */ -const createEmojiRow = async (rowIndex, emojis) => { +const createEmojiRow = async(rowIndex, emojis) => { const context = { index: rowIndex, emojis: emojis.map(emojiData => { @@ -154,6 +160,7 @@ const createEmojiRow = async (rowIndex, emojis) => { /** * Check if the element is an emoji element. * + * @method * @param {Element} element Element to check * @return {Bool} */ @@ -163,6 +170,7 @@ const isEmojiElement = element => element.getAttribute('data-short-names') !== n * Search from an element and up through it's ancestors to fine the category * selector element and return it. * + * @method * @param {Element} element Element to begin searching from * @return {Element|null} */ @@ -185,6 +193,7 @@ const getCategorySelectorByCategoryName = (root, name) => { /** * Sets the given category selector element as active. * + * @method * @param {Element} root The root picker element * @param {Element} element The category selector element to make active */ @@ -203,6 +212,7 @@ const setCategorySelectorActive = (root, element) => { * Get the category selector element and the scroll positions for the previous and * next categories for the given scroll position. * + * @method * @param {Element} root The picker root element * @param {Number} position The position to get the category for * @param {Object} categoryScrollPositions Set of scroll positions for all categories @@ -262,6 +272,7 @@ const getCategoryByScrollPosition = (root, position, categoryScrollPositions) => /** * Get the list of recent emojis data from local storage. * + * @method * @return {Array} */ const getRecentEmojis = () => { @@ -272,6 +283,7 @@ const getRecentEmojis = () => { /** * Save the list of recent emojis in local storage. * + * @method * @param {Array} recentEmojis List of emoji data to save */ const saveRecentEmoji = (recentEmojis) => { @@ -286,6 +298,7 @@ const saveRecentEmoji = (recentEmojis) => { * The new set of recent emojis are saved in local storage and the full set of updated * row data and new emoji row count are returned. * + * @method * @param {Array} rowData The emoji rows data * @param {Number} recentEmojiRowCount Count of the recent emoji rows * @param {Object} newEmoji The emoji data for the emoji to add to the recent emoji list @@ -317,6 +330,7 @@ const addRecentEmoji = (rowData, recentEmojiRowCount, newEmoji) => { * buffer to amount to either side of the total number of requested rows so that * scrolling the emoji rows container is smooth. * + * @method * @param {Number} scrollPosition Scroll position within the emoji container * @param {Number} visibleRowCount How many rows should be visible * @param {Array} rowData The emoji rows data @@ -333,10 +347,11 @@ const getRowsToRender = (scrollPosition, visibleRowCount, rowData) => { /** * Create a row element from the row data. * + * @method * @param {Object} rowData The emoji row data * @return {Element} */ -const createRowElement = async (rowData) => { +const createRowElement = async(rowData) => { let row = null; if (rowData.type === ROW_TYPE.HEADER) { row = await createHeaderRow(rowData.index, rowData.data.displayName); @@ -355,6 +370,7 @@ const createRowElement = async (rowData) => { /** * Check if the given rows match. * + * @method * @param {Object} a The first row * @param {Object} b The second row * @return {Bool} @@ -394,11 +410,12 @@ const doRowsMatch = (a, b) => { * be visible and creates the newly visible row elements. Any rows that haven't * changed visibility will be left untouched. * + * @method * @param {Element} rowContainer The container element for the emoji rows * @param {Array} currentRows List of row data that matches the currently visible rows * @param {Array} nextRows List of row data containing the new list of rows to be made visible */ -const renderRows = async (rowContainer, currentRows, nextRows) => { +const renderRows = async(rowContainer, currentRows, nextRows) => { // We need to add any rows that are in nextRows but not in currentRows. const toAdd = nextRows.filter(nextRow => !currentRows.some(currentRow => doRowsMatch(currentRow, nextRow))); // Remember which rows will still be visible so that we can insert our element in the correct place in the DOM. @@ -448,6 +465,7 @@ const renderRows = async (rowContainer, currentRows, nextRows) => { * Build a function to render the visible emoji rows for a given scroll * position. * + * @method * @param {Element} rowContainer The container element for the emoji rows * @return {Function} */ @@ -456,7 +474,7 @@ const generateRenderRowsAtPositionFunction = (rowContainer) => { let nextRows = []; let rowCount = 0; let isRendering = false; - const renderNextRows = async () => { + const renderNextRows = async() => { if (!nextRows.length) { return; } @@ -491,6 +509,7 @@ const generateRenderRowsAtPositionFunction = (rowContainer) => { /** * Show the search results container and hide the emoji container. * + * @method * @param {Element} emojiContainer The emojis container * @param {Element} searchResultsContainer The search results container */ @@ -502,6 +521,7 @@ const showSearchResults = (emojiContainer, searchResultsContainer) => { /** * Hide the search result container and show the emojis container. * + * @method * @param {Element} emojiContainer The emojis container * @param {Element} searchResultsContainer The search results container * @param {Element} searchInput The search input @@ -515,6 +535,7 @@ const clearSearch = (emojiContainer, searchResultsContainer, searchInput) => { /** * Build function to handle mouse hovering an emoji. Shows the preview. * + * @method * @param {Element} emojiPreview The emoji preview element * @param {Element} emojiShortName The emoji short name element * @return {Function} @@ -532,6 +553,7 @@ const getHandleMouseEnter = (emojiPreview, emojiShortName) => { /** * Build function to handle mouse leaving an emoji. Removes the preview. * + * @method * @param {Element} emojiPreview The emoji preview element * @param {Element} emojiShortName The emoji short name element * @return {Function} @@ -552,6 +574,7 @@ const getHandleMouseLeave = (emojiPreview, emojiShortName) => { * The function currently handles clicking on the category selector or selecting * a specific emoji. * + * @method * @param {Number} recentEmojiRowCount Number of rows of recent emojis * @param {Element} emojiContainer Container element for the visible of emojis * @param {Element} searchResultsContainer Contaienr element for the search results @@ -624,6 +647,7 @@ const getHandleClick = ( * can avoid adding tends of thousands of elements to the DOM unnecessarily which * would bog down performance. * + * @method * @param {Element} root The picker root element * @param {Number} currentVisibleRowScrollPosition The current scroll position of the container * @param {Element} emojiContainer The emojis container element @@ -686,6 +710,7 @@ const getHandleScroll = ( /** * Build the function that handles search input from the user. * + * @method * @param {Element} searchInput The search input element * @param {Element} searchResultsContainer Container element to display the search results * @param {Element} emojiContainer Container element for the emoji rows @@ -697,7 +722,7 @@ const getHandleSearch = (searchInput, searchResultsContainer, emojiContainer) => const renderSearchResultsAtPosition = generateRenderRowsAtPositionFunction(rowContainer); searchResultsContainer.appendChild(rowContainer); - return async () => { + return async() => { const searchTerm = searchInput.value.toLowerCase(); if (searchTerm) { @@ -715,7 +740,7 @@ const getHandleSearch = (searchInput, searchResultsContainer, emojiContainer) => return carry; }, []); - const searchResultsString = await get_string('searchresults', 'core'); + const searchResultsString = await getString('searchresults', 'core'); const rowData = createRowDataForCategory(searchResultsString, searchResultsString, matchingEmojis, 0); // Show the emoji rows for the search results. renderSearchResultsAtPosition(0, rowData, rowData.length); @@ -729,6 +754,7 @@ const getHandleSearch = (searchInput, searchResultsContainer, emojiContainer) => /** * Register the emoji picker event listeners. * + * @method * @param {Element} root The picker root element * @param {Element} emojiContainer Root element containing the list of visible emojis * @param {Function} renderAtPosition Function to render the visible emojis at a given scroll position @@ -792,6 +818,7 @@ const registerEventListeners = ( /** * Initialise the emoji picker. * + * @method * @param {Element} root The root element for the picker * @param {Function} selectCallback Callback for when the user selects an emoji */ @@ -862,4 +889,4 @@ export default (root, selectCallback) => { rowData, recentEmojiRowCount ); -}; \ No newline at end of file +}; diff --git a/lib/amd/src/event_dispatcher.js b/lib/amd/src/event_dispatcher.js index 9da69e7246501..92667d3e9fdb2 100644 --- a/lib/amd/src/event_dispatcher.js +++ b/lib/amd/src/event_dispatcher.js @@ -13,7 +13,7 @@ // along with Moodle. If not, see . /** - * Event dispatcher used to dispatch Native JS CustomEvent objects. + * An Event dispatcher used to dispatch Native JS CustomEvent objects with custom default properties. * * @module core/event_dispatcher * @copyright 2021 Andrew Nicols @@ -25,21 +25,7 @@ * Dispatch an event as a CustomEvent on the specified container. * By default events are bubbled, and cancelable. * - * The eventName should typically by sourced using a constant, for example: - * - * // mod/example/amd/src/events.js - * - * import {dispatchEvent} from 'core/event_dispatcher'; - * - * export const eventTypes = { - * exampleDataDisplayed: 'mod_example/exampleDataDisplayed', - * }; - * - * export const notifyExampleDisplayed = someArgument => dispatchEvent(eventTypes.exampleDataDisplayed, { - * someArgument, - * }, document, { - * cancelable: false, - * }); + * The eventName should typically by sourced using a constant. See the supplied examples. * * Note: This function uses native events. Any additional details are passed to the function in event.detail. * @@ -54,6 +40,21 @@ * @param {Boolean} options.cancelable Whether preventDefault() can be called * @param {Boolean} options.composed Whether the event can bubble across the ShadowDOM bounadry * @returns {CustomEvent} + * + * @example + * // mod/example/amd/src/events.js + * + * import {dispatchEvent} from 'core/event_dispatcher'; + * + * export const eventTypes = { + * exampleDataDisplayed: 'mod_example/exampleDataDisplayed', + * }; + * + * export const notifyExampleDisplayed = someArgument => dispatchEvent(eventTypes.exampleDataDisplayed, { + * someArgument, + * }, document, { + * cancelable: false, + * }); */ export const dispatchEvent = ( eventName, diff --git a/lib/amd/src/form-autocomplete.js b/lib/amd/src/form-autocomplete.js index a198ef7c5e027..f234ffff29a3b 100644 --- a/lib/amd/src/form-autocomplete.js +++ b/lib/amd/src/form-autocomplete.js @@ -17,12 +17,10 @@ * Autocomplete wrapper for select2 library. * * @module core/form-autocomplete - * @class autocomplete * @copyright 2015 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.0 */ -/* globals require: false */ define( ['jquery', 'core/log', 'core/str', 'core/templates', 'core/notification', 'core/loadingicon', 'core/aria'], function($, log, str, templates, notification, LoadingIcon, Aria) { @@ -187,6 +185,7 @@ function($, log, str, templates, notification, LoadingIcon, Aria) { * * @param {Object} state * @param {Array} items + * @returns {Boolean} */ var hasItemListChanged = function(state, items) { if (state.items.length !== items.length) { @@ -1033,7 +1032,7 @@ function($, log, str, templates, notification, LoadingIcon, Aria) { return pendingPromise; }; - return /** @alias module:core/form-autocomplete */ { + return { // Public variables and functions. /** * Turn a boring select box into an auto-complete beast. diff --git a/lib/amd/src/form-cohort-selector.js b/lib/amd/src/form-cohort-selector.js index d61c70d321c72..23d98068be82d 100644 --- a/lib/amd/src/form-cohort-selector.js +++ b/lib/amd/src/form-cohort-selector.js @@ -17,14 +17,13 @@ * Course selector adaptor for auto-complete form element. * * @module core/form-cohort-selector - * @class form-cohort-selector * @copyright 2016 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 */ define(['core/ajax', 'jquery'], function(ajax, $) { - return /** @alias module:core/form-cohort-selector */ { + return { // Public variables and functions. processResults: function(selector, data) { // Mangle the results into an array of objects. diff --git a/lib/amd/src/form-course-selector.js b/lib/amd/src/form-course-selector.js index 2e9323b10a71a..1ea5f4f936864 100644 --- a/lib/amd/src/form-course-selector.js +++ b/lib/amd/src/form-course-selector.js @@ -17,14 +17,13 @@ * Course selector adaptor for auto-complete form element. * * @module core/form-course-selector - * @class form-course-selector * @copyright 2016 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 */ define(['core/ajax', 'jquery'], function(ajax, $) { - return /** @alias module:core/form-course-selector */ { + return { // Public variables and functions. processResults: function(selector, data) { // Mangle the results into an array of objects. diff --git a/lib/amd/src/fragment.js b/lib/amd/src/fragment.js index aa223adab43f9..837bdc2c6407f 100644 --- a/lib/amd/src/fragment.js +++ b/lib/amd/src/fragment.js @@ -17,7 +17,6 @@ * A way to call HTML fragments to be inserted as required via JavaScript. * * @module core/fragment - * @class fragment * @copyright 2016 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 @@ -93,7 +92,7 @@ define(['jquery', 'core/ajax'], function($, ajax) { return allScript; }; - return /** @alias module:core/fragment */{ + return { /** * Appends HTML and JavaScript fragments to specified nodes. * Callbacks called by this AMD module are responsible for doing the appropriate security checks diff --git a/lib/amd/src/fullscreen.js b/lib/amd/src/fullscreen.js index d37a860c20c96..2fcfef0959127 100644 --- a/lib/amd/src/fullscreen.js +++ b/lib/amd/src/fullscreen.js @@ -17,7 +17,6 @@ * Detects if an element is fullscreen. * * @module core/fullscreen - * @class fullscreen * @copyright 2020 University of Nottingham * @author Neill Magill * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -26,6 +25,7 @@ /** * Gets the element that is fullscreen or null if no element is fullscreen. * + * @method * @returns {HTMLElement} */ export const getElement = () => { diff --git a/lib/amd/src/icon_system.js b/lib/amd/src/icon_system.js index 9973810465757..902f9cccf9f9c 100644 --- a/lib/amd/src/icon_system.js +++ b/lib/amd/src/icon_system.js @@ -16,6 +16,7 @@ /** * Icon System base module. * + * @module core/icon_system * @copyright 2017 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -26,6 +27,8 @@ define(['jquery'], function($) { * Icon System abstract class. * * Any icon system needs to define a module extending this one and return this module name from the php icon_system class. + * + * @class core/icon_system */ var IconSystem = function() { }; diff --git a/lib/amd/src/icon_system_fontawesome.js b/lib/amd/src/icon_system_fontawesome.js index a374741feec7c..f148572c522b2 100644 --- a/lib/amd/src/icon_system_fontawesome.js +++ b/lib/amd/src/icon_system_fontawesome.js @@ -16,6 +16,7 @@ /** * Competency rule points module. * + * @module core/icon_system_fontawesome * @copyright 2017 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -28,6 +29,7 @@ define(['core/icon_system', 'jquery', 'core/ajax', 'core/mustache', 'core/locals /** * IconSystemFontawesome + * @class core/icon_system_fontawesome */ var IconSystemFontawesome = function() { IconSystem.apply(this, arguments); diff --git a/lib/amd/src/icon_system_standard.js b/lib/amd/src/icon_system_standard.js index 4163ac384c2a2..be2c7cf32f550 100644 --- a/lib/amd/src/icon_system_standard.js +++ b/lib/amd/src/icon_system_standard.js @@ -16,6 +16,7 @@ /** * Competency rule points module. * + * @module core/icon_system_standard * @copyright 2017 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,6 +26,8 @@ define(['core/icon_system', 'core/url', 'core/mustache'], /** * IconSystemStandard + * + * @class core/icon_system_standard */ var IconSystemStandard = function() { IconSystem.apply(this, arguments); @@ -34,12 +37,12 @@ define(['core/icon_system', 'core/url', 'core/mustache'], /** * Render an icon. * + * @method renderIcon * @param {String} key * @param {String} component * @param {String} title * @param {String} template * @return {String} - * @method renderIcon */ IconSystemStandard.prototype.renderIcon = function(key, component, title, template) { var url = CoreUrl.imageUrl(key, component); @@ -69,6 +72,5 @@ define(['core/icon_system', 'core/url', 'core/mustache'], return 'core/pix_icon'; }; - return /** @alias module:core/icon_system_standard */ IconSystemStandard; - + return IconSystemStandard; }); diff --git a/lib/amd/src/key_codes.js b/lib/amd/src/key_codes.js index 86afb261dcce4..01bf6c3497ac4 100644 --- a/lib/amd/src/key_codes.js +++ b/lib/amd/src/key_codes.js @@ -17,14 +17,16 @@ * A list of human readable names for the keycodes. * * @module core/key_codes - * @class key_codes * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.2 */ -define(function() { - return /** @alias module:core/key_codes */ { +define(function() { + /** + * @type {object} + */ + return { 'tab': 9, 'enter': 13, 'shift': 16, diff --git a/lib/amd/src/local/aria/aria-hidden.js b/lib/amd/src/local/aria/aria-hidden.js index 2a5aa79262afd..6dbc9d8ef8cc4 100644 --- a/lib/amd/src/local/aria/aria-hidden.js +++ b/lib/amd/src/local/aria/aria-hidden.js @@ -17,7 +17,6 @@ * ARIA helpers related to the aria-hidden attribute. * * @module core/local/aria/aria-hidden. - * @class aria * @copyright 2020 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -31,6 +30,7 @@ const siblingObserverMap = new Map(); /** * Determine whether the browser supports the MutationObserver system. * + * @method * @returns {Bool} */ const supportsMutationObservers = () => (MutationObserver && typeof MutationObserver === 'function'); @@ -38,6 +38,7 @@ const supportsMutationObservers = () => (MutationObserver && typeof MutationObse /** * Disable element focusability, disabling the tabindex for child elements which are normally focusable. * + * @method * @param {HTMLElement} target */ const disableElementFocusability = target => { @@ -57,6 +58,7 @@ const disableElementFocusability = target => { /** * Remove the current tab-index and store it for later restoration. * + * @method * @param {HTMLElement} element */ const disableAndStoreTabIndex = element => { @@ -78,6 +80,7 @@ const disableAndStoreTabIndex = element => { /** * Re-enable element focusability, restoring any tabindex. * + * @method * @param {HTMLElement} target */ const enableElementFocusability = target => { @@ -100,6 +103,7 @@ const enableElementFocusability = target => { * When disabling focusability the current tab-index is stored in the ariaHiddenTabIndex data attribute. * This is used to restore the tab-index, but only whilst the parent nodes remain unhidden. * + * @method * @param {HTMLElement} element */ const restoreTabIndex = element => { @@ -121,6 +125,7 @@ const restoreTabIndex = element => { /** * Update the supplied DOM Module to be hidden. * + * @method * @param {HTMLElement} target * @returns {Array} */ @@ -162,6 +167,7 @@ const _hide = target => { /** * Reverse the effect of the hide action. * + * @method * @param {HTMLElement} target * @returns {Array} */ @@ -189,6 +195,7 @@ const _unhide = target => { /** * Correctly mark all siblings of the supplied target Element as hidden. * + * @method * @param {HTMLElement} target * @returns {Array} */ @@ -235,6 +242,7 @@ const _hideSiblings = target => { /** * Correctly reverse the hide action of all children of the supplied target Element. * + * @method * @param {HTMLElement} target * @returns {Array} */ diff --git a/lib/amd/src/local/aria/focuslock.js b/lib/amd/src/local/aria/focuslock.js index 0dbeb8abce8b2..9b28ae9ccfe07 100644 --- a/lib/amd/src/local/aria/focuslock.js +++ b/lib/amd/src/local/aria/focuslock.js @@ -20,7 +20,6 @@ * https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/dialog.html * * @module core/tablock - * @class tablock * @copyright 2019 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -47,6 +46,7 @@ let isLocked = false; * This gives us a solution which supports focus locking of any kind, which loops in both directions, and which * prevents the lock from escaping the modal entirely. * + * @method * @param {Event} event The event from the focus change */ const lockHandler = event => { @@ -77,6 +77,7 @@ const lockHandler = event => { /** * Focus the first descendant of the current lock region. * + * @method * @returns {Bool} Whether a node was focused */ const focusFirstDescendant = () => { @@ -98,6 +99,7 @@ const focusFirstDescendant = () => { /** * Focus the last descendant of the current lock region. * + * @method * @returns {Bool} Whether a node was focused */ const focusLastDescendant = () => { @@ -122,6 +124,7 @@ const focusLastDescendant = () => { * * Note: This example is a wholesale copy of the WCAG example. * + * @method * @param {HTMLElement} focusTarget * @returns {Bool} */ @@ -153,6 +156,7 @@ const isFocusable = focusTarget => { * * Note: This example is a heavily inspired by the WCAG example. * + * @method * @param {HTMLElement} focusTarget * @returns {Bool} Whether focus was successful o rnot. */ @@ -180,6 +184,7 @@ const attemptFocus = focusTarget => { /** * Get the current lock region from the top of the stack. * + * @method * @returns {HTMLElement} */ const getCurrentLockRegion = () => { @@ -189,6 +194,7 @@ const getCurrentLockRegion = () => { /** * Add a new lock region to the stack. * + * @method * @param {HTMLElement} newLockRegion */ const addLockRegionToStack = newLockRegion => { @@ -220,6 +226,8 @@ const addLockRegionToStack = newLockRegion => { /** * Remove the top lock region from the stack. + * + * @method */ const removeLastLockRegionFromStack = () => { // Take the top element off the stack, and replce the current lockRegion value. @@ -250,6 +258,7 @@ const hasTrappedRegionsInStack = () => { /** * Start trapping the focus and lock it to the specified newLockRegion. * + * @method * @param {HTMLElement} newLockRegion The container to lock focus to */ export const trapFocus = newLockRegion => { @@ -283,6 +292,8 @@ export const trapFocus = newLockRegion => { /** * Stop trapping the focus. + * + * @method */ export const untrapFocus = () => { // Remove the top region from the stack. diff --git a/lib/amd/src/local/aria/selectors.js b/lib/amd/src/local/aria/selectors.js index af952f3ef64b5..d7d31b34ad124 100644 --- a/lib/amd/src/local/aria/selectors.js +++ b/lib/amd/src/local/aria/selectors.js @@ -17,7 +17,6 @@ * Selectors used for ARIA. * * @module core/local/aria/selectors - * @class selectors * @copyright 2020 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib/amd/src/local/modal/alert.js b/lib/amd/src/local/modal/alert.js index fecba1447f457..22d73fca051a1 100644 --- a/lib/amd/src/local/modal/alert.js +++ b/lib/amd/src/local/modal/alert.js @@ -17,13 +17,18 @@ * Alert modal. * * @module core/modal_alert - * @class modal_alert * @copyright 2020 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ import Modal from 'core/modal'; +/** + * The Alert Modal + * + * @class + * @extends Modal + */ export default class extends Modal { /** * Register all event listeners. diff --git a/lib/amd/src/modal.js b/lib/amd/src/modal.js index d9006de24d019..f106e81a67224 100644 --- a/lib/amd/src/modal.js +++ b/lib/amd/src/modal.js @@ -16,7 +16,8 @@ /** * Contain the logic for modals. * - * @module core/modal + * @module core/modal + * @class core/modal * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib/amd/src/modal_backdrop.js b/lib/amd/src/modal_backdrop.js index 688583c0ab5aa..6da66ca561560 100644 --- a/lib/amd/src/modal_backdrop.js +++ b/lib/amd/src/modal_backdrop.js @@ -17,7 +17,6 @@ * Contain the logic for modal backdrops. * * @module core/modal_backdrop - * @class modal_backdrop * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -31,6 +30,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/fullscreen'], /** * Constructor for ModalBackdrop. * + * @class core/modal_backdrop * @param {object} root The root element for the modal backdrop */ var ModalBackdrop = function(root) { diff --git a/lib/amd/src/modal_cancel.js b/lib/amd/src/modal_cancel.js index ce23600d30bdb..9874aaa5533e6 100644 --- a/lib/amd/src/modal_cancel.js +++ b/lib/amd/src/modal_cancel.js @@ -17,12 +17,15 @@ * Contain the logic for the cancel modal. * * @module core/modal_cancel - * @class modal_cancel * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ import Modal from 'core/modal'; +/** + * @class + * @extends module:core/modal + */ export default class extends Modal { constructor(root) { super(root); diff --git a/lib/amd/src/modal_save_cancel.js b/lib/amd/src/modal_save_cancel.js index 71d254d98359b..52d70c08658bc 100644 --- a/lib/amd/src/modal_save_cancel.js +++ b/lib/amd/src/modal_save_cancel.js @@ -17,12 +17,17 @@ * Contain the logic for the save/cancel modal. * * @module core/modal_save_cancel - * @class modal_save_cancel * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ import Modal from 'core/modal'; +/** + * The Save/Cancel Modal. + * + * @class + * @extends module:core/modal + */ export default class extends Modal { constructor(root) { super(root); diff --git a/lib/amd/src/normalise.js b/lib/amd/src/normalise.js index 1016080f938cf..c55d82f47efe5 100644 --- a/lib/amd/src/normalise.js +++ b/lib/amd/src/normalise.js @@ -17,13 +17,19 @@ * Normalisation helpers. * * @module core/normalise - * @class normalise * @copyright 2020 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ import jQuery from 'jquery'; +/** + * Normalise a list of Nodes into an Array of Nodes. + * + * @method getList + * @param {(Array|jQuery|NodeList|HTMLElement)} nodes + * @returns {HTMLElement[]} + */ export const getList = nodes => { if (nodes instanceof HTMLElement) { // A single record to conver to a NodeList. diff --git a/lib/amd/src/permissionmanager.js b/lib/amd/src/permissionmanager.js index 2a57cc64621ef..35193da01cf48 100644 --- a/lib/amd/src/permissionmanager.js +++ b/lib/amd/src/permissionmanager.js @@ -12,15 +12,15 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -/* - * @class permissionmanager + +/** * @copyright 2015 Martin Mastny * @since 3.0 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** - * @module admin/permissionmanager + * @module core/permissionmanager */ define(['jquery', 'core/config', 'core/notification', 'core/templates', 'core/yui'], function($, config, notification, templates, Y) { diff --git a/lib/amd/src/popover_region_controller.js b/lib/amd/src/popover_region_controller.js index d9b790f0b3f0f..b758f97ed8c8d 100644 --- a/lib/amd/src/popover_region_controller.js +++ b/lib/amd/src/popover_region_controller.js @@ -19,7 +19,6 @@ * See template: core/popover_region * * @module core/popover_region_controller - * @class popover_region_controller * @copyright 2015 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.2 diff --git a/lib/amd/src/prefetch.js b/lib/amd/src/prefetch.js index 4e79b1b63960e..84b5050b75a2d 100644 --- a/lib/amd/src/prefetch.js +++ b/lib/amd/src/prefetch.js @@ -17,9 +17,49 @@ * Prefetch module to help lazily load content for use on the current page. * * @module core/prefetch - * @class prefetch * @copyright 2020 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * + * @example + * + * import prefetch from 'core/prefetch'; + * + * // A single string prefetch. + * prefetch.prefetchString('error', 'cannotfindteacher'); + * + * // Prefetch multiple strings in the same component. + * prefetch.prefetchStrings('core', [ + * 'yes', + * 'no', + * ]); + * + * // Use the strings. + * import {get_string as getString, get_strings as getStrings} from 'core/str'; + * getString('cannotfindteacher', 'error') + * .then(str => { + * window.console.log(str); // Cannot find teacher + * }) + * .catch(); + * getStrings([ + * { + * key: 'cannotfindteacher', + * component: 'error', + * }, + * { + * key: 'yes', + * component: 'core', + * }, + * { + * key: 'no', + * component: 'core', + * }, + * ]) + * .then((cannotFindTeacher, yes, no) => { + * window.console.log(cannotFindTeacher); // Cannot find teacher + * window.console.log(yes); // Yes + * window.console.log(no); // No + * }) + * .catch(); */ import Config from 'core/config'; @@ -38,6 +78,7 @@ let prefetchTimer; * Fetch all queued items in the queue. * * Should only be called via processQueue. + * @private */ const fetchQueue = () => { // Prefetch templates. @@ -72,6 +113,8 @@ const fetchQueue = () => { * * The initial call will queue the first fetch after a delay. * Subsequent fetches are immediate. + * + * @private */ const processQueue = () => { if (prefetchTimer) { @@ -113,7 +156,8 @@ const processQueue = () => { /** * Add a set of templates to the prefetch queue. * - * @param {Array} templatesNames + * @param {Array} templatesNames A list of the template names to fetch + * @static */ const prefetchTemplates = templatesNames => { templateList = templateList.concat(templatesNames); @@ -124,16 +168,19 @@ const prefetchTemplates = templatesNames => { /** * Add a single template to the prefetch queue. * - * @param {String} templateName - * @returns {undefined} + * @param {String} templateName The template names to fetch + * @static */ -const prefetchTemplate = templateName => prefetchTemplates([templateName]); +const prefetchTemplate = templateName => { + prefetchTemplates([templateName]); +}; /** * Add a set of strings from the same component to the prefetch queue. * - * @param {String} component - * @param {String[]} keys + * @param {String} component The component that all of the strings belongs to + * @param {String[]} keys An array of string identifiers. + * @static */ const prefetchStrings = (component, keys) => { if (!stringList[component]) { @@ -148,8 +195,9 @@ const prefetchStrings = (component, keys) => { /** * Add a single string to the prefetch queue. * - * @param {String} component - * @param {String} key + * @param {String} component The component that the string belongs to + * @param {String} key The string identifier + * @static */ const prefetchString = (component, key) => { if (!stringList[component]) { diff --git a/lib/amd/src/sortable_list.js b/lib/amd/src/sortable_list.js index 3f7e46331e164..ba00d60fcb860 100644 --- a/lib/amd/src/sortable_list.js +++ b/lib/amd/src/sortable_list.js @@ -18,7 +18,7 @@ * * Example of usage: * - * Create a list (for example
    or
) where each draggable element has a drag handle. + * Create a list (for example `
    ` or `
`) where each draggable element has a drag handle. * The best practice is to use the template core/drag_handle: * $OUTPUT->render_from_template('core/drag_handle', ['movetitle' => get_string('movecontent', 'moodle', ELEMENTNAME)]); * @@ -27,6 +27,18 @@ * Space between define and ( critical in comment but not allowed in code in order to function * correctly with Moodle's requirejs.php * + * More details: https://docs.moodle.org/dev/Sortable_list + * + * For the full list of possible parameters see var defaultParameters below. + * + * The following jQuery events are fired: + * - SortableList.EVENTS.DRAGSTART : when user started dragging a list element + * - SortableList.EVENTS.DRAG : when user dragged a list element to a new position + * - SortableList.EVENTS.DROP : when user dropped a list element + * - SortableList.EVENTS.DROPEND : when user finished dragging - either fired right after dropping or + * if "Esc" was pressed during dragging + * + * @example * define (['jquery', 'core/sortable_list'], function($, SortableList) { * var list = new SortableList('ul.my-awesome-list'); // source list (usually
    or
) - selector or element * @@ -39,21 +51,10 @@ * list.getElementName = function(element) { * return $.Deferred().resolve(element.attr('data-name')); * } - * } - * - * More details: https://docs.moodle.org/dev/Sortable_list - * - * For the full list of possible parameters see var defaultParameters below. - * - * The following jQuery events are fired: - * - SortableList.EVENTS.DRAGSTART : when user started dragging a list element - * - SortableList.EVENTS.DRAG : when user dragged a list element to a new position - * - SortableList.EVENTS.DROP : when user dropped a list element - * - SortableList.EVENTS.DROPEND : when user finished dragging - either fired right after dropping or - * if "Esc" was pressed during dragging + * }); * * @module core/sortable_list - * @class sortable_list + * @class core/sortable_list * @copyright 2018 Marina Glancy * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib/amd/src/str.js b/lib/amd/src/str.js index a9b4c5c1d6278..ea75611d899fe 100644 --- a/lib/amd/src/str.js +++ b/lib/amd/src/str.js @@ -14,14 +14,13 @@ // along with Moodle. If not, see . /** - * Fetch and render language strings. - * Hooks into the old M.str global - but can also fetch missing strings on the fly. + * Fetch and return language strings. * * @module core/str - * @class str * @copyright 2015 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 2.9 + * */ import $ from 'jquery'; import Ajax from 'core/ajax'; @@ -31,8 +30,13 @@ import LocalStorage from 'core/localstorage'; // unnecessary requests. let promiseCache = []; +/* eslint-disable no-restricted-properties */ + /** - * Return a promise object that will be resolved into a string eventually (maybe immediately). + * Return a Promise that resolves to a string. + * + * If the string has previously been cached, then the Promise will be resolved immediately, otherwise it will be fetched + * from the server and resolved when available. * * @method get_string * @param {string} key The language string key @@ -40,20 +44,61 @@ let promiseCache = []; * @param {string} param The param for variable expansion in the string. * @param {string} lang The users language - if not passed it is deduced. * @return {Promise} + * + * @example + * + * import {get_string as getString} from 'core/str'; + * get_string('cannotfindteacher', 'error') + * .then(str => { + * window.console.log(str); // Cannot find teacher + * }) + * .catch(); */ +// eslint-disable-next-line camelcase export const get_string = (key, component, param, lang) => { return get_strings([{key, component, param, lang}]) .then(results => results[0]); }; /** - * Make a batch request to load a set of strings + * Make a batch request to load a set of strings. + * + * Any missing string will be fetched from the server. + * The Promise will only be resolved once all strings are available, or an attempt has been made to fetch them. * * @method get_strings - * @param {Object[]} requests Array of { key: key, component: component, param: param, lang: lang }; - * See get_string for more info on these args. - * @return {Promise} + * @param {Object[]} requests List of strings to fetch + * @param {string} requests.key The string identifer to fetch + * @param {string} [requests.component='core'] The componet to fetch from + * @param {string} [requests.lang] The language to fetch a string for. Defaults to current page language. + * @param {object|string} [requests.param] The param for variable expansion in the string. + * @return {Promise[]} + * + * @example + * + * import {get_strings as getStrings} from 'core/str'; + * get_strings([ + * { + * key: 'cannotfindteacher', + * component: 'error', + * }, + * { + * key: 'yes', + * component: 'core', + * }, + * { + * key: 'no', + * component: 'core', + * }, + * ]) + * .then((cannotFindTeacher, yes, no) => { + * window.console.log(cannotFindTeacher); // Cannot find teacher + * window.console.log(yes); // Yes + * window.console.log(no); // No + * }) + * .catch(); */ +// eslint-disable-next-line camelcase export const get_strings = (requests) => { let requestData = []; const pageLang = $('html').attr('lang').replace(/-/g, '_'); @@ -137,9 +182,17 @@ export const get_strings = (requests) => { /** * Add a list of strings to the caches. * + * This function should typically only be called from core APIs to pre-cache values. + * * @method cache_strings - * @param {Object[]} strings Array of { key: key, component: component, lang: lang, value: value } + * @protected + * @param {Object[]} strings List of strings to fetch + * @param {string} strings.key The string identifer to fetch + * @param {string} strings.value The string value + * @param {string} [strings.component='core'] The componet to fetch from + * @param {string} [strings.lang] The language to fetch a string for. Defaults to current page language. */ +// eslint-disable-next-line camelcase export const cache_strings = (strings) => { const defaultLang = $('html').attr('lang').replace(/-/g, '_'); @@ -166,3 +219,4 @@ export const cache_strings = (strings) => { } }); }; +/* eslint-enable no-restricted-properties */ diff --git a/lib/amd/src/toast.js b/lib/amd/src/toast.js index bba97b6a2aad5..0f7106977f7d3 100644 --- a/lib/amd/src/toast.js +++ b/lib/amd/src/toast.js @@ -27,7 +27,8 @@ import Pending from 'core/pending'; /** * Add a new region to place toasts in, taking in a parent element. * - * @param {Element} parent + * @method + * @param {HTMLElement} parent */ export const addToastRegion = async(parent) => { const pendingPromise = new Pending('addToastRegion'); @@ -45,6 +46,7 @@ export const addToastRegion = async(parent) => { /** * Add a new toast or snackbar notification to the page. * + * @method * @param {String} message * @param {Object} configuration * @param {String} [configuration.title] @@ -53,6 +55,21 @@ export const addToastRegion = async(parent) => { * @param {Boolean} [configuration.autohide=true] * @param {Boolean} [configuration.closeButton=false] * @param {Number} [configuration.delay=4000] + * + * @example + * import {add as addToast} from 'core/toast'; + * import {get_string as getString} from 'core/str'; + * + * getString('example', 'mod_myexample') + * .then(str => { + * addToast(str, { + * type: 'warning', + * autohide: false, + * closeButton: true, + * }); + * return; + * }) + * .catch(); */ export const add = async(message, configuration) => { const pendingPromise = new Pending('addToastRegion'); diff --git a/lib/amd/src/truncate.js b/lib/amd/src/truncate.js index 9373d1341c03a..b9bd6e8b02453 100644 --- a/lib/amd/src/truncate.js +++ b/lib/amd/src/truncate.js @@ -28,7 +28,6 @@ * See: https://github.com/pathable/truncate * * @module core/truncate - * @class truncate * @copyright 2017 Pathable * 2017 Mathias Bynens * 2017 Ryan Wyllie diff --git a/lib/amd/src/url.js b/lib/amd/src/url.js index fb7344b9a0890..47929eed9a571 100644 --- a/lib/amd/src/url.js +++ b/lib/amd/src/url.js @@ -17,7 +17,6 @@ * URL utility functions. * * @module core/url - * @class url * @copyright 2015 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 2.9 diff --git a/lib/amd/src/utils.js b/lib/amd/src/utils.js index 933e99fb413e9..bae507aa8e511 100644 --- a/lib/amd/src/utils.js +++ b/lib/amd/src/utils.js @@ -16,22 +16,24 @@ /** * Utility functions. * + * @module core/utils * @copyright 2019 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** - * Create a wrapper function to throttle the execution of the given - * function to at most once every specified period. - * - * If the function is attempted to be executed while it's in cooldown - * (during the wait period) then it'll immediately execute again as - * soon as the cooldown is over. - * - * @param {Function} func The function to throttle - * @param {Number} wait The number of milliseconds to wait between executions - * @return {Function} - */ + * Create a wrapper function to throttle the execution of the given + * function to at most once every specified period. + * + * If the function is attempted to be executed while it's in cooldown + * (during the wait period) then it'll immediately execute again as + * soon as the cooldown is over. + * + * @method + * @param {Function} func The function to throttle + * @param {Number} wait The number of milliseconds to wait between executions + * @return {Function} + */ export const throttle = (func, wait) => { let onCooldown = false; let runAgain = null; @@ -68,14 +70,15 @@ export const throttle = (func, wait) => { }; /** - * Create a wrapper function to debounce the execution of the given - * function. Each attempt to execute the function will reset the cooldown - * period. - * - * @param {Function} func The function to debounce - * @param {Number} wait The number of milliseconds to wait after the final attempt to execute - * @return {Function} - */ + * Create a wrapper function to debounce the execution of the given + * function. Each attempt to execute the function will reset the cooldown + * period. + * + * @method + * @param {Function} func The function to debounce + * @param {Number} wait The number of milliseconds to wait after the final attempt to execute + * @return {Function} + */ export const debounce = (func, wait) => { let timeout = null; return function(...args) { diff --git a/lib/form/amd/build/defaultcustom.min.js.map b/lib/form/amd/build/defaultcustom.min.js.map index 1be9a098e5a9d..706fd5bc8652e 100644 --- a/lib/form/amd/build/defaultcustom.min.js.map +++ b/lib/form/amd/build/defaultcustom.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/defaultcustom.js"],"names":["define","$","on","onChangeSelect","event","element","target","defaultvalue","JSON","parse","attr","customvalue","type","form","closest","elementName","replace","newvalue","prop","find","val","day","month","year","hour","minute"],"mappings":"AAwBAA,OAAM,2BAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CA0B3BA,CAAC,CAAC,MAAD,CAAD,CAAUC,EAAV,CAAa,QAAb,CADe,gCACf,CAzBqB,QAAjBC,CAAAA,cAAiB,CAASC,CAAT,CAAgB,CACjC,GAAIC,CAAAA,CAAO,CAAGJ,CAAC,CAACG,CAAK,CAACE,MAAP,CAAf,CACIC,CAAY,CAAGC,IAAI,CAACC,KAAL,CAAWJ,CAAO,CAACK,IAAR,CAAa,mBAAb,CAAX,CADnB,CAEIC,CAAW,CAAGH,IAAI,CAACC,KAAL,CAAWJ,CAAO,CAACK,IAAR,CAAa,kBAAb,CAAX,CAFlB,CAGIE,CAAI,CAAGP,CAAO,CAACK,IAAR,CAAa,WAAb,CAHX,CAIIG,CAAI,CAAGR,CAAO,CAACS,OAAR,CAAgB,MAAhB,CAJX,CAKIC,CAAW,CAAGV,CAAO,CAACK,IAAR,CAAa,MAAb,EAAqBM,OAArB,CAA6B,gBAA7B,CAA+C,SAA/C,CALlB,CAMIC,CAAQ,CAAGZ,CAAO,CAACa,IAAR,CAAa,SAAb,EAA0BP,CAA1B,CAAwCJ,CANvD,CAQA,GAAa,MAAT,GAAAK,CAAJ,CAAqB,CACjBC,CAAI,CAACM,IAAL,CAAU,WAAYJ,CAAZ,CAA0B,KAApC,EAA0CK,GAA1C,CAA8CH,CAA9C,CACH,CAFD,IAEO,IAAa,eAAT,GAAAL,CAAJ,CAA8B,CACjCC,CAAI,CAACM,IAAL,CAAU,WAAYJ,CAAZ,CAA0B,UAApC,EAA+CK,GAA/C,CAAmDH,CAAQ,CAACI,GAA5D,EACAR,CAAI,CAACM,IAAL,CAAU,WAAYJ,CAAZ,CAA0B,YAApC,EAAiDK,GAAjD,CAAqDH,CAAQ,CAACK,KAA9D,EACAT,CAAI,CAACM,IAAL,CAAU,WAAYJ,CAAZ,CAA0B,WAApC,EAAgDK,GAAhD,CAAoDH,CAAQ,CAACM,IAA7D,CACH,CAJM,IAIA,IAAa,oBAAT,GAAAX,CAAJ,CAAmC,CACtCC,CAAI,CAACM,IAAL,CAAU,WAAYJ,CAAZ,CAA0B,UAApC,EAA+CK,GAA/C,CAAmDH,CAAQ,CAACI,GAA5D,EACAR,CAAI,CAACM,IAAL,CAAU,WAAYJ,CAAZ,CAA0B,YAApC,EAAiDK,GAAjD,CAAqDH,CAAQ,CAACK,KAA9D,EACAT,CAAI,CAACM,IAAL,CAAU,WAAYJ,CAAZ,CAA0B,WAApC,EAAgDK,GAAhD,CAAoDH,CAAQ,CAACM,IAA7D,EACAV,CAAI,CAACM,IAAL,CAAU,WAAYJ,CAAZ,CAA0B,WAApC,EAAgDK,GAAhD,CAAoDH,CAAQ,CAACO,IAA7D,EACAX,CAAI,CAACM,IAAL,CAAU,WAAYJ,CAAZ,CAA0B,aAApC,EAAkDK,GAAlD,CAAsDH,CAAQ,CAACQ,MAA/D,CACH,CACJ,CAGD,CACH,CA3BK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Functionality for the form element defaultcustom\n *\n * @module core_form/defaultcustom\n * @class defaultcustom\n * @copyright 2017 Marina Glancy\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.3\n */\ndefine(['jquery'], function($) {\n var onChangeSelect = function(event) {\n var element = $(event.target),\n defaultvalue = JSON.parse(element.attr('data-defaultvalue')),\n customvalue = JSON.parse(element.attr('data-customvalue')),\n type = element.attr('data-type'),\n form = element.closest('form'),\n elementName = element.attr('name').replace(/\\[customize\\]$/, '[value]'),\n newvalue = element.prop('checked') ? customvalue : defaultvalue;\n\n if (type === 'text') {\n form.find('[name=\"' + elementName + '\"]').val(newvalue);\n } else if (type === 'date_selector') {\n form.find('[name=\"' + elementName + '[day]\"]').val(newvalue.day);\n form.find('[name=\"' + elementName + '[month]\"]').val(newvalue.month);\n form.find('[name=\"' + elementName + '[year]\"]').val(newvalue.year);\n } else if (type === 'date_time_selector') {\n form.find('[name=\"' + elementName + '[day]\"]').val(newvalue.day);\n form.find('[name=\"' + elementName + '[month]\"]').val(newvalue.month);\n form.find('[name=\"' + elementName + '[year]\"]').val(newvalue.year);\n form.find('[name=\"' + elementName + '[hour]\"]').val(newvalue.hour);\n form.find('[name=\"' + elementName + '[minute]\"]').val(newvalue.minute);\n }\n };\n\n var selector = 'input[data-defaultcustom=true]';\n $('body').on('change', selector, onChangeSelect);\n});\n"],"file":"defaultcustom.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/defaultcustom.js"],"names":["define","$","on","onChangeSelect","event","element","target","defaultvalue","JSON","parse","attr","customvalue","type","form","closest","elementName","replace","newvalue","prop","find","val","day","month","year","hour","minute"],"mappings":"AAuBAA,OAAM,2BAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CA0B3BA,CAAC,CAAC,MAAD,CAAD,CAAUC,EAAV,CAAa,QAAb,CADe,gCACf,CAzBqB,QAAjBC,CAAAA,cAAiB,CAASC,CAAT,CAAgB,CACjC,GAAIC,CAAAA,CAAO,CAAGJ,CAAC,CAACG,CAAK,CAACE,MAAP,CAAf,CAC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EACAT,CAAI,CAACM,IAAL,CAAU,WAAYJ,CAAZ,CAA0B,WAApC,EAAgDK,GAAhD,CAAoDH,CAAQ,CAACM,IAA7D,EACAV,CAAI,CAACM,IAAL,CAAU,WAAYJ,CAAZ,CAA0B,WAApC,EAAgDK,GAAhD,CAAoDH,CAAQ,CAACO,IAA7D,EACAX,CAAI,CAACM,IAAL,CAAU,WAAYJ,CAAZ,CAA0B,aAApC,EAAkDK,GAAlD,CAAsDH,CAAQ,CAACQ,MAA/D,CACH,CACJ,CAGD,CACH,CA3BK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Functionality for the form element defaultcustom\n *\n * @module core_form/defaultcustom\n * @copyright 2017 Marina Glancy\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.3\n */\ndefine(['jquery'], function($) {\n var onChangeSelect = function(event) {\n var element = $(event.target),\n defaultvalue = JSON.parse(element.attr('data-defaultvalue')),\n customvalue = JSON.parse(element.attr('data-customvalue')),\n type = element.attr('data-type'),\n form = element.closest('form'),\n elementName = element.attr('name').replace(/\\[customize\\]$/, '[value]'),\n newvalue = element.prop('checked') ? customvalue : defaultvalue;\n\n if (type === 'text') {\n form.find('[name=\"' + elementName + '\"]').val(newvalue);\n } else if (type === 'date_selector') {\n form.find('[name=\"' + elementName + '[day]\"]').val(newvalue.day);\n form.find('[name=\"' + elementName + '[month]\"]').val(newvalue.month);\n form.find('[name=\"' + elementName + '[year]\"]').val(newvalue.year);\n } else if (type === 'date_time_selector') {\n form.find('[name=\"' + elementName + '[day]\"]').val(newvalue.day);\n form.find('[name=\"' + elementName + '[month]\"]').val(newvalue.month);\n form.find('[name=\"' + elementName + '[year]\"]').val(newvalue.year);\n form.find('[name=\"' + elementName + '[hour]\"]').val(newvalue.hour);\n form.find('[name=\"' + elementName + '[minute]\"]').val(newvalue.minute);\n }\n };\n\n var selector = 'input[data-defaultcustom=true]';\n $('body').on('change', selector, onChangeSelect);\n});\n"],"file":"defaultcustom.min.js"} \ No newline at end of file diff --git a/lib/form/amd/build/dynamicform.min.js.map b/lib/form/amd/build/dynamicform.min.js.map index c7f4241dd20c3..e5cd9d95f78f7 100644 --- a/lib/form/amd/build/dynamicform.min.js.map +++ b/lib/form/amd/build/dynamicform.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/dynamicform.js"],"names":["DynamicForm","container","formClass","FORM_SUBMITTED","FORM_CANCELLED","CLIENT_VALIDATION_ERROR","SERVER_VALIDATION_ERROR","ERROR","NOSUBMIT_BUTTON_PRESSED","SUBMIT_BUTTON_PRESSED","CANCEL_BUTTON_PRESSED","key","component","catch","Notification","exception","addEventListener","e","target","matches","preventDefault","event","trigger","events","defaultPrevented","processCancelButton","processNoSubmitButton","submitFormAjax","args","formData","URLSearchParams","Object","entries","pendingPromise","Pending","getBody","toString","then","resp","updateForm","resolve","eventName","detail","cancelable","CustomEvent","dispatchEvent","formDataString","Ajax","call","methodname","formdata","form","response","html","js","Fragment","processCollectedJavascript","javascript","innerHTML","button","getFormNode","FormData","append","getAttribute","FormEvents","notifyFormSubmittedByJavascript","disableButtons","onSubmitError","querySelector","Promise","Y","use","M","core_formchangechecker","reset_form_dirty_state","notifyResetFormChanges","Templates","replaceNodeContents","invalid","querySelectorAll","length","focus","forEach","el","setAttribute","removeAttribute","validateElements","submitted","enableButtons","data","JSON","parse","onSubmitSuccess"],"mappings":"mjBAoCA,OACA,OACA,OACA,OACA,OACA,OACA,O,8kEAGqBA,CAAAA,C,YA2CjB,WAAYC,CAAZ,CAAuBC,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H,CACD,MAAO,KACV,CAtBD,EAuBCA,KAvBD,CAuBO,KAAKsD,aAvBZ,E","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Display an embedded form, it is only loaded and reloaded inside its container\n *\n * Example:\n * import DynamicForm from 'core_form/dynamicform';\n *\n * const dynamicForm = new DynamicForm(document.querySelector('#mycontainer', 'pluginname\\\\form\\\\formname');\n * dynamicForm.addEventListener(dynamicForm.events.FORM_SUBMITTED, e => {\n * e.preventDefault();\n * window.console.log(e.detail);\n * dynamicForm.container.innerHTML = 'Thank you, your form is submitted!';\n * });\n * dynamicForm.load();\n *\n * See also https://docs.moodle.org/dev/Modal_and_AJAX_forms\n *\n * @module core_form/dynamicform\n * @copyright 2019 Marina Glancy\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Ajax from 'core/ajax';\nimport * as FormEvents from 'core_form/events';\nimport Fragment from 'core/fragment';\nimport Notification from 'core/notification';\nimport Pending from 'core/pending';\nimport Templates from 'core/templates';\nimport Y from 'core/yui';\nimport {get_strings as getStrings} from 'core/str';\n\nexport default class DynamicForm {\n\n /**\n * Various events that can be observed.\n *\n * @type {Object}\n */\n events = {\n // Form was successfully submitted - the response is passed to the event listener.\n // Cancellable (in order to prevent default behavior to clear the container).\n FORM_SUBMITTED: 'core_form_dynamicform_formsubmitted',\n // Cancel button was pressed.\n // Cancellable (in order to prevent default behavior to clear the container).\n FORM_CANCELLED: 'core_form_dynamicform_formcancelled',\n // User attempted to submit the form but there was client-side validation error.\n CLIENT_VALIDATION_ERROR: 'core_form_dynamicform_clientvalidationerror',\n // User attempted to submit the form but server returned validation error.\n SERVER_VALIDATION_ERROR: 'core_form_dynamicform_validationerror',\n // Error occurred while performing request to the server.\n // Cancellable (by default calls Notification.exception).\n ERROR: 'core_form_dynamicform_error',\n // Right after user pressed no-submit button,\n // listen to this event if you want to add JS validation or processing for no-submit button.\n // Cancellable.\n NOSUBMIT_BUTTON_PRESSED: 'core_form_dynamicform_nosubmitbutton',\n // Right after user pressed submit button,\n // listen to this event if you want to add additional JS validation or confirmation dialog.\n // Cancellable.\n SUBMIT_BUTTON_PRESSED: 'core_form_dynamicform_submitbutton',\n // Right after user pressed cancel button,\n // listen to this event if you want to add confirmation dialog.\n // Cancellable.\n CANCEL_BUTTON_PRESSED: 'core_form_dynamicform_cancelbutton',\n };\n\n /**\n * Constructor\n *\n * Creates an instance\n *\n * @param {Element} container - the parent element for the form\n * @param {string} formClass full name of the php class that extends \\core_form\\modal , must be in autoloaded location\n */\n constructor(container, formClass) {\n this.formClass = formClass;\n this.container = container;\n\n // Ensure strings required for shortforms are always available.\n getStrings([\n {key: 'collapseall', component: 'moodle'},\n {key: 'expandall', component: 'moodle'}\n ]).catch(Notification.exception);\n\n // Register delegated events handlers in vanilla JS.\n this.container.addEventListener('click', e => {\n if (e.target.matches('form input[type=submit][data-cancel]')) {\n e.preventDefault();\n const event = this.trigger(this.events.CANCEL_BUTTON_PRESSED, e.target);\n if (!event.defaultPrevented) {\n this.processCancelButton();\n }\n } else if (e.target.matches('form input[type=submit][data-no-submit=\"1\"]')) {\n e.preventDefault();\n const event = this.trigger(this.events.NOSUBMIT_BUTTON_PRESSED, e.target);\n if (!event.defaultPrevented) {\n this.processNoSubmitButton(e.target);\n }\n }\n });\n\n this.container.addEventListener('submit', e => {\n if (e.target.matches('form')) {\n e.preventDefault();\n const event = this.trigger(this.events.SUBMIT_BUTTON_PRESSED);\n if (!event.defaultPrevented) {\n this.submitFormAjax();\n }\n }\n });\n }\n\n /**\n * Loads the form via AJAX and shows it inside a given container\n *\n * @param {Object} args\n * @return {Promise}\n * @public\n */\n load(args = null) {\n const formData = new URLSearchParams(Object.entries(args || {}));\n const pendingPromise = new Pending('core_form/dynamicform:load');\n return this.getBody(formData.toString())\n .then((resp) => this.updateForm(resp))\n .then(pendingPromise.resolve);\n }\n\n /**\n * Triggers a custom event\n *\n * @private\n * @param {String} eventName\n * @param {*} detail\n * @param {Boolean} cancelable\n * @return {CustomEvent}\n */\n trigger(eventName, detail = null, cancelable = true) {\n const e = new CustomEvent(eventName, {detail, cancelable});\n this.container.dispatchEvent(e);\n return e;\n }\n\n /**\n * Add listener for an event\n *\n * Example:\n * const dynamicForm = new DynamicForm(...);\n * dynamicForm.addEventListener(dynamicForm.events.FORM_SUBMITTED, e => {\n * e.preventDefault();\n * window.console.log(e.detail);\n * dynamicForm.container.innerHTML = 'Thank you, your form is submitted!';\n * });\n */\n addEventListener(...args) {\n this.container.addEventListener(...args);\n }\n\n /**\n * Get form body\n *\n * @param {String} formDataString form data in format of a query string\n * @private\n * @return {Promise}\n */\n getBody(formDataString) {\n return Ajax.call([{\n methodname: 'core_form_dynamic_form',\n args: {\n formdata: formDataString,\n form: this.formClass,\n }\n }])[0]\n .then(response => {\n return {html: response.html, js: Fragment.processCollectedJavascript(response.javascript)};\n });\n }\n\n /**\n * On form submit\n *\n * @param {*} response Response received from the form's \"process\" method\n */\n onSubmitSuccess(response) {\n const event = this.trigger(this.events.FORM_SUBMITTED, response);\n if (event.defaultPrevented) {\n return;\n }\n\n // Default implementation is to remove the form. Event listener should either remove or reload the form\n // since its contents is no longer correct. For example, if an element was created as a result of\n // form submission, the \"id\" in the form would be still zero. Also the server-side validation\n // errors from the previous submission may still be present.\n this.container.innerHTML = '';\n }\n\n /**\n * On exception during form processing\n *\n * @private\n * @param {Object} exception\n */\n onSubmitError(exception) {\n const event = this.trigger(this.events.ERROR, exception);\n if (event.defaultPrevented) {\n return;\n }\n\n Notification.exception(exception);\n }\n\n /**\n * Click on a \"submit\" button that is marked in the form as registerNoSubmitButton()\n *\n * @method submitButtonPressed\n * @param {Element} button that was pressed\n * @fires event:formSubmittedByJavascript\n */\n processNoSubmitButton(button) {\n const pendingPromise = new Pending('core_form/dynamicform:nosubmit');\n const form = this.getFormNode();\n const formData = new URLSearchParams([...(new FormData(form)).entries()]);\n formData.append(button.getAttribute('name'), button.getAttribute('value'));\n\n FormEvents.notifyFormSubmittedByJavascript(form, true);\n\n // Add the button name to the form data and submit it.\n this.disableButtons();\n\n this.getBody(formData.toString())\n .then(this.updateForm)\n .then(pendingPromise.resolve)\n .catch(this.onSubmitError);\n }\n\n /**\n * Get the form node from the Dialogue.\n *\n * @returns {HTMLFormElement}\n */\n getFormNode() {\n return this.container.querySelector('form');\n }\n\n /**\n * Notifies listeners that form dirty state should be reset.\n *\n * @return {Promise}\n * @fires event:formSubmittedByJavascript\n */\n notifyResetFormChanges() {\n FormEvents.notifyFormSubmittedByJavascript(this.getFormNode(), true);\n\n return new Promise(resolve => {\n Y.use('event', 'moodle-core-event', 'moodle-core-formchangechecker', () => {\n M.core_formchangechecker.reset_form_dirty_state();\n resolve();\n });\n });\n }\n\n /**\n * Click on a \"cancel\" button\n */\n processCancelButton() {\n // Notify listeners that the form is about to be submitted (this will reset atto autosave).\n this.notifyResetFormChanges()\n .then(() => {\n const event = this.trigger(this.events.FORM_CANCELLED);\n if (!event.defaultPrevented) {\n // By default removes the form from the DOM.\n this.container.innerHTML = '';\n }\n return null;\n })\n .catch(null);\n }\n\n /**\n * Update form contents\n *\n * @param {string} html\n * @param {string} js\n * @returns {Promise}\n */\n updateForm({html, js}) {\n return Templates.replaceNodeContents(this.container, html, js);\n }\n\n /**\n * Validate form elements\n * @return {Boolean} Whether client-side validation has passed, false if there are errors\n * @fires event:formSubmittedByJavascript\n */\n validateElements() {\n // Notify listeners that the form is about to be submitted (this will reset atto autosave).\n FormEvents.notifyFormSubmittedByJavascript(this.getFormNode());\n\n // Now the change events have run, see if there are any \"invalid\" form fields.\n const invalid = [...this.container.querySelectorAll('[aria-invalid=\"true\"], .error')];\n\n // If we found invalid fields, focus on the first one and do not submit via ajax.\n if (invalid.length) {\n invalid[0].focus();\n return false;\n }\n\n return true;\n }\n\n /**\n * Disable buttons during form submission\n */\n disableButtons() {\n this.container.querySelectorAll('form input[type=\"submit\"]')\n .forEach(el => el.setAttribute('disabled', true));\n }\n\n /**\n * Enable buttons after form submission (on validation error)\n */\n enableButtons() {\n this.container.querySelectorAll('form input[type=\"submit\"]')\n .forEach(el => el.removeAttribute('disabled'));\n }\n\n /**\n * Submit the form via AJAX call to the core_form_dynamic_form WS\n */\n async submitFormAjax() {\n // If we found invalid fields, focus on the first one and do not submit via ajax.\n if (!(await this.validateElements())) {\n this.trigger(this.events.CLIENT_VALIDATION_ERROR, null, false);\n return;\n }\n this.disableButtons();\n\n // Convert all the form elements values to a serialised string.\n const form = this.container.querySelector('form');\n const formData = new URLSearchParams([...(new FormData(form)).entries()]);\n\n // Now we can continue...\n Ajax.call([{\n methodname: 'core_form_dynamic_form',\n args: {\n formdata: formData.toString(),\n form: this.formClass\n }\n }])[0]\n .then((response) => {\n if (!response.submitted) {\n // Form was not submitted, it could be either because validation failed or because no-submit button was pressed.\n this.updateForm({html: response.html, js: Fragment.processCollectedJavascript(response.javascript)});\n this.enableButtons();\n this.trigger(this.events.SERVER_VALIDATION_ERROR, null, false);\n } else {\n // Form was submitted properly.\n const data = JSON.parse(response.data);\n this.enableButtons();\n this.notifyResetFormChanges()\n .then(() => this.onSubmitSuccess(data))\n .catch();\n }\n return null;\n })\n .catch(this.onSubmitError);\n }\n}\n"],"file":"dynamicform.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/dynamicform.js"],"names":["DynamicForm","container","formClass","FORM_SUBMITTED","FORM_CANCELLED","CLIENT_VALIDATION_ERROR","SERVER_VALIDATION_ERROR","ERROR","NOSUBMIT_BUTTON_PRESSED","SUBMIT_BUTTON_PRESSED","CANCEL_BUTTON_PRESSED","key","component","catch","Notification","exception","addEventListener","e","target","matches","preventDefault","event","trigger","events","defaultPrevented","processCancelButton","processNoSubmitButton","submitFormAjax","args","formData","URLSearchParams","Object","entries","pendingPromise","Pending","getBody","toString","then","resp","updateForm","resolve","eventName","detail","cancelable","CustomEvent","dispatchEvent","formDataString","Ajax","call","methodname","formdata","form","response","html","js","Fragment","processCollectedJavascript","javascript","innerHTML","button","getFormNode","FormData","append","getAttribute","FormEvents","notifyFormSubmittedByJavascript","disableButtons","onSubmitError","querySelector","Promise","Y","use","M","core_formchangechecker","reset_form_dirty_state","notifyResetFormChanges","Templates","replaceNodeContents","invalid","querySelectorAll","length","focus","forEach","el","setAttribute","removeAttribute","validateElements","submitted","enableButtons","data","JSON","parse","onSubmitSuccess"],"mappings":"mjBAoCA,OACA,OACA,OACA,OACA,OACA,OACA,O,8kEAMqBA,CAAAA,C,YA2CjB,WAAYC,CAAZ,CAAuBC,CAAvB,CAAkC,sCApCzB,CAGLC,cAAc,CAAE,qCAHX,CAMLC,cAAc,CAAE,qCANX,CAQLC,uBAAuB,CAAE,6CARpB,CAULC,uBAAuB,CAAE,uCAVpB,CAaLC,KAAK,CAAE,6BAbF,CAiBLC,uBAAuB,CAAE,sCAjBpB,CAqBLC,qBAAqB,CAAE,oCArBlB,CAyBLC,qBAAqB,CAAE,oCAzBlB,CAoCyB,EAC9B,KAAKR,SAAL,CAAiBA,CAAjB,CACA,KAAKD,SAAL,CAAiBA,CAAjB,CAGA,kBAAW,CACP,CAACU,GAAG,CAAE,aAAN,CAAqBC,SAAS,CAAE,QAAhC,CADO,CAEP,CAACD,GAAG,CAAE,WAAN,CAAmBC,SAAS,CAAE,QAA9B,CAFO,CAAX,EAGGC,KAHH,CAGSC,UAAaC,SAHtB,EAMA,KAAKd,SAAL,CAAee,gBAAf,CAAgC,OAAhC,CAAyC,SAAAC,CAAC,CAAI,CAC1C,GAAIA,CAAC,CAACC,MAAF,CAASC,OAAT,CAAiB,sCAAjB,CAAJ,CAA8D,CAC1DF,CA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AACe,CAAD,CAAc,CAChB,GAAI,CAACA,CAAQ,CAACmC,SAAd,CAAyB,CAErB,CAAI,CAAChD,UAAL,CAAgB,CAACc,IAAI,CAAED,CAAQ,CAACC,IAAhB,CAAsBC,EAAE,CAAEC,UAASC,0BAAT,CAAoCJ,CAAQ,CAACK,UAA7C,CAA1B,CAAhB,EACA,CAAI,CAAC+B,aAAL,GACA,CAAI,CAAClE,OAAL,CAAa,CAAI,CAACC,MAAL,CAAYjB,uBAAzB,CAAkD,IAAlD,IACH,CALD,IAKO,CAEH,GAAMmF,CAAAA,CAAI,CAAGC,IAAI,CAACC,KAAL,CAAWvC,CAAQ,CAACqC,IAApB,CAAb,CACA,CAAI,CAACD,aAAL,GACA,CAAI,CAACb,sBAAL,GACCtC,IADD,CACM,iBAAM,CAAA,CAAI,CAACuD,eAAL,CAAqBH,CAArB,CAAN,CADN,EAEC5E,KAFD,EAGH,CACD,MAAO,KACV,CAtBD,EAuBCA,KAvBD,CAuBO,KAAKsD,aAvBZ,E","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Display an embedded form, it is only loaded and reloaded inside its container\n *\n * Example:\n * import DynamicForm from 'core_form/dynamicform';\n *\n * const dynamicForm = new DynamicForm(document.querySelector('#mycontainer', 'pluginname\\\\form\\\\formname');\n * dynamicForm.addEventListener(dynamicForm.events.FORM_SUBMITTED, e => {\n * e.preventDefault();\n * window.console.log(e.detail);\n * dynamicForm.container.innerHTML = 'Thank you, your form is submitted!';\n * });\n * dynamicForm.load();\n *\n * See also https://docs.moodle.org/dev/Modal_and_AJAX_forms\n *\n * @module core_form/dynamicform\n * @copyright 2019 Marina Glancy\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Ajax from 'core/ajax';\nimport * as FormEvents from 'core_form/events';\nimport Fragment from 'core/fragment';\nimport Notification from 'core/notification';\nimport Pending from 'core/pending';\nimport Templates from 'core/templates';\nimport Y from 'core/yui';\nimport {get_strings as getStrings} from 'core/str';\n\n/**\n * @class core_form/dynamicform\n */\nexport default class DynamicForm {\n\n /**\n * Various events that can be observed.\n *\n * @type {Object}\n */\n events = {\n // Form was successfully submitted - the response is passed to the event listener.\n // Cancellable (in order to prevent default behavior to clear the container).\n FORM_SUBMITTED: 'core_form_dynamicform_formsubmitted',\n // Cancel button was pressed.\n // Cancellable (in order to prevent default behavior to clear the container).\n FORM_CANCELLED: 'core_form_dynamicform_formcancelled',\n // User attempted to submit the form but there was client-side validation error.\n CLIENT_VALIDATION_ERROR: 'core_form_dynamicform_clientvalidationerror',\n // User attempted to submit the form but server returned validation error.\n SERVER_VALIDATION_ERROR: 'core_form_dynamicform_validationerror',\n // Error occurred while performing request to the server.\n // Cancellable (by default calls Notification.exception).\n ERROR: 'core_form_dynamicform_error',\n // Right after user pressed no-submit button,\n // listen to this event if you want to add JS validation or processing for no-submit button.\n // Cancellable.\n NOSUBMIT_BUTTON_PRESSED: 'core_form_dynamicform_nosubmitbutton',\n // Right after user pressed submit button,\n // listen to this event if you want to add additional JS validation or confirmation dialog.\n // Cancellable.\n SUBMIT_BUTTON_PRESSED: 'core_form_dynamicform_submitbutton',\n // Right after user pressed cancel button,\n // listen to this event if you want to add confirmation dialog.\n // Cancellable.\n CANCEL_BUTTON_PRESSED: 'core_form_dynamicform_cancelbutton',\n };\n\n /**\n * Constructor\n *\n * Creates an instance\n *\n * @param {Element} container - the parent element for the form\n * @param {string} formClass full name of the php class that extends \\core_form\\modal , must be in autoloaded location\n */\n constructor(container, formClass) {\n this.formClass = formClass;\n this.container = container;\n\n // Ensure strings required for shortforms are always available.\n getStrings([\n {key: 'collapseall', component: 'moodle'},\n {key: 'expandall', component: 'moodle'}\n ]).catch(Notification.exception);\n\n // Register delegated events handlers in vanilla JS.\n this.container.addEventListener('click', e => {\n if (e.target.matches('form input[type=submit][data-cancel]')) {\n e.preventDefault();\n const event = this.trigger(this.events.CANCEL_BUTTON_PRESSED, e.target);\n if (!event.defaultPrevented) {\n this.processCancelButton();\n }\n } else if (e.target.matches('form input[type=submit][data-no-submit=\"1\"]')) {\n e.preventDefault();\n const event = this.trigger(this.events.NOSUBMIT_BUTTON_PRESSED, e.target);\n if (!event.defaultPrevented) {\n this.processNoSubmitButton(e.target);\n }\n }\n });\n\n this.container.addEventListener('submit', e => {\n if (e.target.matches('form')) {\n e.preventDefault();\n const event = this.trigger(this.events.SUBMIT_BUTTON_PRESSED);\n if (!event.defaultPrevented) {\n this.submitFormAjax();\n }\n }\n });\n }\n\n /**\n * Loads the form via AJAX and shows it inside a given container\n *\n * @param {Object} args\n * @return {Promise}\n * @public\n */\n load(args = null) {\n const formData = new URLSearchParams(Object.entries(args || {}));\n const pendingPromise = new Pending('core_form/dynamicform:load');\n return this.getBody(formData.toString())\n .then((resp) => this.updateForm(resp))\n .then(pendingPromise.resolve);\n }\n\n /**\n * Triggers a custom event\n *\n * @private\n * @param {String} eventName\n * @param {*} detail\n * @param {Boolean} cancelable\n * @return {CustomEvent}\n */\n trigger(eventName, detail = null, cancelable = true) {\n const e = new CustomEvent(eventName, {detail, cancelable});\n this.container.dispatchEvent(e);\n return e;\n }\n\n /**\n * Add listener for an event\n *\n * Example:\n * const dynamicForm = new DynamicForm(...);\n * dynamicForm.addEventListener(dynamicForm.events.FORM_SUBMITTED, e => {\n * e.preventDefault();\n * window.console.log(e.detail);\n * dynamicForm.container.innerHTML = 'Thank you, your form is submitted!';\n * });\n */\n addEventListener(...args) {\n this.container.addEventListener(...args);\n }\n\n /**\n * Get form body\n *\n * @param {String} formDataString form data in format of a query string\n * @private\n * @return {Promise}\n */\n getBody(formDataString) {\n return Ajax.call([{\n methodname: 'core_form_dynamic_form',\n args: {\n formdata: formDataString,\n form: this.formClass,\n }\n }])[0]\n .then(response => {\n return {html: response.html, js: Fragment.processCollectedJavascript(response.javascript)};\n });\n }\n\n /**\n * On form submit\n *\n * @param {*} response Response received from the form's \"process\" method\n */\n onSubmitSuccess(response) {\n const event = this.trigger(this.events.FORM_SUBMITTED, response);\n if (event.defaultPrevented) {\n return;\n }\n\n // Default implementation is to remove the form. Event listener should either remove or reload the form\n // since its contents is no longer correct. For example, if an element was created as a result of\n // form submission, the \"id\" in the form would be still zero. Also the server-side validation\n // errors from the previous submission may still be present.\n this.container.innerHTML = '';\n }\n\n /**\n * On exception during form processing\n *\n * @private\n * @param {Object} exception\n */\n onSubmitError(exception) {\n const event = this.trigger(this.events.ERROR, exception);\n if (event.defaultPrevented) {\n return;\n }\n\n Notification.exception(exception);\n }\n\n /**\n * Click on a \"submit\" button that is marked in the form as registerNoSubmitButton()\n *\n * @method submitButtonPressed\n * @param {Element} button that was pressed\n * @fires event:formSubmittedByJavascript\n */\n processNoSubmitButton(button) {\n const pendingPromise = new Pending('core_form/dynamicform:nosubmit');\n const form = this.getFormNode();\n const formData = new URLSearchParams([...(new FormData(form)).entries()]);\n formData.append(button.getAttribute('name'), button.getAttribute('value'));\n\n FormEvents.notifyFormSubmittedByJavascript(form, true);\n\n // Add the button name to the form data and submit it.\n this.disableButtons();\n\n this.getBody(formData.toString())\n .then(this.updateForm)\n .then(pendingPromise.resolve)\n .catch(this.onSubmitError);\n }\n\n /**\n * Get the form node from the Dialogue.\n *\n * @returns {HTMLFormElement}\n */\n getFormNode() {\n return this.container.querySelector('form');\n }\n\n /**\n * Notifies listeners that form dirty state should be reset.\n *\n * @return {Promise}\n * @fires event:formSubmittedByJavascript\n */\n notifyResetFormChanges() {\n FormEvents.notifyFormSubmittedByJavascript(this.getFormNode(), true);\n\n return new Promise(resolve => {\n Y.use('event', 'moodle-core-event', 'moodle-core-formchangechecker', () => {\n M.core_formchangechecker.reset_form_dirty_state();\n resolve();\n });\n });\n }\n\n /**\n * Click on a \"cancel\" button\n */\n processCancelButton() {\n // Notify listeners that the form is about to be submitted (this will reset atto autosave).\n this.notifyResetFormChanges()\n .then(() => {\n const event = this.trigger(this.events.FORM_CANCELLED);\n if (!event.defaultPrevented) {\n // By default removes the form from the DOM.\n this.container.innerHTML = '';\n }\n return null;\n })\n .catch(null);\n }\n\n /**\n * Update form contents\n *\n * @param {string} html\n * @param {string} js\n * @returns {Promise}\n */\n updateForm({html, js}) {\n return Templates.replaceNodeContents(this.container, html, js);\n }\n\n /**\n * Validate form elements\n * @return {Boolean} Whether client-side validation has passed, false if there are errors\n * @fires event:formSubmittedByJavascript\n */\n validateElements() {\n // Notify listeners that the form is about to be submitted (this will reset atto autosave).\n FormEvents.notifyFormSubmittedByJavascript(this.getFormNode());\n\n // Now the change events have run, see if there are any \"invalid\" form fields.\n const invalid = [...this.container.querySelectorAll('[aria-invalid=\"true\"], .error')];\n\n // If we found invalid fields, focus on the first one and do not submit via ajax.\n if (invalid.length) {\n invalid[0].focus();\n return false;\n }\n\n return true;\n }\n\n /**\n * Disable buttons during form submission\n */\n disableButtons() {\n this.container.querySelectorAll('form input[type=\"submit\"]')\n .forEach(el => el.setAttribute('disabled', true));\n }\n\n /**\n * Enable buttons after form submission (on validation error)\n */\n enableButtons() {\n this.container.querySelectorAll('form input[type=\"submit\"]')\n .forEach(el => el.removeAttribute('disabled'));\n }\n\n /**\n * Submit the form via AJAX call to the core_form_dynamic_form WS\n */\n async submitFormAjax() {\n // If we found invalid fields, focus on the first one and do not submit via ajax.\n if (!(await this.validateElements())) {\n this.trigger(this.events.CLIENT_VALIDATION_ERROR, null, false);\n return;\n }\n this.disableButtons();\n\n // Convert all the form elements values to a serialised string.\n const form = this.container.querySelector('form');\n const formData = new URLSearchParams([...(new FormData(form)).entries()]);\n\n // Now we can continue...\n Ajax.call([{\n methodname: 'core_form_dynamic_form',\n args: {\n formdata: formData.toString(),\n form: this.formClass\n }\n }])[0]\n .then((response) => {\n if (!response.submitted) {\n // Form was not submitted, it could be either because validation failed or because no-submit button was pressed.\n this.updateForm({html: response.html, js: Fragment.processCollectedJavascript(response.javascript)});\n this.enableButtons();\n this.trigger(this.events.SERVER_VALIDATION_ERROR, null, false);\n } else {\n // Form was submitted properly.\n const data = JSON.parse(response.data);\n this.enableButtons();\n this.notifyResetFormChanges()\n .then(() => this.onSubmitSuccess(data))\n .catch();\n }\n return null;\n })\n .catch(this.onSubmitError);\n }\n}\n"],"file":"dynamicform.min.js"} \ No newline at end of file diff --git a/lib/form/amd/build/encryptedpassword.min.js.map b/lib/form/amd/build/encryptedpassword.min.js.map index 2e89e87aea5f6..f0c65e4b924d5 100644 --- a/lib/form/amd/build/encryptedpassword.min.js.map +++ b/lib/form/amd/build/encryptedpassword.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/encryptedpassword.js"],"names":["EncryptedPassword","elementId","wrapper","document","querySelector","spanOrLink","input","editButtonOrLink","cancelButton","editHandler","e","stopImmediatePropagation","preventDefault","startEditing","addEventListener","nodeName","parentElement","previousElementSibling","cancelEditing","dataset","novalue","style","display","prototype","moveFocus","disabled","id","removeAttribute","focus","value"],"mappings":"uJA6BO,GAAMA,CAAAA,CAAiB,CAAG,SAASC,CAAT,CAAoB,YAC3CC,CAAO,CAAGC,QAAQ,CAACC,aAAT,CAAuB,kCAAmCH,CAAnC,CAA+C,KAAtE,CADiC,CAEjD,KAAKI,UAAL,CAAkBH,CAAO,CAACE,aAAR,CAAsB,SAAtB,CAAlB,CACA,KAAKE,KAAL,CAAaJ,CAAO,CAACE,aAAR,CAAsB,OAAtB,CAAb,CACA,KAAKG,gBAAL,CAAwBL,CAAO,CAACE,aAAR,CAAsB,4BAAtB,CAAxB,CACA,KAAKI,YAAL,CAAoBN,CAAO,CAACE,aAAR,CAAsB,2BAAtB,CAApB,CAGA,GAAIK,CAAAA,CAAW,CAAG,SAACC,C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,CACX,KAAKlB,KAAL,CAAWsB,KAAX,EACH,CACJ,CAfD,CAoBA5B,CAAiB,CAACuB,SAAlB,CAA4BL,aAA5B,CAA4C,UAAW,CACnD,KAAKZ,KAAL,CAAWe,KAAX,CAAiBC,OAAjB,CAA2B,MAA3B,CACA,KAAKhB,KAAL,CAAWuB,KAAX,CAAmB,EAAnB,CACA,KAAKvB,KAAL,CAAWmB,QAAX,IACA,KAAKpB,UAAL,CAAgBgB,KAAhB,CAAsBC,OAAtB,CAAgC,QAAhC,CACA,KAAKf,gBAAL,CAAsBc,KAAtB,CAA4BC,OAA5B,CAAsC,QAAtC,CACA,KAAKd,YAAL,CAAkBa,KAAlB,CAAwBC,OAAxB,CAAkC,MAAlC,CAGA,GAAMI,CAAAA,CAAE,CAAG,KAAKpB,KAAL,CAAWoB,EAAtB,CACA,KAAKpB,KAAL,CAAWqB,eAAX,CAA2B,IAA3B,EACA,KAAKpB,gBAAL,CAAsBmB,EAAtB,CAA2BA,CAC9B,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Encrypted password functionality.\n *\n * @module core_form/encryptedpassword\n * @class encryptedpassword\n * @copyright 2019 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * Constructor for EncryptedPassword.\n *\n * @param {String} elementId The element to apply the encrypted password JS to\n */\nexport const EncryptedPassword = function(elementId) {\n const wrapper = document.querySelector('div[data-encryptedpasswordid=\"' + elementId + '\"]');\n this.spanOrLink = wrapper.querySelector('span, a');\n this.input = wrapper.querySelector('input');\n this.editButtonOrLink = wrapper.querySelector('button[data-editbutton], a');\n this.cancelButton = wrapper.querySelector('button[data-cancelbutton]');\n\n // Edit button action.\n var editHandler = (e) => {\n e.stopImmediatePropagation();\n e.preventDefault();\n this.startEditing(true);\n };\n this.editButtonOrLink.addEventListener('click', editHandler);\n\n // When it's a link, do some magic to make the label work as well.\n if (this.editButtonOrLink.nodeName === 'A') {\n wrapper.parentElement.previousElementSibling.querySelector('label').addEventListener('click', editHandler);\n }\n\n // Cancel button action.\n this.cancelButton.addEventListener('click', (e) => {\n e.stopImmediatePropagation();\n e.preventDefault();\n this.cancelEditing();\n });\n\n // If the value is not set yet, start editing and remove the cancel option - so that\n // it saves something in the config table and doesn't keep repeat showing it as a new\n // admin setting...\n if (wrapper.dataset.novalue === 'y') {\n this.startEditing(false);\n this.cancelButton.style.display = 'none';\n }\n};\n\n/**\n * Starts editing.\n *\n * @param {Boolean} moveFocus If true, sets focus to the edit box\n */\nEncryptedPassword.prototype.startEditing = function(moveFocus) {\n this.input.style.display = 'inline';\n this.input.disabled = false;\n this.spanOrLink.style.display = 'none';\n this.editButtonOrLink.style.display = 'none';\n this.cancelButton.style.display = 'inline';\n\n // Move the id around, which changes what happens when you click the label.\n const id = this.editButtonOrLink.id;\n this.editButtonOrLink.removeAttribute('id');\n this.input.id = id;\n\n if (moveFocus) {\n this.input.focus();\n }\n};\n\n/**\n * Cancels editing.\n */\nEncryptedPassword.prototype.cancelEditing = function() {\n this.input.style.display = 'none';\n this.input.value = '';\n this.input.disabled = true;\n this.spanOrLink.style.display = 'inline';\n this.editButtonOrLink.style.display = 'inline';\n this.cancelButton.style.display = 'none';\n\n // Move the id around, which changes what happens when you click the label.\n const id = this.input.id;\n this.input.removeAttribute('id');\n this.editButtonOrLink.id = id;\n};\n"],"file":"encryptedpassword.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/encryptedpassword.js"],"names":["EncryptedPassword","elementId","wrapper","document","querySelector","spanOrLink","input","editButtonOrLink","cancelButton","editHandler","e","stopImmediatePropagation","preventDefault","startEditing","addEventListener","nodeName","parentElement","previousElementSibling","cancelEditing","dataset","novalue","style","display","prototype","moveFocus","disabled","id","removeAttribute","focus","value"],"mappings":"uJA6BO,GAAMA,CAAAA,CAAiB,CAAG,SAASC,CAAT,CAAoB,YAC3CC,CAAO,CAAGC,QAAQ,CAACC,aAAT,CAAuB,kCAAmCH,CAAnC,CAA+C,KAAtE,CADiC,CAEjD,KAAKI,UAAL,CAAkBH,CAAO,CAACE,aAAR,CAAsB,SAAtB,CAAlB,CACA,KAAKE,KAAL,CAAaJ,CAAO,CAACE,aAAR,CAAsB,OAAtB,CAAb,CACA,KAAKG,gBAAL,CAAwBL,CAAO,CAACE,aAAR,CAAsB,4BAAtB,CAAxB,CACA,KAAKI,YAAL,CAAoBN,CAAO,CAACE,aAAR,CAAsB,2BAAtB,CAApB,CAGA,GAAIK,CAAAA,CAAW,CAAG,SAACC,CAAD,CAAO,CACrBA,CAAC,CAACC,wBAAF,GACAD,CAAC,CAACE,cAAF,GACA,CAAI,CAACC,YAAL,IACH,CAJD,CAKA,KAAKN,gBAAL,CAAsBO,gBAAtB,CAAuC,OAAvC,CAAgDL,CAAhD,EAGA,GAAuC,GAAnC,QAAKF,gBAAL,CAAsBQ,QAA1B,CAA4C,CACxCb,CAAO,CAACc,aAAR,CAAsBC,sBAAtB,CAA6Cb,aAA7C,CAA2D,OAA3D,EAAoEU,gBAApE,CAAqF,OAArF,CAA8FL,CAA9F,CACH,CAGD,KAAKD,YAAL,CAAkBM,gBAAlB,CAAmC,OAAnC,CAA4C,SAACJ,CAAD,CAAO,CAC/CA,CAAC,CAACC,wBAAF,GACAD,CAAC,CAACE,cAAF,GACA,CAAI,CAACM,aAAL,EACH,CAJD,EASA,GAAgC,GAA5B,GAAAhB,CAAO,CAACiB,OAAR,CAAgBC,OAApB,CAAqC,CACjC,KAAKP,YAAL,KACA,KAAKL,YAAL,CAAkBa,KAAlB,CAAwBC,OAAxB,CAAk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org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Encrypted password functionality.\n *\n * @module core_form/encryptedpassword\n * @copyright 2019 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * Constructor for EncryptedPassword.\n *\n * @class core_form/encryptedpassword\n * @param {String} elementId The element to apply the encrypted password JS to\n */\nexport const EncryptedPassword = function(elementId) {\n const wrapper = document.querySelector('div[data-encryptedpasswordid=\"' + elementId + '\"]');\n this.spanOrLink = wrapper.querySelector('span, a');\n this.input = wrapper.querySelector('input');\n this.editButtonOrLink = wrapper.querySelector('button[data-editbutton], a');\n this.cancelButton = wrapper.querySelector('button[data-cancelbutton]');\n\n // Edit button action.\n var editHandler = (e) => {\n e.stopImmediatePropagation();\n e.preventDefault();\n this.startEditing(true);\n };\n this.editButtonOrLink.addEventListener('click', editHandler);\n\n // When it's a link, do some magic to make the label work as well.\n if (this.editButtonOrLink.nodeName === 'A') {\n wrapper.parentElement.previousElementSibling.querySelector('label').addEventListener('click', editHandler);\n }\n\n // Cancel button action.\n this.cancelButton.addEventListener('click', (e) => {\n e.stopImmediatePropagation();\n e.preventDefault();\n this.cancelEditing();\n });\n\n // If the value is not set yet, start editing and remove the cancel option - so that\n // it saves something in the config table and doesn't keep repeat showing it as a new\n // admin setting...\n if (wrapper.dataset.novalue === 'y') {\n this.startEditing(false);\n this.cancelButton.style.display = 'none';\n }\n};\n\n/**\n * Starts editing.\n *\n * @param {Boolean} moveFocus If true, sets focus to the edit box\n */\nEncryptedPassword.prototype.startEditing = function(moveFocus) {\n this.input.style.display = 'inline';\n this.input.disabled = false;\n this.spanOrLink.style.display = 'none';\n this.editButtonOrLink.style.display = 'none';\n this.cancelButton.style.display = 'inline';\n\n // Move the id around, which changes what happens when you click the label.\n const id = this.editButtonOrLink.id;\n this.editButtonOrLink.removeAttribute('id');\n this.input.id = id;\n\n if (moveFocus) {\n this.input.focus();\n }\n};\n\n/**\n * Cancels editing.\n */\nEncryptedPassword.prototype.cancelEditing = function() {\n this.input.style.display = 'none';\n this.input.value = '';\n this.input.disabled = true;\n this.spanOrLink.style.display = 'inline';\n this.editButtonOrLink.style.display = 'inline';\n this.cancelButton.style.display = 'none';\n\n // Move the id around, which changes what happens when you click the label.\n const id = this.input.id;\n this.input.removeAttribute('id');\n this.editButtonOrLink.id = id;\n};\n"],"file":"encryptedpassword.min.js"} \ No newline at end of file diff --git a/lib/form/amd/build/events.min.js.map b/lib/form/amd/build/events.min.js.map index 4acf0ad272cfd..ecc688b030ae3 100644 --- a/lib/form/amd/build/events.min.js.map +++ b/lib/form/amd/build/events.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/events.js"],"names":["changesMadeString","then","string","catch","changesMadeCheck","e","returnValue","eventTypes","formError","formSubmittedByJavascript","formFieldValidationFailed","uploadStarted","uploadCompleted","notifyFormError","field","notifyFormSubmittedByJavascript","form","skipValidation","fallbackHandled","window","skipClientValidation","customEvent","notifyFieldValidationFailure","message","cancelable","notifyUploadStarted","elementId","addEventListener","document","getElementById","bubbles","cancellable","notifyUploadCompleted","removeEventListener","legacyEventsRegistered","Y","use","element","one","target","formElement","closest","Global","fire","M","core","globalEvents","FORM_ERROR","formid","generateID","elementid","detail","event","FORM_SUBMIT_AJAX","currentTarget","legacyEvent","jQuery","Event","trigger"],"mappings":"6XAsGA,OACA,O,mDA5EA,GAAIA,CAAAA,CAAJ,CACA,iBAAU,yBAAV,CAAqC,QAArC,EAA+CC,IAA/C,CAAoD,SAAAC,CAAM,CAAI,CAC1DF,CAAiB,CAAGE,CAApB,CACA,MAAOA,CA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,CAAAA,CAAI,CAAGmB,UAAEG,GAAF,CAAMjC,CAAC,CAACkC,MAAR,CAAb,CACAvB,CAAI,CAAC2B,IAAL,CACIC,CAAC,CAACC,IAAF,CAAOO,KAAP,CAAaC,gBADjB,CAEI,CACIC,aAAa,CAAEtC,CADnB,CAEIE,eAAe,GAFnB,CAFJ,EAQA,GAAIb,CAAC,CAACY,cAAN,CAAsB,CAClBE,MAAM,CAACC,oBAAP,GACH,CACJ,CAxBD,CAyBH,CA1CD,EA6CAQ,QAAQ,CAACD,gBAAT,CAA0BpB,CAAU,CAACG,yBAArC,CAAgE,SAAAL,CAAC,CAAI,CAGjE,GAAMkD,CAAAA,CAAW,CAAGC,UAAOC,KAAP,CAAa,4BAAb,CAApB,CAEA,cAAOpD,CAAC,CAACkC,MAAT,EAAiBmB,OAAjB,CAAyBH,CAAzB,CAAsClD,CAAC,CAAC8C,MAAF,CAAS5B,OAA/C,CACH,CAND,EAQAW,CAAsB,GACzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript events for the `core_form` subsystem.\n *\n * @module core_form/events\n * @copyright 2021 Huong Nguyen \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.10\n */\n\nimport {get_string as getString} from 'core/str';\nimport {dispatchEvent} from 'core/event_dispatcher';\n\nlet changesMadeString;\ngetString('changesmadereallygoaway', 'moodle').then(string => {\n changesMadeString = string;\n return string;\n}).catch();\n\n/**\n * Prevent user navigate away when upload progress still running.\n * @param {Event} e The event\n */\nconst changesMadeCheck = e => {\n if (e) {\n e.returnValue = changesMadeString;\n }\n};\n\n/**\n * Events for `core_form`.\n *\n * @constant\n * @property {String} formError See {@link event:formError}\n * @property {String} formFieldValidationFailed See {@link event:formFieldValidationFailed}\n * @property {String} formSubmittedByJavascript See {@link event:formSubmittedByJavascript}\n */\nexport const eventTypes = {\n /**\n * An event triggered when a form contains an error\n *\n * @event formError\n * @type {CustomEvent}\n * @property {HTMLElement} target The form field which errored\n */\n formError: 'core_form/error',\n\n /**\n * An event triggered when an mform is about to be submitted via javascript.\n *\n * @event formSubmittedByJavascript\n * @type {CustomEvent}\n * @property {HTMLElement} target The form that was submitted\n * @property {Boolean} skipValidation Whether the form was submitted without validation (i.e. via a Cancel button)\n * @property {Boolean} fallbackHandled Whether the legacy YUI event has been handled\n */\n formSubmittedByJavascript: 'core_form/submittedByJavascript',\n\n /**\n * An event triggered upon form field validation failure.\n *\n * @event formFieldValidationFailed\n * @type {CustomEvent}\n * @property {HTMLElement} target The field that failed validation\n * @property {String} message The message displayed upon failure\n */\n formFieldValidationFailed: 'core_form/fieldValidationFailed',\n\n /**\n * An event triggered when an upload is started\n *\n * @event uploadStarted\n * @type {CustomEvent}\n * @property {HTMLElement} target The location where the upload began\n */\n uploadStarted: 'core_form/uploadStarted',\n\n /**\n * An event triggered when an upload completes\n *\n * @event uploadCompleted\n * @type {CustomEvent}\n * @property {HTMLElement} target The location where the upload completd\n */\n uploadCompleted: 'core_form/uploadCompleted',\n};\n\n// These are only imported for legacy.\nimport jQuery from 'jquery';\nimport Y from 'core/yui';\n\n/**\n * Trigger an event to indicate that a form field contained an error.\n *\n * @method notifyFormError\n * @param {HTMLElement} field The form field causing the error\n * @returns {CustomEvent}\n * @fires formError\n */\nexport const notifyFormError = field => dispatchEvent(eventTypes.formError, {}, field);\n\n/**\n * Trigger an event to indiciate that a form was submitted by Javascript.\n *\n * @method\n * @param {HTMLElement} form The form that was submitted\n * @param {Boolean} skipValidation Submit the form without validation. E.g. \"Cancel\".\n * @param {Boolean} fallbackHandled The legacy YUI event has been handled\n * @returns {CustomEvent}\n * @fires formSubmittedByJavascript\n */\nexport const notifyFormSubmittedByJavascript = (form, skipValidation = false, fallbackHandled = false) => {\n if (skipValidation) {\n window.skipClientValidation = true;\n }\n\n const customEvent = dispatchEvent(\n eventTypes.formSubmittedByJavascript,\n {\n skipValidation,\n fallbackHandled,\n },\n form\n );\n\n if (skipValidation) {\n window.skipClientValidation = false;\n }\n\n return customEvent;\n};\n\n/**\n * Trigger an event to indicate that a form field contained an error.\n *\n * @method notifyFieldValidationFailure\n * @param {HTMLElement} field The field which failed validation\n * @param {String} message The message displayed\n * @returns {CustomEvent}\n * @fires formFieldValidationFailed\n */\nexport const notifyFieldValidationFailure = (field, message) => dispatchEvent(\n eventTypes.formFieldValidationFailed,\n {\n message,\n },\n field,\n {\n cancelable: true\n }\n);\n\n/**\n * Trigger an event to indicate that an upload was started.\n *\n * @method\n * @param {String} elementId The element which was uploaded to\n * @returns {CustomEvent}\n * @fires uploadStarted\n */\nexport const notifyUploadStarted = elementId => {\n // Add an additional check for changes made.\n window.addEventListener('beforeunload', changesMadeCheck);\n\n return dispatchEvent(\n eventTypes.uploadStarted,\n {},\n document.getElementById(elementId),\n {\n bubbles: true,\n cancellable: false,\n }\n );\n};\n\n/**\n * Trigger an event to indicate that an upload was completed.\n *\n * @method\n * @param {String} elementId The element which was uploaded to\n * @returns {CustomEvent}\n * @fires uploadCompleted\n */\nexport const notifyUploadCompleted = elementId => {\n // Remove the additional check for changes made.\n window.removeEventListener('beforeunload', changesMadeCheck);\n\n return dispatchEvent(\n eventTypes.uploadCompleted,\n {},\n document.getElementById(elementId),\n {\n bubbles: true,\n cancellable: false,\n }\n );\n};\n\n/**\n * Trigger upload start event.\n *\n * @method\n * @param {String} elementId\n * @returns {CustomEvent}\n * @fires uploadStarted\n * @deprecated Since Moodle 4.0 See {@link notifyUploadStarted}\n */\nexport const triggerUploadStarted = notifyUploadStarted;\n\n/**\n * Trigger upload complete event.\n *\n * @method\n * @param {String} elementId\n * @returns {CustomEvent}\n * @fires uploadCompleted\n * @deprecated Since Moodle 4.0 See {@link notifyUploadCompleted}\n */\nexport const triggerUploadCompleted = notifyUploadCompleted;\n\n/**\n * List of the events.\n *\n * @deprecated since Moodle 4.0. See {@link eventTypes} instead.\n **/\nexport const types = {\n uploadStarted: 'core_form/uploadStarted',\n uploadCompleted: 'core_form/uploadCompleted',\n};\n\nlet legacyEventsRegistered = false;\nif (!legacyEventsRegistered) {\n // The following event triggers are legacy and will be removed in the future.\n // The following approach provides a backwards-compatability layer for the new events.\n // Code should be updated to make use of native events.\n Y.use('event', 'moodle-core-event', () => {\n\n // Watch for the new native formError event, and trigger the legacy YUI event.\n document.addEventListener(eventTypes.formError, e => {\n const element = Y.one(e.target);\n const formElement = Y.one(e.target.closest('form'));\n\n Y.Global.fire(\n M.core.globalEvents.FORM_ERROR,\n {\n formid: formElement.generateID(),\n elementid: element.generateID(),\n }\n );\n });\n\n // Watch for the new native formSubmittedByJavascript event, and trigger the legacy YUI event.\n document.addEventListener(eventTypes.formSubmittedByJavascript, e => {\n if (e.detail.fallbackHandled) {\n // This event was originally generated by a YUI event.\n // Do not generate another as this will recurse.\n return;\n }\n\n if (e.skipValidation) {\n window.skipClientValidation = true;\n }\n\n // Trigger the legacy YUI event.\n const form = Y.one(e.target);\n form.fire(\n M.core.event.FORM_SUBMIT_AJAX,\n {\n currentTarget: form,\n fallbackHandled: true,\n }\n );\n\n if (e.skipValidation) {\n window.skipClientValidation = false;\n }\n });\n });\n\n // Watch for the new native formFieldValidationFailed event, and trigger the legacy jQuery event.\n document.addEventListener(eventTypes.formFieldValidationFailed, e => {\n // Note: The \"core_form-field-validation\" event is hard-coded in core/event.\n // This is not included to prevent cyclic module dependencies.\n const legacyEvent = jQuery.Event(\"core_form-field-validation\");\n\n jQuery(e.target).trigger(legacyEvent, e.detail.message);\n });\n\n legacyEventsRegistered = true;\n}\n"],"file":"events.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/events.js"],"names":["changesMadeString","then","string","catch","changesMadeCheck","e","returnValue","eventTypes","formError","formSubmittedByJavascript","formFieldValidationFailed","uploadStarted","uploadCompleted","notifyFormError","field","notifyFormSubmittedByJavascript","form","skipValidation","fallbackHandled","window","skipClientValidation","customEvent","notifyFieldValidationFailure","message","cancelable","notifyUploadStarted","elementId","addEventListener","document","getElementById","bubbles","cancellable","notifyUploadCompleted","removeEventListener","legacyEventsRegistered","Y","use","element","one","target","formElement","closest","Global","fire","M","core","globalEvents","FORM_ERROR","formid","generateID","elementid","detail","event","FORM_SUBMIT_AJAX","currentTarget","legacyEvent","jQuery","Event","trigger"],"mappings":"6XAgHA,OACA,O,mDA9EA,GAAIA,CAAAA,CAAJ,CACA,iBAAU,yBAAV,CAAqC,QAArC,EAA+CC,IAA/C,CAAoD,SAAAC,CAAM,CAAI,CAC1DF,CAAiB,CAAGE,CAApB,CACA,MAAOA,CAAAA,CACV,CAHD,EAGGC,KAHH,G,GASMC,CAAAA,CAAgB,CAAG,SAAAC,CAAC,CAAI,CAC1B,GAAIA,CAAJ,CAAO,CACHA,CAAC,CAACC,WAAF,CAAgBN,CACnB,CACJ,C,CAUYO,CAAU,CAAG,CAQtBC,SAAS,CAAE,iBARW,CAoBtBC,yBAAyB,CAAE,iCApBL,CA+BtBC,yBAAyB,CAAE,iCA/BL,CAwCtBC,aAAa,CAAE,yBAxCO,CAiDtBC,eAAe,CAAE,2BAjDK,C,kCAgEK,QAAlBC,CAAAA,eAAkB,CAAAC,CAAK,QAAI,oBAAcP,CAAU,CAACC,SAAzB,CAAoC,EAApC,CAAwCM,CAAxC,CAAJ,C,mCAYW,QAAlCC,CAAAA,+BAAkC,CAACC,CAAD,CAA2D,IAApDC,CAAAA,CAAoD,2DAA5BC,CAA4B,2DACtG,GAAID,CAAJ,CAAoB,CAChBE,MAAM,CAACC,oBAAP,GACH,CAED,GAAMC,CAAAA,CAAW,CAAG,oBAChBd,CAAU,CAACE,yBADK,CAEhB,CACI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,GAAF,CAAMjC,CAAC,CAACkC,MAAR,CADiC,CAE3CC,CAAW,CAAGL,UAAEG,GAAF,CAAMjC,CAAC,CAACkC,MAAF,CAASE,OAAT,CAAiB,MAAjB,CAAN,CAF6B,CAIjDN,UAAEO,MAAF,CAASC,IAAT,CACIC,CAAC,CAACC,IAAF,CAAOC,YAAP,CAAoBC,UADxB,CAEI,CACIC,MAAM,CAAER,CAAW,CAACS,UAAZ,EADZ,CAEIC,SAAS,CAAEb,CAAO,CAACY,UAAR,EAFf,CAFJ,CAOH,CAXD,EAcArB,QAAQ,CAACD,gBAAT,CAA0BpB,CAAU,CAACE,yBAArC,CAAgE,SAAAJ,CAAC,CAAI,CACjE,GAAIA,CAAC,CAAC8C,MAAF,CAASjC,eAAb,CAA8B,CAG1B,MACH,CAED,GAAIb,CAAC,CAACY,cAAN,CAAsB,CAClBE,MAAM,CAACC,oBAAP,GACH,CAGD,GAAMJ,CAAAA,CAAI,CAAGmB,UAAEG,GAAF,CAAMjC,CAAC,CAACkC,MAAR,CAAb,CACAvB,CAAI,CAAC2B,IAAL,CACIC,CAAC,CAACC,IAAF,CAAOO,KAAP,CAAaC,gBADjB,CAEI,CACIC,aAAa,CAAEtC,CADnB,CAEIE,eAAe,GAFnB,CAFJ,EAQA,GAAIb,CAAC,CAACY,cAAN,CAAsB,CAClBE,MAAM,CAACC,oBAAP,GACH,CACJ,CAxBD,CAyBH,CA1CD,EA6CAQ,QAAQ,CAACD,gBAAT,CAA0BpB,CAAU,CAACG,yBAArC,CAAgE,SAAAL,CAAC,CAAI,CAGjE,GAAMkD,CAAAA,CAAW,CAAGC,UAAOC,KAAP,CAAa,4BAAb,CAApB,CAEA,cAAOpD,CAAC,CAACkC,MAAT,EAAiBmB,OAAjB,CAAyBH,CAAzB,CAAsClD,CAAC,CAAC8C,MAAF,CAAS5B,OAA/C,CACH,CAND,EAQAW,CAAsB,GACzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript events for the `core_form` subsystem.\n *\n * @module core_form/events\n * @copyright 2021 Huong Nguyen \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.10\n *\n * @example \n * import {eventTypes as formEventTypes} from 'core_form/events';\n *\n * document.addEventListener(formEventTypes.formSubmittedByJavascript, e => {\n * window.console.log(e.target); // The form that was submitted.\n * window.console.log(e.detail.skipValidation); // Whether form validation was skipped.\n * });\n */\n\nimport {get_string as getString} from 'core/str';\nimport {dispatchEvent} from 'core/event_dispatcher';\n\nlet changesMadeString;\ngetString('changesmadereallygoaway', 'moodle').then(string => {\n changesMadeString = string;\n return string;\n}).catch();\n\n/**\n * Prevent user navigate away when upload progress still running.\n * @param {Event} e The event\n */\nconst changesMadeCheck = e => {\n if (e) {\n e.returnValue = changesMadeString;\n }\n};\n\n/**\n * Events for `core_form`.\n *\n * @constant\n * @property {String} formError See {@link event:formError}\n * @property {String} formFieldValidationFailed See {@link event:formFieldValidationFailed}\n * @property {String} formSubmittedByJavascript See {@link event:formSubmittedByJavascript}\n */\nexport const eventTypes = {\n /**\n * An event triggered when a form contains an error\n *\n * @event formError\n * @type {CustomEvent}\n * @property {HTMLElement} target The form field which errored\n */\n formError: 'core_form/error',\n\n /**\n * An event triggered when an mform is about to be submitted via javascript.\n *\n * @event formSubmittedByJavascript\n * @type {CustomEvent}\n * @property {HTMLElement} target The form that was submitted\n * @property {object} detail\n * @property {boolean} detail.skipValidation Whether the form was submitted without validation (i.e. via a Cancel button)\n * @property {boolean} detail.fallbackHandled Whether the legacy YUI event has been handled\n */\n formSubmittedByJavascript: 'core_form/submittedByJavascript',\n\n /**\n * An event triggered upon form field validation failure.\n *\n * @event formFieldValidationFailed\n * @type {CustomEvent}\n * @property {HTMLElement} target The field that failed validation\n * @property {object} detail\n * @property {String} detail.message The message displayed upon failure\n */\n formFieldValidationFailed: 'core_form/fieldValidationFailed',\n\n /**\n * An event triggered when an upload is started\n *\n * @event uploadStarted\n * @type {CustomEvent}\n * @property {HTMLElement} target The location where the upload began\n */\n uploadStarted: 'core_form/uploadStarted',\n\n /**\n * An event triggered when an upload completes\n *\n * @event uploadCompleted\n * @type {CustomEvent}\n * @property {HTMLElement} target The location where the upload completd\n */\n uploadCompleted: 'core_form/uploadCompleted',\n};\n\n// These are only imported for legacy.\nimport jQuery from 'jquery';\nimport Y from 'core/yui';\n\n/**\n * Trigger an event to indicate that a form field contained an error.\n *\n * @method notifyFormError\n * @param {HTMLElement} field The form field causing the error\n * @returns {CustomEvent}\n * @fires formError\n */\nexport const notifyFormError = field => dispatchEvent(eventTypes.formError, {}, field);\n\n/**\n * Trigger an event to indiciate that a form was submitted by Javascript.\n *\n * @method\n * @param {HTMLElement} form The form that was submitted\n * @param {Boolean} skipValidation Submit the form without validation. E.g. \"Cancel\".\n * @param {Boolean} fallbackHandled The legacy YUI event has been handled\n * @returns {CustomEvent}\n * @fires formSubmittedByJavascript\n */\nexport const notifyFormSubmittedByJavascript = (form, skipValidation = false, fallbackHandled = false) => {\n if (skipValidation) {\n window.skipClientValidation = true;\n }\n\n const customEvent = dispatchEvent(\n eventTypes.formSubmittedByJavascript,\n {\n skipValidation,\n fallbackHandled,\n },\n form\n );\n\n if (skipValidation) {\n window.skipClientValidation = false;\n }\n\n return customEvent;\n};\n\n/**\n * Trigger an event to indicate that a form field contained an error.\n *\n * @method notifyFieldValidationFailure\n * @param {HTMLElement} field The field which failed validation\n * @param {String} message The message displayed\n * @returns {CustomEvent}\n * @fires formFieldValidationFailed\n */\nexport const notifyFieldValidationFailure = (field, message) => dispatchEvent(\n eventTypes.formFieldValidationFailed,\n {\n message,\n },\n field,\n {\n cancelable: true\n }\n);\n\n/**\n * Trigger an event to indicate that an upload was started.\n *\n * @method\n * @param {String} elementId The element which was uploaded to\n * @returns {CustomEvent}\n * @fires uploadStarted\n */\nexport const notifyUploadStarted = elementId => {\n // Add an additional check for changes made.\n window.addEventListener('beforeunload', changesMadeCheck);\n\n return dispatchEvent(\n eventTypes.uploadStarted,\n {},\n document.getElementById(elementId),\n {\n bubbles: true,\n cancellable: false,\n }\n );\n};\n\n/**\n * Trigger an event to indicate that an upload was completed.\n *\n * @method\n * @param {String} elementId The element which was uploaded to\n * @returns {CustomEvent}\n * @fires uploadCompleted\n */\nexport const notifyUploadCompleted = elementId => {\n // Remove the additional check for changes made.\n window.removeEventListener('beforeunload', changesMadeCheck);\n\n return dispatchEvent(\n eventTypes.uploadCompleted,\n {},\n document.getElementById(elementId),\n {\n bubbles: true,\n cancellable: false,\n }\n );\n};\n\n/**\n * Trigger upload start event.\n *\n * @method\n * @param {String} elementId\n * @returns {CustomEvent}\n * @fires uploadStarted\n * @deprecated Since Moodle 4.0 See {@link module:core_form/events.notifyUploadStarted notifyUploadStarted}\n */\nexport const triggerUploadStarted = notifyUploadStarted;\n\n/**\n * Trigger upload complete event.\n *\n * @method\n * @param {String} elementId\n * @returns {CustomEvent}\n * @fires uploadCompleted\n * @deprecated Since Moodle 4.0 See {@link module:core_form/events.notifyUploadCompleted notifyUploadCompleted}\n */\nexport const triggerUploadCompleted = notifyUploadCompleted;\n\n/**\n * List of the events.\n *\n * @deprecated since Moodle 4.0. See {@link module:core_form/events.eventTypes eventTypes} instead.\n **/\nexport const types = {\n uploadStarted: 'core_form/uploadStarted',\n uploadCompleted: 'core_form/uploadCompleted',\n};\n\nlet legacyEventsRegistered = false;\nif (!legacyEventsRegistered) {\n // The following event triggers are legacy and will be removed in the future.\n // The following approach provides a backwards-compatability layer for the new events.\n // Code should be updated to make use of native events.\n Y.use('event', 'moodle-core-event', () => {\n\n // Watch for the new native formError event, and trigger the legacy YUI event.\n document.addEventListener(eventTypes.formError, e => {\n const element = Y.one(e.target);\n const formElement = Y.one(e.target.closest('form'));\n\n Y.Global.fire(\n M.core.globalEvents.FORM_ERROR,\n {\n formid: formElement.generateID(),\n elementid: element.generateID(),\n }\n );\n });\n\n // Watch for the new native formSubmittedByJavascript event, and trigger the legacy YUI event.\n document.addEventListener(eventTypes.formSubmittedByJavascript, e => {\n if (e.detail.fallbackHandled) {\n // This event was originally generated by a YUI event.\n // Do not generate another as this will recurse.\n return;\n }\n\n if (e.skipValidation) {\n window.skipClientValidation = true;\n }\n\n // Trigger the legacy YUI event.\n const form = Y.one(e.target);\n form.fire(\n M.core.event.FORM_SUBMIT_AJAX,\n {\n currentTarget: form,\n fallbackHandled: true,\n }\n );\n\n if (e.skipValidation) {\n window.skipClientValidation = false;\n }\n });\n });\n\n // Watch for the new native formFieldValidationFailed event, and trigger the legacy jQuery event.\n document.addEventListener(eventTypes.formFieldValidationFailed, e => {\n // Note: The \"core_form-field-validation\" event is hard-coded in core/event.\n // This is not included to prevent cyclic module dependencies.\n const legacyEvent = jQuery.Event(\"core_form-field-validation\");\n\n jQuery(e.target).trigger(legacyEvent, e.detail.message);\n });\n\n legacyEventsRegistered = true;\n}\n"],"file":"events.min.js"} \ No newline at end of file diff --git a/lib/form/amd/build/passwordunmask.min.js.map b/lib/form/amd/build/passwordunmask.min.js.map index 8adc2f6b41a5d..13806fc896db8 100644 --- a/lib/form/amd/build/passwordunmask.min.js.map +++ b/lib/form/amd/build/passwordunmask.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/passwordunmask.js"],"names":["define","$","Template","PasswordUnmask","elementid","wrapperSelector","wrapper","editorSpace","find","editLink","editInstructions","displayValue","inputFieldLabel","inputField","document","getElementById","attr","removeClass","hide","setDisplayValue","addListeners","prototype","on","proxy","e","type","keyCode","stopImmediatePropagation","preventDefault","relatedTarget","is","turnEditingOff","turnEditingOn","data","checkFocusOut","isEditing","window","setTimeout","activeElement","has","length","passwordVisible","value","getDisplayValue","val","show","focus","select","focusOnEditLink","off","removeAttr","text","render","element","frozen","valuechars","split","done","html","js","runTemplateJS"],"mappings":"AAwBAA,OAAM,4BAAC,CAAC,QAAD,CAAW,gBAAX,CAAD,CAA+B,SAASC,CAAT,CAAYC,CAAZ,CAAsB,CAOvD,GAAIC,CAAAA,CAAc,CAAG,SAASC,CAAT,CAAoB,CAErC,KAAKC,eAAL,CAAuB,6DAA4DD,CAA5D,CAAwE,KAA/F,CACA,KAAKE,OAAL,CAAeL,CAAC,CAAC,KAAKI,eAAN,CAAhB,CACA,KAAKE,WAAL,CAAmB,KAAKD,OAAL,CAAaE,IAAb,CAAkB,kCAAlB,CAAnB,CACA,KAAKC,QAAL,CAAgB,KAAKH,OAAL,CAAaE,IAAb,CAAkB,iCAAlB,CAAhB,CACA,KAAKE,gBAAL,CAAwB,KAAKJ,OAAL,CAAaE,IAAb,CAAkB,wCAAlB,CAAxB,CACA,KAAKG,YAAL,CAAoB,KAAKL,OAAL,CAAaE,IAAb,CAAkB,wCAAlB,CAApB,CACA,KAAKI,eAAL,CAAuBX,CAAC,CAAC,eAAgBG,CAAhB,CAA4B,KAA7B,CAAxB,CAEA,KAAKS,UAAL,CAAkB,KAAKN,WAAL,CAAiBC,IAAjB,CAAsBM,QAAQ,CAACC,cAAT,CAAwBX,CAAxB,CAAtB,CAAlB,CACA,KAAKS,UAAL,CAAgBG,IAAhB,CAAqB,MAArB,CAA6B,QAA7B,EACA,KAAKH,UAAL,CAAgBI,WAAhB,CAA4B,YAA5B,EAEA,GAAI,CAAC,KAAKP,gBAAL,CAAsBM,IAAtB,CAA2B,IAA3B,CAAL,CAAuC,CACnC,KAAKN,gBAAL,CAAsBM,IAAtB,CAA2B,IAA3B,CAAiCZ,CAAS,CAAG,eAA7C,CACH,CACD,KAAKM,gBAAL,CAAsBQ,IAAtB,GAEA,KAAKC,eAAL,GAGA,KAAKC,YAAL,EACH,CAvBD,CAgCAjB,CA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CAAmB,YAAnB,CADP,CAELY,KAAK,CAAOA,CAFP,CAGLa,UAAU,CAAEb,CAAK,CAACc,KAAN,CAAY,EAAZ,CAHP,CAD4C,CAAzD,EAMGC,IANH,CAMQxD,CAAC,CAACsB,KAAF,CAAQ,SAASmC,CAAT,CAAeC,CAAf,CAAmB,CAC/B,KAAKhD,YAAL,CAAkB+C,IAAlB,CAAuBA,CAAvB,EAEAxD,CAAQ,CAAC0D,aAAT,CAAuBD,CAAvB,CACH,CAJO,CAIL,IAJK,CANR,CAWH,CAED,MAAO,KACV,CAtCD,CAwCA,MAAOxD,CAAAA,CACV,CAhRK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Password Unmask functionality.\n *\n * @module core_form/passwordunmask\n * @class passwordunmask\n * @copyright 2016 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.2\n */\ndefine(['jquery', 'core/templates'], function($, Template) {\n\n /**\n * Constructor for PasswordUnmask.\n *\n * @param {String} elementid The element to apply the PasswordUnmask to\n */\n var PasswordUnmask = function(elementid) {\n // Setup variables.\n this.wrapperSelector = '[data-passwordunmask=\"wrapper\"][data-passwordunmaskid=\"' + elementid + '\"]';\n this.wrapper = $(this.wrapperSelector);\n this.editorSpace = this.wrapper.find('[data-passwordunmask=\"editor\"]');\n this.editLink = this.wrapper.find('a[data-passwordunmask=\"edit\"]');\n this.editInstructions = this.wrapper.find('[data-passwordunmask=\"instructions\"]');\n this.displayValue = this.wrapper.find('[data-passwordunmask=\"displayvalue\"]');\n this.inputFieldLabel = $('label[for=\"' + elementid + '\"]');\n\n this.inputField = this.editorSpace.find(document.getElementById(elementid));\n this.inputField.attr('type', 'hidden');\n this.inputField.removeClass('hiddenifjs');\n\n if (!this.editInstructions.attr('id')) {\n this.editInstructions.attr('id', elementid + '_instructions');\n }\n this.editInstructions.hide();\n\n this.setDisplayValue();\n\n // Add the listeners.\n this.addListeners();\n };\n\n /**\n * Add the event listeners required for PasswordUnmask.\n *\n * @method addListeners\n * @return {PasswordUnmask}\n * @chainable\n */\n PasswordUnmask.prototype.addListeners = function() {\n this.wrapper.on('click keypress', '[data-passwordunmask=\"edit\"]', $.proxy(function(e) {\n if (e.type === 'keypress' && e.keyCode !== 13) {\n return;\n }\n e.stopImmediatePropagation();\n e.preventDefault();\n\n if (this.inputField.attr('type') !== 'hidden') {\n // Only focus on the edit link if the event was not a click, and the new target is not an input field.\n if (e.type !== 'click' && !$(e.relatedTarget).is(':input')) {\n this.turnEditingOff(true);\n } else {\n this.turnEditingOff(false);\n }\n } else {\n this.turnEditingOn();\n }\n }, this));\n\n this.wrapper.on('click keypress', '[data-passwordunmask=\"unmask\"]', $.proxy(function(e) {\n if (e.type === 'keypress' && e.keyCode !== 13) {\n return;\n }\n e.stopImmediatePropagation();\n e.preventDefault();\n\n // Toggle the data attribute.\n this.wrapper.data('unmasked', !this.wrapper.data('unmasked'));\n\n this.setDisplayValue();\n }, this));\n\n this.wrapper.on('keydown', 'input', $.proxy(function(e) {\n if (e.type === 'keydown' && e.keyCode !== 13) {\n return;\n }\n\n e.stopImmediatePropagation();\n e.preventDefault();\n\n this.turnEditingOff(true);\n }, this));\n\n this.inputFieldLabel.on('click', $.proxy(function(e) {\n e.preventDefault();\n\n this.turnEditingOn();\n }, this));\n\n return this;\n };\n\n /**\n * Check whether focus was lost from the PasswordUnmask and turn editing off if required.\n *\n * @method checkFocusOut\n * @param {EventFacade} e The EventFacade generating the suspsected Focus Out\n */\n PasswordUnmask.prototype.checkFocusOut = function(e) {\n if (!this.isEditing()) {\n // Ignore - not editing.\n return;\n }\n\n window.setTimeout($.proxy(function() {\n // Firefox does not have the focusout event. Instead jQuery falls back to the 'blur' event.\n // The blur event does not have a relatedTarget, so instead we use a timeout and the new activeElement.\n var relatedTarget = e.relatedTarget || document.activeElement;\n if (this.wrapper.has($(relatedTarget)).length) {\n // Ignore, some part of the element is still active.\n return;\n }\n\n // Only focus on the edit link if the new related target is not an input field or anchor.\n this.turnEditingOff(!$(relatedTarget).is(':input,a'));\n }, this), 100);\n };\n\n /**\n * Whether the password is currently visible (unmasked).\n *\n * @method passwordVisible\n * @return {Boolean} True if the password is unmasked\n */\n PasswordUnmask.prototype.passwordVisible = function() {\n return !!this.wrapper.data('unmasked');\n };\n\n /**\n * Whether the user is currently editing the field.\n *\n * @method isEditing\n * @return {Boolean} True if edit mode is enabled\n */\n PasswordUnmask.prototype.isEditing = function() {\n return this.inputField.attr('type') !== 'hidden';\n };\n\n /**\n * Enable the editing functionality.\n *\n * @method turnEditingOn\n * @return {PasswordUnmask}\n * @chainable\n */\n PasswordUnmask.prototype.turnEditingOn = function() {\n var value = this.getDisplayValue();\n if (this.passwordVisible()) {\n this.inputField.attr('type', 'text');\n } else {\n this.inputField.attr('type', 'password');\n }\n this.inputField.val(value);\n this.inputField.attr('size', this.inputField.attr('data-size'));\n\n if (this.editInstructions.length) {\n this.inputField.attr('aria-describedby', this.editInstructions.attr('id'));\n this.editInstructions.show();\n }\n\n this.wrapper.attr('data-passwordunmask-visible', 1);\n\n this.editLink.hide();\n this.inputField\n .focus()\n .select();\n\n // Note, this cannot be added as a delegated listener on init because Firefox does not support the FocusOut\n // event (https://bugzilla.mozilla.org/show_bug.cgi?id=687787) and the blur event does not identify the\n // relatedTarget.\n // The act of focusing the this.inputField means that in Firefox the focusout will be triggered on blur of the edit\n // link anchor.\n $('body').on('focusout', this.wrapperSelector, $.proxy(this.checkFocusOut, this));\n\n return this;\n };\n\n /**\n * Disable the editing functionality, optionally focusing on the edit link.\n *\n * @method turnEditingOff\n * @param {Boolean} focusOnEditLink Whether to focus on the edit link after disabling the editor\n * @return {PasswordUnmask}\n * @chainable\n */\n PasswordUnmask.prototype.turnEditingOff = function(focusOnEditLink) {\n $('body').off('focusout', this.wrapperSelector, this.checkFocusOut);\n var value = this.getDisplayValue();\n this.inputField\n // Hide the field again.\n .attr('type', 'hidden')\n\n // Ensure that the aria-describedby is removed.\n .attr('aria-describedby', null);\n this.inputField.val(value);\n\n this.editInstructions.hide();\n\n // Remove the visible attr.\n this.wrapper.removeAttr('data-passwordunmask-visible');\n\n // Remove the size attr.\n this.inputField.removeAttr('size');\n\n this.editLink.show();\n this.setDisplayValue();\n\n if (focusOnEditLink) {\n this.editLink.focus();\n }\n\n return this;\n };\n\n /**\n * Get the currently value.\n *\n * @method getDisplayValue\n * @return {String}\n */\n PasswordUnmask.prototype.getDisplayValue = function() {\n return this.inputField.val();\n };\n\n /**\n * Set the currently value in the display, taking into account the current settings.\n *\n * @method setDisplayValue\n * @return {PasswordUnmask}\n * @chainable\n */\n PasswordUnmask.prototype.setDisplayValue = function() {\n var value = this.getDisplayValue();\n if (this.isEditing()) {\n if (this.wrapper.data('unmasked')) {\n this.inputField.attr('type', 'text');\n } else {\n this.inputField.attr('type', 'password');\n }\n this.inputField.val(value);\n }\n\n // Update the display value.\n // Note: This must always be updated.\n // The unmask value can be changed whilst editing and the editing can then be disabled.\n if (value && this.wrapper.data('unmasked')) {\n // There is a value, and we will show it.\n this.displayValue.text(value);\n } else {\n if (!value) {\n value = \"\";\n }\n // There is a value, but it will be disguised.\n // We use the passwordunmask-fill to allow modification of the fill and to ensure that the display does not\n // change as the page loads the JS.\n Template.render('core_form/element-passwordunmask-fill', {\n element: {\n frozen: this.inputField.is('[readonly]'),\n value: value,\n valuechars: value.split(''),\n },\n }).done($.proxy(function(html, js) {\n this.displayValue.html(html);\n\n Template.runTemplateJS(js);\n }, this));\n }\n\n return this;\n };\n\n return PasswordUnmask;\n});\n"],"file":"passwordunmask.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/passwordunmask.js"],"names":["define","$","Template","PasswordUnmask","elementid","wrapperSelector","wrapper","editorSpace","find","editLink","editInstructions","displayValue","inputFieldLabel","inputField","document","getElementById","attr","removeClass","hide","setDisplayValue","addListeners","prototype","on","proxy","e","type","keyCode","stopImmediatePropagation","preventDefault","relatedTarget","is","turnEditingOff","turnEditingOn","data","checkFocusOut","isEditing","window","setTimeout","activeElement","has","length","passwordVisible","value","getDisplayValue","val","show","focus","select","focusOnEditLink","off","removeAttr","text","render","element","frozen","valuechars","split","done","html","js","runTemplateJS"],"mappings":"AAuBAA,OAAM,4BAAC,CAAC,QAAD,CAAW,gBAAX,CAAD,CAA+B,SAASC,CAAT,CAAYC,CAAZ,CAAsB,CAQvD,GAAIC,CAAAA,CAAc,CAAG,SAASC,CAAT,CAAoB,CAErC,KAAKC,eAAL,CAAuB,6DAA4DD,CAA5D,CAAwE,KAA/F,CACA,KAAKE,OAAL,CAAeL,CAAC,CAAC,KAAKI,eAAN,CAAhB,CACA,KAAKE,WAAL,CAAmB,KAAKD,OAAL,CAAaE,IAAb,CAAkB,kCAAlB,CAAnB,CACA,KAAKC,QAAL,CAAgB,KAAKH,OAAL,CAAaE,IAAb,CAAkB,iCAAlB,CAAhB,CACA,KAAKE,gBAAL,CAAwB,KAAKJ,OAAL,CAAaE,IAAb,CAAkB,wCAAlB,CAAxB,CACA,KAAKG,YAAL,CAAoB,KAAKL,OAAL,CAAaE,IAAb,CAAkB,wCAAlB,CAApB,CACA,KAAKI,eAAL,CAAuBX,CAAC,CAAC,eAAgBG,CAAhB,CAA4B,KAA7B,CAAxB,CAEA,KAAKS,UAAL,CAAkB,KAAKN,WAAL,CAAiBC,IAAjB,CAAsBM,QAAQ,CAACC,cAAT,CAAwBX,CAAxB,CAAtB,CAAlB,CACA,KAAKS,UAAL,CAAgBG,IAAhB,CAAqB,MAArB,CAA6B,QAA7B,EACA,KAAKH,UAAL,CAAgBI,WAAhB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AAb,CAAkB,UAAlB,CAAb,CAA4C,CAExC,KAAKtB,YAAL,CAAkBwC,IAAlB,CAAuBT,CAAvB,CACH,CAHD,IAGO,CACH,GAAI,CAACA,CAAL,CAAY,CACRA,CAAK,CAAG,EACX,CAIDxC,CAAQ,CAACkD,MAAT,CAAgB,uCAAhB,CAAyD,CACrDC,OAAO,CAAE,CACLC,MAAM,CAAM,KAAKzC,UAAL,CAAgBiB,EAAhB,CAAmB,YAAnB,CADP,CAELY,KAAK,CAAOA,CAFP,CAGLa,UAAU,CAAEb,CAAK,CAACc,KAAN,CAAY,EAAZ,CAHP,CAD4C,CAAzD,EAMGC,IANH,CAMQxD,CAAC,CAACsB,KAAF,CAAQ,SAASmC,CAAT,CAAeC,CAAf,CAAmB,CAC/B,KAAKhD,YAAL,CAAkB+C,IAAlB,CAAuBA,CAAvB,EAEAxD,CAAQ,CAAC0D,aAAT,CAAuBD,CAAvB,CACH,CAJO,CAIL,IAJK,CANR,CAWH,CAED,MAAO,KACV,CAtCD,CAwCA,MAAOxD,CAAAA,CACV,CAjRK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Password Unmask functionality.\n *\n * @module core_form/passwordunmask\n * @copyright 2016 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.2\n */\ndefine(['jquery', 'core/templates'], function($, Template) {\n\n /**\n * Constructor for PasswordUnmask.\n *\n * @class core_form/passwordunmask\n * @param {String} elementid The element to apply the PasswordUnmask to\n */\n var PasswordUnmask = function(elementid) {\n // Setup variables.\n this.wrapperSelector = '[data-passwordunmask=\"wrapper\"][data-passwordunmaskid=\"' + elementid + '\"]';\n this.wrapper = $(this.wrapperSelector);\n this.editorSpace = this.wrapper.find('[data-passwordunmask=\"editor\"]');\n this.editLink = this.wrapper.find('a[data-passwordunmask=\"edit\"]');\n this.editInstructions = this.wrapper.find('[data-passwordunmask=\"instructions\"]');\n this.displayValue = this.wrapper.find('[data-passwordunmask=\"displayvalue\"]');\n this.inputFieldLabel = $('label[for=\"' + elementid + '\"]');\n\n this.inputField = this.editorSpace.find(document.getElementById(elementid));\n this.inputField.attr('type', 'hidden');\n this.inputField.removeClass('hiddenifjs');\n\n if (!this.editInstructions.attr('id')) {\n this.editInstructions.attr('id', elementid + '_instructions');\n }\n this.editInstructions.hide();\n\n this.setDisplayValue();\n\n // Add the listeners.\n this.addListeners();\n };\n\n /**\n * Add the event listeners required for PasswordUnmask.\n *\n * @method addListeners\n * @return {PasswordUnmask}\n * @chainable\n */\n PasswordUnmask.prototype.addListeners = function() {\n this.wrapper.on('click keypress', '[data-passwordunmask=\"edit\"]', $.proxy(function(e) {\n if (e.type === 'keypress' && e.keyCode !== 13) {\n return;\n }\n e.stopImmediatePropagation();\n e.preventDefault();\n\n if (this.inputField.attr('type') !== 'hidden') {\n // Only focus on the edit link if the event was not a click, and the new target is not an input field.\n if (e.type !== 'click' && !$(e.relatedTarget).is(':input')) {\n this.turnEditingOff(true);\n } else {\n this.turnEditingOff(false);\n }\n } else {\n this.turnEditingOn();\n }\n }, this));\n\n this.wrapper.on('click keypress', '[data-passwordunmask=\"unmask\"]', $.proxy(function(e) {\n if (e.type === 'keypress' && e.keyCode !== 13) {\n return;\n }\n e.stopImmediatePropagation();\n e.preventDefault();\n\n // Toggle the data attribute.\n this.wrapper.data('unmasked', !this.wrapper.data('unmasked'));\n\n this.setDisplayValue();\n }, this));\n\n this.wrapper.on('keydown', 'input', $.proxy(function(e) {\n if (e.type === 'keydown' && e.keyCode !== 13) {\n return;\n }\n\n e.stopImmediatePropagation();\n e.preventDefault();\n\n this.turnEditingOff(true);\n }, this));\n\n this.inputFieldLabel.on('click', $.proxy(function(e) {\n e.preventDefault();\n\n this.turnEditingOn();\n }, this));\n\n return this;\n };\n\n /**\n * Check whether focus was lost from the PasswordUnmask and turn editing off if required.\n *\n * @method checkFocusOut\n * @param {EventFacade} e The EventFacade generating the suspsected Focus Out\n */\n PasswordUnmask.prototype.checkFocusOut = function(e) {\n if (!this.isEditing()) {\n // Ignore - not editing.\n return;\n }\n\n window.setTimeout($.proxy(function() {\n // Firefox does not have the focusout event. Instead jQuery falls back to the 'blur' event.\n // The blur event does not have a relatedTarget, so instead we use a timeout and the new activeElement.\n var relatedTarget = e.relatedTarget || document.activeElement;\n if (this.wrapper.has($(relatedTarget)).length) {\n // Ignore, some part of the element is still active.\n return;\n }\n\n // Only focus on the edit link if the new related target is not an input field or anchor.\n this.turnEditingOff(!$(relatedTarget).is(':input,a'));\n }, this), 100);\n };\n\n /**\n * Whether the password is currently visible (unmasked).\n *\n * @method passwordVisible\n * @return {Boolean} True if the password is unmasked\n */\n PasswordUnmask.prototype.passwordVisible = function() {\n return !!this.wrapper.data('unmasked');\n };\n\n /**\n * Whether the user is currently editing the field.\n *\n * @method isEditing\n * @return {Boolean} True if edit mode is enabled\n */\n PasswordUnmask.prototype.isEditing = function() {\n return this.inputField.attr('type') !== 'hidden';\n };\n\n /**\n * Enable the editing functionality.\n *\n * @method turnEditingOn\n * @return {PasswordUnmask}\n * @chainable\n */\n PasswordUnmask.prototype.turnEditingOn = function() {\n var value = this.getDisplayValue();\n if (this.passwordVisible()) {\n this.inputField.attr('type', 'text');\n } else {\n this.inputField.attr('type', 'password');\n }\n this.inputField.val(value);\n this.inputField.attr('size', this.inputField.attr('data-size'));\n\n if (this.editInstructions.length) {\n this.inputField.attr('aria-describedby', this.editInstructions.attr('id'));\n this.editInstructions.show();\n }\n\n this.wrapper.attr('data-passwordunmask-visible', 1);\n\n this.editLink.hide();\n this.inputField\n .focus()\n .select();\n\n // Note, this cannot be added as a delegated listener on init because Firefox does not support the FocusOut\n // event (https://bugzilla.mozilla.org/show_bug.cgi?id=687787) and the blur event does not identify the\n // relatedTarget.\n // The act of focusing the this.inputField means that in Firefox the focusout will be triggered on blur of the edit\n // link anchor.\n $('body').on('focusout', this.wrapperSelector, $.proxy(this.checkFocusOut, this));\n\n return this;\n };\n\n /**\n * Disable the editing functionality, optionally focusing on the edit link.\n *\n * @method turnEditingOff\n * @param {Boolean} focusOnEditLink Whether to focus on the edit link after disabling the editor\n * @return {PasswordUnmask}\n * @chainable\n */\n PasswordUnmask.prototype.turnEditingOff = function(focusOnEditLink) {\n $('body').off('focusout', this.wrapperSelector, this.checkFocusOut);\n var value = this.getDisplayValue();\n this.inputField\n // Hide the field again.\n .attr('type', 'hidden')\n\n // Ensure that the aria-describedby is removed.\n .attr('aria-describedby', null);\n this.inputField.val(value);\n\n this.editInstructions.hide();\n\n // Remove the visible attr.\n this.wrapper.removeAttr('data-passwordunmask-visible');\n\n // Remove the size attr.\n this.inputField.removeAttr('size');\n\n this.editLink.show();\n this.setDisplayValue();\n\n if (focusOnEditLink) {\n this.editLink.focus();\n }\n\n return this;\n };\n\n /**\n * Get the currently value.\n *\n * @method getDisplayValue\n * @return {String}\n */\n PasswordUnmask.prototype.getDisplayValue = function() {\n return this.inputField.val();\n };\n\n /**\n * Set the currently value in the display, taking into account the current settings.\n *\n * @method setDisplayValue\n * @return {PasswordUnmask}\n * @chainable\n */\n PasswordUnmask.prototype.setDisplayValue = function() {\n var value = this.getDisplayValue();\n if (this.isEditing()) {\n if (this.wrapper.data('unmasked')) {\n this.inputField.attr('type', 'text');\n } else {\n this.inputField.attr('type', 'password');\n }\n this.inputField.val(value);\n }\n\n // Update the display value.\n // Note: This must always be updated.\n // The unmask value can be changed whilst editing and the editing can then be disabled.\n if (value && this.wrapper.data('unmasked')) {\n // There is a value, and we will show it.\n this.displayValue.text(value);\n } else {\n if (!value) {\n value = \"\";\n }\n // There is a value, but it will be disguised.\n // We use the passwordunmask-fill to allow modification of the fill and to ensure that the display does not\n // change as the page loads the JS.\n Template.render('core_form/element-passwordunmask-fill', {\n element: {\n frozen: this.inputField.is('[readonly]'),\n value: value,\n valuechars: value.split(''),\n },\n }).done($.proxy(function(html, js) {\n this.displayValue.html(html);\n\n Template.runTemplateJS(js);\n }, this));\n }\n\n return this;\n };\n\n return PasswordUnmask;\n});\n"],"file":"passwordunmask.min.js"} \ No newline at end of file diff --git a/lib/form/amd/build/showadvanced.min.js.map b/lib/form/amd/build/showadvanced.min.js.map index 02bef37add7f9..a6848402d1760 100644 --- a/lib/form/amd/build/showadvanced.min.js.map +++ b/lib/form/amd/build/showadvanced.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/showadvanced.js"],"names":["define","$","Log","Strings","Notification","SELECTORS","FIELDSETCONTAINSADVANCED","DIVFITEMADVANCED","DIVADVANCEDSECTION","DIVFCONTAINER","MORELESSLINK","CSS","SHOW","MORELESSACTIONS","MORELESSTOGGLER","SHOWLESS","WRAPPERS","FITEM","FELEMENT","ADVANCEDDIV","uniqIdSeed","ShowAdvanced","id","form","document","getElementById","enhanceForm","prototype","fieldsets","find","each","index","item","enhanceFieldset","bind","on","switchState","e","which","generateId","node","prop","fieldset","statuselement","length","debug","get_strings","key","component","then","results","showmore","showless","morelesslink","addClass","val","html","attr","idlist","formadvancedsection","wrapAll","fitem","felement","append","before","fail","exception","preventDefault","target","closest","toggleClass","removeClass","init","formid"],"mappings":"AAuBAA,OAAM,0BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,UAAvB,CAAmC,mBAAnC,CAAD,CAA0D,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA0BC,CAA1B,CAAwC,IAEhGC,CAAAA,CAAS,CAAG,CACRC,wBAAwB,CAAE,mCADlB,CAERC,gBAAgB,CAAE,oBAFV,CAGRC,kBAAkB,CAAE,uBAHZ,CAIRC,aAAa,CAAE,gBAJP,CA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iB,eAAjB,CAAkC,MAAlC,CACH,CALD,IAKO,CACHd,CAAa,CAACY,GAAd,CAAkB,CAAlB,EACAtD,CAAC,CAACoC,CAAC,CAAC+B,MAAH,CAAD,CAAYG,WAAZ,CAAwB5D,CAAG,CAACI,QAA5B,EACAd,CAAC,CAACoC,CAAC,CAAC+B,MAAH,CAAD,CAAYZ,IAAZ,CAAiBL,CAAjB,EACAlD,CAAC,CAACoC,CAAC,CAAC+B,MAAH,CAAD,CAAYX,IAAZ,CAAiB,eAAjB,CAAkC,OAAlC,CACH,CACD,QACH,CA9BD,EA8BGQ,IA9BH,CA8BQ7D,CAAY,CAAC8D,SA9BrB,EAgCA,MAAO,KACV,CArCD,CAuCA,MAAO,CAOHM,IAAI,CAAE,cAASC,CAAT,CAAiB,CACnB,MAAO,IAAIpD,CAAAA,CAAJ,CAAiBoD,CAAjB,CACV,CATE,CAWV,CA1MK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A class to help show and hide advanced form content.\n *\n * @module core_form/showadvanced\n * @class showadvanced\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/log', 'core/str', 'core/notification'], function($, Log, Strings, Notification) {\n\n var SELECTORS = {\n FIELDSETCONTAINSADVANCED: 'fieldset.containsadvancedelements',\n DIVFITEMADVANCED: 'div.fitem.advanced',\n DIVADVANCEDSECTION: 'div#form-advanced-div',\n DIVFCONTAINER: 'div.fcontainer',\n MORELESSLINK: 'fieldset.containsadvancedelements .moreless-toggler'\n },\n CSS = {\n SHOW: 'show',\n MORELESSACTIONS: 'moreless-actions',\n MORELESSTOGGLER: 'moreless-toggler',\n SHOWLESS: 'moreless-less'\n },\n WRAPPERS = {\n FITEM: '
',\n FELEMENT: '
',\n ADVANCEDDIV: '
'\n },\n IDPREFIX = 'showadvancedid-';\n\n /** @property {Integer} uniqIdSeed Auto incrementing number used to generate ids. */\n var uniqIdSeed = 0;\n\n /**\n * ShowAdvanced behaviour class.\n * @param {String} id The id of the form.\n */\n var ShowAdvanced = function(id) {\n this.id = id;\n\n var form = $(document.getElementById(id));\n this.enhanceForm(form);\n };\n\n /** @property {String} id The form id to enhance. */\n ShowAdvanced.prototype.id = '';\n\n /**\n * @method enhanceForm\n * @param {JQuery} form JQuery selector representing the form\n * @return {ShowAdvanced}\n */\n ShowAdvanced.prototype.enhanceForm = function(form) {\n var fieldsets = form.find(SELECTORS.FIELDSETCONTAINSADVANCED);\n\n // Enhance each fieldset in the form matching the selector.\n fieldsets.each(function(index, item) {\n this.enhanceFieldset($(item));\n }.bind(this));\n\n // Attach some event listeners.\n // Subscribe more/less links to click event.\n form.on('click', SELECTORS.MORELESSLINK, this.switchState);\n\n // Subscribe to key events but filter for space or enter.\n form.on('keydown', SELECTORS.MORELESSLINK, function(e) {\n // Enter or space.\n if (e.which == 13 || e.which == 32) {\n return this.switchState(e);\n }\n return true;\n }.bind(this));\n return this;\n };\n\n\n /**\n * Generates a uniq id for the dom element it's called on unless the element already has an id.\n * The id is set on the dom node before being returned.\n *\n * @method generateId\n * @param {JQuery} node JQuery selector representing a single DOM Node.\n * @return {String}\n */\n ShowAdvanced.prototype.generateId = function(node) {\n var id = node.prop('id');\n if (typeof id === 'undefined') {\n id = IDPREFIX + (uniqIdSeed++);\n node.prop('id', id);\n }\n return id;\n };\n\n /**\n * @method enhanceFieldset\n * @param {JQuery} fieldset JQuery selector representing a fieldset\n * @return {ShowAdvanced}\n */\n ShowAdvanced.prototype.enhanceFieldset = function(fieldset) {\n var statuselement = $('input[name=mform_showmore_' + fieldset.prop('id') + ']');\n if (!statuselement.length) {\n Log.debug(\"M.form.showadvanced::processFieldset was called on an fieldset without a status field: '\" +\n fieldset.prop('id') + \"'\");\n return this;\n }\n\n // Fetch some strings.\n Strings.get_strings([{\n key: 'showmore',\n component: 'core_form'\n }, {\n key: 'showless',\n component: 'core_form'\n }]).then(function(results) {\n var showmore = results[0],\n showless = results[1];\n\n // Generate more/less links.\n var morelesslink = $('
');\n morelesslink.addClass(CSS.MORELESSTOGGLER);\n if (statuselement.val() === '0') {\n morelesslink.html(showmore);\n morelesslink.attr('aria-expanded', 'false');\n } else {\n morelesslink.html(showless);\n morelesslink.attr('aria-expanded', 'true');\n morelesslink.addClass(CSS.SHOWLESS);\n fieldset.find(SELECTORS.DIVFITEMADVANCED).addClass(CSS.SHOW);\n }\n // Build a list of advanced fieldsets.\n var idlist = [];\n fieldset.find(SELECTORS.DIVFITEMADVANCED).each(function(index, node) {\n idlist[idlist.length] = this.generateId($(node));\n }.bind(this));\n\n // Set aria attributes.\n morelesslink.attr('role', 'button');\n morelesslink.attr('aria-controls', 'form-advanced-div');\n\n var formadvancedsection = $(WRAPPERS.ADVANCEDDIV);\n fieldset.find(SELECTORS.DIVFITEMADVANCED).wrapAll(formadvancedsection);\n // Add elements to the DOM.\n var fitem = $(WRAPPERS.FITEM);\n fitem.addClass(CSS.MORELESSACTIONS);\n var felement = $(WRAPPERS.FELEMENT);\n felement.append(morelesslink);\n fitem.append(felement);\n\n fieldset.find(SELECTORS.DIVADVANCEDSECTION).before(fitem);\n return true;\n }.bind(this)).fail(Notification.exception);\n\n return this;\n };\n\n /**\n * @method switchState\n * @param {Event} e Event that triggered this action.\n * @return {Boolean}\n */\n ShowAdvanced.prototype.switchState = function(e) {\n e.preventDefault();\n\n // Fetch some strings.\n Strings.get_strings([{\n key: 'showmore',\n component: 'core_form'\n }, {\n key: 'showless',\n component: 'core_form'\n }]).then(function(results) {\n var showmore = results[0],\n showless = results[1],\n fieldset = $(e.target).closest(SELECTORS.FIELDSETCONTAINSADVANCED);\n\n // Toggle collapsed class.\n fieldset.find(SELECTORS.DIVFITEMADVANCED).toggleClass(CSS.SHOW);\n\n // Get corresponding hidden variable.\n var statuselement = $('input[name=mform_showmore_' + fieldset.prop('id') + ']');\n\n // Invert it and change the link text.\n if (statuselement.val() === '0') {\n statuselement.val(1);\n $(e.target).addClass(CSS.SHOWLESS);\n $(e.target).html(showless);\n $(e.target).attr('aria-expanded', 'true');\n } else {\n statuselement.val(0);\n $(e.target).removeClass(CSS.SHOWLESS);\n $(e.target).html(showmore);\n $(e.target).attr('aria-expanded', 'false');\n }\n return true;\n }).fail(Notification.exception);\n\n return this;\n };\n\n return {\n /**\n * Initialise this module.\n * @method init\n * @param {String} formid\n * @return {ShowAdvanced}\n */\n init: function(formid) {\n return new ShowAdvanced(formid);\n }\n };\n});\n"],"file":"showadvanced.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/showadvanced.js"],"names":["define","$","Log","Strings","Notification","SELECTORS","FIELDSETCONTAINSADVANCED","DIVFITEMADVANCED","DIVADVANCEDSECTION","DIVFCONTAINER","MORELESSLINK","CSS","SHOW","MORELESSACTIONS","MORELESSTOGGLER","SHOWLESS","WRAPPERS","FITEM","FELEMENT","ADVANCEDDIV","uniqIdSeed","ShowAdvanced","id","form","document","getElementById","enhanceForm","prototype","fieldsets","find","each","index","item","enhanceFieldset","bind","on","switchState","e","which","generateId","node","prop","fieldset","statuselement","length","debug","get_strings","key","component","then","results","showmore","showless","morelesslink","addClass","val","html","attr","idlist","formadvancedsection","wrapAll","fitem","felement","append","before","fail","exception","preventDefault","target","closest","toggleClass","removeClass","init","formid"],"mappings":"AAsBAA,OAAM,0BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,UAAvB,CAAmC,mBAAnC,CAAD,CAA0D,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA0BC,CAA1B,CAAwC,IAEhGC,CAAAA,CAAS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C,CAAC+B,MAAH,CAAD,CAAYZ,IAAZ,CAAiBJ,CAAjB,EACAnD,CAAC,CAACoC,CAAC,CAAC+B,MAAH,CAAD,CAAYX,IAAZ,CAAiB,eAAjB,CAAkC,MAAlC,CACH,CALD,IAKO,CACHd,CAAa,CAACY,GAAd,CAAkB,CAAlB,EACAtD,CAAC,CAACoC,CAAC,CAAC+B,MAAH,CAAD,CAAYG,WAAZ,CAAwB5D,CAAG,CAACI,QAA5B,EACAd,CAAC,CAACoC,CAAC,CAAC+B,MAAH,CAAD,CAAYZ,IAAZ,CAAiBL,CAAjB,EACAlD,CAAC,CAACoC,CAAC,CAAC+B,MAAH,CAAD,CAAYX,IAAZ,CAAiB,eAAjB,CAAkC,OAAlC,CACH,CACD,QACH,CA9BD,EA8BGQ,IA9BH,CA8BQ7D,CAAY,CAAC8D,SA9BrB,EAgCA,MAAO,KACV,CArCD,CAuCA,MAAO,CAOHM,IAAI,CAAE,cAASC,CAAT,CAAiB,CACnB,MAAO,IAAIpD,CAAAA,CAAJ,CAAiBoD,CAAjB,CACV,CATE,CAWV,CA5MK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A class to help show and hide advanced form content.\n *\n * @module core_form/showadvanced\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/log', 'core/str', 'core/notification'], function($, Log, Strings, Notification) {\n\n var SELECTORS = {\n FIELDSETCONTAINSADVANCED: 'fieldset.containsadvancedelements',\n DIVFITEMADVANCED: 'div.fitem.advanced',\n DIVADVANCEDSECTION: 'div#form-advanced-div',\n DIVFCONTAINER: 'div.fcontainer',\n MORELESSLINK: 'fieldset.containsadvancedelements .moreless-toggler'\n },\n CSS = {\n SHOW: 'show',\n MORELESSACTIONS: 'moreless-actions',\n MORELESSTOGGLER: 'moreless-toggler',\n SHOWLESS: 'moreless-less'\n },\n WRAPPERS = {\n FITEM: '
',\n FELEMENT: '
',\n ADVANCEDDIV: '
'\n },\n IDPREFIX = 'showadvancedid-';\n\n /** @property {Integer} uniqIdSeed Auto incrementing number used to generate ids. */\n var uniqIdSeed = 0;\n\n /**\n * ShowAdvanced behaviour class.\n *\n * @class core_form/showadvanced\n * @param {String} id The id of the form.\n */\n var ShowAdvanced = function(id) {\n this.id = id;\n\n var form = $(document.getElementById(id));\n this.enhanceForm(form);\n };\n\n /** @property {String} id The form id to enhance. */\n ShowAdvanced.prototype.id = '';\n\n /**\n * @method enhanceForm\n * @param {JQuery} form JQuery selector representing the form\n * @return {ShowAdvanced}\n */\n ShowAdvanced.prototype.enhanceForm = function(form) {\n var fieldsets = form.find(SELECTORS.FIELDSETCONTAINSADVANCED);\n\n // Enhance each fieldset in the form matching the selector.\n fieldsets.each(function(index, item) {\n this.enhanceFieldset($(item));\n }.bind(this));\n\n // Attach some event listeners.\n // Subscribe more/less links to click event.\n form.on('click', SELECTORS.MORELESSLINK, this.switchState);\n\n // Subscribe to key events but filter for space or enter.\n form.on('keydown', SELECTORS.MORELESSLINK, function(e) {\n // Enter or space.\n if (e.which == 13 || e.which == 32) {\n return this.switchState(e);\n }\n return true;\n }.bind(this));\n return this;\n };\n\n\n /**\n * Generates a uniq id for the dom element it's called on unless the element already has an id.\n * The id is set on the dom node before being returned.\n *\n * @method generateId\n * @param {JQuery} node JQuery selector representing a single DOM Node.\n * @return {String}\n */\n ShowAdvanced.prototype.generateId = function(node) {\n var id = node.prop('id');\n if (typeof id === 'undefined') {\n id = IDPREFIX + (uniqIdSeed++);\n node.prop('id', id);\n }\n return id;\n };\n\n /**\n * @method enhanceFieldset\n * @param {JQuery} fieldset JQuery selector representing a fieldset\n * @return {ShowAdvanced}\n */\n ShowAdvanced.prototype.enhanceFieldset = function(fieldset) {\n var statuselement = $('input[name=mform_showmore_' + fieldset.prop('id') + ']');\n if (!statuselement.length) {\n Log.debug(\"M.form.showadvanced::processFieldset was called on an fieldset without a status field: '\" +\n fieldset.prop('id') + \"'\");\n return this;\n }\n\n // Fetch some strings.\n Strings.get_strings([{\n key: 'showmore',\n component: 'core_form'\n }, {\n key: 'showless',\n component: 'core_form'\n }]).then(function(results) {\n var showmore = results[0],\n showless = results[1];\n\n // Generate more/less links.\n var morelesslink = $('');\n morelesslink.addClass(CSS.MORELESSTOGGLER);\n if (statuselement.val() === '0') {\n morelesslink.html(showmore);\n morelesslink.attr('aria-expanded', 'false');\n } else {\n morelesslink.html(showless);\n morelesslink.attr('aria-expanded', 'true');\n morelesslink.addClass(CSS.SHOWLESS);\n fieldset.find(SELECTORS.DIVFITEMADVANCED).addClass(CSS.SHOW);\n }\n // Build a list of advanced fieldsets.\n var idlist = [];\n fieldset.find(SELECTORS.DIVFITEMADVANCED).each(function(index, node) {\n idlist[idlist.length] = this.generateId($(node));\n }.bind(this));\n\n // Set aria attributes.\n morelesslink.attr('role', 'button');\n morelesslink.attr('aria-controls', 'form-advanced-div');\n\n var formadvancedsection = $(WRAPPERS.ADVANCEDDIV);\n fieldset.find(SELECTORS.DIVFITEMADVANCED).wrapAll(formadvancedsection);\n // Add elements to the DOM.\n var fitem = $(WRAPPERS.FITEM);\n fitem.addClass(CSS.MORELESSACTIONS);\n var felement = $(WRAPPERS.FELEMENT);\n felement.append(morelesslink);\n fitem.append(felement);\n\n fieldset.find(SELECTORS.DIVADVANCEDSECTION).before(fitem);\n return true;\n }.bind(this)).fail(Notification.exception);\n\n return this;\n };\n\n /**\n * @method switchState\n * @param {Event} e Event that triggered this action.\n * @return {Boolean}\n */\n ShowAdvanced.prototype.switchState = function(e) {\n e.preventDefault();\n\n // Fetch some strings.\n Strings.get_strings([{\n key: 'showmore',\n component: 'core_form'\n }, {\n key: 'showless',\n component: 'core_form'\n }]).then(function(results) {\n var showmore = results[0],\n showless = results[1],\n fieldset = $(e.target).closest(SELECTORS.FIELDSETCONTAINSADVANCED);\n\n // Toggle collapsed class.\n fieldset.find(SELECTORS.DIVFITEMADVANCED).toggleClass(CSS.SHOW);\n\n // Get corresponding hidden variable.\n var statuselement = $('input[name=mform_showmore_' + fieldset.prop('id') + ']');\n\n // Invert it and change the link text.\n if (statuselement.val() === '0') {\n statuselement.val(1);\n $(e.target).addClass(CSS.SHOWLESS);\n $(e.target).html(showless);\n $(e.target).attr('aria-expanded', 'true');\n } else {\n statuselement.val(0);\n $(e.target).removeClass(CSS.SHOWLESS);\n $(e.target).html(showmore);\n $(e.target).attr('aria-expanded', 'false');\n }\n return true;\n }).fail(Notification.exception);\n\n return this;\n };\n\n return {\n /**\n * Initialise this module.\n * @method init\n * @param {String} formid\n * @return {ShowAdvanced}\n */\n init: function(formid) {\n return new ShowAdvanced(formid);\n }\n };\n});\n"],"file":"showadvanced.min.js"} \ No newline at end of file diff --git a/lib/form/amd/src/defaultcustom.js b/lib/form/amd/src/defaultcustom.js index 67cafdac99a9c..bc0a2d5fe2922 100644 --- a/lib/form/amd/src/defaultcustom.js +++ b/lib/form/amd/src/defaultcustom.js @@ -17,7 +17,6 @@ * Functionality for the form element defaultcustom * * @module core_form/defaultcustom - * @class defaultcustom * @copyright 2017 Marina Glancy * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.3 diff --git a/lib/form/amd/src/dynamicform.js b/lib/form/amd/src/dynamicform.js index 49acfb5c4aacf..c7ab32bb0b55e 100644 --- a/lib/form/amd/src/dynamicform.js +++ b/lib/form/amd/src/dynamicform.js @@ -43,6 +43,9 @@ import Templates from 'core/templates'; import Y from 'core/yui'; import {get_strings as getStrings} from 'core/str'; +/** + * @class core_form/dynamicform + */ export default class DynamicForm { /** diff --git a/lib/form/amd/src/encryptedpassword.js b/lib/form/amd/src/encryptedpassword.js index dd37dbe60db12..a681d6787c850 100644 --- a/lib/form/amd/src/encryptedpassword.js +++ b/lib/form/amd/src/encryptedpassword.js @@ -17,7 +17,6 @@ * Encrypted password functionality. * * @module core_form/encryptedpassword - * @class encryptedpassword * @copyright 2019 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,6 +24,7 @@ /** * Constructor for EncryptedPassword. * + * @class core_form/encryptedpassword * @param {String} elementId The element to apply the encrypted password JS to */ export const EncryptedPassword = function(elementId) { diff --git a/lib/form/amd/src/events.js b/lib/form/amd/src/events.js index f059453dc27a5..fc2658ea104e5 100644 --- a/lib/form/amd/src/events.js +++ b/lib/form/amd/src/events.js @@ -20,6 +20,14 @@ * @copyright 2021 Huong Nguyen * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.10 + * + * @example
+ * import {eventTypes as formEventTypes} from 'core_form/events'; + * + * document.addEventListener(formEventTypes.formSubmittedByJavascript, e => { + * window.console.log(e.target); // The form that was submitted. + * window.console.log(e.detail.skipValidation); // Whether form validation was skipped. + * }); */ import {get_string as getString} from 'core/str'; @@ -65,8 +73,9 @@ export const eventTypes = { * @event formSubmittedByJavascript * @type {CustomEvent} * @property {HTMLElement} target The form that was submitted - * @property {Boolean} skipValidation Whether the form was submitted without validation (i.e. via a Cancel button) - * @property {Boolean} fallbackHandled Whether the legacy YUI event has been handled + * @property {object} detail + * @property {boolean} detail.skipValidation Whether the form was submitted without validation (i.e. via a Cancel button) + * @property {boolean} detail.fallbackHandled Whether the legacy YUI event has been handled */ formSubmittedByJavascript: 'core_form/submittedByJavascript', @@ -76,7 +85,8 @@ export const eventTypes = { * @event formFieldValidationFailed * @type {CustomEvent} * @property {HTMLElement} target The field that failed validation - * @property {String} message The message displayed upon failure + * @property {object} detail + * @property {String} detail.message The message displayed upon failure */ formFieldValidationFailed: 'core_form/fieldValidationFailed', @@ -217,7 +227,7 @@ export const notifyUploadCompleted = elementId => { * @param {String} elementId * @returns {CustomEvent} * @fires uploadStarted - * @deprecated Since Moodle 4.0 See {@link notifyUploadStarted} + * @deprecated Since Moodle 4.0 See {@link module:core_form/events.notifyUploadStarted notifyUploadStarted} */ export const triggerUploadStarted = notifyUploadStarted; @@ -228,14 +238,14 @@ export const triggerUploadStarted = notifyUploadStarted; * @param {String} elementId * @returns {CustomEvent} * @fires uploadCompleted - * @deprecated Since Moodle 4.0 See {@link notifyUploadCompleted} + * @deprecated Since Moodle 4.0 See {@link module:core_form/events.notifyUploadCompleted notifyUploadCompleted} */ export const triggerUploadCompleted = notifyUploadCompleted; /** * List of the events. * - * @deprecated since Moodle 4.0. See {@link eventTypes} instead. + * @deprecated since Moodle 4.0. See {@link module:core_form/events.eventTypes eventTypes} instead. **/ export const types = { uploadStarted: 'core_form/uploadStarted', diff --git a/lib/form/amd/src/passwordunmask.js b/lib/form/amd/src/passwordunmask.js index 884db7cf607b1..3cf7893b33302 100644 --- a/lib/form/amd/src/passwordunmask.js +++ b/lib/form/amd/src/passwordunmask.js @@ -17,7 +17,6 @@ * Password Unmask functionality. * * @module core_form/passwordunmask - * @class passwordunmask * @copyright 2016 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.2 @@ -27,6 +26,7 @@ define(['jquery', 'core/templates'], function($, Template) { /** * Constructor for PasswordUnmask. * + * @class core_form/passwordunmask * @param {String} elementid The element to apply the PasswordUnmask to */ var PasswordUnmask = function(elementid) { diff --git a/lib/form/amd/src/showadvanced.js b/lib/form/amd/src/showadvanced.js index a7a6e9cb2c8d1..4579a75bf1a9f 100644 --- a/lib/form/amd/src/showadvanced.js +++ b/lib/form/amd/src/showadvanced.js @@ -17,7 +17,6 @@ * A class to help show and hide advanced form content. * * @module core_form/showadvanced - * @class showadvanced * @copyright 2016 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -48,6 +47,8 @@ define(['jquery', 'core/log', 'core/str', 'core/notification'], function($, Log, /** * ShowAdvanced behaviour class. + * + * @class core_form/showadvanced * @param {String} id The id of the form. */ var ShowAdvanced = function(id) { diff --git a/lib/table/amd/build/local/dynamic/repository.min.js.map b/lib/table/amd/build/local/dynamic/repository.min.js.map index 0dd30b2fb5454..af7144fe64e5a 100644 --- a/lib/table/amd/build/local/dynamic/repository.min.js.map +++ b/lib/table/amd/build/local/dynamic/repository.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/local/dynamic/repository.js"],"names":["fetch","component","handler","uniqueid","sortData","joinType","filters","firstinitial","lastinitial","pageNumber","pageSize","hiddenColumns","resetPreferences","methodname","args","sortdata","jointype","pagenumber","pagesize","hiddencolumns","resetpreferences"],"mappings":"yKA4CqB,QAARA,CAAAA,KAAQ,CAACC,CAAD,CAAYC,CAAZ,CAAqBC,CAArB,CASoB,8DAAjC,EAAiC,KARjCC,QAQiC,CARjCA,CAQiC,YARtB,EAQsB,OAPjCC,QAOiC,CAPjCA,CAOiC,YAPtB,IAOsB,OANjCC,OAMiC,CANjCA,CAMiC,YANvB,EAMuB,OALjCC,YAKiC,CALjCA,CAKiC,YALlB,IAKkB,OAJjCC,WAIiC,CAJjCA,CAIiC,YAJnB,IAImB,OAHjCC,UAGiC,CAHjCA,CAGiC,YAHpB,IAGoB,OAFjCC,QAEiC,CAFjCA,CAEiC,YAFtB,IAEsB,OADjCC,aACiC,CADjCA,CACiC,YADjB,EACiB,GAA7BC,CAA6B,2DACrC,MAAO,WAAU,CAAC,CACdC,UAAU,uCADI,CAEdC,IAAI,CAAE,CACFb,SAAS,CAATA,CADE,CAEFC,OAAO,CAAPA,CAFE,CAGFC,QAAQ,CAARA,CAHE,CAIFY,QAAQ,CAAEX,CAJR,CAKFY,QAAQ,CAAEX,CALR,CAMFC,OAAO,CAAPA,CANE,CAOFC,YAAY,CAAZA,CAPE,CAQFC,WAAW,CAAXA,CARE,CASFS,UAAU,CAAER,CATV,CAUFS,QAAQ,CAAER,CAVR,CAWFS,aAAa,CAAER,CAXb,CAYFS,gBAAgB,CAAER,CAZhB,CAFQ,CAAD,CAAV,EAgBH,CAhBG,CAiBV,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle calendar ajax actions.\n *\n * @module core_calendar/repository\n * @class repository\n * @copyright 2017 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {call as fetchMany} from 'core/ajax';\n\n/**\n * Fetch table view.\n *\n * @method fetch\n * @param {String} component The component\n * @param {String} handler The name of the handler\n * @param {String} uniqueid The unique id of the table\n * @param {Object} options The options to use when updating the table\n * @param {Array} options.sortData The list of columns to sort by\n * @param {Number} options.joinType The filterset join type\n * @param {Object} options.filters The filters to apply when searching\n * @param {String} options.firstinitial The first name initial to filter on\n * @param {String} options.lastinitial The last name initial to filter on\n * @param {String} options.pageNumber The page number\n * @param {Number} options.pageSize The page size\n * @param {Object} options.hiddenColumns The columns to hide\n * @param {Bool} resetPreferences\n * @return {Promise} Resolved with requested table view\n */\nexport const fetch = (component, handler, uniqueid, {\n sortData = [],\n joinType = null,\n filters = {},\n firstinitial = null,\n lastinitial = null,\n pageNumber = null,\n pageSize = null,\n hiddenColumns = {}\n } = {}, resetPreferences = false) => {\n return fetchMany([{\n methodname: `core_table_get_dynamic_table_content`,\n args: {\n component,\n handler,\n uniqueid,\n sortdata: sortData,\n jointype: joinType,\n filters,\n firstinitial,\n lastinitial,\n pagenumber: pageNumber,\n pagesize: pageSize,\n hiddencolumns: hiddenColumns,\n resetpreferences: resetPreferences\n },\n }])[0];\n};\n"],"file":"repository.min.js"} \ No newline at end of file +{"version":3,"sources":["../../../src/local/dynamic/repository.js"],"names":["fetch","component","handler","uniqueid","sortData","joinType","filters","firstinitial","lastinitial","pageNumber","pageSize","hiddenColumns","resetPreferences","methodname","args","sortdata","jointype","pagenumber","pagesize","hiddencolumns","resetpreferences"],"mappings":"yKA2CqB,QAARA,CAAAA,KAAQ,CAACC,CAAD,CAAYC,CAAZ,CAAqBC,CAArB,+DASjB,EATiB,KACjBC,QADiB,CACjBA,CADiB,YACN,EADM,OAEjBC,QAFiB,CAEjBA,CAFiB,YAEN,IAFM,OAGjBC,OAHiB,CAGjBA,CAHiB,YAGP,EAHO,OAIjBC,YAJiB,CAIjBA,CAJiB,YAIF,IAJE,OAKjBC,WALiB,CAKjBA,CALiB,YAKH,IALG,OAMjBC,UANiB,CAMjBA,CANiB,YAMJ,IANI,OAOjBC,QAPiB,CAOjBA,CAPiB,YAON,IAPM,OAQjBC,aARiB,CAQjBA,CARiB,YAQD,EARC,GASbC,CATa,iEASgB,WAAU,CAAC,CAC5CC,UAAU,uCADkC,CAE5CC,IAAI,CAAE,CACFb,SAAS,CAATA,CADE,CAEFC,OAAO,CAAPA,CAFE,CAGFC,QAAQ,CAARA,CAHE,CAIFY,QAAQ,CAAEX,CAJR,CAKFY,QAAQ,CAAEX,CALR,CAMFC,OAAO,CAAPA,CANE,CAOFC,YAAY,CAAZA,CAPE,CAQFC,WAAW,CAAXA,CARE,CASFS,UAAU,CAAER,CATV,CAUFS,QAAQ,CAAER,CAVR,CAWFS,aAAa,CAAER,CAXb,CAYFS,gBAAgB,CAAER,CAZhB,CAFsC,CAAD,CAAV,EAgBjC,CAhBiC,CAThB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle calendar ajax actions.\n *\n * @module core_calendar/repository\n * @copyright 2017 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport {call as fetchMany} from 'core/ajax';\n\n/**\n * Fetch table view.\n *\n * @method fetch\n * @param {String} component The component\n * @param {String} handler The name of the handler\n * @param {String} uniqueid The unique id of the table\n * @param {Object} options The options to use when updating the table\n * @param {Array} options.sortData The list of columns to sort by\n * @param {Number} options.joinType The filterset join type\n * @param {Object} options.filters The filters to apply when searching\n * @param {String} options.firstinitial The first name initial to filter on\n * @param {String} options.lastinitial The last name initial to filter on\n * @param {String} options.pageNumber The page number\n * @param {Number} options.pageSize The page size\n * @param {Object} options.hiddenColumns The columns to hide\n * @param {Bool} resetPreferences\n * @return {Promise} Resolved with requested table view\n */\nexport const fetch = (component, handler, uniqueid, {\n sortData = [],\n joinType = null,\n filters = {},\n firstinitial = null,\n lastinitial = null,\n pageNumber = null,\n pageSize = null,\n hiddenColumns = {}\n} = {}, resetPreferences = false) => fetchMany([{\n methodname: `core_table_get_dynamic_table_content`,\n args: {\n component,\n handler,\n uniqueid,\n sortdata: sortData,\n jointype: joinType,\n filters,\n firstinitial,\n lastinitial,\n pagenumber: pageNumber,\n pagesize: pageSize,\n hiddencolumns: hiddenColumns,\n resetpreferences: resetPreferences\n },\n}])[0];\n"],"file":"repository.min.js"} \ No newline at end of file diff --git a/lib/table/amd/src/local/dynamic/repository.js b/lib/table/amd/src/local/dynamic/repository.js index c86f30e22fcd1..371bc5418a08b 100644 --- a/lib/table/amd/src/local/dynamic/repository.js +++ b/lib/table/amd/src/local/dynamic/repository.js @@ -17,7 +17,6 @@ * A javascript module to handle calendar ajax actions. * * @module core_calendar/repository - * @class repository * @copyright 2017 Simey Lameze * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -43,30 +42,28 @@ import {call as fetchMany} from 'core/ajax'; * @return {Promise} Resolved with requested table view */ export const fetch = (component, handler, uniqueid, { - sortData = [], - joinType = null, - filters = {}, - firstinitial = null, - lastinitial = null, - pageNumber = null, - pageSize = null, - hiddenColumns = {} - } = {}, resetPreferences = false) => { - return fetchMany([{ - methodname: `core_table_get_dynamic_table_content`, - args: { - component, - handler, - uniqueid, - sortdata: sortData, - jointype: joinType, - filters, - firstinitial, - lastinitial, - pagenumber: pageNumber, - pagesize: pageSize, - hiddencolumns: hiddenColumns, - resetpreferences: resetPreferences - }, - }])[0]; -}; + sortData = [], + joinType = null, + filters = {}, + firstinitial = null, + lastinitial = null, + pageNumber = null, + pageSize = null, + hiddenColumns = {} +} = {}, resetPreferences = false) => fetchMany([{ + methodname: `core_table_get_dynamic_table_content`, + args: { + component, + handler, + uniqueid, + sortdata: sortData, + jointype: joinType, + filters, + firstinitial, + lastinitial, + pagenumber: pageNumber, + pagesize: pageSize, + hiddencolumns: hiddenColumns, + resetpreferences: resetPreferences + }, +}])[0]; diff --git a/message/amd/build/message_notification_preference.min.js.map b/message/amd/build/message_notification_preference.min.js.map index 9325132f52c11..f326d8d2b7d55 100644 --- a/message/amd/build/message_notification_preference.min.js.map +++ b/message/amd/build/message_notification_preference.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/message_notification_preference.js"],"names":["define","$","NotificationPreference","SELECTORS","PREFERENCE_KEY","MessageNotificationPreference","element","userId","call","prototype","Object","create","constructor","getPreferenceKey","root","find","attr"],"mappings":"AAwBAA,OAAM,gDAAC,CAAC,QAAD,CAAW,sCAAX,CAAD,CACE,SAASC,CAAT,CAAYC,CAAZ,CAAoC,IAEpCC,CAAAA,CAAS,CAAG,CACZC,cAAc,CAAE,uBADJ,CAFwB,CAYpCC,CAA6B,CAAG,SAASC,CAAT,CAAkBC,CAAlB,CAA0B,CAC1DL,CAAsB,CAACM,IAAvB,CAA4B,IAA5B,CAAkCF,CAAlC,CAA2CC,CAA3C,CACH,CAduC,CAmBxCF,CAA6B,CAACI,SAA9B,CAA0CC,MAAM,CAACC,MAAP,CAAcT,CAAsB,CAACO,SAArC,CAA1C,CAKAJ,CAA6B,CAACI,SAA9B,CAAwCG,WAAxC,CAAsDP,CAAtD,CAQAA,CAA6B,CAACI,SAA9B,CAAwCI,gBAAxC,CAA2D,UAAW,CAClE,MAAO,MAAKC,IAAL,CAAUC,IAAV,CAAeZ,CAAS,CAACC,cAAzB,EAAyCY,IAAzC,CAA8C,qBAA9C,CACV,CAFD,CAIA,MAAOX,CAAAA,CACV,CAtCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the preference for an individual notification type on the\n * message preference page.\n *\n * @module core_message/message_notification_preference\n * @class message_notification_preference\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core_message/notification_preference'],\n function($, NotificationPreference) {\n\n var SELECTORS = {\n PREFERENCE_KEY: '[data-preference-key]',\n };\n\n /**\n * Constructor for the Preference.\n *\n * @param {object} element jQuery object root element of the preference\n * @param {int} userId The current user id\n */\n var MessageNotificationPreference = function(element, userId) {\n NotificationPreference.call(this, element, userId);\n };\n\n /**\n * Clone the parent prototype.\n */\n MessageNotificationPreference.prototype = Object.create(NotificationPreference.prototype);\n\n /**\n * Set constructor.\n */\n MessageNotificationPreference.prototype.constructor = MessageNotificationPreference;\n\n /**\n * Get the unique prefix key that identifies this user preference.\n *\n * @method getPreferenceKey\n * @return {string}\n */\n MessageNotificationPreference.prototype.getPreferenceKey = function() {\n return this.root.find(SELECTORS.PREFERENCE_KEY).attr('data-preference-key');\n };\n\n return MessageNotificationPreference;\n});\n"],"file":"message_notification_preference.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/message_notification_preference.js"],"names":["define","$","NotificationPreference","SELECTORS","PREFERENCE_KEY","MessageNotificationPreference","element","userId","call","prototype","Object","create","constructor","getPreferenceKey","root","find","attr"],"mappings":"AAuBAA,OAAM,gDAAC,CAAC,QAAD,CAAW,sCAAX,CAAD,CACE,SAASC,CAAT,CAAYC,CAAZ,CAAoC,IAEpCC,CAAAA,CAAS,CAAG,CACZC,cAAc,CAAE,uBADJ,CAFwB,CAapCC,CAA6B,CAAG,SAASC,CAAT,CAAkBC,CAAlB,CAA0B,CAC1DL,CAAsB,CAACM,IAAvB,CAA4B,IAA5B,CAAkCF,CAAlC,CAA2CC,CAA3C,CACH,CAfuC,CAoBxCF,CAA6B,CAACI,SAA9B,CAA0CC,MAAM,CAACC,MAAP,CAAcT,CAAsB,CAACO,SAArC,CAA1C,CAKAJ,CAA6B,CAACI,SAA9B,CAAwCG,WAAxC,CAAsDP,CAAtD,CAQAA,CAA6B,CAACI,SAA9B,CAAwCI,gBAAxC,CAA2D,UAAW,CAClE,MAAO,MAAKC,IAAL,CAAUC,IAAV,CAAeZ,CAAS,CAACC,cAAzB,EAAyCY,IAAzC,CAA8C,qBAA9C,CACV,CAFD,CAIA,MAAOX,CAAAA,CACV,CAvCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the preference for an individual notification type on the\n * message preference page.\n *\n * @module core_message/message_notification_preference\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core_message/notification_preference'],\n function($, NotificationPreference) {\n\n var SELECTORS = {\n PREFERENCE_KEY: '[data-preference-key]',\n };\n\n /**\n * Constructor for the Preference.\n *\n * @class\n * @param {object} element jQuery object root element of the preference\n * @param {int} userId The current user id\n */\n var MessageNotificationPreference = function(element, userId) {\n NotificationPreference.call(this, element, userId);\n };\n\n /**\n * Clone the parent prototype.\n */\n MessageNotificationPreference.prototype = Object.create(NotificationPreference.prototype);\n\n /**\n * Set constructor.\n */\n MessageNotificationPreference.prototype.constructor = MessageNotificationPreference;\n\n /**\n * Get the unique prefix key that identifies this user preference.\n *\n * @method getPreferenceKey\n * @return {string}\n */\n MessageNotificationPreference.prototype.getPreferenceKey = function() {\n return this.root.find(SELECTORS.PREFERENCE_KEY).attr('data-preference-key');\n };\n\n return MessageNotificationPreference;\n});\n"],"file":"message_notification_preference.min.js"} \ No newline at end of file diff --git a/message/amd/build/message_preferences.min.js.map b/message/amd/build/message_preferences.min.js.map index 776988794a4f7..0151b1e4ff3ca 100644 --- a/message/amd/build/message_preferences.min.js.map +++ b/message/amd/build/message_preferences.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/message_preferences.js"],"names":["define","$","Ajax","Notification","MessageNotificationPreference","CustomEvents","SELECTORS","PREFERENCE","PREFERENCES_CONTAINER","CONTACTABLE_PRIVACY_CONTAINER","MessagePreferences","element","root","userId","find","attr","registerEventListeners","prototype","preferencesDisabled","hasClass","saveContactablePrivacySetting","container","value","val","Deferred","resolve","addClass","request","methodname","args","userid","preferences","type","call","fail","exception","always","removeClass","events","activate","on","e","target","name","preferencesContainer","closest","preferenceEl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,IAjBgB,CAAvB,CAkBH,CAvBD,CAyBA,MAAOvC,CAAAA,CACV,CApGK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the message preference page.\n *\n * @module core_message/message_preferences\n * @class message_preferences\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax', 'core/notification',\n 'core_message/message_notification_preference', 'core/custom_interaction_events'],\n function($, Ajax, Notification, MessageNotificationPreference, CustomEvents) {\n\n var SELECTORS = {\n PREFERENCE: '[data-state]',\n PREFERENCES_CONTAINER: '[data-region=\"preferences-container\"]',\n CONTACTABLE_PRIVACY_CONTAINER: '[data-region=\"privacy-setting-container\"]',\n };\n\n /**\n * Constructor for the MessagePreferences.\n *\n * @param {object} element The root element for the message preferences\n */\n var MessagePreferences = function(element) {\n this.root = $(element);\n this.userId = this.root.find(SELECTORS.PREFERENCES_CONTAINER).attr('data-user-id');\n\n this.registerEventListeners();\n };\n\n /**\n * Check if the preferences have been disabled on this page.\n *\n * @method preferencesDisabled\n * @return {bool}\n */\n MessagePreferences.prototype.preferencesDisabled = function() {\n return this.root.find(SELECTORS.PREFERENCES_CONTAINER).hasClass('disabled');\n };\n\n /**\n * Update the contactable privacy user preference in the DOM and\n * send a request to update on the server.\n *\n * @return {Promise}\n * @method saveContactablePrivacySetting\n */\n MessagePreferences.prototype.saveContactablePrivacySetting = function() {\n var container = this.root.find(SELECTORS.CONTACTABLE_PRIVACY_CONTAINER);\n var value = $(\"input[type='radio']:checked\").val();\n\n if (container.hasClass('loading')) {\n return $.Deferred().resolve();\n }\n\n container.addClass('loading');\n\n var request = {\n methodname: 'core_user_update_user_preferences',\n args: {\n userid: this.userId,\n preferences: [\n {\n type: container.attr('data-preference-key'),\n value: value,\n }\n ]\n }\n };\n\n return Ajax.call([request])[0]\n .fail(Notification.exception)\n .always(function() {\n container.removeClass('loading');\n });\n };\n\n /**\n * Create all of the event listeners for the message preferences page.\n *\n * @method registerEventListeners\n */\n MessagePreferences.prototype.registerEventListeners = function() {\n CustomEvents.define(this.root, [\n CustomEvents.events.activate\n ]);\n\n this.root.on('change', function(e) {\n // Add listener for privacy setting radio buttons change.\n if (e.target.name == 'message_blocknoncontacts') {\n this.saveContactablePrivacySetting();\n } else {\n // Add listener for processor preferences.\n if (!this.preferencesDisabled()) {\n var preferencesContainer = $(e.target).closest(SELECTORS.PREFERENCES_CONTAINER);\n var preferenceElement = $(e.target).closest(SELECTORS.PREFERENCE);\n var messagePreference = new MessageNotificationPreference(preferencesContainer, this.userId);\n\n preferenceElement.addClass('loading');\n messagePreference.save().always(function() {\n preferenceElement.removeClass('loading');\n });\n }\n }\n }.bind(this));\n };\n\n return MessagePreferences;\n});\n"],"file":"message_preferences.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/message_preferences.js"],"names":["define","$","Ajax","Notification","MessageNotificationPreference","CustomEvents","SELECTORS","PREFERENCE","PREFERENCES_CONTAINER","CONTACTABLE_PRIVACY_CONTAINER","MessagePreferences","element","root","userId","find","attr","registerEventListeners","prototype","preferencesDisabled","hasClass","saveContactablePrivacySetting","container","value","val","Deferred","resolve","addClass","request","methodname","args","userid","preferences","type","call","fail","exception","always","removeClass","events","activate","on","e","target","name","preferencesContainer","closest","preferenceElement","messagePreference","save","bind"],"mappings":"AAsBAA,OAAM,oCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CACC,8CADD,CACiD,gCADjD,CAAD,CAEE,SAASC,CAAT,CAAYC,CAAZ,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AL,CAAU,CAACN,CAAD,CAAV,EAAqB,CAArB,EACFO,IADE,CACG/B,CAAY,CAACgC,SADhB,EAEFC,MAFE,CAEK,UAAW,CACff,CAAS,CAACgB,WAAV,CAAsB,SAAtB,CACH,CAJE,CAKV,CA5BD,CAmCA3B,CAAkB,CAACO,SAAnB,CAA6BD,sBAA7B,CAAsD,UAAW,CAC7DX,CAAY,CAACL,MAAb,CAAoB,KAAKY,IAAzB,CAA+B,CAC3BP,CAAY,CAACiC,MAAb,CAAoBC,QADO,CAA/B,EAIA,KAAK3B,IAAL,CAAU4B,EAAV,CAAa,QAAb,CAAuB,SAASC,CAAT,CAAY,CAE/B,GAAqB,0BAAjB,EAAAA,CAAC,CAACC,MAAF,CAASC,IAAb,CAAiD,CAC7C,KAAKvB,6BAAL,EACH,CAFD,IAEO,CAEH,GAAI,CAAC,KAAKF,mBAAL,EAAL,CAAiC,IACzB0B,CAAAA,CAAoB,CAAG3C,CAAC,CAACwC,CAAC,CAACC,MAAH,CAAD,CAAYG,OAAZ,CAAoBvC,CAAS,CAACE,qBAA9B,CADE,CAEzBsC,CAAiB,CAAG7C,CAAC,CAACwC,CAAC,CAACC,MAAH,CAAD,CAAYG,OAAZ,CAAoBvC,CAAS,CAACC,UAA9B,CAFK,CAGzBwC,CAAiB,CAAG,GAAI3C,CAAAA,CAAJ,CAAkCwC,CAAlC,CAAwD,KAAK/B,MAA7D,CAHK,CAK7BiC,CAAiB,CAACpB,QAAlB,CAA2B,SAA3B,EACAqB,CAAiB,CAACC,IAAlB,GAAyBZ,MAAzB,CAAgC,UAAW,CACvCU,CAAiB,CAACT,WAAlB,CAA8B,SAA9B,CACH,CAFD,CAGH,CACJ,CACJ,CAjBsB,CAiBrBY,IAjBqB,CAiBhB,IAjBgB,CAAvB,CAkBH,CAvBD,CAyBA,MAAOvC,CAAAA,CACV,CArGK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the message preference page.\n *\n * @module core_message/message_preferences\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax', 'core/notification',\n 'core_message/message_notification_preference', 'core/custom_interaction_events'],\n function($, Ajax, Notification, MessageNotificationPreference, CustomEvents) {\n\n var SELECTORS = {\n PREFERENCE: '[data-state]',\n PREFERENCES_CONTAINER: '[data-region=\"preferences-container\"]',\n CONTACTABLE_PRIVACY_CONTAINER: '[data-region=\"privacy-setting-container\"]',\n };\n\n /**\n * Constructor for the MessagePreferences.\n *\n * @class\n * @param {object} element The root element for the message preferences\n */\n var MessagePreferences = function(element) {\n this.root = $(element);\n this.userId = this.root.find(SELECTORS.PREFERENCES_CONTAINER).attr('data-user-id');\n\n this.registerEventListeners();\n };\n\n /**\n * Check if the preferences have been disabled on this page.\n *\n * @method preferencesDisabled\n * @return {bool}\n */\n MessagePreferences.prototype.preferencesDisabled = function() {\n return this.root.find(SELECTORS.PREFERENCES_CONTAINER).hasClass('disabled');\n };\n\n /**\n * Update the contactable privacy user preference in the DOM and\n * send a request to update on the server.\n *\n * @return {Promise}\n * @method saveContactablePrivacySetting\n */\n MessagePreferences.prototype.saveContactablePrivacySetting = function() {\n var container = this.root.find(SELECTORS.CONTACTABLE_PRIVACY_CONTAINER);\n var value = $(\"input[type='radio']:checked\").val();\n\n if (container.hasClass('loading')) {\n return $.Deferred().resolve();\n }\n\n container.addClass('loading');\n\n var request = {\n methodname: 'core_user_update_user_preferences',\n args: {\n userid: this.userId,\n preferences: [\n {\n type: container.attr('data-preference-key'),\n value: value,\n }\n ]\n }\n };\n\n return Ajax.call([request])[0]\n .fail(Notification.exception)\n .always(function() {\n container.removeClass('loading');\n });\n };\n\n /**\n * Create all of the event listeners for the message preferences page.\n *\n * @method registerEventListeners\n */\n MessagePreferences.prototype.registerEventListeners = function() {\n CustomEvents.define(this.root, [\n CustomEvents.events.activate\n ]);\n\n this.root.on('change', function(e) {\n // Add listener for privacy setting radio buttons change.\n if (e.target.name == 'message_blocknoncontacts') {\n this.saveContactablePrivacySetting();\n } else {\n // Add listener for processor preferences.\n if (!this.preferencesDisabled()) {\n var preferencesContainer = $(e.target).closest(SELECTORS.PREFERENCES_CONTAINER);\n var preferenceElement = $(e.target).closest(SELECTORS.PREFERENCE);\n var messagePreference = new MessageNotificationPreference(preferencesContainer, this.userId);\n\n preferenceElement.addClass('loading');\n messagePreference.save().always(function() {\n preferenceElement.removeClass('loading');\n });\n }\n }\n }.bind(this));\n };\n\n return MessagePreferences;\n});\n"],"file":"message_preferences.min.js"} \ No newline at end of file diff --git a/message/amd/build/message_repository.min.js.map b/message/amd/build/message_repository.min.js.map index e430a7a8aadf0..ad4e02a069628 100644 --- a/message/amd/build/message_repository.min.js.map +++ b/message/amd/build/message_repository.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/message_repository.js"],"names":["define","$","Ajax","Notification","Constants","CONVERSATION_TYPES","sendMessagesToUser","toUserId","messages","formattedMessages","map","message","touserid","text","call","methodname","args","then","results","errors","reduce","carry","result","errormessage","push","length","Error","join","id","msgid","timecreated","useridfrom","conversationid","candeletemessagesforallusers","sendMessagesToConversation","conversationId","countUnreadConversations","promise","fail","exception","getContacts","userId","limit","offset","userid","limitnum","limitfrom","blockUser","blockedUserId","when","apply","blockeduserid","referenceuserid","userids","includecontactrequests","includeprivacyinfo","reponse1","profiles","unblockUser","unblockedUserId","unblockeduserid","createContactRequest","requestUserIds","requesteduserid","deleteContacts","contactUserIds","response1","getMessages","currentUserId","newestFirst","timeFrom","currentuserid","convid","newest","timefrom","searchUsers","searchString","search","searchMessages","sendMessageToUser","sendMessageToConversation","savePreferences","preferences","getPreferences","deleteMessages","messageIds","messageId","messageid","deleteMessagesForAllUsers","deleteConversation","conversationids","getContactRequests","acceptContactRequest","sendingUserId","recipientUserId","declineContactRequest","getConversation","loggedInUserId","includeContactRequests","includePrivacyInfo","memberLimit","memberOffset","messageLimit","messageOffset","newestMessagesFirst","memberlimit","memberoffset","messagelimit","messageoffset","newestmessagesfirst","getConversationBetweenUsers","otherUserId","otheruserid","getSelfConversation","getConversations","type","favourites","mergeself","conversations","conversation","PRIVATE","SELF","otherUser","members","name","fullname","imageurl","profileimageurl","getConversationMembers","setFavouriteConversations","conversationIds","setMutedConversations","unsetFavouriteConversations","unsetMutedConversations","getMemberInfo","referenceUserId","userIds","markAllConversationMessagesAsRead","getUserMessagePreferences","getTotalConversationCounts","getUnreadConversationCounts","getAllConversationCounts","total","unread"],"mappings":"AAuBAA,OAAM,mCACN,CACI,QADJ,CAEI,WAFJ,CAGI,mBAHJ,CAII,yDAJJ,CADM,CAMH,SACCC,CADD,CAECC,CAFD,CAGCC,CAHD,CAICC,CAJD,CAIY,IAEPC,CAAAA,CAAkB,CAAGD,CAAS,CAACC,kBAFxB,CAyRPC,CAAkB,CAAG,SAASC,CAAT,CAAmBC,CAAnB,CAA6B,IAC9CC,CAAAA,CAAiB,CAAGD,CAAQ,CAACE,GAAT,CAAa,SAASC,CAAT,CAAkB,CACnD,MAAO,CACHC,QAAQ,CAAEL,CADP,CAEHM,IAAI,CAAEF,CAFH,CAIV,CALuB,CAD0B,CAclD,MAAOT,CAAAA,CAAI,CAACY,IAAL,CAAU,CAPH,CACVC,UAAU,CAAE,oCADF,CAEVC,IAAI,CAAE,CACFR,QAAQ,CAAEC,CADR,CAFI,CAOG,CAAV,EAAqB,CAArB,EACFQ,IADE,CACG,SAASC,CAAT,CAAkB,CAEpB,GAAIC,CAAAA,CAAM,CAAGD,CAAO,CAACE,MAAR,CAAe,SAASC,CAAT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AA0B,CAzFG,QAA7BA,CAAAA,0BAA6B,CAASlG,CAAT,CAAiB,CAO9C,MAAOvC,CAAAA,CAAI,CAACY,IAAL,CAAU,CANH,CACVC,UAAU,CAAE,sCADF,CAEVC,IAAI,CAAE,CACF4B,MAAM,CAAEH,CADN,CAFI,CAMG,CAAV,EAAqB,CAArB,CACV,CA+CM,CAmCHmG,2BAA2B,CA1EG,QAA9BA,CAAAA,2BAA8B,CAASnG,CAAT,CAAiB,CAO/C,MAAOvC,CAAAA,CAAI,CAACY,IAAL,CAAU,CANH,CACVC,UAAU,CAAE,6CADF,CAEVC,IAAI,CAAE,CACF4B,MAAM,CAAEH,CADN,CAFI,CAMG,CAAV,EAAqB,CAArB,CACV,CA+BM,CAoCHoG,wBAAwB,CA3DG,QAA3BA,CAAAA,wBAA2B,CAASpG,CAAT,CAAiB,CAe5C,MAAOxC,CAAAA,CAAC,CAACgD,IAAF,CAAOC,KAAP,CAAa,IAAb,CAAmBhD,CAAI,CAACY,IAAL,CAdX,CACX,CACIC,UAAU,CAAE,sCADhB,CAEIC,IAAI,CAAE,CACF4B,MAAM,CAAEH,CADN,CAFV,CADW,CAOX,CACI1B,UAAU,CAAE,6CADhB,CAEIC,IAAI,CAAE,CACF4B,MAAM,CAAEH,CADN,CAFV,CAPW,CAcW,CAAnB,EAAwCxB,IAAxC,CAA6C,SAAS6H,CAAT,CAAgBC,CAAhB,CAAwB,CACxE,MAAO,CACHD,KAAK,CAAEA,CADJ,CAEHC,MAAM,CAAEA,CAFL,CAIV,CALM,CAMV,CAEM,CAsCV,CAljCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Retrieves messages from the server.\n *\n * @module core_message/message_repository\n * @class message_repository\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(\n[\n 'jquery',\n 'core/ajax',\n 'core/notification',\n 'core_message/message_drawer_view_conversation_constants'\n], function(\n $,\n Ajax,\n Notification,\n Constants) {\n\n var CONVERSATION_TYPES = Constants.CONVERSATION_TYPES;\n\n /**\n * Count the number of unread conversations (one or more messages from a user)\n * for a given user.\n *\n * @param {object} args The request arguments:\n * @return {object} jQuery promise\n */\n var countUnreadConversations = function(args) {\n var request = {\n methodname: 'core_message_get_unread_conversations_count',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n /**\n * Get contacts for given user.\n *\n * @param {int} userId The user id\n * @param {int} limit Limit for results\n * @param {int} offset Offset for results\n * @return {object} jQuery promise\n */\n var getContacts = function(userId, limit, offset) {\n var args = {\n userid: userId\n };\n\n if (typeof limit !== 'undefined') {\n args.limitnum = limit;\n }\n\n if (typeof offset !== 'undefined') {\n args.limitfrom = offset;\n }\n\n var request = {\n methodname: 'core_message_get_user_contacts',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Block a user.\n *\n * @param {int} userId The requesting user\n * @param {int} blockedUserId Id of user to block\n * @return {object} jQuery promise\n */\n var blockUser = function(userId, blockedUserId) {\n var requests = [\n {\n methodname: 'core_message_block_user',\n args: {\n userid: userId,\n blockeduserid: blockedUserId\n }\n },\n {\n methodname: 'core_message_get_member_info',\n args: {\n referenceuserid: userId,\n userids: [blockedUserId],\n includecontactrequests: true,\n includeprivacyinfo: true\n }\n }\n ];\n\n // Wrap both requests in a single promise so that we can catch an error\n // from either request.\n return $.when.apply(null, Ajax.call(requests)).then(function(reponse1, profiles) {\n // Only return the profile.\n return profiles.length ? profiles[0] : {};\n });\n };\n\n /**\n * Unblock a user.\n *\n * @param {int} userId The requesting user\n * @param {int} unblockedUserId Id of user to unblock\n * @return {object} jQuery promise\n */\n var unblockUser = function(userId, unblockedUserId) {\n var requests = [\n {\n methodname: 'core_message_unblock_user',\n args: {\n userid: userId,\n unblockeduserid: unblockedUserId\n }\n },\n {\n methodname: 'core_message_get_member_info',\n args: {\n referenceuserid: userId,\n userids: [unblockedUserId],\n includecontactrequests: true,\n includeprivacyinfo: true\n }\n }\n ];\n\n // Wrap both requests in a single promise so that we can catch an error\n // from either request.\n return $.when.apply(null, Ajax.call(requests)).then(function(reponse1, profiles) {\n // Only return the profile.\n return profiles.length ? profiles[0] : {};\n });\n };\n\n /**\n * Create a request to add a user as a contact.\n *\n * @param {int} userId The requesting user\n * @param {int[]} requestUserIds List of user ids to add\n * @return {object} jQuery promise\n */\n var createContactRequest = function(userId, requestUserIds) {\n var request = {\n methodname: 'core_message_create_contact_request',\n args: {\n userid: userId,\n requesteduserid: requestUserIds\n }\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Remove a list of users as contacts.\n *\n * @param {int} userId The requesting user\n * @param {int[]} contactUserIds List of user ids to add\n * @return {object} jQuery promise\n */\n var deleteContacts = function(userId, contactUserIds) {\n var requests = [\n {\n methodname: 'core_message_delete_contacts',\n args: {\n userid: userId,\n userids: contactUserIds\n }\n },\n {\n methodname: 'core_message_get_member_info',\n args: {\n referenceuserid: userId,\n userids: contactUserIds,\n includecontactrequests: true,\n includeprivacyinfo: true\n }\n }\n ];\n\n return $.when.apply(null, Ajax.call(requests)).then(function(response1, profiles) {\n // Return all of the profiles as an array.\n return profiles;\n });\n };\n\n /**\n * Get messages between two users.\n *\n * @param {int} currentUserId The requesting user\n * @param {int} conversationId Other user in the conversation\n * @param {int} limit Limit for results\n * @param {int} offset Offset for results\n * @param {bool} newestFirst Order results by newest first\n * @param {int} timeFrom Only return messages after this timestamp\n * @return {object} jQuery promise\n */\n var getMessages = function(currentUserId, conversationId, limit, offset, newestFirst, timeFrom) {\n var args = {\n currentuserid: currentUserId,\n convid: conversationId,\n newest: newestFirst ? true : false\n };\n\n if (typeof limit !== 'undefined') {\n args.limitnum = limit;\n }\n\n if (typeof offset !== 'undefined') {\n args.limitfrom = offset;\n }\n\n if (typeof timeFrom !== 'undefined') {\n args.timefrom = timeFrom;\n }\n\n var request = {\n methodname: 'core_message_get_conversation_messages',\n args: args\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Search for users.\n *\n * @param {int} userId The requesting user\n * @param {string} searchString Search string\n * @param {int} limit Limit for results\n * @param {int} offset Offset for results\n * @return {object} jQuery promise\n */\n var searchUsers = function(userId, searchString, limit, offset) {\n var args = {\n userid: userId,\n search: searchString\n };\n\n if (typeof limit !== 'undefined') {\n args.limitnum = limit;\n }\n\n if (typeof offset !== 'undefined') {\n args.limitfrom = offset;\n }\n\n var request = {\n methodname: 'core_message_message_search_users',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Search for messages.\n *\n * @param {int} userId The requesting user\n * @param {string} searchString Search string\n * @param {int} limit Limit for results\n * @param {int} offset Offset for results\n * @return {object} jQuery promise\n */\n var searchMessages = function(userId, searchString, limit, offset) {\n var args = {\n userid: userId,\n search: searchString\n };\n\n if (typeof limit !== 'undefined') {\n args.limitnum = limit;\n }\n\n if (typeof offset !== 'undefined') {\n args.limitfrom = offset;\n }\n\n var request = {\n methodname: 'core_message_data_for_messagearea_search_messages',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Send a list of messages to a user.\n *\n * @param {int} toUserId The recipient user id\n * @param {string[]} messages List of messages to send\n * @return {object} jQuery promise\n */\n var sendMessagesToUser = function(toUserId, messages) {\n var formattedMessages = messages.map(function(message) {\n return {\n touserid: toUserId,\n text: message\n };\n });\n var request = {\n methodname: 'core_message_send_instant_messages',\n args: {\n messages: formattedMessages\n }\n };\n\n return Ajax.call([request])[0]\n .then(function(results) {\n // Error handling for the weird way the old function works.\n var errors = results.reduce(function(carry, result) {\n if (result.errormessage) {\n carry.push(result.errormessage);\n }\n\n return carry;\n }, []);\n if (errors.length) {\n throw new Error(errors.join(\"\\n\"));\n }\n\n return results;\n })\n .then(function(results) {\n // Format the results to match the other send message function.\n return results.map(function(result) {\n return {\n id: result.msgid,\n text: result.text,\n timecreated: result.timecreated,\n useridfrom: result.useridfrom,\n conversationid: result.conversationid,\n candeletemessagesforallusers: result.candeletemessagesforallusers\n };\n });\n });\n };\n\n /**\n * Send a single message to a user.\n *\n * @param {int} toUserId The recipient user id\n * @param {string} text The message text\n * @return {object} jQuery promise\n */\n var sendMessageToUser = function(toUserId, text) {\n return sendMessagesToUser(toUserId, [text])\n .then(function(results) {\n return results[0];\n });\n };\n\n /**\n * Send messages to a conversation.\n *\n * @param {int} conversationId The conversation id\n * @param {string[]} messages List of messages to send\n * @return {object} jQuery promise\n */\n var sendMessagesToConversation = function(conversationId, messages) {\n var formattedMessages = messages.map(function(message) {\n return {\n text: message\n };\n });\n var request = {\n methodname: 'core_message_send_messages_to_conversation',\n args: {\n conversationid: conversationId,\n messages: formattedMessages\n }\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Send a message to a conversation.\n *\n * @param {int} conversationId The conversation id\n * @param {string} text The message text\n * @return {object} jQuery promise\n */\n var sendMessageToConversation = function(conversationId, text) {\n return sendMessagesToConversation(conversationId, [text])\n .then(function(result) {\n return result[0];\n });\n };\n\n /**\n * Save message preferences.\n *\n * @param {int} userId The owner of the preferences\n * @param {object[]} preferences New preferences values\n * @return {object} jQuery promise\n */\n var savePreferences = function(userId, preferences) {\n var request = {\n methodname: 'core_user_update_user_preferences',\n args: {\n userid: userId,\n preferences: preferences\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Get the user's preferences.\n *\n * @param {int} userId The target user\n * @return {object} jQuery promise\n */\n var getPreferences = function(userId) {\n var request = {\n methodname: 'core_user_get_user_preferences',\n args: {\n userid: userId\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Delete a list of messages.\n *\n * @param {int} userId The user to delete messages for\n * @param {int[]} messageIds List of message ids to delete\n * @return {object} jQuery promise\n */\n var deleteMessages = function(userId, messageIds) {\n return $.when.apply(null, Ajax.call(messageIds.map(function(messageId) {\n return {\n methodname: 'core_message_delete_message',\n args: {\n messageid: messageId,\n userid: userId\n }\n };\n })));\n };\n\n /**\n * Delete a list of messages for all users.\n *\n * @param {int} userId The user to delete messages for\n * @param {int[]} messageIds List of message ids to delete\n * @return {object} jQuery promise\n */\n var deleteMessagesForAllUsers = function(userId, messageIds) {\n return $.when.apply(null, Ajax.call(messageIds.map(function(messageId) {\n return {\n methodname: 'core_message_delete_message_for_all_users',\n args: {\n messageid: messageId,\n userid: userId\n }\n };\n })));\n };\n\n /**\n * Delete a conversation between two users.\n *\n * @param {int} userId The user to delete messages for\n * @param {int} conversationId The id of the conversation\n * @return {object} jQuery promise\n */\n var deleteConversation = function(userId, conversationId) {\n var request = {\n methodname: 'core_message_delete_conversations_by_id',\n args: {\n userid: userId,\n conversationids: [conversationId]\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Get the list of contact requests for a user.\n *\n * @param {int} userId The user id\n * @return {object} jQuery promise\n */\n var getContactRequests = function(userId) {\n var request = {\n methodname: 'core_message_get_contact_requests',\n args: {\n userid: userId\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Accept a contact request.\n *\n * @param {int} sendingUserId The user that sent the request\n * @param {int} recipientUserId The user that received the request\n * @return {object} jQuery promise\n */\n var acceptContactRequest = function(sendingUserId, recipientUserId) {\n var requests = [\n {\n methodname: 'core_message_confirm_contact_request',\n args: {\n userid: sendingUserId,\n requesteduserid: recipientUserId\n }\n },\n {\n methodname: 'core_message_get_member_info',\n args: {\n referenceuserid: recipientUserId,\n userids: [sendingUserId],\n includecontactrequests: true,\n includeprivacyinfo: true\n }\n }\n ];\n\n // Wrap both requests in a single promise so that we can catch an error\n // from either request.\n return $.when.apply(null, Ajax.call(requests)).then(function(reponse1, profiles) {\n // Only return the profile.\n return profiles.length ? profiles[0] : {};\n });\n };\n\n /**\n * Decline a contact request.\n *\n * @param {int} sendingUserId The user that sent the request\n * @param {int} recipientUserId The user that received the request\n * @return {object} jQuery promise\n */\n var declineContactRequest = function(sendingUserId, recipientUserId) {\n var requests = [\n {\n methodname: 'core_message_decline_contact_request',\n args: {\n userid: sendingUserId,\n requesteduserid: recipientUserId\n }\n },\n {\n methodname: 'core_message_get_member_info',\n args: {\n referenceuserid: recipientUserId,\n userids: [sendingUserId],\n includecontactrequests: true,\n includeprivacyinfo: true\n }\n }\n ];\n\n // Wrap both requests in a single promise so that we can catch an error\n // from either request.\n return $.when.apply(null, Ajax.call(requests)).then(function(reponse1, profiles) {\n // Only return the profile.\n return profiles.length ? profiles[0] : {};\n });\n };\n\n /**\n * Get a conversation.\n *\n * @param {int} loggedInUserId The logged in user\n * @param {int} conversationId The conversation id\n * @param {bool} includeContactRequests Incldue contact requests between members\n * @param {bool} includePrivacyInfo Include privacy info for members\n * @param {int} memberLimit Limit for members\n * @param {int} memberOffset Offset for members\n * @param {int} messageLimit Limit for messages\n * @param {int} messageOffset Offset for messages\n * @param {bool} newestMessagesFirst Order the messages by newest first\n * @return {object} jQuery promise\n */\n var getConversation = function(\n loggedInUserId,\n conversationId,\n includeContactRequests,\n includePrivacyInfo,\n memberLimit,\n memberOffset,\n messageLimit,\n messageOffset,\n newestMessagesFirst\n ) {\n var args = {\n userid: loggedInUserId,\n conversationid: conversationId\n };\n\n if (typeof includeContactRequests != 'undefined' && includeContactRequests !== null) {\n args.includecontactrequests = includeContactRequests;\n }\n\n if (typeof includePrivacyInfo != 'undefined' && includePrivacyInfo !== null) {\n args.includeprivacyinfo = includePrivacyInfo;\n }\n\n if (typeof memberLimit != 'undefined' && memberLimit !== null) {\n args.memberlimit = memberLimit;\n }\n\n if (typeof memberOffset != 'undefined' && memberOffset !== null) {\n args.memberoffset = memberOffset;\n }\n\n if (typeof messageLimit != 'undefined' && messageLimit !== null) {\n args.messagelimit = messageLimit;\n }\n\n if (typeof messageOffset != 'undefined' && messageOffset !== null) {\n args.messageoffset = messageOffset;\n }\n\n if (typeof newestMessagesFirst != 'undefined' && newestMessagesFirst !== null) {\n args.newestmessagesfirst = newestMessagesFirst;\n }\n\n var request = {\n methodname: 'core_message_get_conversation',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Get a conversation between users.\n *\n * @param {int} loggedInUserId The logged in user\n * @param {int} otherUserId The other user id\n * @param {bool} includeContactRequests Incldue contact requests between members\n * @param {bool} includePrivacyInfo Include privacy info for members\n * @param {int} memberLimit Limit for members\n * @param {int} memberOffset Offset for members\n * @param {int} messageLimit Limit for messages\n * @param {int} messageOffset Offset for messages\n * @param {bool} newestMessagesFirst Order the messages by newest first\n * @return {object} jQuery promise\n */\n var getConversationBetweenUsers = function(\n loggedInUserId,\n otherUserId,\n includeContactRequests,\n includePrivacyInfo,\n memberLimit,\n memberOffset,\n messageLimit,\n messageOffset,\n newestMessagesFirst\n ) {\n var args = {\n userid: loggedInUserId,\n otheruserid: otherUserId\n };\n\n if (typeof includeContactRequests != 'undefined' && includeContactRequests !== null) {\n args.includecontactrequests = includeContactRequests;\n }\n\n if (typeof includePrivacyInfo != 'undefined' && includePrivacyInfo !== null) {\n args.includeprivacyinfo = includePrivacyInfo;\n }\n\n if (typeof memberLimit != 'undefined' && memberLimit !== null) {\n args.memberlimit = memberLimit;\n }\n\n if (typeof memberOffset != 'undefined' && memberOffset !== null) {\n args.memberoffset = memberOffset;\n }\n\n if (typeof messageLimit != 'undefined' && messageLimit !== null) {\n args.messagelimit = messageLimit;\n }\n\n if (typeof messageOffset != 'undefined' && messageOffset !== null) {\n args.messageoffset = messageOffset;\n }\n\n if (typeof newestMessagesFirst != 'undefined' && newestMessagesFirst !== null) {\n args.newestmessagesfirst = newestMessagesFirst;\n }\n\n var request = {\n methodname: 'core_message_get_conversation_between_users',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Get a self-conversation.\n *\n * @param {int} loggedInUserId The logged in user\n * @param {int} messageLimit Limit for messages\n * @param {int} messageOffset Offset for messages\n * @param {bool} newestMessagesFirst Order the messages by newest first\n * @return {object} jQuery promise\n */\n var getSelfConversation = function(\n loggedInUserId,\n messageLimit,\n messageOffset,\n newestMessagesFirst\n ) {\n var args = {\n userid: loggedInUserId\n };\n\n if (typeof messageLimit != 'undefined' && messageLimit !== null) {\n args.messagelimit = messageLimit;\n }\n\n if (typeof messageOffset != 'undefined' && messageOffset !== null) {\n args.messageoffset = messageOffset;\n }\n\n if (typeof newestMessagesFirst != 'undefined' && newestMessagesFirst !== null) {\n args.newestmessagesfirst = newestMessagesFirst;\n }\n\n var request = {\n methodname: 'core_message_get_self_conversation',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Get the conversations for a user.\n *\n * @param {int} userId The logged in user\n * @param {int|null} type The type of conversation to get\n * @param {int} limit Limit for results\n * @param {int} offset Offset for results\n * @param {bool|null} favourites If favourites should be included or not\n * @return {object} jQuery promise\n */\n var getConversations = function(\n userId,\n type,\n limit,\n offset,\n favourites,\n mergeself\n ) {\n var args = {\n userid: userId,\n type: type\n };\n\n if (typeof limit != 'undefined' && limit !== null) {\n args.limitnum = limit;\n }\n\n if (typeof offset != 'undefined' && offset !== null) {\n args.limitfrom = offset;\n }\n\n if (typeof favourites != 'undefined' && favourites !== null) {\n args.favourites = favourites;\n }\n\n if (typeof mergeself != 'undefined' && mergeself !== null) {\n args.mergeself = mergeself;\n }\n\n var request = {\n methodname: 'core_message_get_conversations',\n args: args\n };\n\n return Ajax.call([request])[0]\n .then(function(result) {\n if (result.conversations.length) {\n result.conversations = result.conversations.map(function(conversation) {\n if (conversation.type == CONVERSATION_TYPES.PRIVATE || conversation.type == CONVERSATION_TYPES.SELF) {\n var otherUser = conversation.members.length ? conversation.members[0] : null;\n\n if (otherUser) {\n conversation.name = conversation.name ? conversation.name : otherUser.fullname;\n conversation.imageurl = conversation.imageurl ? conversation.imageurl : otherUser.profileimageurl;\n }\n }\n\n return conversation;\n });\n }\n\n return result;\n });\n };\n\n /**\n * Get the conversations for a user.\n *\n * @param {int} conversationId The conversation id\n * @param {int} loggedInUserId The logged in user\n * @param {int} limit Limit for results\n * @param {int} offset Offset for results\n * @param {bool} includeContactRequests If contact requests should be included in result\n * @return {object} jQuery promise\n */\n var getConversationMembers = function(conversationId, loggedInUserId, limit, offset, includeContactRequests) {\n var args = {\n userid: loggedInUserId,\n conversationid: conversationId\n };\n\n if (typeof limit != 'undefined' && limit !== null) {\n args.limitnum = limit;\n }\n\n if (typeof offset != 'undefined' && offset !== null) {\n args.limitfrom = offset;\n }\n\n if (typeof includeContactRequests != 'undefined' && includeContactRequests !== null) {\n args.includecontactrequests = includeContactRequests;\n }\n\n var request = {\n methodname: 'core_message_get_conversation_members',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Set a list of conversations to set as favourites for the given user.\n *\n * @param {int} userId The user id\n * @param {array} conversationIds List of conversation ids to set as favourite\n * @return {object} jQuery promise\n */\n var setFavouriteConversations = function(userId, conversationIds) {\n\n var request = {\n methodname: 'core_message_set_favourite_conversations',\n args: {\n userid: userId,\n conversations: conversationIds\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Set a list of conversations to unset as favourites for the given user.\n *\n * @param {int} userId The user id\n * @param {array} conversationIds List of conversation ids to unset as favourite\n * @return {object} jQuery promise\n */\n var unsetFavouriteConversations = function(userId, conversationIds) {\n\n var request = {\n methodname: 'core_message_unset_favourite_conversations',\n args: {\n userid: userId,\n conversations: conversationIds\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Set a list of conversations to set as muted for the given user.\n *\n * @param {int} userId The user id\n * @param {array} conversationIds List of conversation ids to set as favourite\n * @return {object} jQuery promise\n */\n var setMutedConversations = function(userId, conversationIds) {\n var request = {\n methodname: 'core_message_mute_conversations',\n args: {\n userid: userId,\n conversationids: conversationIds\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Set a list of conversations to unset as muted for the given user.\n *\n * @param {int} userId The user id\n * @param {array} conversationIds List of conversation ids to unset as favourite\n * @return {object} jQuery promise\n */\n var unsetMutedConversations = function(userId, conversationIds) {\n var request = {\n methodname: 'core_message_unmute_conversations',\n args: {\n userid: userId,\n conversationids: conversationIds\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Get a list of user's member info.\n *\n * @param {int} referenceUserId The user id\n * @param {array} userIds List of user ids to get\n * @param {bool} includeContactRequests Include contact requests between users in response\n * @param {bool} includePrivacyInfo Include privacy info for reference user in response\n * @return {object} jQuery promise\n */\n var getMemberInfo = function(referenceUserId, userIds, includeContactRequests, includePrivacyInfo) {\n var args = {\n referenceuserid: referenceUserId,\n userids: userIds\n };\n\n if (typeof includeContactRequests != 'undefined') {\n args.includecontactrequests = includeContactRequests;\n }\n\n if (typeof includePrivacyInfo != 'undefined') {\n args.includeprivacyinfo = includePrivacyInfo;\n }\n\n var request = {\n methodname: 'core_message_get_member_info',\n args: args\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Get a list of user's member info.\n *\n * @param {int} userId The user id to mark as read for\n * @param {int} conversationId The conversation to mark as read\n * @return {object} jQuery promise\n */\n var markAllConversationMessagesAsRead = function(userId, conversationId) {\n\n var request = {\n methodname: 'core_message_mark_all_conversation_messages_as_read',\n args: {\n userid: userId,\n conversationid: conversationId\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Get the user's message preferences.\n *\n * @param {int} userId The user id to load preferences for\n * @return {object} jQuery promise\n */\n var getUserMessagePreferences = function(userId) {\n var request = {\n methodname: 'core_message_get_user_message_preferences',\n args: {\n userid: userId\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * The the count of the user's conversations grouped by type.\n *\n * @param {Number} userId The user's id.\n * @return {Object} jQuery promise.\n */\n var getTotalConversationCounts = function(userId) {\n var request = {\n methodname: 'core_message_get_conversation_counts',\n args: {\n userid: userId\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * The the count of the user's unread conversations grouped by type.\n *\n * @param {Number} userId The user's id.\n * @return {Object} jQuery promise.\n */\n var getUnreadConversationCounts = function(userId) {\n var request = {\n methodname: 'core_message_get_unread_conversation_counts',\n args: {\n userid: userId\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Get both the unread and total conversation counts in a single request.\n *\n * @param {Number} userId The user's id.\n * @return {Object} jQuery promise.\n */\n var getAllConversationCounts = function(userId) {\n var requests = [\n {\n methodname: 'core_message_get_conversation_counts',\n args: {\n userid: userId\n }\n },\n {\n methodname: 'core_message_get_unread_conversation_counts',\n args: {\n userid: userId\n }\n },\n ];\n return $.when.apply(null, Ajax.call(requests)).then(function(total, unread) {\n return {\n total: total,\n unread: unread\n };\n });\n };\n\n return {\n countUnreadConversations: countUnreadConversations,\n getContacts: getContacts,\n blockUser: blockUser,\n unblockUser: unblockUser,\n createContactRequest: createContactRequest,\n deleteContacts: deleteContacts,\n getMessages: getMessages,\n searchUsers: searchUsers,\n searchMessages: searchMessages,\n sendMessagesToUser: sendMessagesToUser,\n sendMessageToUser: sendMessageToUser,\n sendMessagesToConversation: sendMessagesToConversation,\n sendMessageToConversation: sendMessageToConversation,\n savePreferences: savePreferences,\n getPreferences: getPreferences,\n deleteMessages: deleteMessages,\n deleteMessagesForAllUsers: deleteMessagesForAllUsers,\n deleteConversation: deleteConversation,\n getContactRequests: getContactRequests,\n acceptContactRequest: acceptContactRequest,\n declineContactRequest: declineContactRequest,\n getConversation: getConversation,\n getConversationBetweenUsers: getConversationBetweenUsers,\n getSelfConversation: getSelfConversation,\n getConversations: getConversations,\n getConversationMembers: getConversationMembers,\n setFavouriteConversations: setFavouriteConversations,\n setMutedConversations: setMutedConversations,\n unsetFavouriteConversations: unsetFavouriteConversations,\n unsetMutedConversations: unsetMutedConversations,\n getMemberInfo: getMemberInfo,\n markAllConversationMessagesAsRead: markAllConversationMessagesAsRead,\n getUserMessagePreferences: getUserMessagePreferences,\n getTotalConversationCounts: getTotalConversationCounts,\n getUnreadConversationCounts: getUnreadConversationCounts,\n getAllConversationCounts: getAllConversationCounts\n };\n});\n"],"file":"message_repository.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/message_repository.js"],"names":["define","$","Ajax","Notification","Constants","CONVERSATION_TYPES","sendMessagesToUser","toUserId","messages","formattedMessages","map","message","touserid","text","call","methodname","args","then","results","errors","reduce","carry","result","errormessage","push","length","Error","join","id","msgid","timecreated","useridfrom","conversationid","candeletemessagesforallusers","sendMessagesToConversation","conversationId","countUnreadConversations","promise","fail","exception","getContacts","userId","limit","offset","userid","limitnum","limitfrom","blockUser","blockedUserId","when","apply","blockeduserid","referenceuserid","userids","includecontactrequests","includeprivacyinfo","reponse1","profiles","unblockUser","unblockedUserId","unblockeduserid","createContactRequest","requestUserIds","requesteduserid","deleteContacts","contactUserIds","response1","getMessages","currentUserId","newestFirst","timeFrom","currentuserid","convid","newest","timefrom","searchUsers","searchString","search","searchMessages","sendMessageToUser","sendMessageToConversation","savePreferences","preferences","getPreferences","deleteMessages","messageIds","messageId","messageid","deleteMessagesForAllUsers","deleteConversation","conversationids","getContactRequests","acceptContactRequest","sendingUserId","recipientUserId","declineContactRequest","getConversation","loggedInUserId","includeContactRequests","includePrivacyInfo","memberLimit","memberOffset","messageLimit","messageOffset","newestMessagesFirst","memberlimit","memberoffset","messagelimit","messageoffset","newestmessagesfirst","getConversationBetweenUsers","otherUserId","otheruserid","getSelfConversation","getConversations","type","favourites","mergeself","conversations","conversation","PRIVATE","SELF","otherUser","members","name","fullname","imageurl","profileimageurl","getConversationMembers","setFavouriteConversations","conversationIds","setMutedConversations","unsetFavouriteConversations","unsetMutedConversations","getMemberInfo","referenceUserId","userIds","markAllConversationMessagesAsRead","getUserMessagePreferences","getTotalConversationCounts","getUnreadConversationCounts","getAllConversationCounts","total","unread"],"mappings":"AAsBAA,OAAM,mCACN,CACI,QADJ,CAEI,WAFJ,CAGI,mBAHJ,CAII,yDAJJ,CADM,CAMH,SACCC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IAAI,CAAE,CACF4B,MAAM,CAAEH,CADN,CAFV,CADW,CAOX,CACI1B,UAAU,CAAE,6CADhB,CAEIC,IAAI,CAAE,CACF4B,MAAM,CAAEH,CADN,CAFV,CAPW,CAcW,CAAnB,EAAwCxB,IAAxC,CAA6C,SAAS6H,CAAT,CAAgBC,CAAhB,CAAwB,CACxE,MAAO,CACHD,KAAK,CAAEA,CADJ,CAEHC,MAAM,CAAEA,CAFL,CAIV,CALM,CAMV,CAEM,CAsCV,CAljCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Retrieves messages from the server.\n *\n * @module core_message/message_repository\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(\n[\n 'jquery',\n 'core/ajax',\n 'core/notification',\n 'core_message/message_drawer_view_conversation_constants'\n], function(\n $,\n Ajax,\n Notification,\n Constants) {\n\n var CONVERSATION_TYPES = Constants.CONVERSATION_TYPES;\n\n /**\n * Count the number of unread conversations (one or more messages from a user)\n * for a given user.\n *\n * @param {object} args The request arguments:\n * @return {object} jQuery promise\n */\n var countUnreadConversations = function(args) {\n var request = {\n methodname: 'core_message_get_unread_conversations_count',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n /**\n * Get contacts for given user.\n *\n * @param {int} userId The user id\n * @param {int} limit Limit for results\n * @param {int} offset Offset for results\n * @return {object} jQuery promise\n */\n var getContacts = function(userId, limit, offset) {\n var args = {\n userid: userId\n };\n\n if (typeof limit !== 'undefined') {\n args.limitnum = limit;\n }\n\n if (typeof offset !== 'undefined') {\n args.limitfrom = offset;\n }\n\n var request = {\n methodname: 'core_message_get_user_contacts',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Block a user.\n *\n * @param {int} userId The requesting user\n * @param {int} blockedUserId Id of user to block\n * @return {object} jQuery promise\n */\n var blockUser = function(userId, blockedUserId) {\n var requests = [\n {\n methodname: 'core_message_block_user',\n args: {\n userid: userId,\n blockeduserid: blockedUserId\n }\n },\n {\n methodname: 'core_message_get_member_info',\n args: {\n referenceuserid: userId,\n userids: [blockedUserId],\n includecontactrequests: true,\n includeprivacyinfo: true\n }\n }\n ];\n\n // Wrap both requests in a single promise so that we can catch an error\n // from either request.\n return $.when.apply(null, Ajax.call(requests)).then(function(reponse1, profiles) {\n // Only return the profile.\n return profiles.length ? profiles[0] : {};\n });\n };\n\n /**\n * Unblock a user.\n *\n * @param {int} userId The requesting user\n * @param {int} unblockedUserId Id of user to unblock\n * @return {object} jQuery promise\n */\n var unblockUser = function(userId, unblockedUserId) {\n var requests = [\n {\n methodname: 'core_message_unblock_user',\n args: {\n userid: userId,\n unblockeduserid: unblockedUserId\n }\n },\n {\n methodname: 'core_message_get_member_info',\n args: {\n referenceuserid: userId,\n userids: [unblockedUserId],\n includecontactrequests: true,\n includeprivacyinfo: true\n }\n }\n ];\n\n // Wrap both requests in a single promise so that we can catch an error\n // from either request.\n return $.when.apply(null, Ajax.call(requests)).then(function(reponse1, profiles) {\n // Only return the profile.\n return profiles.length ? profiles[0] : {};\n });\n };\n\n /**\n * Create a request to add a user as a contact.\n *\n * @param {int} userId The requesting user\n * @param {int[]} requestUserIds List of user ids to add\n * @return {object} jQuery promise\n */\n var createContactRequest = function(userId, requestUserIds) {\n var request = {\n methodname: 'core_message_create_contact_request',\n args: {\n userid: userId,\n requesteduserid: requestUserIds\n }\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Remove a list of users as contacts.\n *\n * @param {int} userId The requesting user\n * @param {int[]} contactUserIds List of user ids to add\n * @return {object} jQuery promise\n */\n var deleteContacts = function(userId, contactUserIds) {\n var requests = [\n {\n methodname: 'core_message_delete_contacts',\n args: {\n userid: userId,\n userids: contactUserIds\n }\n },\n {\n methodname: 'core_message_get_member_info',\n args: {\n referenceuserid: userId,\n userids: contactUserIds,\n includecontactrequests: true,\n includeprivacyinfo: true\n }\n }\n ];\n\n return $.when.apply(null, Ajax.call(requests)).then(function(response1, profiles) {\n // Return all of the profiles as an array.\n return profiles;\n });\n };\n\n /**\n * Get messages between two users.\n *\n * @param {int} currentUserId The requesting user\n * @param {int} conversationId Other user in the conversation\n * @param {int} limit Limit for results\n * @param {int} offset Offset for results\n * @param {bool} newestFirst Order results by newest first\n * @param {int} timeFrom Only return messages after this timestamp\n * @return {object} jQuery promise\n */\n var getMessages = function(currentUserId, conversationId, limit, offset, newestFirst, timeFrom) {\n var args = {\n currentuserid: currentUserId,\n convid: conversationId,\n newest: newestFirst ? true : false\n };\n\n if (typeof limit !== 'undefined') {\n args.limitnum = limit;\n }\n\n if (typeof offset !== 'undefined') {\n args.limitfrom = offset;\n }\n\n if (typeof timeFrom !== 'undefined') {\n args.timefrom = timeFrom;\n }\n\n var request = {\n methodname: 'core_message_get_conversation_messages',\n args: args\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Search for users.\n *\n * @param {int} userId The requesting user\n * @param {string} searchString Search string\n * @param {int} limit Limit for results\n * @param {int} offset Offset for results\n * @return {object} jQuery promise\n */\n var searchUsers = function(userId, searchString, limit, offset) {\n var args = {\n userid: userId,\n search: searchString\n };\n\n if (typeof limit !== 'undefined') {\n args.limitnum = limit;\n }\n\n if (typeof offset !== 'undefined') {\n args.limitfrom = offset;\n }\n\n var request = {\n methodname: 'core_message_message_search_users',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Search for messages.\n *\n * @param {int} userId The requesting user\n * @param {string} searchString Search string\n * @param {int} limit Limit for results\n * @param {int} offset Offset for results\n * @return {object} jQuery promise\n */\n var searchMessages = function(userId, searchString, limit, offset) {\n var args = {\n userid: userId,\n search: searchString\n };\n\n if (typeof limit !== 'undefined') {\n args.limitnum = limit;\n }\n\n if (typeof offset !== 'undefined') {\n args.limitfrom = offset;\n }\n\n var request = {\n methodname: 'core_message_data_for_messagearea_search_messages',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Send a list of messages to a user.\n *\n * @param {int} toUserId The recipient user id\n * @param {string[]} messages List of messages to send\n * @return {object} jQuery promise\n */\n var sendMessagesToUser = function(toUserId, messages) {\n var formattedMessages = messages.map(function(message) {\n return {\n touserid: toUserId,\n text: message\n };\n });\n var request = {\n methodname: 'core_message_send_instant_messages',\n args: {\n messages: formattedMessages\n }\n };\n\n return Ajax.call([request])[0]\n .then(function(results) {\n // Error handling for the weird way the old function works.\n var errors = results.reduce(function(carry, result) {\n if (result.errormessage) {\n carry.push(result.errormessage);\n }\n\n return carry;\n }, []);\n if (errors.length) {\n throw new Error(errors.join(\"\\n\"));\n }\n\n return results;\n })\n .then(function(results) {\n // Format the results to match the other send message function.\n return results.map(function(result) {\n return {\n id: result.msgid,\n text: result.text,\n timecreated: result.timecreated,\n useridfrom: result.useridfrom,\n conversationid: result.conversationid,\n candeletemessagesforallusers: result.candeletemessagesforallusers\n };\n });\n });\n };\n\n /**\n * Send a single message to a user.\n *\n * @param {int} toUserId The recipient user id\n * @param {string} text The message text\n * @return {object} jQuery promise\n */\n var sendMessageToUser = function(toUserId, text) {\n return sendMessagesToUser(toUserId, [text])\n .then(function(results) {\n return results[0];\n });\n };\n\n /**\n * Send messages to a conversation.\n *\n * @param {int} conversationId The conversation id\n * @param {string[]} messages List of messages to send\n * @return {object} jQuery promise\n */\n var sendMessagesToConversation = function(conversationId, messages) {\n var formattedMessages = messages.map(function(message) {\n return {\n text: message\n };\n });\n var request = {\n methodname: 'core_message_send_messages_to_conversation',\n args: {\n conversationid: conversationId,\n messages: formattedMessages\n }\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Send a message to a conversation.\n *\n * @param {int} conversationId The conversation id\n * @param {string} text The message text\n * @return {object} jQuery promise\n */\n var sendMessageToConversation = function(conversationId, text) {\n return sendMessagesToConversation(conversationId, [text])\n .then(function(result) {\n return result[0];\n });\n };\n\n /**\n * Save message preferences.\n *\n * @param {int} userId The owner of the preferences\n * @param {object[]} preferences New preferences values\n * @return {object} jQuery promise\n */\n var savePreferences = function(userId, preferences) {\n var request = {\n methodname: 'core_user_update_user_preferences',\n args: {\n userid: userId,\n preferences: preferences\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Get the user's preferences.\n *\n * @param {int} userId The target user\n * @return {object} jQuery promise\n */\n var getPreferences = function(userId) {\n var request = {\n methodname: 'core_user_get_user_preferences',\n args: {\n userid: userId\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Delete a list of messages.\n *\n * @param {int} userId The user to delete messages for\n * @param {int[]} messageIds List of message ids to delete\n * @return {object} jQuery promise\n */\n var deleteMessages = function(userId, messageIds) {\n return $.when.apply(null, Ajax.call(messageIds.map(function(messageId) {\n return {\n methodname: 'core_message_delete_message',\n args: {\n messageid: messageId,\n userid: userId\n }\n };\n })));\n };\n\n /**\n * Delete a list of messages for all users.\n *\n * @param {int} userId The user to delete messages for\n * @param {int[]} messageIds List of message ids to delete\n * @return {object} jQuery promise\n */\n var deleteMessagesForAllUsers = function(userId, messageIds) {\n return $.when.apply(null, Ajax.call(messageIds.map(function(messageId) {\n return {\n methodname: 'core_message_delete_message_for_all_users',\n args: {\n messageid: messageId,\n userid: userId\n }\n };\n })));\n };\n\n /**\n * Delete a conversation between two users.\n *\n * @param {int} userId The user to delete messages for\n * @param {int} conversationId The id of the conversation\n * @return {object} jQuery promise\n */\n var deleteConversation = function(userId, conversationId) {\n var request = {\n methodname: 'core_message_delete_conversations_by_id',\n args: {\n userid: userId,\n conversationids: [conversationId]\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Get the list of contact requests for a user.\n *\n * @param {int} userId The user id\n * @return {object} jQuery promise\n */\n var getContactRequests = function(userId) {\n var request = {\n methodname: 'core_message_get_contact_requests',\n args: {\n userid: userId\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Accept a contact request.\n *\n * @param {int} sendingUserId The user that sent the request\n * @param {int} recipientUserId The user that received the request\n * @return {object} jQuery promise\n */\n var acceptContactRequest = function(sendingUserId, recipientUserId) {\n var requests = [\n {\n methodname: 'core_message_confirm_contact_request',\n args: {\n userid: sendingUserId,\n requesteduserid: recipientUserId\n }\n },\n {\n methodname: 'core_message_get_member_info',\n args: {\n referenceuserid: recipientUserId,\n userids: [sendingUserId],\n includecontactrequests: true,\n includeprivacyinfo: true\n }\n }\n ];\n\n // Wrap both requests in a single promise so that we can catch an error\n // from either request.\n return $.when.apply(null, Ajax.call(requests)).then(function(reponse1, profiles) {\n // Only return the profile.\n return profiles.length ? profiles[0] : {};\n });\n };\n\n /**\n * Decline a contact request.\n *\n * @param {int} sendingUserId The user that sent the request\n * @param {int} recipientUserId The user that received the request\n * @return {object} jQuery promise\n */\n var declineContactRequest = function(sendingUserId, recipientUserId) {\n var requests = [\n {\n methodname: 'core_message_decline_contact_request',\n args: {\n userid: sendingUserId,\n requesteduserid: recipientUserId\n }\n },\n {\n methodname: 'core_message_get_member_info',\n args: {\n referenceuserid: recipientUserId,\n userids: [sendingUserId],\n includecontactrequests: true,\n includeprivacyinfo: true\n }\n }\n ];\n\n // Wrap both requests in a single promise so that we can catch an error\n // from either request.\n return $.when.apply(null, Ajax.call(requests)).then(function(reponse1, profiles) {\n // Only return the profile.\n return profiles.length ? profiles[0] : {};\n });\n };\n\n /**\n * Get a conversation.\n *\n * @param {int} loggedInUserId The logged in user\n * @param {int} conversationId The conversation id\n * @param {bool} includeContactRequests Incldue contact requests between members\n * @param {bool} includePrivacyInfo Include privacy info for members\n * @param {int} memberLimit Limit for members\n * @param {int} memberOffset Offset for members\n * @param {int} messageLimit Limit for messages\n * @param {int} messageOffset Offset for messages\n * @param {bool} newestMessagesFirst Order the messages by newest first\n * @return {object} jQuery promise\n */\n var getConversation = function(\n loggedInUserId,\n conversationId,\n includeContactRequests,\n includePrivacyInfo,\n memberLimit,\n memberOffset,\n messageLimit,\n messageOffset,\n newestMessagesFirst\n ) {\n var args = {\n userid: loggedInUserId,\n conversationid: conversationId\n };\n\n if (typeof includeContactRequests != 'undefined' && includeContactRequests !== null) {\n args.includecontactrequests = includeContactRequests;\n }\n\n if (typeof includePrivacyInfo != 'undefined' && includePrivacyInfo !== null) {\n args.includeprivacyinfo = includePrivacyInfo;\n }\n\n if (typeof memberLimit != 'undefined' && memberLimit !== null) {\n args.memberlimit = memberLimit;\n }\n\n if (typeof memberOffset != 'undefined' && memberOffset !== null) {\n args.memberoffset = memberOffset;\n }\n\n if (typeof messageLimit != 'undefined' && messageLimit !== null) {\n args.messagelimit = messageLimit;\n }\n\n if (typeof messageOffset != 'undefined' && messageOffset !== null) {\n args.messageoffset = messageOffset;\n }\n\n if (typeof newestMessagesFirst != 'undefined' && newestMessagesFirst !== null) {\n args.newestmessagesfirst = newestMessagesFirst;\n }\n\n var request = {\n methodname: 'core_message_get_conversation',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Get a conversation between users.\n *\n * @param {int} loggedInUserId The logged in user\n * @param {int} otherUserId The other user id\n * @param {bool} includeContactRequests Incldue contact requests between members\n * @param {bool} includePrivacyInfo Include privacy info for members\n * @param {int} memberLimit Limit for members\n * @param {int} memberOffset Offset for members\n * @param {int} messageLimit Limit for messages\n * @param {int} messageOffset Offset for messages\n * @param {bool} newestMessagesFirst Order the messages by newest first\n * @return {object} jQuery promise\n */\n var getConversationBetweenUsers = function(\n loggedInUserId,\n otherUserId,\n includeContactRequests,\n includePrivacyInfo,\n memberLimit,\n memberOffset,\n messageLimit,\n messageOffset,\n newestMessagesFirst\n ) {\n var args = {\n userid: loggedInUserId,\n otheruserid: otherUserId\n };\n\n if (typeof includeContactRequests != 'undefined' && includeContactRequests !== null) {\n args.includecontactrequests = includeContactRequests;\n }\n\n if (typeof includePrivacyInfo != 'undefined' && includePrivacyInfo !== null) {\n args.includeprivacyinfo = includePrivacyInfo;\n }\n\n if (typeof memberLimit != 'undefined' && memberLimit !== null) {\n args.memberlimit = memberLimit;\n }\n\n if (typeof memberOffset != 'undefined' && memberOffset !== null) {\n args.memberoffset = memberOffset;\n }\n\n if (typeof messageLimit != 'undefined' && messageLimit !== null) {\n args.messagelimit = messageLimit;\n }\n\n if (typeof messageOffset != 'undefined' && messageOffset !== null) {\n args.messageoffset = messageOffset;\n }\n\n if (typeof newestMessagesFirst != 'undefined' && newestMessagesFirst !== null) {\n args.newestmessagesfirst = newestMessagesFirst;\n }\n\n var request = {\n methodname: 'core_message_get_conversation_between_users',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Get a self-conversation.\n *\n * @param {int} loggedInUserId The logged in user\n * @param {int} messageLimit Limit for messages\n * @param {int} messageOffset Offset for messages\n * @param {bool} newestMessagesFirst Order the messages by newest first\n * @return {object} jQuery promise\n */\n var getSelfConversation = function(\n loggedInUserId,\n messageLimit,\n messageOffset,\n newestMessagesFirst\n ) {\n var args = {\n userid: loggedInUserId\n };\n\n if (typeof messageLimit != 'undefined' && messageLimit !== null) {\n args.messagelimit = messageLimit;\n }\n\n if (typeof messageOffset != 'undefined' && messageOffset !== null) {\n args.messageoffset = messageOffset;\n }\n\n if (typeof newestMessagesFirst != 'undefined' && newestMessagesFirst !== null) {\n args.newestmessagesfirst = newestMessagesFirst;\n }\n\n var request = {\n methodname: 'core_message_get_self_conversation',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Get the conversations for a user.\n *\n * @param {int} userId The logged in user\n * @param {int|null} type The type of conversation to get\n * @param {int} limit Limit for results\n * @param {int} offset Offset for results\n * @param {bool|null} favourites If favourites should be included or not\n * @return {object} jQuery promise\n */\n var getConversations = function(\n userId,\n type,\n limit,\n offset,\n favourites,\n mergeself\n ) {\n var args = {\n userid: userId,\n type: type\n };\n\n if (typeof limit != 'undefined' && limit !== null) {\n args.limitnum = limit;\n }\n\n if (typeof offset != 'undefined' && offset !== null) {\n args.limitfrom = offset;\n }\n\n if (typeof favourites != 'undefined' && favourites !== null) {\n args.favourites = favourites;\n }\n\n if (typeof mergeself != 'undefined' && mergeself !== null) {\n args.mergeself = mergeself;\n }\n\n var request = {\n methodname: 'core_message_get_conversations',\n args: args\n };\n\n return Ajax.call([request])[0]\n .then(function(result) {\n if (result.conversations.length) {\n result.conversations = result.conversations.map(function(conversation) {\n if (conversation.type == CONVERSATION_TYPES.PRIVATE || conversation.type == CONVERSATION_TYPES.SELF) {\n var otherUser = conversation.members.length ? conversation.members[0] : null;\n\n if (otherUser) {\n conversation.name = conversation.name ? conversation.name : otherUser.fullname;\n conversation.imageurl = conversation.imageurl ? conversation.imageurl : otherUser.profileimageurl;\n }\n }\n\n return conversation;\n });\n }\n\n return result;\n });\n };\n\n /**\n * Get the conversations for a user.\n *\n * @param {int} conversationId The conversation id\n * @param {int} loggedInUserId The logged in user\n * @param {int} limit Limit for results\n * @param {int} offset Offset for results\n * @param {bool} includeContactRequests If contact requests should be included in result\n * @return {object} jQuery promise\n */\n var getConversationMembers = function(conversationId, loggedInUserId, limit, offset, includeContactRequests) {\n var args = {\n userid: loggedInUserId,\n conversationid: conversationId\n };\n\n if (typeof limit != 'undefined' && limit !== null) {\n args.limitnum = limit;\n }\n\n if (typeof offset != 'undefined' && offset !== null) {\n args.limitfrom = offset;\n }\n\n if (typeof includeContactRequests != 'undefined' && includeContactRequests !== null) {\n args.includecontactrequests = includeContactRequests;\n }\n\n var request = {\n methodname: 'core_message_get_conversation_members',\n args: args\n };\n\n return Ajax.call([request])[0];\n };\n\n /**\n * Set a list of conversations to set as favourites for the given user.\n *\n * @param {int} userId The user id\n * @param {array} conversationIds List of conversation ids to set as favourite\n * @return {object} jQuery promise\n */\n var setFavouriteConversations = function(userId, conversationIds) {\n\n var request = {\n methodname: 'core_message_set_favourite_conversations',\n args: {\n userid: userId,\n conversations: conversationIds\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Set a list of conversations to unset as favourites for the given user.\n *\n * @param {int} userId The user id\n * @param {array} conversationIds List of conversation ids to unset as favourite\n * @return {object} jQuery promise\n */\n var unsetFavouriteConversations = function(userId, conversationIds) {\n\n var request = {\n methodname: 'core_message_unset_favourite_conversations',\n args: {\n userid: userId,\n conversations: conversationIds\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Set a list of conversations to set as muted for the given user.\n *\n * @param {int} userId The user id\n * @param {array} conversationIds List of conversation ids to set as favourite\n * @return {object} jQuery promise\n */\n var setMutedConversations = function(userId, conversationIds) {\n var request = {\n methodname: 'core_message_mute_conversations',\n args: {\n userid: userId,\n conversationids: conversationIds\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Set a list of conversations to unset as muted for the given user.\n *\n * @param {int} userId The user id\n * @param {array} conversationIds List of conversation ids to unset as favourite\n * @return {object} jQuery promise\n */\n var unsetMutedConversations = function(userId, conversationIds) {\n var request = {\n methodname: 'core_message_unmute_conversations',\n args: {\n userid: userId,\n conversationids: conversationIds\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Get a list of user's member info.\n *\n * @param {int} referenceUserId The user id\n * @param {array} userIds List of user ids to get\n * @param {bool} includeContactRequests Include contact requests between users in response\n * @param {bool} includePrivacyInfo Include privacy info for reference user in response\n * @return {object} jQuery promise\n */\n var getMemberInfo = function(referenceUserId, userIds, includeContactRequests, includePrivacyInfo) {\n var args = {\n referenceuserid: referenceUserId,\n userids: userIds\n };\n\n if (typeof includeContactRequests != 'undefined') {\n args.includecontactrequests = includeContactRequests;\n }\n\n if (typeof includePrivacyInfo != 'undefined') {\n args.includeprivacyinfo = includePrivacyInfo;\n }\n\n var request = {\n methodname: 'core_message_get_member_info',\n args: args\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Get a list of user's member info.\n *\n * @param {int} userId The user id to mark as read for\n * @param {int} conversationId The conversation to mark as read\n * @return {object} jQuery promise\n */\n var markAllConversationMessagesAsRead = function(userId, conversationId) {\n\n var request = {\n methodname: 'core_message_mark_all_conversation_messages_as_read',\n args: {\n userid: userId,\n conversationid: conversationId\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Get the user's message preferences.\n *\n * @param {int} userId The user id to load preferences for\n * @return {object} jQuery promise\n */\n var getUserMessagePreferences = function(userId) {\n var request = {\n methodname: 'core_message_get_user_message_preferences',\n args: {\n userid: userId\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * The the count of the user's conversations grouped by type.\n *\n * @param {Number} userId The user's id.\n * @return {Object} jQuery promise.\n */\n var getTotalConversationCounts = function(userId) {\n var request = {\n methodname: 'core_message_get_conversation_counts',\n args: {\n userid: userId\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * The the count of the user's unread conversations grouped by type.\n *\n * @param {Number} userId The user's id.\n * @return {Object} jQuery promise.\n */\n var getUnreadConversationCounts = function(userId) {\n var request = {\n methodname: 'core_message_get_unread_conversation_counts',\n args: {\n userid: userId\n }\n };\n return Ajax.call([request])[0];\n };\n\n /**\n * Get both the unread and total conversation counts in a single request.\n *\n * @param {Number} userId The user's id.\n * @return {Object} jQuery promise.\n */\n var getAllConversationCounts = function(userId) {\n var requests = [\n {\n methodname: 'core_message_get_conversation_counts',\n args: {\n userid: userId\n }\n },\n {\n methodname: 'core_message_get_unread_conversation_counts',\n args: {\n userid: userId\n }\n },\n ];\n return $.when.apply(null, Ajax.call(requests)).then(function(total, unread) {\n return {\n total: total,\n unread: unread\n };\n });\n };\n\n return {\n countUnreadConversations: countUnreadConversations,\n getContacts: getContacts,\n blockUser: blockUser,\n unblockUser: unblockUser,\n createContactRequest: createContactRequest,\n deleteContacts: deleteContacts,\n getMessages: getMessages,\n searchUsers: searchUsers,\n searchMessages: searchMessages,\n sendMessagesToUser: sendMessagesToUser,\n sendMessageToUser: sendMessageToUser,\n sendMessagesToConversation: sendMessagesToConversation,\n sendMessageToConversation: sendMessageToConversation,\n savePreferences: savePreferences,\n getPreferences: getPreferences,\n deleteMessages: deleteMessages,\n deleteMessagesForAllUsers: deleteMessagesForAllUsers,\n deleteConversation: deleteConversation,\n getContactRequests: getContactRequests,\n acceptContactRequest: acceptContactRequest,\n declineContactRequest: declineContactRequest,\n getConversation: getConversation,\n getConversationBetweenUsers: getConversationBetweenUsers,\n getSelfConversation: getSelfConversation,\n getConversations: getConversations,\n getConversationMembers: getConversationMembers,\n setFavouriteConversations: setFavouriteConversations,\n setMutedConversations: setMutedConversations,\n unsetFavouriteConversations: unsetFavouriteConversations,\n unsetMutedConversations: unsetMutedConversations,\n getMemberInfo: getMemberInfo,\n markAllConversationMessagesAsRead: markAllConversationMessagesAsRead,\n getUserMessagePreferences: getUserMessagePreferences,\n getTotalConversationCounts: getTotalConversationCounts,\n getUnreadConversationCounts: getUnreadConversationCounts,\n getAllConversationCounts: getAllConversationCounts\n };\n});\n"],"file":"message_repository.min.js"} \ No newline at end of file diff --git a/message/amd/build/notification_preference.min.js.map b/message/amd/build/notification_preference.min.js.map index a99b7b9a59634..e5f5b7e0b9a7a 100644 --- a/message/amd/build/notification_preference.min.js.map +++ b/message/amd/build/notification_preference.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/notification_preference.js"],"names":["define","$","Ajax","Notification","NotificationProcessor","SELECTORS","PROCESSOR","STATE_INPUTS","NotificationPreference","element","userId","root","prototype","getPreferenceKey","attr","getLoggedInPreferenceKey","getLoggedOffPreferenceKey","getProcessors","find","map","index","startLoading","addClass","prop","stopLoading","removeClass","isLoading","hasClass","save","Deferred","resolve","loggedInValue","loggedOffValue","each","processor","isLoggedInEnabled","getName","isLoggedOffEnabled","args","userid","preferences","type","value","call","methodname","fail","exception","always","bind"],"mappings":"AAwBAA,OAAM,wCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAA6C,qCAA7C,C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AAEX,CAFX,CADS,CAKT,CACIU,IAAI,CAAE,KAAKzB,yBAAL,EADV,CAEI0B,KAAK,CAAEV,CAFX,CALS,CAFN,CApCoC,CAuD/C,MAAO9B,CAAAA,CAAI,CAACyC,IAAL,CAAU,CALH,CACVC,UAAU,CAAE,mCADF,CAEVN,IAAI,CAAEA,CAFI,CAKG,CAAV,EAAqB,CAArB,EACFO,IADE,CACG1C,CAAY,CAAC2C,SADhB,EAEFC,MAFE,CAEK,UAAW,CACf,KAAKvB,WAAL,EACH,CAFO,CAENwB,IAFM,CAED,IAFC,CAFL,CAKV,CA5DD,CA8DA,MAAOxC,CAAAA,CACV,CAhKK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the preference for an individual notification type on the\n * message preference page.\n *\n * @module core_message/notification_preference\n * @class notification_preference\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax', 'core/notification', 'core_message/notification_processor'],\n function($, Ajax, Notification, NotificationProcessor) {\n\n var SELECTORS = {\n PROCESSOR: '[data-processor-name]',\n STATE_INPUTS: '[data-state] input',\n };\n\n /**\n * Constructor for the Preference.\n *\n * @param {object} element jQuery object root element of the preference\n * @param {int} userId The current user id\n */\n var NotificationPreference = function(element, userId) {\n this.root = $(element);\n this.userId = userId;\n };\n\n /**\n * Get the unique prefix key that identifies this user preference.\n *\n * @method getPreferenceKey\n * @return {string}\n */\n NotificationPreference.prototype.getPreferenceKey = function() {\n return this.root.attr('data-preference-key');\n };\n\n /**\n * Get the unique key for the logged in preference.\n *\n * @method getLoggedInPreferenceKey\n * @return {string}\n */\n NotificationPreference.prototype.getLoggedInPreferenceKey = function() {\n return this.getPreferenceKey() + '_loggedin';\n };\n\n /**\n * Get the unique key for the logged off preference.\n *\n * @method getLoggedOffPreferenceKey\n * @return {string}\n */\n NotificationPreference.prototype.getLoggedOffPreferenceKey = function() {\n return this.getPreferenceKey() + '_loggedoff';\n };\n\n /**\n * Get the list of Processors available for this preference.\n *\n * @method getProcessors\n * @return {array}\n */\n NotificationPreference.prototype.getProcessors = function() {\n return this.root.find(SELECTORS.PROCESSOR).map(function(index, element) {\n return new NotificationProcessor($(element));\n });\n };\n\n /**\n * Flag the preference as loading.\n *\n * @method startLoading\n */\n NotificationPreference.prototype.startLoading = function() {\n this.root.addClass('loading');\n this.root.find(SELECTORS.STATE_INPUTS).prop('disabled', true);\n };\n\n /**\n * Remove the loading flag for this preference.\n *\n * @method stopLoading\n */\n NotificationPreference.prototype.stopLoading = function() {\n this.root.removeClass('loading');\n this.root.find(SELECTORS.STATE_INPUTS).prop('disabled', false);\n };\n\n /**\n * Check if the preference is loading.\n *\n * @method isLoading\n * @return {Boolean}\n */\n NotificationPreference.prototype.isLoading = function() {\n return this.root.hasClass('loading');\n };\n\n /**\n * Persist the current state of the processors for this preference.\n *\n * @method save\n * @return {object} jQuery promise\n */\n NotificationPreference.prototype.save = function() {\n if (this.isLoading()) {\n return $.Deferred().resolve();\n }\n\n this.startLoading();\n\n var loggedInValue = '';\n var loggedOffValue = '';\n\n this.getProcessors().each(function(index, processor) {\n if (processor.isLoggedInEnabled()) {\n if (loggedInValue === '') {\n loggedInValue = processor.getName();\n } else {\n loggedInValue += ',' + processor.getName();\n }\n }\n\n if (processor.isLoggedOffEnabled()) {\n if (loggedOffValue === '') {\n loggedOffValue = processor.getName();\n } else {\n loggedOffValue += ',' + processor.getName();\n }\n }\n });\n\n if (loggedInValue === '') {\n loggedInValue = 'none';\n }\n\n if (loggedOffValue === '') {\n loggedOffValue = 'none';\n }\n\n var args = {\n userid: this.userId,\n preferences: [\n {\n type: this.getLoggedInPreferenceKey(),\n value: loggedInValue,\n },\n {\n type: this.getLoggedOffPreferenceKey(),\n value: loggedOffValue,\n },\n ],\n };\n\n var request = {\n methodname: 'core_user_update_user_preferences',\n args: args,\n };\n\n return Ajax.call([request])[0]\n .fail(Notification.exception)\n .always(function() {\n this.stopLoading();\n }.bind(this));\n };\n\n return NotificationPreference;\n});\n"],"file":"notification_preference.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/notification_preference.js"],"names":["define","$","Ajax","Notification","NotificationProcessor","SELECTORS","PROCESSOR","STATE_INPUTS","NotificationPreference","element","userId","root","prototype","getPreferenceKey","attr","getLoggedInPreferenceKey","getLoggedOffPreferenceKey","getProcessors","find","map","index","startLoading","addClass","prop","stopLoading","removeClass","isLoading","hasClass","save","Deferred","resolve","loggedInValue","loggedOffValue","each","processor","isLoggedInEnabled","getName","isLoggedOffEnabled","args","userid","preferences","type","value","call","methodname","fail","exception","always","bind"],"mappings":"AAuBAA,OAAM,wCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAA6C,qCAA7C,CAAD,CACE,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgCC,CAAhC,CAAuD,IAEvDC,CAAAA,CAAS,CAAG,CACZC,SAAS,CAAE,uBADC,CAEZC,YAAY,CAAE,oBAFF,CAF2C,CAcvDC,CAAsB,CAAG,SAASC,CAAT,CAAkBC,CAAlB,CAA0B,CACnD,KAAKC,IAAL,CAAYV,CAAC,CAACQ,CAAD,CAAb,CACA,KAAKC,MAAL,CAAcA,CACjB,CAjB0D,CAyB3DF,CAAsB,CAACI,SAAvB,CAAiCC,gBAAjC,CAAoD,UAAW,CAC3D,MAAO,MAAKF,IAAL,CAAUG,IAAV,CAAe,qBAAf,CACV,CAFD,CAUAN,CAAsB,CAACI,SAAvB,CAAiCG,wBAAjC,CAA4D,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IAArB,CAA0B,SAASb,CAAT,CAAgBc,CAAhB,CAA2B,CACjD,GAAIA,CAAS,CAACC,iBAAV,EAAJ,CAAmC,CAC/B,GAAsB,EAAlB,GAAAJ,CAAJ,CAA0B,CACtBA,CAAa,CAAGG,CAAS,CAACE,OAAV,EACnB,CAFD,IAEO,CACHL,CAAa,EAAI,IAAMG,CAAS,CAACE,OAAV,EAC1B,CACJ,CAED,GAAIF,CAAS,CAACG,kBAAV,EAAJ,CAAoC,CAChC,GAAuB,EAAnB,GAAAL,CAAJ,CAA2B,CACvBA,CAAc,CAAGE,CAAS,CAACE,OAAV,EACpB,CAFD,IAEO,CACHJ,CAAc,EAAI,IAAME,CAAS,CAACE,OAAV,EAC3B,CACJ,CACJ,CAhBD,EAkBA,GAAsB,EAAlB,GAAAL,CAAJ,CAA0B,CACtBA,CAAa,CAAG,MACnB,CAED,GAAuB,EAAnB,GAAAC,CAAJ,CAA2B,CACvBA,CAAc,CAAG,MACpB,CAlC8C,GAoC3CM,CAAAA,CAAI,CAAG,CACPC,MAAM,CAAE,KAAK7B,MADN,CAEP8B,WAAW,CAAE,CACT,CACIC,IAAI,CAAE,KAAK1B,wBAAL,EADV,CAEI2B,KAAK,CAAEX,CAFX,CADS,CAKT,CACIU,IAAI,CAAE,KAAKzB,yBAAL,EADV,CAEI0B,KAAK,CAAEV,CAFX,CALS,CAFN,CApCoC,CAuD/C,MAAO9B,CAAAA,CAAI,CAACyC,IAAL,CAAU,CALH,CACVC,UAAU,CAAE,mCADF,CAEVN,IAAI,CAAEA,CAFI,CAKG,CAAV,EAAqB,CAArB,EACFO,IADE,CACG1C,CAAY,CAAC2C,SADhB,EAEFC,MAFE,CAEK,UAAW,CACf,KAAKvB,WAAL,EACH,CAFO,CAENwB,IAFM,CAED,IAFC,CAFL,CAKV,CA5DD,CA8DA,MAAOxC,CAAAA,CACV,CAjKK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the preference for an individual notification type on the\n * message preference page.\n *\n * @module core_message/notification_preference\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax', 'core/notification', 'core_message/notification_processor'],\n function($, Ajax, Notification, NotificationProcessor) {\n\n var SELECTORS = {\n PROCESSOR: '[data-processor-name]',\n STATE_INPUTS: '[data-state] input',\n };\n\n /**\n * Constructor for the Preference.\n *\n * @class\n * @param {object} element jQuery object root element of the preference\n * @param {int} userId The current user id\n */\n var NotificationPreference = function(element, userId) {\n this.root = $(element);\n this.userId = userId;\n };\n\n /**\n * Get the unique prefix key that identifies this user preference.\n *\n * @method getPreferenceKey\n * @return {string}\n */\n NotificationPreference.prototype.getPreferenceKey = function() {\n return this.root.attr('data-preference-key');\n };\n\n /**\n * Get the unique key for the logged in preference.\n *\n * @method getLoggedInPreferenceKey\n * @return {string}\n */\n NotificationPreference.prototype.getLoggedInPreferenceKey = function() {\n return this.getPreferenceKey() + '_loggedin';\n };\n\n /**\n * Get the unique key for the logged off preference.\n *\n * @method getLoggedOffPreferenceKey\n * @return {string}\n */\n NotificationPreference.prototype.getLoggedOffPreferenceKey = function() {\n return this.getPreferenceKey() + '_loggedoff';\n };\n\n /**\n * Get the list of Processors available for this preference.\n *\n * @method getProcessors\n * @return {array}\n */\n NotificationPreference.prototype.getProcessors = function() {\n return this.root.find(SELECTORS.PROCESSOR).map(function(index, element) {\n return new NotificationProcessor($(element));\n });\n };\n\n /**\n * Flag the preference as loading.\n *\n * @method startLoading\n */\n NotificationPreference.prototype.startLoading = function() {\n this.root.addClass('loading');\n this.root.find(SELECTORS.STATE_INPUTS).prop('disabled', true);\n };\n\n /**\n * Remove the loading flag for this preference.\n *\n * @method stopLoading\n */\n NotificationPreference.prototype.stopLoading = function() {\n this.root.removeClass('loading');\n this.root.find(SELECTORS.STATE_INPUTS).prop('disabled', false);\n };\n\n /**\n * Check if the preference is loading.\n *\n * @method isLoading\n * @return {Boolean}\n */\n NotificationPreference.prototype.isLoading = function() {\n return this.root.hasClass('loading');\n };\n\n /**\n * Persist the current state of the processors for this preference.\n *\n * @method save\n * @return {object} jQuery promise\n */\n NotificationPreference.prototype.save = function() {\n if (this.isLoading()) {\n return $.Deferred().resolve();\n }\n\n this.startLoading();\n\n var loggedInValue = '';\n var loggedOffValue = '';\n\n this.getProcessors().each(function(index, processor) {\n if (processor.isLoggedInEnabled()) {\n if (loggedInValue === '') {\n loggedInValue = processor.getName();\n } else {\n loggedInValue += ',' + processor.getName();\n }\n }\n\n if (processor.isLoggedOffEnabled()) {\n if (loggedOffValue === '') {\n loggedOffValue = processor.getName();\n } else {\n loggedOffValue += ',' + processor.getName();\n }\n }\n });\n\n if (loggedInValue === '') {\n loggedInValue = 'none';\n }\n\n if (loggedOffValue === '') {\n loggedOffValue = 'none';\n }\n\n var args = {\n userid: this.userId,\n preferences: [\n {\n type: this.getLoggedInPreferenceKey(),\n value: loggedInValue,\n },\n {\n type: this.getLoggedOffPreferenceKey(),\n value: loggedOffValue,\n },\n ],\n };\n\n var request = {\n methodname: 'core_user_update_user_preferences',\n args: args,\n };\n\n return Ajax.call([request])[0]\n .fail(Notification.exception)\n .always(function() {\n this.stopLoading();\n }.bind(this));\n };\n\n return NotificationPreference;\n});\n"],"file":"notification_preference.min.js"} \ No newline at end of file diff --git a/message/amd/build/notification_processor.min.js.map b/message/amd/build/notification_processor.min.js.map index 925bc7cf27197..174c134670fc1 100644 --- a/message/amd/build/notification_processor.min.js.map +++ b/message/amd/build/notification_processor.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/notification_processor.js"],"names":["define","$","SELECTORS","STATE_NONE","STATE_BOTH","STATE_LOGGED_IN","STATE_LOGGED_OFF","NotificationProcessor","element","root","prototype","getName","attr","isLoggedInEnabled","none","find","prop","both","loggedIn","isLoggedOffEnabled","loggedOff"],"mappings":"AAuBAA,OAAM,uCAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,IACvBC,CAAAA,CAAS,CAAG,CACZC,UAAU,CAAE,uBADA,CAEZC,UAAU,CAAE,uBAFA,CAGZC,eAAe,CAAE,2BAHL,CAIZC,gBAAgB,CAAE,4BAJN,CADW,CAavBC,CAAqB,CAAG,SAASC,CAAT,CAAkB,CAC1C,KAAKC,IAAL,CAAYR,CAAC,CAACO,CAAD,CAChB,CAf0B,CAuB3BD,CAAqB,CAACG,SAAtB,CAAgCC,OAAhC,CAA0C,UAAW,CACjD,MAAO,MAAKF,IAAL,CAAUG,IAAV,CAAe,qBAAf,CACV,CAFD,CAUAL,CAAqB,CAACG,SAAtB,CAAgCG,iBAAhC,CAAoD,UAAW,CAC3D,GAAIC,CAAAA,CAAI,CAAG,KAAKL,IAAL,CAAUM,IAAV,CAAeb,CAAS,CAACC,UAAzB,EAAqCY,IAArC,CAA0C,OAA1C,CAAX,CAEA,GAAID,CAAI,CAACE,IAAL,CAAU,SAAV,CAAJ,CAA0B,CACtB,QACH,CAL0D,GAOvDC,CAAAA,CAAI,CAAG,KAAKR,IAAL,CAAUM,IAAV,CAAeb,CAAS,CAACE,UAAzB,EAAqCW,IAArC,CAA0C,OAA1C,CAPgD,CAQvDG,CAAQ,CAAG,KAAKT,IAAL,CAAUM,IAAV,CAAeb,CAAS,CAACG,eAAzB,EAA0CU,IAA1C,CAA+C,OAA/C,CAR4C,CAU3D,MAAOG,CAAAA,CAAQ,CAACF,IAAT,CAAc,SAAd,GAA4BC,CAAI,CAACD,IAAL,CAAU,SAAV,CACtC,CAXD,CAmBAT,CAAqB,CAACG,SAAtB,CAAgCS,kBAAhC,CAAqD,UAAW,CAC5D,GAAIL,CAAAA,CAAI,CAAG,KAAKL,IAAL,CAAUM,IAAV,CAAeb,CAAS,CAACC,UAAzB,EAAqCY,IAArC,CAA0C,OAA1C,CAAX,CAEA,GAAID,CAAI,CAACE,IAAL,CAAU,SAAV,CAAJ,CAA0B,CACtB,QACH,CAL2D,GAOxDC,CAAAA,CAAI,CAAG,KAAKR,IAAL,CAAUM,IAAV,CAAeb,CAAS,CAACE,UAAzB,EAAqCW,IAArC,CAA0C,OAA1C,CAPiD,CAQxDK,CAAS,CAAG,KAAKX,IAAL,CAAUM,IAAV,CAAeb,CAAS,CAACI,gBAAzB,EAA2CS,IAA3C,CAAgD,OAAhD,CAR4C,CAU5D,MAAOK,CAAAA,CAAS,CAACJ,IAAV,CAAe,SAAf,GAA6BC,CAAI,CAACD,IAAL,CAAU,SAAV,CACvC,CAXD,CAaA,MAAOT,CAAAA,CACV,CAlEK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Represents the notification processor (e.g. email, popup, jabber)\n *\n * @module core_message/notification_processor\n * @class notification_processor\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'], function($) {\n var SELECTORS = {\n STATE_NONE: '[data-state=\"none\"]',\n STATE_BOTH: '[data-state=\"both\"]',\n STATE_LOGGED_IN: '[data-state=\"loggedin\"]',\n STATE_LOGGED_OFF: '[data-state=\"loggedoff\"]',\n };\n\n /**\n * Constructor for the notification processor.\n *\n * @param {object} element jQuery object root element of the processor\n */\n var NotificationProcessor = function(element) {\n this.root = $(element);\n };\n\n /**\n * Get the processor name.\n *\n * @method getName\n * @return {string}\n */\n NotificationProcessor.prototype.getName = function() {\n return this.root.attr('data-processor-name');\n };\n\n /**\n * Check if the processor is enabled when the user is logged in.\n *\n * @method isLoggedInEnabled\n * @return {bool}\n */\n NotificationProcessor.prototype.isLoggedInEnabled = function() {\n var none = this.root.find(SELECTORS.STATE_NONE).find('input');\n\n if (none.prop('checked')) {\n return false;\n }\n\n var both = this.root.find(SELECTORS.STATE_BOTH).find('input');\n var loggedIn = this.root.find(SELECTORS.STATE_LOGGED_IN).find('input');\n\n return loggedIn.prop('checked') || both.prop('checked');\n };\n\n /**\n * Check if the processor is enabled when the user is logged out.\n *\n * @method isLoggedOffEnabled\n * @return {bool}\n */\n NotificationProcessor.prototype.isLoggedOffEnabled = function() {\n var none = this.root.find(SELECTORS.STATE_NONE).find('input');\n\n if (none.prop('checked')) {\n return false;\n }\n\n var both = this.root.find(SELECTORS.STATE_BOTH).find('input');\n var loggedOff = this.root.find(SELECTORS.STATE_LOGGED_OFF).find('input');\n\n return loggedOff.prop('checked') || both.prop('checked');\n };\n\n return NotificationProcessor;\n});\n"],"file":"notification_processor.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/notification_processor.js"],"names":["define","$","SELECTORS","STATE_NONE","STATE_BOTH","STATE_LOGGED_IN","STATE_LOGGED_OFF","NotificationProcessor","element","root","prototype","getName","attr","isLoggedInEnabled","none","find","prop","both","loggedIn","isLoggedOffEnabled","loggedOff"],"mappings":"AAsBAA,OAAM,uCAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,IACvBC,CAAAA,CAAS,CAAG,CACZC,UAAU,CAAE,uBADA,CAEZC,UAAU,CAAE,uBAFA,CAGZC,eAAe,CAAE,2BAHL,CAIZC,gBAAgB,CAAE,4BAJN,CADW,CAcvBC,CAAqB,CAAG,SAASC,CAAT,CAAkB,CAC1C,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AhD,CAR4C,CAU5D,MAAOK,CAAAA,CAAS,CAACJ,IAAV,CAAe,SAAf,GAA6BC,CAAI,CAACD,IAAL,CAAU,SAAV,CACvC,CAXD,CAaA,MAAOT,CAAAA,CACV,CAnEK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Represents the notification processor (e.g. email, popup, jabber)\n *\n * @module core_message/notification_processor\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'], function($) {\n var SELECTORS = {\n STATE_NONE: '[data-state=\"none\"]',\n STATE_BOTH: '[data-state=\"both\"]',\n STATE_LOGGED_IN: '[data-state=\"loggedin\"]',\n STATE_LOGGED_OFF: '[data-state=\"loggedoff\"]',\n };\n\n /**\n * Constructor for the notification processor.\n *\n * @class\n * @param {object} element jQuery object root element of the processor\n */\n var NotificationProcessor = function(element) {\n this.root = $(element);\n };\n\n /**\n * Get the processor name.\n *\n * @method getName\n * @return {string}\n */\n NotificationProcessor.prototype.getName = function() {\n return this.root.attr('data-processor-name');\n };\n\n /**\n * Check if the processor is enabled when the user is logged in.\n *\n * @method isLoggedInEnabled\n * @return {bool}\n */\n NotificationProcessor.prototype.isLoggedInEnabled = function() {\n var none = this.root.find(SELECTORS.STATE_NONE).find('input');\n\n if (none.prop('checked')) {\n return false;\n }\n\n var both = this.root.find(SELECTORS.STATE_BOTH).find('input');\n var loggedIn = this.root.find(SELECTORS.STATE_LOGGED_IN).find('input');\n\n return loggedIn.prop('checked') || both.prop('checked');\n };\n\n /**\n * Check if the processor is enabled when the user is logged out.\n *\n * @method isLoggedOffEnabled\n * @return {bool}\n */\n NotificationProcessor.prototype.isLoggedOffEnabled = function() {\n var none = this.root.find(SELECTORS.STATE_NONE).find('input');\n\n if (none.prop('checked')) {\n return false;\n }\n\n var both = this.root.find(SELECTORS.STATE_BOTH).find('input');\n var loggedOff = this.root.find(SELECTORS.STATE_LOGGED_OFF).find('input');\n\n return loggedOff.prop('checked') || both.prop('checked');\n };\n\n return NotificationProcessor;\n});\n"],"file":"notification_processor.min.js"} \ No newline at end of file diff --git a/message/amd/build/notification_processor_settings.min.js.map b/message/amd/build/notification_processor_settings.min.js.map index a9df440f83012..1b7ae94f25b47 100644 --- a/message/amd/build/notification_processor_settings.min.js.map +++ b/message/amd/build/notification_processor_settings.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/notification_processor_settings.js"],"names":["define","$","Ajax","Str","Notification","CustomEvents","Modal","ModalRegistry","Fragment","registered","SELECTORS","SAVE_BUTTON","CANCEL_BUTTON","PROCESSOR","PREFERENCE_ROW","NotificationProcessorSettings","root","call","name","userId","contextId","element","saveButton","getFooter","find","cancelButton","TYPE","prototype","Object","create","constructor","setUserId","id","getUserId","setElement","getElement","setName","getName","setContextId","getContextId","getForm","getBody","disableButtons","prop","enableButtons","loadTitleContent","titlePromise","get_string","setTitle","loadBodyContent","args","userid","type","bodyPromise","loadFragment","setBody","then","bind","fail","exception","loadAllContent","when","show","hide","updateConfiguredStatus","processorHeader","closest","hasClass","processorName","attr","request","methodname","done","result","userconfigured","notifications","removeClass","registerEventListeners","getModal","on","events","activate","e","data","submit","originalEvent","preventDefault","stopPropagation","register"],"mappings":"AAuBAA,OAAM,gDAAC,CACC,QADD,CAEC,WAFD,CAGC,UAHD,CAIC,mBAJD,CAKC,gCALD,CAMC,YAND,CAOC,qBAPD,CAQC,eARD,CAAD,CAUE,SACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,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CAAmB1E,CAAY,CAAC2E,MAAb,CAAoBC,QAAvC,CAAiDvE,CAAS,CAACE,aAA3D,CAA0E,SAASsE,CAAT,CAAYC,CAAZ,CAAkB,CACxF,KAAKpB,IAAL,GACAoB,CAAI,CAACE,aAAL,CAAmBC,cAAnB,GACAJ,CAAC,CAACK,eAAF,EACH,CAJyE,CAIxE9B,IAJwE,CAInE,IAJmE,CAA1E,CAKH,CArBD,CA0BA,GAAI,CAAChD,CAAL,CAAiB,CACbF,CAAa,CAACiF,QAAd,CACwBzE,CAA6B,CAACW,IADtD,CAEwBX,CAFxB,CAGwB,wBAHxB,EAIAN,CAAU,GACb,CAED,MAAOM,CAAAA,CACV,CArTK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Load the settings for a message processor.\n *\n * @module core_message/notification_processor_settings\n * @class notification_processor_settings\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n 'jquery',\n 'core/ajax',\n 'core/str',\n 'core/notification',\n 'core/custom_interaction_events',\n 'core/modal',\n 'core/modal_registry',\n 'core/fragment',\n ],\n function(\n $,\n Ajax,\n Str,\n Notification,\n CustomEvents,\n Modal,\n ModalRegistry,\n Fragment\n ) {\n\n var registered = false;\n var SELECTORS = {\n SAVE_BUTTON: '[data-action=\"save\"]',\n CANCEL_BUTTON: '[data-action=\"cancel\"]',\n PROCESSOR: '[data-processor-name]',\n PREFERENCE_ROW: '[data-region=\"preference-row\"]',\n };\n\n /**\n * Constructor for the Modal.\n *\n * @param {object} root The root jQuery element for the modal.\n */\n var NotificationProcessorSettings = function(root) {\n Modal.call(this, root);\n this.name = null;\n this.userId = null;\n this.contextId = null;\n this.element = null;\n this.saveButton = this.getFooter().find(SELECTORS.SAVE_BUTTON);\n this.cancelButton = this.getFooter().find(SELECTORS.CANCEL_BUTTON);\n };\n\n NotificationProcessorSettings.TYPE = 'core_message-notification_processor_settings';\n NotificationProcessorSettings.prototype = Object.create(Modal.prototype);\n NotificationProcessorSettings.prototype.constructor = NotificationProcessorSettings;\n\n /**\n * Set the userid to the given value.\n *\n * @method setUserId\n * @param {int} id The notification userid\n */\n NotificationProcessorSettings.prototype.setUserId = function(id) {\n this.userId = id;\n };\n\n /**\n * Retrieve the current userid, if any.\n *\n * @method getUserId\n * @return {int|null} The notification userid\n */\n NotificationProcessorSettings.prototype.getUserId = function() {\n return this.userId;\n };\n\n /**\n * Set the object to the given value.\n *\n * @method setElement\n * @param {object} element The notification node element.\n */\n NotificationProcessorSettings.prototype.setElement = function(element) {\n this.element = element;\n };\n\n /**\n * Retrieve the current element, if any.\n *\n * @method getElement\n * @return {object|null} The notification node element.\n */\n NotificationProcessorSettings.prototype.getElement = function() {\n return this.element;\n };\n\n /**\n * Set the name to the given value.\n *\n * @method setName\n * @param {string} name The notification name.\n */\n NotificationProcessorSettings.prototype.setName = function(name) {\n this.name = name;\n };\n\n /**\n * Retrieve the current name, if any.\n *\n * @method getName\n * @return {string|null} The notification name.\n */\n NotificationProcessorSettings.prototype.getName = function() {\n return this.name;\n };\n /**\n * Set the context id to the given value.\n *\n * @method setContextId\n * @param {Number} id The notification context id\n */\n NotificationProcessorSettings.prototype.setContextId = function(id) {\n this.contextId = id;\n };\n\n /**\n * Retrieve the current context id, if any.\n *\n * @method getContextId\n * @return {Number|null} The notification context id\n */\n NotificationProcessorSettings.prototype.getContextId = function() {\n return this.contextId;\n };\n\n /**\n * Get the form element from the modal.\n *\n * @method getForm\n * @return {object}\n */\n NotificationProcessorSettings.prototype.getForm = function() {\n return this.getBody().find('form');\n };\n\n /**\n * Disable the buttons in the footer.\n *\n * @method disableButtons\n */\n NotificationProcessorSettings.prototype.disableButtons = function() {\n this.saveButton.prop('disabled', true);\n this.cancelButton.prop('disabled', true);\n };\n\n /**\n * Enable the buttons in the footer.\n *\n * @method enableButtons\n */\n NotificationProcessorSettings.prototype.enableButtons = function() {\n this.saveButton.prop('disabled', false);\n this.cancelButton.prop('disabled', false);\n };\n\n /**\n * Load the title for the modal to the appropriate value\n * depending on message outputs.\n *\n * @method loadTitleContent\n * @return {object} A promise resolved with the new title text.\n */\n NotificationProcessorSettings.prototype.loadTitleContent = function() {\n this.titlePromise = Str.get_string('processorsettings', 'message');\n this.setTitle(this.titlePromise);\n\n return this.titlePromise;\n };\n\n /**\n * Load the body for the modal to the appropriate value\n * depending on message outputs.\n *\n * @method loadBodyContent\n * @return {object} A promise resolved with the fragment html and js from\n */\n NotificationProcessorSettings.prototype.loadBodyContent = function() {\n this.disableButtons();\n\n var args = {\n userid: this.getUserId(),\n type: this.getName(),\n };\n\n this.bodyPromise = Fragment.loadFragment('message', 'processor_settings', this.getContextId(), args);\n this.setBody(this.bodyPromise);\n\n this.bodyPromise.then(function() {\n this.enableButtons();\n return;\n }.bind(this))\n .fail(Notification.exception);\n\n return this.bodyPromise;\n };\n\n /**\n * Load both the title and body content.\n *\n * @method loadAllContent\n * @return {object} promise\n */\n NotificationProcessorSettings.prototype.loadAllContent = function() {\n return $.when(this.loadTitleContent(), this.loadBodyContent());\n };\n\n /**\n * Load the modal content before showing it. This\n * is to allow us to re-use the same modal for creating and\n * editing different message outputs within the page.\n *\n * @method show\n */\n NotificationProcessorSettings.prototype.show = function() {\n this.loadAllContent();\n Modal.prototype.show.call(this);\n };\n\n /**\n * Clear the notification from the modal when it's closed so\n * that it is loaded fresh next time it's displayed.\n *\n * @method hide\n */\n NotificationProcessorSettings.prototype.hide = function() {\n Modal.prototype.hide.call(this);\n this.setContextId(null);\n this.setName(null);\n this.setUserId(null);\n };\n\n /**\n * Checks if the processor has been configured. If so then remove the unconfigured\n * status from the interface.\n *\n * @method updateConfiguredStatus\n * @return {Promise|boolean}\n */\n NotificationProcessorSettings.prototype.updateConfiguredStatus = function() {\n var processorHeader = $(this.getElement()).closest(SELECTORS.PROCESSOR);\n\n if (!processorHeader.hasClass('unconfigured')) {\n return false;\n }\n\n var processorName = processorHeader.attr('data-processor-name');\n var request = {\n methodname: 'core_message_get_message_processor',\n args: {\n name: processorName,\n userid: this.userId,\n },\n };\n\n return Ajax.call([request])[0]\n .fail(Notification.exception)\n .done(function(result) {\n // Check if the user has figured configuring the processor.\n if (result.userconfigured) {\n // If they have then we can enable the settings.\n var notifications = $(SELECTORS.PREFERENCE_ROW + ' [data-processor-name=\"' + processorName + '\"]');\n processorHeader.removeClass('unconfigured');\n notifications.removeClass('disabled');\n }\n });\n };\n\n /**\n * Set up all of the event handling for the modal.\n *\n * @method registerEventListeners\n */\n NotificationProcessorSettings.prototype.registerEventListeners = function() {\n // Apply parent event listeners.\n Modal.prototype.registerEventListeners.call(this);\n\n // When the user clicks the save button we trigger the form submission.\n this.getModal().on(CustomEvents.events.activate, SELECTORS.SAVE_BUTTON, function(e, data) {\n this.getForm().submit();\n data.originalEvent.preventDefault();\n }.bind(this));\n\n this.getModal().on('mpp:formsubmitted', function(e) {\n this.hide();\n this.updateConfiguredStatus();\n e.stopPropagation();\n }.bind(this));\n\n this.getModal().on(CustomEvents.events.activate, SELECTORS.CANCEL_BUTTON, function(e, data) {\n this.hide();\n data.originalEvent.preventDefault();\n e.stopPropagation();\n }.bind(this));\n };\n\n // Automatically register with the modal registry the first time this module is imported\n // so that you can create modals\n // of this type using the modal factory.\n if (!registered) {\n ModalRegistry.register(\n NotificationProcessorSettings.TYPE,\n NotificationProcessorSettings,\n 'core/modal_save_cancel');\n registered = true;\n }\n\n return NotificationProcessorSettings;\n});\n"],"file":"notification_processor_settings.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/notification_processor_settings.js"],"names":["define","$","Ajax","Str","Notification","CustomEvents","Modal","ModalRegistry","Fragment","registered","SELECTORS","SAVE_BUTTON","CANCEL_BUTTON","PROCESSOR","PREFERENCE_ROW","NotificationProcessorSettings","root","call","name","userId","contextId","element","saveButton","getFooter","find","cancelButton","TYPE","prototype","Object","create","constructor","setUserId","id","getUserId","setElement","getElement","setName","getName","setContextId","getContextId","getForm","getBody","disableButtons","prop","enableButtons","loadTitleContent","titlePromise","get_string","setTitle","loadBodyContent","args","userid","type","bodyPromise","loadFragment","setBody","then","bind","fail","exception","loadAllContent","when","show","hide","updateConfiguredStatus","processorHeader","closest","hasClass","processorName","attr","request","methodname","done","result","userconfigured","notifications","removeClass","registerEventListeners","getModal","on","events","activate","e","data","submit","originalEvent","preventDefault","stopPropagation","register"],"mappings":"AAsBAA,OAAM,gDAAC,CACC,QADD,CAEC,WAFD,CAGC,UAHD,CAIC,mBAJD,CAKC,gCALD,CAMC,YAND,CAOC,qBAPD,CAQC,eARD,CAAD,CAUE,SACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,CALJ,CAMIC,CANJ,CAOIC,CAPJ,CAQIC,CARJ,CASE,IAEFC,CAAAA,CAAU,GAFR,CAGFC,CAAS,CAAG,CACZC,WAAW,CAAE,wBADD,CAEZC,aAAa,CAAE,0BAFH,CAGZC,SAAS,CAAE,uBAHC,CAIZC,cAAc,CAAE,kCAJJ,CAHV,CAgBFC,CAA6B,CAAG,SAASC,CAAT,CAAe,CAC/CV,CAAK,CAACW,IAAN,CAAW,IAAX,CAAiBD,CAAjB,EACA,KAAKE,IAAL,CAAY,IAAZ,CACA,KAAKC,MAAL,CAAc,IAAd,CACA,KAAKC,SAAL,CAAiB,IAAjB,CACA,KAAKC,OAAL,CAAe,IAAf,CACA,KAAKC,UAAL,CAAkB,KAAKC,SAAL,GAAiBC,IAAjB,CAAsBd,CAAS,CAACC,WAAhC,CAAlB,CACA,KAAKc,YAAL,CAAoB,KAA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,CAA0B,UAA1B,CACH,CACJ,CAVE,CAWV,CA3BD,CAkCA7D,CAA6B,CAACY,SAA9B,CAAwCkD,sBAAxC,CAAiE,UAAW,CAExEvE,CAAK,CAACqB,SAAN,CAAgBkD,sBAAhB,CAAuC5D,IAAvC,CAA4C,IAA5C,EAGA,KAAK6D,QAAL,GAAgBC,EAAhB,CAAmB1E,CAAY,CAAC2E,MAAb,CAAoBC,QAAvC,CAAiDvE,CAAS,CAACC,WAA3D,CAAwE,SAASuE,CAAT,CAAYC,CAAZ,CAAkB,CACtF,KAAK3C,OAAL,GAAe4C,MAAf,GACAD,CAAI,CAACE,aAAL,CAAmBC,cAAnB,EACH,CAHuE,CAGtE7B,IAHsE,CAGjE,IAHiE,CAAxE,EAKA,KAAKqB,QAAL,GAAgBC,EAAhB,CAAmB,mBAAnB,CAAwC,SAASG,CAAT,CAAY,CAChD,KAAKnB,IAAL,GACA,KAAKC,sBAAL,GACAkB,CAAC,CAACK,eAAF,EACH,CAJuC,CAItC9B,IAJsC,CAIjC,IAJiC,CAAxC,EAMA,KAAKqB,QAAL,GAAgBC,EAAhB,CAAmB1E,CAAY,CAAC2E,MAAb,CAAoBC,QAAvC,CAAiDvE,CAAS,CAACE,aAA3D,CAA0E,SAASsE,CAAT,CAAYC,CAAZ,CAAkB,CACxF,KAAKpB,IAAL,GACAoB,CAAI,CAACE,aAAL,CAAmBC,cAAnB,GACAJ,CAAC,CAACK,eAAF,EACH,CAJyE,CAIxE9B,IAJwE,CAInE,IAJmE,CAA1E,CAKH,CArBD,CA0BA,GAAI,CAAChD,CAAL,CAAiB,CACbF,CAAa,CAACiF,QAAd,CACwBzE,CAA6B,CAACW,IADtD,CAEwBX,CAFxB,CAGwB,wBAHxB,EAIAN,CAAU,GACb,CAED,MAAOM,CAAAA,CACV,CAtTK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Load the settings for a message processor.\n *\n * @module core_message/notification_processor_settings\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n 'jquery',\n 'core/ajax',\n 'core/str',\n 'core/notification',\n 'core/custom_interaction_events',\n 'core/modal',\n 'core/modal_registry',\n 'core/fragment',\n ],\n function(\n $,\n Ajax,\n Str,\n Notification,\n CustomEvents,\n Modal,\n ModalRegistry,\n Fragment\n ) {\n\n var registered = false;\n var SELECTORS = {\n SAVE_BUTTON: '[data-action=\"save\"]',\n CANCEL_BUTTON: '[data-action=\"cancel\"]',\n PROCESSOR: '[data-processor-name]',\n PREFERENCE_ROW: '[data-region=\"preference-row\"]',\n };\n\n /**\n * Constructor for the Modal.\n *\n * @class\n * @param {object} root The root jQuery element for the modal.\n */\n var NotificationProcessorSettings = function(root) {\n Modal.call(this, root);\n this.name = null;\n this.userId = null;\n this.contextId = null;\n this.element = null;\n this.saveButton = this.getFooter().find(SELECTORS.SAVE_BUTTON);\n this.cancelButton = this.getFooter().find(SELECTORS.CANCEL_BUTTON);\n };\n\n NotificationProcessorSettings.TYPE = 'core_message-notification_processor_settings';\n NotificationProcessorSettings.prototype = Object.create(Modal.prototype);\n NotificationProcessorSettings.prototype.constructor = NotificationProcessorSettings;\n\n /**\n * Set the userid to the given value.\n *\n * @method setUserId\n * @param {int} id The notification userid\n */\n NotificationProcessorSettings.prototype.setUserId = function(id) {\n this.userId = id;\n };\n\n /**\n * Retrieve the current userid, if any.\n *\n * @method getUserId\n * @return {int|null} The notification userid\n */\n NotificationProcessorSettings.prototype.getUserId = function() {\n return this.userId;\n };\n\n /**\n * Set the object to the given value.\n *\n * @method setElement\n * @param {object} element The notification node element.\n */\n NotificationProcessorSettings.prototype.setElement = function(element) {\n this.element = element;\n };\n\n /**\n * Retrieve the current element, if any.\n *\n * @method getElement\n * @return {object|null} The notification node element.\n */\n NotificationProcessorSettings.prototype.getElement = function() {\n return this.element;\n };\n\n /**\n * Set the name to the given value.\n *\n * @method setName\n * @param {string} name The notification name.\n */\n NotificationProcessorSettings.prototype.setName = function(name) {\n this.name = name;\n };\n\n /**\n * Retrieve the current name, if any.\n *\n * @method getName\n * @return {string|null} The notification name.\n */\n NotificationProcessorSettings.prototype.getName = function() {\n return this.name;\n };\n /**\n * Set the context id to the given value.\n *\n * @method setContextId\n * @param {Number} id The notification context id\n */\n NotificationProcessorSettings.prototype.setContextId = function(id) {\n this.contextId = id;\n };\n\n /**\n * Retrieve the current context id, if any.\n *\n * @method getContextId\n * @return {Number|null} The notification context id\n */\n NotificationProcessorSettings.prototype.getContextId = function() {\n return this.contextId;\n };\n\n /**\n * Get the form element from the modal.\n *\n * @method getForm\n * @return {object}\n */\n NotificationProcessorSettings.prototype.getForm = function() {\n return this.getBody().find('form');\n };\n\n /**\n * Disable the buttons in the footer.\n *\n * @method disableButtons\n */\n NotificationProcessorSettings.prototype.disableButtons = function() {\n this.saveButton.prop('disabled', true);\n this.cancelButton.prop('disabled', true);\n };\n\n /**\n * Enable the buttons in the footer.\n *\n * @method enableButtons\n */\n NotificationProcessorSettings.prototype.enableButtons = function() {\n this.saveButton.prop('disabled', false);\n this.cancelButton.prop('disabled', false);\n };\n\n /**\n * Load the title for the modal to the appropriate value\n * depending on message outputs.\n *\n * @method loadTitleContent\n * @return {object} A promise resolved with the new title text.\n */\n NotificationProcessorSettings.prototype.loadTitleContent = function() {\n this.titlePromise = Str.get_string('processorsettings', 'message');\n this.setTitle(this.titlePromise);\n\n return this.titlePromise;\n };\n\n /**\n * Load the body for the modal to the appropriate value\n * depending on message outputs.\n *\n * @method loadBodyContent\n * @return {object} A promise resolved with the fragment html and js from\n */\n NotificationProcessorSettings.prototype.loadBodyContent = function() {\n this.disableButtons();\n\n var args = {\n userid: this.getUserId(),\n type: this.getName(),\n };\n\n this.bodyPromise = Fragment.loadFragment('message', 'processor_settings', this.getContextId(), args);\n this.setBody(this.bodyPromise);\n\n this.bodyPromise.then(function() {\n this.enableButtons();\n return;\n }.bind(this))\n .fail(Notification.exception);\n\n return this.bodyPromise;\n };\n\n /**\n * Load both the title and body content.\n *\n * @method loadAllContent\n * @return {object} promise\n */\n NotificationProcessorSettings.prototype.loadAllContent = function() {\n return $.when(this.loadTitleContent(), this.loadBodyContent());\n };\n\n /**\n * Load the modal content before showing it. This\n * is to allow us to re-use the same modal for creating and\n * editing different message outputs within the page.\n *\n * @method show\n */\n NotificationProcessorSettings.prototype.show = function() {\n this.loadAllContent();\n Modal.prototype.show.call(this);\n };\n\n /**\n * Clear the notification from the modal when it's closed so\n * that it is loaded fresh next time it's displayed.\n *\n * @method hide\n */\n NotificationProcessorSettings.prototype.hide = function() {\n Modal.prototype.hide.call(this);\n this.setContextId(null);\n this.setName(null);\n this.setUserId(null);\n };\n\n /**\n * Checks if the processor has been configured. If so then remove the unconfigured\n * status from the interface.\n *\n * @method updateConfiguredStatus\n * @return {Promise|boolean}\n */\n NotificationProcessorSettings.prototype.updateConfiguredStatus = function() {\n var processorHeader = $(this.getElement()).closest(SELECTORS.PROCESSOR);\n\n if (!processorHeader.hasClass('unconfigured')) {\n return false;\n }\n\n var processorName = processorHeader.attr('data-processor-name');\n var request = {\n methodname: 'core_message_get_message_processor',\n args: {\n name: processorName,\n userid: this.userId,\n },\n };\n\n return Ajax.call([request])[0]\n .fail(Notification.exception)\n .done(function(result) {\n // Check if the user has figured configuring the processor.\n if (result.userconfigured) {\n // If they have then we can enable the settings.\n var notifications = $(SELECTORS.PREFERENCE_ROW + ' [data-processor-name=\"' + processorName + '\"]');\n processorHeader.removeClass('unconfigured');\n notifications.removeClass('disabled');\n }\n });\n };\n\n /**\n * Set up all of the event handling for the modal.\n *\n * @method registerEventListeners\n */\n NotificationProcessorSettings.prototype.registerEventListeners = function() {\n // Apply parent event listeners.\n Modal.prototype.registerEventListeners.call(this);\n\n // When the user clicks the save button we trigger the form submission.\n this.getModal().on(CustomEvents.events.activate, SELECTORS.SAVE_BUTTON, function(e, data) {\n this.getForm().submit();\n data.originalEvent.preventDefault();\n }.bind(this));\n\n this.getModal().on('mpp:formsubmitted', function(e) {\n this.hide();\n this.updateConfiguredStatus();\n e.stopPropagation();\n }.bind(this));\n\n this.getModal().on(CustomEvents.events.activate, SELECTORS.CANCEL_BUTTON, function(e, data) {\n this.hide();\n data.originalEvent.preventDefault();\n e.stopPropagation();\n }.bind(this));\n };\n\n // Automatically register with the modal registry the first time this module is imported\n // so that you can create modals\n // of this type using the modal factory.\n if (!registered) {\n ModalRegistry.register(\n NotificationProcessorSettings.TYPE,\n NotificationProcessorSettings,\n 'core/modal_save_cancel');\n registered = true;\n }\n\n return NotificationProcessorSettings;\n});\n"],"file":"notification_processor_settings.min.js"} \ No newline at end of file diff --git a/message/amd/build/preferences_notifications_list_controller.min.js.map b/message/amd/build/preferences_notifications_list_controller.min.js.map index 82d050e1afde6..700274e16e6d7 100644 --- a/message/amd/build/preferences_notifications_list_controller.min.js.map +++ b/message/amd/build/preferences_notifications_list_controller.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/preferences_notifications_list_controller.js"],"names":["define","$","Ajax","Notification","CustomEvents","NotificationPreference","NotificationProcessorSettings","ModalFactory","SELECTORS","DISABLE_NOTIFICATIONS","DISABLE_NOTIFICATIONS_CONTAINER","PREFERENCE","PREFERENCE_ROW","PREFERENCE_INPUT","PROCESSOR_SETTING","PreferencesController","element","root","userId","attr","registerEventListeners","prototype","isDisabled","hasClass","setDisabled","addClass","find","prop","setEnabled","removeClass","toggleDisableAllStatus","checkbox","container","ischecked","Deferred","resolve","request","methodname","args","userid","emailstop","call","done","bind","always","fail","exception","disabledNotificationsElement","events","activate","on","e","preferenceElement","target","closest","preferenceRow","preference","save","eventFormPromise","create","type","TYPE","preventDefault","then","modal","setUserId","setName","setContextId","setElement","show","stopImmediatePropagation"],"mappings":"AAwBAA,OAAM,0DAAC,CAAC,QAAD,CACC,WADD,CAEC,mBAFD,CAGC,gCAHD,CAIC,sCAJD,CAKC,8CALD,CAMC,oBAND,CAAD,CAQE,SACEC,CADF,CAEEC,CAFF,CAGEC,CAHF,CAIEC,CAJF,CAKEC,CALF,CAMEC,CANF,CAOEC,CAPF,CAQE,IAEFC,CAAAA,CAAS,CAAG,CACZC,qBAAqB,CAAE,+EADX,CAEZC,+BAA+B,CAAE,kDAFrB,CAGZC,UAAU,CAAE,cAHA,CAIZC,cAAc,CAAE,kCAJJ,CAKZC,gBAAgB,CAAE,oBALN,CAMZC,iBAAiB,CAAE,0BANP,CAFV,CAgBFC,CAAqB,CAAG,SAASC,CAAT,CAAkB,CAC1C,KAAKC,IAAL,CAAYhB,CAAC,CAACe,CAAD,CAAb,CACA,KAAKE,MAAL,CAAc,KAAKD,IAAL,CAAUE,IAAV,CAAe,cAAf,CAAd,CAEA,KAAKC,sBAAL,EACH,CArBK,CA6BNL,CAAqB,CAACM,SAAtB,CAAgCC,UAAhC,CAA6C,UAAW,CACpD,MAAO,MAAKL,IAAL,CAAUM,QAAV,CAAmB,UAAnB,CACV,CAFD,CASAR,CAAqB,CAACM,SAAtB,CAAgCG,WAAhC,CAA8C,UAAW,CACrD,KAAKP,IAAL,CAAUQ,QAAV,CAAmB,UAAnB,EACA,KAAKR,IAAL,CAAUS,IAAV,CAAelB,CAAS,CAACK,gBAAzB,EAA2Cc,IAA3C,CAAgD,UAAhD,IACH,CAHD,CAUAZ,CAAqB,CAACM,SAAtB,CAAgCO,UAAhC,CAA6C,UAAW,CACpD,KAAKX,IAAL,CAAUY,WAAV,CAAsB,UAAtB,EACA,KAAKZ,IAAL,CAAUS,IAAV,CAAelB,CAAS,CAACK,gBAAzB,EAA2Cc,IAA3C,CAAgD,UAAhD,IAC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,WAAhB,CAAd,EACA6C,CAAK,CAACG,YAAN,CAAmBlE,CAAC,CAACe,CAAD,CAAD,CAAWG,IAAX,CAAgB,iBAAhB,CAAnB,EACA6C,CAAK,CAACI,UAAN,CAAiBpD,CAAjB,EACAgD,CAAK,CAACK,IAAN,GAEAlB,CAAC,CAACmB,wBAAF,EAEH,CAVD,EAUGzB,IAVH,CAUQ1C,CAAY,CAAC2C,SAVrB,CAWH,CAfD,EAiBA1C,CAAY,CAACJ,MAAb,CAAoB+C,CAApB,CAAkD,CAC9C3C,CAAY,CAAC4C,MAAb,CAAoBC,QAD0B,CAAlD,EAIAF,CAA4B,CAACG,EAA7B,CAAgC9C,CAAY,CAAC4C,MAAb,CAAoBC,QAApD,CAA8D,UAAW,CACrE,KAAKnB,sBAAL,EACH,CAF6D,CAE5Da,IAF4D,CAEvD,IAFuD,CAA9D,CAGH,CAhDD,CAkDA,MAAO5B,CAAAA,CACV,CArKK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the preferences for the list of notification types on the\n * message preference page\n *\n * @module core_message/preferences_notifications_list_controller\n * @class preferences_notifications_list_controller\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery',\n 'core/ajax',\n 'core/notification',\n 'core/custom_interaction_events',\n 'core_message/notification_preference',\n 'core_message/notification_processor_settings',\n 'core/modal_factory',\n ],\n function(\n $,\n Ajax,\n Notification,\n CustomEvents,\n NotificationPreference,\n NotificationProcessorSettings,\n ModalFactory\n ) {\n\n var SELECTORS = {\n DISABLE_NOTIFICATIONS: '[data-region=\"disable-notification-container\"] [data-disable-notifications]',\n DISABLE_NOTIFICATIONS_CONTAINER: '[data-region=\"disable-notification-container\"]',\n PREFERENCE: '[data-state]',\n PREFERENCE_ROW: '[data-region=\"preference-row\"]',\n PREFERENCE_INPUT: '[data-state] input',\n PROCESSOR_SETTING: '[data-processor-setting]',\n };\n\n /**\n * Constructor for the PreferencesController.\n *\n * @param {object} element jQuery object root element of the preference\n */\n var PreferencesController = function(element) {\n this.root = $(element);\n this.userId = this.root.attr('data-user-id');\n\n this.registerEventListeners();\n };\n\n /**\n * Check if the preferences are all disabled.\n *\n * @method isDisabled\n * @return {bool}\n */\n PreferencesController.prototype.isDisabled = function() {\n return this.root.hasClass('disabled');\n };\n\n /**\n * Disable all of the preferences.\n *\n * @method setDisabled\n */\n PreferencesController.prototype.setDisabled = function() {\n this.root.addClass('disabled');\n this.root.find(SELECTORS.PREFERENCE_INPUT).prop('disabled', true);\n };\n\n /**\n * Enable all of the preferences.\n *\n * @method setEnabled\n */\n PreferencesController.prototype.setEnabled = function() {\n this.root.removeClass('disabled');\n this.root.find(SELECTORS.PREFERENCE_INPUT).prop('disabled', false);\n };\n\n /**\n * Update the disable all notifications user property in the DOM and\n * send a request to update on the server.\n *\n * @method toggleDisableAllStatus\n * @return {Promise}\n */\n PreferencesController.prototype.toggleDisableAllStatus = function() {\n var checkbox = $(SELECTORS.DISABLE_NOTIFICATIONS);\n var container = $(SELECTORS.DISABLE_NOTIFICATIONS_CONTAINER);\n var ischecked = checkbox.prop('checked');\n\n if (container.hasClass('loading')) {\n return $.Deferred().resolve();\n }\n\n container.addClass('loading');\n\n var request = {\n methodname: 'core_user_update_user_preferences',\n args: {\n userid: this.userId,\n emailstop: ischecked ? 1 : 0,\n }\n };\n\n return Ajax.call([request])[0]\n .done(function() {\n if (ischecked) {\n this.setDisabled();\n } else {\n this.setEnabled();\n }\n }.bind(this))\n .always(function() {\n container.removeClass('loading');\n })\n .fail(Notification.exception);\n };\n\n /**\n * Set up all of the event listeners for the PreferencesController.\n *\n * @method registerEventListeners\n */\n PreferencesController.prototype.registerEventListeners = function() {\n var disabledNotificationsElement = $(SELECTORS.DISABLE_NOTIFICATIONS);\n\n CustomEvents.define(this.root, [\n CustomEvents.events.activate,\n ]);\n\n this.root.on('change', function(e) {\n if (!this.isDisabled()) {\n var preferenceElement = $(e.target).closest(SELECTORS.PREFERENCE);\n var preferenceRow = $(e.target).closest(SELECTORS.PREFERENCE_ROW);\n var preference = new NotificationPreference(preferenceRow, this.userId);\n\n preferenceElement.addClass('loading');\n preference.save().always(function() {\n preferenceElement.removeClass('loading');\n });\n }\n }.bind(this));\n\n var eventFormPromise = ModalFactory.create({\n type: NotificationProcessorSettings.TYPE,\n });\n\n this.root.on(CustomEvents.events.activate, SELECTORS.PROCESSOR_SETTING, function(e) {\n var element = $(e.target).closest(SELECTORS.PROCESSOR_SETTING);\n\n e.preventDefault();\n eventFormPromise.then(function(modal) {\n // Configure modal with element settings.\n modal.setUserId($(element).attr('data-user-id'));\n modal.setName($(element).attr('data-name'));\n modal.setContextId($(element).attr('data-context-id'));\n modal.setElement(element);\n modal.show();\n\n e.stopImmediatePropagation();\n return;\n }).fail(Notification.exception);\n });\n\n CustomEvents.define(disabledNotificationsElement, [\n CustomEvents.events.activate\n ]);\n\n disabledNotificationsElement.on(CustomEvents.events.activate, function() {\n this.toggleDisableAllStatus();\n }.bind(this));\n };\n\n return PreferencesController;\n});\n"],"file":"preferences_notifications_list_controller.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/preferences_notifications_list_controller.js"],"names":["define","$","Ajax","Notification","CustomEvents","NotificationPreference","NotificationProcessorSettings","ModalFactory","SELECTORS","DISABLE_NOTIFICATIONS","DISABLE_NOTIFICATIONS_CONTAINER","PREFERENCE","PREFERENCE_ROW","PREFERENCE_INPUT","PROCESSOR_SETTING","PreferencesController","element","root","userId","attr","registerEventListeners","prototype","isDisabled","hasClass","setDisabled","addClass","find","prop","setEnabled","removeClass","toggleDisableAllStatus","checkbox","container","ischecked","Deferred","resolve","request","methodname","args","userid","emailstop","call","done","bind","always","fail","exception","disabledNotificationsElement","events","activate","on","e","preferenceElement","target","closest","preferenceRow","preference","save","eventFormPromise","create","type","TYPE","preventDefault","then","modal","setUserId","setName","setContextId","setElement","show","stopImmediatePropagation"],"mappings":"AAuBAA,OAAM,0DAAC,CAAC,QAAD,CACC,WADD,CAEC,mBAFD,CAGC,gCAHD,CAIC,sCAJD,CAKC,8CALD,CAMC,oBAND,CAAD,CAQE,SACEC,CADF,CAEEC,CAFF,CAGEC,CAHF,CAIEC,CAJF,CAKEC,CALF,CAMEC,CANF,CAOEC,CAPF,CAQE,IAEFC,CAAAA,CAAS,CAAG,CACZC,qBAAqB,CAAE,+EADX,CAEZC,+BAA+B,CAAE,kDAFrB,CAGZC,UAAU,CAAE,cAHA,CAIZC,cAAc,CAAE,kCAJJ,CAKZC,gBAAgB,CAAE,oBALN,CAMZC,iBAAiB,CAAE,0BANP,CAFV,CAiBFC,CAAqB,CAAG,SAASC,CAAT,CAAkB,CAC1C,KAAKC,IAAL,CAAYhB,CAAC,CAACe,CAAD,CAAb,CACA,KAAKE,MAAL,CAAc,KAAKD,IAAL,CAAUE,IAAV,CAAe,cAAf,CAAd,CAEA,KAAKC,sBAAL,EACH,CAtBK,CA8BNL,CAAqB,CAACM,SAAtB,CAAgCC,UAAhC,CAA6C,UAAW,CACpD,MAAO,MAAKL,IAAL,CAAUM,QAAV,CAAmB,UAAnB,CACV,CAFD,CASAR,CAAqB,CAACM,SAAtB,CAAgCG,WAAhC,CAA8C,UAAW,CACrD,KAAKP,IAAL,CAAUQ,QAAV,CAAmB,UAAnB,EACA,KAAKR,IAAL,CAAUS,IAAV,CAAelB,CAAS,CAACK,gBAAzB,EAA2Cc,IAA3C,CAAgD,UAAhD,IACH,CAHD,CAUAZ,CAAqB,CAACM,SAAtB,CAAgCO,UAAhC,CAA6C,UAAW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gBhE,CAAC,CAACe,CAAD,CAAD,CAAWG,IAAX,CAAgB,cAAhB,CAAhB,EACA6C,CAAK,CAACE,OAAN,CAAcjE,CAAC,CAACe,CAAD,CAAD,CAAWG,IAAX,CAAgB,WAAhB,CAAd,EACA6C,CAAK,CAACG,YAAN,CAAmBlE,CAAC,CAACe,CAAD,CAAD,CAAWG,IAAX,CAAgB,iBAAhB,CAAnB,EACA6C,CAAK,CAACI,UAAN,CAAiBpD,CAAjB,EACAgD,CAAK,CAACK,IAAN,GAEAlB,CAAC,CAACmB,wBAAF,EAEH,CAVD,EAUGzB,IAVH,CAUQ1C,CAAY,CAAC2C,SAVrB,CAWH,CAfD,EAiBA1C,CAAY,CAACJ,MAAb,CAAoB+C,CAApB,CAAkD,CAC9C3C,CAAY,CAAC4C,MAAb,CAAoBC,QAD0B,CAAlD,EAIAF,CAA4B,CAACG,EAA7B,CAAgC9C,CAAY,CAAC4C,MAAb,CAAoBC,QAApD,CAA8D,UAAW,CACrE,KAAKnB,sBAAL,EACH,CAF6D,CAE5Da,IAF4D,CAEvD,IAFuD,CAA9D,CAGH,CAhDD,CAkDA,MAAO5B,CAAAA,CACV,CAtKK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the preferences for the list of notification types on the\n * message preference page\n *\n * @module core_message/preferences_notifications_list_controller\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery',\n 'core/ajax',\n 'core/notification',\n 'core/custom_interaction_events',\n 'core_message/notification_preference',\n 'core_message/notification_processor_settings',\n 'core/modal_factory',\n ],\n function(\n $,\n Ajax,\n Notification,\n CustomEvents,\n NotificationPreference,\n NotificationProcessorSettings,\n ModalFactory\n ) {\n\n var SELECTORS = {\n DISABLE_NOTIFICATIONS: '[data-region=\"disable-notification-container\"] [data-disable-notifications]',\n DISABLE_NOTIFICATIONS_CONTAINER: '[data-region=\"disable-notification-container\"]',\n PREFERENCE: '[data-state]',\n PREFERENCE_ROW: '[data-region=\"preference-row\"]',\n PREFERENCE_INPUT: '[data-state] input',\n PROCESSOR_SETTING: '[data-processor-setting]',\n };\n\n /**\n * Constructor for the PreferencesController.\n *\n * @class\n * @param {object} element jQuery object root element of the preference\n */\n var PreferencesController = function(element) {\n this.root = $(element);\n this.userId = this.root.attr('data-user-id');\n\n this.registerEventListeners();\n };\n\n /**\n * Check if the preferences are all disabled.\n *\n * @method isDisabled\n * @return {bool}\n */\n PreferencesController.prototype.isDisabled = function() {\n return this.root.hasClass('disabled');\n };\n\n /**\n * Disable all of the preferences.\n *\n * @method setDisabled\n */\n PreferencesController.prototype.setDisabled = function() {\n this.root.addClass('disabled');\n this.root.find(SELECTORS.PREFERENCE_INPUT).prop('disabled', true);\n };\n\n /**\n * Enable all of the preferences.\n *\n * @method setEnabled\n */\n PreferencesController.prototype.setEnabled = function() {\n this.root.removeClass('disabled');\n this.root.find(SELECTORS.PREFERENCE_INPUT).prop('disabled', false);\n };\n\n /**\n * Update the disable all notifications user property in the DOM and\n * send a request to update on the server.\n *\n * @method toggleDisableAllStatus\n * @return {Promise}\n */\n PreferencesController.prototype.toggleDisableAllStatus = function() {\n var checkbox = $(SELECTORS.DISABLE_NOTIFICATIONS);\n var container = $(SELECTORS.DISABLE_NOTIFICATIONS_CONTAINER);\n var ischecked = checkbox.prop('checked');\n\n if (container.hasClass('loading')) {\n return $.Deferred().resolve();\n }\n\n container.addClass('loading');\n\n var request = {\n methodname: 'core_user_update_user_preferences',\n args: {\n userid: this.userId,\n emailstop: ischecked ? 1 : 0,\n }\n };\n\n return Ajax.call([request])[0]\n .done(function() {\n if (ischecked) {\n this.setDisabled();\n } else {\n this.setEnabled();\n }\n }.bind(this))\n .always(function() {\n container.removeClass('loading');\n })\n .fail(Notification.exception);\n };\n\n /**\n * Set up all of the event listeners for the PreferencesController.\n *\n * @method registerEventListeners\n */\n PreferencesController.prototype.registerEventListeners = function() {\n var disabledNotificationsElement = $(SELECTORS.DISABLE_NOTIFICATIONS);\n\n CustomEvents.define(this.root, [\n CustomEvents.events.activate,\n ]);\n\n this.root.on('change', function(e) {\n if (!this.isDisabled()) {\n var preferenceElement = $(e.target).closest(SELECTORS.PREFERENCE);\n var preferenceRow = $(e.target).closest(SELECTORS.PREFERENCE_ROW);\n var preference = new NotificationPreference(preferenceRow, this.userId);\n\n preferenceElement.addClass('loading');\n preference.save().always(function() {\n preferenceElement.removeClass('loading');\n });\n }\n }.bind(this));\n\n var eventFormPromise = ModalFactory.create({\n type: NotificationProcessorSettings.TYPE,\n });\n\n this.root.on(CustomEvents.events.activate, SELECTORS.PROCESSOR_SETTING, function(e) {\n var element = $(e.target).closest(SELECTORS.PROCESSOR_SETTING);\n\n e.preventDefault();\n eventFormPromise.then(function(modal) {\n // Configure modal with element settings.\n modal.setUserId($(element).attr('data-user-id'));\n modal.setName($(element).attr('data-name'));\n modal.setContextId($(element).attr('data-context-id'));\n modal.setElement(element);\n modal.show();\n\n e.stopImmediatePropagation();\n return;\n }).fail(Notification.exception);\n });\n\n CustomEvents.define(disabledNotificationsElement, [\n CustomEvents.events.activate\n ]);\n\n disabledNotificationsElement.on(CustomEvents.events.activate, function() {\n this.toggleDisableAllStatus();\n }.bind(this));\n };\n\n return PreferencesController;\n});\n"],"file":"preferences_notifications_list_controller.min.js"} \ No newline at end of file diff --git a/message/amd/build/preferences_processor_form.min.js.map b/message/amd/build/preferences_processor_form.min.js.map index 4cd0653d9592c..48b5d9a387dae 100644 --- a/message/amd/build/preferences_processor_form.min.js.map +++ b/message/amd/build/preferences_processor_form.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/preferences_processor_form.js"],"names":["define","$","Ajax","Notification","ProcessorForm","element","root","userId","attr","name","find","on","e","preventDefault","save","done","trigger","bind","prototype","startLoading","addClass","stopLoading","removeClass","isLoading","hasClass","Deferred","data","serializeArray","request","methodname","args","userid","formvalues","call","fail","exception","always"],"mappings":"AAuBAA,OAAM,2CAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAAD,CACE,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgC,CAMpC,GAAIC,CAAAA,CAAa,CAAG,SAASC,CAAT,CAAkB,CAClC,KAAKC,IAAL,CAAYL,CAAC,CAACI,CAAD,CAAb,CACA,KAAKE,MAAL,CAAc,KAAKD,IAAL,CAAUE,IAAV,CAAe,cAAf,CAAd,CACA,KAAKC,IAAL,CAAY,KAAKH,IAAL,CAAUE,IAAV,CAAe,qBAAf,CAAZ,CAEA,KAAKF,IAAL,CAAUI,IAAV,CAAe,MAAf,EAAuBC,EAAvB,CAA0B,QAA1B,CAAoC,SAASC,CAAT,CAAY,CAC5CA,CAAC,CAACC,cAAF,GACA,KAAKC,IAAL,GAAYC,IAAZ,CAAiB,UAAW,CACxBd,CAAC,CAACI,CAAD,CAAD,CAAWW,OAAX,CAAmB,mBAAnB,CACH,CAFD,CAGH,CALmC,CAKlCC,IALkC,CAK7B,IAL6B,CAApC,CAMH,CAXD,CAkBAb,CAAa,CAACc,SAAd,CAAwBC,YAAxB,CAAuC,UAAW,CAC9C,KAAKb,IAAL,CAAUc,QAAV,CAAmB,SAAnB,CACH,CAFD,CASAhB,CAAa,CAACc,SAAd,CAAwBG,WAAxB,CAAsC,UAAW,CAC7C,KAAKf,IAAL,CAAUgB,WAAV,CAAsB,SAAtB,CACH,CAFD,CAUAlB,CAAa,CAACc,SAAd,CAAwBK,SAAxB,CAAoC,UAAW,CAC3C,MAAO,MAAKjB,IAAL,CAAUkB,QAAV,CAAmB,SAAnB,CACV,CAFD,CAUApB,CAAa,CAACc,SAAd,CAAwBJ,IAAxB,CAA+B,UAAW,CACtC,GAAI,KAAKS,SAAL,EAAJ,CAAsB,CAClB,MAAOtB,CAAAA,CAAC,CAACwB,QAAF,EACV,CAED,KAAKN,YAAL,GALsC,GAOlCO,CAAAA,CAAI,CAAG,KAAKpB,IAAL,CAAUI,IAAV,CAAe,MAAf,EAAuBiB,cAAvB,EAP2B,CAQlCC,CAAO,CAAG,CACVC,UAAU,CAAE,4CADF,CAEVC,IAAI,CAAE,CACFC,MAAM,CAAE,KAAKxB,MADX,CAEFE,IAAI,CAAE,KAAKA,IAFT,CAGFuB,UAAU,CAAEN,CAHV,CAFI,CARwB,CAiBtC,MAAOxB,CAAAA,CAAI,CAAC+B,IAAL,CAAU,CAACL,CAAD,CAAV,EAAqB,CAArB,EACFM,IADE,CACG/B,CAAY,CAACgC,SADhB,EAEFC,MAFE,CAEK,UAAW,CACf,KAAKf,WAAL,EACH,CAFO,CAENJ,IAFM,CAED,IAFC,CAFL,CAKV,CAtBD,CAwBA,MAAOb,CAAAA,CACV,CA/EK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Manages the processor form on the message preferences page.\n *\n * @module core_message/preferences_processor_form\n * @class preferences_processor_form\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax', 'core/notification'],\n function($, Ajax, Notification) {\n /**\n * Constructor for the ProcessorForm.\n *\n * @param {object} element jQuery object root element of the preference\n */\n var ProcessorForm = function(element) {\n this.root = $(element);\n this.userId = this.root.attr('data-user-id');\n this.name = this.root.attr('data-processor-name');\n\n this.root.find('form').on('submit', function(e) {\n e.preventDefault();\n this.save().done(function() {\n $(element).trigger('mpp:formsubmitted');\n });\n }.bind(this));\n };\n\n /**\n * Flag the processor as loading.\n *\n * @method startLoading\n */\n ProcessorForm.prototype.startLoading = function() {\n this.root.addClass('loading');\n };\n\n /**\n * Remove the loading flag for this processor.\n *\n * @method stopLoading\n */\n ProcessorForm.prototype.stopLoading = function() {\n this.root.removeClass('loading');\n };\n\n /**\n * Check if this processor is loading.\n *\n * @method isLoading\n * @return {bool}\n */\n ProcessorForm.prototype.isLoading = function() {\n return this.root.hasClass('loading');\n };\n\n /**\n * Persist the processor configuration.\n *\n * @method save\n * @return {object} jQuery promise\n */\n ProcessorForm.prototype.save = function() {\n if (this.isLoading()) {\n return $.Deferred();\n }\n\n this.startLoading();\n\n var data = this.root.find('form').serializeArray();\n var request = {\n methodname: 'core_message_message_processor_config_form',\n args: {\n userid: this.userId,\n name: this.name,\n formvalues: data,\n }\n };\n\n return Ajax.call([request])[0]\n .fail(Notification.exception)\n .always(function() {\n this.stopLoading();\n }.bind(this));\n };\n\n return ProcessorForm;\n});\n"],"file":"preferences_processor_form.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/preferences_processor_form.js"],"names":["define","$","Ajax","Notification","ProcessorForm","element","root","userId","attr","name","find","on","e","preventDefault","save","done","trigger","bind","prototype","startLoading","addClass","stopLoading","removeClass","isLoading","hasClass","Deferred","data","serializeArray","request","methodname","args","userid","formvalues","call","fail","exception","always"],"mappings":"AAsBAA,OAAM,2CAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAAD,CACE,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgC,CAOpC,GAAIC,CAAAA,CAAa,CAAG,SAASC,CAAT,CAAkB,CAClC,KAAKC,IAAL,CAAY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AFI,CARwB,CAiBtC,MAAOxB,CAAAA,CAAI,CAAC+B,IAAL,CAAU,CAACL,CAAD,CAAV,EAAqB,CAArB,EACFM,IADE,CACG/B,CAAY,CAACgC,SADhB,EAEFC,MAFE,CAEK,UAAW,CACf,KAAKf,WAAL,EACH,CAFO,CAENJ,IAFM,CAED,IAFC,CAFL,CAKV,CAtBD,CAwBA,MAAOb,CAAAA,CACV,CAhFK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Manages the processor form on the message preferences page.\n *\n * @module core_message/preferences_processor_form\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax', 'core/notification'],\n function($, Ajax, Notification) {\n /**\n * Constructor for the ProcessorForm.\n *\n * @class\n * @param {object} element jQuery object root element of the preference\n */\n var ProcessorForm = function(element) {\n this.root = $(element);\n this.userId = this.root.attr('data-user-id');\n this.name = this.root.attr('data-processor-name');\n\n this.root.find('form').on('submit', function(e) {\n e.preventDefault();\n this.save().done(function() {\n $(element).trigger('mpp:formsubmitted');\n });\n }.bind(this));\n };\n\n /**\n * Flag the processor as loading.\n *\n * @method startLoading\n */\n ProcessorForm.prototype.startLoading = function() {\n this.root.addClass('loading');\n };\n\n /**\n * Remove the loading flag for this processor.\n *\n * @method stopLoading\n */\n ProcessorForm.prototype.stopLoading = function() {\n this.root.removeClass('loading');\n };\n\n /**\n * Check if this processor is loading.\n *\n * @method isLoading\n * @return {bool}\n */\n ProcessorForm.prototype.isLoading = function() {\n return this.root.hasClass('loading');\n };\n\n /**\n * Persist the processor configuration.\n *\n * @method save\n * @return {object} jQuery promise\n */\n ProcessorForm.prototype.save = function() {\n if (this.isLoading()) {\n return $.Deferred();\n }\n\n this.startLoading();\n\n var data = this.root.find('form').serializeArray();\n var request = {\n methodname: 'core_message_message_processor_config_form',\n args: {\n userid: this.userId,\n name: this.name,\n formvalues: data,\n }\n };\n\n return Ajax.call([request])[0]\n .fail(Notification.exception)\n .always(function() {\n this.stopLoading();\n }.bind(this));\n };\n\n return ProcessorForm;\n});\n"],"file":"preferences_processor_form.min.js"} \ No newline at end of file diff --git a/message/amd/build/toggle_contact_button.min.js.map b/message/amd/build/toggle_contact_button.min.js.map index 7c22e88a194d7..6fdea0e95f268 100644 --- a/message/amd/build/toggle_contact_button.min.js.map +++ b/message/amd/build/toggle_contact_button.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/toggle_contact_button.js"],"names":["define","$","Ajax","Templates","Notification","CustomEvents","isContact","element","attr","setContact","setNotContact","getUserId","getCurrentUserId","isLoading","hasClass","sendRequest","request","Deferred","addClass","call","fail","exception","always","removeClass","removeAttr","addContact","methodname","args","userid","requesteduserid","done","render","html","js","replaceNodeContents","removeContact","userids","enhance","children","length","append","events","activate","on","e","data","preventDefault","originalEvent"],"mappings":"AAuBAA,OAAM,sCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAA0C,mBAA1C,CAA+D,gCAA/D,CAAD,CACE,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6BC,CAA7B,CAA2CC,CAA3C,CAAyD,IASzDC,CAAAA,CAAS,CAAG,SAASC,CAAT,CAAkB,CAC9B,MAA0C,GAAnC,EAAAA,CAAO,CAACC,IAAR,CAAa,iBAAb,CACV,CAX4D,CAmBzDC,CAAU,CAAG,SAASF,CAAT,CAAkB,CAC/BA,CAAO,CAACC,IAAR,CAAa,iBAAb,CAAgC,GAAhC,CACH,CArB4D,CA6BzD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iC,MAAR,CAAeR,CAAf,CAAqBC,CAArB,CACH,CAFD,CAGH,CAED5B,CAAY,CAACL,MAAb,CAAoBO,CAApB,CAA6B,CAACF,CAAY,CAACoC,MAAb,CAAoBC,QAArB,CAA7B,EAEAnC,CAAO,CAACoC,EAAR,CAAWtC,CAAY,CAACoC,MAAb,CAAoBC,QAA/B,CAAyC,SAASE,CAAT,CAAYC,CAAZ,CAAkB,CACvD,GAAIvC,CAAS,CAACC,CAAD,CAAb,CAAwB,CACpB4B,CAAa,CAAC5B,CAAD,CAChB,CAFD,IAEO,CACHkB,CAAU,CAAClB,CAAD,CACb,CACDqC,CAAC,CAACE,cAAF,GACAD,CAAI,CAACE,aAAL,CAAmBD,cAAnB,EACH,CARD,CASH,CAEyD,CAG7D,CArLK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to add/remove contact using ajax.\n *\n * @module core_message/toggle_contact_button\n * @class toggle_contact_button\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/custom_interaction_events'],\n function($, Ajax, Templates, Notification, CustomEvents) {\n\n /**\n * Check the state of the element, if the current user is a contact or not.\n *\n * @method isContact\n * @param {object} element jQuery object for the button\n * @return {bool}\n */\n var isContact = function(element) {\n return element.attr('data-is-contact') == '1';\n };\n\n /**\n * Record that the user is a contact.\n *\n * @method setContact\n * @param {object} element jQuery object for the button\n */\n var setContact = function(element) {\n element.attr('data-is-contact', '1');\n };\n\n /**\n * Record that the user is not a contact.\n *\n * @method setNotContact\n * @param {object} element jQuery object for the button\n */\n var setNotContact = function(element) {\n element.attr('data-is-contact', '0');\n };\n\n /**\n * Get the id for the user being viewed.\n *\n * @method getUserId\n * @param {object} element jQuery object for the button\n * @return {int}\n */\n var getUserId = function(element) {\n return element.attr('data-userid');\n };\n\n /**\n * Get the id for the logged in user.\n *\n * @method getUserId\n * @param {object} element jQuery object for the button\n * @return {int}\n */\n var getCurrentUserId = function(element) {\n return element.attr('data-currentuserid');\n };\n\n /**\n * Check if this element is currently loading.\n *\n * @method isLoading\n * @param {object} element jQuery object for the button\n * @return {bool}\n */\n var isLoading = function(element) {\n return element.hasClass('loading') || element.attr('disabled');\n };\n\n /**\n * Sends an ajax request to the server and handles the element state\n * while the request is being performed.\n *\n * @method sendRequest\n * @param {object} element jQuery object for the button\n * @param {object} request Request hash to send\n * @return {object} jQuery promise\n */\n var sendRequest = function(element, request) {\n if (isLoading(element)) {\n return $.Deferred();\n }\n\n element.addClass('loading');\n element.attr('disabled', 'disabled');\n\n return Ajax.call([request])[0]\n .fail(Notification.exception)\n .always(function() {\n element.removeClass('loading');\n element.removeAttr('disabled');\n });\n };\n\n /**\n * Send a request to the server to add the current user as\n * a contact. The contents of the button are changed to the\n * remove contact button upon success.\n *\n * @method addContact\n * @param {object} element jQuery object for the button\n */\n var addContact = function(element) {\n if (isLoading(element)) {\n return;\n }\n\n var request = {\n methodname: 'core_message_create_contact_request',\n args: {\n userid: getCurrentUserId(element),\n requesteduserid: getUserId(element),\n }\n };\n sendRequest(element, request).done(function() {\n setContact(element);\n Templates.render('message/remove_contact_button', {}).done(function(html, js) {\n Templates.replaceNodeContents(element, html, js);\n });\n });\n };\n\n /**\n * Send a request to the server to remove the current user as\n * a contact. The contents of the button are changed to the\n * add contact button upon success.\n *\n * @method removeContact\n * @param {object} element jQuery object for the button\n */\n var removeContact = function(element) {\n if (isLoading(element)) {\n return;\n }\n\n var request = {\n methodname: 'core_message_delete_contacts',\n args: {\n userids: [getUserId(element)],\n }\n };\n\n sendRequest(element, request).done(function() {\n setNotContact(element);\n Templates.render('message/add_contact_button', {}).done(function(html, js) {\n Templates.replaceNodeContents(element, html, js);\n });\n });\n };\n\n /**\n * Enhances the given element with a loading gif and event handles to make\n * ajax requests to add or remove a contact where appropriate.\n *\n * @method enhance\n * @param {object} element jQuery object for the button\n */\n var enhance = function(element) {\n element = $(element);\n\n if (!element.children('.loading-icon').length) {\n // Add the loading gif if it isn't already there.\n Templates.render('core/loading', {}).done(function(html, js) {\n element.append(html, js);\n });\n }\n\n CustomEvents.define(element, [CustomEvents.events.activate]);\n\n element.on(CustomEvents.events.activate, function(e, data) {\n if (isContact(element)) {\n removeContact(element);\n } else {\n addContact(element);\n }\n e.preventDefault();\n data.originalEvent.preventDefault();\n });\n };\n\n return /** @alias module:message/toggle_contact_button */ {\n enhance: enhance\n };\n});\n"],"file":"toggle_contact_button.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/toggle_contact_button.js"],"names":["define","$","Ajax","Templates","Notification","CustomEvents","isContact","element","attr","setContact","setNotContact","getUserId","getCurrentUserId","isLoading","hasClass","sendRequest","request","Deferred","addClass","call","fail","exception","always","removeClass","removeAttr","addContact","methodname","args","userid","requesteduserid","done","render","html","js","replaceNodeContents","removeContact","userids","enhance","children","length","append","events","activate","on","e","data","preventDefault","originalEvent"],"mappings":"AAsBAA,OAAM,sCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAA0C,mBAA1C,CAA+D,gCAA/D,CAAD,CACE,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6BC,CAA7B,CAA2CC,CAA3C,CAAyD,IASzDC,CAAAA,CAAS,CAAG,SAASC,CAAT,CAAkB,CAC9B,MAA0C,GAAnC,EAAAA,CAAO,CAACC,IAAR,CAAa,iBAAb,CACV,CAX4D,CAmBzDC,CAAU,CAAG,SAASF,CAAT,CAAkB,CAC/BA,CAAO,CAACC,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SAASE,CAAT,CAAeC,CAAf,CAAmB,CACzD1B,CAAO,CAACiC,MAAR,CAAeR,CAAf,CAAqBC,CAArB,CACH,CAFD,CAGH,CAED5B,CAAY,CAACL,MAAb,CAAoBO,CAApB,CAA6B,CAACF,CAAY,CAACoC,MAAb,CAAoBC,QAArB,CAA7B,EAEAnC,CAAO,CAACoC,EAAR,CAAWtC,CAAY,CAACoC,MAAb,CAAoBC,QAA/B,CAAyC,SAASE,CAAT,CAAYC,CAAZ,CAAkB,CACvD,GAAIvC,CAAS,CAACC,CAAD,CAAb,CAAwB,CACpB4B,CAAa,CAAC5B,CAAD,CAChB,CAFD,IAEO,CACHkB,CAAU,CAAClB,CAAD,CACb,CACDqC,CAAC,CAACE,cAAF,GACAD,CAAI,CAACE,aAAL,CAAmBD,cAAnB,EACH,CARD,CASH,CAEM,CAGV,CAtLK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to add/remove contact using ajax.\n *\n * @module core_message/toggle_contact_button\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/custom_interaction_events'],\n function($, Ajax, Templates, Notification, CustomEvents) {\n\n /**\n * Check the state of the element, if the current user is a contact or not.\n *\n * @method isContact\n * @param {object} element jQuery object for the button\n * @return {bool}\n */\n var isContact = function(element) {\n return element.attr('data-is-contact') == '1';\n };\n\n /**\n * Record that the user is a contact.\n *\n * @method setContact\n * @param {object} element jQuery object for the button\n */\n var setContact = function(element) {\n element.attr('data-is-contact', '1');\n };\n\n /**\n * Record that the user is not a contact.\n *\n * @method setNotContact\n * @param {object} element jQuery object for the button\n */\n var setNotContact = function(element) {\n element.attr('data-is-contact', '0');\n };\n\n /**\n * Get the id for the user being viewed.\n *\n * @method getUserId\n * @param {object} element jQuery object for the button\n * @return {int}\n */\n var getUserId = function(element) {\n return element.attr('data-userid');\n };\n\n /**\n * Get the id for the logged in user.\n *\n * @method getUserId\n * @param {object} element jQuery object for the button\n * @return {int}\n */\n var getCurrentUserId = function(element) {\n return element.attr('data-currentuserid');\n };\n\n /**\n * Check if this element is currently loading.\n *\n * @method isLoading\n * @param {object} element jQuery object for the button\n * @return {bool}\n */\n var isLoading = function(element) {\n return element.hasClass('loading') || element.attr('disabled');\n };\n\n /**\n * Sends an ajax request to the server and handles the element state\n * while the request is being performed.\n *\n * @method sendRequest\n * @param {object} element jQuery object for the button\n * @param {object} request Request hash to send\n * @return {object} jQuery promise\n */\n var sendRequest = function(element, request) {\n if (isLoading(element)) {\n return $.Deferred();\n }\n\n element.addClass('loading');\n element.attr('disabled', 'disabled');\n\n return Ajax.call([request])[0]\n .fail(Notification.exception)\n .always(function() {\n element.removeClass('loading');\n element.removeAttr('disabled');\n });\n };\n\n /**\n * Send a request to the server to add the current user as\n * a contact. The contents of the button are changed to the\n * remove contact button upon success.\n *\n * @method addContact\n * @param {object} element jQuery object for the button\n */\n var addContact = function(element) {\n if (isLoading(element)) {\n return;\n }\n\n var request = {\n methodname: 'core_message_create_contact_request',\n args: {\n userid: getCurrentUserId(element),\n requesteduserid: getUserId(element),\n }\n };\n sendRequest(element, request).done(function() {\n setContact(element);\n Templates.render('message/remove_contact_button', {}).done(function(html, js) {\n Templates.replaceNodeContents(element, html, js);\n });\n });\n };\n\n /**\n * Send a request to the server to remove the current user as\n * a contact. The contents of the button are changed to the\n * add contact button upon success.\n *\n * @method removeContact\n * @param {object} element jQuery object for the button\n */\n var removeContact = function(element) {\n if (isLoading(element)) {\n return;\n }\n\n var request = {\n methodname: 'core_message_delete_contacts',\n args: {\n userids: [getUserId(element)],\n }\n };\n\n sendRequest(element, request).done(function() {\n setNotContact(element);\n Templates.render('message/add_contact_button', {}).done(function(html, js) {\n Templates.replaceNodeContents(element, html, js);\n });\n });\n };\n\n /**\n * Enhances the given element with a loading gif and event handles to make\n * ajax requests to add or remove a contact where appropriate.\n *\n * @public\n * @method enhance\n * @param {object} element jQuery object for the button\n */\n var enhance = function(element) {\n element = $(element);\n\n if (!element.children('.loading-icon').length) {\n // Add the loading gif if it isn't already there.\n Templates.render('core/loading', {}).done(function(html, js) {\n element.append(html, js);\n });\n }\n\n CustomEvents.define(element, [CustomEvents.events.activate]);\n\n element.on(CustomEvents.events.activate, function(e, data) {\n if (isContact(element)) {\n removeContact(element);\n } else {\n addContact(element);\n }\n e.preventDefault();\n data.originalEvent.preventDefault();\n });\n };\n\n return {\n enhance: enhance\n };\n});\n"],"file":"toggle_contact_button.min.js"} \ No newline at end of file diff --git a/message/amd/src/message_notification_preference.js b/message/amd/src/message_notification_preference.js index e6c5b68600c3d..2ee01836ce1e0 100644 --- a/message/amd/src/message_notification_preference.js +++ b/message/amd/src/message_notification_preference.js @@ -18,7 +18,6 @@ * message preference page. * * @module core_message/message_notification_preference - * @class message_notification_preference * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -32,6 +31,7 @@ define(['jquery', 'core_message/notification_preference'], /** * Constructor for the Preference. * + * @class * @param {object} element jQuery object root element of the preference * @param {int} userId The current user id */ diff --git a/message/amd/src/message_preferences.js b/message/amd/src/message_preferences.js index effc62987f5b8..a966f5ebae0fb 100644 --- a/message/amd/src/message_preferences.js +++ b/message/amd/src/message_preferences.js @@ -17,7 +17,6 @@ * Controls the message preference page. * * @module core_message/message_preferences - * @class message_preferences * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -34,6 +33,7 @@ define(['jquery', 'core/ajax', 'core/notification', /** * Constructor for the MessagePreferences. * + * @class * @param {object} element The root element for the message preferences */ var MessagePreferences = function(element) { diff --git a/message/amd/src/message_repository.js b/message/amd/src/message_repository.js index 49f2939823cd6..907009c233628 100644 --- a/message/amd/src/message_repository.js +++ b/message/amd/src/message_repository.js @@ -17,7 +17,6 @@ * Retrieves messages from the server. * * @module core_message/message_repository - * @class message_repository * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/message/amd/src/notification_preference.js b/message/amd/src/notification_preference.js index 8b857b6bf7b2f..ae52eecf8b28b 100644 --- a/message/amd/src/notification_preference.js +++ b/message/amd/src/notification_preference.js @@ -18,7 +18,6 @@ * message preference page. * * @module core_message/notification_preference - * @class notification_preference * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -33,6 +32,7 @@ define(['jquery', 'core/ajax', 'core/notification', 'core_message/notification_p /** * Constructor for the Preference. * + * @class * @param {object} element jQuery object root element of the preference * @param {int} userId The current user id */ diff --git a/message/amd/src/notification_processor.js b/message/amd/src/notification_processor.js index 16f779b885c4d..338dd24d44390 100644 --- a/message/amd/src/notification_processor.js +++ b/message/amd/src/notification_processor.js @@ -17,7 +17,6 @@ * Represents the notification processor (e.g. email, popup, jabber) * * @module core_message/notification_processor - * @class notification_processor * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -32,6 +31,7 @@ define(['jquery'], function($) { /** * Constructor for the notification processor. * + * @class * @param {object} element jQuery object root element of the processor */ var NotificationProcessor = function(element) { diff --git a/message/amd/src/notification_processor_settings.js b/message/amd/src/notification_processor_settings.js index 1fce77e238db8..4295750591f2b 100644 --- a/message/amd/src/notification_processor_settings.js +++ b/message/amd/src/notification_processor_settings.js @@ -17,7 +17,6 @@ * Load the settings for a message processor. * * @module core_message/notification_processor_settings - * @class notification_processor_settings * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -53,6 +52,7 @@ define([ /** * Constructor for the Modal. * + * @class * @param {object} root The root jQuery element for the modal. */ var NotificationProcessorSettings = function(root) { diff --git a/message/amd/src/preferences_notifications_list_controller.js b/message/amd/src/preferences_notifications_list_controller.js index 47e16422aac94..daad95353d478 100644 --- a/message/amd/src/preferences_notifications_list_controller.js +++ b/message/amd/src/preferences_notifications_list_controller.js @@ -18,7 +18,6 @@ * message preference page * * @module core_message/preferences_notifications_list_controller - * @class preferences_notifications_list_controller * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -52,6 +51,7 @@ define(['jquery', /** * Constructor for the PreferencesController. * + * @class * @param {object} element jQuery object root element of the preference */ var PreferencesController = function(element) { diff --git a/message/amd/src/preferences_processor_form.js b/message/amd/src/preferences_processor_form.js index 677b190c5494f..67ba1c9ffb582 100644 --- a/message/amd/src/preferences_processor_form.js +++ b/message/amd/src/preferences_processor_form.js @@ -17,7 +17,6 @@ * Manages the processor form on the message preferences page. * * @module core_message/preferences_processor_form - * @class preferences_processor_form * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -26,6 +25,7 @@ define(['jquery', 'core/ajax', 'core/notification'], /** * Constructor for the ProcessorForm. * + * @class * @param {object} element jQuery object root element of the preference */ var ProcessorForm = function(element) { diff --git a/message/amd/src/toggle_contact_button.js b/message/amd/src/toggle_contact_button.js index ad47749223293..4490494c0ccc9 100644 --- a/message/amd/src/toggle_contact_button.js +++ b/message/amd/src/toggle_contact_button.js @@ -17,7 +17,6 @@ * Module to add/remove contact using ajax. * * @module core_message/toggle_contact_button - * @class toggle_contact_button * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -173,6 +172,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust * Enhances the given element with a loading gif and event handles to make * ajax requests to add or remove a contact where appropriate. * + * @public * @method enhance * @param {object} element jQuery object for the button */ @@ -199,7 +199,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust }); }; - return /** @alias module:message/toggle_contact_button */ { + return { enhance: enhance }; }); diff --git a/message/output/popup/amd/build/notification_area_content_area.min.js.map b/message/output/popup/amd/build/notification_area_content_area.min.js.map index dbcbfcc4c7eaa..f284f2420ccdc 100644 --- a/message/output/popup/amd/build/notification_area_content_area.min.js.map +++ b/message/output/popup/amd/build/notification_area_content_area.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/notification_area_content_area.js"],"names":["define","$","Templates","DebugNotification","CustomEvents","NotificationRepo","NotificationAreaEvents","SELECTORS","CONTAINER","CONTENT","HEADER","FOOTER","TOGGLE_MODE","TEMPLATES","ContentArea","root","userId","container","closest","header","find","content","footer","registerEventListeners","prototype","getRoot","getContainer","getUserId","getHeader","getContent","getFooter","show","addClass","hide","removeClass","setHeaderHTML","html","empty","setContentHTML","setFooterHTML","showNotification","notification","headerPromise","render","done","bind","contentPromise","footerPromise","when","trigger","notificationShown","events","activate","on","VIEW_TOGGLE","e"],"mappings":"AAwBAA,OAAM,gDAAC,CAAC,QAAD,CAAW,gBAAX,CAA6B,mBAA7B,CAAkD,gCAAlD,CACC,uCADD,CAC0C,wCAD1C,CAAD,CAEF,SAASC,CAAT,CAAYC,CAAZ,CAAuBC,CAAvB,CAA0CC,CAA1C,CAAwDC,CAAxD,CAA0EC,CAA1E,CAAkG,IAE9FC,CAAAA,CAAS,CAAG,CACZC,SAAS,CAAE,qCADC,CAEZC,OAAO,CAAE,2BAFG,CAGZC,MAAM,CAAE,0BAHI,CAIZC,MAAM,CAAE,0BAJI,CAKZC,WAAW,CAAE,+BALD,CAFkF,CAU9FC,CAAS,CAAG,CACZH,MAAM,CAAE,qDADI,CAEZD,OAAO,CAAE,sDAFG,CAGZE,MAAM,CAAE,qDAHI,CAVkF,C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AAON,CAAP,CAAsBI,CAAtB,CAAsCC,CAAtC,EAAqDH,IAArD,CAA0D,UAAW,CACxE,KAAKb,IAAL,GACA,KAAKL,YAAL,GAAoBuB,OAApB,CAA4B3C,CAAsB,CAAC4C,iBAAnD,CAAsE,CAACT,CAAD,CAAtE,CACH,CAHgE,CAG/DI,IAH+D,CAG1D,IAH0D,CAA1D,CAIV,CAjBD,CAwBA/B,CAAW,CAACU,SAAZ,CAAsBD,sBAAtB,CAA+C,UAAW,CACtDnB,CAAY,CAACJ,MAAb,CAAoB,KAAKyB,OAAL,EAApB,CAAoC,CAChCrB,CAAY,CAAC+C,MAAb,CAAoBC,QADY,CAApC,EAIA,KAAK3B,OAAL,GAAe4B,EAAf,CAAkBjD,CAAY,CAAC+C,MAAb,CAAoBC,QAAtC,CAAgD7C,CAAS,CAAC+C,WAA1D,CAAuE,UAAW,CAC9E,KAAKrB,IAAL,EACH,CAFsE,CAErEY,IAFqE,CAEhE,IAFgE,CAAvE,EAIA,KAAKnB,YAAL,GAAoB2B,EAApB,CAAuB/C,CAAsB,CAACkC,gBAA9C,CAAgE,SAASe,CAAT,CAAYd,CAAZ,CAA0B,CACtF,KAAKD,gBAAL,CAAsBC,CAAtB,CACH,CAF+D,CAE9DI,IAF8D,CAEzD,IAFyD,CAAhE,CAGH,CAZD,CAcA,MAAO/B,CAAAA,CACV,CA/LK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the content area of the notification area on the\n * notification page.\n *\n * @module message_popup/notification_area_content_area\n * @class notification_area_content_area\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/templates', 'core/notification', 'core/custom_interaction_events',\n 'message_popup/notification_repository', 'message_popup/notification_area_events'],\n function($, Templates, DebugNotification, CustomEvents, NotificationRepo, NotificationAreaEvents) {\n\n var SELECTORS = {\n CONTAINER: '[data-region=\"notification-area\"]',\n CONTENT: '[data-region=\"content\"]',\n HEADER: '[data-region=\"header\"]',\n FOOTER: '[data-region=\"footer\"]',\n TOGGLE_MODE: '[data-action=\"toggle-mode\"]',\n };\n\n var TEMPLATES = {\n HEADER: 'message_popup/notification_area_content_area_header',\n CONTENT: 'message_popup/notification_area_content_area_content',\n FOOTER: 'message_popup/notification_area_content_area_footer',\n };\n\n /**\n * Constructor for the ContentArea\n *\n * @param {object} root The root element for the content area\n * @param {int} userId The user id of the current user\n */\n var ContentArea = function(root, userId) {\n this.root = $(root);\n this.container = this.root.closest(SELECTORS.CONTAINER);\n this.userId = userId;\n this.header = this.root.find(SELECTORS.HEADER);\n this.content = this.root.find(SELECTORS.CONTENT);\n this.footer = this.root.find(SELECTORS.FOOTER);\n\n this.registerEventListeners();\n };\n\n /**\n * Get the root element.\n *\n * @method getRoot\n * @return {object} jQuery element\n */\n ContentArea.prototype.getRoot = function() {\n return this.root;\n };\n\n /**\n * Get the container element (which the content area is within).\n *\n * @method getContainer\n * @return {object} jQuery element\n */\n ContentArea.prototype.getContainer = function() {\n return this.container;\n };\n\n /**\n * Get the user id.\n *\n * @method getUserId\n * @return {int}\n */\n ContentArea.prototype.getUserId = function() {\n return this.userId;\n };\n\n /**\n * Get the content area header element.\n *\n * @method getHeader\n * @return {object} jQuery element\n */\n ContentArea.prototype.getHeader = function() {\n return this.header;\n };\n\n /**\n * Get the content area content element.\n *\n * @method getContent\n * @return {object} jQuery element\n */\n ContentArea.prototype.getContent = function() {\n return this.content;\n };\n\n /**\n * Get the content area footer element.\n *\n * @method getFooter\n * @return {object} jQuery element\n */\n ContentArea.prototype.getFooter = function() {\n return this.footer;\n };\n\n /**\n * Display the content area. Typically used with responsive\n * styling on smaller screens.\n *\n * @method show\n */\n ContentArea.prototype.show = function() {\n this.getContainer().addClass('show-content-area');\n };\n\n /**\n * Hide the content area. Typically used with responsive\n * styling on smaller screens.\n *\n * @method hide\n */\n ContentArea.prototype.hide = function() {\n this.getContainer().removeClass('show-content-area');\n };\n\n /**\n * Change the HTML in the content area header element.\n *\n * @method setHeaderHTML\n * @param {string} html The HTML to be set\n */\n ContentArea.prototype.setHeaderHTML = function(html) {\n this.getHeader().empty().html(html);\n };\n\n /**\n * Change the HTML in the content area content element.\n *\n * @method setContentHMTL\n * @param {string} html The HTML to be set.\n */\n ContentArea.prototype.setContentHTML = function(html) {\n this.getContent().empty().html(html);\n };\n\n /**\n * Change the HTML in the content area footer element.\n *\n * @method setFooterHTML\n * @param {string} html The HTML to be set.\n */\n ContentArea.prototype.setFooterHTML = function(html) {\n this.getFooter().empty().html(html);\n };\n\n /**\n * Render the given notification context in the content area.\n *\n * @method showNotification\n * @param {object} notification The notification context (from a webservice)\n * @return {object} jQuery promise\n */\n ContentArea.prototype.showNotification = function(notification) {\n var headerPromise = Templates.render(TEMPLATES.HEADER, notification).done(function(html) {\n this.setHeaderHTML(html);\n }.bind(this));\n\n var contentPromise = Templates.render(TEMPLATES.CONTENT, notification).done(function(html) {\n this.setContentHTML(html);\n }.bind(this));\n\n var footerPromise = Templates.render(TEMPLATES.FOOTER, notification).done(function(html) {\n this.setFooterHTML(html);\n }.bind(this));\n\n return $.when(headerPromise, contentPromise, footerPromise).done(function() {\n this.show();\n this.getContainer().trigger(NotificationAreaEvents.notificationShown, [notification]);\n }.bind(this));\n };\n\n /**\n * Create the event listeners for the content area.\n *\n * @method registerEventListeners\n */\n ContentArea.prototype.registerEventListeners = function() {\n CustomEvents.define(this.getRoot(), [\n CustomEvents.events.activate\n ]);\n\n this.getRoot().on(CustomEvents.events.activate, SELECTORS.VIEW_TOGGLE, function() {\n this.hide();\n }.bind(this));\n\n this.getContainer().on(NotificationAreaEvents.showNotification, function(e, notification) {\n this.showNotification(notification);\n }.bind(this));\n };\n\n return ContentArea;\n});\n"],"file":"notification_area_content_area.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/notification_area_content_area.js"],"names":["define","$","Templates","DebugNotification","CustomEvents","NotificationRepo","NotificationAreaEvents","SELECTORS","CONTAINER","CONTENT","HEADER","FOOTER","TOGGLE_MODE","TEMPLATES","ContentArea","root","userId","container","closest","header","find","content","footer","registerEventListeners","prototype","getRoot","getContainer","getUserId","getHeader","getContent","getFooter","show","addClass","hide","removeClass","setHeaderHTML","html","empty","setContentHTML","setFooterHTML","showNotification","notification","headerPromise","render","done","bind","contentPromise","footerPromise","when","trigger","notificationShown","events","activate","on","VIEW_TOGGLE","e"],"mappings":"AAuBAA,OAAM,gDAAC,CAAC,QAAD,CAAW,gBAAX,CAA6B,mBAA7B,CAAkD,gCAAlD,CACC,uCADD,CAC0C,wCAD1C,CAAD,CAEF,SAASC,CAAT,CAAYC,CAAZ,CAAuBC,CAAvB,CAA0CC,CAA1C,CAAwDC,CAAxD,CAA0EC,CAA1E,CAAkG,IAE9FC,CAAAA,CAAS,CAAG,CACZC,SAAS,CAAE,qCADC,CAEZC,OAAO,CAAE,2BAFG,CAGZC,MAAM,CAAE,0BAHI,CAIZC,MAAM,CAAE,0BAJI,CAKZC,WAAW,CAAE,+BALD,CAFkF,CAU9FC,CAAS,CAAG,CACZH,MAAM,CAAE,qDADI,CAEZD,OAAO,CAAE,sDAFG,CAGZE,MAAM,CAAE,qDAHI,CAVkF,CAuB9FG,CAAW,CAAG,SAASC,CAAT,CAAeC,CAAf,CAAuB,CACrC,KAAKD,IAAL,CAAYd,CAAC,CAACc,CAAD,CAAb,CACA,KAAKE,SAAL,CAAiB,KAAKF,IAAL,CAAUG,OAAV,CAAkBX,CAAS,CAACC,SAA5B,CAAjB,CACA,KAAKQ,MAAL,CAAcA,CAAd,C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,CAA1D,CAIV,CAjBD,CAwBA/B,CAAW,CAACU,SAAZ,CAAsBD,sBAAtB,CAA+C,UAAW,CACtDnB,CAAY,CAACJ,MAAb,CAAoB,KAAKyB,OAAL,EAApB,CAAoC,CAChCrB,CAAY,CAAC+C,MAAb,CAAoBC,QADY,CAApC,EAIA,KAAK3B,OAAL,GAAe4B,EAAf,CAAkBjD,CAAY,CAAC+C,MAAb,CAAoBC,QAAtC,CAAgD7C,CAAS,CAAC+C,WAA1D,CAAuE,UAAW,CAC9E,KAAKrB,IAAL,EACH,CAFsE,CAErEY,IAFqE,CAEhE,IAFgE,CAAvE,EAIA,KAAKnB,YAAL,GAAoB2B,EAApB,CAAuB/C,CAAsB,CAACkC,gBAA9C,CAAgE,SAASe,CAAT,CAAYd,CAAZ,CAA0B,CACtF,KAAKD,gBAAL,CAAsBC,CAAtB,CACH,CAF+D,CAE9DI,IAF8D,CAEzD,IAFyD,CAAhE,CAGH,CAZD,CAcA,MAAO/B,CAAAA,CACV,CAhMK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the content area of the notification area on the\n * notification page.\n *\n * @module message_popup/notification_area_content_area\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/templates', 'core/notification', 'core/custom_interaction_events',\n 'message_popup/notification_repository', 'message_popup/notification_area_events'],\n function($, Templates, DebugNotification, CustomEvents, NotificationRepo, NotificationAreaEvents) {\n\n var SELECTORS = {\n CONTAINER: '[data-region=\"notification-area\"]',\n CONTENT: '[data-region=\"content\"]',\n HEADER: '[data-region=\"header\"]',\n FOOTER: '[data-region=\"footer\"]',\n TOGGLE_MODE: '[data-action=\"toggle-mode\"]',\n };\n\n var TEMPLATES = {\n HEADER: 'message_popup/notification_area_content_area_header',\n CONTENT: 'message_popup/notification_area_content_area_content',\n FOOTER: 'message_popup/notification_area_content_area_footer',\n };\n\n /**\n * Constructor for the ContentArea\n *\n * @class\n * @param {object} root The root element for the content area\n * @param {int} userId The user id of the current user\n */\n var ContentArea = function(root, userId) {\n this.root = $(root);\n this.container = this.root.closest(SELECTORS.CONTAINER);\n this.userId = userId;\n this.header = this.root.find(SELECTORS.HEADER);\n this.content = this.root.find(SELECTORS.CONTENT);\n this.footer = this.root.find(SELECTORS.FOOTER);\n\n this.registerEventListeners();\n };\n\n /**\n * Get the root element.\n *\n * @method getRoot\n * @return {object} jQuery element\n */\n ContentArea.prototype.getRoot = function() {\n return this.root;\n };\n\n /**\n * Get the container element (which the content area is within).\n *\n * @method getContainer\n * @return {object} jQuery element\n */\n ContentArea.prototype.getContainer = function() {\n return this.container;\n };\n\n /**\n * Get the user id.\n *\n * @method getUserId\n * @return {int}\n */\n ContentArea.prototype.getUserId = function() {\n return this.userId;\n };\n\n /**\n * Get the content area header element.\n *\n * @method getHeader\n * @return {object} jQuery element\n */\n ContentArea.prototype.getHeader = function() {\n return this.header;\n };\n\n /**\n * Get the content area content element.\n *\n * @method getContent\n * @return {object} jQuery element\n */\n ContentArea.prototype.getContent = function() {\n return this.content;\n };\n\n /**\n * Get the content area footer element.\n *\n * @method getFooter\n * @return {object} jQuery element\n */\n ContentArea.prototype.getFooter = function() {\n return this.footer;\n };\n\n /**\n * Display the content area. Typically used with responsive\n * styling on smaller screens.\n *\n * @method show\n */\n ContentArea.prototype.show = function() {\n this.getContainer().addClass('show-content-area');\n };\n\n /**\n * Hide the content area. Typically used with responsive\n * styling on smaller screens.\n *\n * @method hide\n */\n ContentArea.prototype.hide = function() {\n this.getContainer().removeClass('show-content-area');\n };\n\n /**\n * Change the HTML in the content area header element.\n *\n * @method setHeaderHTML\n * @param {string} html The HTML to be set\n */\n ContentArea.prototype.setHeaderHTML = function(html) {\n this.getHeader().empty().html(html);\n };\n\n /**\n * Change the HTML in the content area content element.\n *\n * @method setContentHMTL\n * @param {string} html The HTML to be set.\n */\n ContentArea.prototype.setContentHTML = function(html) {\n this.getContent().empty().html(html);\n };\n\n /**\n * Change the HTML in the content area footer element.\n *\n * @method setFooterHTML\n * @param {string} html The HTML to be set.\n */\n ContentArea.prototype.setFooterHTML = function(html) {\n this.getFooter().empty().html(html);\n };\n\n /**\n * Render the given notification context in the content area.\n *\n * @method showNotification\n * @param {object} notification The notification context (from a webservice)\n * @return {object} jQuery promise\n */\n ContentArea.prototype.showNotification = function(notification) {\n var headerPromise = Templates.render(TEMPLATES.HEADER, notification).done(function(html) {\n this.setHeaderHTML(html);\n }.bind(this));\n\n var contentPromise = Templates.render(TEMPLATES.CONTENT, notification).done(function(html) {\n this.setContentHTML(html);\n }.bind(this));\n\n var footerPromise = Templates.render(TEMPLATES.FOOTER, notification).done(function(html) {\n this.setFooterHTML(html);\n }.bind(this));\n\n return $.when(headerPromise, contentPromise, footerPromise).done(function() {\n this.show();\n this.getContainer().trigger(NotificationAreaEvents.notificationShown, [notification]);\n }.bind(this));\n };\n\n /**\n * Create the event listeners for the content area.\n *\n * @method registerEventListeners\n */\n ContentArea.prototype.registerEventListeners = function() {\n CustomEvents.define(this.getRoot(), [\n CustomEvents.events.activate\n ]);\n\n this.getRoot().on(CustomEvents.events.activate, SELECTORS.VIEW_TOGGLE, function() {\n this.hide();\n }.bind(this));\n\n this.getContainer().on(NotificationAreaEvents.showNotification, function(e, notification) {\n this.showNotification(notification);\n }.bind(this));\n };\n\n return ContentArea;\n});\n"],"file":"notification_area_content_area.min.js"} \ No newline at end of file diff --git a/message/output/popup/amd/build/notification_area_control_area.min.js.map b/message/output/popup/amd/build/notification_area_control_area.min.js.map index d0f35d85f47e9..b762fae1cfe7c 100644 --- a/message/output/popup/amd/build/notification_area_control_area.min.js.map +++ b/message/output/popup/amd/build/notification_area_control_area.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/notification_area_control_area.js"],"names":["define","$","Templates","DebugNotification","CustomEvents","NotificationRepo","NotificationAreaEvents","SELECTORS","CONTAINER","CONTENT","NOTIFICATION","CAN_RECEIVE_FOCUS","TEMPLATES","ControlArea","root","userId","container","closest","content","find","offset","limit","initialLoad","isLoading","loadedAll","notifications","registerEventListeners","prototype","getRoot","getContainer","getUserId","getContent","getOffset","getLimit","setOffset","value","setLimit","incrementOffset","startLoading","addClass","stopLoading","removeClass","hasDoneInitialLoad","hasLoadedAllContent","setLoadedAllContent","val","setCacheNotification","notification","id","getCacheNotification","getNotificationElement","element","length","scrollNotificationIntoView","notificationElement","position","relativeTop","top","scrollTop","innerHeight","height","outerHeight","scrollTo","showNotification","focus","notificationId","attr","trigger","extend","markNotificationAsRead","markAsRead","done","renderNotifications","promises","each","index","contextUrl","contexturl","promise","render","then","html","js","bind","push","when","apply","arguments","argument","append","runTemplateJS","loadMoreNotifications","Deferred","resolve","request","useridto","query","result","unreadCount","unreadcount","always","events","activate","scrollBottom","scrollLock","up","down","on","e","target","data","prev","originalEvent","preventDefault","next","notificationShown","read","cachedNotification"],"mappings":"mSAuBAA,OAAM,gDAAC,CAAC,QAAD,CAAW,gBAAX,CAA6B,mBAA7B,CAAkD,gCAAlD,CACC,uCADD,CAC0C,wCAD1C,CAAD,CAEF,SAASC,CAAT,CAAYC,CAAZ,CAAuBC,CAAvB,CAA0CC,CAA1C,CAAwDC,CAAxD,CAA0EC,CAA1E,CAAkG,IAE9FC,CAAAA,CAAS,CAAG,CACZC,SAAS,CAAE,qCADC,CAEZC,OAAO,CAAE,2BAFG,CAGZC,YAAY,CAAE,uDAHF,CAIZC,iBAAiB,CAAE,6EAJP,CAFkF,CAS9FC,CAAS,CAAG,CACZF,YAAY,CAAE,yCADF,CATk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B,CACA,KAAKqD,gBAAL,CAAsBT,CAAmB,CAACyD,IAApB,EAAtB,EAEAD,CAAI,CAACE,aAAL,CAAmBC,cAAnB,EACH,CALiE,CAKhE9B,IALgE,CAK3D,IAL2D,CAAlE,EAQA,KAAKvD,OAAL,GAAe+E,EAAf,CAAkBvG,CAAY,CAACiG,MAAb,CAAoBK,IAAtC,CAA4CnG,CAAS,CAACG,YAAtD,CAAoE,SAASkG,CAAT,CAAYE,CAAZ,CAAkB,CAClF,GAAIxD,CAAAA,CAAmB,CAAGrD,CAAC,CAAC2G,CAAC,CAACC,MAAH,CAAD,CAAY5F,OAAZ,CAAoBV,CAAS,CAACG,YAA9B,CAA1B,CACA,KAAKqD,gBAAL,CAAsBT,CAAmB,CAAC4D,IAApB,EAAtB,EAEAJ,CAAI,CAACE,aAAL,CAAmBC,cAAnB,EACH,CALmE,CAKlE9B,IALkE,CAK7D,IAL6D,CAApE,EAOA,KAAKtD,YAAL,GAAoB8E,EAApB,CAAuBrG,CAAsB,CAAC6G,iBAA9C,CAAiE,SAASP,CAAT,CAAY7D,CAAZ,CAA0B,CACvF,GAAI,CAACA,CAAY,CAACqE,IAAlB,CAAwB,CACpB,GAAIjE,CAAAA,CAAO,CAAG,KAAKD,sBAAL,CAA4BH,CAAY,CAACC,EAAzC,CAAd,CAEA,GAAIG,CAAJ,CAAa,CACT,KAAKkB,sBAAL,CAA4BlB,CAA5B,CACH,CAED,GAAIkE,CAAAA,CAAkB,CAAG,KAAKpE,oBAAL,CAA0BF,CAAY,CAACC,EAAvC,CAAzB,CAEA,GAAIqE,CAAJ,CAAwB,CACpBA,CAAkB,CAACD,IAAnB,GACH,CACJ,CACJ,CAdgE,CAc/DjC,IAd+D,CAc1D,IAd0D,CAAjE,CAeH,CAjDD,CAmDA,MAAOtE,CAAAA,CACV,CAnaK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the notification area on the notification page.\n *\n * @module message_popup/notification_area_control_area\n * @class notification_area_control_area\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/templates', 'core/notification', 'core/custom_interaction_events',\n 'message_popup/notification_repository', 'message_popup/notification_area_events'],\n function($, Templates, DebugNotification, CustomEvents, NotificationRepo, NotificationAreaEvents) {\n\n var SELECTORS = {\n CONTAINER: '[data-region=\"notification-area\"]',\n CONTENT: '[data-region=\"content\"]',\n NOTIFICATION: '[data-region=\"notification-content-item-container\"]',\n CAN_RECEIVE_FOCUS: 'input:not([type=\"hidden\"]), a[href], button, textarea, select, [tabindex]',\n };\n\n var TEMPLATES = {\n NOTIFICATION: 'message_popup/notification_content_item',\n };\n\n /**\n * Constructor for ControlArea\n *\n * @param {object} root The root element for the content area\n * @param {int} userId The user id of the current user\n */\n var ControlArea = function(root, userId) {\n this.root = $(root);\n this.container = this.root.closest(SELECTORS.CONTAINER);\n this.userId = userId;\n this.content = this.root.find(SELECTORS.CONTENT);\n this.offset = 0;\n this.limit = 20;\n this.initialLoad = false;\n this.isLoading = false;\n this.loadedAll = false;\n this.notifications = {};\n\n this.registerEventListeners();\n };\n\n /**\n * Get the root element.\n *\n * @method getRoot\n * @return {object} jQuery element\n */\n ControlArea.prototype.getRoot = function() {\n return this.root;\n };\n\n /**\n * Get the container element (which the control area is within).\n *\n * @method getContainer\n * @return {object} jQuery element\n */\n ControlArea.prototype.getContainer = function() {\n return this.container;\n };\n\n /**\n * Get the user id.\n *\n * @method getUserId\n * @return {int}\n */\n ControlArea.prototype.getUserId = function() {\n return this.userId;\n };\n\n /**\n * Get the control area content element.\n *\n * @method getContent\n * @return {object} jQuery element\n */\n ControlArea.prototype.getContent = function() {\n return this.content;\n };\n\n /**\n * Get the offset value for paginated loading of the\n * notifications.\n *\n * @method getOffset\n * @return {int}\n */\n ControlArea.prototype.getOffset = function() {\n return this.offset;\n };\n\n /**\n * Get the limit value for the paginated loading of the\n * notifications.\n *\n * @method getLimit\n * @return {int}\n */\n ControlArea.prototype.getLimit = function() {\n return this.limit;\n };\n\n /**\n * Set the offset value for the paginated loading of the\n * notifications.\n *\n * @method setOffset\n * @param {int} value The new offset value\n */\n ControlArea.prototype.setOffset = function(value) {\n this.offset = value;\n };\n\n /**\n * Set the limit value for the paginated loading of the\n * notifications.\n *\n * @method setLimit\n * @param {int} value The new limit value\n */\n ControlArea.prototype.setLimit = function(value) {\n this.limit = value;\n };\n\n /**\n * Increment the offset by the limit amount.\n *\n * @method incrementOffset\n */\n ControlArea.prototype.incrementOffset = function() {\n this.offset += this.limit;\n };\n\n /**\n * Flag the control area as loading.\n *\n * @method startLoading\n */\n ControlArea.prototype.startLoading = function() {\n this.isLoading = true;\n this.getRoot().addClass('loading');\n };\n\n /**\n * Remove the loading flag from the control area.\n *\n * @method stopLoading\n */\n ControlArea.prototype.stopLoading = function() {\n this.isLoading = false;\n this.getRoot().removeClass('loading');\n };\n\n /**\n * Check if the first load of notifications has been triggered.\n *\n * @method hasDoneInitialLoad\n * @return {bool} true if first notification loaded, false otherwise\n */\n ControlArea.prototype.hasDoneInitialLoad = function() {\n return this.initialLoad;\n };\n\n /**\n * Check if all of the notifications have been loaded.\n *\n * @method hasLoadedAllContent\n * @return {bool}\n */\n ControlArea.prototype.hasLoadedAllContent = function() {\n return this.loadedAll;\n };\n\n /**\n * Set the state of the loaded all content property.\n *\n * @method setLoadedAllContent\n * @param {bool} val True if all content is loaded, false otherwise\n */\n ControlArea.prototype.setLoadedAllContent = function(val) {\n this.loadedAll = val;\n };\n\n /**\n * Save a notification in the cache.\n *\n * @method setCacheNotification\n * @param {object} notification A notification returned by a webservice\n */\n ControlArea.prototype.setCacheNotification = function(notification) {\n this.notifications[notification.id] = notification;\n };\n\n /**\n * Retrieve a notification from the cache.\n *\n * @method getCacheNotification\n * @param {int} id The id for the notification you wish to retrieve\n * @return {object} A notification (as returned by a webservice)\n */\n ControlArea.prototype.getCacheNotification = function(id) {\n return this.notifications[id];\n };\n\n /**\n * Find the notification element in the control area for the given id.\n *\n * @method getNotificationElement\n * @param {int} id The notification id\n * @return {(object|null)} jQuery element or null\n */\n ControlArea.prototype.getNotificationElement = function(id) {\n var element = this.getRoot().find(SELECTORS.NOTIFICATION + '[data-id=\"' + id + '\"]');\n return element.length == 1 ? element : null;\n };\n\n /**\n * Scroll the notification element into view within the control area, if it\n * isn't already visible.\n *\n * @method scrollNotificationIntoView\n * @param {object} notificationElement The jQuery notification element\n */\n ControlArea.prototype.scrollNotificationIntoView = function(notificationElement) {\n var position = notificationElement.position();\n var container = this.getRoot();\n var relativeTop = position.top - container.scrollTop();\n\n // If the element isn't in the view window.\n if (relativeTop > container.innerHeight()) {\n var height = notificationElement.outerHeight();\n // Offset enough to make sure the notification will be in view.\n height = height * 4;\n var scrollTo = position.top - height;\n container.scrollTop(scrollTo);\n }\n };\n\n /**\n * Show the full notification for the given notification element. The notification\n * context is retrieved from the cache and send as data with an event to be\n * rendered in the content area.\n *\n * @method showNotification\n * @param {(int|object)} notificationElement The notification id or jQuery notification element\n */\n ControlArea.prototype.showNotification = function(notificationElement) {\n if (typeof notificationElement !== 'object') {\n // Assume it's an ID if it's not an object.\n notificationElement = this.getNotificationElement(notificationElement);\n }\n\n if (notificationElement && notificationElement.length) {\n this.getRoot().find(SELECTORS.NOTIFICATION).removeClass('selected');\n notificationElement.addClass('selected').find(SELECTORS.CAN_RECEIVE_FOCUS).focus();\n var notificationId = notificationElement.attr('data-id');\n var notification = this.getCacheNotification(notificationId);\n this.scrollNotificationIntoView(notificationElement);\n // Create a new version of the notification to send with the notification so\n // this copy isn't modified.\n this.getContainer().trigger(NotificationAreaEvents.showNotification, [$.extend({}, notification)]);\n }\n };\n\n /**\n * Send a request to mark the notification as read in the server and remove the unread\n * status from the element.\n *\n * @method markNotificationAsRead\n * @param {object} notificationElement The jQuery notification element\n * @return {object} jQuery promise\n */\n ControlArea.prototype.markNotificationAsRead = function(notificationElement) {\n return NotificationRepo.markAsRead(notificationElement.attr('data-id')).done(function() {\n notificationElement.removeClass('unread');\n });\n };\n\n\n /**\n * Render the notification data with the appropriate template and add it to the DOM.\n *\n * @method renderNotifications\n * @param {array} notifications Array of notification data\n * @return {object} jQuery promise that is resolved when all notifications have been\n * rendered and added to the DOM\n */\n ControlArea.prototype.renderNotifications = function(notifications) {\n var promises = [];\n var container = this.getContent();\n\n $.each(notifications, function(index, notification) {\n // Need to remove the contexturl so the item isn't rendered\n // as a link.\n var contextUrl = notification.contexturl;\n delete notification.contexturl;\n\n var promise = Templates.render(TEMPLATES.NOTIFICATION, notification)\n .then(function(html, js) {\n // Restore it for the cache.\n notification.contexturl = contextUrl;\n this.setCacheNotification(notification);\n // Pass the Rendered content out.\n return {html: html, js: js};\n }.bind(this));\n promises.push(promise);\n }.bind(this));\n\n return $.when.apply($, promises).then(function() {\n // Each of the promises in the when will pass its results as an argument to the function.\n // The order of the arguments will be the order that the promises are passed to when()\n // i.e. the first promise's results will be in the first argument.\n $.each(arguments, function(index, argument) {\n container.append(argument.html);\n Templates.runTemplateJS(argument.js);\n });\n return;\n });\n };\n\n /**\n * Load notifications from the server and render them.\n *\n * @method loadMoreNotifications\n * @return {object} jQuery promise\n */\n ControlArea.prototype.loadMoreNotifications = function() {\n if (this.isLoading || this.hasLoadedAllContent()) {\n return $.Deferred().resolve();\n }\n\n this.startLoading();\n var request = {\n limit: this.getLimit(),\n offset: this.getOffset(),\n useridto: this.getUserId(),\n };\n\n if (!this.initialLoad) {\n // If this is the first load we may have been given a non-zero offset,\n // in which case we need to load all notifications preceeding that offset\n // to make sure the full list is rendered.\n request.limit = this.getOffset() + this.getLimit();\n request.offset = 0;\n }\n\n var promise = NotificationRepo.query(request).then(function(result) {\n var notifications = result.notifications;\n this.unreadCount = result.unreadcount;\n this.setLoadedAllContent(!notifications.length || notifications.length < this.getLimit());\n this.initialLoad = true;\n\n if (notifications.length) {\n this.incrementOffset();\n return this.renderNotifications(notifications);\n }\n\n return false;\n }.bind(this))\n .always(function() {\n this.stopLoading();\n }.bind(this));\n\n return promise;\n };\n\n /**\n * Create the event listeners for the control area.\n *\n * @method registerEventListeners\n */\n ControlArea.prototype.registerEventListeners = function() {\n CustomEvents.define(this.getRoot(), [\n CustomEvents.events.activate,\n CustomEvents.events.scrollBottom,\n CustomEvents.events.scrollLock,\n CustomEvents.events.up,\n CustomEvents.events.down,\n ]);\n\n this.getRoot().on(CustomEvents.events.scrollBottom, function() {\n this.loadMoreNotifications();\n }.bind(this));\n\n this.getRoot().on(CustomEvents.events.activate, SELECTORS.NOTIFICATION, function(e) {\n var notificationElement = $(e.target).closest(SELECTORS.NOTIFICATION);\n this.showNotification(notificationElement);\n }.bind(this));\n\n // Show the previous notification in the list.\n this.getRoot().on(CustomEvents.events.up, SELECTORS.NOTIFICATION, function(e, data) {\n var notificationElement = $(e.target).closest(SELECTORS.NOTIFICATION);\n this.showNotification(notificationElement.prev());\n\n data.originalEvent.preventDefault();\n }.bind(this));\n\n // Show the next notification in the list.\n this.getRoot().on(CustomEvents.events.down, SELECTORS.NOTIFICATION, function(e, data) {\n var notificationElement = $(e.target).closest(SELECTORS.NOTIFICATION);\n this.showNotification(notificationElement.next());\n\n data.originalEvent.preventDefault();\n }.bind(this));\n\n this.getContainer().on(NotificationAreaEvents.notificationShown, function(e, notification) {\n if (!notification.read) {\n var element = this.getNotificationElement(notification.id);\n\n if (element) {\n this.markNotificationAsRead(element);\n }\n\n var cachedNotification = this.getCacheNotification(notification.id);\n\n if (cachedNotification) {\n cachedNotification.read = true;\n }\n }\n }.bind(this));\n };\n\n return ControlArea;\n});\n"],"file":"notification_area_control_area.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/notification_area_control_area.js"],"names":["define","$","Templates","DebugNotification","CustomEvents","NotificationRepo","NotificationAreaEvents","SELECTORS","CONTAINER","CONTENT","NOTIFICATION","CAN_RECEIVE_FOCUS","TEMPLATES","ControlArea","root","userId","container","closest","content","find","offset","limit","initialLoad","isLoading","loadedAll","notifications","registerEventListeners","prototype","getRoot","getContainer","getUserId","getContent","getOffset","getLimit","setOffset","value","setLimit","incrementOffset","startLoading","addClass","stopLoading","removeClass","hasDoneInitialLoad","hasLoadedAllContent","setLoadedAllContent","val","setCacheNotification","notification","id","getCacheNotification","getNotificationElement","element","length","scrollNotificationIntoView","notificationElement","position","relativeTop","top","scrollTop","innerHeight","height","outerHeight","scrollTo","showNotification","focus","notificationId","attr","trigger","extend","markNotificationAsRead","markAsRead","done","renderNotifications","promises","each","index","contextUrl","contexturl","promise","render","then","html","js","bind","push","when","apply","arguments","argument","append","runTemplateJS","loadMoreNotifications","Deferred","resolve","request","useridto","query","result","unreadCount","unreadcount","always","events","activate","scrollBottom","scrollLock","up","down","on","e","target","data","prev","originalEvent","preventDefault","next","notificationShown","read","cachedNotification"],"mappings":"mSAsBAA,OAAM,gDAAC,CAAC,QAAD,CAAW,gBAAX,CAA6B,mBAA7B,CAAkD,gCAAlD,CACC,uCADD,CAC0C,wCAD1C,CAAD,CAEF,SAASC,CAAT,CAAYC,CAAZ,CAAuBC,CAAvB,CAA0CC,CAA1C,CAAwDC,CAAxD,CAA0EC,CAA1E,CAAkG,IAE9FC,CAAAA,CAAS,CAAG,CACZC,SAAS,CAAE,qCADC,CAEZC,OAAO,CAAE,2BAFG,CAGZC,YAAY,CAAE,uDAHF,CAIZC,iBAAiB,CAAE,6EAJP,CAFkF,CAS9FC,CAAS,CAAG,CACZF,YAAY,CAAE,yCADF,CATkF,CAoB9FG,CAAW,CAAG,SAASC,CAAT,CAAeC,CAAf,CAAuB,CACrC,KAAKD,IAAL,CAAYb,C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CAAmBC,cAAnB,EACH,CALiE,CAKhE9B,IALgE,CAK3D,IAL2D,CAAlE,EAQA,KAAKvD,OAAL,GAAe+E,EAAf,CAAkBvG,CAAY,CAACiG,MAAb,CAAoBK,IAAtC,CAA4CnG,CAAS,CAACG,YAAtD,CAAoE,SAASkG,CAAT,CAAYE,CAAZ,CAAkB,CAClF,GAAIxD,CAAAA,CAAmB,CAAGrD,CAAC,CAAC2G,CAAC,CAACC,MAAH,CAAD,CAAY5F,OAAZ,CAAoBV,CAAS,CAACG,YAA9B,CAA1B,CACA,KAAKqD,gBAAL,CAAsBT,CAAmB,CAAC4D,IAApB,EAAtB,EAEAJ,CAAI,CAACE,aAAL,CAAmBC,cAAnB,EACH,CALmE,CAKlE9B,IALkE,CAK7D,IAL6D,CAApE,EAOA,KAAKtD,YAAL,GAAoB8E,EAApB,CAAuBrG,CAAsB,CAAC6G,iBAA9C,CAAiE,SAASP,CAAT,CAAY7D,CAAZ,CAA0B,CACvF,GAAI,CAACA,CAAY,CAACqE,IAAlB,CAAwB,CACpB,GAAIjE,CAAAA,CAAO,CAAG,KAAKD,sBAAL,CAA4BH,CAAY,CAACC,EAAzC,CAAd,CAEA,GAAIG,CAAJ,CAAa,CACT,KAAKkB,sBAAL,CAA4BlB,CAA5B,CACH,CAED,GAAIkE,CAAAA,CAAkB,CAAG,KAAKpE,oBAAL,CAA0BF,CAAY,CAACC,EAAvC,CAAzB,CAEA,GAAIqE,CAAJ,CAAwB,CACpBA,CAAkB,CAACD,IAAnB,GACH,CACJ,CACJ,CAdgE,CAc/DjC,IAd+D,CAc1D,IAd0D,CAAjE,CAeH,CAjDD,CAmDA,MAAOtE,CAAAA,CACV,CApaK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the notification area on the notification page.\n *\n * @module message_popup/notification_area_control_area\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/templates', 'core/notification', 'core/custom_interaction_events',\n 'message_popup/notification_repository', 'message_popup/notification_area_events'],\n function($, Templates, DebugNotification, CustomEvents, NotificationRepo, NotificationAreaEvents) {\n\n var SELECTORS = {\n CONTAINER: '[data-region=\"notification-area\"]',\n CONTENT: '[data-region=\"content\"]',\n NOTIFICATION: '[data-region=\"notification-content-item-container\"]',\n CAN_RECEIVE_FOCUS: 'input:not([type=\"hidden\"]), a[href], button, textarea, select, [tabindex]',\n };\n\n var TEMPLATES = {\n NOTIFICATION: 'message_popup/notification_content_item',\n };\n\n /**\n * Constructor for ControlArea\n *\n * @class\n * @param {object} root The root element for the content area\n * @param {int} userId The user id of the current user\n */\n var ControlArea = function(root, userId) {\n this.root = $(root);\n this.container = this.root.closest(SELECTORS.CONTAINER);\n this.userId = userId;\n this.content = this.root.find(SELECTORS.CONTENT);\n this.offset = 0;\n this.limit = 20;\n this.initialLoad = false;\n this.isLoading = false;\n this.loadedAll = false;\n this.notifications = {};\n\n this.registerEventListeners();\n };\n\n /**\n * Get the root element.\n *\n * @method getRoot\n * @return {object} jQuery element\n */\n ControlArea.prototype.getRoot = function() {\n return this.root;\n };\n\n /**\n * Get the container element (which the control area is within).\n *\n * @method getContainer\n * @return {object} jQuery element\n */\n ControlArea.prototype.getContainer = function() {\n return this.container;\n };\n\n /**\n * Get the user id.\n *\n * @method getUserId\n * @return {int}\n */\n ControlArea.prototype.getUserId = function() {\n return this.userId;\n };\n\n /**\n * Get the control area content element.\n *\n * @method getContent\n * @return {object} jQuery element\n */\n ControlArea.prototype.getContent = function() {\n return this.content;\n };\n\n /**\n * Get the offset value for paginated loading of the\n * notifications.\n *\n * @method getOffset\n * @return {int}\n */\n ControlArea.prototype.getOffset = function() {\n return this.offset;\n };\n\n /**\n * Get the limit value for the paginated loading of the\n * notifications.\n *\n * @method getLimit\n * @return {int}\n */\n ControlArea.prototype.getLimit = function() {\n return this.limit;\n };\n\n /**\n * Set the offset value for the paginated loading of the\n * notifications.\n *\n * @method setOffset\n * @param {int} value The new offset value\n */\n ControlArea.prototype.setOffset = function(value) {\n this.offset = value;\n };\n\n /**\n * Set the limit value for the paginated loading of the\n * notifications.\n *\n * @method setLimit\n * @param {int} value The new limit value\n */\n ControlArea.prototype.setLimit = function(value) {\n this.limit = value;\n };\n\n /**\n * Increment the offset by the limit amount.\n *\n * @method incrementOffset\n */\n ControlArea.prototype.incrementOffset = function() {\n this.offset += this.limit;\n };\n\n /**\n * Flag the control area as loading.\n *\n * @method startLoading\n */\n ControlArea.prototype.startLoading = function() {\n this.isLoading = true;\n this.getRoot().addClass('loading');\n };\n\n /**\n * Remove the loading flag from the control area.\n *\n * @method stopLoading\n */\n ControlArea.prototype.stopLoading = function() {\n this.isLoading = false;\n this.getRoot().removeClass('loading');\n };\n\n /**\n * Check if the first load of notifications has been triggered.\n *\n * @method hasDoneInitialLoad\n * @return {bool} true if first notification loaded, false otherwise\n */\n ControlArea.prototype.hasDoneInitialLoad = function() {\n return this.initialLoad;\n };\n\n /**\n * Check if all of the notifications have been loaded.\n *\n * @method hasLoadedAllContent\n * @return {bool}\n */\n ControlArea.prototype.hasLoadedAllContent = function() {\n return this.loadedAll;\n };\n\n /**\n * Set the state of the loaded all content property.\n *\n * @method setLoadedAllContent\n * @param {bool} val True if all content is loaded, false otherwise\n */\n ControlArea.prototype.setLoadedAllContent = function(val) {\n this.loadedAll = val;\n };\n\n /**\n * Save a notification in the cache.\n *\n * @method setCacheNotification\n * @param {object} notification A notification returned by a webservice\n */\n ControlArea.prototype.setCacheNotification = function(notification) {\n this.notifications[notification.id] = notification;\n };\n\n /**\n * Retrieve a notification from the cache.\n *\n * @method getCacheNotification\n * @param {int} id The id for the notification you wish to retrieve\n * @return {object} A notification (as returned by a webservice)\n */\n ControlArea.prototype.getCacheNotification = function(id) {\n return this.notifications[id];\n };\n\n /**\n * Find the notification element in the control area for the given id.\n *\n * @method getNotificationElement\n * @param {int} id The notification id\n * @return {(object|null)} jQuery element or null\n */\n ControlArea.prototype.getNotificationElement = function(id) {\n var element = this.getRoot().find(SELECTORS.NOTIFICATION + '[data-id=\"' + id + '\"]');\n return element.length == 1 ? element : null;\n };\n\n /**\n * Scroll the notification element into view within the control area, if it\n * isn't already visible.\n *\n * @method scrollNotificationIntoView\n * @param {object} notificationElement The jQuery notification element\n */\n ControlArea.prototype.scrollNotificationIntoView = function(notificationElement) {\n var position = notificationElement.position();\n var container = this.getRoot();\n var relativeTop = position.top - container.scrollTop();\n\n // If the element isn't in the view window.\n if (relativeTop > container.innerHeight()) {\n var height = notificationElement.outerHeight();\n // Offset enough to make sure the notification will be in view.\n height = height * 4;\n var scrollTo = position.top - height;\n container.scrollTop(scrollTo);\n }\n };\n\n /**\n * Show the full notification for the given notification element. The notification\n * context is retrieved from the cache and send as data with an event to be\n * rendered in the content area.\n *\n * @method showNotification\n * @param {(int|object)} notificationElement The notification id or jQuery notification element\n */\n ControlArea.prototype.showNotification = function(notificationElement) {\n if (typeof notificationElement !== 'object') {\n // Assume it's an ID if it's not an object.\n notificationElement = this.getNotificationElement(notificationElement);\n }\n\n if (notificationElement && notificationElement.length) {\n this.getRoot().find(SELECTORS.NOTIFICATION).removeClass('selected');\n notificationElement.addClass('selected').find(SELECTORS.CAN_RECEIVE_FOCUS).focus();\n var notificationId = notificationElement.attr('data-id');\n var notification = this.getCacheNotification(notificationId);\n this.scrollNotificationIntoView(notificationElement);\n // Create a new version of the notification to send with the notification so\n // this copy isn't modified.\n this.getContainer().trigger(NotificationAreaEvents.showNotification, [$.extend({}, notification)]);\n }\n };\n\n /**\n * Send a request to mark the notification as read in the server and remove the unread\n * status from the element.\n *\n * @method markNotificationAsRead\n * @param {object} notificationElement The jQuery notification element\n * @return {object} jQuery promise\n */\n ControlArea.prototype.markNotificationAsRead = function(notificationElement) {\n return NotificationRepo.markAsRead(notificationElement.attr('data-id')).done(function() {\n notificationElement.removeClass('unread');\n });\n };\n\n\n /**\n * Render the notification data with the appropriate template and add it to the DOM.\n *\n * @method renderNotifications\n * @param {array} notifications Array of notification data\n * @return {object} jQuery promise that is resolved when all notifications have been\n * rendered and added to the DOM\n */\n ControlArea.prototype.renderNotifications = function(notifications) {\n var promises = [];\n var container = this.getContent();\n\n $.each(notifications, function(index, notification) {\n // Need to remove the contexturl so the item isn't rendered\n // as a link.\n var contextUrl = notification.contexturl;\n delete notification.contexturl;\n\n var promise = Templates.render(TEMPLATES.NOTIFICATION, notification)\n .then(function(html, js) {\n // Restore it for the cache.\n notification.contexturl = contextUrl;\n this.setCacheNotification(notification);\n // Pass the Rendered content out.\n return {html: html, js: js};\n }.bind(this));\n promises.push(promise);\n }.bind(this));\n\n return $.when.apply($, promises).then(function() {\n // Each of the promises in the when will pass its results as an argument to the function.\n // The order of the arguments will be the order that the promises are passed to when()\n // i.e. the first promise's results will be in the first argument.\n $.each(arguments, function(index, argument) {\n container.append(argument.html);\n Templates.runTemplateJS(argument.js);\n });\n return;\n });\n };\n\n /**\n * Load notifications from the server and render them.\n *\n * @method loadMoreNotifications\n * @return {object} jQuery promise\n */\n ControlArea.prototype.loadMoreNotifications = function() {\n if (this.isLoading || this.hasLoadedAllContent()) {\n return $.Deferred().resolve();\n }\n\n this.startLoading();\n var request = {\n limit: this.getLimit(),\n offset: this.getOffset(),\n useridto: this.getUserId(),\n };\n\n if (!this.initialLoad) {\n // If this is the first load we may have been given a non-zero offset,\n // in which case we need to load all notifications preceeding that offset\n // to make sure the full list is rendered.\n request.limit = this.getOffset() + this.getLimit();\n request.offset = 0;\n }\n\n var promise = NotificationRepo.query(request).then(function(result) {\n var notifications = result.notifications;\n this.unreadCount = result.unreadcount;\n this.setLoadedAllContent(!notifications.length || notifications.length < this.getLimit());\n this.initialLoad = true;\n\n if (notifications.length) {\n this.incrementOffset();\n return this.renderNotifications(notifications);\n }\n\n return false;\n }.bind(this))\n .always(function() {\n this.stopLoading();\n }.bind(this));\n\n return promise;\n };\n\n /**\n * Create the event listeners for the control area.\n *\n * @method registerEventListeners\n */\n ControlArea.prototype.registerEventListeners = function() {\n CustomEvents.define(this.getRoot(), [\n CustomEvents.events.activate,\n CustomEvents.events.scrollBottom,\n CustomEvents.events.scrollLock,\n CustomEvents.events.up,\n CustomEvents.events.down,\n ]);\n\n this.getRoot().on(CustomEvents.events.scrollBottom, function() {\n this.loadMoreNotifications();\n }.bind(this));\n\n this.getRoot().on(CustomEvents.events.activate, SELECTORS.NOTIFICATION, function(e) {\n var notificationElement = $(e.target).closest(SELECTORS.NOTIFICATION);\n this.showNotification(notificationElement);\n }.bind(this));\n\n // Show the previous notification in the list.\n this.getRoot().on(CustomEvents.events.up, SELECTORS.NOTIFICATION, function(e, data) {\n var notificationElement = $(e.target).closest(SELECTORS.NOTIFICATION);\n this.showNotification(notificationElement.prev());\n\n data.originalEvent.preventDefault();\n }.bind(this));\n\n // Show the next notification in the list.\n this.getRoot().on(CustomEvents.events.down, SELECTORS.NOTIFICATION, function(e, data) {\n var notificationElement = $(e.target).closest(SELECTORS.NOTIFICATION);\n this.showNotification(notificationElement.next());\n\n data.originalEvent.preventDefault();\n }.bind(this));\n\n this.getContainer().on(NotificationAreaEvents.notificationShown, function(e, notification) {\n if (!notification.read) {\n var element = this.getNotificationElement(notification.id);\n\n if (element) {\n this.markNotificationAsRead(element);\n }\n\n var cachedNotification = this.getCacheNotification(notification.id);\n\n if (cachedNotification) {\n cachedNotification.read = true;\n }\n }\n }.bind(this));\n };\n\n return ControlArea;\n});\n"],"file":"notification_area_control_area.min.js"} \ No newline at end of file diff --git a/message/output/popup/amd/build/notification_area_events.min.js b/message/output/popup/amd/build/notification_area_events.min.js index 5912b546a2679..d977f2a6e4cf7 100644 --- a/message/output/popup/amd/build/notification_area_events.min.js +++ b/message/output/popup/amd/build/notification_area_events.min.js @@ -1,2 +1,2 @@ -define ("message_popup/notification_area_events",[],function(){return{showNotification:"notification-area-events:showNotification",notificationShown:"notification-area-events:notificationShown"}}); +define ("message_popup/notification_area_events",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;a.default={showNotification:"notification-area-events:showNotification",notificationShown:"notification-area-events:notificationShown"};return a.default}); //# sourceMappingURL=notification_area_events.min.js.map diff --git a/message/output/popup/amd/build/notification_area_events.min.js.map b/message/output/popup/amd/build/notification_area_events.min.js.map index cc4f11c435288..d8499517ad075 100644 --- a/message/output/popup/amd/build/notification_area_events.min.js.map +++ b/message/output/popup/amd/build/notification_area_events.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/notification_area_events.js"],"names":["define","showNotification","notificationShown"],"mappings":"AAwBAA,OAAM,0CAAC,EAAD,CAAK,UAAW,CAClB,MAAO,CACHC,gBAAgB,CAAE,2CADf,CAEHC,iBAAiB,CAAE,4CAFhB,CAIV,CALK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the events that can be fired in the notification area on\n * the notifications page.\n *\n * @module message_popup/notification_area_events\n * @class notification_area_events\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([], function() {\n return {\n showNotification: 'notification-area-events:showNotification',\n notificationShown: 'notification-area-events:notificationShown',\n };\n});\n"],"file":"notification_area_events.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/notification_area_events.js"],"names":["showNotification","notificationShown"],"mappings":"kKAuBe,CACXA,gBAAgB,CAAE,2CADP,CAEXC,iBAAiB,CAAE,4CAFR,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the events that can be fired in the notification area on\n * the notifications page.\n *\n * @module message_popup/notification_area_events\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nexport default {\n showNotification: 'notification-area-events:showNotification',\n notificationShown: 'notification-area-events:notificationShown',\n};\n"],"file":"notification_area_events.min.js"} \ No newline at end of file diff --git a/message/output/popup/amd/build/notification_repository.min.js.map b/message/output/popup/amd/build/notification_repository.min.js.map index 3e3b3f591fd15..aa9231966d8a3 100644 --- a/message/output/popup/amd/build/notification_repository.min.js.map +++ b/message/output/popup/amd/build/notification_repository.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/notification_repository.js"],"names":["define","Ajax","Notification","query","args","limit","offset","promise","call","methodname","fail","exception","countUnread","markAllAsRead","markAsRead","id","timeread","notificationid"],"mappings":"AAuBAA,OAAM,yCAAC,CAAC,WAAD,CAAc,mBAAd,CAAD,CAAqC,SAASC,CAAT,CAAeC,CAAf,CAA6B,CA8FpE,MAAO,CACHC,KAAK,CAxFG,QAARA,CAAAA,KAAQ,CAASC,CAAT,CAAe,CACvB,GAA0B,WAAtB,QAAOA,CAAAA,CAAI,CAACC,KAAhB,CAAuC,CACnCD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VL,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CAdsB,CAgBpCG,CAAO,CAACG,IAAR,CAAaR,CAAY,CAACS,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAEM,CAMV,CApGK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Retrieves notifications from the server.\n *\n * @module message_popup/notification_repository\n * @class notification_repository\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['core/ajax', 'core/notification'], function(Ajax, Notification) {\n /**\n * Retrieve a list of notifications from the server.\n *\n * @param {object} args The request arguments\n * @return {object} jQuery promise\n */\n var query = function(args) {\n if (typeof args.limit === 'undefined') {\n args.limit = 20;\n }\n\n if (typeof args.offset === 'undefined') {\n args.offset = 0;\n }\n\n var request = {\n methodname: 'message_popup_get_popup_notifications',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n /**\n * Get the number of unread notifications from the server.\n *\n * @param {object} args The request arguments\n * @return {object} jQuery promise\n */\n var countUnread = function(args) {\n var request = {\n methodname: 'message_popup_get_unread_popup_notification_count',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n /**\n * Mark all notifications for the given user as read.\n *\n * @param {object} args The request arguments:\n * @return {object} jQuery promise\n */\n var markAllAsRead = function(args) {\n var request = {\n methodname: 'core_message_mark_all_notifications_as_read',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n /**\n * Mark a specific notification as read.\n *\n * @param {int} id The notification id\n * @param {int} timeread The read timestamp (optional)\n * @return {object} jQuery promise\n */\n var markAsRead = function(id, timeread) {\n var args = {\n notificationid: id,\n };\n\n if (timeread) {\n args.timeread = timeread;\n }\n\n var request = {\n methodname: 'core_message_mark_notification_read',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n return {\n query: query,\n countUnread: countUnread,\n markAllAsRead: markAllAsRead,\n markAsRead: markAsRead,\n };\n});\n"],"file":"notification_repository.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/notification_repository.js"],"names":["define","Ajax","Notification","query","args","limit","offset","promise","call","methodname","fail","exception","countUnread","markAllAsRead","markAsRead","id","timeread","notificationid"],"mappings":"AAsBAA,OAAM,yCAAC,CAAC,WAAD,CAAc,mBAAd,CAAD,CAAqC,SAASC,CAAT,CAAeC,CAAf,CAA6B,CA8FpE,MAAO,CACHC,KAAK,CAxFG,QAARA,CAAAA,KAAQ,CAASC,CAAT,CAAe,CACvB,GAA0B,WAAtB,QAAOA,CAAAA,CAAI,CAACC,KAAhB,CAAuC,CACnCD,CAAI,CAACC,KAAL,CAAa,EAChB,CAED,GAA2B,WAAvB,QAAOD,CAAAA,CAAI,CAACE,MAAhB,CAAwC,CACpCF,CAAI,CAACE,MAAL,CAAc,CACjB,CAPsB,GAcnBC,CAAAA,CAAO,CAAGN,CAAI,CAACO,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,uCADF,CAEVL,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CAdS,CAgBvBG,CAAO,CAACG,IAAR,CAAaR,CAAY,CAACS,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAoEM,CAEHK,WAAW,CA9DG,QAAdA,CAAAA,WAAc,CAASR,CAAT,CAAe,IAMzBG,CAAAA,CAAO,CAAGN,CAAI,CAACO,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,mDADF,CAEVL,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CANe,CAQ7BG,CAAO,CAACG,IAAR,CAAaR,CAAY,CAACS,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAiDM,CAGHM,aAAa,CA5CG,QAAhBA,CAAAA,aAAgB,CAAST,CAAT,CAAe,IAM3BG,CAAAA,CAAO,CAAGN,CAAI,CAACO,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,6CADF,CAEVL,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CANiB,CAQ/BG,CAAO,CAACG,IAAR,CAAaR,CAAY,CAACS,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CA8BM,CAIHO,UAAU,CAzBG,QAAbA,CAAAA,UAAa,CAASC,CAAT,CAAaC,CAAb,CAAuB,CACpC,GAAIZ,CAAAA,CAAI,CAAG,CACPa,cAAc,CAAEF,CADT,CAAX,CAIA,GAAIC,CAAJ,CAAc,CACVZ,CAAI,CAACY,QAAL,CAAgBA,CACnB,CAPmC,GAchCT,CAAAA,CAAO,CAAGN,CAAI,CAACO,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,qCADF,CAEVL,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CAdsB,CAgBpCG,CAAO,CAACG,IAAR,CAAaR,CAAY,CAACS,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAEM,CAMV,CApGK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Retrieves notifications from the server.\n *\n * @module message_popup/notification_repository\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['core/ajax', 'core/notification'], function(Ajax, Notification) {\n /**\n * Retrieve a list of notifications from the server.\n *\n * @param {object} args The request arguments\n * @return {object} jQuery promise\n */\n var query = function(args) {\n if (typeof args.limit === 'undefined') {\n args.limit = 20;\n }\n\n if (typeof args.offset === 'undefined') {\n args.offset = 0;\n }\n\n var request = {\n methodname: 'message_popup_get_popup_notifications',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n /**\n * Get the number of unread notifications from the server.\n *\n * @param {object} args The request arguments\n * @return {object} jQuery promise\n */\n var countUnread = function(args) {\n var request = {\n methodname: 'message_popup_get_unread_popup_notification_count',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n /**\n * Mark all notifications for the given user as read.\n *\n * @param {object} args The request arguments:\n * @return {object} jQuery promise\n */\n var markAllAsRead = function(args) {\n var request = {\n methodname: 'core_message_mark_all_notifications_as_read',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n /**\n * Mark a specific notification as read.\n *\n * @param {int} id The notification id\n * @param {int} timeread The read timestamp (optional)\n * @return {object} jQuery promise\n */\n var markAsRead = function(id, timeread) {\n var args = {\n notificationid: id,\n };\n\n if (timeread) {\n args.timeread = timeread;\n }\n\n var request = {\n methodname: 'core_message_mark_notification_read',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n return {\n query: query,\n countUnread: countUnread,\n markAllAsRead: markAllAsRead,\n markAsRead: markAsRead,\n };\n});\n"],"file":"notification_repository.min.js"} \ No newline at end of file diff --git a/message/output/popup/amd/src/notification_area_content_area.js b/message/output/popup/amd/src/notification_area_content_area.js index b1b18eeac2c17..a70ee59e769fc 100644 --- a/message/output/popup/amd/src/notification_area_content_area.js +++ b/message/output/popup/amd/src/notification_area_content_area.js @@ -18,7 +18,6 @@ * notification page. * * @module message_popup/notification_area_content_area - * @class notification_area_content_area * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -43,6 +42,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/custom_interactio /** * Constructor for the ContentArea * + * @class * @param {object} root The root element for the content area * @param {int} userId The user id of the current user */ diff --git a/message/output/popup/amd/src/notification_area_control_area.js b/message/output/popup/amd/src/notification_area_control_area.js index 1437256305b00..752fbfd07ae1c 100644 --- a/message/output/popup/amd/src/notification_area_control_area.js +++ b/message/output/popup/amd/src/notification_area_control_area.js @@ -17,7 +17,6 @@ * Controls the notification area on the notification page. * * @module message_popup/notification_area_control_area - * @class notification_area_control_area * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -39,6 +38,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/custom_interactio /** * Constructor for ControlArea * + * @class * @param {object} root The root element for the content area * @param {int} userId The user id of the current user */ diff --git a/message/output/popup/amd/src/notification_area_events.js b/message/output/popup/amd/src/notification_area_events.js index 3722df4ccc10a..8ea4f0a7c9f5a 100644 --- a/message/output/popup/amd/src/notification_area_events.js +++ b/message/output/popup/amd/src/notification_area_events.js @@ -18,13 +18,10 @@ * the notifications page. * * @module message_popup/notification_area_events - * @class notification_area_events * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -define([], function() { - return { - showNotification: 'notification-area-events:showNotification', - notificationShown: 'notification-area-events:notificationShown', - }; -}); +export default { + showNotification: 'notification-area-events:showNotification', + notificationShown: 'notification-area-events:notificationShown', +}; diff --git a/message/output/popup/amd/src/notification_repository.js b/message/output/popup/amd/src/notification_repository.js index 99c7b2a1883e0..cc87597ed0345 100644 --- a/message/output/popup/amd/src/notification_repository.js +++ b/message/output/popup/amd/src/notification_repository.js @@ -17,7 +17,6 @@ * Retrieves notifications from the server. * * @module message_popup/notification_repository - * @class notification_repository * @copyright 2016 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/mod/assign/amd/build/grading_actions.min.js.map b/mod/assign/amd/build/grading_actions.min.js.map index 8fdb2f68a005c..ef4f7a365b76f 100644 --- a/mod/assign/amd/build/grading_actions.min.js.map +++ b/mod/assign/amd/build/grading_actions.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/grading_actions.js"],"names":["define","$","GradingEvents","GradingActions","selector","_regionSelector","_region","registerEventListeners","prototype","_lastUserId","_showActionsForm","event","userid","form","find","removeClass","addClass","_trigger","action","document","trigger","getReviewPanelElement","hasReviewPanelElement","length","getCollapseGradePanelButton","getCollapseReviewPanelButton","getExpandAllPanelsButton","resetLayoutButtons","collapseReviewPanel","COLLAPSE_REVIEW_PANEL","EXPAND_GRADE_PANEL","collapseGradePanel","COLLAPSE_GRADE_PANEL","EXPAND_REVIEW_PANEL","expandAllPanels","collapseReviewPanelButton","click","e","preventDefault","bind","keydown","metaKey","shiftKey","altKey","ctrlKey","keyCode","collapseGradePanelButton","expandAllPanelsButton","on"],"mappings":"AAwBAA,OAAM,8BAAC,CAAC,QAAD,CAAW,2BAAX,CAAD,CAA0C,SAASC,CAAT,CAAYC,CAAZ,CAA2B,CAQvE,GAAIC,CAAAA,CAAc,CAAG,SAASC,CAAT,CAAmB,CACpC,KAAKC,eAAL,CAAuBD,CAAvB,CACA,KAAKE,OAAL,CAAeL,CAAC,CAACG,CAAD,CAAhB,CAEA,KAAKG,sBAAL,EACH,CALD,CAQAJ,CAAc,CAACK,SAAf,CAAyBH,eAAzB,CAA2C,IAA3C,CAGAF,CAAc,CAACK,SAAf,CAAyBC,WAAzB,CAAuC,CAAvC,CAGAN,CAAc,CAACK,SAAf,CAAyBF,OAAzB,C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n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for the \"Actions\" panel at the bottom of the page.\n *\n * @module mod_assign/grading_actions\n * @class GradingActions\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'mod_assign/grading_events'], function($, GradingEvents) {\n\n /**\n * GradingActions class.\n *\n * @class GradingActions\n * @param {String} selector The selector for the page region containing the actions panel.\n */\n var GradingActions = function(selector) {\n this._regionSelector = selector;\n this._region = $(selector);\n\n this.registerEventListeners();\n };\n\n /** @property {String} Selector for the page region containing the user navigation. */\n GradingActions.prototype._regionSelector = null;\n\n /** @property {Integer} Remember the last user id to prevent unnessecary reloads. */\n GradingActions.prototype._lastUserId = 0;\n\n /** @property {JQuery} JQuery node for the page region containing the user navigation. */\n GradingActions.prototype._region = null;\n\n /**\n * Show the actions if there is valid user.\n *\n * @method _showActionsForm\n * @private\n * @param {Event} event\n * @param {Integer} userid\n */\n GradingActions.prototype._showActionsForm = function(event, userid) {\n var form = this._region.find('[data-region=grading-actions-form]');\n\n if (userid != this._lastUserId && userid > 0) {\n this._lastUserId = userid;\n }\n if (userid > 0) {\n form.removeClass('hide');\n } else {\n form.addClass('hide');\n }\n\n };\n\n /**\n * Trigger the named action.\n *\n * @method _trigger\n * @private\n * @param {String} action\n */\n GradingActions.prototype._trigger = function(action) {\n $(document).trigger(action);\n };\n\n /**\n * Get the review panel element.\n *\n * @method getReviewPanelElement\n * @return {jQuery}\n */\n GradingActions.prototype.getReviewPanelElement = function() {\n return $('[data-region=\"review-panel\"]');\n };\n\n /**\n * Check if the page has a review panel.\n *\n * @method hasReviewPanelElement\n * @return {bool}\n */\n GradingActions.prototype.hasReviewPanelElement = function() {\n return this.getReviewPanelElement().length > 0;\n };\n\n /**\n * Get the collapse grade panel button.\n *\n * @method getCollapseGradePanelButton\n * @return {jQuery}\n */\n GradingActions.prototype.getCollapseGradePanelButton = function() {\n return $('[data-region=\"grade-actions\"] .collapse-grade-panel');\n };\n\n /**\n * Get the collapse review panel button.\n *\n * @method getCollapseReviewPanelButton\n * @return {jQuery}\n */\n GradingActions.prototype.getCollapseReviewPanelButton = function() {\n return $('[data-region=\"grade-actions\"] .collapse-review-panel');\n };\n\n /**\n * Get the expand all panels button.\n *\n * @method getExpandAllPanelsButton\n * @return {jQuery}\n */\n GradingActions.prototype.getExpandAllPanelsButton = function() {\n return $('[data-region=\"grade-actions\"] .collapse-none');\n };\n\n /**\n * Remove the active state from all layout buttons.\n *\n * @method resetLayoutButtons\n */\n GradingActions.prototype.resetLayoutButtons = function() {\n this.getCollapseGradePanelButton().removeClass('active');\n this.getCollapseReviewPanelButton().removeClass('active');\n this.getExpandAllPanelsButton().removeClass('active');\n };\n\n /**\n * Hide the review panel.\n *\n * @method collapseReviewPanel\n */\n GradingActions.prototype.collapseReviewPanel = function() {\n $(document).trigger(GradingEvents.COLLAPSE_REVIEW_PANEL);\n $(document).trigger(GradingEvents.EXPAND_GRADE_PANEL);\n this.resetLayoutButtons();\n this.getCollapseReviewPanelButton().addClass('active');\n };\n\n /**\n * Show/Hide the grade panel.\n *\n * @method collapseGradePanel\n */\n GradingActions.prototype.collapseGradePanel = function() {\n $(document).trigger(GradingEvents.COLLAPSE_GRADE_PANEL);\n $(document).trigger(GradingEvents.EXPAND_REVIEW_PANEL);\n this.resetLayoutButtons();\n this.getCollapseGradePanelButton().addClass('active');\n };\n\n /**\n * Return the layout to default.\n *\n * @method expandAllPanels\n */\n GradingActions.prototype.expandAllPanels = function() {\n $(document).trigger(GradingEvents.EXPAND_GRADE_PANEL);\n $(document).trigger(GradingEvents.EXPAND_REVIEW_PANEL);\n this.resetLayoutButtons();\n this.getExpandAllPanelsButton().addClass('active');\n };\n\n /**\n * Register event listeners for the grade panel.\n *\n * @method registerEventListeners\n */\n GradingActions.prototype.registerEventListeners = function() {\n // Don't need layout controls if there is no review panel.\n if (this.hasReviewPanelElement()) {\n var collapseReviewPanelButton = this.getCollapseReviewPanelButton();\n collapseReviewPanelButton.click(function(e) {\n this.collapseReviewPanel();\n e.preventDefault();\n }.bind(this));\n\n collapseReviewPanelButton.keydown(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.collapseReviewPanel();\n e.preventDefault();\n }\n }\n }.bind(this));\n\n var collapseGradePanelButton = this.getCollapseGradePanelButton();\n collapseGradePanelButton.click(function(e) {\n this.collapseGradePanel();\n e.preventDefault();\n }.bind(this));\n\n collapseGradePanelButton.keydown(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.collapseGradePanel();\n e.preventDefault();\n }\n }\n }.bind(this));\n\n var expandAllPanelsButton = this.getExpandAllPanelsButton();\n expandAllPanelsButton.click(function(e) {\n this.expandAllPanels();\n e.preventDefault();\n }.bind(this));\n\n expandAllPanelsButton.keydown(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.expandAllPanels();\n e.preventDefault();\n }\n }\n }.bind(this));\n }\n\n $(document).on('user-changed', this._showActionsForm.bind(this));\n\n this._region.find('[name=\"savechanges\"]').on('click', this._trigger.bind(this, 'save-changes'));\n this._region.find('[name=\"saveandshownext\"]').on('click', this._trigger.bind(this, 'save-and-show-next'));\n this._region.find('[name=\"resetbutton\"]').on('click', this._trigger.bind(this, 'reset'));\n this._region.find('form').on('submit', function(e) {\n e.preventDefault();\n });\n };\n\n return GradingActions;\n});\n"],"file":"grading_actions.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/grading_actions.js"],"names":["define","$","GradingEvents","GradingActions","selector","_regionSelector","_region","registerEventListeners","prototype","_lastUserId","_showActionsForm","event","userid","form","find","removeClass","addClass","_trigger","action","document","trigger","getReviewPanelElement","hasReviewPanelElement","length","getCollapseGradePanelButton","getCollapseReviewPanelButton","getExpandAllPanelsButton","resetLayoutButtons","collapseReviewPanel","COLLAPSE_REVIEW_PANEL","EXPAND_GRADE_PANEL","collapseGradePanel","COLLAPSE_GRADE_PANEL","EXPAND_REVIEW_PANEL","expandAllPanels","collapseReviewPanelButton","click","e","preventDefault","bind","keydown","metaKey","shiftKey","altKey","ctrlKey","keyCode","collapseGradePanelButton","expandAllPanelsButton","on"],"mappings":"AAuBAA,OAAM,8BAAC,CAAC,QAAD,CAAW,2BAAX,CAAD,CAA0C,SAASC,CAAT,CAAYC,CAAZ,CAA2B,CAQvE,GAAIC,CAAAA,CAAc,CAAG,SAASC,CAAT,CAAmB,CACpC,KAAKC,eAAL,CAAuBD,CAAvB,CACA,KAAKE,OAAL,CAAeL,CAAC,CAACG,CAAD,CAAhB,CAEA,KAAKG,sBAAL,EACH,CALD,CAQAJ,CAAc,CAACK,SAAf,CAAyBH,eAAzB,CAA2C,IAA3C,CAGAF,CAAc,CAACK,SAAf,CAAyBC,WAAzB,CAAuC,CAAvC,CAGAN,CAAc,CAACK,SAAf,CAAyBF,OAAzB,CAAmC,IAAnC,CAUAH,CAAc,CAACK,SAAf,CAAyBE,gBAAzB,CAA4C,SAASC,CAAT,CAAgBC,CAAhB,CAAwB,CAChE,GAAIC,CAAAA,CAAI,CAAG,KAAKP,OAAL,CAAaQ,IAAb,CAAkB,oCAAlB,CAAX,CAEA,GAAIF,CAAM,EAAI,KAAKH,WAAf,EAAuC,CAAT,CAAAG,CAAlC,CAA8C,CAC1C,KAAKH,WAAL,CAAmBG,CACtB,CACD,GAAa,CAAT,CAAAA,CA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KAAKX,eAAL,GACAG,CAAC,CAACC,cAAF,EACH,CACJ,CACJ,CAP6B,CAO5BC,IAP4B,CAOvB,IAPuB,CAA9B,CAQH,CAEDtC,CAAC,CAACkB,QAAD,CAAD,CAAY6B,EAAZ,CAAe,cAAf,CAA+B,KAAKtC,gBAAL,CAAsB6B,IAAtB,CAA2B,IAA3B,CAA/B,EAEA,KAAKjC,OAAL,CAAaQ,IAAb,CAAkB,wBAAlB,EAA0CkC,EAA1C,CAA6C,OAA7C,CAAsD,KAAK/B,QAAL,CAAcsB,IAAd,CAAmB,IAAnB,CAAyB,cAAzB,CAAtD,EACA,KAAKjC,OAAL,CAAaQ,IAAb,CAAkB,4BAAlB,EAA8CkC,EAA9C,CAAiD,OAAjD,CAA0D,KAAK/B,QAAL,CAAcsB,IAAd,CAAmB,IAAnB,CAAyB,oBAAzB,CAA1D,EACA,KAAKjC,OAAL,CAAaQ,IAAb,CAAkB,wBAAlB,EAA0CkC,EAA1C,CAA6C,OAA7C,CAAsD,KAAK/B,QAAL,CAAcsB,IAAd,CAAmB,IAAnB,CAAyB,OAAzB,CAAtD,EACA,KAAKjC,OAAL,CAAaQ,IAAb,CAAkB,MAAlB,EAA0BkC,EAA1B,CAA6B,QAA7B,CAAuC,SAASX,CAAT,CAAY,CAC/CA,CAAC,CAACC,cAAF,EACH,CAFD,CAGH,CAzDD,CA2DA,MAAOnC,CAAAA,CACV,CA3NK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for the \"Actions\" panel at the bottom of the page.\n *\n * @module mod_assign/grading_actions\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'mod_assign/grading_events'], function($, GradingEvents) {\n\n /**\n * GradingActions class.\n *\n * @class mod_assign/grading_actions\n * @param {String} selector The selector for the page region containing the actions panel.\n */\n var GradingActions = function(selector) {\n this._regionSelector = selector;\n this._region = $(selector);\n\n this.registerEventListeners();\n };\n\n /** @property {String} Selector for the page region containing the user navigation. */\n GradingActions.prototype._regionSelector = null;\n\n /** @property {Integer} Remember the last user id to prevent unnessecary reloads. */\n GradingActions.prototype._lastUserId = 0;\n\n /** @property {JQuery} JQuery node for the page region containing the user navigation. */\n GradingActions.prototype._region = null;\n\n /**\n * Show the actions if there is valid user.\n *\n * @method _showActionsForm\n * @private\n * @param {Event} event\n * @param {Integer} userid\n */\n GradingActions.prototype._showActionsForm = function(event, userid) {\n var form = this._region.find('[data-region=grading-actions-form]');\n\n if (userid != this._lastUserId && userid > 0) {\n this._lastUserId = userid;\n }\n if (userid > 0) {\n form.removeClass('hide');\n } else {\n form.addClass('hide');\n }\n\n };\n\n /**\n * Trigger the named action.\n *\n * @method _trigger\n * @private\n * @param {String} action\n */\n GradingActions.prototype._trigger = function(action) {\n $(document).trigger(action);\n };\n\n /**\n * Get the review panel element.\n *\n * @method getReviewPanelElement\n * @return {jQuery}\n */\n GradingActions.prototype.getReviewPanelElement = function() {\n return $('[data-region=\"review-panel\"]');\n };\n\n /**\n * Check if the page has a review panel.\n *\n * @method hasReviewPanelElement\n * @return {bool}\n */\n GradingActions.prototype.hasReviewPanelElement = function() {\n return this.getReviewPanelElement().length > 0;\n };\n\n /**\n * Get the collapse grade panel button.\n *\n * @method getCollapseGradePanelButton\n * @return {jQuery}\n */\n GradingActions.prototype.getCollapseGradePanelButton = function() {\n return $('[data-region=\"grade-actions\"] .collapse-grade-panel');\n };\n\n /**\n * Get the collapse review panel button.\n *\n * @method getCollapseReviewPanelButton\n * @return {jQuery}\n */\n GradingActions.prototype.getCollapseReviewPanelButton = function() {\n return $('[data-region=\"grade-actions\"] .collapse-review-panel');\n };\n\n /**\n * Get the expand all panels button.\n *\n * @method getExpandAllPanelsButton\n * @return {jQuery}\n */\n GradingActions.prototype.getExpandAllPanelsButton = function() {\n return $('[data-region=\"grade-actions\"] .collapse-none');\n };\n\n /**\n * Remove the active state from all layout buttons.\n *\n * @method resetLayoutButtons\n */\n GradingActions.prototype.resetLayoutButtons = function() {\n this.getCollapseGradePanelButton().removeClass('active');\n this.getCollapseReviewPanelButton().removeClass('active');\n this.getExpandAllPanelsButton().removeClass('active');\n };\n\n /**\n * Hide the review panel.\n *\n * @method collapseReviewPanel\n */\n GradingActions.prototype.collapseReviewPanel = function() {\n $(document).trigger(GradingEvents.COLLAPSE_REVIEW_PANEL);\n $(document).trigger(GradingEvents.EXPAND_GRADE_PANEL);\n this.resetLayoutButtons();\n this.getCollapseReviewPanelButton().addClass('active');\n };\n\n /**\n * Show/Hide the grade panel.\n *\n * @method collapseGradePanel\n */\n GradingActions.prototype.collapseGradePanel = function() {\n $(document).trigger(GradingEvents.COLLAPSE_GRADE_PANEL);\n $(document).trigger(GradingEvents.EXPAND_REVIEW_PANEL);\n this.resetLayoutButtons();\n this.getCollapseGradePanelButton().addClass('active');\n };\n\n /**\n * Return the layout to default.\n *\n * @method expandAllPanels\n */\n GradingActions.prototype.expandAllPanels = function() {\n $(document).trigger(GradingEvents.EXPAND_GRADE_PANEL);\n $(document).trigger(GradingEvents.EXPAND_REVIEW_PANEL);\n this.resetLayoutButtons();\n this.getExpandAllPanelsButton().addClass('active');\n };\n\n /**\n * Register event listeners for the grade panel.\n *\n * @method registerEventListeners\n */\n GradingActions.prototype.registerEventListeners = function() {\n // Don't need layout controls if there is no review panel.\n if (this.hasReviewPanelElement()) {\n var collapseReviewPanelButton = this.getCollapseReviewPanelButton();\n collapseReviewPanelButton.click(function(e) {\n this.collapseReviewPanel();\n e.preventDefault();\n }.bind(this));\n\n collapseReviewPanelButton.keydown(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.collapseReviewPanel();\n e.preventDefault();\n }\n }\n }.bind(this));\n\n var collapseGradePanelButton = this.getCollapseGradePanelButton();\n collapseGradePanelButton.click(function(e) {\n this.collapseGradePanel();\n e.preventDefault();\n }.bind(this));\n\n collapseGradePanelButton.keydown(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.collapseGradePanel();\n e.preventDefault();\n }\n }\n }.bind(this));\n\n var expandAllPanelsButton = this.getExpandAllPanelsButton();\n expandAllPanelsButton.click(function(e) {\n this.expandAllPanels();\n e.preventDefault();\n }.bind(this));\n\n expandAllPanelsButton.keydown(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.expandAllPanels();\n e.preventDefault();\n }\n }\n }.bind(this));\n }\n\n $(document).on('user-changed', this._showActionsForm.bind(this));\n\n this._region.find('[name=\"savechanges\"]').on('click', this._trigger.bind(this, 'save-changes'));\n this._region.find('[name=\"saveandshownext\"]').on('click', this._trigger.bind(this, 'save-and-show-next'));\n this._region.find('[name=\"resetbutton\"]').on('click', this._trigger.bind(this, 'reset'));\n this._region.find('form').on('submit', function(e) {\n e.preventDefault();\n });\n };\n\n return GradingActions;\n});\n"],"file":"grading_actions.min.js"} \ No newline at end of file diff --git a/mod/assign/amd/build/grading_form_change_checker.min.js.map b/mod/assign/amd/build/grading_form_change_checker.min.js.map index 1ef64096b5e0b..a3dab9899f270 100644 --- a/mod/assign/amd/build/grading_form_change_checker.min.js.map +++ b/mod/assign/amd/build/grading_form_change_checker.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/grading_form_change_checker.js"],"names":["define","$","saveFormState","selector","trigger","data","serialize","checkFormForChanges","previousdata"],"mappings":"AAuBAA,OAAM,0CAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAE3B,MAAmE,CAO/DC,aAAa,CAAE,uBAASC,CAAT,CAAmB,CAC9BF,CAAC,CAACE,CAAD,CAAD,CAAYC,OAAZ,CAAoB,iBAApB,EACA,GAAIC,CAAAA,CAAI,CAAGJ,CAAC,CAACE,CAAD,CAAD,CAAYG,SAAZ,EAAX,CACAL,CAAC,CAACE,CAAD,CAAD,CAAYE,IAAZ,CAAiB,kBAAjB,CAAqCA,CAArC,CACH,CAX8D,CAoB/DE,mBAAmB,CAAE,6BAASJ,CAAT,CAAmB,CAEpCF,CAAC,CAACE,CAAD,CAAD,CAAYC,OAAZ,CAAoB,iBAApB,EAEA,GAAIC,CAAAA,CAAI,CAAGJ,CAAC,CAACE,CAAD,CAAD,CAAYG,SAAZ,EAAX,CACIE,CAAY,CAAGP,CAAC,CAACE,CAAD,CAAD,CAAYE,IAAZ,CAAiB,kBAAjB,CADnB,CAGA,GAA4B,WAAxB,QAAOG,CAAAA,CAAX,CAAyC,CACrC,QACH,CACD,MAAQA,CAAAA,CAAY,EAAIH,CAC3B,CA/B8D,CAiCtE,CAnCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Simple method to check for changes to a form between two points in time.\n *\n * @module mod_assign/grading_form_change_checker\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery'], function($) {\n\n return /** @alias module:mod_assign/grading_form_change_checker */ {\n /**\n * Save the values in the form to a data attribute so they can be compared later for changes.\n *\n * @method saveFormState\n * @param {String} selector The selector for the form element.\n */\n saveFormState: function(selector) {\n $(selector).trigger('save-form-state');\n var data = $(selector).serialize();\n $(selector).data('saved-form-state', data);\n },\n\n /**\n * Compare the current values in the form to the previously saved state.\n *\n * @method checkFormForChanges\n * @param {String} selector The selector for the form element.\n * @return {Boolean} True if there are changes to the form data.\n */\n checkFormForChanges: function(selector) {\n\n $(selector).trigger('save-form-state');\n\n var data = $(selector).serialize(),\n previousdata = $(selector).data('saved-form-state');\n\n if (typeof previousdata === 'undefined') {\n return false;\n }\n return (previousdata != data);\n }\n };\n});\n"],"file":"grading_form_change_checker.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/grading_form_change_checker.js"],"names":["define","$","saveFormState","selector","trigger","data","serialize","checkFormForChanges","previousdata"],"mappings":"AAuBAA,OAAM,0CAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAE3B,MAAO,CAOHC,aAAa,CAAE,uBAASC,CAAT,CAAmB,CAC9BF,CAAC,CAACE,CAAD,CAAD,CAAYC,OAAZ,CAAoB,iBAApB,EACA,GAAIC,CAAAA,CAAI,CAAGJ,CAAC,CAACE,CAAD,CAAD,CAAYG,SAAZ,EAAX,CACAL,CAAC,CAACE,CAAD,CAAD,CAAYE,IAAZ,CAAiB,kBAAjB,CAAqCA,CAArC,CACH,CAXE,CAoBHE,mBAAmB,CAAE,6BAASJ,CAAT,CAAmB,CAEpCF,CAAC,CAACE,CAAD,CAAD,CAAYC,OAAZ,CAAoB,iBAApB,EAEA,GAAIC,CAAAA,CAAI,CAAGJ,CAAC,CAACE,CAAD,CAAD,CAAYG,SAAZ,EAAX,CACIE,CAAY,CAAGP,CAAC,CAACE,CAAD,CAAD,CAAYE,IAAZ,CAAiB,kBAAjB,CADnB,CAGA,GAA4B,WAAxB,QAAOG,CAAAA,CAAX,CAAyC,CACrC,QACH,CACD,MAAQA,CAAAA,CAAY,EAAIH,CAC3B,CA/BE,CAiCV,CAnCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Simple method to check for changes to a form between two points in time.\n *\n * @module mod_assign/grading_form_change_checker\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery'], function($) {\n\n return {\n /**\n * Save the values in the form to a data attribute so they can be compared later for changes.\n *\n * @method saveFormState\n * @param {String} selector The selector for the form element.\n */\n saveFormState: function(selector) {\n $(selector).trigger('save-form-state');\n var data = $(selector).serialize();\n $(selector).data('saved-form-state', data);\n },\n\n /**\n * Compare the current values in the form to the previously saved state.\n *\n * @method checkFormForChanges\n * @param {String} selector The selector for the form element.\n * @return {Boolean} True if there are changes to the form data.\n */\n checkFormForChanges: function(selector) {\n\n $(selector).trigger('save-form-state');\n\n var data = $(selector).serialize(),\n previousdata = $(selector).data('saved-form-state');\n\n if (typeof previousdata === 'undefined') {\n return false;\n }\n return (previousdata != data);\n }\n };\n});\n"],"file":"grading_form_change_checker.min.js"} \ No newline at end of file diff --git a/mod/assign/amd/build/grading_navigation.min.js.map b/mod/assign/amd/build/grading_navigation.min.js.map index a0b3ca6e72ce7..710d94c16ea7d 100644 --- a/mod/assign/amd/build/grading_navigation.min.js.map +++ b/mod/assign/amd/build/grading_navigation.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/grading_navigation.js"],"names":["define","$","notification","str","autocomplete","ajax","checker","GradingNavigation","selector","_regionSelector","_region","_filters","_users","_filteredUsers","_lastXofYUpdate","_firstLoadUsers","_loadAllUsers","find","on","_handlePreviousUser","bind","_handleNextUser","_handleChangeUser","_toggleExpandFilters","document","_refreshSelector","toggleLink","configPanel","getElementById","attr","_filterChanged","userid","data","_selectUserById","get_string","done","s","enhance","fail","exception","_isLoading","prototype","_lastFilters","select","assignmentid","groupid","filterPanel","filter","val","workflowFilter","markerFilter","call","methodname","args","assignid","onlyids","tablesort","_usersLoaded","users","length","trigger","_selectNoUser","_triggerNextUserEvent","_checkClickOutsideConfigureFilters","event","is","target","has","hide","unbind","_updateFilterPreferences","userId","filterList","preferenceNames","preferences","i","deferred","Deferred","resolve","newValue","push","name","value","filters","each","idx","ele","element","prop","filterlist","text","join","currentUserID","parseInt","foundIndex","index","user","id","_refreshCount","checkFormForChanges","get_strings","key","component","strs","confirm","useridnumber","isNaN","preventDefault","closest","expanded","css","stopPropagation","e","currentUserId","currentIndex","count","newIndex","saved","_setCountString","x","y","updateNumber","show","url","URL","window","location","searchParams","get","newid","recordid","set","history","replaceState","nextUserId","nextUser"],"mappings":"AAuBAA,OAAM,iCAAC,CAAC,QAAD,CAAW,mBAAX,CAAgC,UAAhC,CAA4C,wBAA5C,CACC,WADD,CACc,wCADd,CAAD,CAEC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAA+BC,CAA/B,CAA6CC,CAA7C,CAAmDC,CAAnD,CAA4D,CAQ/D,GAAIC,CAAAA,CAAiB,CAAG,SAASC,CAAT,CAAmB,CACvC,KAAKC,eAAL,CAAuBD,CAAvB,CACA,KAAKE,OAAL,CAAeT,CAAC,CAACO,CAAD,CAAhB,CACA,KAAKG,QAAL,CAAgB,EAAhB,CACA,KAAKC,MAAL,CAAc,EAAd,CACA,KAAKC,cAAL,CAAsB,EAAtB,CACA,KAAKC,eAAL,CAAuB,CAAvB,CACA,KAAKC,eAAL,IAGA,KAAKC,aAAL,GAKA,KAAKN,OAAL,CAAaO,IAAb,CAAkB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G,CAAE,wBAAN,CAAgCC,SAAS,CAAE,YAA3C,CAFY,CAGZ,CAACD,GAAG,CAAE,iBAAN,CAAyBC,SAAS,CAAE,YAApC,CAHY,CAIZ,CAACD,GAAG,CAAE,QAAN,CAAgBC,SAAS,CAAE,MAA3B,CAJY,CAAhB,EAKGnE,IALH,CAKQ,SAASoE,CAAT,CAAe,CACnBrG,CAAY,CAACsG,OAAb,CAAqBD,CAAI,CAAC,CAAD,CAAzB,CAA8BA,CAAI,CAAC,CAAD,CAAlC,CAAuCA,CAAI,CAAC,CAAD,CAA3C,CAAgDA,CAAI,CAAC,CAAD,CAApD,CAAyD,UAAW,CAChEtG,CAAC,CAACuB,QAAD,CAAD,CAAYoC,OAAZ,CAAoB,cAApB,CAAoC7B,CAApC,CACH,CAFD,CAGH,CATD,CAUH,CAZD,IAYO,CACH,GAAI,CAAC2E,KAAK,CAAC3E,CAAD,CAAN,EAA2B,CAAT,CAAAA,CAAtB,CAAkC,CAC9BY,CAAM,CAACd,IAAP,CAAY,eAAZ,CAA6BE,CAA7B,EAEA9B,CAAC,CAACuB,QAAD,CAAD,CAAYoC,OAAZ,CAAoB,cAApB,CAAoC7B,CAApC,CACH,CACJ,CACJ,CA1BD,CA4BA,MAAOxB,CAAAA,CACV,CAliBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript to handle changing users via the user selector in the header.\n *\n * @module mod_assign/grading_navigation\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',\n 'core/ajax', 'mod_assign/grading_form_change_checker'],\n function($, notification, str, autocomplete, ajax, checker) {\n\n /**\n * GradingNavigation class.\n *\n * @class GradingNavigation\n * @param {String} selector The selector for the page region containing the user navigation.\n */\n var GradingNavigation = function(selector) {\n this._regionSelector = selector;\n this._region = $(selector);\n this._filters = [];\n this._users = [];\n this._filteredUsers = [];\n this._lastXofYUpdate = 0;\n this._firstLoadUsers = true;\n\n // Get the current user list from a webservice.\n this._loadAllUsers();\n\n // We do not allow navigation while ajax requests are pending.\n // Attach listeners to the select and arrow buttons.\n\n this._region.find('[data-action=\"previous-user\"]').on('click', this._handlePreviousUser.bind(this));\n this._region.find('[data-action=\"next-user\"]').on('click', this._handleNextUser.bind(this));\n this._region.find('[data-action=\"change-user\"]').on('change', this._handleChangeUser.bind(this));\n this._region.find('[data-region=\"user-filters\"]').on('click', this._toggleExpandFilters.bind(this));\n\n $(document).on('user-changed', this._refreshSelector.bind(this));\n $(document).on('done-saving-show-next', this._handleNextUser.bind(this));\n\n // Position the configure filters panel under the link that expands it.\n var toggleLink = this._region.find('[data-region=\"user-filters\"]');\n var configPanel = $(document.getElementById(toggleLink.attr('aria-controls')));\n\n configPanel.on('change', 'select', this._filterChanged.bind(this));\n\n var userid = $('[data-region=\"grading-navigation-panel\"]').data('first-userid');\n if (userid) {\n this._selectUserById(userid);\n }\n\n str.get_string('changeuser', 'mod_assign').done(function(s) {\n autocomplete.enhance('[data-action=change-user]', false, 'mod_assign/participant_selector', s);\n }\n ).fail(notification.exception);\n\n $(document).bind(\"start-loading-user\", function() {\n this._isLoading = true;\n }.bind(this));\n $(document).bind(\"finish-loading-user\", function() {\n this._isLoading = false;\n }.bind(this));\n };\n\n /** @property {Boolean} Boolean tracking active ajax requests. */\n GradingNavigation.prototype._isLoading = false;\n\n /** @property {String} Selector for the page region containing the user navigation. */\n GradingNavigation.prototype._regionSelector = null;\n\n /** @property {Array} The list of active filter keys */\n GradingNavigation.prototype._filters = null;\n\n /** @property {Array} The list of users */\n GradingNavigation.prototype._users = null;\n\n /** @property {JQuery} JQuery node for the page region containing the user navigation. */\n GradingNavigation.prototype._region = null;\n\n /** @property {String} Last active filters */\n GradingNavigation.prototype._lastFilters = '';\n\n /**\n * Load the list of all users for this assignment.\n *\n * @private\n * @method _loadAllUsers\n * @return {Boolean} True if the user list was fetched.\n */\n GradingNavigation.prototype._loadAllUsers = function() {\n var select = this._region.find('[data-action=change-user]');\n var assignmentid = select.attr('data-assignmentid');\n var groupid = select.attr('data-groupid');\n\n var filterPanel = this._region.find('[data-region=\"configure-filters\"]');\n var filter = filterPanel.find('select[name=\"filter\"]').val();\n var workflowFilter = filterPanel.find('select[name=\"workflowfilter\"]');\n if (workflowFilter) {\n filter += ',' + workflowFilter.val();\n }\n var markerFilter = filterPanel.find('select[name=\"markerfilter\"]');\n if (markerFilter) {\n filter += ',' + markerFilter.val();\n }\n\n if (this._lastFilters == filter) {\n return false;\n }\n this._lastFilters = filter;\n\n ajax.call([{\n methodname: 'mod_assign_list_participants',\n args: {assignid: assignmentid, groupid: groupid, filter: '', onlyids: true, tablesort: true},\n done: this._usersLoaded.bind(this),\n fail: notification.exception\n }]);\n return true;\n };\n\n /**\n * Call back to rebuild the user selector and x of y info when the user list is updated.\n *\n * @private\n * @method _usersLoaded\n * @param {Array} users\n */\n GradingNavigation.prototype._usersLoaded = function(users) {\n this._firstLoadUsers = false;\n this._filteredUsers = this._users = users;\n if (this._users.length) {\n // Position the configure filters panel under the link that expands it.\n var toggleLink = this._region.find('[data-region=\"user-filters\"]');\n var configPanel = $(document.getElementById(toggleLink.attr('aria-controls')));\n\n configPanel.find('select[name=\"filter\"]').trigger('change');\n } else {\n this._selectNoUser();\n }\n this._triggerNextUserEvent();\n };\n\n /**\n * Close the configure filters panel if a click is detected outside of it.\n *\n * @private\n * @method _checkClickOutsideConfigureFilters\n * @param {Event} event\n */\n GradingNavigation.prototype._checkClickOutsideConfigureFilters = function(event) {\n var configPanel = this._region.find('[data-region=\"configure-filters\"]');\n\n if (!configPanel.is(event.target) && configPanel.has(event.target).length === 0) {\n var toggleLink = this._region.find('[data-region=\"user-filters\"]');\n\n configPanel.hide();\n configPanel.attr('aria-hidden', 'true');\n toggleLink.attr('aria-expanded', 'false');\n $(document).unbind('click.mod_assign_grading_navigation');\n }\n };\n\n /**\n * Close the configure filters panel if a click is detected outside of it.\n *\n * @private\n * @method _updateFilterPreference\n * @param {Number} userId The current user id.\n * @param {Array} filterList The list of current filter values.\n * @param {Array} preferenceNames The names of the preferences to update\n * @return {Promise} Resolved when all the preferences are updated.\n */\n GradingNavigation.prototype._updateFilterPreferences = function(userId, filterList, preferenceNames) {\n var preferences = [],\n i = 0;\n\n if (filterList.length == 0 || this._firstLoadUsers) {\n // Nothing to update.\n var deferred = $.Deferred();\n deferred.resolve();\n return deferred;\n }\n // General filter.\n // Set the user preferences to the current filters.\n for (i = 0; i < filterList.length; i++) {\n var newValue = filterList[i];\n if (newValue == 'none') {\n newValue = '';\n }\n\n preferences.push({\n userid: userId,\n name: preferenceNames[i],\n value: newValue\n });\n }\n\n return ajax.call([{\n methodname: 'core_user_set_user_preferences',\n args: {\n preferences: preferences\n }\n }])[0];\n };\n /**\n * Turn a filter on or off.\n *\n * @private\n * @method _filterChanged\n * @param {Event} event\n */\n GradingNavigation.prototype._filterChanged = function() {\n // There are 3 types of filter right now.\n var filterPanel = this._region.find('[data-region=\"configure-filters\"]');\n var filters = filterPanel.find('select');\n var preferenceNames = [];\n\n this._filters = [];\n filters.each(function(idx, ele) {\n var element = $(ele);\n this._filters.push(element.val());\n preferenceNames.push('assign_' + element.prop('name'));\n }.bind(this));\n\n // Update the active filter string.\n var filterlist = [];\n filterPanel.find('option:checked').each(function(idx, ele) {\n filterlist[filterlist.length] = $(ele).text();\n });\n if (filterlist.length) {\n this._region.find('[data-region=\"user-filters\"] span').text(filterlist.join(', '));\n } else {\n str.get_string('nofilters', 'mod_assign').done(function(s) {\n this._region.find('[data-region=\"user-filters\"] span').text(s);\n }.bind(this)).fail(notification.exception);\n }\n\n var select = this._region.find('[data-action=change-user]');\n var currentUserID = select.data('currentuserid');\n this._updateFilterPreferences(currentUserID, this._filters, preferenceNames).done(function() {\n // Reload the list of users to apply the new filters.\n if (!this._loadAllUsers()) {\n var userid = parseInt(select.attr('data-selected'));\n var foundIndex = 0;\n // Search the returned users for the current selection.\n $.each(this._filteredUsers, function(index, user) {\n if (userid == user.id) {\n foundIndex = index;\n }\n });\n\n if (this._filteredUsers.length) {\n this._selectUserById(this._filteredUsers[foundIndex].id);\n } else {\n this._selectNoUser();\n }\n\n }\n }.bind(this)).fail(notification.exception);\n this._refreshCount();\n };\n\n /**\n * Select no users, because no users match the filters.\n *\n * @private\n * @method _selectNoUser\n */\n GradingNavigation.prototype._selectNoUser = function() {\n // Detect unsaved changes, and offer to save them - otherwise change user right now.\n if (this._isLoading) {\n return;\n }\n if (checker.checkFormForChanges('[data-region=\"grade-panel\"] .gradeform')) {\n // Form has changes, so we need to confirm before switching users.\n str.get_strings([\n {key: 'unsavedchanges', component: 'mod_assign'},\n {key: 'unsavedchangesquestion', component: 'mod_assign'},\n {key: 'saveandcontinue', component: 'mod_assign'},\n {key: 'cancel', component: 'core'},\n ]).done(function(strs) {\n notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {\n $(document).trigger('save-changes', -1);\n });\n });\n } else {\n $(document).trigger('user-changed', -1);\n }\n };\n\n /**\n * Select the specified user by id.\n *\n * @private\n * @method _selectUserById\n * @param {Number} userid\n */\n GradingNavigation.prototype._selectUserById = function(userid) {\n var select = this._region.find('[data-action=change-user]');\n var useridnumber = parseInt(userid, 10);\n\n // Detect unsaved changes, and offer to save them - otherwise change user right now.\n if (this._isLoading) {\n return;\n }\n if (checker.checkFormForChanges('[data-region=\"grade-panel\"] .gradeform')) {\n // Form has changes, so we need to confirm before switching users.\n str.get_strings([\n {key: 'unsavedchanges', component: 'mod_assign'},\n {key: 'unsavedchangesquestion', component: 'mod_assign'},\n {key: 'saveandcontinue', component: 'mod_assign'},\n {key: 'cancel', component: 'core'},\n ]).done(function(strs) {\n notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {\n $(document).trigger('save-changes', useridnumber);\n });\n });\n } else {\n select.attr('data-selected', userid);\n\n if (!isNaN(useridnumber) && useridnumber > 0) {\n $(document).trigger('user-changed', userid);\n }\n }\n };\n\n /**\n * Expand or collapse the filter config panel.\n *\n * @private\n * @method _toggleExpandFilters\n * @param {Event} event\n */\n GradingNavigation.prototype._toggleExpandFilters = function(event) {\n event.preventDefault();\n var toggleLink = $(event.target).closest('[data-region=\"user-filters\"]');\n var expanded = toggleLink.attr('aria-expanded') == 'true';\n var configPanel = $(document.getElementById(toggleLink.attr('aria-controls')));\n\n if (expanded) {\n configPanel.hide();\n configPanel.attr('aria-hidden', 'true');\n toggleLink.attr('aria-expanded', 'false');\n $(document).unbind('click.mod_assign_grading_navigation');\n } else {\n configPanel.css('display', 'inline-block');\n configPanel.attr('aria-hidden', 'false');\n toggleLink.attr('aria-expanded', 'true');\n event.stopPropagation();\n $(document).on('click.mod_assign_grading_navigation', this._checkClickOutsideConfigureFilters.bind(this));\n }\n };\n\n /**\n * Change to the previous user in the grading list.\n *\n * @private\n * @method _handlePreviousUser\n * @param {Event} e\n */\n GradingNavigation.prototype._handlePreviousUser = function(e) {\n e.preventDefault();\n var select = this._region.find('[data-action=change-user]');\n var currentUserId = select.attr('data-selected');\n var i = 0;\n var currentIndex = 0;\n\n for (i = 0; i < this._filteredUsers.length; i++) {\n if (this._filteredUsers[i].id == currentUserId) {\n currentIndex = i;\n break;\n }\n }\n\n var count = this._filteredUsers.length;\n var newIndex = (currentIndex - 1);\n if (newIndex < 0) {\n newIndex = count - 1;\n }\n\n if (count) {\n this._selectUserById(this._filteredUsers[newIndex].id);\n }\n };\n\n /**\n * Change to the next user in the grading list.\n *\n * @param {Event} e\n * @param {Boolean} saved Has the form already been saved? Skips checking for changes if true.\n */\n GradingNavigation.prototype._handleNextUser = function(e, saved) {\n e.preventDefault();\n var select = this._region.find('[data-action=change-user]');\n var currentUserId = select.attr('data-selected');\n var i = 0;\n var currentIndex = 0;\n\n for (i = 0; i < this._filteredUsers.length; i++) {\n if (this._filteredUsers[i].id == currentUserId) {\n currentIndex = i;\n break;\n }\n }\n\n var count = this._filteredUsers.length;\n var newIndex = (currentIndex + 1) % count;\n\n if (saved && count) {\n // If we've already saved the grade, skip checking if we've made any changes.\n var userid = this._filteredUsers[newIndex].id;\n var useridnumber = parseInt(userid, 10);\n select.attr('data-selected', userid);\n if (!isNaN(useridnumber) && useridnumber > 0) {\n $(document).trigger('user-changed', userid);\n }\n } else if (count) {\n this._selectUserById(this._filteredUsers[newIndex].id);\n }\n };\n\n /**\n * Set count string. This method only sets the value for the last time it was ever called to deal\n * with promises that return in a non-predictable order.\n *\n * @private\n * @method _setCountString\n * @param {Number} x\n * @param {Number} y\n */\n GradingNavigation.prototype._setCountString = function(x, y) {\n var updateNumber = 0;\n this._lastXofYUpdate++;\n updateNumber = this._lastXofYUpdate;\n\n var param = {x: x, y: y};\n str.get_string('xofy', 'mod_assign', param).done(function(s) {\n if (updateNumber == this._lastXofYUpdate) {\n this._region.find('[data-region=\"user-count-summary\"]').text(s);\n }\n }.bind(this)).fail(notification.exception);\n };\n\n /**\n * Rebuild the x of y string.\n *\n * @private\n * @method _refreshCount\n */\n GradingNavigation.prototype._refreshCount = function() {\n var select = this._region.find('[data-action=change-user]');\n var userid = select.attr('data-selected');\n var i = 0;\n var currentIndex = 0;\n\n if (isNaN(userid) || userid <= 0) {\n this._region.find('[data-region=\"user-count\"]').hide();\n } else {\n this._region.find('[data-region=\"user-count\"]').show();\n\n for (i = 0; i < this._filteredUsers.length; i++) {\n if (this._filteredUsers[i].id == userid) {\n currentIndex = i;\n break;\n }\n }\n var count = this._filteredUsers.length;\n if (count) {\n currentIndex += 1;\n }\n this._setCountString(currentIndex, count);\n // Update window URL\n if (currentIndex > 0) {\n var url = new URL(window.location);\n if (parseInt(url.searchParams.get('blindid')) > 0) {\n var newid = this._filteredUsers[currentIndex - 1].recordid;\n url.searchParams.set('blindid', newid);\n } else {\n url.searchParams.set('userid', userid);\n }\n // We do this so a browser refresh will return to the same user.\n window.history.replaceState({}, \"\", url);\n }\n }\n };\n\n /**\n * Respond to a user-changed event by updating the selector.\n *\n * @private\n * @method _refreshSelector\n * @param {Event} event\n * @param {String} userid\n */\n GradingNavigation.prototype._refreshSelector = function(event, userid) {\n var select = this._region.find('[data-action=change-user]');\n userid = parseInt(userid, 10);\n\n if (!isNaN(userid) && userid > 0) {\n select.attr('data-selected', userid);\n }\n this._refreshCount();\n };\n\n /**\n * Trigger the next user event depending on the number of filtered users\n *\n * @private\n * @method _triggerNextUserEvent\n */\n GradingNavigation.prototype._triggerNextUserEvent = function() {\n if (this._filteredUsers.length > 1) {\n $(document).trigger('next-user', {nextUserId: null, nextUser: true});\n } else {\n $(document).trigger('next-user', {nextUser: false});\n }\n };\n\n /**\n * Change to a different user in the grading list.\n *\n * @private\n * @method _handleChangeUser\n * @param {Event} event\n */\n GradingNavigation.prototype._handleChangeUser = function() {\n var select = this._region.find('[data-action=change-user]');\n var userid = parseInt(select.val(), 10);\n\n if (this._isLoading) {\n return;\n }\n if (checker.checkFormForChanges('[data-region=\"grade-panel\"] .gradeform')) {\n // Form has changes, so we need to confirm before switching users.\n str.get_strings([\n {key: 'unsavedchanges', component: 'mod_assign'},\n {key: 'unsavedchangesquestion', component: 'mod_assign'},\n {key: 'saveandcontinue', component: 'mod_assign'},\n {key: 'cancel', component: 'core'},\n ]).done(function(strs) {\n notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {\n $(document).trigger('save-changes', userid);\n });\n });\n } else {\n if (!isNaN(userid) && userid > 0) {\n select.attr('data-selected', userid);\n\n $(document).trigger('user-changed', userid);\n }\n }\n };\n\n return GradingNavigation;\n});\n"],"file":"grading_navigation.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/grading_navigation.js"],"names":["define","$","notification","str","autocomplete","ajax","checker","GradingNavigation","selector","_regionSelector","_region","_filters","_users","_filteredUsers","_lastXofYUpdate","_firstLoadUsers","_loadAllUsers","find","on","_handlePreviousUser","bind","_handleNextUser","_handleChangeUser","_toggleExpandFilters","document","_refreshSelector","toggleLink","configPanel","getElementById","attr","_filterChanged","userid","data","_selectUserById","get_string","done","s","enhance","fail","exception","_isLoading","prototype","_lastFilters","select","assignmentid","groupid","filterPanel","filter","val","workflowFilter","markerFilter","call","methodname","args","assignid","onlyids","tablesort","_usersLoaded","users","length","trigger","_selectNoUser","_triggerNextUserEvent","_checkClickOutsideConfigureFilters","event","is","target","has","hide","unbind","_updateFilterPreferences","userId","filterList","preferenceNames","preferences","i","deferred","Deferred","resolve","newValue","push","name","value","filters","each","idx","ele","element","prop","filterlist","text","join","currentUserID","parseInt","foundIndex","index","user","id","_refreshCount","checkFormForChanges","get_strings","key","component","strs","confirm","useridnumber","isNaN","preventDefault","closest","expanded","css","stopPropagation","e","currentUserId","currentIndex","count","newIndex","saved","_setCountString","x","y","updateNumber","show","url","URL","window","location","searchParams","get","newid","recordid","set","history","replaceState","nextUserId","nextUser"],"mappings":"AAuBAA,OAAM,iCAAC,CAAC,QAAD,CAAW,mBAAX,CAAgC,UAAhC,CAA4C,wBAA5C,CACC,WADD,CACc,wCADd,CAAD,CAEC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAA+BC,CAA/B,CAA6CC,CAA7C,CAAmDC,CAAnD,CAA4D,CAQ/D,GAAIC,CAAAA,CAAiB,CAAG,SAASC,CAAT,CAAmB,CACvC,KAAKC,eAAL,CAAuBD,CAAvB,CACA,KAAKE,OAAL,CAAeT,CAAC,CAACO,CAAD,CAAhB,CACA,KAAKG,QAAL,CAAgB,EAAhB,CACA,KAAKC,MAAL,CAAc,EAAd,CACA,KAAKC,cAAL,CAAsB,EAAtB,CACA,KAAKC,eAAL,CAAuB,CAAvB,CACA,KAAKC,eAAL,I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gBAAN,CAAwBC,SAAS,CAAE,YAAnC,CADY,CAEZ,CAACD,GAAG,CAAE,wBAAN,CAAgCC,SAAS,CAAE,YAA3C,CAFY,CAGZ,CAACD,GAAG,CAAE,iBAAN,CAAyBC,SAAS,CAAE,YAApC,CAHY,CAIZ,CAACD,GAAG,CAAE,QAAN,CAAgBC,SAAS,CAAE,MAA3B,CAJY,CAAhB,EAKGnE,IALH,CAKQ,SAASoE,CAAT,CAAe,CACnBrG,CAAY,CAACsG,OAAb,CAAqBD,CAAI,CAAC,CAAD,CAAzB,CAA8BA,CAAI,CAAC,CAAD,CAAlC,CAAuCA,CAAI,CAAC,CAAD,CAA3C,CAAgDA,CAAI,CAAC,CAAD,CAApD,CAAyD,UAAW,CAChEtG,CAAC,CAACuB,QAAD,CAAD,CAAYoC,OAAZ,CAAoB,cAApB,CAAoC7B,CAApC,CACH,CAFD,CAGH,CATD,CAUH,CAZD,IAYO,CACH,GAAI,CAAC2E,KAAK,CAAC3E,CAAD,CAAN,EAA2B,CAAT,CAAAA,CAAtB,CAAkC,CAC9BY,CAAM,CAACd,IAAP,CAAY,eAAZ,CAA6BE,CAA7B,EAEA9B,CAAC,CAACuB,QAAD,CAAD,CAAYoC,OAAZ,CAAoB,cAApB,CAAoC7B,CAApC,CACH,CACJ,CACJ,CA1BD,CA4BA,MAAOxB,CAAAA,CACV,CAliBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript to handle changing users via the user selector in the header.\n *\n * @module mod_assign/grading_navigation\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete',\n 'core/ajax', 'mod_assign/grading_form_change_checker'],\n function($, notification, str, autocomplete, ajax, checker) {\n\n /**\n * GradingNavigation class.\n *\n * @class mod_assign/grading_navigation\n * @param {String} selector The selector for the page region containing the user navigation.\n */\n var GradingNavigation = function(selector) {\n this._regionSelector = selector;\n this._region = $(selector);\n this._filters = [];\n this._users = [];\n this._filteredUsers = [];\n this._lastXofYUpdate = 0;\n this._firstLoadUsers = true;\n\n // Get the current user list from a webservice.\n this._loadAllUsers();\n\n // We do not allow navigation while ajax requests are pending.\n // Attach listeners to the select and arrow buttons.\n\n this._region.find('[data-action=\"previous-user\"]').on('click', this._handlePreviousUser.bind(this));\n this._region.find('[data-action=\"next-user\"]').on('click', this._handleNextUser.bind(this));\n this._region.find('[data-action=\"change-user\"]').on('change', this._handleChangeUser.bind(this));\n this._region.find('[data-region=\"user-filters\"]').on('click', this._toggleExpandFilters.bind(this));\n\n $(document).on('user-changed', this._refreshSelector.bind(this));\n $(document).on('done-saving-show-next', this._handleNextUser.bind(this));\n\n // Position the configure filters panel under the link that expands it.\n var toggleLink = this._region.find('[data-region=\"user-filters\"]');\n var configPanel = $(document.getElementById(toggleLink.attr('aria-controls')));\n\n configPanel.on('change', 'select', this._filterChanged.bind(this));\n\n var userid = $('[data-region=\"grading-navigation-panel\"]').data('first-userid');\n if (userid) {\n this._selectUserById(userid);\n }\n\n str.get_string('changeuser', 'mod_assign').done(function(s) {\n autocomplete.enhance('[data-action=change-user]', false, 'mod_assign/participant_selector', s);\n }\n ).fail(notification.exception);\n\n $(document).bind(\"start-loading-user\", function() {\n this._isLoading = true;\n }.bind(this));\n $(document).bind(\"finish-loading-user\", function() {\n this._isLoading = false;\n }.bind(this));\n };\n\n /** @property {Boolean} Boolean tracking active ajax requests. */\n GradingNavigation.prototype._isLoading = false;\n\n /** @property {String} Selector for the page region containing the user navigation. */\n GradingNavigation.prototype._regionSelector = null;\n\n /** @property {Array} The list of active filter keys */\n GradingNavigation.prototype._filters = null;\n\n /** @property {Array} The list of users */\n GradingNavigation.prototype._users = null;\n\n /** @property {JQuery} JQuery node for the page region containing the user navigation. */\n GradingNavigation.prototype._region = null;\n\n /** @property {String} Last active filters */\n GradingNavigation.prototype._lastFilters = '';\n\n /**\n * Load the list of all users for this assignment.\n *\n * @private\n * @method _loadAllUsers\n * @return {Boolean} True if the user list was fetched.\n */\n GradingNavigation.prototype._loadAllUsers = function() {\n var select = this._region.find('[data-action=change-user]');\n var assignmentid = select.attr('data-assignmentid');\n var groupid = select.attr('data-groupid');\n\n var filterPanel = this._region.find('[data-region=\"configure-filters\"]');\n var filter = filterPanel.find('select[name=\"filter\"]').val();\n var workflowFilter = filterPanel.find('select[name=\"workflowfilter\"]');\n if (workflowFilter) {\n filter += ',' + workflowFilter.val();\n }\n var markerFilter = filterPanel.find('select[name=\"markerfilter\"]');\n if (markerFilter) {\n filter += ',' + markerFilter.val();\n }\n\n if (this._lastFilters == filter) {\n return false;\n }\n this._lastFilters = filter;\n\n ajax.call([{\n methodname: 'mod_assign_list_participants',\n args: {assignid: assignmentid, groupid: groupid, filter: '', onlyids: true, tablesort: true},\n done: this._usersLoaded.bind(this),\n fail: notification.exception\n }]);\n return true;\n };\n\n /**\n * Call back to rebuild the user selector and x of y info when the user list is updated.\n *\n * @private\n * @method _usersLoaded\n * @param {Array} users\n */\n GradingNavigation.prototype._usersLoaded = function(users) {\n this._firstLoadUsers = false;\n this._filteredUsers = this._users = users;\n if (this._users.length) {\n // Position the configure filters panel under the link that expands it.\n var toggleLink = this._region.find('[data-region=\"user-filters\"]');\n var configPanel = $(document.getElementById(toggleLink.attr('aria-controls')));\n\n configPanel.find('select[name=\"filter\"]').trigger('change');\n } else {\n this._selectNoUser();\n }\n this._triggerNextUserEvent();\n };\n\n /**\n * Close the configure filters panel if a click is detected outside of it.\n *\n * @private\n * @method _checkClickOutsideConfigureFilters\n * @param {Event} event\n */\n GradingNavigation.prototype._checkClickOutsideConfigureFilters = function(event) {\n var configPanel = this._region.find('[data-region=\"configure-filters\"]');\n\n if (!configPanel.is(event.target) && configPanel.has(event.target).length === 0) {\n var toggleLink = this._region.find('[data-region=\"user-filters\"]');\n\n configPanel.hide();\n configPanel.attr('aria-hidden', 'true');\n toggleLink.attr('aria-expanded', 'false');\n $(document).unbind('click.mod_assign_grading_navigation');\n }\n };\n\n /**\n * Close the configure filters panel if a click is detected outside of it.\n *\n * @private\n * @method _updateFilterPreference\n * @param {Number} userId The current user id.\n * @param {Array} filterList The list of current filter values.\n * @param {Array} preferenceNames The names of the preferences to update\n * @return {Promise} Resolved when all the preferences are updated.\n */\n GradingNavigation.prototype._updateFilterPreferences = function(userId, filterList, preferenceNames) {\n var preferences = [],\n i = 0;\n\n if (filterList.length == 0 || this._firstLoadUsers) {\n // Nothing to update.\n var deferred = $.Deferred();\n deferred.resolve();\n return deferred;\n }\n // General filter.\n // Set the user preferences to the current filters.\n for (i = 0; i < filterList.length; i++) {\n var newValue = filterList[i];\n if (newValue == 'none') {\n newValue = '';\n }\n\n preferences.push({\n userid: userId,\n name: preferenceNames[i],\n value: newValue\n });\n }\n\n return ajax.call([{\n methodname: 'core_user_set_user_preferences',\n args: {\n preferences: preferences\n }\n }])[0];\n };\n /**\n * Turn a filter on or off.\n *\n * @private\n * @method _filterChanged\n * @param {Event} event\n */\n GradingNavigation.prototype._filterChanged = function() {\n // There are 3 types of filter right now.\n var filterPanel = this._region.find('[data-region=\"configure-filters\"]');\n var filters = filterPanel.find('select');\n var preferenceNames = [];\n\n this._filters = [];\n filters.each(function(idx, ele) {\n var element = $(ele);\n this._filters.push(element.val());\n preferenceNames.push('assign_' + element.prop('name'));\n }.bind(this));\n\n // Update the active filter string.\n var filterlist = [];\n filterPanel.find('option:checked').each(function(idx, ele) {\n filterlist[filterlist.length] = $(ele).text();\n });\n if (filterlist.length) {\n this._region.find('[data-region=\"user-filters\"] span').text(filterlist.join(', '));\n } else {\n str.get_string('nofilters', 'mod_assign').done(function(s) {\n this._region.find('[data-region=\"user-filters\"] span').text(s);\n }.bind(this)).fail(notification.exception);\n }\n\n var select = this._region.find('[data-action=change-user]');\n var currentUserID = select.data('currentuserid');\n this._updateFilterPreferences(currentUserID, this._filters, preferenceNames).done(function() {\n // Reload the list of users to apply the new filters.\n if (!this._loadAllUsers()) {\n var userid = parseInt(select.attr('data-selected'));\n var foundIndex = 0;\n // Search the returned users for the current selection.\n $.each(this._filteredUsers, function(index, user) {\n if (userid == user.id) {\n foundIndex = index;\n }\n });\n\n if (this._filteredUsers.length) {\n this._selectUserById(this._filteredUsers[foundIndex].id);\n } else {\n this._selectNoUser();\n }\n\n }\n }.bind(this)).fail(notification.exception);\n this._refreshCount();\n };\n\n /**\n * Select no users, because no users match the filters.\n *\n * @private\n * @method _selectNoUser\n */\n GradingNavigation.prototype._selectNoUser = function() {\n // Detect unsaved changes, and offer to save them - otherwise change user right now.\n if (this._isLoading) {\n return;\n }\n if (checker.checkFormForChanges('[data-region=\"grade-panel\"] .gradeform')) {\n // Form has changes, so we need to confirm before switching users.\n str.get_strings([\n {key: 'unsavedchanges', component: 'mod_assign'},\n {key: 'unsavedchangesquestion', component: 'mod_assign'},\n {key: 'saveandcontinue', component: 'mod_assign'},\n {key: 'cancel', component: 'core'},\n ]).done(function(strs) {\n notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {\n $(document).trigger('save-changes', -1);\n });\n });\n } else {\n $(document).trigger('user-changed', -1);\n }\n };\n\n /**\n * Select the specified user by id.\n *\n * @private\n * @method _selectUserById\n * @param {Number} userid\n */\n GradingNavigation.prototype._selectUserById = function(userid) {\n var select = this._region.find('[data-action=change-user]');\n var useridnumber = parseInt(userid, 10);\n\n // Detect unsaved changes, and offer to save them - otherwise change user right now.\n if (this._isLoading) {\n return;\n }\n if (checker.checkFormForChanges('[data-region=\"grade-panel\"] .gradeform')) {\n // Form has changes, so we need to confirm before switching users.\n str.get_strings([\n {key: 'unsavedchanges', component: 'mod_assign'},\n {key: 'unsavedchangesquestion', component: 'mod_assign'},\n {key: 'saveandcontinue', component: 'mod_assign'},\n {key: 'cancel', component: 'core'},\n ]).done(function(strs) {\n notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {\n $(document).trigger('save-changes', useridnumber);\n });\n });\n } else {\n select.attr('data-selected', userid);\n\n if (!isNaN(useridnumber) && useridnumber > 0) {\n $(document).trigger('user-changed', userid);\n }\n }\n };\n\n /**\n * Expand or collapse the filter config panel.\n *\n * @private\n * @method _toggleExpandFilters\n * @param {Event} event\n */\n GradingNavigation.prototype._toggleExpandFilters = function(event) {\n event.preventDefault();\n var toggleLink = $(event.target).closest('[data-region=\"user-filters\"]');\n var expanded = toggleLink.attr('aria-expanded') == 'true';\n var configPanel = $(document.getElementById(toggleLink.attr('aria-controls')));\n\n if (expanded) {\n configPanel.hide();\n configPanel.attr('aria-hidden', 'true');\n toggleLink.attr('aria-expanded', 'false');\n $(document).unbind('click.mod_assign_grading_navigation');\n } else {\n configPanel.css('display', 'inline-block');\n configPanel.attr('aria-hidden', 'false');\n toggleLink.attr('aria-expanded', 'true');\n event.stopPropagation();\n $(document).on('click.mod_assign_grading_navigation', this._checkClickOutsideConfigureFilters.bind(this));\n }\n };\n\n /**\n * Change to the previous user in the grading list.\n *\n * @private\n * @method _handlePreviousUser\n * @param {Event} e\n */\n GradingNavigation.prototype._handlePreviousUser = function(e) {\n e.preventDefault();\n var select = this._region.find('[data-action=change-user]');\n var currentUserId = select.attr('data-selected');\n var i = 0;\n var currentIndex = 0;\n\n for (i = 0; i < this._filteredUsers.length; i++) {\n if (this._filteredUsers[i].id == currentUserId) {\n currentIndex = i;\n break;\n }\n }\n\n var count = this._filteredUsers.length;\n var newIndex = (currentIndex - 1);\n if (newIndex < 0) {\n newIndex = count - 1;\n }\n\n if (count) {\n this._selectUserById(this._filteredUsers[newIndex].id);\n }\n };\n\n /**\n * Change to the next user in the grading list.\n *\n * @param {Event} e\n * @param {Boolean} saved Has the form already been saved? Skips checking for changes if true.\n */\n GradingNavigation.prototype._handleNextUser = function(e, saved) {\n e.preventDefault();\n var select = this._region.find('[data-action=change-user]');\n var currentUserId = select.attr('data-selected');\n var i = 0;\n var currentIndex = 0;\n\n for (i = 0; i < this._filteredUsers.length; i++) {\n if (this._filteredUsers[i].id == currentUserId) {\n currentIndex = i;\n break;\n }\n }\n\n var count = this._filteredUsers.length;\n var newIndex = (currentIndex + 1) % count;\n\n if (saved && count) {\n // If we've already saved the grade, skip checking if we've made any changes.\n var userid = this._filteredUsers[newIndex].id;\n var useridnumber = parseInt(userid, 10);\n select.attr('data-selected', userid);\n if (!isNaN(useridnumber) && useridnumber > 0) {\n $(document).trigger('user-changed', userid);\n }\n } else if (count) {\n this._selectUserById(this._filteredUsers[newIndex].id);\n }\n };\n\n /**\n * Set count string. This method only sets the value for the last time it was ever called to deal\n * with promises that return in a non-predictable order.\n *\n * @private\n * @method _setCountString\n * @param {Number} x\n * @param {Number} y\n */\n GradingNavigation.prototype._setCountString = function(x, y) {\n var updateNumber = 0;\n this._lastXofYUpdate++;\n updateNumber = this._lastXofYUpdate;\n\n var param = {x: x, y: y};\n str.get_string('xofy', 'mod_assign', param).done(function(s) {\n if (updateNumber == this._lastXofYUpdate) {\n this._region.find('[data-region=\"user-count-summary\"]').text(s);\n }\n }.bind(this)).fail(notification.exception);\n };\n\n /**\n * Rebuild the x of y string.\n *\n * @private\n * @method _refreshCount\n */\n GradingNavigation.prototype._refreshCount = function() {\n var select = this._region.find('[data-action=change-user]');\n var userid = select.attr('data-selected');\n var i = 0;\n var currentIndex = 0;\n\n if (isNaN(userid) || userid <= 0) {\n this._region.find('[data-region=\"user-count\"]').hide();\n } else {\n this._region.find('[data-region=\"user-count\"]').show();\n\n for (i = 0; i < this._filteredUsers.length; i++) {\n if (this._filteredUsers[i].id == userid) {\n currentIndex = i;\n break;\n }\n }\n var count = this._filteredUsers.length;\n if (count) {\n currentIndex += 1;\n }\n this._setCountString(currentIndex, count);\n // Update window URL\n if (currentIndex > 0) {\n var url = new URL(window.location);\n if (parseInt(url.searchParams.get('blindid')) > 0) {\n var newid = this._filteredUsers[currentIndex - 1].recordid;\n url.searchParams.set('blindid', newid);\n } else {\n url.searchParams.set('userid', userid);\n }\n // We do this so a browser refresh will return to the same user.\n window.history.replaceState({}, \"\", url);\n }\n }\n };\n\n /**\n * Respond to a user-changed event by updating the selector.\n *\n * @private\n * @method _refreshSelector\n * @param {Event} event\n * @param {String} userid\n */\n GradingNavigation.prototype._refreshSelector = function(event, userid) {\n var select = this._region.find('[data-action=change-user]');\n userid = parseInt(userid, 10);\n\n if (!isNaN(userid) && userid > 0) {\n select.attr('data-selected', userid);\n }\n this._refreshCount();\n };\n\n /**\n * Trigger the next user event depending on the number of filtered users\n *\n * @private\n * @method _triggerNextUserEvent\n */\n GradingNavigation.prototype._triggerNextUserEvent = function() {\n if (this._filteredUsers.length > 1) {\n $(document).trigger('next-user', {nextUserId: null, nextUser: true});\n } else {\n $(document).trigger('next-user', {nextUser: false});\n }\n };\n\n /**\n * Change to a different user in the grading list.\n *\n * @private\n * @method _handleChangeUser\n * @param {Event} event\n */\n GradingNavigation.prototype._handleChangeUser = function() {\n var select = this._region.find('[data-action=change-user]');\n var userid = parseInt(select.val(), 10);\n\n if (this._isLoading) {\n return;\n }\n if (checker.checkFormForChanges('[data-region=\"grade-panel\"] .gradeform')) {\n // Form has changes, so we need to confirm before switching users.\n str.get_strings([\n {key: 'unsavedchanges', component: 'mod_assign'},\n {key: 'unsavedchangesquestion', component: 'mod_assign'},\n {key: 'saveandcontinue', component: 'mod_assign'},\n {key: 'cancel', component: 'core'},\n ]).done(function(strs) {\n notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {\n $(document).trigger('save-changes', userid);\n });\n });\n } else {\n if (!isNaN(userid) && userid > 0) {\n select.attr('data-selected', userid);\n\n $(document).trigger('user-changed', userid);\n }\n }\n };\n\n return GradingNavigation;\n});\n"],"file":"grading_navigation.min.js"} \ No newline at end of file diff --git a/mod/assign/amd/build/grading_navigation_user_info.min.js.map b/mod/assign/amd/build/grading_navigation_user_info.min.js.map index 1eca6953f62b9..845b3707ac3aa 100644 --- a/mod/assign/amd/build/grading_navigation_user_info.min.js.map +++ b/mod/assign/amd/build/grading_navigation_user_info.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/grading_navigation_user_info.js"],"names":["define","$","notification","ajax","templates","UserInfo","selector","_regionSelector","_region","_userCache","document","on","_refreshUserInfo","bind","prototype","_lastUserId","_getAssignmentId","attr","event","userid","promise","Deferred","render","done","html","js","fadeOut","replaceNodeContents","fadeIn","fail","exception","resolve","assignmentId","requests","call","methodname","args","assignid","embeduser","participant","hasOwnProperty","reject","context","identityfields","data","split","identity","courseid","user","each","i","k","hasidentity","push","join","profileimageurl"],"mappings":"AAwBAA,OAAM,2CAAC,CAAC,QAAD,CAAW,mBAAX,CAAgC,WAAhC,CAA6C,gBAA7C,CAAD,CAAiE,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAA2C,CAQ9G,GAAIC,CAAAA,CAAQ,CAAG,SAASC,CAAT,CAAmB,CAC9B,KAAKC,eAAL,CAAuBD,CAAvB,CACA,KAAKE,OAAL,CAAeP,CAAC,CAACK,CAAD,CAAhB,CACA,KAAKG,UAAL,CAAkB,EAAlB,CAEAR,CAAC,CAACS,QAAD,CAAD,CAAYC,EAAZ,CAAe,cAAf,CAA+B,KAAKC,gBAAL,CAAsBC,IAAtB,CAA2B,IAA3B,CAA/B,CACH,CAND,CASAR,CAAQ,CAACS,SAAT,CAAmBP,eAAnB,CAAqC,IAArC,CAGAF,CAAQ,CAACS,SAAT,CAAmBL,UAAnB,CAAgC,IAAhC,CAGAJ,CAAQ,CAACS,SAAT,CAAmBN,OAAnB,CAA6B,IAA7B,CAGAH,CAAQ,CAACS,SAAT,CAAmBC,WAAnB,CAAiC,CAAjC,CASAV,C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E,SAASC,CAAT,CAAeC,CAAf,CAAmB,CAEnF,KAAKjB,OAAL,CAAakB,OAAb,CAAqB,MAArB,CAA6B,UAAW,CACpCtB,CAAS,CAACuB,mBAAV,CAA8B,KAAKnB,OAAnC,CAA4CgB,CAA5C,CAAkDC,CAAlD,EACA,KAAKjB,OAAL,CAAaoB,MAAb,CAAoB,MAApB,CACH,CAH4B,CAG3Bf,IAH2B,CAGtB,IAHsB,CAA7B,CAIH,CANmE,CAMlEA,IANkE,CAM7D,IAN6D,CAApE,EAMcgB,IANd,CAMmB3B,CAAY,CAAC4B,SANhC,CAOH,CATkB,CAUlBjB,IAVkB,CAUb,IAVa,CA/BnB,CA0CH,CAvF+C,CAuF9CA,IAvF8C,CAuFzC,IAvFyC,CAAhD,EAuFcgB,IAvFd,CAuFmB3B,CAAY,CAAC4B,SAvFhC,CAwFH,CArGD,CAuGA,MAAOzB,CAAAA,CACV,CAvJK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for the \"User summary\" panel at the top of the page.\n *\n * @module mod_assign/grading_navigation_user_info\n * @class UserInfo\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/notification', 'core/ajax', 'core/templates'], function($, notification, ajax, templates) {\n\n /**\n * UserInfo class.\n *\n * @class UserInfo\n * @param {String} selector The selector for the page region containing the user navigation.\n */\n var UserInfo = function(selector) {\n this._regionSelector = selector;\n this._region = $(selector);\n this._userCache = {};\n\n $(document).on('user-changed', this._refreshUserInfo.bind(this));\n };\n\n /** @property {String} Selector for the page region containing the user navigation. */\n UserInfo.prototype._regionSelector = null;\n\n /** @property {Array} Cache of user info contexts. */\n UserInfo.prototype._userCache = null;\n\n /** @property {JQuery} JQuery node for the page region containing the user navigation. */\n UserInfo.prototype._region = null;\n\n /** @property {Integer} Remember the last user id to prevent unnecessary reloads. */\n UserInfo.prototype._lastUserId = 0;\n\n /**\n * Get the assignment id\n *\n * @private\n * @method _getAssignmentId\n * @return {Integer} assignment id\n */\n UserInfo.prototype._getAssignmentId = function() {\n return this._region.attr('data-assignmentid');\n };\n\n /**\n * Get the user context - re-render the template in the page.\n *\n * @private\n * @method _refreshUserInfo\n * @param {Event} event\n * @param {Number} userid\n */\n UserInfo.prototype._refreshUserInfo = function(event, userid) {\n var promise = $.Deferred();\n\n // Put the current user ID in the DOM so yui can access it.\n this._region.attr('data-userid', userid);\n\n // Skip reloading if it is the same user.\n if (this._lastUserId == userid) {\n return;\n }\n this._lastUserId = userid;\n\n // First insert the loading template.\n templates.render('mod_assign/loading', {}).done(function(html, js) {\n // Update the page.\n this._region.fadeOut(\"fast\", function() {\n templates.replaceNodeContents(this._region, html, js);\n this._region.fadeIn(\"fast\");\n }.bind(this));\n\n if (userid < 0) {\n // Render the template.\n templates.render('mod_assign/grading_navigation_no_users', {}).done(function(html, js) {\n if (userid == this._lastUserId) {\n // Update the page.\n this._region.fadeOut(\"fast\", function() {\n templates.replaceNodeContents(this._region, html, js);\n this._region.fadeIn(\"fast\");\n }.bind(this));\n }\n }.bind(this)).fail(notification.exception);\n return;\n }\n\n if (typeof this._userCache[userid] !== \"undefined\") {\n promise.resolve(this._userCache[userid]);\n } else {\n // Load context from ajax.\n var assignmentId = this._getAssignmentId();\n var requests = ajax.call([{\n methodname: 'mod_assign_get_participant',\n args: {\n userid: userid,\n assignid: assignmentId,\n embeduser: true\n }\n }]);\n\n requests[0].done(function(participant) {\n if (!participant.hasOwnProperty('id')) {\n promise.reject('No users');\n } else {\n this._userCache[userid] = participant;\n promise.resolve(this._userCache[userid]);\n }\n }.bind(this)).fail(notification.exception);\n }\n\n promise.done(function(context) {\n var identityfields = $('[data-showuseridentity]').data('showuseridentity').split(','),\n identity = [];\n // Render the template.\n context.courseid = $('[data-region=\"grading-navigation-panel\"]').attr('data-courseid');\n\n if (context.user) {\n // Build a string for the visible identity fields listed in showuseridentity config setting.\n $.each(identityfields, function(i, k) {\n if (typeof context.user[k] !== 'undefined' && context.user[k] !== '') {\n context.hasidentity = true;\n identity.push(context.user[k]);\n }\n });\n context.identity = identity.join(', ');\n\n // Add profile image url to context.\n if (context.user.profileimageurl) {\n context.profileimageurl = context.user.profileimageurl;\n }\n }\n\n templates.render('mod_assign/grading_navigation_user_summary', context).done(function(html, js) {\n // Update the page.\n if (userid == this._lastUserId) {\n this._region.fadeOut(\"fast\", function() {\n templates.replaceNodeContents(this._region, html, js);\n this._region.fadeIn(\"fast\");\n }.bind(this));\n }\n }.bind(this)).fail(notification.exception);\n }.bind(this)).fail(function() {\n // Render the template.\n templates.render('mod_assign/grading_navigation_no_users', {}).done(function(html, js) {\n // Update the page.\n this._region.fadeOut(\"fast\", function() {\n templates.replaceNodeContents(this._region, html, js);\n this._region.fadeIn(\"fast\");\n }.bind(this));\n }.bind(this)).fail(notification.exception);\n }\n .bind(this));\n }.bind(this)).fail(notification.exception);\n };\n\n return UserInfo;\n});\n"],"file":"grading_navigation_user_info.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/grading_navigation_user_info.js"],"names":["define","$","notification","ajax","templates","UserInfo","selector","_regionSelector","_region","_userCache","document","on","_refreshUserInfo","bind","prototype","_lastUserId","_getAssignmentId","attr","event","userid","promise","Deferred","render","done","html","js","fadeOut","replaceNodeContents","fadeIn","fail","exception","resolve","assignmentId","requests","call","methodname","args","assignid","embeduser","participant","hasOwnProperty","reject","context","identityfields","data","split","identity","courseid","user","each","i","k","hasidentity","push","join","profileimageurl"],"mappings":"AAuBAA,OAAM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AAA,CACV,CAvJK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for the \"User summary\" panel at the top of the page.\n *\n * @module mod_assign/grading_navigation_user_info\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/notification', 'core/ajax', 'core/templates'], function($, notification, ajax, templates) {\n\n /**\n * UserInfo class.\n *\n * @class mod_assign/grading_navigation_user_info\n * @param {String} selector The selector for the page region containing the user navigation.\n */\n var UserInfo = function(selector) {\n this._regionSelector = selector;\n this._region = $(selector);\n this._userCache = {};\n\n $(document).on('user-changed', this._refreshUserInfo.bind(this));\n };\n\n /** @property {String} Selector for the page region containing the user navigation. */\n UserInfo.prototype._regionSelector = null;\n\n /** @property {Array} Cache of user info contexts. */\n UserInfo.prototype._userCache = null;\n\n /** @property {JQuery} JQuery node for the page region containing the user navigation. */\n UserInfo.prototype._region = null;\n\n /** @property {Integer} Remember the last user id to prevent unnecessary reloads. */\n UserInfo.prototype._lastUserId = 0;\n\n /**\n * Get the assignment id\n *\n * @private\n * @method _getAssignmentId\n * @return {Integer} assignment id\n */\n UserInfo.prototype._getAssignmentId = function() {\n return this._region.attr('data-assignmentid');\n };\n\n /**\n * Get the user context - re-render the template in the page.\n *\n * @private\n * @method _refreshUserInfo\n * @param {Event} event\n * @param {Number} userid\n */\n UserInfo.prototype._refreshUserInfo = function(event, userid) {\n var promise = $.Deferred();\n\n // Put the current user ID in the DOM so yui can access it.\n this._region.attr('data-userid', userid);\n\n // Skip reloading if it is the same user.\n if (this._lastUserId == userid) {\n return;\n }\n this._lastUserId = userid;\n\n // First insert the loading template.\n templates.render('mod_assign/loading', {}).done(function(html, js) {\n // Update the page.\n this._region.fadeOut(\"fast\", function() {\n templates.replaceNodeContents(this._region, html, js);\n this._region.fadeIn(\"fast\");\n }.bind(this));\n\n if (userid < 0) {\n // Render the template.\n templates.render('mod_assign/grading_navigation_no_users', {}).done(function(html, js) {\n if (userid == this._lastUserId) {\n // Update the page.\n this._region.fadeOut(\"fast\", function() {\n templates.replaceNodeContents(this._region, html, js);\n this._region.fadeIn(\"fast\");\n }.bind(this));\n }\n }.bind(this)).fail(notification.exception);\n return;\n }\n\n if (typeof this._userCache[userid] !== \"undefined\") {\n promise.resolve(this._userCache[userid]);\n } else {\n // Load context from ajax.\n var assignmentId = this._getAssignmentId();\n var requests = ajax.call([{\n methodname: 'mod_assign_get_participant',\n args: {\n userid: userid,\n assignid: assignmentId,\n embeduser: true\n }\n }]);\n\n requests[0].done(function(participant) {\n if (!participant.hasOwnProperty('id')) {\n promise.reject('No users');\n } else {\n this._userCache[userid] = participant;\n promise.resolve(this._userCache[userid]);\n }\n }.bind(this)).fail(notification.exception);\n }\n\n promise.done(function(context) {\n var identityfields = $('[data-showuseridentity]').data('showuseridentity').split(','),\n identity = [];\n // Render the template.\n context.courseid = $('[data-region=\"grading-navigation-panel\"]').attr('data-courseid');\n\n if (context.user) {\n // Build a string for the visible identity fields listed in showuseridentity config setting.\n $.each(identityfields, function(i, k) {\n if (typeof context.user[k] !== 'undefined' && context.user[k] !== '') {\n context.hasidentity = true;\n identity.push(context.user[k]);\n }\n });\n context.identity = identity.join(', ');\n\n // Add profile image url to context.\n if (context.user.profileimageurl) {\n context.profileimageurl = context.user.profileimageurl;\n }\n }\n\n templates.render('mod_assign/grading_navigation_user_summary', context).done(function(html, js) {\n // Update the page.\n if (userid == this._lastUserId) {\n this._region.fadeOut(\"fast\", function() {\n templates.replaceNodeContents(this._region, html, js);\n this._region.fadeIn(\"fast\");\n }.bind(this));\n }\n }.bind(this)).fail(notification.exception);\n }.bind(this)).fail(function() {\n // Render the template.\n templates.render('mod_assign/grading_navigation_no_users', {}).done(function(html, js) {\n // Update the page.\n this._region.fadeOut(\"fast\", function() {\n templates.replaceNodeContents(this._region, html, js);\n this._region.fadeIn(\"fast\");\n }.bind(this));\n }.bind(this)).fail(notification.exception);\n }\n .bind(this));\n }.bind(this)).fail(notification.exception);\n };\n\n return UserInfo;\n});\n"],"file":"grading_navigation_user_info.min.js"} \ No newline at end of file diff --git a/mod/assign/amd/build/grading_panel.min.js.map b/mod/assign/amd/build/grading_panel.min.js.map index 550019be473a6..d38e4f89d4682 100644 --- a/mod/assign/amd/build/grading_panel.min.js.map +++ b/mod/assign/amd/build/grading_panel.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/grading_panel.js"],"names":["define","$","Y","notification","templates","fragment","ajax","str","checker","GradingEvents","FormEvents","Toast","GradingPanel","selector","_regionSelector","_region","_userCache","registerEventListeners","prototype","_lastUserId","_lastAttemptNumber","nextUserId","nextUser","_niceReplaceNodeContents","node","html","js","promise","Deferred","fadeOut","replaceNodeContents","fadeIn","resolve","_saveFormState","checked","prop","val","_submitForm","event","commentAreaElement","document","querySelector","commentTextAreaElement","value","commentActionPostElement","click","form","find","show","trigger","notifyFormSubmittedByJavascript","data","serialize","assignmentid","attr","call","methodname","args","userid","jsonformdata","JSON","stringify","done","_handleFormSubmissionResponse","bind","fail","exception","formdata","response","length","get_strings","key","component","strs","add","use","M","core_formchangechecker","reset_form_dirty_state","hide","_resetForm","e","Event","_refreshGradingPanel","_chooseAttempt","link","target","submissionsId","submissionsform","getElementById","formcopy","clone","formhtml","wrap","confirm","attemptnumber","_addPopoutButtons","region","render","parents","closest","addClass","parent","append","on","_togglePopout","preventDefault","container","hasClass","removeClass","submissiondata","contextid","window","util","js_pending","params","loadFragment","saveFormState","js_complete","_getNextUser","_handleSaveAndShowNext","getPan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AnD,EAIA4D,CAAU,CAACpB,EAAX,CAAc/F,CAAa,CAACsH,kBAA5B,CAAgD,UAAW,CACvD,KAAKJ,WAAL,EACH,CAF+C,CAE9C3D,IAF8C,CAEzC,IAFyC,CAAhD,CAGH,CA5BD,CA8BA,MAAOpD,CAAAA,CACV,CA1YK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for the \"Grading\" panel at the right of the page.\n *\n * @module mod_assign/grading_panel\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine([\n 'jquery', 'core/yui', 'core/notification', 'core/templates', 'core/fragment',\n 'core/ajax', 'core/str', 'mod_assign/grading_form_change_checker',\n 'mod_assign/grading_events', 'core_form/events', 'core/toast'\n],\nfunction($, Y, notification, templates, fragment, ajax, str, checker, GradingEvents, FormEvents, Toast) {\n\n /**\n * GradingPanel class.\n *\n * @class GradingPanel\n * @param {String} selector The selector for the page region containing the user navigation.\n */\n var GradingPanel = function(selector) {\n this._regionSelector = selector;\n this._region = $(selector);\n this._userCache = [];\n\n this.registerEventListeners();\n };\n\n /** @property {String} Selector for the page region containing the user navigation. */\n GradingPanel.prototype._regionSelector = null;\n\n /** @property {Integer} Remember the last user id to prevent unnessecary reloads. */\n GradingPanel.prototype._lastUserId = 0;\n\n /** @property {Integer} Remember the last attempt number to prevent unnessecary reloads. */\n GradingPanel.prototype._lastAttemptNumber = -1;\n\n /** @property {JQuery} JQuery node for the page region containing the user navigation. */\n GradingPanel.prototype._region = null;\n\n /** @property {Integer} The id of the next user in the grading list */\n GradingPanel.prototype.nextUserId = null;\n\n /** @property {Boolean} Next user exists in the grading list */\n GradingPanel.prototype.nextUser = false;\n\n /**\n * Fade the dom node out, update it, and fade it back.\n *\n * @private\n * @method _niceReplaceNodeContents\n * @param {JQuery} node\n * @param {String} html\n * @param {String} js\n * @return {Deferred} promise resolved when the animations are complete.\n */\n GradingPanel.prototype._niceReplaceNodeContents = function(node, html, js) {\n var promise = $.Deferred();\n\n node.fadeOut(\"fast\", function() {\n templates.replaceNodeContents(node, html, js);\n node.fadeIn(\"fast\", function() {\n promise.resolve();\n });\n });\n\n return promise.promise();\n };\n\n /**\n * Make sure all form fields have the latest saved state.\n * @private\n * @method _saveFormState\n */\n GradingPanel.prototype._saveFormState = function() {\n // Copy data from notify students checkbox which was moved out of the form.\n var checked = $('[data-region=\"grading-actions-form\"] [name=\"sendstudentnotifications\"]').prop(\"checked\");\n $('.gradeform [name=\"sendstudentnotifications\"]').val(checked);\n };\n\n /**\n * Make form submit via ajax.\n *\n * @private\n * @param {Object} event\n * @param {Integer} nextUserId\n * @param {Boolean} nextUser optional. Load next user in the grading list.\n * @method _submitForm\n * @fires event:formSubmittedByJavascript\n */\n GradingPanel.prototype._submitForm = function(event, nextUserId, nextUser) {\n // If the form has data in comment-area, then we need to save that comment\n var commentAreaElement = document.querySelector('.comment-area');\n if (commentAreaElement) {\n var commentTextAreaElement = commentAreaElement.querySelector('.db > textarea');\n if (commentTextAreaElement.value !== '') {\n var commentActionPostElement = commentAreaElement.querySelector('.fd a[id^=\"comment-action-post-\"]');\n commentActionPostElement.click();\n }\n }\n\n // The form was submitted - send it via ajax instead.\n var form = $(this._region.find('form.gradeform'));\n\n $('[data-region=\"overlay\"]').show();\n\n // We call this, so other modules can update the form with the latest state.\n form.trigger('save-form-state');\n\n // Tell all form fields we are about to submit the form.\n FormEvents.notifyFormSubmittedByJavascript(form[0]);\n\n // Now we get all the current values from the form.\n var data = form.serialize();\n var assignmentid = this._region.attr('data-assignmentid');\n\n // Now we can continue...\n ajax.call([{\n methodname: 'mod_assign_submit_grading_form',\n args: {assignmentid: assignmentid, userid: this._lastUserId, jsonformdata: JSON.stringify(data)},\n done: this._handleFormSubmissionResponse.bind(this, data, nextUserId, nextUser),\n fail: notification.exception\n }]);\n };\n\n /**\n * Handle form submission response.\n *\n * @private\n * @method _handleFormSubmissionResponse\n * @param {Array} formdata - submitted values\n * @param {Integer} nextUserId - optional. The id of the user to load after the form is saved.\n * @param {Array} response List of errors.\n * @param {Boolean} nextUser - optional. If true, switch to next user in the grading list.\n */\n GradingPanel.prototype._handleFormSubmissionResponse = function(formdata, nextUserId, nextUser, response) {\n if (typeof nextUserId === \"undefined\") {\n nextUserId = this._lastUserId;\n }\n if (response.length) {\n // There was an error saving the grade. Re-render the form using the submitted data so we can show\n // validation errors.\n $(document).trigger('reset', [this._lastUserId, formdata]);\n } else {\n str.get_strings([\n {key: 'gradechangessaveddetail', component: 'mod_assign'},\n ]).done(function(strs) {\n Toast.add(strs[0]);\n }).fail(notification.exception);\n Y.use('moodle-core-formchangechecker', function() {\n M.core_formchangechecker.reset_form_dirty_state();\n });\n if (nextUserId == this._lastUserId) {\n $(document).trigger('reset', nextUserId);\n } else if (nextUser) {\n $(document).trigger('done-saving-show-next', true);\n } else {\n $(document).trigger('user-changed', nextUserId);\n }\n }\n $('[data-region=\"overlay\"]').hide();\n };\n\n /**\n * Refresh form with default values.\n *\n * @private\n * @method _resetForm\n * @param {Event} e\n * @param {Integer} userid\n * @param {Array} formdata\n */\n GradingPanel.prototype._resetForm = function(e, userid, formdata) {\n // The form was cancelled - refresh with default values.\n var event = $.Event(\"custom\");\n if (typeof userid == \"undefined\") {\n userid = this._lastUserId;\n }\n this._lastUserId = 0;\n this._refreshGradingPanel(event, userid, formdata);\n };\n\n /**\n * Open a picker to choose an older attempt.\n *\n * @private\n * @param {Object} e\n * @method _chooseAttempt\n */\n GradingPanel.prototype._chooseAttempt = function(e) {\n // Show a dialog.\n\n // The form is in the element pointed to by data-submissions.\n var link = $(e.target);\n var submissionsId = link.data('submissions');\n var submissionsform = $(document.getElementById(submissionsId));\n var formcopy = submissionsform.clone();\n var formhtml = formcopy.wrap($('
')).html();\n\n str.get_strings([\n {key: 'viewadifferentattempt', component: 'mod_assign'},\n {key: 'view', component: 'core'},\n {key: 'cancel', component: 'core'},\n ]).done(function(strs) {\n notification.confirm(strs[0], formhtml, strs[1], strs[2], function() {\n var attemptnumber = $(\"input:radio[name='select-attemptnumber']:checked\").val();\n\n this._refreshGradingPanel(null, this._lastUserId, '', attemptnumber);\n }.bind(this));\n }.bind(this)).fail(notification.exception);\n };\n\n /**\n * Add popout buttons\n *\n * @private\n * @method _addPopoutButtons\n * @param {JQuery} selector The region selector to add popout buttons to.\n */\n GradingPanel.prototype._addPopoutButtons = function(selector) {\n var region = $(selector);\n\n templates.render('mod_assign/popout_button', {}).done(function(html) {\n var parents = region.find('[data-fieldtype=\"filemanager\"],[data-fieldtype=\"editor\"],[data-fieldtype=\"grading\"]')\n .closest('.fitem');\n parents.addClass('has-popout').find('label').parent().append(html);\n\n region.on('click', '[data-region=\"popout-button\"]', this._togglePopout.bind(this));\n }.bind(this)).fail(notification.exception);\n };\n\n /**\n * Make a div \"popout\" or \"popback\".\n *\n * @private\n * @method _togglePopout\n * @param {Event} event\n */\n GradingPanel.prototype._togglePopout = function(event) {\n event.preventDefault();\n var container = $(event.target).closest('.fitem');\n if (container.hasClass('popout')) {\n $('.popout').removeClass('popout');\n } else {\n $('.popout').removeClass('popout');\n container.addClass('popout');\n container.addClass('moodle-has-zindex');\n }\n };\n\n /**\n * Get the user context - re-render the template in the page.\n *\n * @private\n * @method _refreshGradingPanel\n * @param {Event} event\n * @param {Number} userid\n * @param {String} submissiondata serialised submission data.\n * @param {Integer} attemptnumber\n */\n GradingPanel.prototype._refreshGradingPanel = function(event, userid, submissiondata, attemptnumber) {\n var contextid = this._region.attr('data-contextid');\n if (typeof submissiondata === 'undefined') {\n submissiondata = '';\n }\n if (typeof attemptnumber === 'undefined') {\n attemptnumber = -1;\n }\n // Skip reloading if it is the same user.\n if (this._lastUserId == userid && this._lastAttemptNumber == attemptnumber && submissiondata === '') {\n return;\n }\n this._lastUserId = userid;\n this._lastAttemptNumber = attemptnumber;\n $(document).trigger('start-loading-user');\n // Tell behat to back off too.\n window.M.util.js_pending('mod-assign-loading-user');\n // First insert the loading template.\n templates.render('mod_assign/loading', {}).done(function(html, js) {\n // Update the page.\n this._niceReplaceNodeContents(this._region, html, js).done(function() {\n if (userid > 0) {\n this._region.show();\n // Reload the grading form \"fragment\" for this user.\n var params = {userid: userid, attemptnumber: attemptnumber, jsonformdata: JSON.stringify(submissiondata)};\n fragment.loadFragment('mod_assign', 'gradingpanel', contextid, params).done(function(html, js) {\n this._niceReplaceNodeContents(this._region, html, js)\n .done(function() {\n checker.saveFormState('[data-region=\"grade-panel\"] .gradeform');\n $(document).on('editor-content-restored', function() {\n // If the editor has some content that has been restored\n // then save the form state again for comparison.\n checker.saveFormState('[data-region=\"grade-panel\"] .gradeform');\n });\n $('[data-region=\"attempt-chooser\"]').on('click', this._chooseAttempt.bind(this));\n this._addPopoutButtons('[data-region=\"grade-panel\"] .gradeform');\n $(document).trigger('finish-loading-user');\n // Tell behat we are friends again.\n window.M.util.js_complete('mod-assign-loading-user');\n }.bind(this))\n .fail(notification.exception);\n }.bind(this)).fail(notification.exception);\n $('[data-region=\"review-panel\"]').show();\n } else {\n this._region.hide();\n $('[data-region=\"review-panel\"]').hide();\n $(document).trigger('finish-loading-user');\n // Tell behat we are friends again.\n window.M.util.js_complete('mod-assign-loading-user');\n }\n }.bind(this));\n }.bind(this)).fail(notification.exception);\n };\n\n /**\n * Get next user data and store it in global variables\n *\n * @private\n * @method _getNextUser\n * @param {Event} event\n * @param {Object} data Next user's data\n */\n GradingPanel.prototype._getNextUser = function(event, data) {\n this.nextUserId = data.nextUserId;\n this.nextUser = data.nextUser;\n };\n\n /**\n * Handle the save-and-show-next event\n *\n * @private\n * @method _handleSaveAndShowNext\n */\n GradingPanel.prototype._handleSaveAndShowNext = function() {\n this._submitForm(null, this.nextUserId, this.nextUser);\n };\n\n /**\n * Get the grade panel element.\n *\n * @method getPanelElement\n * @return {jQuery}\n */\n GradingPanel.prototype.getPanelElement = function() {\n return $('[data-region=\"grade-panel\"]');\n };\n\n /**\n * Hide the grade panel.\n *\n * @method collapsePanel\n */\n GradingPanel.prototype.collapsePanel = function() {\n this.getPanelElement().addClass('collapsed');\n };\n\n /**\n * Show the grade panel.\n *\n * @method expandPanel\n */\n GradingPanel.prototype.expandPanel = function() {\n this.getPanelElement().removeClass('collapsed');\n };\n\n /**\n * Register event listeners for the grade panel.\n *\n * @method registerEventListeners\n */\n GradingPanel.prototype.registerEventListeners = function() {\n var docElement = $(document);\n var region = $(this._region);\n // Add an event listener to prevent form submission when pressing enter key.\n region.on('submit', 'form', function(e) {\n e.preventDefault();\n });\n\n docElement.on('next-user', this._getNextUser.bind(this));\n docElement.on('user-changed', this._refreshGradingPanel.bind(this));\n docElement.on('save-changes', this._submitForm.bind(this));\n docElement.on('save-and-show-next', this._handleSaveAndShowNext.bind(this));\n docElement.on('reset', this._resetForm.bind(this));\n\n docElement.on('save-form-state', this._saveFormState.bind(this));\n\n docElement.on(GradingEvents.COLLAPSE_GRADE_PANEL, function() {\n this.collapsePanel();\n }.bind(this));\n\n // We should expand if the review panel is collapsed.\n docElement.on(GradingEvents.COLLAPSE_REVIEW_PANEL, function() {\n this.expandPanel();\n }.bind(this));\n\n docElement.on(GradingEvents.EXPAND_GRADE_PANEL, function() {\n this.expandPanel();\n }.bind(this));\n };\n\n return GradingPanel;\n});\n"],"file":"grading_panel.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/grading_panel.js"],"names":["define","$","Y","notification","templates","fragment","ajax","str","checker","GradingEvents","FormEvents","Toast","GradingPanel","selector","_regionSelector","_region","_userCache","registerEventListeners","prototype","_lastUserId","_lastAttemptNumber","nextUserId","nextUser","_niceReplaceNodeContents","node","html","js","promise","Deferred","fadeOut","replaceNodeContents","fadeIn","resolve","_saveFormState","checked","prop","val","_submitForm","event","commentAreaElement","document","querySelector","commentTextAreaElement","value","commentActionPostElement","click","form","find","show","trigger","notifyFormSubmittedByJavascript","data","serialize","assignmentid","attr","call","methodname","args","userid","jsonformdata","JSON","stringify","done","_handleFormSubmissionResponse","bind","fail","exception","formdata","response","length","get_strings","key","component","strs","add","use","M","core_formchangechecker","reset_form_dirty_state","hide","_resetForm","e","Event","_refreshGradingPanel","_chooseAttempt","link","target","submissionsId","submissionsform","getElementById","formcopy","clone","formhtml","wrap","confirm","attemptnumber","_addPopoutButtons","region","render","parents","closest","addClass","parent","append","on","_togglePopout","preventDefault","container","hasClass","removeClass","submissiondata","contextid","window","util","js_pending","params","loadFragment","saveFormState","js_complete","_getNextUser","_handleSaveAndShowNext","getPanelElement","collapsePanel","expandPanel","docElement","COLLAPSE_GRADE_PANEL","COLLAPSE_REVIEW_PANEL","EXPAND_GRADE_PANEL"],"mappings":"AAuBAA,OAAM,4BAAC,CACH,QADG,CACO,UADP,CACmB,mBADnB,CACwC,gBADxC,CAC0D,eAD1D,CAEH,WAFG,CAEU,UAFV,CAEsB,wCAFtB,CAGH,2BAHG,CAG0B,kBAH1B,CAG8C,YAH9C,CAAD,CAKN,SAASC,CAAT,CAAYC,CAAZ,CAAeC,CAAf,CAA6BC,CAA7B,CAAwCC,CAAxC,CAAkDC,CAAlD,CAAwDC,CAAxD,CAA6DC,CAA7D,CAAsEC,CAAtE,CAAqFC,CAArF,CAAiGC,CAAjG,CAAwG,CAQpG,GAAIC,CAAAA,CAAY,CAAG,SAASC,CAAT,CAAmB,CAClC,KAAKC,eAAL,CAAuBD,CAAvB,CACA,KAAKE,OAAL,CAAed,CAAC,CAACY,CAAD,CAAhB,CACA,KAAKG,UAAL,CAAkB,EAAlB,CAEA,KAAKC,sBAAL,EACH,CAND,CASAL,CAAY,CAACM,SAAb,CAAuBJ,eAAv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CAAc,oBAAd,CAAoC,KAAKgB,sBAAL,CAA4BxD,IAA5B,CAAiC,IAAjC,CAApC,EACA4D,CAAU,CAACpB,EAAX,CAAc,OAAd,CAAuB,KAAKxB,UAAL,CAAgBhB,IAAhB,CAAqB,IAArB,CAAvB,EAEA4D,CAAU,CAACpB,EAAX,CAAc,iBAAd,CAAiC,KAAKvE,cAAL,CAAoB+B,IAApB,CAAyB,IAAzB,CAAjC,EAEA4D,CAAU,CAACpB,EAAX,CAAc/F,CAAa,CAACoH,oBAA5B,CAAkD,UAAW,CACzD,KAAKH,aAAL,EACH,CAFiD,CAEhD1D,IAFgD,CAE3C,IAF2C,CAAlD,EAKA4D,CAAU,CAACpB,EAAX,CAAc/F,CAAa,CAACqH,qBAA5B,CAAmD,UAAW,CAC1D,KAAKH,WAAL,EACH,CAFkD,CAEjD3D,IAFiD,CAE5C,IAF4C,CAAnD,EAIA4D,CAAU,CAACpB,EAAX,CAAc/F,CAAa,CAACsH,kBAA5B,CAAgD,UAAW,CACvD,KAAKJ,WAAL,EACH,CAF+C,CAE9C3D,IAF8C,CAEzC,IAFyC,CAAhD,CAGH,CA5BD,CA8BA,MAAOpD,CAAAA,CACV,CA1YK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for the \"Grading\" panel at the right of the page.\n *\n * @module mod_assign/grading_panel\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine([\n 'jquery', 'core/yui', 'core/notification', 'core/templates', 'core/fragment',\n 'core/ajax', 'core/str', 'mod_assign/grading_form_change_checker',\n 'mod_assign/grading_events', 'core_form/events', 'core/toast'\n],\nfunction($, Y, notification, templates, fragment, ajax, str, checker, GradingEvents, FormEvents, Toast) {\n\n /**\n * GradingPanel class.\n *\n * @class mod_assign/grading_panel\n * @param {String} selector The selector for the page region containing the user navigation.\n */\n var GradingPanel = function(selector) {\n this._regionSelector = selector;\n this._region = $(selector);\n this._userCache = [];\n\n this.registerEventListeners();\n };\n\n /** @property {String} Selector for the page region containing the user navigation. */\n GradingPanel.prototype._regionSelector = null;\n\n /** @property {Integer} Remember the last user id to prevent unnessecary reloads. */\n GradingPanel.prototype._lastUserId = 0;\n\n /** @property {Integer} Remember the last attempt number to prevent unnessecary reloads. */\n GradingPanel.prototype._lastAttemptNumber = -1;\n\n /** @property {JQuery} JQuery node for the page region containing the user navigation. */\n GradingPanel.prototype._region = null;\n\n /** @property {Integer} The id of the next user in the grading list */\n GradingPanel.prototype.nextUserId = null;\n\n /** @property {Boolean} Next user exists in the grading list */\n GradingPanel.prototype.nextUser = false;\n\n /**\n * Fade the dom node out, update it, and fade it back.\n *\n * @private\n * @method _niceReplaceNodeContents\n * @param {JQuery} node\n * @param {String} html\n * @param {String} js\n * @return {Deferred} promise resolved when the animations are complete.\n */\n GradingPanel.prototype._niceReplaceNodeContents = function(node, html, js) {\n var promise = $.Deferred();\n\n node.fadeOut(\"fast\", function() {\n templates.replaceNodeContents(node, html, js);\n node.fadeIn(\"fast\", function() {\n promise.resolve();\n });\n });\n\n return promise.promise();\n };\n\n /**\n * Make sure all form fields have the latest saved state.\n * @private\n * @method _saveFormState\n */\n GradingPanel.prototype._saveFormState = function() {\n // Copy data from notify students checkbox which was moved out of the form.\n var checked = $('[data-region=\"grading-actions-form\"] [name=\"sendstudentnotifications\"]').prop(\"checked\");\n $('.gradeform [name=\"sendstudentnotifications\"]').val(checked);\n };\n\n /**\n * Make form submit via ajax.\n *\n * @private\n * @param {Object} event\n * @param {Integer} nextUserId\n * @param {Boolean} nextUser optional. Load next user in the grading list.\n * @method _submitForm\n * @fires event:formSubmittedByJavascript\n */\n GradingPanel.prototype._submitForm = function(event, nextUserId, nextUser) {\n // If the form has data in comment-area, then we need to save that comment\n var commentAreaElement = document.querySelector('.comment-area');\n if (commentAreaElement) {\n var commentTextAreaElement = commentAreaElement.querySelector('.db > textarea');\n if (commentTextAreaElement.value !== '') {\n var commentActionPostElement = commentAreaElement.querySelector('.fd a[id^=\"comment-action-post-\"]');\n commentActionPostElement.click();\n }\n }\n\n // The form was submitted - send it via ajax instead.\n var form = $(this._region.find('form.gradeform'));\n\n $('[data-region=\"overlay\"]').show();\n\n // We call this, so other modules can update the form with the latest state.\n form.trigger('save-form-state');\n\n // Tell all form fields we are about to submit the form.\n FormEvents.notifyFormSubmittedByJavascript(form[0]);\n\n // Now we get all the current values from the form.\n var data = form.serialize();\n var assignmentid = this._region.attr('data-assignmentid');\n\n // Now we can continue...\n ajax.call([{\n methodname: 'mod_assign_submit_grading_form',\n args: {assignmentid: assignmentid, userid: this._lastUserId, jsonformdata: JSON.stringify(data)},\n done: this._handleFormSubmissionResponse.bind(this, data, nextUserId, nextUser),\n fail: notification.exception\n }]);\n };\n\n /**\n * Handle form submission response.\n *\n * @private\n * @method _handleFormSubmissionResponse\n * @param {Array} formdata - submitted values\n * @param {Integer} nextUserId - optional. The id of the user to load after the form is saved.\n * @param {Array} response List of errors.\n * @param {Boolean} nextUser - optional. If true, switch to next user in the grading list.\n */\n GradingPanel.prototype._handleFormSubmissionResponse = function(formdata, nextUserId, nextUser, response) {\n if (typeof nextUserId === \"undefined\") {\n nextUserId = this._lastUserId;\n }\n if (response.length) {\n // There was an error saving the grade. Re-render the form using the submitted data so we can show\n // validation errors.\n $(document).trigger('reset', [this._lastUserId, formdata]);\n } else {\n str.get_strings([\n {key: 'gradechangessaveddetail', component: 'mod_assign'},\n ]).done(function(strs) {\n Toast.add(strs[0]);\n }).fail(notification.exception);\n Y.use('moodle-core-formchangechecker', function() {\n M.core_formchangechecker.reset_form_dirty_state();\n });\n if (nextUserId == this._lastUserId) {\n $(document).trigger('reset', nextUserId);\n } else if (nextUser) {\n $(document).trigger('done-saving-show-next', true);\n } else {\n $(document).trigger('user-changed', nextUserId);\n }\n }\n $('[data-region=\"overlay\"]').hide();\n };\n\n /**\n * Refresh form with default values.\n *\n * @private\n * @method _resetForm\n * @param {Event} e\n * @param {Integer} userid\n * @param {Array} formdata\n */\n GradingPanel.prototype._resetForm = function(e, userid, formdata) {\n // The form was cancelled - refresh with default values.\n var event = $.Event(\"custom\");\n if (typeof userid == \"undefined\") {\n userid = this._lastUserId;\n }\n this._lastUserId = 0;\n this._refreshGradingPanel(event, userid, formdata);\n };\n\n /**\n * Open a picker to choose an older attempt.\n *\n * @private\n * @param {Object} e\n * @method _chooseAttempt\n */\n GradingPanel.prototype._chooseAttempt = function(e) {\n // Show a dialog.\n\n // The form is in the element pointed to by data-submissions.\n var link = $(e.target);\n var submissionsId = link.data('submissions');\n var submissionsform = $(document.getElementById(submissionsId));\n var formcopy = submissionsform.clone();\n var formhtml = formcopy.wrap($('')).html();\n\n str.get_strings([\n {key: 'viewadifferentattempt', component: 'mod_assign'},\n {key: 'view', component: 'core'},\n {key: 'cancel', component: 'core'},\n ]).done(function(strs) {\n notification.confirm(strs[0], formhtml, strs[1], strs[2], function() {\n var attemptnumber = $(\"input:radio[name='select-attemptnumber']:checked\").val();\n\n this._refreshGradingPanel(null, this._lastUserId, '', attemptnumber);\n }.bind(this));\n }.bind(this)).fail(notification.exception);\n };\n\n /**\n * Add popout buttons\n *\n * @private\n * @method _addPopoutButtons\n * @param {JQuery} selector The region selector to add popout buttons to.\n */\n GradingPanel.prototype._addPopoutButtons = function(selector) {\n var region = $(selector);\n\n templates.render('mod_assign/popout_button', {}).done(function(html) {\n var parents = region.find('[data-fieldtype=\"filemanager\"],[data-fieldtype=\"editor\"],[data-fieldtype=\"grading\"]')\n .closest('.fitem');\n parents.addClass('has-popout').find('label').parent().append(html);\n\n region.on('click', '[data-region=\"popout-button\"]', this._togglePopout.bind(this));\n }.bind(this)).fail(notification.exception);\n };\n\n /**\n * Make a div \"popout\" or \"popback\".\n *\n * @private\n * @method _togglePopout\n * @param {Event} event\n */\n GradingPanel.prototype._togglePopout = function(event) {\n event.preventDefault();\n var container = $(event.target).closest('.fitem');\n if (container.hasClass('popout')) {\n $('.popout').removeClass('popout');\n } else {\n $('.popout').removeClass('popout');\n container.addClass('popout');\n container.addClass('moodle-has-zindex');\n }\n };\n\n /**\n * Get the user context - re-render the template in the page.\n *\n * @private\n * @method _refreshGradingPanel\n * @param {Event} event\n * @param {Number} userid\n * @param {String} submissiondata serialised submission data.\n * @param {Integer} attemptnumber\n */\n GradingPanel.prototype._refreshGradingPanel = function(event, userid, submissiondata, attemptnumber) {\n var contextid = this._region.attr('data-contextid');\n if (typeof submissiondata === 'undefined') {\n submissiondata = '';\n }\n if (typeof attemptnumber === 'undefined') {\n attemptnumber = -1;\n }\n // Skip reloading if it is the same user.\n if (this._lastUserId == userid && this._lastAttemptNumber == attemptnumber && submissiondata === '') {\n return;\n }\n this._lastUserId = userid;\n this._lastAttemptNumber = attemptnumber;\n $(document).trigger('start-loading-user');\n // Tell behat to back off too.\n window.M.util.js_pending('mod-assign-loading-user');\n // First insert the loading template.\n templates.render('mod_assign/loading', {}).done(function(html, js) {\n // Update the page.\n this._niceReplaceNodeContents(this._region, html, js).done(function() {\n if (userid > 0) {\n this._region.show();\n // Reload the grading form \"fragment\" for this user.\n var params = {userid: userid, attemptnumber: attemptnumber, jsonformdata: JSON.stringify(submissiondata)};\n fragment.loadFragment('mod_assign', 'gradingpanel', contextid, params).done(function(html, js) {\n this._niceReplaceNodeContents(this._region, html, js)\n .done(function() {\n checker.saveFormState('[data-region=\"grade-panel\"] .gradeform');\n $(document).on('editor-content-restored', function() {\n // If the editor has some content that has been restored\n // then save the form state again for comparison.\n checker.saveFormState('[data-region=\"grade-panel\"] .gradeform');\n });\n $('[data-region=\"attempt-chooser\"]').on('click', this._chooseAttempt.bind(this));\n this._addPopoutButtons('[data-region=\"grade-panel\"] .gradeform');\n $(document).trigger('finish-loading-user');\n // Tell behat we are friends again.\n window.M.util.js_complete('mod-assign-loading-user');\n }.bind(this))\n .fail(notification.exception);\n }.bind(this)).fail(notification.exception);\n $('[data-region=\"review-panel\"]').show();\n } else {\n this._region.hide();\n $('[data-region=\"review-panel\"]').hide();\n $(document).trigger('finish-loading-user');\n // Tell behat we are friends again.\n window.M.util.js_complete('mod-assign-loading-user');\n }\n }.bind(this));\n }.bind(this)).fail(notification.exception);\n };\n\n /**\n * Get next user data and store it in global variables\n *\n * @private\n * @method _getNextUser\n * @param {Event} event\n * @param {Object} data Next user's data\n */\n GradingPanel.prototype._getNextUser = function(event, data) {\n this.nextUserId = data.nextUserId;\n this.nextUser = data.nextUser;\n };\n\n /**\n * Handle the save-and-show-next event\n *\n * @private\n * @method _handleSaveAndShowNext\n */\n GradingPanel.prototype._handleSaveAndShowNext = function() {\n this._submitForm(null, this.nextUserId, this.nextUser);\n };\n\n /**\n * Get the grade panel element.\n *\n * @method getPanelElement\n * @return {jQuery}\n */\n GradingPanel.prototype.getPanelElement = function() {\n return $('[data-region=\"grade-panel\"]');\n };\n\n /**\n * Hide the grade panel.\n *\n * @method collapsePanel\n */\n GradingPanel.prototype.collapsePanel = function() {\n this.getPanelElement().addClass('collapsed');\n };\n\n /**\n * Show the grade panel.\n *\n * @method expandPanel\n */\n GradingPanel.prototype.expandPanel = function() {\n this.getPanelElement().removeClass('collapsed');\n };\n\n /**\n * Register event listeners for the grade panel.\n *\n * @method registerEventListeners\n */\n GradingPanel.prototype.registerEventListeners = function() {\n var docElement = $(document);\n var region = $(this._region);\n // Add an event listener to prevent form submission when pressing enter key.\n region.on('submit', 'form', function(e) {\n e.preventDefault();\n });\n\n docElement.on('next-user', this._getNextUser.bind(this));\n docElement.on('user-changed', this._refreshGradingPanel.bind(this));\n docElement.on('save-changes', this._submitForm.bind(this));\n docElement.on('save-and-show-next', this._handleSaveAndShowNext.bind(this));\n docElement.on('reset', this._resetForm.bind(this));\n\n docElement.on('save-form-state', this._saveFormState.bind(this));\n\n docElement.on(GradingEvents.COLLAPSE_GRADE_PANEL, function() {\n this.collapsePanel();\n }.bind(this));\n\n // We should expand if the review panel is collapsed.\n docElement.on(GradingEvents.COLLAPSE_REVIEW_PANEL, function() {\n this.expandPanel();\n }.bind(this));\n\n docElement.on(GradingEvents.EXPAND_GRADE_PANEL, function() {\n this.expandPanel();\n }.bind(this));\n };\n\n return GradingPanel;\n});\n"],"file":"grading_panel.min.js"} \ No newline at end of file diff --git a/mod/assign/amd/build/grading_review_panel.min.js.map b/mod/assign/amd/build/grading_review_panel.min.js.map index dc852fe0c5883..87f677b2a71ab 100644 --- a/mod/assign/amd/build/grading_review_panel.min.js.map +++ b/mod/assign/amd/build/grading_review_panel.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/grading_review_panel.js"],"names":["define","$","GradingEvents","GradingReviewPanel","_region","registerEventListeners","prototype","getReviewPanel","pluginname","owner","data","getTogglePanelButton","getPanelElement","find","getPanelContentElement","togglePanel","hasClass","document","trigger","EXPAND_REVIEW_PANEL","COLLAPSE_REVIEW_PANEL","collapsePanel","addClass","removeClass","attr","expandPanel","removeAttr","toggleReviewPanelButton","click","e","preventDefault","bind","keydown","metaKey","shiftKey","altKey","ctrlKey","keyCode","docElement","on","COLLAPSE_GRADE_PANEL","EXPAND_GRADE_PANEL"],"mappings":"AAwBAA,OAAM,mCAAC,CAAC,QAAD,CAAW,2BAAX,CAAD,CAA0C,SAASC,CAAT,CAAYC,CAAZ,CAA2B,CAQvE,GAAIC,CAAAA,CAAkB,CAAG,UAAW,CAChC,KAAKC,OAAL,CAAeH,CAAC,CAAC,wCAAD,CAAhB,CACA,KAAKI,sBAAL,EACH,CAHD,CAMAF,CAAkB,CAACG,SAAnB,CAA6BF,OAA7B,CAAuC,IAAvC,CAWAD,CAAkB,CAACG,SA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CAACC,EAAX,CAAcrC,CAAa,CAACiB,mBAA5B,CAAiD,UAAW,CACxD,KAAKM,WAAL,EACH,CAFgD,CAE/CM,IAF+C,CAE1C,IAF0C,CAAjD,EAIAO,CAAU,CAACC,EAAX,CAAcrC,CAAa,CAACuC,kBAA5B,CAAgD,UAAW,CACvD,KAAK7B,eAAL,GAAuBW,WAAvB,CAAmC,uBAAnC,CACH,CAF+C,CAE9CQ,IAF8C,CAEzC,IAFyC,CAAhD,CAGH,CAlCD,CAoCA,MAAO5B,CAAAA,CACV,CA7IK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for the \"Review\" panel at the left of the page.\n *\n * @module mod_assign/grading_review_panel\n * @class GradingReviewPanel\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'mod_assign/grading_events'], function($, GradingEvents) {\n\n /**\n * GradingReviewPanel class.\n *\n * @class GradingReviewPanel\n * @param {String} selector The selector for the page region containing the user navigation.\n */\n var GradingReviewPanel = function() {\n this._region = $('[data-region=\"review-panel-content\"]');\n this.registerEventListeners();\n };\n\n /** @property {JQuery} JQuery node for the page region containing the user navigation. */\n GradingReviewPanel.prototype._region = null;\n\n /**\n * It is first come first served to get ownership of the grading review panel.\n * There can be only one.\n *\n * @public\n * @method getReviewPanel\n * @param {String} pluginname - the first plugin to ask for the panel gets it.\n * @return {DOMNode} or false\n */\n GradingReviewPanel.prototype.getReviewPanel = function(pluginname) {\n var owner = this._region.data('panel-owner');\n if (typeof owner == \"undefined\") {\n this._region.data('review-panel-plugin', pluginname);\n }\n if (this._region.data('review-panel-plugin') == pluginname) {\n return this._region[0];\n }\n return false;\n };\n\n /**\n * Get the toggle review panel button.\n *\n * @method getTogglePanelButton\n * @return {jQuery}\n */\n GradingReviewPanel.prototype.getTogglePanelButton = function() {\n return this.getPanelElement().find('[data-region=\"review-panel-toggle\"]');\n };\n\n /**\n * Get the review panel element.\n *\n * @method getPanelElement\n * @return {jQuery}\n */\n GradingReviewPanel.prototype.getPanelElement = function() {\n return $('[data-region=\"review-panel\"]');\n };\n\n /**\n * Get the review panel content element.\n *\n * @method getPanelContentElement\n * @return {jQuery}\n */\n GradingReviewPanel.prototype.getPanelContentElement = function() {\n return $('[data-region=\"review-panel-content\"]');\n };\n\n /**\n * Show/Hide the review panel.\n *\n * @method togglePanel\n */\n GradingReviewPanel.prototype.togglePanel = function() {\n if (this.getPanelElement().hasClass('collapsed')) {\n $(document).trigger(GradingEvents.EXPAND_REVIEW_PANEL);\n } else {\n $(document).trigger(GradingEvents.COLLAPSE_REVIEW_PANEL);\n }\n };\n\n /**\n * Hide the review panel.\n *\n * @method collapsePanel\n */\n GradingReviewPanel.prototype.collapsePanel = function() {\n this.getPanelElement().addClass('collapsed').removeClass('grade-panel-collapsed');\n this.getPanelContentElement().attr('aria-hidden', true);\n };\n\n /**\n * Show the review panel.\n *\n * @method expandPanel\n */\n GradingReviewPanel.prototype.expandPanel = function() {\n this.getPanelElement().removeClass('collapsed');\n this.getPanelContentElement().removeAttr('aria-hidden');\n };\n\n /**\n * Register event listeners for the review panel.\n *\n * @method registerEventListeners\n */\n GradingReviewPanel.prototype.registerEventListeners = function() {\n var toggleReviewPanelButton = this.getTogglePanelButton();\n toggleReviewPanelButton.click(function(e) {\n this.togglePanel();\n e.preventDefault();\n }.bind(this));\n\n toggleReviewPanelButton.keydown(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.togglePanel();\n e.preventDefault();\n }\n }\n }.bind(this));\n\n var docElement = $(document);\n docElement.on(GradingEvents.COLLAPSE_REVIEW_PANEL, function() {\n this.collapsePanel();\n }.bind(this));\n\n // Need special styling when grade panel is collapsed.\n docElement.on(GradingEvents.COLLAPSE_GRADE_PANEL, function() {\n this.expandPanel();\n this.getPanelElement().addClass('grade-panel-collapsed');\n }.bind(this));\n\n docElement.on(GradingEvents.EXPAND_REVIEW_PANEL, function() {\n this.expandPanel();\n }.bind(this));\n\n docElement.on(GradingEvents.EXPAND_GRADE_PANEL, function() {\n this.getPanelElement().removeClass('grade-panel-collapsed');\n }.bind(this));\n };\n\n return GradingReviewPanel;\n});\n"],"file":"grading_review_panel.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/grading_review_panel.js"],"names":["define","$","GradingEvents","GradingReviewPanel","_region","registerEventListeners","prototype","getReviewPanel","pluginname","owner","data","getTogglePanelButton","getPanelElement","find","getPanelContentElement","togglePanel","hasClass","document","trigger","EXPAND_REVIEW_PANEL","COLLAPSE_REVIEW_PANEL","collapsePanel","addClass","removeClass","attr","expandPanel","removeAttr","toggleReviewPanelButton","click","e","preventDefault","bind","keydown","metaKey","shiftKey","altKey","ctrlKey","keyCode","docElement","on","COLLAPSE_GRADE_PANEL","EXPAND_GRADE_PANEL"],"mappings":"AAuBAA,OAAM,mCAAC,CAAC,QAAD,CAAW,2BAAX,CAAD,CAA0C,SAASC,CAAT,CAAYC,CAAZ,CAA2B,CAQvE,GAAIC,CAAAA,CAAkB,CAAG,UAAW,CAChC,KAAKC,OAAL,CAAeH,CAAC,CAAC,wCAAD,CAAhB,CACA,KAAKI,sBAAL,EACH,CAHD,CAMAF,CAAkB,CAACG,SAAnB,CAA6BF,OAA7B,CAAuC,IAAvC,CAWAD,CAAkB,CAACG,SAAnB,CAA6BC,cAA7B,CAA8C,SAASC,CAAT,CAAqB,CAC/D,GAAIC,CAAAA,CAAK,CAAG,KAA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D,CAE/CM,IAF+C,CAE1C,IAF0C,CAAjD,EAIAO,CAAU,CAACC,EAAX,CAAcrC,CAAa,CAACuC,kBAA5B,CAAgD,UAAW,CACvD,KAAK7B,eAAL,GAAuBW,WAAvB,CAAmC,uBAAnC,CACH,CAF+C,CAE9CQ,IAF8C,CAEzC,IAFyC,CAAhD,CAGH,CAlCD,CAoCA,MAAO5B,CAAAA,CACV,CA7IK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Javascript controller for the \"Review\" panel at the left of the page.\n *\n * @module mod_assign/grading_review_panel\n * @copyright 2016 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'mod_assign/grading_events'], function($, GradingEvents) {\n\n /**\n * GradingReviewPanel class.\n *\n * @class mod_assign/grading_review_panel\n * @param {String} selector The selector for the page region containing the user navigation.\n */\n var GradingReviewPanel = function() {\n this._region = $('[data-region=\"review-panel-content\"]');\n this.registerEventListeners();\n };\n\n /** @property {JQuery} JQuery node for the page region containing the user navigation. */\n GradingReviewPanel.prototype._region = null;\n\n /**\n * It is first come first served to get ownership of the grading review panel.\n * There can be only one.\n *\n * @public\n * @method getReviewPanel\n * @param {String} pluginname - the first plugin to ask for the panel gets it.\n * @return {DOMNode} or false\n */\n GradingReviewPanel.prototype.getReviewPanel = function(pluginname) {\n var owner = this._region.data('panel-owner');\n if (typeof owner == \"undefined\") {\n this._region.data('review-panel-plugin', pluginname);\n }\n if (this._region.data('review-panel-plugin') == pluginname) {\n return this._region[0];\n }\n return false;\n };\n\n /**\n * Get the toggle review panel button.\n *\n * @method getTogglePanelButton\n * @return {jQuery}\n */\n GradingReviewPanel.prototype.getTogglePanelButton = function() {\n return this.getPanelElement().find('[data-region=\"review-panel-toggle\"]');\n };\n\n /**\n * Get the review panel element.\n *\n * @method getPanelElement\n * @return {jQuery}\n */\n GradingReviewPanel.prototype.getPanelElement = function() {\n return $('[data-region=\"review-panel\"]');\n };\n\n /**\n * Get the review panel content element.\n *\n * @method getPanelContentElement\n * @return {jQuery}\n */\n GradingReviewPanel.prototype.getPanelContentElement = function() {\n return $('[data-region=\"review-panel-content\"]');\n };\n\n /**\n * Show/Hide the review panel.\n *\n * @method togglePanel\n */\n GradingReviewPanel.prototype.togglePanel = function() {\n if (this.getPanelElement().hasClass('collapsed')) {\n $(document).trigger(GradingEvents.EXPAND_REVIEW_PANEL);\n } else {\n $(document).trigger(GradingEvents.COLLAPSE_REVIEW_PANEL);\n }\n };\n\n /**\n * Hide the review panel.\n *\n * @method collapsePanel\n */\n GradingReviewPanel.prototype.collapsePanel = function() {\n this.getPanelElement().addClass('collapsed').removeClass('grade-panel-collapsed');\n this.getPanelContentElement().attr('aria-hidden', true);\n };\n\n /**\n * Show the review panel.\n *\n * @method expandPanel\n */\n GradingReviewPanel.prototype.expandPanel = function() {\n this.getPanelElement().removeClass('collapsed');\n this.getPanelContentElement().removeAttr('aria-hidden');\n };\n\n /**\n * Register event listeners for the review panel.\n *\n * @method registerEventListeners\n */\n GradingReviewPanel.prototype.registerEventListeners = function() {\n var toggleReviewPanelButton = this.getTogglePanelButton();\n toggleReviewPanelButton.click(function(e) {\n this.togglePanel();\n e.preventDefault();\n }.bind(this));\n\n toggleReviewPanelButton.keydown(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n this.togglePanel();\n e.preventDefault();\n }\n }\n }.bind(this));\n\n var docElement = $(document);\n docElement.on(GradingEvents.COLLAPSE_REVIEW_PANEL, function() {\n this.collapsePanel();\n }.bind(this));\n\n // Need special styling when grade panel is collapsed.\n docElement.on(GradingEvents.COLLAPSE_GRADE_PANEL, function() {\n this.expandPanel();\n this.getPanelElement().addClass('grade-panel-collapsed');\n }.bind(this));\n\n docElement.on(GradingEvents.EXPAND_REVIEW_PANEL, function() {\n this.expandPanel();\n }.bind(this));\n\n docElement.on(GradingEvents.EXPAND_GRADE_PANEL, function() {\n this.getPanelElement().removeClass('grade-panel-collapsed');\n }.bind(this));\n };\n\n return GradingReviewPanel;\n});\n"],"file":"grading_review_panel.min.js"} \ No newline at end of file diff --git a/mod/assign/amd/src/grading_actions.js b/mod/assign/amd/src/grading_actions.js index 2a2eff23fbab8..1fec81a434efb 100644 --- a/mod/assign/amd/src/grading_actions.js +++ b/mod/assign/amd/src/grading_actions.js @@ -17,7 +17,6 @@ * Javascript controller for the "Actions" panel at the bottom of the page. * * @module mod_assign/grading_actions - * @class GradingActions * @copyright 2016 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 @@ -27,7 +26,7 @@ define(['jquery', 'mod_assign/grading_events'], function($, GradingEvents) { /** * GradingActions class. * - * @class GradingActions + * @class mod_assign/grading_actions * @param {String} selector The selector for the page region containing the actions panel. */ var GradingActions = function(selector) { diff --git a/mod/assign/amd/src/grading_form_change_checker.js b/mod/assign/amd/src/grading_form_change_checker.js index 30496db243996..3cbaa2bfd183e 100644 --- a/mod/assign/amd/src/grading_form_change_checker.js +++ b/mod/assign/amd/src/grading_form_change_checker.js @@ -23,7 +23,7 @@ */ define(['jquery'], function($) { - return /** @alias module:mod_assign/grading_form_change_checker */ { + return { /** * Save the values in the form to a data attribute so they can be compared later for changes. * diff --git a/mod/assign/amd/src/grading_navigation.js b/mod/assign/amd/src/grading_navigation.js index ddeceeab2a824..a0f862149a50e 100644 --- a/mod/assign/amd/src/grading_navigation.js +++ b/mod/assign/amd/src/grading_navigation.js @@ -28,7 +28,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/form-autocomplete', /** * GradingNavigation class. * - * @class GradingNavigation + * @class mod_assign/grading_navigation * @param {String} selector The selector for the page region containing the user navigation. */ var GradingNavigation = function(selector) { diff --git a/mod/assign/amd/src/grading_navigation_user_info.js b/mod/assign/amd/src/grading_navigation_user_info.js index 03e8bb80be5d2..b18ecfcc302fb 100644 --- a/mod/assign/amd/src/grading_navigation_user_info.js +++ b/mod/assign/amd/src/grading_navigation_user_info.js @@ -17,7 +17,6 @@ * Javascript controller for the "User summary" panel at the top of the page. * * @module mod_assign/grading_navigation_user_info - * @class UserInfo * @copyright 2016 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 @@ -27,7 +26,7 @@ define(['jquery', 'core/notification', 'core/ajax', 'core/templates'], function( /** * UserInfo class. * - * @class UserInfo + * @class mod_assign/grading_navigation_user_info * @param {String} selector The selector for the page region containing the user navigation. */ var UserInfo = function(selector) { diff --git a/mod/assign/amd/src/grading_panel.js b/mod/assign/amd/src/grading_panel.js index 480f99a09a228..17f0d356d24f4 100644 --- a/mod/assign/amd/src/grading_panel.js +++ b/mod/assign/amd/src/grading_panel.js @@ -31,7 +31,7 @@ function($, Y, notification, templates, fragment, ajax, str, checker, GradingEve /** * GradingPanel class. * - * @class GradingPanel + * @class mod_assign/grading_panel * @param {String} selector The selector for the page region containing the user navigation. */ var GradingPanel = function(selector) { diff --git a/mod/assign/amd/src/grading_review_panel.js b/mod/assign/amd/src/grading_review_panel.js index 05cae7282dc1d..0deea8a34601a 100644 --- a/mod/assign/amd/src/grading_review_panel.js +++ b/mod/assign/amd/src/grading_review_panel.js @@ -17,7 +17,6 @@ * Javascript controller for the "Review" panel at the left of the page. * * @module mod_assign/grading_review_panel - * @class GradingReviewPanel * @copyright 2016 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 @@ -27,7 +26,7 @@ define(['jquery', 'mod_assign/grading_events'], function($, GradingEvents) { /** * GradingReviewPanel class. * - * @class GradingReviewPanel + * @class mod_assign/grading_review_panel * @param {String} selector The selector for the page region containing the user navigation. */ var GradingReviewPanel = function() { diff --git a/mod/forum/amd/build/discussion_nested_v2.min.js.map b/mod/forum/amd/build/discussion_nested_v2.min.js.map index a370455ff036e..cfa47db266428 100644 --- a/mod/forum/amd/build/discussion_nested_v2.min.js.map +++ b/mod/forum/amd/build/discussion_nested_v2.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/discussion_nested_v2.js"],"names":["getPostContainer","element","closest","Selectors","post","getPostContainerById","id","find","getParentPostContainers","parents","getPostContentContainer","postContainer","children","not","repliesContainer","forumCoreContent","getInPageReplyContainer","filter","inpageReplyContainer","getInPageReplyForm","inpageReplyContent","getInPageReplyCreateButton","inpageReplyCreateButton","getRepliesVisibilityToggleContainer","repliesVisibilityToggleContainer","getRepliesContainer","hasReplies","length","getShowRepliesButton","replyVisibilityToggleContainer","showReplies","getHideRepliesButton","hideReplies","repliesVisible","is","postIdToSee","showButton","hideButton","addClass","removeClass","slideDown","duration","queue","complete","postContainerToSee","scrollIntoView","css","fadeIn","slideUp","fadeOut","showInPageReplyForm","buildShowInPageReplyFormFunction","additionalTemplateContext","inPageReplyContainer","inPageReplyCreateButton","hasInPageReplyForm","renderInPageReplyTemplate","html","Templates","appendNodeContents","Notification","exception","then","Y","Promise","resolve","use","M","core_formchangechecker","init","formid","one","querySelector","generateID","catch","inPageReplyForm","focus","hideInPageReplyForm","button","postContentContainer","currentSubject","forumSubject","text","currentAuthorName","authorName","context","postid","data","attr","sesskey","cfg","parentsubject","parentauthorname","canreplyprivately","postformat","InPageReply","CONTENT_FORMATS","MOODLE","render","incrementTotalReplyCount","replyCount","each","index","currentCount","parseInt","innerText","registerEventListeners","root","CustomEvents","define","events","activate","AutoRows","on","e","originalEvent","preventDefault","currentTarget","inpageReplyCancelButton","target","EVENTS","POST_CREATED","inpageSubmitBtn","newPostId","postContainers","container","Discussion","discussionToolsContainer","discussion","tools","LockToggle","FavouriteToggle","toggleElement","response","newTargetState","userstate","favourited","Pin","pinned","Subscribe","subscribed"],"mappings":"ubAqBA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,O,2qCAUMA,CAAAA,CAAgB,CAAG,SAACC,CAAD,CAAa,CAClC,MAAOA,CAAAA,CAAO,CAACC,OAAR,CAAgBC,UAAUC,IAAV,CAAeA,IAA/B,CACV,C,CASKC,CAAoB,CAAG,SAACJ,CAAD,CAAUK,CAAV,CAAiB,CAC1C,MAAOL,CAAAA,CAAO,CAACM,IAAR,WAAgBJ,UAAUC,IAAV,CAAeA,IAA/B,0BAAoDE,CAApD,MACV,C,CAQKE,CAAuB,CAAG,SAACP,CAAD,CAAa,CACzC,MAAOA,CAAAA,CAAO,CAACQ,OAAR,CAAgBN,UAAUC,IAAV,CAAeA,IAA/B,CACV,C,CAQKM,CAAuB,CAAG,SAACC,CAAD,CAAmB,CAC/C,MAAOA,CAAAA,CAAa,CAACC,QAAd,GAAyBC,GAAzB,CAA6BV,UAAUC,IAAV,CAAeU,gBAA5C,EAA8DP,IAA9D,CAAmEJ,UAAUC,IAAV,CAAeW,gBAAlF,CACV,C,CAQKC,CAAuB,CAAG,SAACL,CAAD,CAAmB,CAC/C,MAAOA,CAAAA,CAAa,CAACC,QAAd,GAAyBK,MAAzB,CAAgCd,UAAUC,IAAV,CAAec,oBAA/C,CACV,C,CAQKC,CAAkB,CAAG,SAACR,CAAD,CAAmB,CAC1C,MAAOK,CAAAA,CAAuB,CAACL,CAAD,CAAvB,CAAuCJ,IAAvC,CAA4CJ,UAAUC,IAAV,CAAegB,kBAA3D,CACV,C,CAQKC,CAA0B,CAAG,SAACV,CAAD,CAAmB,CAClD,MAAOD,CAAAA,CAAuB,CAACC,CAAD,CAAvB,CAAuCJ,IAAvC,CAA4CJ,UAAUC,IAAV,CAAekB,uBAA3D,CACV,C,CASKC,CAAmC,CAAG,SAACZ,CAAD,C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AAhB,EAEAZ,UAAY1B,IAAZ,CAAiBsC,CAAjB,EAGA,GAAMoB,CAAAA,CAAwB,CAAGpB,CAAI,CAACpG,IAAL,CAAUJ,UAAU6H,UAAV,CAAqBC,KAA/B,CAAjC,CACAC,UAAW7D,IAAX,CAAgB0D,CAAhB,KACAI,UAAgB9D,IAAhB,CAAqB0D,CAArB,IAAsD,SAACK,CAAD,CAAgBC,CAAhB,CAA6B,CAC/E,GAAMC,CAAAA,CAAc,CAAGD,CAAQ,CAACE,SAAT,CAAmBC,UAAnB,CAAgC,CAAhC,CAAoC,CAA3D,CACA,MAAOJ,CAAAA,CAAa,CAAC7C,IAAd,CAAmB,aAAnB,CAAkC+C,CAAlC,CACV,CAHD,EAIAG,UAAIpE,IAAJ,CAAS0D,CAAT,IAA0C,SAACK,CAAD,CAAgBC,CAAhB,CAA6B,CACnE,GAAMC,CAAAA,CAAc,CAAGD,CAAQ,CAACK,MAAT,CAAkB,CAAlB,CAAsB,CAA7C,CACA,MAAON,CAAAA,CAAa,CAAC7C,IAAd,CAAmB,aAAnB,CAAkC+C,CAAlC,CACV,CAHD,EAIAK,UAAUtE,IAAV,CAAe0D,CAAf,IAAgD,SAACK,CAAD,CAAgBC,CAAhB,CAA6B,CACzE,GAAMC,CAAAA,CAAc,CAAGD,CAAQ,CAACE,SAAT,CAAmBK,UAAnB,CAAgC,CAAhC,CAAoC,CAA3D,CACAR,CAAa,CAAC7C,IAAd,CAAmB,aAAnB,CAAkC+C,CAAlC,CACH,CAHD,CAIH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module for viewing a discussion in nested v2 view.\n *\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport $ from 'jquery';\nimport AutoRows from 'core/auto_rows';\nimport CustomEvents from 'core/custom_interaction_events';\nimport Notification from 'core/notification';\nimport Templates from 'core/templates';\nimport Discussion from 'mod_forum/discussion';\nimport InPageReply from 'mod_forum/inpage_reply';\nimport LockToggle from 'mod_forum/lock_toggle';\nimport FavouriteToggle from 'mod_forum/favourite_toggle';\nimport Pin from 'mod_forum/pin_toggle';\nimport Selectors from 'mod_forum/selectors';\nimport Subscribe from 'mod_forum/subscription_toggle';\n\nconst ANIMATION_DURATION = 150;\n\n/**\n * Get the closest post container element from the given element.\n *\n * @param {Object} element jQuery element to search from\n * @return {Object} jQuery element\n */\nconst getPostContainer = (element) => {\n return element.closest(Selectors.post.post);\n};\n\n/**\n * Get the closest post container element from the given element.\n *\n * @param {Object} element jQuery element to search from\n * @param {Number} id Id of the post to find.\n * @return {Object} jQuery element\n */\nconst getPostContainerById = (element, id) => {\n return element.find(`${Selectors.post.post}[data-post-id=${id}]`);\n};\n\n/**\n * Get the parent post container elements from the given element.\n *\n * @param {Object} element jQuery element to search from\n * @return {Object} jQuery element\n */\nconst getParentPostContainers = (element) => {\n return element.parents(Selectors.post.post);\n};\n\n/**\n * Get the post content container element from the post container element.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery element\n */\nconst getPostContentContainer = (postContainer) => {\n return postContainer.children().not(Selectors.post.repliesContainer).find(Selectors.post.forumCoreContent);\n};\n\n/**\n * Get the in page reply container element from the post container element.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery element\n */\nconst getInPageReplyContainer = (postContainer) => {\n return postContainer.children().filter(Selectors.post.inpageReplyContainer);\n};\n\n/**\n * Get the in page reply form element from the post container element.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery element\n */\nconst getInPageReplyForm = (postContainer) => {\n return getInPageReplyContainer(postContainer).find(Selectors.post.inpageReplyContent);\n};\n\n/**\n * Get the in page reply create (reply) button element from the post container element.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery element\n */\nconst getInPageReplyCreateButton = (postContainer) => {\n return getPostContentContainer(postContainer).find(Selectors.post.inpageReplyCreateButton);\n};\n\n/**\n * Get the replies visibility toggle container (show/hide replies button container) element\n * from the post container element.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery element\n */\nconst getRepliesVisibilityToggleContainer = (postContainer) => {\n return postContainer.children(Selectors.post.repliesVisibilityToggleContainer);\n};\n\n/**\n * Get the replies container element from the post container element.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery element\n */\nconst getRepliesContainer = (postContainer) => {\n return postContainer.children(Selectors.post.repliesContainer);\n};\n\n/**\n * Check if the post has any replies.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Bool}\n */\nconst hasReplies = (postContainer) => {\n return getRepliesContainer(postContainer).children().length > 0;\n};\n\n/**\n * Get the show replies button element from the replies visibility toggle container element.\n *\n * @param {Object} replyVisibilityToggleContainer jQuery element for the toggle container\n * @return {Object} jQuery element\n */\nconst getShowRepliesButton = (replyVisibilityToggleContainer) => {\n return replyVisibilityToggleContainer.find(Selectors.post.showReplies);\n};\n\n/**\n * Get the hide replies button element from the replies visibility toggle container element.\n *\n * @param {Object} replyVisibilityToggleContainer jQuery element for the toggle container\n * @return {Object} jQuery element\n */\nconst getHideRepliesButton = (replyVisibilityToggleContainer) => {\n return replyVisibilityToggleContainer.find(Selectors.post.hideReplies);\n};\n\n/**\n * Check if the replies are visible.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Bool}\n */\nconst repliesVisible = (postContainer) => {\n const repliesContainer = getRepliesContainer(postContainer);\n return repliesContainer.is(':visible');\n};\n\n/**\n * Show the post replies.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @param {Number|null} postIdToSee Id of the post to scroll into view (if any)\n */\nconst showReplies = (postContainer, postIdToSee = null) => {\n const repliesContainer = getRepliesContainer(postContainer);\n const replyVisibilityToggleContainer = getRepliesVisibilityToggleContainer(postContainer);\n const showButton = getShowRepliesButton(replyVisibilityToggleContainer);\n const hideButton = getHideRepliesButton(replyVisibilityToggleContainer);\n\n showButton.addClass('hidden');\n hideButton.removeClass('hidden');\n\n repliesContainer.slideDown({\n duration: ANIMATION_DURATION,\n queue: false,\n complete: () => {\n if (postIdToSee) {\n const postContainerToSee = getPostContainerById(repliesContainer, postIdToSee);\n if (postContainerToSee.length) {\n postContainerToSee[0].scrollIntoView();\n }\n }\n }\n }).css('display', 'none').fadeIn(ANIMATION_DURATION);\n};\n\n/**\n * Hide the post replies.\n *\n * @param {Object} postContainer jQuery element for the post container\n */\nconst hideReplies = (postContainer) => {\n const repliesContainer = getRepliesContainer(postContainer);\n const replyVisibilityToggleContainer = getRepliesVisibilityToggleContainer(postContainer);\n const showButton = getShowRepliesButton(replyVisibilityToggleContainer);\n const hideButton = getHideRepliesButton(replyVisibilityToggleContainer);\n\n showButton.removeClass('hidden');\n hideButton.addClass('hidden');\n\n repliesContainer.slideUp({\n duration: ANIMATION_DURATION,\n queue: false\n }).fadeOut(ANIMATION_DURATION);\n};\n\n/** Variable to hold the showInPageReplyForm function after it's built. */\nlet showInPageReplyForm = null;\n\n/**\n * Build the showInPageReplyForm function with the given additional template context.\n *\n * @param {Object} additionalTemplateContext Additional render context for the in page reply template.\n * @return {Function}\n */\nconst buildShowInPageReplyFormFunction = (additionalTemplateContext) => {\n /**\n * Show the in page reply form in the given in page reply container. The form\n * display will be animated.\n *\n * @param {Object} postContainer jQuery element for the post container\n */\n return async (postContainer) => {\n\n const inPageReplyContainer = getInPageReplyContainer(postContainer);\n const repliesVisibilityToggleContainer = getRepliesVisibilityToggleContainer(postContainer);\n const inPageReplyCreateButton = getInPageReplyCreateButton(postContainer);\n\n if (!hasInPageReplyForm(inPageReplyContainer)) {\n try {\n const html = await renderInPageReplyTemplate(additionalTemplateContext, inPageReplyCreateButton, postContainer);\n Templates.appendNodeContents(inPageReplyContainer, html, '');\n } catch (e) {\n Notification.exception(e);\n }\n\n // Load formchangechecker module.\n import('core/yui')\n .then(Y => {\n return new Promise(resolve => {\n Y.use('moodle-core-formchangechecker', Y => {\n resolve(Y);\n });\n });\n })\n .then(Y => {\n M.core_formchangechecker.init({formid: Y.one(postContainer[0].querySelector('form')).generateID()});\n return Y;\n })\n .catch();\n }\n\n inPageReplyCreateButton.fadeOut(ANIMATION_DURATION, () => {\n const inPageReplyForm = getInPageReplyForm(postContainer);\n inPageReplyForm.slideDown({\n duration: ANIMATION_DURATION,\n queue: false,\n complete: () => {\n inPageReplyForm.find('textarea').focus();\n }\n }).css('display', 'none').fadeIn(ANIMATION_DURATION);\n\n if (repliesVisibilityToggleContainer.length && hasReplies(postContainer)) {\n repliesVisibilityToggleContainer.fadeIn(ANIMATION_DURATION);\n hideReplies(postContainer);\n }\n });\n };\n};\n\n/**\n * Hide the in page reply form in the given in page reply container. The form\n * display will be animated.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @param {Number|null} postIdToSee Id of the post to scroll into view (if any)\n */\nconst hideInPageReplyForm = (postContainer, postIdToSee = null) => {\n const inPageReplyForm = getInPageReplyForm(postContainer);\n const inPageReplyCreateButton = getInPageReplyCreateButton(postContainer);\n const repliesVisibilityToggleContainer = getRepliesVisibilityToggleContainer(postContainer);\n\n if (repliesVisibilityToggleContainer.length && hasReplies(postContainer)) {\n repliesVisibilityToggleContainer.fadeOut(ANIMATION_DURATION);\n if (!repliesVisible(postContainer)) {\n showReplies(postContainer, postIdToSee);\n }\n }\n\n inPageReplyForm.slideUp({\n duration: ANIMATION_DURATION,\n queue: false,\n complete: () => {\n inPageReplyCreateButton.fadeIn(ANIMATION_DURATION);\n }\n }).fadeOut(200);\n};\n\n/**\n * Check if the in page reply container contains the in page reply form.\n *\n * @param {Object} inPageReplyContainer jQuery element for the in page reply container\n * @return {Bool}\n */\nconst hasInPageReplyForm = (inPageReplyContainer) => {\n return inPageReplyContainer.find(Selectors.post.inpageReplyContent).length > 0;\n};\n\n/**\n * Render the template to generate the in page reply form HTML.\n *\n * @param {Object} additionalTemplateContext Additional render context for the in page reply template\n * @param {Object} button jQuery element for the reply button that was clicked\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery promise\n */\nconst renderInPageReplyTemplate = (additionalTemplateContext, button, postContainer) => {\n const postContentContainer = getPostContentContainer(postContainer);\n const currentSubject = postContentContainer.find(Selectors.post.forumSubject).text();\n const currentAuthorName = postContentContainer.find(Selectors.post.authorName).text();\n const context = {\n postid: postContainer.data('post-id'),\n \"reply_url\": button.attr('data-href'),\n sesskey: M.cfg.sesskey,\n parentsubject: currentSubject,\n parentauthorname: currentAuthorName,\n canreplyprivately: button.data('can-reply-privately'),\n postformat: InPageReply.CONTENT_FORMATS.MOODLE,\n ...additionalTemplateContext\n };\n\n return Templates.render('mod_forum/inpage_reply_v2', context);\n};\n\n/**\n * Increment the total reply count in the show/hide replies buttons for the post.\n *\n * @param {Object} postContainer jQuery element for the post container\n */\nconst incrementTotalReplyCount = (postContainer) => {\n getRepliesVisibilityToggleContainer(postContainer).find(Selectors.post.replyCount).each((index, element) => {\n const currentCount = parseInt(element.innerText, 10);\n element.innerText = currentCount + 1;\n });\n};\n\n/**\n * Create all of the event listeners for the discussion.\n *\n * @param {Object} root jQuery element for the discussion container\n */\nconst registerEventListeners = (root) => {\n CustomEvents.define(root, [CustomEvents.events.activate]);\n // Auto expanding text area for in page reply.\n AutoRows.init(root);\n\n // Reply button is clicked.\n root.on(CustomEvents.events.activate, Selectors.post.inpageReplyCreateButton, (e, data) => {\n data.originalEvent.preventDefault();\n const postContainer = getPostContainer($(e.currentTarget));\n showInPageReplyForm(postContainer);\n });\n\n // Cancel in page reply button.\n root.on(CustomEvents.events.activate, Selectors.post.inpageReplyCancelButton, (e, data) => {\n data.originalEvent.preventDefault();\n const postContainer = getPostContainer($(e.currentTarget));\n hideInPageReplyForm(postContainer);\n });\n\n // Show replies button clicked.\n root.on(CustomEvents.events.activate, Selectors.post.showReplies, (e, data) => {\n data.originalEvent.preventDefault();\n const postContainer = getPostContainer($(e.target));\n showReplies(postContainer);\n });\n\n // Hide replies button clicked.\n root.on(CustomEvents.events.activate, Selectors.post.hideReplies, (e, data) => {\n data.originalEvent.preventDefault();\n const postContainer = getPostContainer($(e.target));\n hideReplies(postContainer);\n });\n\n // Post created with in page reply.\n root.on(InPageReply.EVENTS.POST_CREATED, Selectors.post.inpageSubmitBtn, (e, newPostId) => {\n const currentTarget = $(e.currentTarget);\n const postContainer = getPostContainer(currentTarget);\n const postContainers = getParentPostContainers(currentTarget);\n hideInPageReplyForm(postContainer, newPostId);\n\n postContainers.each((index, container) => {\n incrementTotalReplyCount($(container));\n });\n });\n};\n\n/**\n * Initialise the javascript for the discussion in nested v2 display mode.\n *\n * @param {Object} root jQuery element for the discussion container\n * @param {Object} context Additional render context for the in page reply template\n */\nexport const init = (root, context) => {\n // Build the showInPageReplyForm function with the additional render context.\n showInPageReplyForm = buildShowInPageReplyFormFunction(context);\n // Add discussion event listeners.\n registerEventListeners(root);\n // Initialise default discussion javascript (keyboard nav etc).\n Discussion.init(root);\n // Add in page reply javascript.\n InPageReply.init(root);\n\n // Initialise the settings menu javascript.\n const discussionToolsContainer = root.find(Selectors.discussion.tools);\n LockToggle.init(discussionToolsContainer, false);\n FavouriteToggle.init(discussionToolsContainer, false, (toggleElement, response) => {\n const newTargetState = response.userstate.favourited ? 0 : 1;\n return toggleElement.data('targetstate', newTargetState);\n });\n Pin.init(discussionToolsContainer, false, (toggleElement, response) => {\n const newTargetState = response.pinned ? 0 : 1;\n return toggleElement.data('targetstate', newTargetState);\n });\n Subscribe.init(discussionToolsContainer, false, (toggleElement, response) => {\n const newTargetState = response.userstate.subscribed ? 0 : 1;\n toggleElement.data('targetstate', newTargetState);\n });\n};\n"],"file":"discussion_nested_v2.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/discussion_nested_v2.js"],"names":["getPostContainer","element","closest","Selectors","post","getPostContainerById","id","find","getParentPostContainers","parents","getPostContentContainer","postContainer","children","not","repliesContainer","forumCoreContent","getInPageReplyContainer","filter","inpageReplyContainer","getInPageReplyForm","inpageReplyContent","getInPageReplyCreateButton","inpageReplyCreateButton","getRepliesVisibilityToggleContainer","repliesVisibilityToggleContainer","getRepliesContainer","hasReplies","length","getShowRepliesButton","replyVisibilityToggleContainer","showReplies","getHideRepliesButton","hideReplies","repliesVisible","is","postIdToSee","showButton","hideButton","addClass","removeClass","slideDown","duration","queue","complete","postContainerToSee","scrollIntoView","css","fadeIn","slideUp","fadeOut","showInPageReplyForm","buildShowInPageReplyFormFunction","additionalTemplateContext","inPageReplyContainer","inPageReplyCreateButton","hasInPageReplyForm","renderInPageReplyTemplate","html","Templates","appendNodeContents","Notification","exception","then","Y","Promise","resolve","use","M","core_formchangechecker","init","formid","one","querySelector","generateID","catch","inPageReplyForm","focus","hideInPageReplyForm","button","postContentContainer","currentSubject","forumSubject","text","currentAuthorName","authorName","context","postid","data","attr","sesskey","cfg","parentsubject","parentauthorname","canreplyprivately","postformat","InPageReply","CONTENT_FORMATS","MOODLE","render","incrementTotalReplyCount","replyCount","each","index","currentCount","parseInt","innerText","registerEventListeners","root","CustomEvents","define","events","activate","AutoRows","on","e","originalEvent","preventDefault","currentTarget","inpageReplyCancelButton","target","EVENTS","POST_CREATED","inpageSubmitBtn","newPostId","postContainers","container","Discussion","discussionToolsContainer","discussion","tools","LockToggle","FavouriteToggle","toggleElement","response","newTargetState","userstate","favourited","Pin","pinned","Subscribe","subscribed"],"mappings":"ubAsBA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,O,2qCAUMA,CAAAA,CAAgB,CAAG,SAACC,CAAD,CAAa,CAClC,MAAOA,CAAAA,CAAO,CAACC,OAAR,CAAgBC,UAAUC,IAAV,CAAeA,IAA/B,CACV,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AAc,CAAGD,CAAQ,CAACE,SAAT,CAAmBC,UAAnB,CAAgC,CAAhC,CAAoC,CAA3D,CACA,MAAOJ,CAAAA,CAAa,CAAC7C,IAAd,CAAmB,aAAnB,CAAkC+C,CAAlC,CACV,CAHD,EAIAG,UAAIpE,IAAJ,CAAS0D,CAAT,IAA0C,SAACK,CAAD,CAAgBC,CAAhB,CAA6B,CACnE,GAAMC,CAAAA,CAAc,CAAGD,CAAQ,CAACK,MAAT,CAAkB,CAAlB,CAAsB,CAA7C,CACA,MAAON,CAAAA,CAAa,CAAC7C,IAAd,CAAmB,aAAnB,CAAkC+C,CAAlC,CACV,CAHD,EAIAK,UAAUtE,IAAV,CAAe0D,CAAf,IAAgD,SAACK,CAAD,CAAgBC,CAAhB,CAA6B,CACzE,GAAMC,CAAAA,CAAc,CAAGD,CAAQ,CAACE,SAAT,CAAmBK,UAAnB,CAAgC,CAAhC,CAAoC,CAA3D,CACAR,CAAa,CAAC7C,IAAd,CAAmB,aAAnB,CAAkC+C,CAAlC,CACH,CAHD,CAIH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module for viewing a discussion in nested v2 view.\n *\n * @module mod_Forum/discussion_nested_v2\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport $ from 'jquery';\nimport AutoRows from 'core/auto_rows';\nimport CustomEvents from 'core/custom_interaction_events';\nimport Notification from 'core/notification';\nimport Templates from 'core/templates';\nimport Discussion from 'mod_forum/discussion';\nimport InPageReply from 'mod_forum/inpage_reply';\nimport LockToggle from 'mod_forum/lock_toggle';\nimport FavouriteToggle from 'mod_forum/favourite_toggle';\nimport Pin from 'mod_forum/pin_toggle';\nimport Selectors from 'mod_forum/selectors';\nimport Subscribe from 'mod_forum/subscription_toggle';\n\nconst ANIMATION_DURATION = 150;\n\n/**\n * Get the closest post container element from the given element.\n *\n * @param {Object} element jQuery element to search from\n * @return {Object} jQuery element\n */\nconst getPostContainer = (element) => {\n return element.closest(Selectors.post.post);\n};\n\n/**\n * Get the closest post container element from the given element.\n *\n * @param {Object} element jQuery element to search from\n * @param {Number} id Id of the post to find.\n * @return {Object} jQuery element\n */\nconst getPostContainerById = (element, id) => {\n return element.find(`${Selectors.post.post}[data-post-id=${id}]`);\n};\n\n/**\n * Get the parent post container elements from the given element.\n *\n * @param {Object} element jQuery element to search from\n * @return {Object} jQuery element\n */\nconst getParentPostContainers = (element) => {\n return element.parents(Selectors.post.post);\n};\n\n/**\n * Get the post content container element from the post container element.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery element\n */\nconst getPostContentContainer = (postContainer) => {\n return postContainer.children().not(Selectors.post.repliesContainer).find(Selectors.post.forumCoreContent);\n};\n\n/**\n * Get the in page reply container element from the post container element.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery element\n */\nconst getInPageReplyContainer = (postContainer) => {\n return postContainer.children().filter(Selectors.post.inpageReplyContainer);\n};\n\n/**\n * Get the in page reply form element from the post container element.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery element\n */\nconst getInPageReplyForm = (postContainer) => {\n return getInPageReplyContainer(postContainer).find(Selectors.post.inpageReplyContent);\n};\n\n/**\n * Get the in page reply create (reply) button element from the post container element.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery element\n */\nconst getInPageReplyCreateButton = (postContainer) => {\n return getPostContentContainer(postContainer).find(Selectors.post.inpageReplyCreateButton);\n};\n\n/**\n * Get the replies visibility toggle container (show/hide replies button container) element\n * from the post container element.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery element\n */\nconst getRepliesVisibilityToggleContainer = (postContainer) => {\n return postContainer.children(Selectors.post.repliesVisibilityToggleContainer);\n};\n\n/**\n * Get the replies container element from the post container element.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery element\n */\nconst getRepliesContainer = (postContainer) => {\n return postContainer.children(Selectors.post.repliesContainer);\n};\n\n/**\n * Check if the post has any replies.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Bool}\n */\nconst hasReplies = (postContainer) => {\n return getRepliesContainer(postContainer).children().length > 0;\n};\n\n/**\n * Get the show replies button element from the replies visibility toggle container element.\n *\n * @param {Object} replyVisibilityToggleContainer jQuery element for the toggle container\n * @return {Object} jQuery element\n */\nconst getShowRepliesButton = (replyVisibilityToggleContainer) => {\n return replyVisibilityToggleContainer.find(Selectors.post.showReplies);\n};\n\n/**\n * Get the hide replies button element from the replies visibility toggle container element.\n *\n * @param {Object} replyVisibilityToggleContainer jQuery element for the toggle container\n * @return {Object} jQuery element\n */\nconst getHideRepliesButton = (replyVisibilityToggleContainer) => {\n return replyVisibilityToggleContainer.find(Selectors.post.hideReplies);\n};\n\n/**\n * Check if the replies are visible.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @return {Bool}\n */\nconst repliesVisible = (postContainer) => {\n const repliesContainer = getRepliesContainer(postContainer);\n return repliesContainer.is(':visible');\n};\n\n/**\n * Show the post replies.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @param {Number|null} postIdToSee Id of the post to scroll into view (if any)\n */\nconst showReplies = (postContainer, postIdToSee = null) => {\n const repliesContainer = getRepliesContainer(postContainer);\n const replyVisibilityToggleContainer = getRepliesVisibilityToggleContainer(postContainer);\n const showButton = getShowRepliesButton(replyVisibilityToggleContainer);\n const hideButton = getHideRepliesButton(replyVisibilityToggleContainer);\n\n showButton.addClass('hidden');\n hideButton.removeClass('hidden');\n\n repliesContainer.slideDown({\n duration: ANIMATION_DURATION,\n queue: false,\n complete: () => {\n if (postIdToSee) {\n const postContainerToSee = getPostContainerById(repliesContainer, postIdToSee);\n if (postContainerToSee.length) {\n postContainerToSee[0].scrollIntoView();\n }\n }\n }\n }).css('display', 'none').fadeIn(ANIMATION_DURATION);\n};\n\n/**\n * Hide the post replies.\n *\n * @param {Object} postContainer jQuery element for the post container\n */\nconst hideReplies = (postContainer) => {\n const repliesContainer = getRepliesContainer(postContainer);\n const replyVisibilityToggleContainer = getRepliesVisibilityToggleContainer(postContainer);\n const showButton = getShowRepliesButton(replyVisibilityToggleContainer);\n const hideButton = getHideRepliesButton(replyVisibilityToggleContainer);\n\n showButton.removeClass('hidden');\n hideButton.addClass('hidden');\n\n repliesContainer.slideUp({\n duration: ANIMATION_DURATION,\n queue: false\n }).fadeOut(ANIMATION_DURATION);\n};\n\n/** Variable to hold the showInPageReplyForm function after it's built. */\nlet showInPageReplyForm = null;\n\n/**\n * Build the showInPageReplyForm function with the given additional template context.\n *\n * @param {Object} additionalTemplateContext Additional render context for the in page reply template.\n * @return {Function}\n */\nconst buildShowInPageReplyFormFunction = (additionalTemplateContext) => {\n /**\n * Show the in page reply form in the given in page reply container. The form\n * display will be animated.\n *\n * @param {Object} postContainer jQuery element for the post container\n */\n return async(postContainer) => {\n\n const inPageReplyContainer = getInPageReplyContainer(postContainer);\n const repliesVisibilityToggleContainer = getRepliesVisibilityToggleContainer(postContainer);\n const inPageReplyCreateButton = getInPageReplyCreateButton(postContainer);\n\n if (!hasInPageReplyForm(inPageReplyContainer)) {\n try {\n const html = await renderInPageReplyTemplate(additionalTemplateContext, inPageReplyCreateButton, postContainer);\n Templates.appendNodeContents(inPageReplyContainer, html, '');\n } catch (e) {\n Notification.exception(e);\n }\n\n // Load formchangechecker module.\n import('core/yui')\n .then(Y => {\n return new Promise(resolve => {\n Y.use('moodle-core-formchangechecker', Y => {\n resolve(Y);\n });\n });\n })\n .then(Y => {\n M.core_formchangechecker.init({formid: Y.one(postContainer[0].querySelector('form')).generateID()});\n return Y;\n })\n .catch();\n }\n\n inPageReplyCreateButton.fadeOut(ANIMATION_DURATION, () => {\n const inPageReplyForm = getInPageReplyForm(postContainer);\n inPageReplyForm.slideDown({\n duration: ANIMATION_DURATION,\n queue: false,\n complete: () => {\n inPageReplyForm.find('textarea').focus();\n }\n }).css('display', 'none').fadeIn(ANIMATION_DURATION);\n\n if (repliesVisibilityToggleContainer.length && hasReplies(postContainer)) {\n repliesVisibilityToggleContainer.fadeIn(ANIMATION_DURATION);\n hideReplies(postContainer);\n }\n });\n };\n};\n\n/**\n * Hide the in page reply form in the given in page reply container. The form\n * display will be animated.\n *\n * @param {Object} postContainer jQuery element for the post container\n * @param {Number|null} postIdToSee Id of the post to scroll into view (if any)\n */\nconst hideInPageReplyForm = (postContainer, postIdToSee = null) => {\n const inPageReplyForm = getInPageReplyForm(postContainer);\n const inPageReplyCreateButton = getInPageReplyCreateButton(postContainer);\n const repliesVisibilityToggleContainer = getRepliesVisibilityToggleContainer(postContainer);\n\n if (repliesVisibilityToggleContainer.length && hasReplies(postContainer)) {\n repliesVisibilityToggleContainer.fadeOut(ANIMATION_DURATION);\n if (!repliesVisible(postContainer)) {\n showReplies(postContainer, postIdToSee);\n }\n }\n\n inPageReplyForm.slideUp({\n duration: ANIMATION_DURATION,\n queue: false,\n complete: () => {\n inPageReplyCreateButton.fadeIn(ANIMATION_DURATION);\n }\n }).fadeOut(200);\n};\n\n/**\n * Check if the in page reply container contains the in page reply form.\n *\n * @param {Object} inPageReplyContainer jQuery element for the in page reply container\n * @return {Bool}\n */\nconst hasInPageReplyForm = (inPageReplyContainer) => {\n return inPageReplyContainer.find(Selectors.post.inpageReplyContent).length > 0;\n};\n\n/**\n * Render the template to generate the in page reply form HTML.\n *\n * @param {Object} additionalTemplateContext Additional render context for the in page reply template\n * @param {Object} button jQuery element for the reply button that was clicked\n * @param {Object} postContainer jQuery element for the post container\n * @return {Object} jQuery promise\n */\nconst renderInPageReplyTemplate = (additionalTemplateContext, button, postContainer) => {\n const postContentContainer = getPostContentContainer(postContainer);\n const currentSubject = postContentContainer.find(Selectors.post.forumSubject).text();\n const currentAuthorName = postContentContainer.find(Selectors.post.authorName).text();\n const context = {\n postid: postContainer.data('post-id'),\n \"reply_url\": button.attr('data-href'),\n sesskey: M.cfg.sesskey,\n parentsubject: currentSubject,\n parentauthorname: currentAuthorName,\n canreplyprivately: button.data('can-reply-privately'),\n postformat: InPageReply.CONTENT_FORMATS.MOODLE,\n ...additionalTemplateContext\n };\n\n return Templates.render('mod_forum/inpage_reply_v2', context);\n};\n\n/**\n * Increment the total reply count in the show/hide replies buttons for the post.\n *\n * @param {Object} postContainer jQuery element for the post container\n */\nconst incrementTotalReplyCount = (postContainer) => {\n getRepliesVisibilityToggleContainer(postContainer).find(Selectors.post.replyCount).each((index, element) => {\n const currentCount = parseInt(element.innerText, 10);\n element.innerText = currentCount + 1;\n });\n};\n\n/**\n * Create all of the event listeners for the discussion.\n *\n * @param {Object} root jQuery element for the discussion container\n */\nconst registerEventListeners = (root) => {\n CustomEvents.define(root, [CustomEvents.events.activate]);\n // Auto expanding text area for in page reply.\n AutoRows.init(root);\n\n // Reply button is clicked.\n root.on(CustomEvents.events.activate, Selectors.post.inpageReplyCreateButton, (e, data) => {\n data.originalEvent.preventDefault();\n const postContainer = getPostContainer($(e.currentTarget));\n showInPageReplyForm(postContainer);\n });\n\n // Cancel in page reply button.\n root.on(CustomEvents.events.activate, Selectors.post.inpageReplyCancelButton, (e, data) => {\n data.originalEvent.preventDefault();\n const postContainer = getPostContainer($(e.currentTarget));\n hideInPageReplyForm(postContainer);\n });\n\n // Show replies button clicked.\n root.on(CustomEvents.events.activate, Selectors.post.showReplies, (e, data) => {\n data.originalEvent.preventDefault();\n const postContainer = getPostContainer($(e.target));\n showReplies(postContainer);\n });\n\n // Hide replies button clicked.\n root.on(CustomEvents.events.activate, Selectors.post.hideReplies, (e, data) => {\n data.originalEvent.preventDefault();\n const postContainer = getPostContainer($(e.target));\n hideReplies(postContainer);\n });\n\n // Post created with in page reply.\n root.on(InPageReply.EVENTS.POST_CREATED, Selectors.post.inpageSubmitBtn, (e, newPostId) => {\n const currentTarget = $(e.currentTarget);\n const postContainer = getPostContainer(currentTarget);\n const postContainers = getParentPostContainers(currentTarget);\n hideInPageReplyForm(postContainer, newPostId);\n\n postContainers.each((index, container) => {\n incrementTotalReplyCount($(container));\n });\n });\n};\n\n/**\n * Initialise the javascript for the discussion in nested v2 display mode.\n *\n * @param {Object} root jQuery element for the discussion container\n * @param {Object} context Additional render context for the in page reply template\n */\nexport const init = (root, context) => {\n // Build the showInPageReplyForm function with the additional render context.\n showInPageReplyForm = buildShowInPageReplyFormFunction(context);\n // Add discussion event listeners.\n registerEventListeners(root);\n // Initialise default discussion javascript (keyboard nav etc).\n Discussion.init(root);\n // Add in page reply javascript.\n InPageReply.init(root);\n\n // Initialise the settings menu javascript.\n const discussionToolsContainer = root.find(Selectors.discussion.tools);\n LockToggle.init(discussionToolsContainer, false);\n FavouriteToggle.init(discussionToolsContainer, false, (toggleElement, response) => {\n const newTargetState = response.userstate.favourited ? 0 : 1;\n return toggleElement.data('targetstate', newTargetState);\n });\n Pin.init(discussionToolsContainer, false, (toggleElement, response) => {\n const newTargetState = response.pinned ? 0 : 1;\n return toggleElement.data('targetstate', newTargetState);\n });\n Subscribe.init(discussionToolsContainer, false, (toggleElement, response) => {\n const newTargetState = response.userstate.subscribed ? 0 : 1;\n toggleElement.data('targetstate', newTargetState);\n });\n};\n"],"file":"discussion_nested_v2.min.js"} \ No newline at end of file diff --git a/mod/forum/amd/build/form-user-selector.min.js.map b/mod/forum/amd/build/form-user-selector.min.js.map index 3f83b909e9fc5..880cda87a5464 100644 --- a/mod/forum/amd/build/form-user-selector.min.js.map +++ b/mod/forum/amd/build/form-user-selector.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/form-user-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","promise","courseid","attr","call","methodname","args","search","searchanywhere","page","perpage","then","promises","i","render","when","apply","arguments","fail"],"mappings":"AAwBAA,OAAM,gCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAC3E,MAAyD,CACrDC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAK,CAAG,EAAZ,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCH,CAAK,CAACI,IAAN,CAAW,CACPC,KAAK,CAAEF,CAAI,CAACG,EADL,CAEPC,KAAK,CAAEJ,CAAI,CAACK,MAFL,CAAX,CAIH,CALD,EAMA,MAAOR,CAAAA,CACV,CAVoD,CAYrDS,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,IAC/CC,CAAAA,CAD+C,CAE/CC,CAAQ,CAAGpB,CAAC,CAACI,CAAD,CAAD,CAAYiB,IAAZ,CAAiB,UAAjB,CAFoC,CAInDF,CAAO,CAAGlB,CAAI,CAACqB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,yBADK,CAEjBC,IAAI,CAAE,CACFJ,QAAQ,CAAEA,CADR,CAEFK,MAAM,CAAET,CAFN,CAGFU,cAAc,GAHZ,CAIFC,IAAI,CAAE,CAJJ,CAKFC,OAAO,CAAE,EALP,CAFW,CAAD,CAAV,CAAV,CAWAT,CAAO,CAAC,CAAD,CAAP,CAAWU,IAAX,CAAgB,SAASxB,CAAT,CAAkB,CAC9B,GAAIyB,CAAAA,CAAQ,CAAG,EAAf,CACIC,CAAC,CAAG,CADR,CAIA/B,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCqB,CAAQ,CAACpB,IAAT,CAAcR,CAAS,CAAC8B,MAAV,CAAiB,yCAAjB,CAA4DvB,CAA5D,CAAd,CACH,CAFD,EAKA,MAAOT,CAAAA,CAAC,CAACiC,IAAF,CAAOC,KAAP,CAAalC,CAAC,CAACiC,IAAf,CAAqBH,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAIL,CAAAA,CAAI,CAAGW,SAAX,CACAnC,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCA,CAAI,CAACK,MAAL,CAAcU,CAAI,CAACO,CAAD,CAAlB,CACAA,CAAC,EACJ,CAHD,EAIAd,CAAO,CAACZ,CAAD,CAEV,CARM,CAUV,CApBD,EAoBG+B,IApBH,CAoBQlB,CApBR,CAqBH,CAhDoD,CAoD5D,CArDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Enrolled user selector module.\n *\n * @module mod_forum/form-user-selector\n * @class form-user-selector\n * @copyright 2019 Shamim Rezaie\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n return /** @alias module:mod_forum/form-user-selector */ {\n processResults: function(selector, results) {\n var users = [];\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n var courseid = $(selector).attr('courseid');\n\n promise = Ajax.call([{\n methodname: 'core_enrol_search_users',\n args: {\n courseid: courseid,\n search: query,\n searchanywhere: true,\n page: 0,\n perpage: 30\n }\n }]);\n\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results, function(index, user) {\n promises.push(Templates.render('mod_forum/form-user-selector-suggestion', user));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results, function(index, user) {\n user._label = args[i];\n i++;\n });\n success(results);\n return;\n });\n\n }).fail(failure);\n }\n\n };\n\n});\n"],"file":"form-user-selector.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/form-user-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","promise","courseid","attr","call","methodname","args","search","searchanywhere","page","perpage","then","promises","i","render","when","apply","arguments","fail"],"mappings":"AAuBAA,OAAM,gCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAC3E,MAAyD,CACrDC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAK,CAAG,EAAZ,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCH,CAAK,CAACI,IAAN,CAAW,CACPC,KAAK,CAAEF,CAAI,CAACG,EADL,CAEPC,KAAK,CAAEJ,CAAI,CAACK,MAFL,CAAX,CAIH,CALD,EAMA,MAAOR,CAAAA,CACV,CAVoD,CAYrDS,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,IAC/CC,CAAAA,CAD+C,CAE/CC,CAAQ,CAAGpB,CAAC,CAACI,CAAD,CAAD,CAAYiB,IAAZ,CAAiB,UAAjB,CAFoC,CAInDF,CAAO,CAAGlB,CAAI,CAACqB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,yBADK,CAEjBC,IAAI,CAAE,CACFJ,QAAQ,CAAEA,CADR,CAEFK,MAAM,CAAET,CAFN,CAGFU,cAAc,GAHZ,CAIFC,IAAI,CAAE,CAJJ,CAKFC,OAAO,CAAE,EALP,CAFW,CAAD,CAAV,CAAV,CAWAT,CAAO,CAAC,CAAD,CAAP,CAAWU,IAAX,CAAgB,SAASxB,CAAT,CAAkB,CAC9B,GAAIyB,CAAAA,CAAQ,CAAG,EAAf,CACIC,CAAC,CAAG,CADR,CAIA/B,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCqB,CAAQ,CAACpB,IAAT,CAAcR,CAAS,CAAC8B,MAAV,CAAiB,yCAAjB,CAA4DvB,CAA5D,CAAd,CACH,CAFD,EAKA,MAAOT,CAAAA,CAAC,CAACiC,IAAF,CAAOC,KAAP,CAAalC,CAAC,CAACiC,IAAf,CAAqBH,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAIL,CAAAA,CAAI,CAAGW,SAAX,CACAnC,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCA,CAAI,CAACK,MAAL,CAAcU,CAAI,CAACO,CAAD,CAAlB,CACAA,CAAC,EACJ,CAHD,EAIAd,CAAO,CAACZ,CAAD,CAEV,CARM,CAUV,CApBD,EAoBG+B,IApBH,CAoBQlB,CApBR,CAqBH,CAhDoD,CAoD5D,CArDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Enrolled user selector module.\n *\n * @module mod_forum/form-user-selector\n * @copyright 2019 Shamim Rezaie\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n return /** @alias module:mod_forum/form-user-selector */ {\n processResults: function(selector, results) {\n var users = [];\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n var courseid = $(selector).attr('courseid');\n\n promise = Ajax.call([{\n methodname: 'core_enrol_search_users',\n args: {\n courseid: courseid,\n search: query,\n searchanywhere: true,\n page: 0,\n perpage: 30\n }\n }]);\n\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results, function(index, user) {\n promises.push(Templates.render('mod_forum/form-user-selector-suggestion', user));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results, function(index, user) {\n user._label = args[i];\n i++;\n });\n success(results);\n return;\n });\n\n }).fail(failure);\n }\n\n };\n\n});\n"],"file":"form-user-selector.min.js"} \ No newline at end of file diff --git a/mod/forum/amd/build/local/grades/local/grader/gradingpanel.min.js.map b/mod/forum/amd/build/local/grades/local/grader/gradingpanel.min.js.map index 60411632a0229..516a4290400c8 100644 --- a/mod/forum/amd/build/local/grades/local/grader/gradingpanel.min.js.map +++ b/mod/forum/amd/build/local/grades/local/grader/gradingpanel.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../../../src/local/grades/local/grader/gradingpanel.js"],"names":["component","context","gradingComponent","gradingSubtype","itemName","gradingMethodHandler","GradingMethod","getter","userId","fetchCurrentGrade","setter","notifyStudent","formData","storeCurrentGrade"],"mappings":"6nBAmCe,WAAMA,CAAN,CAAiBC,CAAjB,CAA0BC,CAA1B,CAA4CC,CAA5C,CAA4DC,CAA5D,2FACPC,CADO,WACmBH,CADnB,gCAEX,GAAIC,CAAJ,CAAoB,CAChBE,CAAoB,aAAQF,CAAR,CACvB,CAJU,8FAMwBE,CANxB,mMAMwBA,CANxB,sBAMwBA,CANxB,UAMLC,CANK,iCAQJ,CACHC,MAAM,CAAE,SAACC,CAAD,QAAYF,CAAAA,CAAa,CAACG,iBAAd,CAAgCT,CAAhC,CAA2CC,CAA3C,CAAoDG,CAApD,CAA8DI,CAA9D,CAAZ,CADL,CAEHE,MAAM,CAAE,SAACF,CAAD,CAASG,CAAT,CAAwBC,CAAxB,QAAqCN,CAAAA,CAAa,CAACO,iBAAd,CACzCb,CADyC,CAC9BC,CAD8B,CACrBG,CADqB,CACXI,CADW,CACHG,CADG,CACYC,CADZ,CAArC,CAFL,CARI,0C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Grading panel functions.\n *\n * @module mod_forum/local/grades/local/grader/gradingpnael\n * @copyright 2019 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * Get the grade panel setter and getter for the current component.\n * This function dynamically pulls the relevant gradingpanel JS file defined in the grading method.\n * We do this because we do not know until execution time what the grading type is and we do not want to import unused files.\n *\n * @param {String} component The component being graded\n * @param {Number} context The contextid of the thing being graded\n * @param {String} gradingComponent The thing providing the grading type\n * @param {String} gradingSubtype The subtype fo the grading component\n * @param {String} itemName The name of the thing being graded\n * @return {Object}\n */\nexport default async(component, context, gradingComponent, gradingSubtype, itemName) => {\n let gradingMethodHandler = `${gradingComponent}/grades/grader/gradingpanel`;\n if (gradingSubtype) {\n gradingMethodHandler += `/${gradingSubtype}`;\n }\n\n const GradingMethod = await import(gradingMethodHandler);\n\n return {\n getter: (userId) => GradingMethod.fetchCurrentGrade(component, context, itemName, userId),\n setter: (userId, notifyStudent, formData) => GradingMethod.storeCurrentGrade(\n component, context, itemName, userId, notifyStudent, formData),\n };\n};\n\n"],"file":"gradingpanel.min.js"} \ No newline at end of file +{"version":3,"sources":["../../../../../src/local/grades/local/grader/gradingpanel.js"],"names":["component","context","gradingComponent","gradingSubtype","itemName","gradingMethodHandler","GradingMethod","getter","userId","fetchCurrentGrade","setter","notifyStudent","formData","storeCurrentGrade"],"mappings":"6nBAoCe,WAAMA,CAAN,CAAiBC,CAAjB,CAA0BC,CAA1B,CAA4CC,CAA5C,CAA4DC,CAA5D,2FACPC,CADO,WACmBH,CADnB,gCAEX,GAAIC,CAAJ,CAAoB,CAChBE,CAAoB,aAAQF,CAAR,CACvB,CAJU,8FAMwBE,CANxB,mMAMwBA,CANxB,sBAMwBA,CANxB,UAMLC,CANK,iCAQJ,CACHC,MAAM,CAAE,SAACC,CAAD,QAAYF,CAAAA,CAAa,CAACG,iBAAd,CAAgCT,CAAhC,CAA2CC,CAA3C,CAAoDG,CAApD,CAA8DI,CAA9D,CAAZ,CADL,CAEHE,MAAM,CAAE,SAACF,CAAD,CAASG,CAAT,CAAwBC,CAAxB,QAAqCN,CAAAA,CAAa,CAACO,iBAAd,CACzCb,CADyC,CAC9BC,CAD8B,CACrBG,CADqB,CACXI,CADW,CACHG,CADG,CACYC,CADZ,CAArC,CAFL,CARI,0C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Grading panel functions.\n *\n * @module mod_forum/local/grades/local/grader/gradingpanel\n * @copyright 2019 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * Get the grade panel setter and getter for the current component.\n * This function dynamically pulls the relevant gradingpanel JS file defined in the grading method.\n * We do this because we do not know until execution time what the grading type is and we do not want to import unused files.\n *\n * @method\n * @param {String} component The component being graded\n * @param {Number} context The contextid of the thing being graded\n * @param {String} gradingComponent The thing providing the grading type\n * @param {String} gradingSubtype The subtype fo the grading component\n * @param {String} itemName The name of the thing being graded\n * @return {Object}\n */\nexport default async(component, context, gradingComponent, gradingSubtype, itemName) => {\n let gradingMethodHandler = `${gradingComponent}/grades/grader/gradingpanel`;\n if (gradingSubtype) {\n gradingMethodHandler += `/${gradingSubtype}`;\n }\n\n const GradingMethod = await import(gradingMethodHandler);\n\n return {\n getter: (userId) => GradingMethod.fetchCurrentGrade(component, context, itemName, userId),\n setter: (userId, notifyStudent, formData) => GradingMethod.storeCurrentGrade(\n component, context, itemName, userId, notifyStudent, formData),\n };\n};\n\n"],"file":"gradingpanel.min.js"} \ No newline at end of file diff --git a/mod/forum/amd/build/local/grades/local/grader/user_picker.min.js.map b/mod/forum/amd/build/local/grades/local/grader/user_picker.min.js.map index fea8da81e91b4..8413fc9be217e 100644 --- a/mod/forum/amd/build/local/grades/local/grader/user_picker.min.js.map +++ b/mod/forum/amd/build/local/grades/local/grader/user_picker.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../../../src/local/grades/local/grader/user_picker.js"],"names":["UserPicker","userList","showUserCallback","preChangeUserCallback","currentUserIndex","render","bind","setUserId","userId","userIndex","findIndex","user","id","parseInt","Error","root","document","createElement","renderNavigator","html","js","Templates","replaceNodeContents","showUser","currentUser","registerEventListeners","renderForPromise","context","Promise","all","renderUserChange","userRegion","querySelector","Selectors","regions","currentUserRegion","fullname","textContent","addEventListener","e","button","target","closest","actions","changeUser","result","failed","updateIndex","dataset","direction","length","total","displayIndex","users","initialUserId","userPicker"],"mappings":"6NAuBA,OACA,O,61EAKMA,CAAAA,C,YASF,WAAYC,CAAZ,CAAsBC,CAAtB,CAAwCC,CAAxC,CAA+D,WAC3D,KAAKF,QAAL,CAAgBA,CAAhB,CACA,KAAKC,gBAAL,CAAwBA,CAAxB,CACA,KAAKC,qBAAL,CAA6BA,CAA7B,CACA,KAAKC,gBAAL,CAAwB,CAAxB,CAGA,KAAKC,MAAL,CAAc,KAAKA,MAAL,CAAYC,IAAZ,CAAiB,IAAjB,CAAd,CACA,KAAKC,SAAL,CAAiB,KAAKA,SAAL,CAAeD,IAAf,CAAoB,IAApB,CACpB,C,+CAQSE,C,CAAQ,CAEd,GAAMC,CAAAA,CAAS,CAAG,KAAKR,QAAL,CAAcS,SAAd,CAAwB,SAAAC,CAAI,CAAI,CAC9C,MAAOA,CAAAA,CAAI,CAACC,EAAL,GAAYC,QAAQ,CAACL,CAAD,CAC9B,CAFiB,CAAlB,CAIA,GAAkB,CAAC,CAAf,GAAAC,CAAJ,CAAsB,CAClB,KAAMK,CAAAA,KAAK,wBAAiBN,CAAjB,eACd,CAED,KAAKJ,gBAAL,CAAwBK,CAC3B,C,yKAOG,KAAKM,IAAL,CAAYC,QAAQ,CAACC,aAAT,CAAuB,KAAvB,CAAZ,C,eAEyB,MAAKC,eAAL,E,iBAAlBC,C,GAAAA,I,CAAMC,C,GAAAA,E,CACbC,UAAUC,mBAAV,CAA8B,KAAKP,IAAnC,CAAyCI,CAAzC,CAA+CC,CAA/C,E,eAGM,MAAKG,QAAL,CAAc,KAAKC,WAAnB,C,QAGN,KAAKC,sBAAL,G,qKAQc,CACd,MAAOJ,WAAUK,gBAAV,iEAA0D,EAA1D,CACV,C,0DAQgBC,C,CAAS,CACtB,MAAON,WAAUK,gBAAV,sEAA+DC,CAA/D,CACV,C,8EAOchB,C,oHACgBiB,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D,CAAsD,CACzD,KAAK9C,gBAAL,CAAwB,CAC3B,CAED,MAAO,MAAKA,gBACf,C,uCAQiB,CACd,YACO,KAAKH,QAAL,CAAc,KAAKG,gBAAnB,CADP,EAEI+C,KAAK,CAAE,KAAKlD,QAAL,CAAciD,MAFzB,CAGIE,YAAY,CAAE,KAAKhD,gBAAL,CAAwB,CAH1C,EAKH,C,oCAOc,CACX,MAAO,MAAKW,IACf,C,6DAYU,WACXsC,CADW,CAEXnD,CAFW,CAGXC,CAHW,4IAMP,EANO,KAKPmD,aALO,CAKPA,CALO,YAKS,IALT,GAQLC,CARK,CAQQ,GAAIvD,CAAAA,CAAJ,CAAeqD,CAAf,CAAsBnD,CAAtB,CAAwCC,CAAxC,CARR,CASX,GAAImD,CAAJ,CAAmB,CACfC,CAAU,CAAChD,SAAX,CAAqB+C,CAArB,CACH,CAXU,eAYLC,CAAAA,CAAU,CAAClD,MAAX,EAZK,iCAcJkD,CAdI,0C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * This module will tie together all of the different calls the gradable module will make.\n *\n * @module mod_forum/local/grades/local/grader/user_picker\n * @copyright 2019 Mathew May \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Templates from 'core/templates';\nimport Selectors from './user_picker/selectors';\nimport {get_string as getString} from 'core/str';\n\nconst templatePath = 'mod_forum/local/grades/local/grader';\n\nclass UserPicker {\n\n /**\n * Constructor for the User Picker.\n *\n * @param {Array} userList List of users\n * @param {Function} showUserCallback The callback used to display the user\n * @param {Function} preChangeUserCallback The callback to use before changing user\n */\n constructor(userList, showUserCallback, preChangeUserCallback) {\n this.userList = userList;\n this.showUserCallback = showUserCallback;\n this.preChangeUserCallback = preChangeUserCallback;\n this.currentUserIndex = 0;\n\n // Ensure that render is bound correctly.\n this.render = this.render.bind(this);\n this.setUserId = this.setUserId.bind(this);\n }\n\n /**\n * Set the current userid without rendering the change.\n * To show the user, call showUser too.\n *\n * @param {Number} userId\n */\n setUserId(userId) {\n // Determine the current index based on the user ID.\n const userIndex = this.userList.findIndex(user => {\n return user.id === parseInt(userId);\n });\n\n if (userIndex === -1) {\n throw Error(`User with id ${userId} not found`);\n }\n\n this.currentUserIndex = userIndex;\n }\n\n /**\n * Render the user picker.\n */\n async render() {\n // Create the root node.\n this.root = document.createElement('div');\n\n const {html, js} = await this.renderNavigator();\n Templates.replaceNodeContents(this.root, html, js);\n\n // Call the showUser function to show the first user immediately.\n await this.showUser(this.currentUser);\n\n // Ensure that the event listeners are all bound.\n this.registerEventListeners();\n }\n\n /**\n * Render the navigator itself.\n *\n * @returns {Promise}\n */\n renderNavigator() {\n return Templates.renderForPromise(`${templatePath}/user_picker`, {});\n }\n\n /**\n * Render the current user details for the picker.\n *\n * @param {Object} context The data used to render the user picker.\n * @returns {Promise}\n */\n renderUserChange(context) {\n return Templates.renderForPromise(`${templatePath}/user_picker/user`, context);\n }\n\n /**\n * Show the specified user in the picker.\n *\n * @param {Object} user\n */\n async showUser(user) {\n const [{html, js}] = await Promise.all([this.renderUserChange(user), this.showUserCallback(user)]);\n const userRegion = this.root.querySelector(Selectors.regions.userRegion);\n Templates.replaceNodeContents(userRegion, html, js);\n\n // Update the hidden now-grading region so screen readers can announce the user that's currently being graded.\n const currentUserRegion = this.root.querySelector(Selectors.regions.currentUser);\n currentUserRegion.textContent = await getString('nowgradinguser', 'mod_forum', user.fullname);\n }\n\n /**\n * Register the event listeners for the user picker.\n */\n registerEventListeners() {\n this.root.addEventListener('click', async(e) => {\n const button = e.target.closest(Selectors.actions.changeUser);\n\n if (button) {\n const result = await this.preChangeUserCallback(this.currentUser);\n\n if (!result.failed) {\n this.updateIndex(parseInt(button.dataset.direction));\n await this.showUser(this.currentUser);\n }\n }\n });\n }\n\n /**\n * Update the current user index.\n *\n * @param {Number} direction\n * @returns {Number}}\n */\n updateIndex(direction) {\n this.currentUserIndex += direction;\n\n // Loop around the edges.\n if (this.currentUserIndex < 0) {\n this.currentUserIndex = this.userList.length - 1;\n } else if (this.currentUserIndex > this.userList.length - 1) {\n this.currentUserIndex = 0;\n }\n\n return this.currentUserIndex;\n }\n\n /**\n * Get the details of the user currently shown with the total number of users, and the 1-indexed count of the\n * current user.\n *\n * @returns {Object}\n */\n get currentUser() {\n return {\n ...this.userList[this.currentUserIndex],\n total: this.userList.length,\n displayIndex: this.currentUserIndex + 1,\n };\n }\n\n /**\n * Get the root node for the User Picker.\n *\n * @returns {HTMLElement}\n */\n get rootNode() {\n return this.root;\n }\n}\n\n/**\n * Create a new user picker.\n *\n * @param {Array} users The list of users\n * @param {Function} showUserCallback The function to call to show a specific user\n * @param {Function} preChangeUserCallback The fucntion to call to save the grade for the current user\n * @param {Number} [currentUserID] The userid of the current user\n * @returns {UserPicker}\n */\nexport default async(\n users,\n showUserCallback,\n preChangeUserCallback,\n {\n initialUserId = null,\n } = {}\n) => {\n const userPicker = new UserPicker(users, showUserCallback, preChangeUserCallback);\n if (initialUserId) {\n userPicker.setUserId(initialUserId);\n }\n await userPicker.render();\n\n return userPicker;\n};\n"],"file":"user_picker.min.js"} \ No newline at end of file +{"version":3,"sources":["../../../../../src/local/grades/local/grader/user_picker.js"],"names":["UserPicker","userList","showUserCallback","preChangeUserCallback","currentUserIndex","render","bind","setUserId","userId","userIndex","findIndex","user","id","parseInt","Error","root","document","createElement","renderNavigator","html","js","Templates","replaceNodeContents","showUser","currentUser","registerEventListeners","renderForPromise","context","Promise","all","renderUserChange","userRegion","querySelector","Selectors","regions","currentUserRegion","fullname","textContent","addEventListener","e","button","target","closest","actions","changeUser","result","failed","updateIndex","dataset","direction","length","total","displayIndex","users","initialUserId","userPicker"],"mappings":"6NAuBA,OACA,O,61EAUMA,CAAAA,C,YAUF,WAAYC,CAAZ,CAAsBC,CAAtB,CAAwCC,CAAxC,CAA+D,WAC3D,KAAKF,QAAL,CAAgBA,CAAhB,CACA,KAAKC,gBAAL,CAAwBA,CAAxB,CACA,KAAKC,qBAAL,CAA6BA,CAA7B,CACA,KAAKC,gBAAL,CAAwB,CAAxB,CAGA,KAAKC,MAAL,CAAc,KAAKA,MAAL,CAAYC,IAAZ,CAAiB,IAAjB,CAAd,CACA,KAAKC,SAAL,CAAiB,KAAKA,SAAL,CAAeD,IAAf,CAAoB,IAApB,CACpB,C,+CAQSE,C,CAAQ,CAEd,GAAMC,CAAAA,CAAS,CAAG,KAAKR,QAAL,CAAcS,SAAd,CAAwB,SAAAC,CAAI,CAAI,CAC9C,MAAOA,CAAAA,CAAI,CAACC,EAAL,GAAYC,QAAQ,CAACL,CAAD,CAC9B,CAFiB,CAAlB,CAIA,GAAkB,CAAC,CAAf,GAAAC,CAAJ,CAAsB,CAClB,KAAMK,CAAAA,KAAK,wBAAiBN,CAAjB,eACd,CAED,KAAKJ,gBAAL,CAAwBK,CAC3B,C,yKAOG,KAAKM,IAAL,CAAYC,QAAQ,CAACC,aAAT,CAAuB,KAAvB,CAAZ,C,eAEyB,MAAKC,eAAL,E,iBAAlBC,C,GAAAA,I,CAAMC,C,GAAAA,E,CACbC,UAAUC,mBAAV,CAA8B,KAAKP,IAAnC,CAAyCI,CAAzC,CAA+CC,CAA/C,E,eAGM,MAAKG,QAAL,CAAc,KAAKC,WAAnB,C,QAGN,KAAKC,sBAAL,G,qKAQc,CACd,MAAOJ,WAAUK,gBAAV,iEAA0D,EAA1D,CACV,C,0DAQgBC,C,CAAS,CACtB,MAAON,WAAUK,gBAAV,sEAA+DC,CAA/D,CACV,C,8EAOchB,C,oHACgBiB,CAAAA,OAAO,CAACC,GAAR,CAAY,CAAC,KAAKC,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,CAED,MAAO,MAAKA,gBACf,C,uCAQiB,CACd,YACO,KAAKH,QAAL,CAAc,KAAKG,gBAAnB,CADP,EAEI+C,KAAK,CAAE,KAAKlD,QAAL,CAAciD,MAFzB,CAGIE,YAAY,CAAE,KAAKhD,gBAAL,CAAwB,CAH1C,EAKH,C,oCAOc,CACX,MAAO,MAAKW,IACf,C,6DAYU,WACXsC,CADW,CAEXnD,CAFW,CAGXC,CAHW,4IAMP,EANO,KAKPmD,aALO,CAKPA,CALO,YAKS,IALT,GAQLC,CARK,CAQQ,GAAIvD,CAAAA,CAAJ,CAAeqD,CAAf,CAAsBnD,CAAtB,CAAwCC,CAAxC,CARR,CASX,GAAImD,CAAJ,CAAmB,CACfC,CAAU,CAAChD,SAAX,CAAqB+C,CAArB,CACH,CAXU,eAYLC,CAAAA,CAAU,CAAClD,MAAX,EAZK,iCAcJkD,CAdI,0C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * This module will tie together all of the different calls the gradable module will make.\n *\n * @module mod_forum/local/grades/local/grader/user_picker\n * @copyright 2019 Mathew May \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Templates from 'core/templates';\nimport Selectors from './user_picker/selectors';\nimport {get_string as getString} from 'core/str';\n\nconst templatePath = 'mod_forum/local/grades/local/grader';\n\n/**\n * The Grader User Picker.\n *\n * @class mod_forum/local/grades/local/grader/user_picker\n */\nclass UserPicker {\n\n /**\n * Constructor for the User Picker.\n *\n * @constructor mod_forum/local/grades/local/grader/user_picker\n * @param {Array} userList List of users\n * @param {Function} showUserCallback The callback used to display the user\n * @param {Function} preChangeUserCallback The callback to use before changing user\n */\n constructor(userList, showUserCallback, preChangeUserCallback) {\n this.userList = userList;\n this.showUserCallback = showUserCallback;\n this.preChangeUserCallback = preChangeUserCallback;\n this.currentUserIndex = 0;\n\n // Ensure that render is bound correctly.\n this.render = this.render.bind(this);\n this.setUserId = this.setUserId.bind(this);\n }\n\n /**\n * Set the current userid without rendering the change.\n * To show the user, call showUser too.\n *\n * @param {Number} userId\n */\n setUserId(userId) {\n // Determine the current index based on the user ID.\n const userIndex = this.userList.findIndex(user => {\n return user.id === parseInt(userId);\n });\n\n if (userIndex === -1) {\n throw Error(`User with id ${userId} not found`);\n }\n\n this.currentUserIndex = userIndex;\n }\n\n /**\n * Render the user picker.\n */\n async render() {\n // Create the root node.\n this.root = document.createElement('div');\n\n const {html, js} = await this.renderNavigator();\n Templates.replaceNodeContents(this.root, html, js);\n\n // Call the showUser function to show the first user immediately.\n await this.showUser(this.currentUser);\n\n // Ensure that the event listeners are all bound.\n this.registerEventListeners();\n }\n\n /**\n * Render the navigator itself.\n *\n * @returns {Promise}\n */\n renderNavigator() {\n return Templates.renderForPromise(`${templatePath}/user_picker`, {});\n }\n\n /**\n * Render the current user details for the picker.\n *\n * @param {Object} context The data used to render the user picker.\n * @returns {Promise}\n */\n renderUserChange(context) {\n return Templates.renderForPromise(`${templatePath}/user_picker/user`, context);\n }\n\n /**\n * Show the specified user in the picker.\n *\n * @param {Object} user\n */\n async showUser(user) {\n const [{html, js}] = await Promise.all([this.renderUserChange(user), this.showUserCallback(user)]);\n const userRegion = this.root.querySelector(Selectors.regions.userRegion);\n Templates.replaceNodeContents(userRegion, html, js);\n\n // Update the hidden now-grading region so screen readers can announce the user that's currently being graded.\n const currentUserRegion = this.root.querySelector(Selectors.regions.currentUser);\n currentUserRegion.textContent = await getString('nowgradinguser', 'mod_forum', user.fullname);\n }\n\n /**\n * Register the event listeners for the user picker.\n */\n registerEventListeners() {\n this.root.addEventListener('click', async(e) => {\n const button = e.target.closest(Selectors.actions.changeUser);\n\n if (button) {\n const result = await this.preChangeUserCallback(this.currentUser);\n\n if (!result.failed) {\n this.updateIndex(parseInt(button.dataset.direction));\n await this.showUser(this.currentUser);\n }\n }\n });\n }\n\n /**\n * Update the current user index.\n *\n * @param {Number} direction\n * @returns {Number}}\n */\n updateIndex(direction) {\n this.currentUserIndex += direction;\n\n // Loop around the edges.\n if (this.currentUserIndex < 0) {\n this.currentUserIndex = this.userList.length - 1;\n } else if (this.currentUserIndex > this.userList.length - 1) {\n this.currentUserIndex = 0;\n }\n\n return this.currentUserIndex;\n }\n\n /**\n * Get the details of the user currently shown with the total number of users, and the 1-indexed count of the\n * current user.\n *\n * @returns {Object}\n */\n get currentUser() {\n return {\n ...this.userList[this.currentUserIndex],\n total: this.userList.length,\n displayIndex: this.currentUserIndex + 1,\n };\n }\n\n /**\n * Get the root node for the User Picker.\n *\n * @returns {HTMLElement}\n */\n get rootNode() {\n return this.root;\n }\n}\n\n/**\n * Create a new user picker.\n *\n * @param {Array} users The list of users\n * @param {Function} showUserCallback The function to call to show a specific user\n * @param {Function} preChangeUserCallback The fucntion to call to save the grade for the current user\n * @param {Number} [currentUserID] The userid of the current user\n * @returns {UserPicker}\n */\nexport default async(\n users,\n showUserCallback,\n preChangeUserCallback,\n {\n initialUserId = null,\n } = {}\n) => {\n const userPicker = new UserPicker(users, showUserCallback, preChangeUserCallback);\n if (initialUserId) {\n userPicker.setUserId(initialUserId);\n }\n await userPicker.render();\n\n return userPicker;\n};\n"],"file":"user_picker.min.js"} \ No newline at end of file diff --git a/mod/forum/amd/build/local/layout/fullscreen.min.js b/mod/forum/amd/build/local/layout/fullscreen.min.js index cf4ab0f3efdf9..64b8126c45966 100644 --- a/mod/forum/amd/build/local/layout/fullscreen.min.js +++ b/mod/forum/amd/build/local/layout/fullscreen.min.js @@ -1,2 +1,2 @@ -function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("mod_forum/local/layout/fullscreen",["exports","core/loadingicon","core/toast","core/local/aria/focuslock"],function(a,b,c,d){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.createLayout=void 0;d=f(d);function e(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;e=function(){return a};return a}function f(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=e();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a){if(Object.prototype.hasOwnProperty.call(a,f)){var g=d?Object.getOwnPropertyDescriptor(a,f):null;if(g&&(g.get||g.set)){Object.defineProperty(c,f,g)}else{c[f]=a[f]}}}c.default=a;if(b){b.set(a,c)}return c}var g=function(){var a=0.\n\n/**\n * Full screen window layout.\n *\n * @copyright 2019 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {addIconToContainer} from 'core/loadingicon';\nimport {addToastRegion} from 'core/toast';\nimport * as FocusLockManager from 'core/local/aria/focuslock';\n\n/**\n * @param {string} templateName\n * @param {object} context\n * @return {object}\n */\nconst getComposedLayout = ({\n fullscreen = true,\n showLoader = false,\n focusOnClose = null,\n} = {}) => {\n const container = document.createElement('div');\n document.body.append(container);\n container.classList.add('layout');\n container.classList.add('fullscreen');\n container.setAttribute('role', 'application');\n addToastRegion(container);\n\n // Lock scrolling on the document body.\n lockBodyScroll();\n\n // Lock tab control.\n FocusLockManager.trapFocus(container);\n\n const helpers = getLayoutHelpers(container, FocusLockManager, focusOnClose);\n\n if (showLoader) {\n helpers.showLoadingIcon();\n }\n\n if (fullscreen) {\n helpers.requestFullscreen();\n }\n\n return helpers;\n};\n\nconst getLayoutHelpers = (layoutNode, FocusLockManager, focusOnClose) => {\n const contentNode = document.createElement('div');\n layoutNode.append(contentNode);\n\n const loadingNode = document.createElement('div');\n layoutNode.append(loadingNode);\n\n /**\n * Close and destroy the window container.\n */\n const close = () => {\n exitFullscreen();\n unlockBodyScroll();\n FocusLockManager.untrapFocus();\n\n layoutNode.remove();\n\n if (focusOnClose) {\n try {\n focusOnClose.focus();\n } catch (e) {\n // eslint-disable-line\n }\n }\n };\n\n /**\n * Attempt to make the conatiner full screen.\n */\n const requestFullscreen = () => {\n if (layoutNode.requestFullscreen) {\n layoutNode.requestFullscreen();\n } else if (layoutNode.msRequestFullscreen) {\n layoutNode.msRequestFullscreen();\n } else if (layoutNode.mozRequestFullscreen) {\n layoutNode.mozRequestFullscreen();\n } else if (layoutNode.webkitRequestFullscreen) {\n layoutNode.webkitRequestFullscreen();\n } else {\n // Not supported.\n // Hack to make this act like full-screen as much as possible.\n layoutNode.setTop(0);\n }\n };\n\n /**\n * Exit full screen but do not close the container fully.\n */\n const exitFullscreen = () => {\n if (document.exitRequestFullScreen) {\n if (document.fullScreenElement !== layoutNode) {\n return;\n }\n document.exitRequestFullScreen();\n } else if (document.msExitFullscreen) {\n if (document.msFullscreenElement !== layoutNode) {\n return;\n }\n document.msExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n if (document.mozFullScreenElement !== layoutNode) {\n return;\n }\n document.mozCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n if (document.webkitFullscreenElement !== layoutNode) {\n return;\n }\n document.webkitExitFullscreen();\n }\n };\n\n const toggleFullscreen = () => {\n if (document.exitRequestFullScreen) {\n if (document.fullScreenElement === layoutNode) {\n exitFullscreen();\n } else {\n requestFullscreen();\n }\n } else if (document.msExitFullscreen) {\n if (document.msFullscreenElement === layoutNode) {\n exitFullscreen();\n } else {\n requestFullscreen();\n }\n } else if (document.mozCancelFullScreen) {\n if (document.mozFullScreenElement === layoutNode) {\n exitFullscreen();\n } else {\n requestFullscreen();\n }\n } else if (document.webkitExitFullscreen) {\n if (document.webkitFullscreenElement === layoutNode) {\n exitFullscreen();\n } else {\n requestFullscreen();\n }\n }\n };\n\n /**\n * Get the Node which is fullscreen.\n *\n * @return {Element}\n */\n const getContainer = () => {\n return contentNode;\n };\n\n const setContent = (content) => {\n hideLoadingIcon();\n\n // Note: It would be better to use replaceWith, but this is not compatible with IE.\n let child = contentNode.lastElementChild;\n while (child) {\n contentNode.removeChild(child);\n child = contentNode.lastElementChild;\n }\n contentNode.append(content);\n };\n\n const showLoadingIcon = () => {\n addIconToContainer(loadingNode);\n };\n\n const hideLoadingIcon = () => {\n // Hide the loading container.\n let child = loadingNode.lastElementChild;\n while (child) {\n loadingNode.removeChild(child);\n child = loadingNode.lastElementChild;\n }\n };\n\n /**\n * @return {Object}\n */\n return {\n close,\n\n toggleFullscreen,\n requestFullscreen,\n exitFullscreen,\n\n getContainer,\n setContent,\n\n showLoadingIcon,\n hideLoadingIcon,\n };\n};\n\nconst lockBodyScroll = () => {\n document.querySelector('body').classList.add('overflow-hidden');\n};\n\nconst unlockBodyScroll = () => {\n document.querySelector('body').classList.remove('overflow-hidden');\n};\n\nexport const createLayout = getComposedLayout;\n"],"file":"fullscreen.min.js"} \ No newline at end of file +{"version":3,"sources":["../../../src/local/layout/fullscreen.js"],"names":["createLayout","fullscreen","showLoader","focusOnClose","container","document","createElement","body","append","classList","add","setAttribute","lockBodyScroll","FocusLockManager","trapFocus","helpers","getLayoutHelpers","showLoadingIcon","requestFullscreen","layoutNode","contentNode","loadingNode","msRequestFullscreen","mozRequestFullscreen","webkitRequestFullscreen","setTop","exitFullscreen","exitRequestFullScreen","fullScreenElement","msExitFullscreen","msFullscreenElement","mozCancelFullScreen","mozFullScreenElement","webkitExitFullscreen","webkitFullscreenElement","hideLoadingIcon","child","lastElementChild","removeChild","close","unlockBodyScroll","untrapFocus","remove","focus","e","toggleFullscreen","getContainer","setContent","content","querySelector"],"mappings":"6fAyBA,O,siBAWO,GAAMA,CAAAA,CAAY,CAAG,UAIjB,8DAAP,EAAO,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lBA,CAAAA,eAAkB,EAAM,CAC1B,yBAAmBI,CAAnB,CACH,CAcM,CAWHc,eAAe,CAAfA,CAXG,CAaV,C,CAEKvB,CAAc,CAAG,UAAM,CACzBP,QAAQ,CAAC4C,aAAT,CAAuB,MAAvB,EAA+BxC,SAA/B,CAAyCC,GAAzC,CAA6C,iBAA7C,CACH,C,CAEK8B,CAAgB,CAAG,UAAM,CAC3BnC,QAAQ,CAAC4C,aAAT,CAAuB,MAAvB,EAA+BxC,SAA/B,CAAyCiC,MAAzC,CAAgD,iBAAhD,CACH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Full screen window layout.\n *\n * @module mod_forum/local/layout/fullscreen\n * @copyright 2019 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {addIconToContainer} from 'core/loadingicon';\nimport {addToastRegion} from 'core/toast';\nimport * as FocusLockManager from 'core/local/aria/focuslock';\n\n/**\n * Get the composed layout.\n *\n * @method\n * @param {string} templateName\n * @param {object} context\n * @returns {LayoutHelper}\n */\n\nexport const createLayout = ({\n fullscreen = true,\n showLoader = false,\n focusOnClose = null,\n} = {}) => {\n const container = document.createElement('div');\n document.body.append(container);\n container.classList.add('layout');\n container.classList.add('fullscreen');\n container.setAttribute('role', 'application');\n addToastRegion(container);\n\n // Lock scrolling on the document body.\n lockBodyScroll();\n\n // Lock tab control.\n FocusLockManager.trapFocus(container);\n\n const helpers = getLayoutHelpers(container, FocusLockManager, focusOnClose);\n\n if (showLoader) {\n helpers.showLoadingIcon();\n }\n\n if (fullscreen) {\n helpers.requestFullscreen();\n }\n\n return helpers;\n};\n\n/**\n * LayoutHelper A helper object containing functions for managing the current fullscreen layout\n *\n * @typedef {object}\n * @property {Function} close A function to close the fullscreen layout\n * @property {Function} toggleFullscreen A function to toggle the fullscreen from active to disabled and back\n * @property {Function} requestFullscreen Make a request to the browser to make the window full screen.\n * Note: This must be called in response to a direct user action\n * @property {Function} exitFullscreen Exit the fullscreen mode\n * @property {Function} getContainer Get the container of the fullscreen layout\n * @property {Function} setContent Set the content of the fullscreen layout\n * @property {Function} showLoadingIcon Display the loading icon\n * @property {Function} hideLoadingIcon Hide the loading icon\n */\n\n/**\n * Get the layout helpers.\n *\n * @method\n * @private\n * @param {HTMLElement} layoutNode\n * @param {FocusLockManager} FocusLockManager\n * @param {Boolean} focusOnClose\n * @returns {LayoutHelper}\n */\nconst getLayoutHelpers = (layoutNode, FocusLockManager, focusOnClose) => {\n const contentNode = document.createElement('div');\n layoutNode.append(contentNode);\n\n const loadingNode = document.createElement('div');\n layoutNode.append(loadingNode);\n\n /**\n * Close and destroy the window container.\n */\n const close = () => {\n exitFullscreen();\n unlockBodyScroll();\n FocusLockManager.untrapFocus();\n\n layoutNode.remove();\n\n if (focusOnClose) {\n try {\n focusOnClose.focus();\n } catch (e) {\n // eslint-disable-line\n }\n }\n };\n\n /**\n * Attempt to make the conatiner full screen.\n */\n const requestFullscreen = () => {\n if (layoutNode.requestFullscreen) {\n layoutNode.requestFullscreen();\n } else if (layoutNode.msRequestFullscreen) {\n layoutNode.msRequestFullscreen();\n } else if (layoutNode.mozRequestFullscreen) {\n layoutNode.mozRequestFullscreen();\n } else if (layoutNode.webkitRequestFullscreen) {\n layoutNode.webkitRequestFullscreen();\n } else {\n // Not supported.\n // Hack to make this act like full-screen as much as possible.\n layoutNode.setTop(0);\n }\n };\n\n /**\n * Exit full screen but do not close the container fully.\n */\n const exitFullscreen = () => {\n if (document.exitRequestFullScreen) {\n if (document.fullScreenElement !== layoutNode) {\n return;\n }\n document.exitRequestFullScreen();\n } else if (document.msExitFullscreen) {\n if (document.msFullscreenElement !== layoutNode) {\n return;\n }\n document.msExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n if (document.mozFullScreenElement !== layoutNode) {\n return;\n }\n document.mozCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n if (document.webkitFullscreenElement !== layoutNode) {\n return;\n }\n document.webkitExitFullscreen();\n }\n };\n\n const toggleFullscreen = () => {\n if (document.exitRequestFullScreen) {\n if (document.fullScreenElement === layoutNode) {\n exitFullscreen();\n } else {\n requestFullscreen();\n }\n } else if (document.msExitFullscreen) {\n if (document.msFullscreenElement === layoutNode) {\n exitFullscreen();\n } else {\n requestFullscreen();\n }\n } else if (document.mozCancelFullScreen) {\n if (document.mozFullScreenElement === layoutNode) {\n exitFullscreen();\n } else {\n requestFullscreen();\n }\n } else if (document.webkitExitFullscreen) {\n if (document.webkitFullscreenElement === layoutNode) {\n exitFullscreen();\n } else {\n requestFullscreen();\n }\n }\n };\n\n /**\n * Get the Node which is fullscreen.\n *\n * @return {Element}\n */\n const getContainer = () => {\n return contentNode;\n };\n\n const setContent = (content) => {\n hideLoadingIcon();\n\n // Note: It would be better to use replaceWith, but this is not compatible with IE.\n let child = contentNode.lastElementChild;\n while (child) {\n contentNode.removeChild(child);\n child = contentNode.lastElementChild;\n }\n contentNode.append(content);\n };\n\n const showLoadingIcon = () => {\n addIconToContainer(loadingNode);\n };\n\n const hideLoadingIcon = () => {\n // Hide the loading container.\n let child = loadingNode.lastElementChild;\n while (child) {\n loadingNode.removeChild(child);\n child = loadingNode.lastElementChild;\n }\n };\n\n /**\n * @return {Object}\n */\n return {\n close,\n\n toggleFullscreen,\n requestFullscreen,\n exitFullscreen,\n\n getContainer,\n setContent,\n\n showLoadingIcon,\n hideLoadingIcon,\n };\n};\n\nconst lockBodyScroll = () => {\n document.querySelector('body').classList.add('overflow-hidden');\n};\n\nconst unlockBodyScroll = () => {\n document.querySelector('body').classList.remove('overflow-hidden');\n};\n"],"file":"fullscreen.min.js"} \ No newline at end of file diff --git a/mod/forum/amd/src/discussion_nested_v2.js b/mod/forum/amd/src/discussion_nested_v2.js index 1b8f3d2b063fe..4ef64937c0b89 100644 --- a/mod/forum/amd/src/discussion_nested_v2.js +++ b/mod/forum/amd/src/discussion_nested_v2.js @@ -16,6 +16,7 @@ /** * Module for viewing a discussion in nested v2 view. * + * @module mod_Forum/discussion_nested_v2 * @copyright 2019 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -232,7 +233,7 @@ const buildShowInPageReplyFormFunction = (additionalTemplateContext) => { * * @param {Object} postContainer jQuery element for the post container */ - return async (postContainer) => { + return async(postContainer) => { const inPageReplyContainer = getInPageReplyContainer(postContainer); const repliesVisibilityToggleContainer = getRepliesVisibilityToggleContainer(postContainer); diff --git a/mod/forum/amd/src/form-user-selector.js b/mod/forum/amd/src/form-user-selector.js index 882ada63f5a73..3c69c3210ee6a 100644 --- a/mod/forum/amd/src/form-user-selector.js +++ b/mod/forum/amd/src/form-user-selector.js @@ -17,7 +17,6 @@ * Enrolled user selector module. * * @module mod_forum/form-user-selector - * @class form-user-selector * @copyright 2019 Shamim Rezaie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/mod/forum/amd/src/local/grades/local/grader/gradingpanel.js b/mod/forum/amd/src/local/grades/local/grader/gradingpanel.js index f79d67d9e2ee5..37314814af85c 100644 --- a/mod/forum/amd/src/local/grades/local/grader/gradingpanel.js +++ b/mod/forum/amd/src/local/grades/local/grader/gradingpanel.js @@ -16,7 +16,7 @@ /** * Grading panel functions. * - * @module mod_forum/local/grades/local/grader/gradingpnael + * @module mod_forum/local/grades/local/grader/gradingpanel * @copyright 2019 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -26,6 +26,7 @@ * This function dynamically pulls the relevant gradingpanel JS file defined in the grading method. * We do this because we do not know until execution time what the grading type is and we do not want to import unused files. * + * @method * @param {String} component The component being graded * @param {Number} context The contextid of the thing being graded * @param {String} gradingComponent The thing providing the grading type diff --git a/mod/forum/amd/src/local/grades/local/grader/user_picker.js b/mod/forum/amd/src/local/grades/local/grader/user_picker.js index d16c3d90c8e0c..565b60212faaf 100644 --- a/mod/forum/amd/src/local/grades/local/grader/user_picker.js +++ b/mod/forum/amd/src/local/grades/local/grader/user_picker.js @@ -27,11 +27,17 @@ import {get_string as getString} from 'core/str'; const templatePath = 'mod_forum/local/grades/local/grader'; +/** + * The Grader User Picker. + * + * @class mod_forum/local/grades/local/grader/user_picker + */ class UserPicker { /** * Constructor for the User Picker. * + * @constructor mod_forum/local/grades/local/grader/user_picker * @param {Array} userList List of users * @param {Function} showUserCallback The callback used to display the user * @param {Function} preChangeUserCallback The callback to use before changing user diff --git a/mod/forum/amd/src/local/layout/fullscreen.js b/mod/forum/amd/src/local/layout/fullscreen.js index 724629ff8f1dc..2e3984bf269e4 100644 --- a/mod/forum/amd/src/local/layout/fullscreen.js +++ b/mod/forum/amd/src/local/layout/fullscreen.js @@ -16,6 +16,7 @@ /** * Full screen window layout. * + * @module mod_forum/local/layout/fullscreen * @copyright 2019 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,11 +26,15 @@ import {addToastRegion} from 'core/toast'; import * as FocusLockManager from 'core/local/aria/focuslock'; /** + * Get the composed layout. + * + * @method * @param {string} templateName * @param {object} context - * @return {object} + * @returns {LayoutHelper} */ -const getComposedLayout = ({ + +export const createLayout = ({ fullscreen = true, showLoader = false, focusOnClose = null, @@ -60,6 +65,31 @@ const getComposedLayout = ({ return helpers; }; +/** + * LayoutHelper A helper object containing functions for managing the current fullscreen layout + * + * @typedef {object} + * @property {Function} close A function to close the fullscreen layout + * @property {Function} toggleFullscreen A function to toggle the fullscreen from active to disabled and back + * @property {Function} requestFullscreen Make a request to the browser to make the window full screen. + * Note: This must be called in response to a direct user action + * @property {Function} exitFullscreen Exit the fullscreen mode + * @property {Function} getContainer Get the container of the fullscreen layout + * @property {Function} setContent Set the content of the fullscreen layout + * @property {Function} showLoadingIcon Display the loading icon + * @property {Function} hideLoadingIcon Hide the loading icon + */ + +/** + * Get the layout helpers. + * + * @method + * @private + * @param {HTMLElement} layoutNode + * @param {FocusLockManager} FocusLockManager + * @param {Boolean} focusOnClose + * @returns {LayoutHelper} + */ const getLayoutHelpers = (layoutNode, FocusLockManager, focusOnClose) => { const contentNode = document.createElement('div'); layoutNode.append(contentNode); @@ -219,5 +249,3 @@ const lockBodyScroll = () => { const unlockBodyScroll = () => { document.querySelector('body').classList.remove('overflow-hidden'); }; - -export const createLayout = getComposedLayout; diff --git a/mod/lti/amd/build/cartridge_registration_form.min.js.map b/mod/lti/amd/build/cartridge_registration_form.min.js.map index 8882c71a8f962..b5a5c8c26b27d 100644 --- a/mod/lti/amd/build/cartridge_registration_form.min.js.map +++ b/mod/lti/amd/build/cartridge_registration_form.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/cartridge_registration_form.js"],"names":["define","$","ajax","notification","toolType","ltiEvents","KEYS","str","SELECTORS","CARTRIDGE_URL","CONSUMER_KEY","SHARED_SECRET","REGISTRATION_FORM","REGISTRATION_SUBMIT_BUTTON","REGISTRATION_CANCEL_BUTTON","getCartridgeURL","attr","getSubmitButton","getCancelButton","getConsumerKey","val","getSharedSecret","startLoading","addClass","stopLoading","removeClass","isLoading","hasClass","submitCartridgeURL","url","consumerKey","sharedSecret","promise","create","cartridgeurl","key","secret","done","get_string","s","document","trigger","NEW_TOOL_TYPE","STOP_CARTRIDGE_REGISTRATION","REGISTRATION_FEEDBACK","message","fail","exception","error","always","registerEventListeners","form","submit","e","preventDefault","cancelButton","click","keypress","metaKey","shiftKey","altKey","ctrlKey","keyCode","ENTER","SPACE","init"],"mappings":"AA2BAA,OAAM,uCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAA6C,mBAA7C,CAAkE,gBAAlE,CAAo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,CAPD,EAOGF,IAPH,CAOQ3C,CAAY,CAAC4C,SAPrB,CAQH,CAjBD,EAiBGE,MAjBH,CAiBU,UAAW,CACnBzB,CAAW,EACZ,CAnBD,EAqBA,MAAOQ,CAAAA,CACV,CAnJmE,CA2JhEkB,CAAsB,CAAG,UAAW,CACpC,GAAIC,CAAAA,CAAI,CAAGlD,CAAC,CAACO,CAAS,CAACI,iBAAX,CAAZ,CACAuC,CAAI,CAACC,MAAL,CAAY,SAASC,CAAT,CAAY,CACpBA,CAAC,CAACC,cAAF,GACA1B,CAAkB,EACrB,CAHD,EAKA,GAAI2B,CAAAA,CAAY,CAAGrC,CAAe,EAAlC,CACAqC,CAAY,CAACC,KAAb,CAAmB,SAASH,CAAT,CAAY,CAC3BA,CAAC,CAACC,cAAF,GACArD,CAAC,CAACuC,QAAD,CAAD,CAAYC,OAAZ,CAAoBpC,CAAS,CAACsC,2BAA9B,CACH,CAHD,EAIAY,CAAY,CAACE,QAAb,CAAsB,SAASJ,CAAT,CAAY,CAC9B,GAAI,CAACA,CAAC,CAACK,OAAH,EAAc,CAACL,CAAC,CAACM,QAAjB,EAA6B,CAACN,CAAC,CAACO,MAAhC,EAA0C,CAACP,CAAC,CAACQ,OAAjD,CAA0D,CACtD,GAAIR,CAAC,CAACS,OAAF,EAAaxD,CAAI,CAACyD,KAAlB,EAA2BV,CAAC,CAACS,OAAF,EAAaxD,CAAI,CAAC0D,KAAjD,CAAwD,CACpDX,CAAC,CAACC,cAAF,GACAC,CAAY,CAACC,KAAb,EACH,CACJ,CACJ,CAPD,CAQH,CA/KmE,CAiLpE,MAAgE,CAK5DS,IAAI,CAAE,eAAW,CACbf,CAAsB,EACzB,CAP2D,CASnE,CA3LK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Encapsules the behavior for creating a tool type from a cartridge URL\n * in Moodle. Manages the UI while operations are occuring.\n *\n * See template: mod_lti/cartridge_registration_form\n *\n * @module mod_lti/cartridge_registration_form\n * @class cartridge_registration_form\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/ajax', 'core/notification', 'mod_lti/tool_type', 'mod_lti/events', 'mod_lti/keys', 'core/str'],\n function($, ajax, notification, toolType, ltiEvents, KEYS, str) {\n\n var SELECTORS = {\n CARTRIDGE_URL: '#cartridge-url',\n CONSUMER_KEY: '#registration-key',\n SHARED_SECRET: '#registration-secret',\n REGISTRATION_FORM: '#cartridge-registration-form',\n REGISTRATION_SUBMIT_BUTTON: '#cartridge-registration-submit',\n REGISTRATION_CANCEL_BUTTON: '#cartridge-registration-cancel',\n };\n\n /**\n * Return the URL the user entered for the cartridge.\n *\n * @method getCartridgeURL\n * @private\n * @return {String}\n */\n var getCartridgeURL = function() {\n return $(SELECTORS.REGISTRATION_FORM).attr('data-cartridge-url');\n };\n\n /**\n * Return the submit button element.\n *\n * @method getSubmitButton\n * @private\n * @return {JQuery} jQuery object\n */\n var getSubmitButton = function() {\n return $(SELECTORS.REGISTRATION_SUBMIT_BUTTON);\n };\n\n /**\n * Return the cancel button element.\n *\n * @method getCancelButton\n * @private\n * @return {JQuery} jQuery object\n */\n var getCancelButton = function() {\n return $(SELECTORS.REGISTRATION_CANCEL_BUTTON);\n };\n\n /**\n * Return the value that the user entered for the consumer key.\n *\n * @method getConsumerKey\n * @private\n * @return {String} the value entered for consumer key.\n */\n var getConsumerKey = function() {\n return $(SELECTORS.CONSUMER_KEY).val();\n };\n\n /**\n * Return the value that the user entered for the shared secret.\n *\n * @method getSharedSecret\n * @private\n * @return {String} the value entered for shared secret\n */\n var getSharedSecret = function() {\n return $(SELECTORS.SHARED_SECRET).val();\n };\n\n /**\n * Trigger a visual loading indicator.\n *\n * @method startLoading\n * @private\n */\n var startLoading = function() {\n getSubmitButton().addClass('loading');\n };\n\n /**\n * Stop the visual loading indicator.\n *\n * @method stopLoading\n * @private\n */\n var stopLoading = function() {\n getSubmitButton().removeClass('loading');\n };\n\n /**\n * Check if the page is currently loading.\n *\n * @method isLoading\n * @private\n * @return {Boolean}\n */\n var isLoading = function() {\n return getSubmitButton().hasClass('loading');\n };\n\n /**\n * Create a tool type from the cartridge URL that the user input. This will\n * send an ajax request to the Moodle server to create the Type. The request will\n * include the consumer key and secret, if any.\n *\n * On success the page will be re-rendered to take the user back to the original\n * page with the list of tools and an alert notifying them of success.\n *\n * @method submitCartridgeURL\n * @private\n * @return {Promise} jQuery Deferred object\n */\n var submitCartridgeURL = function() {\n if (isLoading()) {\n return false;\n }\n\n var url = getCartridgeURL();\n // No URL? Do nothing.\n if (url === \"\") {\n return false;\n }\n\n startLoading();\n var consumerKey = getConsumerKey();\n var sharedSecret = getSharedSecret();\n var promise = toolType.create({cartridgeurl: url, key: consumerKey, secret: sharedSecret});\n\n promise.done(function() {\n str.get_string('successfullycreatedtooltype', 'mod_lti').done(function(s) {\n $(document).trigger(ltiEvents.NEW_TOOL_TYPE);\n $(document).trigger(ltiEvents.STOP_CARTRIDGE_REGISTRATION);\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, {\n message: s\n });\n }).fail(notification.exception);\n }).fail(function() {\n str.get_string('failedtocreatetooltype', 'mod_lti').done(function(s) {\n $(document).trigger(ltiEvents.NEW_TOOL_TYPE);\n $(document).trigger(ltiEvents.STOP_CARTRIDGE_REGISTRATION);\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, {\n message: s,\n error: true\n });\n }).fail(notification.exception);\n }).always(function() {\n stopLoading();\n });\n\n return promise;\n };\n\n /**\n * Sets up the listeners for user interaction on the page.\n *\n * @method registerEventListeners\n * @private\n */\n var registerEventListeners = function() {\n var form = $(SELECTORS.REGISTRATION_FORM);\n form.submit(function(e) {\n e.preventDefault();\n submitCartridgeURL();\n });\n\n var cancelButton = getCancelButton();\n cancelButton.click(function(e) {\n e.preventDefault();\n $(document).trigger(ltiEvents.STOP_CARTRIDGE_REGISTRATION);\n });\n cancelButton.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER || e.keyCode == KEYS.SPACE) {\n e.preventDefault();\n cancelButton.click();\n }\n }\n });\n };\n\n return /** @alias module:mod_lti/cartridge_registration_form */ {\n\n /**\n * Initialise this module.\n */\n init: function() {\n registerEventListeners();\n }\n };\n});\n"],"file":"cartridge_registration_form.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/cartridge_registration_form.js"],"names":["define","$","ajax","notification","toolType","ltiEvents","KEYS","str","SELECTORS","CARTRIDGE_URL","CONSUMER_KEY","SHARED_SECRET","REGISTRATION_FORM","REGISTRATION_SUBMIT_BUTTON","REGISTRATION_CANCEL_BUTTON","getCartridgeURL","attr","getSubmitButton","getCancelButton","getConsumerKey","val","getSharedSecret","startLoading","addClass","stopLoading","removeClass","isLoading","hasClass","submitCartridgeURL","url","consumerKey","sharedSecret","promise","create","cartridgeurl","key","secret","done","get_string","s","document","trigger","NEW_TOOL_TYPE","STOP_CARTRIDGE_REGISTRATION","REGISTRATION_FEEDBACK","message","fail","exception","error","always","registerEventListeners","form","submit","e","preventDefault","cancelButton","click","keypress","metaKey","shiftKey","altKey","ctrlKey","keyCode","ENTER","SPACE","init"],"mappings":"AA0BAA,OAAM,uCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAA6C,mBAA7C,CAAkE,gBAAlE,CAAoF,cAApF,CAAoG,UAApG,CAAD,CACE,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgCC,CAA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,UAAW,CACnBzB,CAAW,EACZ,CAnBD,EAqBA,MAAOQ,CAAAA,CACV,CAnJmE,CA2JhEkB,CAAsB,CAAG,UAAW,CACpC,GAAIC,CAAAA,CAAI,CAAGlD,CAAC,CAACO,CAAS,CAACI,iBAAX,CAAZ,CACAuC,CAAI,CAACC,MAAL,CAAY,SAASC,CAAT,CAAY,CACpBA,CAAC,CAACC,cAAF,GACA1B,CAAkB,EACrB,CAHD,EAKA,GAAI2B,CAAAA,CAAY,CAAGrC,CAAe,EAAlC,CACAqC,CAAY,CAACC,KAAb,CAAmB,SAASH,CAAT,CAAY,CAC3BA,CAAC,CAACC,cAAF,GACArD,CAAC,CAACuC,QAAD,CAAD,CAAYC,OAAZ,CAAoBpC,CAAS,CAACsC,2BAA9B,CACH,CAHD,EAIAY,CAAY,CAACE,QAAb,CAAsB,SAASJ,CAAT,CAAY,CAC9B,GAAI,CAACA,CAAC,CAACK,OAAH,EAAc,CAACL,CAAC,CAACM,QAAjB,EAA6B,CAACN,CAAC,CAACO,MAAhC,EAA0C,CAACP,CAAC,CAACQ,OAAjD,CAA0D,CACtD,GAAIR,CAAC,CAACS,OAAF,EAAaxD,CAAI,CAACyD,KAAlB,EAA2BV,CAAC,CAACS,OAAF,EAAaxD,CAAI,CAAC0D,KAAjD,CAAwD,CACpDX,CAAC,CAACC,cAAF,GACAC,CAAY,CAACC,KAAb,EACH,CACJ,CACJ,CAPD,CAQH,CA/KmE,CAiLpE,MAAgE,CAK5DS,IAAI,CAAE,eAAW,CACbf,CAAsB,EACzB,CAP2D,CASnE,CA3LK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Encapsules the behavior for creating a tool type from a cartridge URL\n * in Moodle. Manages the UI while operations are occuring.\n *\n * See template: mod_lti/cartridge_registration_form\n *\n * @module mod_lti/cartridge_registration_form\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/ajax', 'core/notification', 'mod_lti/tool_type', 'mod_lti/events', 'mod_lti/keys', 'core/str'],\n function($, ajax, notification, toolType, ltiEvents, KEYS, str) {\n\n var SELECTORS = {\n CARTRIDGE_URL: '#cartridge-url',\n CONSUMER_KEY: '#registration-key',\n SHARED_SECRET: '#registration-secret',\n REGISTRATION_FORM: '#cartridge-registration-form',\n REGISTRATION_SUBMIT_BUTTON: '#cartridge-registration-submit',\n REGISTRATION_CANCEL_BUTTON: '#cartridge-registration-cancel',\n };\n\n /**\n * Return the URL the user entered for the cartridge.\n *\n * @method getCartridgeURL\n * @private\n * @return {String}\n */\n var getCartridgeURL = function() {\n return $(SELECTORS.REGISTRATION_FORM).attr('data-cartridge-url');\n };\n\n /**\n * Return the submit button element.\n *\n * @method getSubmitButton\n * @private\n * @return {JQuery} jQuery object\n */\n var getSubmitButton = function() {\n return $(SELECTORS.REGISTRATION_SUBMIT_BUTTON);\n };\n\n /**\n * Return the cancel button element.\n *\n * @method getCancelButton\n * @private\n * @return {JQuery} jQuery object\n */\n var getCancelButton = function() {\n return $(SELECTORS.REGISTRATION_CANCEL_BUTTON);\n };\n\n /**\n * Return the value that the user entered for the consumer key.\n *\n * @method getConsumerKey\n * @private\n * @return {String} the value entered for consumer key.\n */\n var getConsumerKey = function() {\n return $(SELECTORS.CONSUMER_KEY).val();\n };\n\n /**\n * Return the value that the user entered for the shared secret.\n *\n * @method getSharedSecret\n * @private\n * @return {String} the value entered for shared secret\n */\n var getSharedSecret = function() {\n return $(SELECTORS.SHARED_SECRET).val();\n };\n\n /**\n * Trigger a visual loading indicator.\n *\n * @method startLoading\n * @private\n */\n var startLoading = function() {\n getSubmitButton().addClass('loading');\n };\n\n /**\n * Stop the visual loading indicator.\n *\n * @method stopLoading\n * @private\n */\n var stopLoading = function() {\n getSubmitButton().removeClass('loading');\n };\n\n /**\n * Check if the page is currently loading.\n *\n * @method isLoading\n * @private\n * @return {Boolean}\n */\n var isLoading = function() {\n return getSubmitButton().hasClass('loading');\n };\n\n /**\n * Create a tool type from the cartridge URL that the user input. This will\n * send an ajax request to the Moodle server to create the Type. The request will\n * include the consumer key and secret, if any.\n *\n * On success the page will be re-rendered to take the user back to the original\n * page with the list of tools and an alert notifying them of success.\n *\n * @method submitCartridgeURL\n * @private\n * @return {Promise} jQuery Deferred object\n */\n var submitCartridgeURL = function() {\n if (isLoading()) {\n return false;\n }\n\n var url = getCartridgeURL();\n // No URL? Do nothing.\n if (url === \"\") {\n return false;\n }\n\n startLoading();\n var consumerKey = getConsumerKey();\n var sharedSecret = getSharedSecret();\n var promise = toolType.create({cartridgeurl: url, key: consumerKey, secret: sharedSecret});\n\n promise.done(function() {\n str.get_string('successfullycreatedtooltype', 'mod_lti').done(function(s) {\n $(document).trigger(ltiEvents.NEW_TOOL_TYPE);\n $(document).trigger(ltiEvents.STOP_CARTRIDGE_REGISTRATION);\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, {\n message: s\n });\n }).fail(notification.exception);\n }).fail(function() {\n str.get_string('failedtocreatetooltype', 'mod_lti').done(function(s) {\n $(document).trigger(ltiEvents.NEW_TOOL_TYPE);\n $(document).trigger(ltiEvents.STOP_CARTRIDGE_REGISTRATION);\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, {\n message: s,\n error: true\n });\n }).fail(notification.exception);\n }).always(function() {\n stopLoading();\n });\n\n return promise;\n };\n\n /**\n * Sets up the listeners for user interaction on the page.\n *\n * @method registerEventListeners\n * @private\n */\n var registerEventListeners = function() {\n var form = $(SELECTORS.REGISTRATION_FORM);\n form.submit(function(e) {\n e.preventDefault();\n submitCartridgeURL();\n });\n\n var cancelButton = getCancelButton();\n cancelButton.click(function(e) {\n e.preventDefault();\n $(document).trigger(ltiEvents.STOP_CARTRIDGE_REGISTRATION);\n });\n cancelButton.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER || e.keyCode == KEYS.SPACE) {\n e.preventDefault();\n cancelButton.click();\n }\n }\n });\n };\n\n return /** @alias module:mod_lti/cartridge_registration_form */ {\n\n /**\n * Initialise this module.\n */\n init: function() {\n registerEventListeners();\n }\n };\n});\n"],"file":"cartridge_registration_form.min.js"} \ No newline at end of file diff --git a/mod/lti/amd/build/contentitem.min.js.map b/mod/lti/amd/build/contentitem.min.js.map index 8162972033519..a86d602581ce2 100644 --- a/mod/lti/amd/build/contentitem.min.js.map +++ b/mod/lti/amd/build/contentitem.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/contentitem.js"],"names":["define","$","notification","str","templates","FormField","ModalFactory","ModalEvents","dialogue","doneCallback","ltiFormFields","TYPES","TEXT","EDITOR","CHECKBOX","SELECT","hideElement","e","setAttribute","showElement","removeAttribute","showMultipleSummaryAndHideForm","items","form","document","querySelector","toolArea","buttonGroup","submitAndLaunch","Array","from","children","forEach","renderForPromise","html","js","replaceNodeContents","configToVariant","config","variant","name","introeditor","text","format","instructorchoiceacceptgrades","grade_modgrade_point","window","processContentItemReturnData","returnData","hide","multiple","index","setFieldValue","variants","v","push","submitAndCourse","onclick","preventDefault","disabled","fd","FormData","backToCourse","click","reduce","postVariant","promise","Object","entries","entry","set","body","URLSearchParams","doPost","fetch","location","pathname","method","then","catch","Promise","resolve","field","value","init","url","postData","cb","bodyPromise","render","setBody","show","get_string","title","create","large","modal","getRoot","on","hidden","fetchNotifications","exception"],"mappings":"kYA2BAA,OAAM,uBACF,CACI,QADJ,CAEI,mBAFJ,CAGI,UAHJ,CAII,gBAJJ,CAKI,oBALJ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AAhC,EAAuCd,IAAvC,CAA4C,SAASe,CAAT,CAAgB,CACxD,MAAOvF,CAAAA,CAAY,CAACwF,MAAb,CAAoB,CACvBD,KAAK,CAAEA,CADgB,CAEvBtB,IAAI,CAAEiB,CAFiB,CAGvBO,KAAK,GAHkB,CAApB,CAKV,CAND,EAMGjB,IANH,CAMQ,SAASkB,CAAT,CAAgB,CACpBxF,CAAQ,CAAGwF,CAAX,CAEAA,CAAK,CAACC,OAAN,GAAgBC,EAAhB,CAAmB3F,CAAW,CAAC4F,MAA/B,CAAuC,UAAW,CAE9CH,CAAK,CAACN,OAAN,CAAc,EAAd,EAGAxF,CAAY,CAACkG,kBAAb,EACH,CAND,EASAJ,CAAK,CAACL,IAAN,EAEH,CApBD,EAoBGZ,KApBH,CAoBS7E,CAAY,CAACmG,SApBtB,CAqBH,CA7Ca,CAsMrB,CAnNC,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Launches the modal dialogue that contains the iframe that sends the Content-Item selection request to an\n * LTI tool provider that supports Content-Item type message.\n *\n * See template: mod_lti/contentitem\n *\n * @module mod_lti/contentitem\n * @class contentitem\n * @copyright 2016 Jun Pataleta \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.2\n */\ndefine(\n [\n 'jquery',\n 'core/notification',\n 'core/str',\n 'core/templates',\n 'mod_lti/form-field',\n 'core/modal_factory',\n 'core/modal_events'\n ],\n function($, notification, str, templates, FormField, ModalFactory, ModalEvents) {\n var dialogue;\n var doneCallback;\n var contentItem = {\n /**\n * Init function.\n *\n * @param {string} url The URL for the content item selection.\n * @param {object} postData The data to be sent for the content item selection request.\n * @param {Function} cb The callback to run once the content item has been processed.\n */\n init: function(url, postData, cb) {\n doneCallback = cb;\n var context = {\n url: url,\n postData: postData\n };\n var bodyPromise = templates.render('mod_lti/contentitem', context);\n\n if (dialogue) {\n // Set dialogue body.\n dialogue.setBody(bodyPromise);\n // Display the dialogue.\n dialogue.show();\n return;\n }\n\n str.get_string('selectcontent', 'lti').then(function(title) {\n return ModalFactory.create({\n title: title,\n body: bodyPromise,\n large: true\n });\n }).then(function(modal) {\n dialogue = modal;\n // On hide handler.\n modal.getRoot().on(ModalEvents.hidden, function() {\n // Empty modal contents when it's hidden.\n modal.setBody('');\n\n // Fetch notifications.\n notification.fetchNotifications();\n });\n\n // Display the dialogue.\n modal.show();\n return;\n }).catch(notification.exception);\n }\n };\n\n /**\n * Array of form fields for LTI tool configuration.\n */\n var ltiFormFields = [\n new FormField('name', FormField.TYPES.TEXT, false, ''),\n new FormField('introeditor', FormField.TYPES.EDITOR, false, ''),\n new FormField('toolurl', FormField.TYPES.TEXT, true, ''),\n new FormField('securetoolurl', FormField.TYPES.TEXT, true, ''),\n new FormField('instructorchoiceacceptgrades', FormField.TYPES.CHECKBOX, true, true),\n new FormField('instructorchoicesendname', FormField.TYPES.CHECKBOX, true, true),\n new FormField('instructorchoicesendemailaddr', FormField.TYPES.CHECKBOX, true, true),\n new FormField('instructorcustomparameters', FormField.TYPES.TEXT, true, ''),\n new FormField('icon', FormField.TYPES.TEXT, true, ''),\n new FormField('secureicon', FormField.TYPES.TEXT, true, ''),\n new FormField('launchcontainer', FormField.TYPES.SELECT, true, 0),\n new FormField('grade_modgrade_point', FormField.TYPES.TEXT, false, ''),\n new FormField('lineitemresourceid', FormField.TYPES.TEXT, true, ''),\n new FormField('lineitemtag', FormField.TYPES.TEXT, true, '')\n ];\n\n /**\n * Hide the element, including aria and tab index.\n * @param {HTMLElement} e the element to be hidden.\n */\n const hideElement = (e) => {\n e.setAttribute('hidden', 'true');\n e.setAttribute('aria-hidden', 'true');\n e.setAttribute('tab-index', '-1');\n };\n\n /**\n * Show the element, including aria and tab index (set to 1).\n * @param {HTMLElement} e the element to be shown.\n */\n const showElement = (e) => {\n e.removeAttribute('hidden');\n e.setAttribute('aria-hidden', 'false');\n e.setAttribute('tab-index', '1');\n };\n\n /**\n * When more than one item needs to be added, the UI is simplified\n * to just list the items to be added. Form is hidden and the only\n * options is (save and return to course) or cancel.\n * This function injects the summary to the form page, and hides\n * the unneeded elements.\n * @param {Object[]} items items to be added to the course.\n */\n const showMultipleSummaryAndHideForm = async function(items) {\n const form = document.querySelector('#region-main-box form');\n const toolArea = form.querySelector('[data-attribute=\"dynamic-import\"]');\n const buttonGroup = form.querySelector('#fgroup_id_buttonar');\n const submitAndLaunch = form.querySelector('#id_submitbutton');\n Array.from(form.children).forEach(hideElement);\n hideElement(submitAndLaunch);\n const {html, js} = await templates.renderForPromise('mod_lti/tool_deeplinking_results',\n {items: items});\n\n await templates.replaceNodeContents(toolArea, html, js);\n showElement(toolArea);\n showElement(buttonGroup);\n };\n\n /**\n * Transforms config values aimed at populating the lti mod form to JSON variant\n * which are used to insert more than one activity modules in one submit\n * by applying variation to the submitted form.\n * See /course/modedit.php.\n * @private\n * @param {Object} config transforms a config to an actual form data to be posted.\n * @return {Object} variant that will be used to modify form values on submit.\n */\n var configToVariant = (config) => {\n const variant = {};\n ['name', 'toolurl', 'securetoolurl', 'instructorcustomparameters', 'icon', 'secureicon',\n 'launchcontainer', 'lineitemresourceid', 'lineitemtag'].forEach(\n function(name) {\n variant[name] = config[name] || '';\n }\n );\n variant['introeditor[text]'] = config.introeditor ? config.introeditor.text : '';\n variant['introeditor[format]'] = config.introeditor ? config.introeditor.format : '';\n if (config.instructorchoiceacceptgrades === 1) {\n variant.instructorchoiceacceptgrades = '1';\n variant['grade[modgrade_point]'] = config.grade_modgrade_point || '100';\n } else {\n variant.instructorchoiceacceptgrades = '0';\n }\n return variant;\n };\n\n /**\n * Window function that can be called from mod_lti/contentitem_return to close the dialogue and process the return data.\n * If the return data contains more than one item, the form will not be populated with item data\n * but rather hidden, and the item data will be added to a single input field used to create multiple\n * instances in one request.\n *\n * @param {object} returnData The fetched configuration data from the Content-Item selection dialogue.\n */\n window.processContentItemReturnData = function(returnData) {\n if (dialogue) {\n dialogue.hide();\n }\n var index;\n if (returnData.multiple) {\n for (index in ltiFormFields) {\n // Name is required, so putting a placeholder as it will not be used\n // in multi-items add.\n ltiFormFields[index].setFieldValue(ltiFormFields[index].name === 'name' ? 'item' : null);\n }\n var variants = [];\n returnData.multiple.forEach(function(v) {\n variants.push(configToVariant(v));\n });\n showMultipleSummaryAndHideForm(returnData.multiple);\n const submitAndCourse = document.querySelector('#id_submitbutton2');\n submitAndCourse.onclick = (e) => {\n e.preventDefault();\n submitAndCourse.disabled = true;\n const fd = new FormData(document.querySelector('form.mform'));\n const postVariant = (promise, variant) => {\n Object.entries(variant).forEach((entry) => fd.set(entry[0], entry[1]));\n const body = new URLSearchParams(fd);\n const doPost = () => fetch(document.location.pathname, {method: 'post', body});\n return promise.then(doPost).catch(doPost);\n };\n const backToCourse = () => {\n document.querySelector(\"#id_cancel\").click();\n };\n variants.reduce(postVariant, Promise.resolve()).then(backToCourse).catch(backToCourse);\n };\n } else {\n // Populate LTI configuration fields from return data.\n for (index in ltiFormFields) {\n var field = ltiFormFields[index];\n var value = null;\n if (typeof returnData[field.name] !== 'undefined') {\n value = returnData[field.name];\n }\n field.setFieldValue(value);\n }\n field.setFieldValue(value);\n }\n\n if (doneCallback) {\n doneCallback(returnData);\n }\n };\n\n return contentItem;\n }\n);\n"],"file":"contentitem.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/contentitem.js"],"names":["define","$","notification","str","templates","FormField","ModalFactory","ModalEvents","dialogue","doneCallback","ltiFormFields","TYPES","TEXT","EDITOR","CHECKBOX","SELECT","hideElement","e","setAttribute","showElement","removeAttribute","showMultipleSummaryAndHideForm","items","form","document","querySelector","toolArea","buttonGroup","submitAndLaunch","Array","from","children","forEach","renderForPromise","html","js","replaceNodeContents","configToVariant","config","variant","name","introeditor","text","format","instructorchoiceacceptgrades","grade_modgrade_point","window","processContentItemReturnData","returnData","hide","multiple","index","setFieldValue","variants","v","push","submitAndCourse","onclick","preventDefault","disabled","fd","FormData","backToCourse","click","reduce","postVariant","promise","Object","entries","entry","set","body","URLSearchParams","doPost","fetch","location","pathname","method","then","catch","Promise","resolve","field","value","init","url","postData","cb","bodyPromise","render","setBody","show","get_string","title","create","large","modal","getRoot","on","hidden","fetchNotifications","exception"],"mappings":"kYA0BAA,OAAM,uBACF,CACI,QADJ,CAEI,mBAFJ,CAGI,UAHJ,CAII,gBAJJ,CAKI,oBALJ,CAMI,oBANJ,CAOI,mBAPJ,CADE,CAUF,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAA+BC,CAA/B,CAA0CC,CAA1C,CAAqDC,CAArD,CAAmEC,CAAnE,CAAgF,IACxEC,CAAAA,CADwE,CAExEC,CAFwE,CAsDxEC,CAAa,CAAG,CAChB,GAAIL,CAAAA,CAAJ,CAAc,MAAd,CAAsBA,CAAS,CAACM,KAAV,CAAgBC,IAAtC,IAAmD,EAAnD,CADgB,CAEhB,GAAIP,CAAAA,CAAJ,CAAc,aAAd,CAA6BA,CAAS,CAACM,KAAV,CAAgBE,MAA7C,IAA4D,EAA5D,CAFgB,CAGhB,GAAIR,CAAAA,CAAJ,CAAc,SAAd,CAAyBA,CAAS,CAACM,KAAV,CAAgBC,IAAzC,IAAqD,EAArD,CAHgB,CAIhB,GAAIP,CAAAA,CAAJ,CAAc,eAAd,CAA+BA,CAAS,CAACM,KAAV,CAAgBC,IAA/C,IAA2D,EAA3D,CAJgB,CAKhB,GAAIP,CAAAA,CAAJ,CAAc,8BAAd,CAA8CA,CAAS,CAACM,KAAV,CAAgBG,QAA9D,OALgB,CAMhB,GAAIT,CAAAA,CAAJ,CAAc,0BAAd,CAA0CA,C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,CAAkB,CACdA,CAAY,CAACuC,CAAD,CACf,CACJ,CAhDD,CAkDA,MArMkB,CAQdoC,IAAI,CAAE,cAASC,CAAT,CAAcC,CAAd,CAAwBC,CAAxB,CAA4B,CAC9B9E,CAAY,CAAG8E,CAAf,CAD8B,GAM1BC,CAAAA,CAAW,CAAGpF,CAAS,CAACqF,MAAV,CAAiB,qBAAjB,CAJJ,CACVJ,GAAG,CAAEA,CADK,CAEVC,QAAQ,CAAEA,CAFA,CAII,CANY,CAQ9B,GAAI9E,CAAJ,CAAc,CAEVA,CAAQ,CAACkF,OAAT,CAAiBF,CAAjB,EAEAhF,CAAQ,CAACmF,IAAT,GACA,MACH,CAEDxF,CAAG,CAACyF,UAAJ,CAAe,eAAf,CAAgC,KAAhC,EAAuCd,IAAvC,CAA4C,SAASe,CAAT,CAAgB,CACxD,MAAOvF,CAAAA,CAAY,CAACwF,MAAb,CAAoB,CACvBD,KAAK,CAAEA,CADgB,CAEvBtB,IAAI,CAAEiB,CAFiB,CAGvBO,KAAK,GAHkB,CAApB,CAKV,CAND,EAMGjB,IANH,CAMQ,SAASkB,CAAT,CAAgB,CACpBxF,CAAQ,CAAGwF,CAAX,CAEAA,CAAK,CAACC,OAAN,GAAgBC,EAAhB,CAAmB3F,CAAW,CAAC4F,MAA/B,CAAuC,UAAW,CAE9CH,CAAK,CAACN,OAAN,CAAc,EAAd,EAGAxF,CAAY,CAACkG,kBAAb,EACH,CAND,EASAJ,CAAK,CAACL,IAAN,EAEH,CApBD,EAoBGZ,KApBH,CAoBS7E,CAAY,CAACmG,SApBtB,CAqBH,CA7Ca,CAsMrB,CAnNC,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Launches the modal dialogue that contains the iframe that sends the Content-Item selection request to an\n * LTI tool provider that supports Content-Item type message.\n *\n * See template: mod_lti/contentitem\n *\n * @module mod_lti/contentitem\n * @copyright 2016 Jun Pataleta \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.2\n */\ndefine(\n [\n 'jquery',\n 'core/notification',\n 'core/str',\n 'core/templates',\n 'mod_lti/form-field',\n 'core/modal_factory',\n 'core/modal_events'\n ],\n function($, notification, str, templates, FormField, ModalFactory, ModalEvents) {\n var dialogue;\n var doneCallback;\n var contentItem = {\n /**\n * Init function.\n *\n * @param {string} url The URL for the content item selection.\n * @param {object} postData The data to be sent for the content item selection request.\n * @param {Function} cb The callback to run once the content item has been processed.\n */\n init: function(url, postData, cb) {\n doneCallback = cb;\n var context = {\n url: url,\n postData: postData\n };\n var bodyPromise = templates.render('mod_lti/contentitem', context);\n\n if (dialogue) {\n // Set dialogue body.\n dialogue.setBody(bodyPromise);\n // Display the dialogue.\n dialogue.show();\n return;\n }\n\n str.get_string('selectcontent', 'lti').then(function(title) {\n return ModalFactory.create({\n title: title,\n body: bodyPromise,\n large: true\n });\n }).then(function(modal) {\n dialogue = modal;\n // On hide handler.\n modal.getRoot().on(ModalEvents.hidden, function() {\n // Empty modal contents when it's hidden.\n modal.setBody('');\n\n // Fetch notifications.\n notification.fetchNotifications();\n });\n\n // Display the dialogue.\n modal.show();\n return;\n }).catch(notification.exception);\n }\n };\n\n /**\n * Array of form fields for LTI tool configuration.\n */\n var ltiFormFields = [\n new FormField('name', FormField.TYPES.TEXT, false, ''),\n new FormField('introeditor', FormField.TYPES.EDITOR, false, ''),\n new FormField('toolurl', FormField.TYPES.TEXT, true, ''),\n new FormField('securetoolurl', FormField.TYPES.TEXT, true, ''),\n new FormField('instructorchoiceacceptgrades', FormField.TYPES.CHECKBOX, true, true),\n new FormField('instructorchoicesendname', FormField.TYPES.CHECKBOX, true, true),\n new FormField('instructorchoicesendemailaddr', FormField.TYPES.CHECKBOX, true, true),\n new FormField('instructorcustomparameters', FormField.TYPES.TEXT, true, ''),\n new FormField('icon', FormField.TYPES.TEXT, true, ''),\n new FormField('secureicon', FormField.TYPES.TEXT, true, ''),\n new FormField('launchcontainer', FormField.TYPES.SELECT, true, 0),\n new FormField('grade_modgrade_point', FormField.TYPES.TEXT, false, ''),\n new FormField('lineitemresourceid', FormField.TYPES.TEXT, true, ''),\n new FormField('lineitemtag', FormField.TYPES.TEXT, true, '')\n ];\n\n /**\n * Hide the element, including aria and tab index.\n * @param {HTMLElement} e the element to be hidden.\n */\n const hideElement = (e) => {\n e.setAttribute('hidden', 'true');\n e.setAttribute('aria-hidden', 'true');\n e.setAttribute('tab-index', '-1');\n };\n\n /**\n * Show the element, including aria and tab index (set to 1).\n * @param {HTMLElement} e the element to be shown.\n */\n const showElement = (e) => {\n e.removeAttribute('hidden');\n e.setAttribute('aria-hidden', 'false');\n e.setAttribute('tab-index', '1');\n };\n\n /**\n * When more than one item needs to be added, the UI is simplified\n * to just list the items to be added. Form is hidden and the only\n * options is (save and return to course) or cancel.\n * This function injects the summary to the form page, and hides\n * the unneeded elements.\n * @param {Object[]} items items to be added to the course.\n */\n const showMultipleSummaryAndHideForm = async function(items) {\n const form = document.querySelector('#region-main-box form');\n const toolArea = form.querySelector('[data-attribute=\"dynamic-import\"]');\n const buttonGroup = form.querySelector('#fgroup_id_buttonar');\n const submitAndLaunch = form.querySelector('#id_submitbutton');\n Array.from(form.children).forEach(hideElement);\n hideElement(submitAndLaunch);\n const {html, js} = await templates.renderForPromise('mod_lti/tool_deeplinking_results',\n {items: items});\n\n await templates.replaceNodeContents(toolArea, html, js);\n showElement(toolArea);\n showElement(buttonGroup);\n };\n\n /**\n * Transforms config values aimed at populating the lti mod form to JSON variant\n * which are used to insert more than one activity modules in one submit\n * by applying variation to the submitted form.\n * See /course/modedit.php.\n * @private\n * @param {Object} config transforms a config to an actual form data to be posted.\n * @return {Object} variant that will be used to modify form values on submit.\n */\n var configToVariant = (config) => {\n const variant = {};\n ['name', 'toolurl', 'securetoolurl', 'instructorcustomparameters', 'icon', 'secureicon',\n 'launchcontainer', 'lineitemresourceid', 'lineitemtag'].forEach(\n function(name) {\n variant[name] = config[name] || '';\n }\n );\n variant['introeditor[text]'] = config.introeditor ? config.introeditor.text : '';\n variant['introeditor[format]'] = config.introeditor ? config.introeditor.format : '';\n if (config.instructorchoiceacceptgrades === 1) {\n variant.instructorchoiceacceptgrades = '1';\n variant['grade[modgrade_point]'] = config.grade_modgrade_point || '100';\n } else {\n variant.instructorchoiceacceptgrades = '0';\n }\n return variant;\n };\n\n /**\n * Window function that can be called from mod_lti/contentitem_return to close the dialogue and process the return data.\n * If the return data contains more than one item, the form will not be populated with item data\n * but rather hidden, and the item data will be added to a single input field used to create multiple\n * instances in one request.\n *\n * @param {object} returnData The fetched configuration data from the Content-Item selection dialogue.\n */\n window.processContentItemReturnData = function(returnData) {\n if (dialogue) {\n dialogue.hide();\n }\n var index;\n if (returnData.multiple) {\n for (index in ltiFormFields) {\n // Name is required, so putting a placeholder as it will not be used\n // in multi-items add.\n ltiFormFields[index].setFieldValue(ltiFormFields[index].name === 'name' ? 'item' : null);\n }\n var variants = [];\n returnData.multiple.forEach(function(v) {\n variants.push(configToVariant(v));\n });\n showMultipleSummaryAndHideForm(returnData.multiple);\n const submitAndCourse = document.querySelector('#id_submitbutton2');\n submitAndCourse.onclick = (e) => {\n e.preventDefault();\n submitAndCourse.disabled = true;\n const fd = new FormData(document.querySelector('form.mform'));\n const postVariant = (promise, variant) => {\n Object.entries(variant).forEach((entry) => fd.set(entry[0], entry[1]));\n const body = new URLSearchParams(fd);\n const doPost = () => fetch(document.location.pathname, {method: 'post', body});\n return promise.then(doPost).catch(doPost);\n };\n const backToCourse = () => {\n document.querySelector(\"#id_cancel\").click();\n };\n variants.reduce(postVariant, Promise.resolve()).then(backToCourse).catch(backToCourse);\n };\n } else {\n // Populate LTI configuration fields from return data.\n for (index in ltiFormFields) {\n var field = ltiFormFields[index];\n var value = null;\n if (typeof returnData[field.name] !== 'undefined') {\n value = returnData[field.name];\n }\n field.setFieldValue(value);\n }\n field.setFieldValue(value);\n }\n\n if (doneCallback) {\n doneCallback(returnData);\n }\n };\n\n return contentItem;\n }\n);\n"],"file":"contentitem.min.js"} \ No newline at end of file diff --git a/mod/lti/amd/build/contentitem_return.min.js.map b/mod/lti/amd/build/contentitem_return.min.js.map index 22a22673283b1..f415a8271b14b 100644 --- a/mod/lti/amd/build/contentitem_return.min.js.map +++ b/mod/lti/amd/build/contentitem_return.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/contentitem_return.js"],"names":["define","$","init","returnData","window","ready","top","parent","processContentItemReturnData"],"mappings":"AAwBAA,OAAM,8BAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAC3B,MAAO,CAMHC,IAAI,CAAE,cAASC,CAAT,CAAqB,CAEvBF,CAAC,CAACG,MAAD,CAAD,CAAUC,KAAV,CAAgB,UAAW,CACvB,GAAID,MAAM,EAAIE,GAAd,CAAmB,CAEfC,MAAM,CAACC,4BAAP,CAAoCL,CAApC,CACH,CAHD,IAGO,CACHC,MAAM,CAACI,4BAAP,CAAoCL,CAApC,CACH,CACJ,CAPD,CAQH,CAhBE,CAkBV,CAnBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Processes the result of LTI tool creation from a Content-Item message type.\n *\n * @module mod_lti/contentitem_return\n * @class contentitem_return\n * @copyright 2016 Jun Pataleta \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.2\n */\ndefine(['jquery'], function($) {\n return {\n /**\n * Init function.\n *\n * @param {string} returnData The returned data.\n */\n init: function(returnData) {\n // Make sure the window has loaded before we perform processing.\n $(window).ready(function() {\n if (window != top) {\n // Send return data to be processed by the parent window.\n parent.processContentItemReturnData(returnData);\n } else {\n window.processContentItemReturnData(returnData);\n }\n });\n }\n };\n});\n"],"file":"contentitem_return.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/contentitem_return.js"],"names":["define","$","init","returnData","window","ready","top","parent","processContentItemReturnData"],"mappings":"AAuBAA,OAAM,8BAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAC3B,MAAO,CAMHC,IAAI,CAAE,cAASC,CAAT,CAAqB,CAEvBF,CAAC,CAACG,MAAD,CAAD,CAAUC,KAAV,CAAgB,UAAW,CACvB,GAAID,MAAM,EAAIE,GAAd,CAAmB,CAEfC,MAAM,CAACC,4BAAP,CAAoCL,CAApC,CACH,CAHD,IAGO,CACHC,MAAM,CAACI,4BAAP,CAAoCL,CAApC,CACH,CACJ,CAPD,CAQH,CAhBE,CAkBV,CAnBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Processes the result of LTI tool creation from a Content-Item message type.\n *\n * @module mod_lti/contentitem_return\n * @copyright 2016 Jun Pataleta \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.2\n */\ndefine(['jquery'], function($) {\n return {\n /**\n * Init function.\n *\n * @param {string} returnData The returned data.\n */\n init: function(returnData) {\n // Make sure the window has loaded before we perform processing.\n $(window).ready(function() {\n if (window != top) {\n // Send return data to be processed by the parent window.\n parent.processContentItemReturnData(returnData);\n } else {\n window.processContentItemReturnData(returnData);\n }\n });\n }\n };\n});\n"],"file":"contentitem_return.min.js"} \ No newline at end of file diff --git a/mod/lti/amd/build/external_registration.min.js.map b/mod/lti/amd/build/external_registration.min.js.map index 3cca5029612a1..b505db28059b2 100644 --- a/mod/lti/amd/build/external_registration.min.js.map +++ b/mod/lti/amd/build/external_registration.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/external_registration.js"],"names":["define","$","ajax","notification","templates","ltiEvents","toolProxy","toolType","KEYS","str","SELECTORS","EXTERNAL_REGISTRATION_CONTAINER","EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER","EXTERNAL_REGISTRATION_CANCEL_BUTTON","TOOL_TYPE_CAPABILITIES_CONTAINER","TOOL_TYPE_CAPABILITIES_TEMPLATE_CONTAINER","CAPABILITIES_AGREE_CONTAINER","getExternalRegistrationCancelButton","getExternalRegistrationContainer","getExternalRegistrationTemplateContainer","getToolTypeCapabilitiesContainer","getToolTypeCapabilitiesTemplateContainer","startLoadingCapabilitiesContainer","addClass","stopLoadingCapabilitiesContainer","removeClass","startLoadingCancel","stopLoadingCancel","hideToolTypeCapabilitiesContainer","showToolTypeCapabilitiesContainer","hideExternalRegistrationContent","showExternalRegistrationContent","setToolProxyId","id","button","attr","getToolProxyId","clearToolProxyId","removeAttr","hasToolProxyId","hasCreatedToolProxy","setProxyAsNew","setProxyAsOld","getRegistrationRequest","call","methodname","args","cancelRegistration","promise","Deferred","delete","done","resolve","fail","failure","reject","finishExternalRegistration","exception","get_string","s","document","trigger","REGISTRATION_FEEDBACK","message","error","renderExternalRegistrationWindow","registrationRequest","render","html","js","container","append","runTemplateJS","find","submit","setTypeStatusActive","typeData","update","state","constants","configured","promptForToolTypeCapabilitiesAgreement","replaceNodeContents","choiceContainer","on","CAPABILITIES_AGREE","always","empty","CAPABILITIES_DECLINE","createAndRegisterToolProxy","url","create","regurl","result","registerProxy","feedback","STOP_EXTERNAL_REGISTRATION","registerEventListeners","START_EXTERNAL_REGISTRATION","event","data","proxyid","cancelExternalRegistrationButton","click","e","preventDefault","keypress","metaKey","shiftKey","altKey","ctrlKey","keyCode","ENTER","SPACE","window","triggerExternalRegistrationComplete","status","NEW_TOOL_TYPE","proxyId","getFromToolProxyId","types","length","hascapabilitygroups","init"],"mappings":"AA8BAA,OAAM,iCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAA6C,gBAA7C,CAA+D,gBAA/D,CACC,oBADD,CACuB,mBADvB,CAC4C,cAD5C,CAC4D,UAD5D,CAAD,CAEE,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAsDC,CAAtD,CAAiEC,CAAjE,CAA2EC,CAA3E,CAAiFC,CAAjF,CAAsF,IAEtFC,CAAAA,CAAS,CAAG,CACZC,+BAA+B,CAAE,uCADrB,CAEZC,wCAAwC,CAAE,2CAF9B,CAGZC,mCAAmC,CAAE,+BAHzB,CAIZC,gCAAgC,CAAE,mCAJtB,CAKZC,yCAAyC,CAAE,4CAL/B,CAMZC,4BAA4B,CAAE,yBANlB,CAF0E,CAmBtFC,CAAmC,CAAG,UAAW,CACjD,MAAOhB,CAAAA,CAAC,CAACS,CAAS,CAACG,mCAAX,CACX,CArByF,CA+BtFK,CAAgC,CAAG,UAAW,CAC9C,MAAOjB,CAAAA,CAAC,CAACS,CAAS,CAACC,+BAAX,CACX,CAjCyF,CA2CtFQ,CAAwC,CAAG,UAAW,CACtD,MAAOlB,CAAAA,CAAC,CAACS,CAAS,CAACE,wCAAX,CACX,CA7CyF,CAwDtFQ,CAAgC,CAAG,UAAW,CAC9C,MAAOnB,CAAA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,CAAC2D,QAAD,CAAD,CAAYC,OAAZ,CAAoBxD,CAAS,CAACyD,qBAA9B,CAAqDiC,CAArD,CACH,CAFD,CAGH,CAJD,EAIG1C,IAJH,CAIQlD,CAAY,CAACsD,SAJrB,EAMAT,CAAO,CAACI,OAAR,EACH,CAED,MAAOJ,CAAAA,CACV,CACJ,CAplByF,CAslB1F,MAA0D,CAKtD2E,IAAI,CAAE,eAAW,CACb1B,CAAsB,EACzB,CAPqD,CAS7D,CAjmBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Encapsules the behavior for creating a tool type and tool proxy from a\n * registration url in Moodle.\n *\n * Manages the UI while operations are occuring, including rendering external\n * registration page within the iframe.\n *\n * See template: mod_lti/external_registration\n *\n * @module mod_lti/external_registration\n * @class external_registration\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/events',\n 'mod_lti/tool_proxy', 'mod_lti/tool_type', 'mod_lti/keys', 'core/str'],\n function($, ajax, notification, templates, ltiEvents, toolProxy, toolType, KEYS, str) {\n\n var SELECTORS = {\n EXTERNAL_REGISTRATION_CONTAINER: '#external-registration-page-container',\n EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER: '#external-registration-template-container',\n EXTERNAL_REGISTRATION_CANCEL_BUTTON: '#cancel-external-registration',\n TOOL_TYPE_CAPABILITIES_CONTAINER: '#tool-type-capabilities-container',\n TOOL_TYPE_CAPABILITIES_TEMPLATE_CONTAINER: '#tool-type-capabilities-template-container',\n CAPABILITIES_AGREE_CONTAINER: '.capabilities-container',\n };\n\n /**\n * Return the external registration cancel button element. This button is\n * the cancel button that appears while the iframe is rendered.\n *\n * @method getExternalRegistrationCancelButton\n * @private\n * @return {JQuery} jQuery object\n */\n var getExternalRegistrationCancelButton = function() {\n return $(SELECTORS.EXTERNAL_REGISTRATION_CANCEL_BUTTON);\n };\n\n /**\n * Return the container that holds all elements for the external registration, including\n * the cancel button and the iframe.\n *\n * @method getExternalRegistrationContainer\n * @private\n * @return {JQuery} jQuery object\n */\n var getExternalRegistrationContainer = function() {\n return $(SELECTORS.EXTERNAL_REGISTRATION_CONTAINER);\n };\n\n /**\n * Return the container that holds the external registration page template. It should\n * be the iframe.\n *\n * @method getExternalRegistrationTemplateContainer\n * @private\n * @return {JQuery} jQuery object\n */\n var getExternalRegistrationTemplateContainer = function() {\n return $(SELECTORS.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER);\n };\n\n /**\n * Return the container that holds the elements for displaying the list of capabilities\n * that this tool type requires. This container wraps the loading indicator and the template\n * container.\n *\n * @method getToolTypeCapabilitiesContainer\n * @private\n * @return {JQuery} jQuery object\n */\n var getToolTypeCapabilitiesContainer = function() {\n return $(SELECTORS.TOOL_TYPE_CAPABILITIES_CONTAINER);\n };\n\n /**\n * Return the container that holds the template that lists the capabilities that the\n * tool type will require.\n *\n * @method getToolTypeCapabilitiesTemplateContainer\n * @private\n * @return {JQuery} jQuery object\n */\n var getToolTypeCapabilitiesTemplateContainer = function() {\n return $(SELECTORS.TOOL_TYPE_CAPABILITIES_TEMPLATE_CONTAINER);\n };\n\n /**\n * Triggers a visual indicator to show that the capabilities section is loading.\n *\n * @method startLoadingCapabilitiesContainer\n * @private\n */\n var startLoadingCapabilitiesContainer = function() {\n getToolTypeCapabilitiesContainer().addClass('loading');\n };\n\n /**\n * Removes the visual indicator that shows the capabilities section is loading.\n *\n * @method stopLoadingCapabilitiesContainer\n * @private\n */\n var stopLoadingCapabilitiesContainer = function() {\n getToolTypeCapabilitiesContainer().removeClass('loading');\n };\n\n /**\n * Adds a visual indicator that shows the cancel button is loading.\n *\n * @method startLoadingCancel\n * @private\n */\n var startLoadingCancel = function() {\n getExternalRegistrationCancelButton().addClass('loading');\n };\n\n /**\n * Adds a visual indicator that shows the cancel button is loading.\n *\n * @method startLoadingCancel\n * @private\n */\n var stopLoadingCancel = function() {\n getExternalRegistrationCancelButton().removeClass('loading');\n };\n\n /**\n * Stops displaying the tool type capabilities container.\n *\n * @method hideToolTypeCapabilitiesContainer\n * @private\n */\n var hideToolTypeCapabilitiesContainer = function() {\n getToolTypeCapabilitiesContainer().addClass('hidden');\n };\n\n /**\n * Displays the tool type capabilities container.\n *\n * @method showToolTypeCapabilitiesContainer\n * @private\n */\n var showToolTypeCapabilitiesContainer = function() {\n getToolTypeCapabilitiesContainer().removeClass('hidden');\n };\n\n /**\n * Stops displaying the external registration content.\n *\n * @method hideExternalRegistrationContent\n * @private\n */\n var hideExternalRegistrationContent = function() {\n getExternalRegistrationContainer().addClass('hidden');\n };\n\n /**\n * Displays the external registration content.\n *\n * @method showExternalRegistrationContent\n * @private\n */\n var showExternalRegistrationContent = function() {\n getExternalRegistrationContainer().removeClass('hidden');\n };\n\n /**\n * Save the given tool proxy id on the DOM.\n *\n * @method setToolProxyId\n * @private\n * @param {Integer} id Tool proxy ID\n */\n var setToolProxyId = function(id) {\n var button = getExternalRegistrationCancelButton();\n button.attr('data-tool-proxy-id', id);\n };\n\n /**\n * Return the saved tool proxy id.\n *\n * @method getToolProxyId\n * @private\n * @return {String} Tool proxy ID\n */\n var getToolProxyId = function() {\n var button = getExternalRegistrationCancelButton();\n return button.attr('data-tool-proxy-id');\n };\n\n /**\n * Remove the saved tool proxy id.\n *\n * @method clearToolProxyId\n * @private\n */\n var clearToolProxyId = function() {\n var button = getExternalRegistrationCancelButton();\n button.removeAttr('data-tool-proxy-id');\n };\n\n /**\n * Returns true if a tool proxy id has been recorded.\n *\n * @method hasToolProxyId\n * @private\n * @return {Boolean}\n */\n var hasToolProxyId = function() {\n return getToolProxyId() ? true : false;\n };\n\n /**\n * Checks if this process has created a tool proxy within\n * Moodle yet.\n *\n * @method hasCreatedToolProxy\n * @private\n * @return {Boolean}\n */\n var hasCreatedToolProxy = function() {\n var button = getExternalRegistrationCancelButton();\n return button.attr('data-tool-proxy-new') && hasToolProxyId();\n };\n\n /**\n * Records that this process has created a tool proxy.\n *\n * @method setProxyAsNew\n * @private\n * @return {Boolean}\n */\n var setProxyAsNew = function() {\n var button = getExternalRegistrationCancelButton();\n return button.attr('data-tool-proxy-new', \"new\");\n };\n\n /**\n * Records that this process has not created a tool proxy.\n *\n * @method setProxyAsOld\n * @private\n * @return {Boolean}\n */\n var setProxyAsOld = function() {\n var button = getExternalRegistrationCancelButton();\n return button.removeAttr('data-tool-proxy-new');\n };\n\n /**\n * Gets the external registration request required to be sent to the external\n * registration page using a form.\n *\n * See mod_lti/tool_proxy_registration_form template.\n *\n * @method getRegistrationRequest\n * @private\n * @param {Integer} id Tool Proxy ID\n * @return {Promise} jQuery Deferred object\n */\n var getRegistrationRequest = function(id) {\n var request = {\n methodname: 'mod_lti_get_tool_proxy_registration_request',\n args: {\n id: id\n }\n };\n\n return ajax.call([request])[0];\n };\n\n /**\n * Cancel an in progress external registration. This will perform any necessary\n * clean up of tool proxies and return the page section back to the home section.\n *\n * @method cancelRegistration\n * @private\n * @return {Promise} jQuery Deferred object\n */\n var cancelRegistration = function() {\n startLoadingCancel();\n var promise = $.Deferred();\n\n // If we've created a proxy as part of this process then\n // we need to delete it to clean up the data in the back end.\n if (hasCreatedToolProxy()) {\n var id = getToolProxyId();\n toolProxy.delete(id).done(function() {\n promise.resolve();\n }).fail(function(failure) {\n promise.reject(failure);\n });\n } else {\n promise.resolve();\n }\n\n promise.done(function() {\n // Return to the original page.\n finishExternalRegistration();\n stopLoadingCancel();\n }).fail(function(failure) {\n notification.exception(failure);\n finishExternalRegistration();\n stopLoadingCancel();\n str.get_string('failedtodeletetoolproxy', 'mod_lti').done(function(s) {\n var feedback = {\n message: s,\n error: true\n };\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, feedback);\n }).fail(notification.exception);\n });\n\n return promise;\n };\n\n /**\n * Load the external registration template and render it in the DOM and display it.\n *\n * @method renderExternalRegistrationWindow\n * @private\n * @param {Object} registrationRequest\n * @return {Promise} jQuery Deferred object\n */\n var renderExternalRegistrationWindow = function(registrationRequest) {\n var promise = templates.render('mod_lti/tool_proxy_registration_form', registrationRequest);\n\n promise.done(function(html, js) {\n // Show the external registration page in an iframe.\n var container = getExternalRegistrationTemplateContainer();\n container.append(html);\n templates.runTemplateJS(js);\n\n container.find('form').submit();\n showExternalRegistrationContent();\n }).fail(notification.exception);\n\n return promise;\n };\n\n /**\n * Send a request to Moodle server to set the state of the tool type to configured (active).\n *\n * @method setTypeStatusActive\n * @private\n * @param {Object} typeData A set of data representing a type, as returned by a request to get a type\n * from the Moodle server.\n * @return {Promise} jQuery Deferred object\n */\n var setTypeStatusActive = function(typeData) {\n return toolType.update({\n id: typeData.id,\n state: toolType.constants.state.configured\n });\n };\n\n /**\n * Render and display an agreement page for the user to acknowledge the list of capabilities\n * (groups of data) that the external tool requires in order to work. If the user agrees then\n * we will activate the tool so that it is immediately available. If they don't agree then\n * the tool remains in a pending state within Moodle until agreement is given.\n *\n * @method promptForToolTypeCapabilitiesAgreement\n * @private\n * @param {Object} typeData A set of data representing a type, as returned by a request to get a type\n * from the Moodle server.\n * @return {Promise} jQuery Deferred object\n */\n var promptForToolTypeCapabilitiesAgreement = function(typeData) {\n var promise = $.Deferred();\n\n templates.render('mod_lti/tool_type_capabilities_agree', typeData).done(function(html, js) {\n var container = getToolTypeCapabilitiesTemplateContainer();\n\n hideExternalRegistrationContent();\n showToolTypeCapabilitiesContainer();\n\n templates.replaceNodeContents(container, html, js);\n\n var choiceContainer = container.find(SELECTORS.CAPABILITIES_AGREE_CONTAINER);\n\n // The user agrees to allow the tool to use the groups of data so we can go\n // ahead and activate it for them so that it can be used straight away.\n choiceContainer.on(ltiEvents.CAPABILITIES_AGREE, function() {\n startLoadingCapabilitiesContainer();\n setTypeStatusActive(typeData).always(function() {\n stopLoadingCapabilitiesContainer();\n container.empty();\n promise.resolve();\n });\n });\n\n // The user declines to let the tool use the data. In this case we leave\n // the tool as pending and they can delete it using the main screen if they\n // wish.\n choiceContainer.on(ltiEvents.CAPABILITIES_DECLINE, function() {\n container.empty();\n promise.resolve();\n });\n }).fail(promise.reject);\n\n promise.done(function() {\n hideToolTypeCapabilitiesContainer();\n }).fail(notification.exception);\n\n return promise;\n };\n\n /**\n * Send a request to the Moodle server to create a tool proxy using the registration URL the user\n * has provided. The proxy is required for the external registration page to work correctly.\n *\n * After the proxy is created the external registration page is rendered within an iframe for the user\n * to complete the registration in the external page.\n *\n * If the tool proxy creation fails then we redirect the page section back to the home section and\n * display the error, rather than rendering the external registration page.\n *\n * @method createAndRegisterToolProxy\n * @private\n * @param {String} url Tool registration URL to register\n * @return {Promise} jQuery Deferred object\n */\n var createAndRegisterToolProxy = function(url) {\n var promise = $.Deferred();\n\n if (!url || url === \"\") {\n // No URL has been input so do nothing.\n promise.resolve();\n } else {\n // A tool proxy needs to exist before the external page is rendered because\n // the external page sends requests back to Moodle for information that is stored\n // in the proxy.\n toolProxy.create({regurl: url})\n .done(function(result) {\n // Note that it's a new proxy so we will always clean it up.\n setProxyAsNew();\n promise = registerProxy(result.id);\n })\n .fail(function(exception) {\n // Clean up.\n cancelRegistration();\n // Let the user know what the error is.\n var feedback = {\n message: exception.message,\n error: true\n };\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, feedback);\n promise.reject(exception);\n });\n }\n\n return promise;\n };\n\n /**\n * Loads the window to register a proxy, given an ID.\n *\n * @method registerProxy\n * @private\n * @param {Integer} id Proxy id to register\n * @return {Promise} jQuery Deferred object to fail or resolve\n */\n var registerProxy = function(id) {\n var promise = $.Deferred();\n // Save the id on the DOM to cleanup later.\n setToolProxyId(id);\n\n // There is a specific set of data needed to send to the external registration page\n // in a form, so let's get it from our server.\n getRegistrationRequest(id)\n .done(function(registrationRequest) {\n renderExternalRegistrationWindow(registrationRequest)\n .done(function() {\n promise.resolve();\n })\n .fail(promise.fail);\n })\n .fail(promise.fail);\n\n return promise;\n };\n\n /**\n * Complete the registration process, clean up any left over data and\n * trigger the appropriate events.\n *\n * @method finishExternalRegistration\n * @private\n */\n var finishExternalRegistration = function() {\n if (hasToolProxyId()) {\n clearToolProxyId();\n }\n setProxyAsOld(false);\n\n hideExternalRegistrationContent();\n var container = getExternalRegistrationTemplateContainer();\n container.empty();\n\n $(document).trigger(ltiEvents.STOP_EXTERNAL_REGISTRATION);\n };\n\n /**\n * Sets up the listeners for user interaction on the page.\n *\n * @method registerEventListeners\n * @private\n */\n var registerEventListeners = function() {\n\n $(document).on(ltiEvents.START_EXTERNAL_REGISTRATION, function(event, data) {\n if (!data) {\n return;\n }\n if (data.url) {\n createAndRegisterToolProxy(data.url);\n }\n if (data.proxyid) {\n registerProxy(data.proxyid);\n }\n });\n\n var cancelExternalRegistrationButton = getExternalRegistrationCancelButton();\n cancelExternalRegistrationButton.click(function(e) {\n e.preventDefault();\n cancelRegistration();\n });\n cancelExternalRegistrationButton.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER || e.keyCode == KEYS.SPACE) {\n e.preventDefault();\n cancelRegistration();\n }\n }\n });\n\n // This is gross but necessary due to isolated jQuery scopes between\n // child iframe and parent windows. There is no other way to communicate.\n //\n // This function gets called by the moodle page that received the redirect\n // from the external registration page and handles the external page's returned\n // parameters.\n //\n // See AMD module mod_lti/external_registration_return.\n window.triggerExternalRegistrationComplete = function(data) {\n var promise = $.Deferred();\n var feedback = {\n message: \"\",\n error: false\n };\n\n if (data.status == \"success\") {\n str.get_string('successfullycreatedtooltype', 'mod_lti').done(function(s) {\n feedback.message = s;\n }).fail(notification.exception);\n\n // Trigger appropriate events when we've completed the necessary requests.\n promise.done(function() {\n finishExternalRegistration();\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, feedback);\n $(document).trigger(ltiEvents.NEW_TOOL_TYPE);\n }).fail(notification.exception);\n\n // We should have created a tool proxy by this point.\n if (hasCreatedToolProxy()) {\n var proxyId = getToolProxyId();\n\n // We need the list of types that are linked to this proxy. We're assuming it'll\n // only be one because this process creates a one-to-one type->proxy.\n toolType.getFromToolProxyId(proxyId).done(function(types) {\n if (types && types.length) {\n // There should only be one result.\n var typeData = types[0];\n\n // Check if the external tool required access to any Moodle data (users, courses etc).\n if (typeData.hascapabilitygroups) {\n // If it did then we ask the user to agree to those groups before the type is\n // activated (i.e. can be used in Moodle).\n promptForToolTypeCapabilitiesAgreement(typeData).always(function() {\n promise.resolve();\n });\n } else {\n promise.resolve();\n }\n } else {\n promise.resolve();\n }\n }).fail(function() {\n promise.resolve();\n });\n }\n } else {\n // Anything other than success is failure.\n feedback.message = data.error;\n feedback.error = true;\n\n // Cancel registration to clean up any proxies and tools that were\n // created.\n promise.done(function() {\n cancelRegistration().always(function() {\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, feedback);\n });\n }).fail(notification.exception);\n\n promise.resolve();\n }\n\n return promise;\n };\n };\n\n return /** @alias module:mod_lti/external_registration */ {\n\n /**\n * Initialise this module.\n */\n init: function() {\n registerEventListeners();\n }\n };\n});\n"],"file":"external_registration.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/external_registration.js"],"names":["define","$","ajax","notification","templates","ltiEvents","toolProxy","toolType","KEYS","str","SELECTORS","EXTERNAL_REGISTRATION_CONTAINER","EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER","EXTERNAL_REGISTRATION_CANCEL_BUTTON","TOOL_TYPE_CAPABILITIES_CONTAINER","TOOL_TYPE_CAPABILITIES_TEMPLATE_CONTAINER","CAPABILITIES_AGREE_CONTAINER","getExternalRegistrationCancelButton","getExternalRegistrationContainer","getExternalRegistrationTemplateContainer","getToolTypeCapabilitiesContainer","getToolTypeCapabilitiesTemplateContainer","startLoadingCapabilitiesContainer","addClass","stopLoadingCapabilitiesContainer","removeClass","startLoadingCancel","stopLoadingCancel","hideToolTypeCapabilitiesContainer","showToolTypeCapabilitiesContainer","hideExternalRegistrationContent","showExternalRegistrationContent","setToolProxyId","id","button","attr","getToolProxyId","clearToolProxyId","removeAttr","hasToolProxyId","hasCreatedToolProxy","setProxyAsNew","setProxyAsOld","getRegistrationRequest","call","methodname","args","cancelRegistration","promise","Deferred","delete","done","resolve","fail","failure","reject","finishExternalRegistration","exception","get_string","s","document","trigger","REGISTRATION_FEEDBACK","message","error","renderExternalRegistrationWindow","registrationRequest","render","html","js","container","append","runTemplateJS","find","submit","setTypeStatusActive","typeData","update","state","constants","configured","promptForToolTypeCapabilitiesAgreement","replaceNodeContents","choiceContainer","on","CAPABILITIES_AGREE","always","empty","CAPABILITIES_DECLINE","createAndRegisterToolProxy","url","create","regurl","result","registerProxy","feedback","STOP_EXTERNAL_REGISTRATION","registerEventListeners","START_EXTERNAL_REGISTRATION","event","data","proxyid","cancelExternalRegistrationButton","click","e","preventDefault","keypress","metaKey","shiftKey","altKey","ctrlKey","keyCode","ENTER","SPACE","window","triggerExternalRegistrationComplete","status","NEW_TOOL_TYPE","proxyId","getFromToolProxyId","types","length","hascapabilitygroups","init"],"mappings":"AA6BAA,OAAM,iCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAA6C,gBAA7C,CAA+D,gBAA/D,CACC,oBADD,CACuB,mBADvB,CAC4C,cAD5C,CAC4D,UAD5D,CAAD,CAEE,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAsDC,CAAtD,CAAiEC,CAAjE,CAA2EC,CAA3E,CAAiFC,CAAjF,CAAsF,IAEtFC,CAAAA,CAAS,CAAG,CACZC,+BAA+B,CAAE,uCADrB,CA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C,CAG9BzC,CAAsC,CAACL,CAAD,CAAtC,CAAiDU,MAAjD,CAAwD,UAAW,CAC/DtC,CAAO,CAACI,OAAR,EACH,CAFD,CAGH,CAND,IAMO,CACHJ,CAAO,CAACI,OAAR,EACH,CACJ,CAdD,IAcO,CACHJ,CAAO,CAACI,OAAR,EACH,CACJ,CAlBD,EAkBGC,IAlBH,CAkBQ,UAAW,CACfL,CAAO,CAACI,OAAR,EACH,CApBD,CAqBH,CACJ,CAxCD,IAwCO,CAEH2C,CAAQ,CAAChC,OAAT,CAAmBqC,CAAI,CAACpC,KAAxB,CACA+B,CAAQ,CAAC/B,KAAT,IAIAhB,CAAO,CAACG,IAAR,CAAa,UAAW,CACpBJ,CAAkB,GAAGuC,MAArB,CAA4B,UAAW,CACnCrF,CAAC,CAAC2D,QAAD,CAAD,CAAYC,OAAZ,CAAoBxD,CAAS,CAACyD,qBAA9B,CAAqDiC,CAArD,CACH,CAFD,CAGH,CAJD,EAIG1C,IAJH,CAIQlD,CAAY,CAACsD,SAJrB,EAMAT,CAAO,CAACI,OAAR,EACH,CAED,MAAOJ,CAAAA,CACV,CACJ,CAplByF,CAslB1F,MAAO,CAKH2E,IAAI,CAAE,eAAW,CACb1B,CAAsB,EACzB,CAPE,CASV,CAjmBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Encapsules the behavior for creating a tool type and tool proxy from a\n * registration url in Moodle.\n *\n * Manages the UI while operations are occuring, including rendering external\n * registration page within the iframe.\n *\n * See template: mod_lti/external_registration\n *\n * @module mod_lti/external_registration\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/events',\n 'mod_lti/tool_proxy', 'mod_lti/tool_type', 'mod_lti/keys', 'core/str'],\n function($, ajax, notification, templates, ltiEvents, toolProxy, toolType, KEYS, str) {\n\n var SELECTORS = {\n EXTERNAL_REGISTRATION_CONTAINER: '#external-registration-page-container',\n EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER: '#external-registration-template-container',\n EXTERNAL_REGISTRATION_CANCEL_BUTTON: '#cancel-external-registration',\n TOOL_TYPE_CAPABILITIES_CONTAINER: '#tool-type-capabilities-container',\n TOOL_TYPE_CAPABILITIES_TEMPLATE_CONTAINER: '#tool-type-capabilities-template-container',\n CAPABILITIES_AGREE_CONTAINER: '.capabilities-container',\n };\n\n /**\n * Return the external registration cancel button element. This button is\n * the cancel button that appears while the iframe is rendered.\n *\n * @method getExternalRegistrationCancelButton\n * @private\n * @return {JQuery} jQuery object\n */\n var getExternalRegistrationCancelButton = function() {\n return $(SELECTORS.EXTERNAL_REGISTRATION_CANCEL_BUTTON);\n };\n\n /**\n * Return the container that holds all elements for the external registration, including\n * the cancel button and the iframe.\n *\n * @method getExternalRegistrationContainer\n * @private\n * @return {JQuery} jQuery object\n */\n var getExternalRegistrationContainer = function() {\n return $(SELECTORS.EXTERNAL_REGISTRATION_CONTAINER);\n };\n\n /**\n * Return the container that holds the external registration page template. It should\n * be the iframe.\n *\n * @method getExternalRegistrationTemplateContainer\n * @private\n * @return {JQuery} jQuery object\n */\n var getExternalRegistrationTemplateContainer = function() {\n return $(SELECTORS.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER);\n };\n\n /**\n * Return the container that holds the elements for displaying the list of capabilities\n * that this tool type requires. This container wraps the loading indicator and the template\n * container.\n *\n * @method getToolTypeCapabilitiesContainer\n * @private\n * @return {JQuery} jQuery object\n */\n var getToolTypeCapabilitiesContainer = function() {\n return $(SELECTORS.TOOL_TYPE_CAPABILITIES_CONTAINER);\n };\n\n /**\n * Return the container that holds the template that lists the capabilities that the\n * tool type will require.\n *\n * @method getToolTypeCapabilitiesTemplateContainer\n * @private\n * @return {JQuery} jQuery object\n */\n var getToolTypeCapabilitiesTemplateContainer = function() {\n return $(SELECTORS.TOOL_TYPE_CAPABILITIES_TEMPLATE_CONTAINER);\n };\n\n /**\n * Triggers a visual indicator to show that the capabilities section is loading.\n *\n * @method startLoadingCapabilitiesContainer\n * @private\n */\n var startLoadingCapabilitiesContainer = function() {\n getToolTypeCapabilitiesContainer().addClass('loading');\n };\n\n /**\n * Removes the visual indicator that shows the capabilities section is loading.\n *\n * @method stopLoadingCapabilitiesContainer\n * @private\n */\n var stopLoadingCapabilitiesContainer = function() {\n getToolTypeCapabilitiesContainer().removeClass('loading');\n };\n\n /**\n * Adds a visual indicator that shows the cancel button is loading.\n *\n * @method startLoadingCancel\n * @private\n */\n var startLoadingCancel = function() {\n getExternalRegistrationCancelButton().addClass('loading');\n };\n\n /**\n * Adds a visual indicator that shows the cancel button is loading.\n *\n * @method startLoadingCancel\n * @private\n */\n var stopLoadingCancel = function() {\n getExternalRegistrationCancelButton().removeClass('loading');\n };\n\n /**\n * Stops displaying the tool type capabilities container.\n *\n * @method hideToolTypeCapabilitiesContainer\n * @private\n */\n var hideToolTypeCapabilitiesContainer = function() {\n getToolTypeCapabilitiesContainer().addClass('hidden');\n };\n\n /**\n * Displays the tool type capabilities container.\n *\n * @method showToolTypeCapabilitiesContainer\n * @private\n */\n var showToolTypeCapabilitiesContainer = function() {\n getToolTypeCapabilitiesContainer().removeClass('hidden');\n };\n\n /**\n * Stops displaying the external registration content.\n *\n * @method hideExternalRegistrationContent\n * @private\n */\n var hideExternalRegistrationContent = function() {\n getExternalRegistrationContainer().addClass('hidden');\n };\n\n /**\n * Displays the external registration content.\n *\n * @method showExternalRegistrationContent\n * @private\n */\n var showExternalRegistrationContent = function() {\n getExternalRegistrationContainer().removeClass('hidden');\n };\n\n /**\n * Save the given tool proxy id on the DOM.\n *\n * @method setToolProxyId\n * @private\n * @param {Integer} id Tool proxy ID\n */\n var setToolProxyId = function(id) {\n var button = getExternalRegistrationCancelButton();\n button.attr('data-tool-proxy-id', id);\n };\n\n /**\n * Return the saved tool proxy id.\n *\n * @method getToolProxyId\n * @private\n * @return {String} Tool proxy ID\n */\n var getToolProxyId = function() {\n var button = getExternalRegistrationCancelButton();\n return button.attr('data-tool-proxy-id');\n };\n\n /**\n * Remove the saved tool proxy id.\n *\n * @method clearToolProxyId\n * @private\n */\n var clearToolProxyId = function() {\n var button = getExternalRegistrationCancelButton();\n button.removeAttr('data-tool-proxy-id');\n };\n\n /**\n * Returns true if a tool proxy id has been recorded.\n *\n * @method hasToolProxyId\n * @private\n * @return {Boolean}\n */\n var hasToolProxyId = function() {\n return getToolProxyId() ? true : false;\n };\n\n /**\n * Checks if this process has created a tool proxy within\n * Moodle yet.\n *\n * @method hasCreatedToolProxy\n * @private\n * @return {Boolean}\n */\n var hasCreatedToolProxy = function() {\n var button = getExternalRegistrationCancelButton();\n return button.attr('data-tool-proxy-new') && hasToolProxyId();\n };\n\n /**\n * Records that this process has created a tool proxy.\n *\n * @method setProxyAsNew\n * @private\n * @return {Boolean}\n */\n var setProxyAsNew = function() {\n var button = getExternalRegistrationCancelButton();\n return button.attr('data-tool-proxy-new', \"new\");\n };\n\n /**\n * Records that this process has not created a tool proxy.\n *\n * @method setProxyAsOld\n * @private\n * @return {Boolean}\n */\n var setProxyAsOld = function() {\n var button = getExternalRegistrationCancelButton();\n return button.removeAttr('data-tool-proxy-new');\n };\n\n /**\n * Gets the external registration request required to be sent to the external\n * registration page using a form.\n *\n * See mod_lti/tool_proxy_registration_form template.\n *\n * @method getRegistrationRequest\n * @private\n * @param {Integer} id Tool Proxy ID\n * @return {Promise} jQuery Deferred object\n */\n var getRegistrationRequest = function(id) {\n var request = {\n methodname: 'mod_lti_get_tool_proxy_registration_request',\n args: {\n id: id\n }\n };\n\n return ajax.call([request])[0];\n };\n\n /**\n * Cancel an in progress external registration. This will perform any necessary\n * clean up of tool proxies and return the page section back to the home section.\n *\n * @method cancelRegistration\n * @private\n * @return {Promise} jQuery Deferred object\n */\n var cancelRegistration = function() {\n startLoadingCancel();\n var promise = $.Deferred();\n\n // If we've created a proxy as part of this process then\n // we need to delete it to clean up the data in the back end.\n if (hasCreatedToolProxy()) {\n var id = getToolProxyId();\n toolProxy.delete(id).done(function() {\n promise.resolve();\n }).fail(function(failure) {\n promise.reject(failure);\n });\n } else {\n promise.resolve();\n }\n\n promise.done(function() {\n // Return to the original page.\n finishExternalRegistration();\n stopLoadingCancel();\n }).fail(function(failure) {\n notification.exception(failure);\n finishExternalRegistration();\n stopLoadingCancel();\n str.get_string('failedtodeletetoolproxy', 'mod_lti').done(function(s) {\n var feedback = {\n message: s,\n error: true\n };\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, feedback);\n }).fail(notification.exception);\n });\n\n return promise;\n };\n\n /**\n * Load the external registration template and render it in the DOM and display it.\n *\n * @method renderExternalRegistrationWindow\n * @private\n * @param {Object} registrationRequest\n * @return {Promise} jQuery Deferred object\n */\n var renderExternalRegistrationWindow = function(registrationRequest) {\n var promise = templates.render('mod_lti/tool_proxy_registration_form', registrationRequest);\n\n promise.done(function(html, js) {\n // Show the external registration page in an iframe.\n var container = getExternalRegistrationTemplateContainer();\n container.append(html);\n templates.runTemplateJS(js);\n\n container.find('form').submit();\n showExternalRegistrationContent();\n }).fail(notification.exception);\n\n return promise;\n };\n\n /**\n * Send a request to Moodle server to set the state of the tool type to configured (active).\n *\n * @method setTypeStatusActive\n * @private\n * @param {Object} typeData A set of data representing a type, as returned by a request to get a type\n * from the Moodle server.\n * @return {Promise} jQuery Deferred object\n */\n var setTypeStatusActive = function(typeData) {\n return toolType.update({\n id: typeData.id,\n state: toolType.constants.state.configured\n });\n };\n\n /**\n * Render and display an agreement page for the user to acknowledge the list of capabilities\n * (groups of data) that the external tool requires in order to work. If the user agrees then\n * we will activate the tool so that it is immediately available. If they don't agree then\n * the tool remains in a pending state within Moodle until agreement is given.\n *\n * @method promptForToolTypeCapabilitiesAgreement\n * @private\n * @param {Object} typeData A set of data representing a type, as returned by a request to get a type\n * from the Moodle server.\n * @return {Promise} jQuery Deferred object\n */\n var promptForToolTypeCapabilitiesAgreement = function(typeData) {\n var promise = $.Deferred();\n\n templates.render('mod_lti/tool_type_capabilities_agree', typeData).done(function(html, js) {\n var container = getToolTypeCapabilitiesTemplateContainer();\n\n hideExternalRegistrationContent();\n showToolTypeCapabilitiesContainer();\n\n templates.replaceNodeContents(container, html, js);\n\n var choiceContainer = container.find(SELECTORS.CAPABILITIES_AGREE_CONTAINER);\n\n // The user agrees to allow the tool to use the groups of data so we can go\n // ahead and activate it for them so that it can be used straight away.\n choiceContainer.on(ltiEvents.CAPABILITIES_AGREE, function() {\n startLoadingCapabilitiesContainer();\n setTypeStatusActive(typeData).always(function() {\n stopLoadingCapabilitiesContainer();\n container.empty();\n promise.resolve();\n });\n });\n\n // The user declines to let the tool use the data. In this case we leave\n // the tool as pending and they can delete it using the main screen if they\n // wish.\n choiceContainer.on(ltiEvents.CAPABILITIES_DECLINE, function() {\n container.empty();\n promise.resolve();\n });\n }).fail(promise.reject);\n\n promise.done(function() {\n hideToolTypeCapabilitiesContainer();\n }).fail(notification.exception);\n\n return promise;\n };\n\n /**\n * Send a request to the Moodle server to create a tool proxy using the registration URL the user\n * has provided. The proxy is required for the external registration page to work correctly.\n *\n * After the proxy is created the external registration page is rendered within an iframe for the user\n * to complete the registration in the external page.\n *\n * If the tool proxy creation fails then we redirect the page section back to the home section and\n * display the error, rather than rendering the external registration page.\n *\n * @method createAndRegisterToolProxy\n * @private\n * @param {String} url Tool registration URL to register\n * @return {Promise} jQuery Deferred object\n */\n var createAndRegisterToolProxy = function(url) {\n var promise = $.Deferred();\n\n if (!url || url === \"\") {\n // No URL has been input so do nothing.\n promise.resolve();\n } else {\n // A tool proxy needs to exist before the external page is rendered because\n // the external page sends requests back to Moodle for information that is stored\n // in the proxy.\n toolProxy.create({regurl: url})\n .done(function(result) {\n // Note that it's a new proxy so we will always clean it up.\n setProxyAsNew();\n promise = registerProxy(result.id);\n })\n .fail(function(exception) {\n // Clean up.\n cancelRegistration();\n // Let the user know what the error is.\n var feedback = {\n message: exception.message,\n error: true\n };\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, feedback);\n promise.reject(exception);\n });\n }\n\n return promise;\n };\n\n /**\n * Loads the window to register a proxy, given an ID.\n *\n * @method registerProxy\n * @private\n * @param {Integer} id Proxy id to register\n * @return {Promise} jQuery Deferred object to fail or resolve\n */\n var registerProxy = function(id) {\n var promise = $.Deferred();\n // Save the id on the DOM to cleanup later.\n setToolProxyId(id);\n\n // There is a specific set of data needed to send to the external registration page\n // in a form, so let's get it from our server.\n getRegistrationRequest(id)\n .done(function(registrationRequest) {\n renderExternalRegistrationWindow(registrationRequest)\n .done(function() {\n promise.resolve();\n })\n .fail(promise.fail);\n })\n .fail(promise.fail);\n\n return promise;\n };\n\n /**\n * Complete the registration process, clean up any left over data and\n * trigger the appropriate events.\n *\n * @method finishExternalRegistration\n * @private\n */\n var finishExternalRegistration = function() {\n if (hasToolProxyId()) {\n clearToolProxyId();\n }\n setProxyAsOld(false);\n\n hideExternalRegistrationContent();\n var container = getExternalRegistrationTemplateContainer();\n container.empty();\n\n $(document).trigger(ltiEvents.STOP_EXTERNAL_REGISTRATION);\n };\n\n /**\n * Sets up the listeners for user interaction on the page.\n *\n * @method registerEventListeners\n * @private\n */\n var registerEventListeners = function() {\n\n $(document).on(ltiEvents.START_EXTERNAL_REGISTRATION, function(event, data) {\n if (!data) {\n return;\n }\n if (data.url) {\n createAndRegisterToolProxy(data.url);\n }\n if (data.proxyid) {\n registerProxy(data.proxyid);\n }\n });\n\n var cancelExternalRegistrationButton = getExternalRegistrationCancelButton();\n cancelExternalRegistrationButton.click(function(e) {\n e.preventDefault();\n cancelRegistration();\n });\n cancelExternalRegistrationButton.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER || e.keyCode == KEYS.SPACE) {\n e.preventDefault();\n cancelRegistration();\n }\n }\n });\n\n // This is gross but necessary due to isolated jQuery scopes between\n // child iframe and parent windows. There is no other way to communicate.\n //\n // This function gets called by the moodle page that received the redirect\n // from the external registration page and handles the external page's returned\n // parameters.\n //\n // See AMD module mod_lti/external_registration_return.\n window.triggerExternalRegistrationComplete = function(data) {\n var promise = $.Deferred();\n var feedback = {\n message: \"\",\n error: false\n };\n\n if (data.status == \"success\") {\n str.get_string('successfullycreatedtooltype', 'mod_lti').done(function(s) {\n feedback.message = s;\n }).fail(notification.exception);\n\n // Trigger appropriate events when we've completed the necessary requests.\n promise.done(function() {\n finishExternalRegistration();\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, feedback);\n $(document).trigger(ltiEvents.NEW_TOOL_TYPE);\n }).fail(notification.exception);\n\n // We should have created a tool proxy by this point.\n if (hasCreatedToolProxy()) {\n var proxyId = getToolProxyId();\n\n // We need the list of types that are linked to this proxy. We're assuming it'll\n // only be one because this process creates a one-to-one type->proxy.\n toolType.getFromToolProxyId(proxyId).done(function(types) {\n if (types && types.length) {\n // There should only be one result.\n var typeData = types[0];\n\n // Check if the external tool required access to any Moodle data (users, courses etc).\n if (typeData.hascapabilitygroups) {\n // If it did then we ask the user to agree to those groups before the type is\n // activated (i.e. can be used in Moodle).\n promptForToolTypeCapabilitiesAgreement(typeData).always(function() {\n promise.resolve();\n });\n } else {\n promise.resolve();\n }\n } else {\n promise.resolve();\n }\n }).fail(function() {\n promise.resolve();\n });\n }\n } else {\n // Anything other than success is failure.\n feedback.message = data.error;\n feedback.error = true;\n\n // Cancel registration to clean up any proxies and tools that were\n // created.\n promise.done(function() {\n cancelRegistration().always(function() {\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, feedback);\n });\n }).fail(notification.exception);\n\n promise.resolve();\n }\n\n return promise;\n };\n };\n\n return {\n\n /**\n * Initialise this module.\n */\n init: function() {\n registerEventListeners();\n }\n };\n});\n"],"file":"external_registration.min.js"} \ No newline at end of file diff --git a/mod/lti/amd/build/external_registration_return.min.js.map b/mod/lti/amd/build/external_registration_return.min.js.map index 2f86d982ffa6a..b33bb201726ab 100644 --- a/mod/lti/amd/build/external_registration_return.min.js.map +++ b/mod/lti/amd/build/external_registration_return.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/external_registration_return.js"],"names":["define","init","message","error","id","status","window","parent","triggerExternalRegistrationComplete"],"mappings":"AA2BAA,OAAM,wCAAC,EAAD,CAAK,UAAW,CAElB,MAAiE,CAa7DC,IAAI,CAAE,cAASC,CAAT,CAAkBC,CAAlB,CAAyBC,CAAzB,CAA6BC,CAA7B,CAAqC,CACvC,GAAIC,MAAM,CAACC,MAAX,CAAmB,CACfD,MAAM,CAACC,MAAP,CAAcC,mCAAd,CAAkD,CAC9CN,OAAO,CAAEA,CADqC,CAE9CC,KAAK,CAAEA,CAFuC,CAG9CC,EAAE,CAAEA,CAH0C,CAI9CC,MAAM,CAAEA,CAJsC,CAAlD,CAMH,CACJ,CAtB4D,CAwBpE,CA1BK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Handles the return params from the external registration page after it\n * redirects back to Moodle.\n *\n * See also: mod/lti/externalregistrationreturn.php\n *\n * @module mod_lti/external_registration_return\n * @class external_registration_return\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine([], function() {\n\n return /** @alias module:mod_lti/external_registration_return */ {\n\n /**\n * If this was rendered in an iframe then trigger the external registration\n * complete behaviour in the parent page and provide the params returned from\n * the external registration page.\n *\n * @param {String} message The registration message from the external registration page\n * @param {String} error The registration error message from the external registration page, if\n * there was an error.\n * @param {Integer} id The tool proxy id for the external registration.\n * @param {String} status Whether the external registration was successful or not.\n */\n init: function(message, error, id, status) {\n if (window.parent) {\n window.parent.triggerExternalRegistrationComplete({\n message: message,\n error: error,\n id: id,\n status: status\n });\n }\n }\n };\n});\n"],"file":"external_registration_return.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/external_registration_return.js"],"names":["define","init","message","error","id","status","window","parent","triggerExternalRegistrationComplete"],"mappings":"AA0BAA,OAAM,wCAAC,EAAD,CAAK,UAAW,CAClB,MAAO,CAaHC,IAAI,CAAE,cAASC,CAAT,CAAkBC,CAAlB,CAAyBC,CAAzB,CAA6BC,CAA7B,CAAqC,CACvC,GAAIC,MAAM,CAACC,MAAX,CAAmB,CACfD,MAAM,CAACC,MAAP,CAAcC,mCAAd,CAAkD,CAC9CN,OAAO,CAAEA,CADqC,CAE9CC,KAAK,CAAEA,CAFuC,CAG9CC,EAAE,CAAEA,CAH0C,CAI9CC,MAAM,CAAEA,CAJsC,CAAlD,CAMH,CACJ,CAtBE,CAwBV,CAzBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Handles the return params from the external registration page after it\n * redirects back to Moodle.\n *\n * See also: mod/lti/externalregistrationreturn.php\n *\n * @module mod_lti/external_registration_return\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine([], function() {\n return {\n\n /**\n * If this was rendered in an iframe then trigger the external registration\n * complete behaviour in the parent page and provide the params returned from\n * the external registration page.\n *\n * @param {String} message The registration message from the external registration page\n * @param {String} error The registration error message from the external registration page, if\n * there was an error.\n * @param {Integer} id The tool proxy id for the external registration.\n * @param {String} status Whether the external registration was successful or not.\n */\n init: function(message, error, id, status) {\n if (window.parent) {\n window.parent.triggerExternalRegistrationComplete({\n message: message,\n error: error,\n id: id,\n status: status\n });\n }\n }\n };\n});\n"],"file":"external_registration_return.min.js"} \ No newline at end of file diff --git a/mod/lti/amd/build/form-field.min.js.map b/mod/lti/amd/build/form-field.min.js.map index db77009a21e4e..45b3f42225393 100644 --- a/mod/lti/amd/build/form-field.min.js.map +++ b/mod/lti/amd/build/form-field.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/form-field.js"],"names":["define","$","FormField","name","type","resetIfUndefined","defaultValue","id","selector","TYPES","TEXT","SELECT","CHECKBOX","EDITOR","prototype","setFieldValue","value","prop","text","attoEditor","length","html","tinyMCE","execInstanceCommand","val"],"mappings":"AAwBAA,OAAM,sBAAC,CAAC,QAAD,CAAD,CACF,SAASC,CAAT,CAAY,CAUR,GAAIC,CAAAA,CAAS,CAAG,SAASC,CAAT,CAAeC,CAAf,CAAqBC,CAArB,CAAuCC,CAAvC,CAAqD,CACjE,KAAKH,IAAL,CAAYA,CAAZ,CACA,KAAKI,EAAL,CAAU,MAAQ,KAAKJ,IAAvB,CACA,KAAKK,QAAL,CAAgB,IAAM,KAAKD,EAA3B,CACA,KAAKH,IAAL,CAAYA,CAAZ,CACA,KAAKC,gBAAL,CAAwBA,CAAxB,CACA,KAAKC,YAAL,CAAoBA,CACvB,CAPD,CAcAJ,CAAS,CAACO,KA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Od,CAAAA,CACV,CAhFC,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A module that enables the setting of form field values on the client side.\n *\n * @module mod_lti/form-field\n * @class form-field\n * @copyright 2016 Jun Pataleta \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.2\n */\ndefine(['jquery'],\n function($) {\n /**\n * Form field class.\n *\n * @param {string} name Field name.\n * @param {number} type The field type.\n * @param {boolean} resetIfUndefined Flag to reset the field to the default value if undefined in the return data.\n * @param {string|number|boolean} defaultValue The default value to use for the field.\n * @constructor\n */\n var FormField = function(name, type, resetIfUndefined, defaultValue) {\n this.name = name;\n this.id = 'id_' + this.name;\n this.selector = '#' + this.id;\n this.type = type;\n this.resetIfUndefined = resetIfUndefined;\n this.defaultValue = defaultValue;\n };\n\n /**\n * Form field types.\n *\n * @type {{TEXT: number, SELECT: number, CHECKBOX: number, EDITOR: number}}\n */\n FormField.TYPES = {\n TEXT: 1,\n SELECT: 2,\n CHECKBOX: 3,\n EDITOR: 4\n };\n\n /**\n * Sets the values for a form field.\n *\n * @param {string|boolean|number} value The value to be set into the field.\n */\n FormField.prototype.setFieldValue = function(value) {\n if (value === null) {\n if (this.resetIfUndefined) {\n value = this.defaultValue;\n } else {\n // No need set the field value if value is null and there's no need to reset the field.\n return;\n }\n }\n\n switch (this.type) {\n case FormField.TYPES.CHECKBOX:\n if (value) {\n $(this.selector).prop('checked', true);\n } else {\n $(this.selector).prop('checked', false);\n }\n break;\n case FormField.TYPES.EDITOR:\n if (typeof value.text !== 'undefined') {\n /* global tinyMCE:false */\n\n // Set text in editor's editable content, if applicable.\n // Check if it is an Atto editor.\n var attoEditor = $(this.selector + 'editable');\n if (attoEditor.length) {\n attoEditor.html(value.text);\n } else if (typeof tinyMCE !== 'undefined') {\n // If the editor is not Atto, try to fallback to TinyMCE.\n tinyMCE.execInstanceCommand(this.id, 'mceInsertContent', false, value.text);\n }\n\n // Set text to actual editor text area.\n $(this.selector).val(value.text);\n }\n break;\n default:\n $(this.selector).val(value);\n break;\n }\n };\n\n return FormField;\n }\n);\n"],"file":"form-field.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/form-field.js"],"names":["define","$","FormField","name","type","resetIfUndefined","defaultValue","id","selector","TYPES","TEXT","SELECT","CHECKBOX","EDITOR","prototype","setFieldValue","value","prop","text","attoEditor","length","html","tinyMCE","execInstanceCommand","val"],"mappings":"AAuBAA,OAAM,sBAAC,CAAC,QAAD,CAAD,CACF,SAASC,CAAT,CAAY,CAUR,GAAIC,CAAAA,CAAS,CAAG,SAASC,CAAT,CAAeC,CAAf,CAAqBC,CAArB,CAAuCC,CAAvC,CAAqD,CACjE,KAAKH,IAAL,CAAYA,CAAZ,CACA,KAAKI,EAAL,CAAU,MAAQ,KAAKJ,IAAvB,CACA,KAAKK,QAAL,CAAgB,IAAM,KAAKD,EAA3B,CACA,KAAKH,IAAL,CAAYA,CAAZ,CACA,KAAKC,gBAAL,CAAwBA,CAAxB,CACA,KAAKC,YAAL,CAAoBA,CACvB,CAPD,CAcAJ,CAAS,CAACO,KAAV,CAAkB,CACdC,IAAI,CAAE,CADQ,CAEdC,MAAM,CAAE,CAFM,CAGdC,QAAQ,CAAE,CAHI,CAIdC,MAAM,CAAE,CAJM,CAAlB,CAYAX,CAAS,CAACY,SAAV,CAAoBC,aAApB,CAAoC,SAASC,CAAT,CAAgB,CAChD,GAAc,IAAV,GAAAA,CAAJ,CAAoB,CAChB,GAAI,KAAKX,gBAAT,CAA2B,CACvBW,CAAK,CAAG,KAAKV,YAChB,CAFD,IAEO,CAEH,MACH,CACJ,CAED,OAAQ,KAAKF,IAAb,EACI,IAAKF,CAAAA,CAAS,CAACO,KAAV,CAAgBG,QAArB,CACI,GAAII,CAAJ,CAAW,CACPf,CAAC,CAAC,KAAKO,QAAN,CAAD,CAAiBS,IAAjB,CAAsB,SAAtB,IACH,CAFD,IAEO,CACHhB,CAAC,CAAC,KAAKO,QAAN,CAAD,CAAiBS,IAAjB,CAAsB,SAAtB,IACH,CACD,MACJ,IAAKf,CAAAA,CAAS,CAACO,KAAV,CAAgBI,MAArB,CACI,GAA0B,WAAtB,QAAOG,CAAAA,CAAK,CAACE,IAAjB,CAAuC,CAKnC,GAAIC,CAAAA,CAAU,CAAGlB,CAAC,CAAC,KAAKO,QAAL,CAAgB,UAAjB,CAAlB,CACA,GAAIW,CAAU,CAACC,MAAf,CAAuB,CACnBD,CAAU,CAACE,IAAX,CAAgBL,CAAK,CAACE,IAAtB,CACH,CAFD,IAEO,IAAuB,WAAnB,QAAOI,CAAAA,OAAX,CAAoC,CAEvCA,OAAO,CAACC,mBAAR,CAA4B,KAAKhB,EAAjC,CAAqC,kBAArC,IAAgES,CAAK,CAACE,IAAtE,CACH,CAGDjB,CAAC,CAAC,KAAKO,QAAN,CAAD,CAAiBgB,GAAjB,CAAqBR,CAAK,CAACE,IAA3B,CACH,CACD,MACJ,QACIjB,CAAC,CAAC,KAAKO,QAAN,CAAD,CAAiBgB,GAAjB,CAAqBR,CAArB,EACA,MA5BR,CA8BH,CAxCD,CA0CA,MAAOd,CAAAA,CACV,CAhFC,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A module that enables the setting of form field values on the client side.\n *\n * @module mod_lti/form-field\n * @copyright 2016 Jun Pataleta \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.2\n */\ndefine(['jquery'],\n function($) {\n /**\n * Form field class.\n *\n * @param {string} name Field name.\n * @param {number} type The field type.\n * @param {boolean} resetIfUndefined Flag to reset the field to the default value if undefined in the return data.\n * @param {string|number|boolean} defaultValue The default value to use for the field.\n * @constructor\n */\n var FormField = function(name, type, resetIfUndefined, defaultValue) {\n this.name = name;\n this.id = 'id_' + this.name;\n this.selector = '#' + this.id;\n this.type = type;\n this.resetIfUndefined = resetIfUndefined;\n this.defaultValue = defaultValue;\n };\n\n /**\n * Form field types.\n *\n * @type {{TEXT: number, SELECT: number, CHECKBOX: number, EDITOR: number}}\n */\n FormField.TYPES = {\n TEXT: 1,\n SELECT: 2,\n CHECKBOX: 3,\n EDITOR: 4\n };\n\n /**\n * Sets the values for a form field.\n *\n * @param {string|boolean|number} value The value to be set into the field.\n */\n FormField.prototype.setFieldValue = function(value) {\n if (value === null) {\n if (this.resetIfUndefined) {\n value = this.defaultValue;\n } else {\n // No need set the field value if value is null and there's no need to reset the field.\n return;\n }\n }\n\n switch (this.type) {\n case FormField.TYPES.CHECKBOX:\n if (value) {\n $(this.selector).prop('checked', true);\n } else {\n $(this.selector).prop('checked', false);\n }\n break;\n case FormField.TYPES.EDITOR:\n if (typeof value.text !== 'undefined') {\n /* global tinyMCE:false */\n\n // Set text in editor's editable content, if applicable.\n // Check if it is an Atto editor.\n var attoEditor = $(this.selector + 'editable');\n if (attoEditor.length) {\n attoEditor.html(value.text);\n } else if (typeof tinyMCE !== 'undefined') {\n // If the editor is not Atto, try to fallback to TinyMCE.\n tinyMCE.execInstanceCommand(this.id, 'mceInsertContent', false, value.text);\n }\n\n // Set text to actual editor text area.\n $(this.selector).val(value.text);\n }\n break;\n default:\n $(this.selector).val(value);\n break;\n }\n };\n\n return FormField;\n }\n);\n"],"file":"form-field.min.js"} \ No newline at end of file diff --git a/mod/lti/amd/build/tool_card_controller.min.js.map b/mod/lti/amd/build/tool_card_controller.min.js.map index b2234669f1d46..63af769b6de39 100644 --- a/mod/lti/amd/build/tool_card_controller.min.js.map +++ b/mod/lti/amd/build/tool_card_controller.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/tool_card_controller.js"],"names":["define","$","ajax","notification","templates","modalFactory","toolType","ltiEvents","KEYS","str","SELECTORS","DELETE_BUTTON","NAME_ELEMENT","DESCRIPTION_ELEMENT","CAPABILITIES_CONTAINER","ACTIVATE_BUTTON","ANNOUNCEMENT_TIMEOUT","getDeleteButton","element","find","getNameElement","getDescriptionElement","getActivateButton","hasActivateButton","length","getCapabilitiesContainer","hasCapabilitiesContainer","getTypeId","attr","clearAllAnnouncements","removeClass","startLoading","addClass","stopLoading","announceSuccess","promise","Deferred","setTimeout","resolve","announceFailure","deleteType","typeId","get_strings","key","component","done","strs","confirm","delete","remove","fail","exception","always","error","reject","setValueSnapshot","value","getValueSnapshot","snapshotDescription","descriptionElement","hasClass","description","text","trim","updateDescription","snapshotVal","update","id","type","snapshotName","nameElement","name","updateName","setStatusActive","state","constants","configured","then","toolTypeData","render","html","js","replaceNode","catch","displayCapabilitiesApproval","hideCapabilitiesApproval","activateToolType","registerEventListeners","deleteButton","click","e","preventDefault","keypress","metaKey","shiftKey","altKey","ctrlKey","keyCode","ENTER","SPACE","focus","blur","activateButton","capabilitiesContainer","on","CAPABILITIES_AGREE","CAPABILITIES_DECLINE","registerModal","trigger","data","context","bodyPromise","mailTo","encodeURIComponent","footerPromise","create","large","title","body","footer","init"],"mappings":"AA2BCA,OAAM,gCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAA6C,gBAA7C,CAA+D,oBAA/D,CACA,mBADA,CACqB,gBADrB,CACuC,cADvC,CAEA,UAFA,CAAD,CAGC,SAASC,CAAT,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CAM0C,QAN1C,CAOTI,kBAAkB,CAAC/F,CAAO,CAAC2F,IAAR,CAAa,oBAAb,CAAD,CAPT,CAOgD,MAPhD,CAQTI,kBAAkB,CAAC/F,CAAO,CAAC2F,IAAR,CAAa,iBAAb,CAAD,CART,CAQ6C,QAR7C,CASTI,kBAAkB,CAAC/F,CAAO,CAAC2F,IAAR,CAAa,mBAAb,CAAD,CATT,CAS+C,MAT/C,CAUTI,kBAAkB,CAAC/F,CAAO,CAAC2F,IAAR,CAAa,gBAAb,CAAD,CAVT,CAU4C,QAV5C,CAWTI,kBAAkB,CAAC/F,CAAO,CAAC2F,IAAR,CAAa,mBAAb,CAAD,CAXT,CAW+C,MAX/C,CAYTI,kBAAkB,CAAC/F,CAAO,CAAC2F,IAAR,CAAa,gBAAb,CAAD,CAZT,CAY4C,QA1BvB,CA2BlCC,CAAO,CAAG,CACN,OAAUE,CADJ,CAAV,CAGA,GAAIE,CAAAA,CAAa,CAAG9G,CAAS,CAAC2E,MAAV,CAAiB,kCAAjB,CAAqD+B,CAArD,CAApB,CACAzG,CAAY,CAAC8G,MAAb,CAAoB,CAClBC,KAAK,GADa,CAElBC,KAAK,CAAEnG,CAAO,CAAC2F,IAAR,CAAa,YAAb,CAFW,CAGlBS,IAAI,CAAEP,CAHY,CAIlBQ,MAAM,CAAEL,CAJU,CAApB,CAKGN,CALH,CAMH,CApoB4F,CAsoB7F,MAAyD,CAOrDY,IAAI,CAAE,cAAStG,CAAT,CAAkB,CACpBqE,CAAsB,CAACrE,CAAD,CAAtB,CACAyF,CAAa,CAACzF,CAAD,CAChB,CAVoD,CAY5D,CArpBM,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls all of the behaviour and interaction with a tool type card. These are\n * listed on the LTI tool type management page.\n *\n * See template: mod_lti/tool_card\n *\n * @module mod_lti/tool_card_controller\n * @class tool_card_controller\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\n define(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'core/modal_factory',\n 'mod_lti/tool_type', 'mod_lti/events', 'mod_lti/keys',\n 'core/str'],\n function($, ajax, notification, templates, modalFactory, toolType, ltiEvents, KEYS, str) {\n\n var SELECTORS = {\n DELETE_BUTTON: '.delete',\n NAME_ELEMENT: '.name',\n DESCRIPTION_ELEMENT: '.description',\n CAPABILITIES_CONTAINER: '.capabilities-container',\n ACTIVATE_BUTTON: '.tool-card-footer a.activate',\n };\n\n // Timeout in seconds.\n var ANNOUNCEMENT_TIMEOUT = 2000;\n\n /**\n * Return the delete button element.\n *\n * @method getDeleteButton\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {JQuery} jQuery object\n */\n var getDeleteButton = function(element) {\n return element.find(SELECTORS.DELETE_BUTTON);\n };\n\n /**\n * Return the element representing the tool type name.\n *\n * @method getNameElement\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {JQuery} jQuery object\n */\n var getNameElement = function(element) {\n return element.find(SELECTORS.NAME_ELEMENT);\n };\n\n /**\n * Return the element representing the tool type description.\n *\n * @method getDescriptionElement\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {JQuery} jQuery object\n */\n var getDescriptionElement = function(element) {\n return element.find(SELECTORS.DESCRIPTION_ELEMENT);\n };\n\n /**\n * Return the activate button for the type.\n *\n * @method getActivateButton\n * @private\n * @param {Object} element jQuery object representing the tool card.\n * @return {Object} jQuery object\n */\n var getActivateButton = function(element) {\n return element.find(SELECTORS.ACTIVATE_BUTTON);\n };\n\n /**\n * Checks if the type card has an activate button.\n *\n * @method hasActivateButton\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Boolean} true if has active buton\n */\n var hasActivateButton = function(element) {\n return getActivateButton(element).length ? true : false;\n };\n\n /**\n * Return the element that contains the capabilities approval for\n * the user.\n *\n * @method getCapabilitiesContainer\n * @private\n * @param {Object} element jQuery object representing the tool card.\n * @return {Object} The element\n */\n var getCapabilitiesContainer = function(element) {\n return element.find(SELECTORS.CAPABILITIES_CONTAINER);\n };\n\n /**\n * Checks if the tool type has capabilities that need approval. If it\n * does then the container will be present.\n *\n * @method hasCapabilitiesContainer\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Boolean} true if has capbilities.\n */\n var hasCapabilitiesContainer = function(element) {\n return getCapabilitiesContainer(element).length ? true : false;\n };\n\n /**\n * Get the type id.\n *\n * @method getTypeId\n * @private\n * @param {Object} element jQuery object representing the tool card.\n * @return {String} Type ID\n */\n var getTypeId = function(element) {\n return element.attr('data-type-id');\n };\n\n /**\n * Stop any announcement currently visible on the card.\n *\n * @method clearAllAnnouncements\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var clearAllAnnouncements = function(element) {\n element.removeClass('announcement loading success fail capabilities');\n };\n\n /**\n * Show the loading announcement.\n *\n * @method startLoading\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var startLoading = function(element) {\n clearAllAnnouncements(element);\n element.addClass('announcement loading');\n };\n\n /**\n * Hide the loading announcement.\n *\n * @method stopLoading\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var stopLoading = function(element) {\n element.removeClass('announcement loading');\n };\n\n /**\n * Show the success announcement. The announcement is only\n * visible for 2 seconds.\n *\n * @method announceSuccess\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var announceSuccess = function(element) {\n var promise = $.Deferred();\n\n clearAllAnnouncements(element);\n element.addClass('announcement success');\n setTimeout(function() {\n element.removeClass('announcement success');\n promise.resolve();\n }, ANNOUNCEMENT_TIMEOUT);\n\n return promise;\n };\n\n /**\n * Show the failure announcement. The announcement is only\n * visible for 2 seconds.\n *\n * @method announceFailure\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var announceFailure = function(element) {\n var promise = $.Deferred();\n\n clearAllAnnouncements(element);\n element.addClass('announcement fail');\n setTimeout(function() {\n element.removeClass('announcement fail');\n promise.resolve();\n }, ANNOUNCEMENT_TIMEOUT);\n\n return promise;\n };\n\n /**\n * Delete the tool type from the Moodle server. Triggers a success\n * or failure announcement depending on the result.\n *\n * @method deleteType\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var deleteType = function(element) {\n var promise = $.Deferred();\n var typeId = getTypeId(element);\n startLoading(element);\n\n if (typeId === \"\") {\n return $.Deferred().resolve();\n }\n\n str.get_strings([\n {\n key: 'delete',\n component: 'mod_lti'\n },\n {\n key: 'delete_confirmation',\n component: 'mod_lti'\n },\n {\n key: 'delete',\n component: 'mod_lti'\n },\n {\n key: 'cancel',\n component: 'core'\n },\n ])\n .done(function(strs) {\n notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {\n toolType.delete(typeId)\n .done(function() {\n stopLoading(element);\n announceSuccess(element)\n .done(function() {\n element.remove();\n })\n .fail(notification.exception)\n .always(function() {\n // Always resolve because even if the announcement fails the type was deleted.\n promise.resolve();\n });\n })\n .fail(function(error) {\n announceFailure(element);\n promise.reject(error);\n });\n }, function() {\n stopLoading(element);\n promise.resolve();\n });\n })\n .fail(function(error) {\n stopLoading(element);\n notification.exception(error);\n promise.reject(error);\n });\n\n return promise;\n };\n\n /**\n * Save a given value in a data attribute on the element.\n *\n * @method setValueSnapshot\n * @private\n * @param {JQuery} element jQuery object representing the element.\n * @param {String} value to be saved.\n */\n var setValueSnapshot = function(element, value) {\n element.attr('data-val-snapshot', value);\n };\n\n /**\n * Return the saved value from the element.\n *\n * @method getValueSnapshot\n * @private\n * @param {JQuery} element jQuery object representing the element.\n * @return {String} the saved value.\n */\n var getValueSnapshot = function(element) {\n return element.attr('data-val-snapshot');\n };\n\n /**\n * Save the current value of the tool description.\n *\n * @method snapshotDescription\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var snapshotDescription = function(element) {\n var descriptionElement = getDescriptionElement(element);\n\n if (descriptionElement.hasClass('loading')) {\n return;\n }\n\n var description = descriptionElement.text().trim();\n setValueSnapshot(descriptionElement, description);\n };\n\n /**\n * Send a request to update the description value for this tool\n * in the Moodle server.\n *\n * @method updateDescription\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var updateDescription = function(element) {\n var typeId = getTypeId(element);\n\n // Return early if we don't have an id because it's\n // required to save the changes.\n if (typeId === \"\") {\n return $.Deferred().resolve();\n }\n\n var descriptionElement = getDescriptionElement(element);\n\n // Return early if we're already saving a value.\n if (descriptionElement.hasClass('loading')) {\n return $.Deferred().resolve();\n }\n\n var description = descriptionElement.text().trim();\n var snapshotVal = getValueSnapshot(descriptionElement);\n\n // If the value hasn't change then don't bother sending the\n // update request.\n if (snapshotVal == description) {\n return $.Deferred().resolve();\n }\n\n descriptionElement.addClass('loading');\n\n var promise = toolType.update({id: typeId, description: description});\n\n promise.done(function(type) {\n descriptionElement.removeClass('loading');\n // Make sure the text is updated with the description from the\n // server, just in case the update didn't work.\n descriptionElement.text(type.description);\n }).fail(notification.exception);\n\n // Probably need to handle failures better so that we can revert\n // the value in the input for the user.\n promise.fail(function() {\n descriptionElement.removeClass('loading');\n });\n\n return promise;\n };\n\n /**\n * Save the current value of the tool name.\n *\n * @method snapshotName\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var snapshotName = function(element) {\n var nameElement = getNameElement(element);\n\n if (nameElement.hasClass('loading')) {\n return;\n }\n\n var name = nameElement.text().trim();\n setValueSnapshot(nameElement, name);\n };\n\n /**\n * Send a request to update the name value for this tool\n * in the Moodle server.\n *\n * @method updateName\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var updateName = function(element) {\n var typeId = getTypeId(element);\n\n // Return if we don't have an id.\n if (typeId === \"\") {\n return $.Deferred().resolve();\n }\n\n var nameElement = getNameElement(element);\n\n // Return if we're already saving.\n if (nameElement.hasClass('loading')) {\n return $.Deferred().resolve();\n }\n\n var name = nameElement.text().trim();\n var snapshotVal = getValueSnapshot(nameElement);\n\n // If the value hasn't change then don't bother sending the\n // update request.\n if (snapshotVal == name) {\n return $.Deferred().resolve();\n }\n\n nameElement.addClass('loading');\n var promise = toolType.update({id: typeId, name: name});\n\n promise.done(function(type) {\n nameElement.removeClass('loading');\n // Make sure the text is updated with the name from the\n // server, just in case the update didn't work.\n nameElement.text(type.name);\n });\n\n // Probably need to handle failures better so that we can revert\n // the value in the input for the user.\n promise.fail(function() {\n nameElement.removeClass('loading');\n });\n\n return promise;\n };\n\n /**\n * Send a request to update the state for this tool to be configured (active)\n * in the Moodle server. A success or failure announcement is triggered depending\n * on the result.\n *\n * @method setStatusActive\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var setStatusActive = function(element) {\n var id = getTypeId(element);\n\n // Return if we don't have an id.\n if (id === \"\") {\n return $.Deferred().resolve();\n }\n\n startLoading(element);\n\n var promise = toolType.update({\n id: id,\n state: toolType.constants.state.configured\n });\n\n promise.then(function(toolTypeData) {\n stopLoading(element);\n announceSuccess(element);\n return toolTypeData;\n }).then(function(toolTypeData) {\n return templates.render('mod_lti/tool_card', toolTypeData);\n }).then(function(html, js) {\n templates.replaceNode(element, html, js);\n return;\n }).catch(function() {\n stopLoading(element);\n announceFailure(element);\n });\n\n return promise;\n };\n\n /**\n * Show the capabilities approval screen to show which groups of data this\n * type requires access to in Moodle (if any).\n *\n * @method displayCapabilitiesApproval\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var displayCapabilitiesApproval = function(element) {\n element.addClass('announcement capabilities');\n };\n\n /**\n * Hide the capabilities approval screen.\n *\n * @method hideCapabilitiesApproval\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var hideCapabilitiesApproval = function(element) {\n element.removeClass('announcement capabilities');\n };\n\n /**\n * The user wishes to activate this tool so show them the capabilities that\n * they need to agree to or if there are none then set the tool type's state\n * to active.\n *\n * @method activateToolType\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var activateToolType = function(element) {\n if (hasCapabilitiesContainer(element)) {\n displayCapabilitiesApproval(element);\n } else {\n setStatusActive(element);\n }\n };\n\n /**\n * Sets up the listeners for user interaction on this tool type card.\n *\n * @method registerEventListeners\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var registerEventListeners = function(element) {\n var deleteButton = getDeleteButton(element);\n deleteButton.click(function(e) {\n e.preventDefault();\n deleteType(element);\n });\n deleteButton.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER || e.keyCode == KEYS.SPACE) {\n e.preventDefault();\n deleteButton.click();\n }\n }\n });\n\n var descriptionElement = getDescriptionElement(element);\n descriptionElement.focus(function(e) {\n e.preventDefault();\n // Save a copy of the current value for the description so that\n // we can check if the user has changed it before sending a request to\n // the server.\n snapshotDescription(element);\n });\n descriptionElement.blur(function(e) {\n e.preventDefault();\n updateDescription(element);\n });\n descriptionElement.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER) {\n e.preventDefault();\n descriptionElement.blur();\n }\n }\n });\n\n var nameElement = getNameElement(element);\n nameElement.focus(function(e) {\n e.preventDefault();\n // Save a copy of the current value for the name so that\n // we can check if the user has changed it before sending a request to\n // the server.\n snapshotName(element);\n });\n nameElement.blur(function(e) {\n e.preventDefault();\n updateName(element);\n });\n nameElement.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER) {\n e.preventDefault();\n nameElement.blur();\n }\n }\n });\n\n // Only pending tool type cards have an activate button.\n if (hasActivateButton(element)) {\n var activateButton = getActivateButton(element);\n activateButton.click(function(e) {\n e.preventDefault();\n activateToolType(element);\n });\n activateButton.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER || e.keyCode == KEYS.SPACE) {\n e.preventDefault();\n activateButton.click();\n }\n }\n });\n }\n\n if (hasCapabilitiesContainer(element)) {\n var capabilitiesContainer = getCapabilitiesContainer(element);\n\n capabilitiesContainer.on(ltiEvents.CAPABILITIES_AGREE, function() {\n setStatusActive(element);\n });\n\n capabilitiesContainer.on(ltiEvents.CAPABILITIES_DECLINE, function() {\n hideCapabilitiesApproval(element);\n });\n }\n };\n\n /**\n * Sets up the templates for the tool configuration modal on this tool type card.\n *\n * @method registerModal\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var registerModal = function(element) {\n var trigger = $('#' + element.data('uniqid') + '-' + element.data('deploymentid'));\n var context = {\n 'uniqid': element.data('uniqid'),\n 'platformid': element.data('platformid'),\n 'clientid': element.data('clientid'),\n 'deploymentid': element.data('deploymentid'),\n 'urls': {\n 'publickeyset': element.data('publickeyseturl'),\n 'accesstoken': element.data('accesstokenurl'),\n 'authrequest': element.data('authrequesturl')\n }\n };\n var bodyPromise = templates.render('mod_lti/tool_config_modal_body', context);\n var mailTo = 'mailto:?subject=' + encodeURIComponent(element.data('mailtosubject')) +\n '&body=' + encodeURIComponent(element.data('platformidstr')) + ':%20' +\n encodeURIComponent(element.data('platformid')) + '%0D%0A' +\n encodeURIComponent(element.data('clientidstr')) + ':%20' +\n encodeURIComponent(element.data('clientid')) + '%0D%0A' +\n encodeURIComponent(element.data('deploymentidstr')) + ':%20' +\n encodeURIComponent(element.data('deploymentid')) + '%0D%0A' +\n encodeURIComponent(element.data('publickeyseturlstr')) + ':%20' +\n encodeURIComponent(element.data('publickeyseturl')) + '%0D%0A' +\n encodeURIComponent(element.data('accesstokenurlstr')) + ':%20' +\n encodeURIComponent(element.data('accesstokenurl')) + '%0D%0A' +\n encodeURIComponent(element.data('authrequesturlstr')) + ':%20' +\n encodeURIComponent(element.data('authrequesturl')) + '%0D%0A';\n context = {\n 'mailto': mailTo\n };\n var footerPromise = templates.render('mod_lti/tool_config_modal_footer', context);\n modalFactory.create({\n large: true,\n title: element.data('modaltitle'),\n body: bodyPromise,\n footer: footerPromise,\n }, trigger);\n };\n\n return /** @alias module:mod_lti/tool_card_controller */ {\n\n /**\n * Initialise this module.\n *\n * @param {JQuery} element jQuery object representing the tool card.\n */\n init: function(element) {\n registerEventListeners(element);\n registerModal(element);\n }\n };\n});\n"],"file":"tool_card_controller.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/tool_card_controller.js"],"names":["define","$","ajax","notification","templates","modalFactory","toolType","ltiEvents","KEYS","str","SELECTORS","DELETE_BUTTON","NAME_ELEMENT","DESCRIPTION_ELEMENT","CAPABILITIES_CONTAINER","ACTIVATE_BUTTON","ANNOUNCEMENT_TIMEOUT","getDeleteButton","element","find","getNameElement","getDescriptionElement","getActivateButton","hasActivateButton","length","getCapabilitiesContainer","hasCapabilitiesContainer","getTypeId","attr","clearAllAnnouncements","removeClass","startLoading","addClass","stopLoading","announceSuccess","promise","Deferred","setTimeout","resolve","announceFailure","deleteType","typeId","get_strings","key","component","done","strs","confirm","delete","remove","fail","exception","always","error","reject","setValueSnapshot","value","getValueSnapshot","snapshotDescription","descriptionElement","hasClass","description","text","trim","updateDescription","snapshotVal","update","id","type","snapshotName","nameElement","name","updateName","setStatusActive","state","constants","configured","then","toolTypeData","render","html","js","replaceNode","catch","displayCapabilitiesApproval","hideCapabilitiesApproval","activateToolType","registerEventListeners","deleteButton","click","e","preventDefault","keypress","metaKey","shiftKey","altKey","ctrlKey","keyCode","ENTER","SPACE","focus","blur","activateButton","capabilitiesContainer","on","CAPABILITIES_AGREE","CAPABILITIES_DECLINE","registerModal","trigger","data","context","bodyPromise","mailTo","encodeURIComponent","footerPromise","create","large","title","body","footer","init"],"mappings":"AA0BCA,OAAM,gCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAA6C,gBAA7C,CAA+D,oBAA/D,CACA,mBADA,CACqB,gBADrB,CACuC,cADvC,CAEA,UAFA,CAAD,CAGC,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAyDC,CAAzD,CAAmEC,CAAnE,CAA8EC,CAA9E,CAAoFC,CAApF,CAAyF,IAEzFC,CAAAA,CAAS,CAAG,CACZC,aAAa,CAAE,SADH,CAEZC,YAAY,CAAE,OAFF,CAGZC,mBAAmB,CAAE,cAHT,CAIZC,sBAAsB,CAAE,yBAJZ,CAKZC,eAAe,CAAE,8BALL,CAF6E,CAWzFC,CAAoB,CAAG,GAXkE,CAqBzFC,CAAe,CAAG,SAASC,CAAT,CAAkB,CACpC,MAAOA,CAAAA,CAAO,CAACC,IAAR,CAAaT,CAAS,CAACC,aAAvB,CACV,CAvB4F,CAiCzFS,CAAc,CAAG,SAASF,CAAT,CAAkB,CACnC,MAAOA,CAAAA,CAAO,CAACC,IAAR,CAAaT,CAAS,CAACE,YAAvB,CACV,CAnC4F,CA6CzFS,CAAqB,CAAG,SAASH,CAAT,CAAkB,CAC1C,MAAOA,CAAAA,CAAO,CAACC,IAAR,CAAaT,CAAS,CAACG,mBAAvB,CACV,CA/C4F,CAyDzFS,CAAiB,CAAG,SAASJ,CAAT,CAAkB,CACtC,MAAOA,CAAAA,CAAO,CAACC,IAAR,CAAaT,CAAS,CAACK,eAAvB,CACV,CA3D4F,CAqEzFQ,CAAiB,CAAG,SAASL,CAAT,CAAkB,CACtC,MAAOI,CAAAA,CAAiB,CAACJ,CAAD,CAAjB,CAA2BM,MAA3B,MACV,CAvE4F,CAkFzFC,CA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AAD,CAAtB,CACAyF,CAAa,CAACzF,CAAD,CAChB,CAVoD,CAY5D,CArpBM,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls all of the behaviour and interaction with a tool type card. These are\n * listed on the LTI tool type management page.\n *\n * See template: mod_lti/tool_card\n *\n * @module mod_lti/tool_card_controller\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\n define(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'core/modal_factory',\n 'mod_lti/tool_type', 'mod_lti/events', 'mod_lti/keys',\n 'core/str'],\n function($, ajax, notification, templates, modalFactory, toolType, ltiEvents, KEYS, str) {\n\n var SELECTORS = {\n DELETE_BUTTON: '.delete',\n NAME_ELEMENT: '.name',\n DESCRIPTION_ELEMENT: '.description',\n CAPABILITIES_CONTAINER: '.capabilities-container',\n ACTIVATE_BUTTON: '.tool-card-footer a.activate',\n };\n\n // Timeout in seconds.\n var ANNOUNCEMENT_TIMEOUT = 2000;\n\n /**\n * Return the delete button element.\n *\n * @method getDeleteButton\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {JQuery} jQuery object\n */\n var getDeleteButton = function(element) {\n return element.find(SELECTORS.DELETE_BUTTON);\n };\n\n /**\n * Return the element representing the tool type name.\n *\n * @method getNameElement\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {JQuery} jQuery object\n */\n var getNameElement = function(element) {\n return element.find(SELECTORS.NAME_ELEMENT);\n };\n\n /**\n * Return the element representing the tool type description.\n *\n * @method getDescriptionElement\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {JQuery} jQuery object\n */\n var getDescriptionElement = function(element) {\n return element.find(SELECTORS.DESCRIPTION_ELEMENT);\n };\n\n /**\n * Return the activate button for the type.\n *\n * @method getActivateButton\n * @private\n * @param {Object} element jQuery object representing the tool card.\n * @return {Object} jQuery object\n */\n var getActivateButton = function(element) {\n return element.find(SELECTORS.ACTIVATE_BUTTON);\n };\n\n /**\n * Checks if the type card has an activate button.\n *\n * @method hasActivateButton\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Boolean} true if has active buton\n */\n var hasActivateButton = function(element) {\n return getActivateButton(element).length ? true : false;\n };\n\n /**\n * Return the element that contains the capabilities approval for\n * the user.\n *\n * @method getCapabilitiesContainer\n * @private\n * @param {Object} element jQuery object representing the tool card.\n * @return {Object} The element\n */\n var getCapabilitiesContainer = function(element) {\n return element.find(SELECTORS.CAPABILITIES_CONTAINER);\n };\n\n /**\n * Checks if the tool type has capabilities that need approval. If it\n * does then the container will be present.\n *\n * @method hasCapabilitiesContainer\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Boolean} true if has capbilities.\n */\n var hasCapabilitiesContainer = function(element) {\n return getCapabilitiesContainer(element).length ? true : false;\n };\n\n /**\n * Get the type id.\n *\n * @method getTypeId\n * @private\n * @param {Object} element jQuery object representing the tool card.\n * @return {String} Type ID\n */\n var getTypeId = function(element) {\n return element.attr('data-type-id');\n };\n\n /**\n * Stop any announcement currently visible on the card.\n *\n * @method clearAllAnnouncements\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var clearAllAnnouncements = function(element) {\n element.removeClass('announcement loading success fail capabilities');\n };\n\n /**\n * Show the loading announcement.\n *\n * @method startLoading\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var startLoading = function(element) {\n clearAllAnnouncements(element);\n element.addClass('announcement loading');\n };\n\n /**\n * Hide the loading announcement.\n *\n * @method stopLoading\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var stopLoading = function(element) {\n element.removeClass('announcement loading');\n };\n\n /**\n * Show the success announcement. The announcement is only\n * visible for 2 seconds.\n *\n * @method announceSuccess\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var announceSuccess = function(element) {\n var promise = $.Deferred();\n\n clearAllAnnouncements(element);\n element.addClass('announcement success');\n setTimeout(function() {\n element.removeClass('announcement success');\n promise.resolve();\n }, ANNOUNCEMENT_TIMEOUT);\n\n return promise;\n };\n\n /**\n * Show the failure announcement. The announcement is only\n * visible for 2 seconds.\n *\n * @method announceFailure\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var announceFailure = function(element) {\n var promise = $.Deferred();\n\n clearAllAnnouncements(element);\n element.addClass('announcement fail');\n setTimeout(function() {\n element.removeClass('announcement fail');\n promise.resolve();\n }, ANNOUNCEMENT_TIMEOUT);\n\n return promise;\n };\n\n /**\n * Delete the tool type from the Moodle server. Triggers a success\n * or failure announcement depending on the result.\n *\n * @method deleteType\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var deleteType = function(element) {\n var promise = $.Deferred();\n var typeId = getTypeId(element);\n startLoading(element);\n\n if (typeId === \"\") {\n return $.Deferred().resolve();\n }\n\n str.get_strings([\n {\n key: 'delete',\n component: 'mod_lti'\n },\n {\n key: 'delete_confirmation',\n component: 'mod_lti'\n },\n {\n key: 'delete',\n component: 'mod_lti'\n },\n {\n key: 'cancel',\n component: 'core'\n },\n ])\n .done(function(strs) {\n notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {\n toolType.delete(typeId)\n .done(function() {\n stopLoading(element);\n announceSuccess(element)\n .done(function() {\n element.remove();\n })\n .fail(notification.exception)\n .always(function() {\n // Always resolve because even if the announcement fails the type was deleted.\n promise.resolve();\n });\n })\n .fail(function(error) {\n announceFailure(element);\n promise.reject(error);\n });\n }, function() {\n stopLoading(element);\n promise.resolve();\n });\n })\n .fail(function(error) {\n stopLoading(element);\n notification.exception(error);\n promise.reject(error);\n });\n\n return promise;\n };\n\n /**\n * Save a given value in a data attribute on the element.\n *\n * @method setValueSnapshot\n * @private\n * @param {JQuery} element jQuery object representing the element.\n * @param {String} value to be saved.\n */\n var setValueSnapshot = function(element, value) {\n element.attr('data-val-snapshot', value);\n };\n\n /**\n * Return the saved value from the element.\n *\n * @method getValueSnapshot\n * @private\n * @param {JQuery} element jQuery object representing the element.\n * @return {String} the saved value.\n */\n var getValueSnapshot = function(element) {\n return element.attr('data-val-snapshot');\n };\n\n /**\n * Save the current value of the tool description.\n *\n * @method snapshotDescription\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var snapshotDescription = function(element) {\n var descriptionElement = getDescriptionElement(element);\n\n if (descriptionElement.hasClass('loading')) {\n return;\n }\n\n var description = descriptionElement.text().trim();\n setValueSnapshot(descriptionElement, description);\n };\n\n /**\n * Send a request to update the description value for this tool\n * in the Moodle server.\n *\n * @method updateDescription\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var updateDescription = function(element) {\n var typeId = getTypeId(element);\n\n // Return early if we don't have an id because it's\n // required to save the changes.\n if (typeId === \"\") {\n return $.Deferred().resolve();\n }\n\n var descriptionElement = getDescriptionElement(element);\n\n // Return early if we're already saving a value.\n if (descriptionElement.hasClass('loading')) {\n return $.Deferred().resolve();\n }\n\n var description = descriptionElement.text().trim();\n var snapshotVal = getValueSnapshot(descriptionElement);\n\n // If the value hasn't change then don't bother sending the\n // update request.\n if (snapshotVal == description) {\n return $.Deferred().resolve();\n }\n\n descriptionElement.addClass('loading');\n\n var promise = toolType.update({id: typeId, description: description});\n\n promise.done(function(type) {\n descriptionElement.removeClass('loading');\n // Make sure the text is updated with the description from the\n // server, just in case the update didn't work.\n descriptionElement.text(type.description);\n }).fail(notification.exception);\n\n // Probably need to handle failures better so that we can revert\n // the value in the input for the user.\n promise.fail(function() {\n descriptionElement.removeClass('loading');\n });\n\n return promise;\n };\n\n /**\n * Save the current value of the tool name.\n *\n * @method snapshotName\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var snapshotName = function(element) {\n var nameElement = getNameElement(element);\n\n if (nameElement.hasClass('loading')) {\n return;\n }\n\n var name = nameElement.text().trim();\n setValueSnapshot(nameElement, name);\n };\n\n /**\n * Send a request to update the name value for this tool\n * in the Moodle server.\n *\n * @method updateName\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var updateName = function(element) {\n var typeId = getTypeId(element);\n\n // Return if we don't have an id.\n if (typeId === \"\") {\n return $.Deferred().resolve();\n }\n\n var nameElement = getNameElement(element);\n\n // Return if we're already saving.\n if (nameElement.hasClass('loading')) {\n return $.Deferred().resolve();\n }\n\n var name = nameElement.text().trim();\n var snapshotVal = getValueSnapshot(nameElement);\n\n // If the value hasn't change then don't bother sending the\n // update request.\n if (snapshotVal == name) {\n return $.Deferred().resolve();\n }\n\n nameElement.addClass('loading');\n var promise = toolType.update({id: typeId, name: name});\n\n promise.done(function(type) {\n nameElement.removeClass('loading');\n // Make sure the text is updated with the name from the\n // server, just in case the update didn't work.\n nameElement.text(type.name);\n });\n\n // Probably need to handle failures better so that we can revert\n // the value in the input for the user.\n promise.fail(function() {\n nameElement.removeClass('loading');\n });\n\n return promise;\n };\n\n /**\n * Send a request to update the state for this tool to be configured (active)\n * in the Moodle server. A success or failure announcement is triggered depending\n * on the result.\n *\n * @method setStatusActive\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var setStatusActive = function(element) {\n var id = getTypeId(element);\n\n // Return if we don't have an id.\n if (id === \"\") {\n return $.Deferred().resolve();\n }\n\n startLoading(element);\n\n var promise = toolType.update({\n id: id,\n state: toolType.constants.state.configured\n });\n\n promise.then(function(toolTypeData) {\n stopLoading(element);\n announceSuccess(element);\n return toolTypeData;\n }).then(function(toolTypeData) {\n return templates.render('mod_lti/tool_card', toolTypeData);\n }).then(function(html, js) {\n templates.replaceNode(element, html, js);\n return;\n }).catch(function() {\n stopLoading(element);\n announceFailure(element);\n });\n\n return promise;\n };\n\n /**\n * Show the capabilities approval screen to show which groups of data this\n * type requires access to in Moodle (if any).\n *\n * @method displayCapabilitiesApproval\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var displayCapabilitiesApproval = function(element) {\n element.addClass('announcement capabilities');\n };\n\n /**\n * Hide the capabilities approval screen.\n *\n * @method hideCapabilitiesApproval\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var hideCapabilitiesApproval = function(element) {\n element.removeClass('announcement capabilities');\n };\n\n /**\n * The user wishes to activate this tool so show them the capabilities that\n * they need to agree to or if there are none then set the tool type's state\n * to active.\n *\n * @method activateToolType\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var activateToolType = function(element) {\n if (hasCapabilitiesContainer(element)) {\n displayCapabilitiesApproval(element);\n } else {\n setStatusActive(element);\n }\n };\n\n /**\n * Sets up the listeners for user interaction on this tool type card.\n *\n * @method registerEventListeners\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var registerEventListeners = function(element) {\n var deleteButton = getDeleteButton(element);\n deleteButton.click(function(e) {\n e.preventDefault();\n deleteType(element);\n });\n deleteButton.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER || e.keyCode == KEYS.SPACE) {\n e.preventDefault();\n deleteButton.click();\n }\n }\n });\n\n var descriptionElement = getDescriptionElement(element);\n descriptionElement.focus(function(e) {\n e.preventDefault();\n // Save a copy of the current value for the description so that\n // we can check if the user has changed it before sending a request to\n // the server.\n snapshotDescription(element);\n });\n descriptionElement.blur(function(e) {\n e.preventDefault();\n updateDescription(element);\n });\n descriptionElement.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER) {\n e.preventDefault();\n descriptionElement.blur();\n }\n }\n });\n\n var nameElement = getNameElement(element);\n nameElement.focus(function(e) {\n e.preventDefault();\n // Save a copy of the current value for the name so that\n // we can check if the user has changed it before sending a request to\n // the server.\n snapshotName(element);\n });\n nameElement.blur(function(e) {\n e.preventDefault();\n updateName(element);\n });\n nameElement.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER) {\n e.preventDefault();\n nameElement.blur();\n }\n }\n });\n\n // Only pending tool type cards have an activate button.\n if (hasActivateButton(element)) {\n var activateButton = getActivateButton(element);\n activateButton.click(function(e) {\n e.preventDefault();\n activateToolType(element);\n });\n activateButton.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER || e.keyCode == KEYS.SPACE) {\n e.preventDefault();\n activateButton.click();\n }\n }\n });\n }\n\n if (hasCapabilitiesContainer(element)) {\n var capabilitiesContainer = getCapabilitiesContainer(element);\n\n capabilitiesContainer.on(ltiEvents.CAPABILITIES_AGREE, function() {\n setStatusActive(element);\n });\n\n capabilitiesContainer.on(ltiEvents.CAPABILITIES_DECLINE, function() {\n hideCapabilitiesApproval(element);\n });\n }\n };\n\n /**\n * Sets up the templates for the tool configuration modal on this tool type card.\n *\n * @method registerModal\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var registerModal = function(element) {\n var trigger = $('#' + element.data('uniqid') + '-' + element.data('deploymentid'));\n var context = {\n 'uniqid': element.data('uniqid'),\n 'platformid': element.data('platformid'),\n 'clientid': element.data('clientid'),\n 'deploymentid': element.data('deploymentid'),\n 'urls': {\n 'publickeyset': element.data('publickeyseturl'),\n 'accesstoken': element.data('accesstokenurl'),\n 'authrequest': element.data('authrequesturl')\n }\n };\n var bodyPromise = templates.render('mod_lti/tool_config_modal_body', context);\n var mailTo = 'mailto:?subject=' + encodeURIComponent(element.data('mailtosubject')) +\n '&body=' + encodeURIComponent(element.data('platformidstr')) + ':%20' +\n encodeURIComponent(element.data('platformid')) + '%0D%0A' +\n encodeURIComponent(element.data('clientidstr')) + ':%20' +\n encodeURIComponent(element.data('clientid')) + '%0D%0A' +\n encodeURIComponent(element.data('deploymentidstr')) + ':%20' +\n encodeURIComponent(element.data('deploymentid')) + '%0D%0A' +\n encodeURIComponent(element.data('publickeyseturlstr')) + ':%20' +\n encodeURIComponent(element.data('publickeyseturl')) + '%0D%0A' +\n encodeURIComponent(element.data('accesstokenurlstr')) + ':%20' +\n encodeURIComponent(element.data('accesstokenurl')) + '%0D%0A' +\n encodeURIComponent(element.data('authrequesturlstr')) + ':%20' +\n encodeURIComponent(element.data('authrequesturl')) + '%0D%0A';\n context = {\n 'mailto': mailTo\n };\n var footerPromise = templates.render('mod_lti/tool_config_modal_footer', context);\n modalFactory.create({\n large: true,\n title: element.data('modaltitle'),\n body: bodyPromise,\n footer: footerPromise,\n }, trigger);\n };\n\n return /** @alias module:mod_lti/tool_card_controller */ {\n\n /**\n * Initialise this module.\n *\n * @param {JQuery} element jQuery object representing the tool card.\n */\n init: function(element) {\n registerEventListeners(element);\n registerModal(element);\n }\n };\n});\n"],"file":"tool_card_controller.min.js"} \ No newline at end of file diff --git a/mod/lti/amd/build/tool_configure_controller.min.js.map b/mod/lti/amd/build/tool_configure_controller.min.js.map index 066b480b38d59..9caf867238a48 100644 --- a/mod/lti/amd/build/tool_configure_controller.min.js.map +++ b/mod/lti/amd/build/tool_configure_controller.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/tool_configure_controller.js"],"names":["define","$","ajax","notification","templates","ltiEvents","KEYS","toolType","toolProxy","str","config","SELECTORS","EXTERNAL_REGISTRATION_CONTAINER","EXTERNAL_REGISTRATION_PAGE_CONTAINER","EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER","CARTRIDGE_REGISTRATION_CONTAINER","CARTRIDGE_REGISTRATION_FORM","ADD_TOOL_FORM","TOOL_LIST_CONTAINER","TOOL_CREATE_BUTTON","TOOL_CREATE_LTILEGACY_BUTTON","REGISTRATION_CHOICE_CONTAINER","TOOL_URL","getToolListContainer","getExternalRegistrationContainer","getCartridgeRegistrationContainer","getRegistrationChoiceContainer","closeLTIAdvRegistration","e","data","subject","empty","hideExternalRegistration","showRegistrationChoices","showToolList","reloadToolList","initiateRegistration","url","removeClass","container","append","encodeURIComponent","sesskey","showExternalRegistration","window","addEventListener","getToolURL","val","addClass","hideCartridgeRegistration","hideRegistrationChoices","screenReaderAnnounce","showCartridgeRegistration","find","attr","element","children","detach","appendTo","hideToolList","showRegistrationFeedback","type","error","addNotification","message","startLoading","stopLoading","promise","Deferred","when","query","done","types","proxies","render","tools","html","js","runTemplateJS","resolve","fail","reject","exception","always","addLTIAdvTool","trim","addLTILegacyTool","toolButton","isCartridge","result","iscartridge","document","trigger","START_CARTRIDGE_REGISTRATION","START_EXTERNAL_REGISTRATION","get_string","s","REGISTRATION_FEEDBACK","registerEventListeners","on","NEW_TOOL_TYPE","STOP_EXTERNAL_REGISTRATION","event","STOP_CARTRIDGE_REGISTRATION","removeAttr","addLegacyButton","click","preventDefault","addLTIButton","init"],"mappings":"AA0BAA,OAAM,qCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAA6C,gBAA7C,CAA+D,gBAA/D,CAAiF,cAAjF,CAAiG,mBAAjG,CACC,oBADD,CACuB,UADvB,CACmC,aADnC,CAAD,CAEE,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAsDC,CAAtD,CAA4DC,CAA5D,CAAsEC,CAAtE,CAAiFC,CAAjF,CAAsFC,CAAtF,CAA8F,IAE9FC,CAAAA,CAAS,CAAG,CACZC,+BAA+B,CAAE,kCADrB,CAEZC,oCAAoC,CAAE,uCAF1B,CAGZC,wCAAwC,CAAE,2CAH9B,CAIZC,gCAAgC,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AIApC,CAAC,CAAC0F,QAAD,CAAD,CAAYQ,EAAZ,CAAe9F,CAAS,CAACkG,2BAAzB,CAAsD,UAAW,CAC7D9E,CAAiC,GAAG4B,IAApC,CAAyC1C,CAAS,CAACK,2BAAnD,EAAgFwF,UAAhF,CAA2F,oBAA3F,EACAvE,CAAuB,EAC1B,CAHD,EAKAhC,CAAC,CAAC0F,QAAD,CAAD,CAAYQ,EAAZ,CAAe9F,CAAS,CAAC4F,qBAAzB,CAAgD,SAASK,CAAT,CAAgBzE,CAAhB,CAAsB,CAClE+B,CAAwB,CAAC/B,CAAD,CAC3B,CAFD,EAIA,GAAI4E,CAAAA,CAAe,CAAGxG,CAAC,CAACU,CAAS,CAACS,4BAAX,CAAvB,CACAqF,CAAe,CAACC,KAAhB,CAAsB,SAAS9E,CAAT,CAAY,CAC9BA,CAAC,CAAC+E,cAAF,GACArB,CAAgB,EACnB,CAHD,EAKA,GAAIsB,CAAAA,CAAY,CAAG3G,CAAC,CAACU,CAAS,CAACQ,kBAAX,CAApB,CACAyF,CAAY,CAACF,KAAb,CAAmB,SAAS9E,CAAT,CAAY,CAC3BA,CAAC,CAAC+E,cAAF,GACAvB,CAAa,EAChB,CAHD,CAKH,CA9YiG,CAgZlG,MAAgE,CAK5DyB,IAAI,CAAE,eAAW,CACbX,CAAsB,GACtB/D,CAAc,EACjB,CAR2D,CAUnE,CA5ZK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Standard Ajax wrapper for Moodle. It calls the central Ajax script,\n * which can call any existing webservice using the current session.\n * In addition, it can batch multiple requests and return multiple responses.\n *\n * @module mod_lti/tool_configure_controller\n * @class tool_configure_controller\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/events', 'mod_lti/keys', 'mod_lti/tool_type',\n 'mod_lti/tool_proxy', 'core/str', 'core/config'],\n function($, ajax, notification, templates, ltiEvents, KEYS, toolType, toolProxy, str, config) {\n\n var SELECTORS = {\n EXTERNAL_REGISTRATION_CONTAINER: '#external-registration-container',\n EXTERNAL_REGISTRATION_PAGE_CONTAINER: '#external-registration-page-container',\n EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER: '#external-registration-template-container',\n CARTRIDGE_REGISTRATION_CONTAINER: '#cartridge-registration-container',\n CARTRIDGE_REGISTRATION_FORM: '#cartridge-registration-form',\n ADD_TOOL_FORM: '#add-tool-form',\n TOOL_LIST_CONTAINER: '#tool-list-container',\n TOOL_CREATE_BUTTON: '#tool-create-button',\n TOOL_CREATE_LTILEGACY_BUTTON: '#tool-createltilegacy-button',\n REGISTRATION_CHOICE_CONTAINER: '#registration-choice-container',\n TOOL_URL: '#tool-url'\n };\n\n /**\n * Get the tool list container element.\n *\n * @method getToolListContainer\n * @private\n * @return {Object} jQuery object\n */\n var getToolListContainer = function() {\n return $(SELECTORS.TOOL_LIST_CONTAINER);\n };\n\n /**\n * Get the external registration container element.\n *\n * @method getExternalRegistrationContainer\n * @private\n * @return {Object} jQuery object\n */\n var getExternalRegistrationContainer = function() {\n return $(SELECTORS.EXTERNAL_REGISTRATION_CONTAINER);\n };\n\n /**\n * Get the cartridge registration container element.\n *\n * @method getCartridgeRegistrationContainer\n * @private\n * @return {Object} jQuery object\n */\n var getCartridgeRegistrationContainer = function() {\n return $(SELECTORS.CARTRIDGE_REGISTRATION_CONTAINER);\n };\n\n /**\n * Get the registration choice container element.\n *\n * @method getRegistrationChoiceContainer\n * @private\n * @return {Object} jQuery object\n */\n var getRegistrationChoiceContainer = function() {\n return $(SELECTORS.REGISTRATION_CHOICE_CONTAINER);\n };\n\n /**\n * Close the LTI Advantage Registration IFrame.\n *\n * @private\n * @param {Object} e post message event sent from the registration frame.\n */\n var closeLTIAdvRegistration = function(e) {\n if (e.data && 'org.imsglobal.lti.close' === e.data.subject) {\n $(SELECTORS.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER).empty();\n hideExternalRegistration();\n showRegistrationChoices();\n showToolList();\n showRegistrationChoices();\n reloadToolList();\n }\n };\n\n /**\n * Load the external registration template and render it in the DOM and display it.\n *\n * @method initiateRegistration\n * @private\n * @param {String} url where to send the registration request\n */\n var initiateRegistration = function(url) {\n // Show the external registration page in an iframe.\n $(SELECTORS.EXTERNAL_REGISTRATION_PAGE_CONTAINER).removeClass('hidden');\n var container = $(SELECTORS.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER);\n container.append($(\"\"));\n showExternalRegistration();\n window.addEventListener(\"message\", closeLTIAdvRegistration, false);\n };\n\n /**\n * Get the tool type URL.\n *\n * @method getToolURL\n * @private\n * @return {String} the tool type url\n */\n var getToolURL = function() {\n return $(SELECTORS.TOOL_URL).val();\n };\n\n /**\n * Hide the external registration container.\n *\n * @method hideExternalRegistration\n * @private\n */\n var hideExternalRegistration = function() {\n getExternalRegistrationContainer().addClass('hidden');\n };\n\n /**\n * Hide the cartridge registration container.\n *\n * @method hideCartridgeRegistration\n * @private\n */\n var hideCartridgeRegistration = function() {\n getCartridgeRegistrationContainer().addClass('hidden');\n };\n\n /**\n * Hide the registration choice container.\n *\n * @method hideRegistrationChoices\n * @private\n */\n var hideRegistrationChoices = function() {\n getRegistrationChoiceContainer().addClass('hidden');\n };\n\n /**\n * Display the external registration panel and hides the other\n * panels.\n *\n * @method showExternalRegistration\n * @private\n */\n var showExternalRegistration = function() {\n hideCartridgeRegistration();\n hideRegistrationChoices();\n getExternalRegistrationContainer().removeClass('hidden');\n screenReaderAnnounce(getExternalRegistrationContainer());\n };\n\n /**\n * Display the cartridge registration panel and hides the other\n * panels.\n *\n * @method showCartridgeRegistration\n * @param {String} url\n * @private\n */\n var showCartridgeRegistration = function(url) {\n hideExternalRegistration();\n hideRegistrationChoices();\n // Don't save the key and secret from the last tool.\n var container = getCartridgeRegistrationContainer();\n container.find('input').val('');\n container.removeClass('hidden');\n container.find(SELECTORS.CARTRIDGE_REGISTRATION_FORM).attr('data-cartridge-url', url);\n screenReaderAnnounce(container);\n };\n\n /**\n * Display the registration choices panel and hides the other\n * panels.\n *\n * @method showRegistrationChoices\n * @private\n */\n var showRegistrationChoices = function() {\n hideExternalRegistration();\n hideCartridgeRegistration();\n getRegistrationChoiceContainer().removeClass('hidden');\n screenReaderAnnounce(getRegistrationChoiceContainer());\n };\n\n /**\n * JAWS does not notice visibility changes with aria-live.\n * Remove and add the content back to force it to read it out.\n * This function can be removed once JAWS supports visibility.\n *\n * @method screenReaderAnnounce\n * @param {Object} element\n * @private\n */\n var screenReaderAnnounce = function(element) {\n var children = element.children().detach();\n children.appendTo(element);\n };\n\n /**\n * Hides the list of tool types.\n *\n * @method hideToolList\n * @private\n */\n var hideToolList = function() {\n getToolListContainer().addClass('hidden');\n };\n\n /**\n * Display the list of tool types.\n *\n * @method hideToolList\n * @private\n */\n var showToolList = function() {\n getToolListContainer().removeClass('hidden');\n };\n\n /**\n * Display the registration feedback alert and hide the other panels.\n *\n * @method showRegistrationFeedback\n * @param {Object} data\n * @private\n */\n var showRegistrationFeedback = function(data) {\n var type = data.error ? 'error' : 'success';\n notification.addNotification({\n message: data.message,\n type: type\n });\n };\n\n /**\n * Show the loading animation\n *\n * @method startLoading\n * @private\n * @param {Object} element jQuery object\n */\n var startLoading = function(element) {\n element.addClass(\"loading\");\n };\n\n /**\n * Hide the loading animation\n *\n * @method stopLoading\n * @private\n * @param {Object} element jQuery object\n */\n var stopLoading = function(element) {\n element.removeClass(\"loading\");\n };\n\n /**\n * Refresh the list of tool types and render the new ones.\n *\n * @method reloadToolList\n * @private\n */\n var reloadToolList = function() {\n var promise = $.Deferred();\n var container = getToolListContainer();\n startLoading(container);\n\n $.when(\n toolType.query(),\n toolProxy.query({'orphanedonly': true})\n )\n .done(function(types, proxies) {\n templates.render('mod_lti/tool_list', {tools: types, proxies: proxies})\n .done(function(html, js) {\n container.empty();\n container.append(html);\n templates.runTemplateJS(js);\n promise.resolve();\n }).fail(promise.reject);\n })\n .fail(promise.reject);\n\n promise.fail(notification.exception)\n .always(function() {\n stopLoading(container);\n });\n };\n\n /**\n * Start the LTI Advantage registration.\n *\n * @method addLTIAdvTool\n * @private\n */\n var addLTIAdvTool = function() {\n var url = getToolURL().trim();\n\n if (url) {\n $(SELECTORS.TOOL_URL).val('');\n hideToolList();\n initiateRegistration(url);\n }\n\n };\n\n /**\n * Trigger appropriate registration process process for the user input\n * URL. It can either be a cartridge or a registration url.\n *\n * @method addLTILegacyTool\n * @private\n * @return {Promise} jQuery Deferred object\n */\n var addLTILegacyTool = function() {\n var url = getToolURL().trim();\n\n if (url === \"\") {\n return $.Deferred().resolve();\n }\n var toolButton = $(SELECTORS.TOOL_CREATE_LTILEGACY_BUTTON);\n startLoading(toolButton);\n\n var promise = toolType.isCartridge(url);\n\n promise.always(function() {\n stopLoading(toolButton);\n });\n\n promise.done(function(result) {\n if (result.iscartridge) {\n $(SELECTORS.TOOL_URL).val('');\n $(document).trigger(ltiEvents.START_CARTRIDGE_REGISTRATION, url);\n } else {\n $(document).trigger(ltiEvents.START_EXTERNAL_REGISTRATION, {url: url});\n }\n });\n\n promise.fail(function() {\n str.get_string('errorbadurl', 'mod_lti')\n .done(function(s) {\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, {\n message: s,\n error: true\n });\n })\n .fail(notification.exception);\n });\n\n return promise;\n };\n\n /**\n * Sets up the listeners for user interaction on the page.\n *\n * @method registerEventListeners\n * @private\n */\n var registerEventListeners = function() {\n\n // These are events fired by the registration processes. Either\n // the cartridge registration or the external registration url.\n $(document).on(ltiEvents.NEW_TOOL_TYPE, function() {\n reloadToolList();\n });\n\n $(document).on(ltiEvents.START_EXTERNAL_REGISTRATION, function() {\n showExternalRegistration();\n $(SELECTORS.TOOL_URL).val('');\n hideToolList();\n });\n\n $(document).on(ltiEvents.STOP_EXTERNAL_REGISTRATION, function() {\n showToolList();\n showRegistrationChoices();\n });\n\n $(document).on(ltiEvents.START_CARTRIDGE_REGISTRATION, function(event, url) {\n showCartridgeRegistration(url);\n });\n\n $(document).on(ltiEvents.STOP_CARTRIDGE_REGISTRATION, function() {\n getCartridgeRegistrationContainer().find(SELECTORS.CARTRIDGE_REGISTRATION_FORM).removeAttr('data-cartridge-url');\n showRegistrationChoices();\n });\n\n $(document).on(ltiEvents.REGISTRATION_FEEDBACK, function(event, data) {\n showRegistrationFeedback(data);\n });\n\n var addLegacyButton = $(SELECTORS.TOOL_CREATE_LTILEGACY_BUTTON);\n addLegacyButton.click(function(e) {\n e.preventDefault();\n addLTILegacyTool();\n });\n\n var addLTIButton = $(SELECTORS.TOOL_CREATE_BUTTON);\n addLTIButton.click(function(e) {\n e.preventDefault();\n addLTIAdvTool();\n });\n\n };\n\n return /** @alias module:mod_lti/cartridge_registration_form */ {\n\n /**\n * Initialise this module.\n */\n init: function() {\n registerEventListeners();\n reloadToolList();\n }\n };\n});\n"],"file":"tool_configure_controller.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/tool_configure_controller.js"],"names":["define","$","ajax","notification","templates","ltiEvents","KEYS","toolType","toolProxy","str","config","SELECTORS","EXTERNAL_REGISTRATION_CONTAINER","EXTERNAL_REGISTRATION_PAGE_CONTAINER","EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER","CARTRIDGE_REGISTRATION_CONTAINER","CARTRIDGE_REGISTRATION_FORM","ADD_TOOL_FORM","TOOL_LIST_CONTAINER","TOOL_CREATE_BUTTON","TOOL_CREATE_LTILEGACY_BUTTON","REGISTRATION_CHOICE_CONTAINER","TOOL_URL","getToolListContainer","getExternalRegistrationContainer","getCartridgeRegistrationContainer","getRegistrationChoiceContainer","closeLTIAdvRegistration","e","data","subject","empty","hideExternalRegistration","showRegistrationChoices","showToolList","reloadToolList","initiateRegistration","url","removeClass","container","append","encodeURIComponent","sesskey","showExternalRegistration","window","addEventListener","getToolURL","val","addClass","hideCartridgeRegistration","hideRegistrationChoices","screenReaderAnnounce","showCartridgeRegistration","find","attr","element","children","detach","appendTo","hideToolList","showRegistrationFeedback","type","error","addNotification","message","startLoading","stopLoading","promise","Deferred","when","query","done","types","proxies","render","tools","html","js","runTemplateJS","resolve","fail","reject","exception","always","addLTIAdvTool","trim","addLTILegacyTool","toolButton","isCartridge","result","iscartridge","document","trigger","START_CARTRIDGE_REGISTRATION","START_EXTERNAL_REGISTRATION","get_string","s","REGISTRATION_FEEDBACK","registerEventListeners","on","NEW_TOOL_TYPE","STOP_EXTERNAL_REGISTRATION","event","STOP_CARTRIDGE_REGISTRATION","removeAttr","addLegacyButton","click","preventDefault","addLTIButton","init"],"mappings":"AAyBAA,OAAM,qCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAA6C,gBAA7C,CAA+D,gBAA/D,CAAiF,cAAjF,CAAiG,mBAAjG,CACC,oBADD,CACuB,UADvB,CACmC,aADnC,CAAD,CAEE,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAsDC,CAAtD,CAA4DC,CAA5D,CAAsEC,CAAtE,CAAiFC,CAAjF,CAAsFC,CAAtF,CAA8F,IAE9FC,CAAAA,CAAS,CAAG,CACZC,+BAA+B,CAAE,kCADrB,CAEZC,oCAAoC,CAAE,uCAF1B,CAGZC,wCAAwC,CAAE,2CAH9B,CAIZC,gCAAgC,CAAE,mCAJtB,CAKZC,2BAA2B,CAAE,8BALjB,CAMZC,aAAa,CAAE,gBANH,CAOZC,mBAAmB,CAAE,sBAPT,CAQZC,kBAAkB,CAAE,qBARR,CASZC,4BAA4B,CA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K,2BAAnD,EAAgFwF,UAAhF,CAA2F,oBAA3F,EACAvE,CAAuB,EAC1B,CAHD,EAKAhC,CAAC,CAAC0F,QAAD,CAAD,CAAYQ,EAAZ,CAAe9F,CAAS,CAAC4F,qBAAzB,CAAgD,SAASK,CAAT,CAAgBzE,CAAhB,CAAsB,CAClE+B,CAAwB,CAAC/B,CAAD,CAC3B,CAFD,EAIA,GAAI4E,CAAAA,CAAe,CAAGxG,CAAC,CAACU,CAAS,CAACS,4BAAX,CAAvB,CACAqF,CAAe,CAACC,KAAhB,CAAsB,SAAS9E,CAAT,CAAY,CAC9BA,CAAC,CAAC+E,cAAF,GACArB,CAAgB,EACnB,CAHD,EAKA,GAAIsB,CAAAA,CAAY,CAAG3G,CAAC,CAACU,CAAS,CAACQ,kBAAX,CAApB,CACAyF,CAAY,CAACF,KAAb,CAAmB,SAAS9E,CAAT,CAAY,CAC3BA,CAAC,CAAC+E,cAAF,GACAvB,CAAa,EAChB,CAHD,CAKH,CA9YiG,CAgZlG,MAAgE,CAK5DyB,IAAI,CAAE,eAAW,CACbX,CAAsB,GACtB/D,CAAc,EACjB,CAR2D,CAUnE,CA5ZK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Standard Ajax wrapper for Moodle. It calls the central Ajax script,\n * which can call any existing webservice using the current session.\n * In addition, it can batch multiple requests and return multiple responses.\n *\n * @module mod_lti/tool_configure_controller\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/events', 'mod_lti/keys', 'mod_lti/tool_type',\n 'mod_lti/tool_proxy', 'core/str', 'core/config'],\n function($, ajax, notification, templates, ltiEvents, KEYS, toolType, toolProxy, str, config) {\n\n var SELECTORS = {\n EXTERNAL_REGISTRATION_CONTAINER: '#external-registration-container',\n EXTERNAL_REGISTRATION_PAGE_CONTAINER: '#external-registration-page-container',\n EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER: '#external-registration-template-container',\n CARTRIDGE_REGISTRATION_CONTAINER: '#cartridge-registration-container',\n CARTRIDGE_REGISTRATION_FORM: '#cartridge-registration-form',\n ADD_TOOL_FORM: '#add-tool-form',\n TOOL_LIST_CONTAINER: '#tool-list-container',\n TOOL_CREATE_BUTTON: '#tool-create-button',\n TOOL_CREATE_LTILEGACY_BUTTON: '#tool-createltilegacy-button',\n REGISTRATION_CHOICE_CONTAINER: '#registration-choice-container',\n TOOL_URL: '#tool-url'\n };\n\n /**\n * Get the tool list container element.\n *\n * @method getToolListContainer\n * @private\n * @return {Object} jQuery object\n */\n var getToolListContainer = function() {\n return $(SELECTORS.TOOL_LIST_CONTAINER);\n };\n\n /**\n * Get the external registration container element.\n *\n * @method getExternalRegistrationContainer\n * @private\n * @return {Object} jQuery object\n */\n var getExternalRegistrationContainer = function() {\n return $(SELECTORS.EXTERNAL_REGISTRATION_CONTAINER);\n };\n\n /**\n * Get the cartridge registration container element.\n *\n * @method getCartridgeRegistrationContainer\n * @private\n * @return {Object} jQuery object\n */\n var getCartridgeRegistrationContainer = function() {\n return $(SELECTORS.CARTRIDGE_REGISTRATION_CONTAINER);\n };\n\n /**\n * Get the registration choice container element.\n *\n * @method getRegistrationChoiceContainer\n * @private\n * @return {Object} jQuery object\n */\n var getRegistrationChoiceContainer = function() {\n return $(SELECTORS.REGISTRATION_CHOICE_CONTAINER);\n };\n\n /**\n * Close the LTI Advantage Registration IFrame.\n *\n * @private\n * @param {Object} e post message event sent from the registration frame.\n */\n var closeLTIAdvRegistration = function(e) {\n if (e.data && 'org.imsglobal.lti.close' === e.data.subject) {\n $(SELECTORS.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER).empty();\n hideExternalRegistration();\n showRegistrationChoices();\n showToolList();\n showRegistrationChoices();\n reloadToolList();\n }\n };\n\n /**\n * Load the external registration template and render it in the DOM and display it.\n *\n * @method initiateRegistration\n * @private\n * @param {String} url where to send the registration request\n */\n var initiateRegistration = function(url) {\n // Show the external registration page in an iframe.\n $(SELECTORS.EXTERNAL_REGISTRATION_PAGE_CONTAINER).removeClass('hidden');\n var container = $(SELECTORS.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER);\n container.append($(\"\"));\n showExternalRegistration();\n window.addEventListener(\"message\", closeLTIAdvRegistration, false);\n };\n\n /**\n * Get the tool type URL.\n *\n * @method getToolURL\n * @private\n * @return {String} the tool type url\n */\n var getToolURL = function() {\n return $(SELECTORS.TOOL_URL).val();\n };\n\n /**\n * Hide the external registration container.\n *\n * @method hideExternalRegistration\n * @private\n */\n var hideExternalRegistration = function() {\n getExternalRegistrationContainer().addClass('hidden');\n };\n\n /**\n * Hide the cartridge registration container.\n *\n * @method hideCartridgeRegistration\n * @private\n */\n var hideCartridgeRegistration = function() {\n getCartridgeRegistrationContainer().addClass('hidden');\n };\n\n /**\n * Hide the registration choice container.\n *\n * @method hideRegistrationChoices\n * @private\n */\n var hideRegistrationChoices = function() {\n getRegistrationChoiceContainer().addClass('hidden');\n };\n\n /**\n * Display the external registration panel and hides the other\n * panels.\n *\n * @method showExternalRegistration\n * @private\n */\n var showExternalRegistration = function() {\n hideCartridgeRegistration();\n hideRegistrationChoices();\n getExternalRegistrationContainer().removeClass('hidden');\n screenReaderAnnounce(getExternalRegistrationContainer());\n };\n\n /**\n * Display the cartridge registration panel and hides the other\n * panels.\n *\n * @method showCartridgeRegistration\n * @param {String} url\n * @private\n */\n var showCartridgeRegistration = function(url) {\n hideExternalRegistration();\n hideRegistrationChoices();\n // Don't save the key and secret from the last tool.\n var container = getCartridgeRegistrationContainer();\n container.find('input').val('');\n container.removeClass('hidden');\n container.find(SELECTORS.CARTRIDGE_REGISTRATION_FORM).attr('data-cartridge-url', url);\n screenReaderAnnounce(container);\n };\n\n /**\n * Display the registration choices panel and hides the other\n * panels.\n *\n * @method showRegistrationChoices\n * @private\n */\n var showRegistrationChoices = function() {\n hideExternalRegistration();\n hideCartridgeRegistration();\n getRegistrationChoiceContainer().removeClass('hidden');\n screenReaderAnnounce(getRegistrationChoiceContainer());\n };\n\n /**\n * JAWS does not notice visibility changes with aria-live.\n * Remove and add the content back to force it to read it out.\n * This function can be removed once JAWS supports visibility.\n *\n * @method screenReaderAnnounce\n * @param {Object} element\n * @private\n */\n var screenReaderAnnounce = function(element) {\n var children = element.children().detach();\n children.appendTo(element);\n };\n\n /**\n * Hides the list of tool types.\n *\n * @method hideToolList\n * @private\n */\n var hideToolList = function() {\n getToolListContainer().addClass('hidden');\n };\n\n /**\n * Display the list of tool types.\n *\n * @method hideToolList\n * @private\n */\n var showToolList = function() {\n getToolListContainer().removeClass('hidden');\n };\n\n /**\n * Display the registration feedback alert and hide the other panels.\n *\n * @method showRegistrationFeedback\n * @param {Object} data\n * @private\n */\n var showRegistrationFeedback = function(data) {\n var type = data.error ? 'error' : 'success';\n notification.addNotification({\n message: data.message,\n type: type\n });\n };\n\n /**\n * Show the loading animation\n *\n * @method startLoading\n * @private\n * @param {Object} element jQuery object\n */\n var startLoading = function(element) {\n element.addClass(\"loading\");\n };\n\n /**\n * Hide the loading animation\n *\n * @method stopLoading\n * @private\n * @param {Object} element jQuery object\n */\n var stopLoading = function(element) {\n element.removeClass(\"loading\");\n };\n\n /**\n * Refresh the list of tool types and render the new ones.\n *\n * @method reloadToolList\n * @private\n */\n var reloadToolList = function() {\n var promise = $.Deferred();\n var container = getToolListContainer();\n startLoading(container);\n\n $.when(\n toolType.query(),\n toolProxy.query({'orphanedonly': true})\n )\n .done(function(types, proxies) {\n templates.render('mod_lti/tool_list', {tools: types, proxies: proxies})\n .done(function(html, js) {\n container.empty();\n container.append(html);\n templates.runTemplateJS(js);\n promise.resolve();\n }).fail(promise.reject);\n })\n .fail(promise.reject);\n\n promise.fail(notification.exception)\n .always(function() {\n stopLoading(container);\n });\n };\n\n /**\n * Start the LTI Advantage registration.\n *\n * @method addLTIAdvTool\n * @private\n */\n var addLTIAdvTool = function() {\n var url = getToolURL().trim();\n\n if (url) {\n $(SELECTORS.TOOL_URL).val('');\n hideToolList();\n initiateRegistration(url);\n }\n\n };\n\n /**\n * Trigger appropriate registration process process for the user input\n * URL. It can either be a cartridge or a registration url.\n *\n * @method addLTILegacyTool\n * @private\n * @return {Promise} jQuery Deferred object\n */\n var addLTILegacyTool = function() {\n var url = getToolURL().trim();\n\n if (url === \"\") {\n return $.Deferred().resolve();\n }\n var toolButton = $(SELECTORS.TOOL_CREATE_LTILEGACY_BUTTON);\n startLoading(toolButton);\n\n var promise = toolType.isCartridge(url);\n\n promise.always(function() {\n stopLoading(toolButton);\n });\n\n promise.done(function(result) {\n if (result.iscartridge) {\n $(SELECTORS.TOOL_URL).val('');\n $(document).trigger(ltiEvents.START_CARTRIDGE_REGISTRATION, url);\n } else {\n $(document).trigger(ltiEvents.START_EXTERNAL_REGISTRATION, {url: url});\n }\n });\n\n promise.fail(function() {\n str.get_string('errorbadurl', 'mod_lti')\n .done(function(s) {\n $(document).trigger(ltiEvents.REGISTRATION_FEEDBACK, {\n message: s,\n error: true\n });\n })\n .fail(notification.exception);\n });\n\n return promise;\n };\n\n /**\n * Sets up the listeners for user interaction on the page.\n *\n * @method registerEventListeners\n * @private\n */\n var registerEventListeners = function() {\n\n // These are events fired by the registration processes. Either\n // the cartridge registration or the external registration url.\n $(document).on(ltiEvents.NEW_TOOL_TYPE, function() {\n reloadToolList();\n });\n\n $(document).on(ltiEvents.START_EXTERNAL_REGISTRATION, function() {\n showExternalRegistration();\n $(SELECTORS.TOOL_URL).val('');\n hideToolList();\n });\n\n $(document).on(ltiEvents.STOP_EXTERNAL_REGISTRATION, function() {\n showToolList();\n showRegistrationChoices();\n });\n\n $(document).on(ltiEvents.START_CARTRIDGE_REGISTRATION, function(event, url) {\n showCartridgeRegistration(url);\n });\n\n $(document).on(ltiEvents.STOP_CARTRIDGE_REGISTRATION, function() {\n getCartridgeRegistrationContainer().find(SELECTORS.CARTRIDGE_REGISTRATION_FORM).removeAttr('data-cartridge-url');\n showRegistrationChoices();\n });\n\n $(document).on(ltiEvents.REGISTRATION_FEEDBACK, function(event, data) {\n showRegistrationFeedback(data);\n });\n\n var addLegacyButton = $(SELECTORS.TOOL_CREATE_LTILEGACY_BUTTON);\n addLegacyButton.click(function(e) {\n e.preventDefault();\n addLTILegacyTool();\n });\n\n var addLTIButton = $(SELECTORS.TOOL_CREATE_BUTTON);\n addLTIButton.click(function(e) {\n e.preventDefault();\n addLTIAdvTool();\n });\n\n };\n\n return /** @alias module:mod_lti/cartridge_registration_form */ {\n\n /**\n * Initialise this module.\n */\n init: function() {\n registerEventListeners();\n reloadToolList();\n }\n };\n});\n"],"file":"tool_configure_controller.min.js"} \ No newline at end of file diff --git a/mod/lti/amd/build/tool_proxy.min.js.map b/mod/lti/amd/build/tool_proxy.min.js.map index 6a28a118d941c..c91340d18cf82 100644 --- a/mod/lti/amd/build/tool_proxy.min.js.map +++ b/mod/lti/amd/build/tool_proxy.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/tool_proxy.js"],"names":["define","ajax","notification","query","args","promise","call","methodname","fail","exception","id","create"],"mappings":"AAwBAA,OAAM,sBAAC,CAAC,WAAD,CAAc,mBAAd,CAAD,CAAqC,SAASC,CAAT,CAAeC,CAAf,CAA6B,CACpE,MAA+C,CAa3CC,KAAK,CAAE,eAASC,CAAT,CAAe,IAMdC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,0BADF,CAEVH,IAAI,CAAEA,CAAI,EAAI,EAFJ,CAKU,CAAV,EAAqB,CAArB,CANI,CAQlBC,CAAO,CAACG,IAAR,CAAaN,CAAY,CAACO,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAxB0C,CAiC3C,OAAU,iBAASK,CAAT,CAAa,IAQfL,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CAPV,CACVC,UAAU,CAAE,2BADF,CAEVH,IAAI,CAAE,CACFM,EAAE,CAAEA,CADF,CAFI,CAOU,CAAV,EAAqB,CAArB,CARK,CAUnBL,CAAO,CAACG,IAAR,CAAaN,CAAY,CAACO,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CA9C0C,CA4D3CM,MAAM,CAAE,gBAASP,CAAT,CAAe,IAMfC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,2BADF,CAEVH,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CANK,CAQnB,MAAOC,CAAAA,CACV,CArE0C,CAuElD,CAxEK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Provides an interface for a tool proxy in the Moodle server.\n *\n * @module mod_lti/tool_proxy\n * @class tool_proxy\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['core/ajax', 'core/notification'], function(ajax, notification) {\n return /** @alias module:mod_lti/tool_proxy */ {\n /**\n * Get a list of tool types from Moodle for the given\n * search args.\n *\n * See also:\n * mod/lti/classes/external.php get_tool_types_parameters()\n *\n * @method query\n * @public\n * @param {Object} args Search parameters\n * @return {Promise} jQuery Deferred object\n */\n query: function(args) {\n var request = {\n methodname: 'mod_lti_get_tool_proxies',\n args: args || {}\n };\n\n var promise = ajax.call([request])[0];\n\n promise.fail(notification.exception);\n\n return promise;\n },\n /**\n * Delete a tool proxy from Moodle.\n *\n * @method delete\n * @public\n * @param {Integer} id Tool proxy ID\n * @return {Promise} jQuery Deferred object\n */\n 'delete': function(id) {\n var request = {\n methodname: 'mod_lti_delete_tool_proxy',\n args: {\n id: id\n }\n };\n\n var promise = ajax.call([request])[0];\n\n promise.fail(notification.exception);\n\n return promise;\n },\n\n /**\n * Create a tool proxy in Moodle.\n *\n * The promise will fail if the proxy cannot be created, so you must handle the fail result.\n *\n * See mod/lti/classes/external.php create_tool_proxy_parameters\n *\n * @method create\n * @public\n * @param {Object} args Tool proxy properties\n * @return {Promise} jQuery Deferred object\n */\n create: function(args) {\n var request = {\n methodname: 'mod_lti_create_tool_proxy',\n args: args\n };\n\n var promise = ajax.call([request])[0];\n\n return promise;\n }\n };\n});\n"],"file":"tool_proxy.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/tool_proxy.js"],"names":["define","ajax","notification","query","args","promise","call","methodname","fail","exception","id","create"],"mappings":"AAuBAA,OAAM,sBAAC,CAAC,WAAD,CAAc,mBAAd,CAAD,CAAqC,SAASC,CAAT,CAAeC,CAAf,CAA6B,CACpE,MAAO,CAaHC,KAAK,CAAE,eAASC,CAAT,CAAe,IAMdC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,0BADF,CAEVH,IAAI,CAAEA,CAAI,EAAI,EAFJ,CAKU,CAAV,EAAqB,CAArB,CANI,CAQlBC,CAAO,CAACG,IAAR,CAAaN,CAAY,CAACO,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAxBE,CAiCH,OAAU,iBAASK,CAAT,CAAa,IAQfL,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CAPV,CACVC,UAAU,CAAE,2BADF,CAEVH,IAAI,CAAE,CACFM,EAAE,CAAEA,CADF,CAFI,CAOU,CAAV,EAAqB,CAArB,CARK,CAUnBL,CAAO,CAACG,IAAR,CAAaN,CAAY,CAACO,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CA9CE,CA4DHM,MAAM,CAAE,gBAASP,CAAT,CAAe,IAMfC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,2BADF,CAEVH,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CANK,CAQnB,MAAOC,CAAAA,CACV,CArEE,CAuEV,CAxEK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Provides an interface for a tool proxy in the Moodle server.\n *\n * @module mod_lti/tool_proxy\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['core/ajax', 'core/notification'], function(ajax, notification) {\n return {\n /**\n * Get a list of tool types from Moodle for the given\n * search args.\n *\n * See also:\n * mod/lti/classes/external.php get_tool_types_parameters()\n *\n * @method query\n * @public\n * @param {Object} args Search parameters\n * @return {Promise} jQuery Deferred object\n */\n query: function(args) {\n var request = {\n methodname: 'mod_lti_get_tool_proxies',\n args: args || {}\n };\n\n var promise = ajax.call([request])[0];\n\n promise.fail(notification.exception);\n\n return promise;\n },\n /**\n * Delete a tool proxy from Moodle.\n *\n * @method delete\n * @public\n * @param {Integer} id Tool proxy ID\n * @return {Promise} jQuery Deferred object\n */\n 'delete': function(id) {\n var request = {\n methodname: 'mod_lti_delete_tool_proxy',\n args: {\n id: id\n }\n };\n\n var promise = ajax.call([request])[0];\n\n promise.fail(notification.exception);\n\n return promise;\n },\n\n /**\n * Create a tool proxy in Moodle.\n *\n * The promise will fail if the proxy cannot be created, so you must handle the fail result.\n *\n * See mod/lti/classes/external.php create_tool_proxy_parameters\n *\n * @method create\n * @public\n * @param {Object} args Tool proxy properties\n * @return {Promise} jQuery Deferred object\n */\n create: function(args) {\n var request = {\n methodname: 'mod_lti_create_tool_proxy',\n args: args\n };\n\n var promise = ajax.call([request])[0];\n\n return promise;\n }\n };\n});\n"],"file":"tool_proxy.min.js"} \ No newline at end of file diff --git a/mod/lti/amd/build/tool_proxy_card_controller.min.js.map b/mod/lti/amd/build/tool_proxy_card_controller.min.js.map index ce8eded398189..ca8052257a062 100644 --- a/mod/lti/amd/build/tool_proxy_card_controller.min.js.map +++ b/mod/lti/amd/build/tool_proxy_card_controller.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/tool_proxy_card_controller.js"],"names":["define","$","ajax","notification","templates","toolProxy","ltiEvents","KEYS","str","SELECTORS","DELETE_BUTTON","CAPABILITIES_CONTAINER","ACTIVATE_BUTTON","ANNOUNCEMENT_TIMEOUT","getDeleteButton","element","find","getActivateButton","getTypeId","attr","clearAllAnnouncements","removeClass","startLoading","addClass","stopLoading","announceSuccess","promise","Deferred","setTimeout","resolve","announceFailure","deleteType","typeId","get_strings","key","component","done","strs","confirm","delete","remove","fail","exception","error","reject","activateToolType","data","proxyid","document","trigger","START_EXTERNAL_REGISTRATION","registerEventListeners","deleteButton","click","e","preventDefault","keypress","metaKey","shiftKey","altKey","ctrlKey","keyCode","ENTER","SPACE","activateButton","init"],"mappings":"AA2BAA,OAAM,sCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAA6C,gBAA7C,CAA+D,oBAA/D,CAAqF,gBAArF,C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A0C,CAACL,CAAC,CAACM,OAAjD,CAA0D,CACtD,GAAIN,CAAC,CAACO,OAAF,EAAatD,CAAI,CAACuD,KAAlB,EAA2BR,CAAC,CAACO,OAAF,EAAatD,CAAI,CAACwD,KAAjD,CAAwD,CACpDT,CAAC,CAACC,cAAF,GACAH,CAAY,CAACC,KAAb,EACH,CACJ,CACJ,CAPL,EASA,GAAIW,CAAAA,CAAc,CAAG/C,CAAiB,CAACF,CAAD,CAAtC,CACAiD,CAAc,CAACX,KAAf,CAAqB,SAASC,CAAT,CAAY,CACzBA,CAAC,CAACC,cAAF,GACAV,CAAgB,CAAC9B,CAAD,CACnB,CAHL,EAIAiD,CAAc,CAACR,QAAf,CAAwB,SAASF,CAAT,CAAY,CAC5B,GAAI,CAACA,CAAC,CAACG,OAAH,EAAc,CAACH,CAAC,CAACI,QAAjB,EAA6B,CAACJ,CAAC,CAACK,MAAhC,EAA0C,CAACL,CAAC,CAACM,OAAjD,CAA0D,CACtD,GAAIN,CAAC,CAACO,OAAF,EAAatD,CAAI,CAACuD,KAAlB,EAA2BR,CAAC,CAACO,OAAF,EAAatD,CAAI,CAACwD,KAAjD,CAAwD,CACpDT,CAAC,CAACC,cAAF,GACAS,CAAc,CAACX,KAAf,EACH,CACJ,CACJ,CAPL,CAQH,CAhP+E,CAkPhF,MAAyD,CAOrDY,IAAI,CAAE,cAASlD,CAAT,CAAkB,CACpBoC,CAAsB,CAACpC,CAAD,CACzB,CAToD,CAW5D,CA/PK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls all of the behaviour and interaction with a tool type card. These are\n * listed on the LTI tool type management page.\n *\n * See template: mod_lti/tool_proxy_card\n *\n * @module mod_lti/tool_proxy_card_controller\n * @class tool_card_controller\n * @copyright 2016 John Okely \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/tool_proxy', 'mod_lti/events', 'mod_lti/keys',\n 'core/str'],\n function($, ajax, notification, templates, toolProxy, ltiEvents, KEYS, str) {\n\n var SELECTORS = {\n DELETE_BUTTON: '.delete',\n CAPABILITIES_CONTAINER: '.capabilities-container',\n ACTIVATE_BUTTON: '.tool-card-footer a.activate',\n };\n\n // Timeout in seconds.\n var ANNOUNCEMENT_TIMEOUT = 2000;\n\n /**\n * Return the delete button element.\n *\n * @method getDeleteButton\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {JQuery} jQuery object\n */\n var getDeleteButton = function(element) {\n return element.find(SELECTORS.DELETE_BUTTON);\n };\n\n /**\n * Return the activate button for the type.\n *\n * @method getActivateButton\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {JQuery} jQuery object\n */\n var getActivateButton = function(element) {\n return element.find(SELECTORS.ACTIVATE_BUTTON);\n };\n\n /**\n * Get the type id.\n *\n * @method getTypeId\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {String} Type ID\n */\n var getTypeId = function(element) {\n return element.attr('data-proxy-id');\n };\n\n /**\n * Stop any announcement currently visible on the card.\n *\n * @method clearAllAnnouncements\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var clearAllAnnouncements = function(element) {\n element.removeClass('announcement loading success fail capabilities');\n };\n\n /**\n * Show the loading announcement.\n *\n * @method startLoading\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var startLoading = function(element) {\n clearAllAnnouncements(element);\n element.addClass('announcement loading');\n };\n\n /**\n * Hide the loading announcement.\n *\n * @method stopLoading\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var stopLoading = function(element) {\n element.removeClass('announcement loading');\n };\n\n /**\n * Show the success announcement. The announcement is only\n * visible for 2 seconds.\n *\n * @method announceSuccess\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var announceSuccess = function(element) {\n var promise = $.Deferred();\n\n clearAllAnnouncements(element);\n element.addClass('announcement success');\n setTimeout(function() {\n element.removeClass('announcement success');\n promise.resolve();\n }, ANNOUNCEMENT_TIMEOUT);\n\n return promise;\n };\n\n /**\n * Show the failure announcement. The announcement is only\n * visible for 2 seconds.\n *\n * @method announceFailure\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var announceFailure = function(element) {\n var promise = $.Deferred();\n\n clearAllAnnouncements(element);\n element.addClass('announcement fail');\n setTimeout(function() {\n element.removeClass('announcement fail');\n promise.resolve();\n }, ANNOUNCEMENT_TIMEOUT);\n\n return promise;\n };\n\n /**\n * Delete the tool type from the Moodle server. Triggers a success\n * or failure announcement depending on the result.\n *\n * @method deleteType\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var deleteType = function(element) {\n var promise = $.Deferred();\n var typeId = getTypeId(element);\n startLoading(element);\n\n if (typeId === \"\") {\n return $.Deferred().resolve();\n }\n\n str.get_strings([\n {\n key: 'delete',\n component: 'mod_lti'\n },\n {\n key: 'delete_confirmation',\n component: 'mod_lti'\n },\n {\n key: 'delete',\n component: 'mod_lti'\n },\n {\n key: 'cancel',\n component: 'core'\n },\n ])\n .done(function(strs) {\n notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {\n toolProxy.delete(typeId)\n .done(function() {\n stopLoading(element);\n announceSuccess(element)\n .done(function() {\n element.remove();\n promise.resolve();\n })\n .fail(notification.exception);\n })\n .fail(function(error) {\n announceFailure(element);\n promise.reject(error);\n });\n }, function() {\n stopLoading(element);\n promise.resolve();\n });\n })\n .fail(function(error) {\n stopLoading(element);\n notification.exception(error);\n promise.reject(error);\n });\n\n return promise;\n };\n\n /**\n * The user wishes to activate this tool so show them the capabilities that\n * they need to agree to or if there are none then set the tool type's state\n * to active.\n *\n * @method activateToolType\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var activateToolType = function(element) {\n var data = {proxyid: getTypeId(element)};\n $(document).trigger(ltiEvents.START_EXTERNAL_REGISTRATION, data);\n };\n\n /**\n * Sets up the listeners for user interaction on this tool type card.\n *\n * @method registerEventListeners\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var registerEventListeners = function(element) {\n var deleteButton = getDeleteButton(element);\n deleteButton.click(function(e) {\n e.preventDefault();\n deleteType(element);\n });\n deleteButton.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER || e.keyCode == KEYS.SPACE) {\n e.preventDefault();\n deleteButton.click();\n }\n }\n });\n\n var activateButton = getActivateButton(element);\n activateButton.click(function(e) {\n e.preventDefault();\n activateToolType(element);\n });\n activateButton.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER || e.keyCode == KEYS.SPACE) {\n e.preventDefault();\n activateButton.click();\n }\n }\n });\n };\n\n return /** @alias module:mod_lti/tool_card_controller */ {\n\n /**\n * Initialise this module.\n *\n * @param {JQuery} element jQuery object representing the tool card.\n */\n init: function(element) {\n registerEventListeners(element);\n }\n };\n});\n"],"file":"tool_proxy_card_controller.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/tool_proxy_card_controller.js"],"names":["define","$","ajax","notification","templates","toolProxy","ltiEvents","KEYS","str","SELECTORS","DELETE_BUTTON","CAPABILITIES_CONTAINER","ACTIVATE_BUTTON","ANNOUNCEMENT_TIMEOUT","getDeleteButton","element","find","getActivateButton","getTypeId","attr","clearAllAnnouncements","removeClass","startLoading","addClass","stopLoading","announceSuccess","promise","Deferred","setTimeout","resolve","announceFailure","deleteType","typeId","get_strings","key","component","done","strs","confirm","delete","remove","fail","exception","error","reject","activateToolType","data","proxyid","document","trigger","START_EXTERNAL_REGISTRATION","registerEventListeners","deleteButton","click","e","preventDefault","keypress","metaKey","shiftKey","altKey","ctrlKey","keyCode","ENTER","SPACE","activateButton","init"],"mappings":"AA0BAA,OAAM,sCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAA6C,gBAA7C,CAA+D,oBAA/D,CAAqF,gBAArF,CAAuG,cAAvG,CACC,UADD,CAAD,CAEE,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAsDC,CAAtD,CAAiEC,CAAjE,CAAuEC,CAAvE,CAA4E,IAE5EC,CAAAA,CAAS,CAAG,CACZC,aAAa,CAAE,SADH,CAEZC,sBAAsB,CAAE,yBAFZ,CAGZC,eAAe,CAAE,8BAHL,CAFgE,CAS5EC,CAAoB,CAAG,GATqD,CAmB5EC,CAAe,CAAG,SAASC,CAAT,CAAkB,CACpC,MAAOA,CAAAA,CAAO,CAACC,IAAR,CAAaP,CAAS,CAACC,aAAvB,CACV,CArB+E,CA+B5EO,CAAiB,CAAG,SAASF,CAAT,CAAkB,CACtC,MAAOA,CAAAA,CAAO,CAACC,IAAR,CAAaP,CAAS,CAACG,eAAvB,CACV,CAjC+E,CA2C5EM,CAAS,CAAG,SAASH,CAAT,CAAkB,CAC9B,MAAOA,CAAAA,CAAO,CAACI,IAAR,CAAa,eAAb,CACV,CA7C+E,CAsD5EC,CAAqB,CAAG,SAASL,CAAT,CAAkB,CAC1CA,CAAO,CAACM,WAAR,CAAoB,gDAApB,CACH,CAxD+E,CAiE5EC,CAAY,CAAG,SAASP,CAAT,CAAkB,CACjCK,CAAqB,CAACL,CAAD,CAArB,CACAA,CAAO,CAACQ,QAAR,CAAiB,sBAAjB,CACH,CApE+E,CA6E5EC,CAAW,CAAG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CACzB,CAToD,CAW5D,CA/PK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls all of the behaviour and interaction with a tool type card. These are\n * listed on the LTI tool type management page.\n *\n * See template: mod_lti/tool_proxy_card\n *\n * @module mod_lti/tool_proxy_card_controller\n * @copyright 2016 John Okely \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/tool_proxy', 'mod_lti/events', 'mod_lti/keys',\n 'core/str'],\n function($, ajax, notification, templates, toolProxy, ltiEvents, KEYS, str) {\n\n var SELECTORS = {\n DELETE_BUTTON: '.delete',\n CAPABILITIES_CONTAINER: '.capabilities-container',\n ACTIVATE_BUTTON: '.tool-card-footer a.activate',\n };\n\n // Timeout in seconds.\n var ANNOUNCEMENT_TIMEOUT = 2000;\n\n /**\n * Return the delete button element.\n *\n * @method getDeleteButton\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {JQuery} jQuery object\n */\n var getDeleteButton = function(element) {\n return element.find(SELECTORS.DELETE_BUTTON);\n };\n\n /**\n * Return the activate button for the type.\n *\n * @method getActivateButton\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {JQuery} jQuery object\n */\n var getActivateButton = function(element) {\n return element.find(SELECTORS.ACTIVATE_BUTTON);\n };\n\n /**\n * Get the type id.\n *\n * @method getTypeId\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {String} Type ID\n */\n var getTypeId = function(element) {\n return element.attr('data-proxy-id');\n };\n\n /**\n * Stop any announcement currently visible on the card.\n *\n * @method clearAllAnnouncements\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var clearAllAnnouncements = function(element) {\n element.removeClass('announcement loading success fail capabilities');\n };\n\n /**\n * Show the loading announcement.\n *\n * @method startLoading\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var startLoading = function(element) {\n clearAllAnnouncements(element);\n element.addClass('announcement loading');\n };\n\n /**\n * Hide the loading announcement.\n *\n * @method stopLoading\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var stopLoading = function(element) {\n element.removeClass('announcement loading');\n };\n\n /**\n * Show the success announcement. The announcement is only\n * visible for 2 seconds.\n *\n * @method announceSuccess\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var announceSuccess = function(element) {\n var promise = $.Deferred();\n\n clearAllAnnouncements(element);\n element.addClass('announcement success');\n setTimeout(function() {\n element.removeClass('announcement success');\n promise.resolve();\n }, ANNOUNCEMENT_TIMEOUT);\n\n return promise;\n };\n\n /**\n * Show the failure announcement. The announcement is only\n * visible for 2 seconds.\n *\n * @method announceFailure\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var announceFailure = function(element) {\n var promise = $.Deferred();\n\n clearAllAnnouncements(element);\n element.addClass('announcement fail');\n setTimeout(function() {\n element.removeClass('announcement fail');\n promise.resolve();\n }, ANNOUNCEMENT_TIMEOUT);\n\n return promise;\n };\n\n /**\n * Delete the tool type from the Moodle server. Triggers a success\n * or failure announcement depending on the result.\n *\n * @method deleteType\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n * @return {Promise} jQuery Deferred object\n */\n var deleteType = function(element) {\n var promise = $.Deferred();\n var typeId = getTypeId(element);\n startLoading(element);\n\n if (typeId === \"\") {\n return $.Deferred().resolve();\n }\n\n str.get_strings([\n {\n key: 'delete',\n component: 'mod_lti'\n },\n {\n key: 'delete_confirmation',\n component: 'mod_lti'\n },\n {\n key: 'delete',\n component: 'mod_lti'\n },\n {\n key: 'cancel',\n component: 'core'\n },\n ])\n .done(function(strs) {\n notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {\n toolProxy.delete(typeId)\n .done(function() {\n stopLoading(element);\n announceSuccess(element)\n .done(function() {\n element.remove();\n promise.resolve();\n })\n .fail(notification.exception);\n })\n .fail(function(error) {\n announceFailure(element);\n promise.reject(error);\n });\n }, function() {\n stopLoading(element);\n promise.resolve();\n });\n })\n .fail(function(error) {\n stopLoading(element);\n notification.exception(error);\n promise.reject(error);\n });\n\n return promise;\n };\n\n /**\n * The user wishes to activate this tool so show them the capabilities that\n * they need to agree to or if there are none then set the tool type's state\n * to active.\n *\n * @method activateToolType\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var activateToolType = function(element) {\n var data = {proxyid: getTypeId(element)};\n $(document).trigger(ltiEvents.START_EXTERNAL_REGISTRATION, data);\n };\n\n /**\n * Sets up the listeners for user interaction on this tool type card.\n *\n * @method registerEventListeners\n * @private\n * @param {JQuery} element jQuery object representing the tool card.\n */\n var registerEventListeners = function(element) {\n var deleteButton = getDeleteButton(element);\n deleteButton.click(function(e) {\n e.preventDefault();\n deleteType(element);\n });\n deleteButton.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER || e.keyCode == KEYS.SPACE) {\n e.preventDefault();\n deleteButton.click();\n }\n }\n });\n\n var activateButton = getActivateButton(element);\n activateButton.click(function(e) {\n e.preventDefault();\n activateToolType(element);\n });\n activateButton.keypress(function(e) {\n if (!e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {\n if (e.keyCode == KEYS.ENTER || e.keyCode == KEYS.SPACE) {\n e.preventDefault();\n activateButton.click();\n }\n }\n });\n };\n\n return /** @alias module:mod_lti/tool_card_controller */ {\n\n /**\n * Initialise this module.\n *\n * @param {JQuery} element jQuery object representing the tool card.\n */\n init: function(element) {\n registerEventListeners(element);\n }\n };\n});\n"],"file":"tool_proxy_card_controller.min.js"} \ No newline at end of file diff --git a/mod/lti/amd/build/tool_type.min.js.map b/mod/lti/amd/build/tool_type.min.js.map index 6dfc2aff4abfc..1abae83583b8b 100644 --- a/mod/lti/amd/build/tool_type.min.js.map +++ b/mod/lti/amd/build/tool_type.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/tool_type.js"],"names":["define","ajax","notification","query","args","promise","call","methodname","fail","exception","create","update","id","getFromToolProxyId","toolproxyid","isCartridge","url","constants","state","configured","pending","rejected"],"mappings":"AAwBAA,OAAM,qBAAC,CAAC,WAAD,CAAc,mBAAd,CAAD,CAAqC,SAASC,CAAT,CAAeC,CAAf,CAA6B,CACpE,MAA8C,CAa1CC,KAAK,CAAE,eAASC,CAAT,CAAe,IAMdC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,wBADF,CAEVH,IAAI,CAAEA,CAAI,EAAI,EAFJ,CAKU,CAAV,EAAqB,CAArB,CANI,CAQlBC,CAAO,CAACG,IAAR,CAAaN,CAAY,CAACO,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAxByC,CAuC1CK,MAAM,CAAE,gBAASN,CAAT,CAAe,IAMfC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,0BADF,CAEVH,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CANK,CAQnB,MAAOC,CAAAA,CACV,CAhDyC,CA6D1CM,MAAM,CAAE,gBAASP,CAAT,CAAe,IAMfC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,0BADF,CAEVH,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CANK,CAQnBC,CAAO,CAACG,IAAR,CAAaN,CAAY,CAACO,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAxEyC,CAkF1C,OAAU,iBAASO,CAAT,CAAa,IAQfP,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CAPV,CACVC,UAAU,CAAE,0BADF,CAEVH,IAAI,CAAE,CACFQ,EAAE,CAAEA,CADF,CAFI,CAOU,CAAV,EAAqB,CAArB,CARK,CAUnBP,CAAO,CAACG,IAAR,CAAaN,CAAY,CAACO,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CA/FyC,CA0G1CQ,kBAAkB,CAAE,4BAASD,CAAT,CAAa,CAC7B,MAAO,MAAKT,KAAL,CAAW,CAACW,WAAW,CAAEF,CAAd,CAAX,CACV,CA5GyC,CAwH1CG,WAAW,CAAE,qBAASC,CAAT,CAAc,IAQnBX,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CAPV,CACVC,UAAU,CAAE,sBADF,CAEVH,IAAI,CAAE,CACFY,GAAG,CAAEA,CADH,CAFI,CAOU,CAAV,EAAqB,CAArB,CARS,CAUvB,MAAOX,CAAAA,CACV,CAnIyC,CAwI1CY,SAAS,CAAE,CACPC,KAAK,CAAE,CACHC,UAAU,CAAE,CADT,CAEHC,OAAO,CAAE,CAFN,CAGHC,QAAQ,CAAE,CAHP,CADA,CAxI+B,CAgJjD,CAjJK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Provides an interface for a tool type in the Moodle server.\n *\n * @module mod_lti/tool_type\n * @class tool_type\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['core/ajax', 'core/notification'], function(ajax, notification) {\n return /** @alias module:mod_lti/tool_type */ {\n /**\n * Get a list of tool types from Moodle for the given\n * search args.\n *\n * See also:\n * mod/lti/classes/external.php get_tool_types_parameters()\n *\n * @method query\n * @public\n * @param {Object} args Search parameters\n * @return {Promise} jQuery Deferred object\n */\n query: function(args) {\n var request = {\n methodname: 'mod_lti_get_tool_types',\n args: args || {}\n };\n\n var promise = ajax.call([request])[0];\n\n promise.fail(notification.exception);\n\n return promise;\n },\n\n /**\n * Create a tool type in Moodle.\n *\n * The promise will fail if the URL is not a cartridge, so you must handle the fail result.\n *\n * See also:\n * mod/lti/classes/external.php create_tool_type_parameters()\n *\n * @method create\n * @public\n * @param {Object} args Tool type properties\n * @return {Promise} jQuery Deferred object\n */\n create: function(args) {\n var request = {\n methodname: 'mod_lti_create_tool_type',\n args: args\n };\n\n var promise = ajax.call([request])[0];\n\n return promise;\n },\n\n /**\n * Update a tool type in Moodle.\n *\n * See also:\n * mod/lti/classes/external.php update_tool_type_parameters()\n *\n * @method update\n * @public\n * @param {Object} args Tool type properties\n * @return {Promise} jQuery Deferred object\n */\n update: function(args) {\n var request = {\n methodname: 'mod_lti_update_tool_type',\n args: args\n };\n\n var promise = ajax.call([request])[0];\n\n promise.fail(notification.exception);\n\n return promise;\n },\n\n /**\n * Delete a tool type from Moodle.\n *\n * @method delete\n * @public\n * @param {Integer} id Tool type ID\n * @return {Promise} jQuery Deferred object\n */\n 'delete': function(id) {\n var request = {\n methodname: 'mod_lti_delete_tool_type',\n args: {\n id: id\n }\n };\n\n var promise = ajax.call([request])[0];\n\n promise.fail(notification.exception);\n\n return promise;\n },\n\n /**\n * Get a list of tool types from Moodle for the given\n * tool proxy id.\n *\n * @method query\n * @public\n * @param {Integer} id Tool type ID\n * @return {Promise} jQuery Deferred object\n */\n getFromToolProxyId: function(id) {\n return this.query({toolproxyid: id});\n },\n\n /**\n * Check if the given URL is a cartridge URL.\n *\n * The promise will fail if the URL is unreachable, so you must handle the fail result.\n *\n * @method isCartridge\n * @public\n * @param {String} url\n * @return {Promise} jQuery Deferred object\n */\n isCartridge: function(url) {\n var request = {\n methodname: 'mod_lti_is_cartridge',\n args: {\n url: url\n }\n };\n\n var promise = ajax.call([request])[0];\n\n return promise;\n },\n\n /**\n * Tool type constants.\n */\n constants: {\n state: {\n configured: 1,\n pending: 2,\n rejected: 3\n },\n }\n };\n});\n"],"file":"tool_type.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/tool_type.js"],"names":["define","ajax","notification","query","args","promise","call","methodname","fail","exception","create","update","id","getFromToolProxyId","toolproxyid","isCartridge","url","constants","state","configured","pending","rejected"],"mappings":"AAuBAA,OAAM,qBAAC,CAAC,WAAD,CAAc,mBAAd,CAAD,CAAqC,SAASC,CAAT,CAAeC,CAAf,CAA6B,CACpE,MAAO,CAaHC,KAAK,CAAE,eAASC,CAAT,CAAe,IAMdC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,wBADF,CAEVH,IAAI,CAAEA,CAAI,EAAI,EAFJ,CAKU,CAAV,EAAqB,CAArB,CANI,CAQlBC,CAAO,CAACG,IAAR,CAAaN,CAAY,CAACO,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAxBE,CAuCHK,MAAM,CAAE,gBAASN,CAAT,CAAe,IAMfC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,0BADF,CAEVH,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CANK,CAQnB,MAAOC,CAAAA,CACV,CAhDE,CA6DHM,MAAM,CAAE,gBAASP,CAAT,CAAe,IAMfC,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,0BADF,CAEVH,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CANK,CAQnBC,CAAO,CAACG,IAAR,CAAaN,CAAY,CAACO,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAxEE,CAkFH,OAAU,iBAASO,CAAT,CAAa,IAQfP,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CAPV,CACVC,UAAU,CAAE,0BADF,CAEVH,IAAI,CAAE,CACFQ,EAAE,CAAEA,CADF,CAFI,CAOU,CAAV,EAAqB,CAArB,CARK,CAUnBP,CAAO,CAACG,IAAR,CAAaN,CAAY,CAACO,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CA/FE,CA0GHQ,kBAAkB,CAAE,4BAASD,CAAT,CAAa,CAC7B,MAAO,MAAKT,KAAL,CAAW,CAACW,WAAW,CAAEF,CAAd,CAAX,CACV,CA5GE,CAwHHG,WAAW,CAAE,qBAASC,CAAT,CAAc,IAQnBX,CAAAA,CAAO,CAAGJ,CAAI,CAACK,IAAL,CAAU,CAPV,CACVC,UAAU,CAAE,sBADF,CAEVH,IAAI,CAAE,CACFY,GAAG,CAAEA,CADH,CAFI,CAOU,CAAV,EAAqB,CAArB,CARS,CAUvB,MAAOX,CAAAA,CACV,CAnIE,CAwIHY,SAAS,CAAE,CACPC,KAAK,CAAE,CACHC,UAAU,CAAE,CADT,CAEHC,OAAO,CAAE,CAFN,CAGHC,QAAQ,CAAE,CAHP,CADA,CAxIR,CAgJV,CAjJK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Provides an interface for a tool type in the Moodle server.\n *\n * @module mod_lti/tool_type\n * @copyright 2015 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['core/ajax', 'core/notification'], function(ajax, notification) {\n return {\n /**\n * Get a list of tool types from Moodle for the given\n * search args.\n *\n * See also:\n * mod/lti/classes/external.php get_tool_types_parameters()\n *\n * @method query\n * @public\n * @param {Object} args Search parameters\n * @return {Promise} jQuery Deferred object\n */\n query: function(args) {\n var request = {\n methodname: 'mod_lti_get_tool_types',\n args: args || {}\n };\n\n var promise = ajax.call([request])[0];\n\n promise.fail(notification.exception);\n\n return promise;\n },\n\n /**\n * Create a tool type in Moodle.\n *\n * The promise will fail if the URL is not a cartridge, so you must handle the fail result.\n *\n * See also:\n * mod/lti/classes/external.php create_tool_type_parameters()\n *\n * @method create\n * @public\n * @param {Object} args Tool type properties\n * @return {Promise} jQuery Deferred object\n */\n create: function(args) {\n var request = {\n methodname: 'mod_lti_create_tool_type',\n args: args\n };\n\n var promise = ajax.call([request])[0];\n\n return promise;\n },\n\n /**\n * Update a tool type in Moodle.\n *\n * See also:\n * mod/lti/classes/external.php update_tool_type_parameters()\n *\n * @method update\n * @public\n * @param {Object} args Tool type properties\n * @return {Promise} jQuery Deferred object\n */\n update: function(args) {\n var request = {\n methodname: 'mod_lti_update_tool_type',\n args: args\n };\n\n var promise = ajax.call([request])[0];\n\n promise.fail(notification.exception);\n\n return promise;\n },\n\n /**\n * Delete a tool type from Moodle.\n *\n * @method delete\n * @public\n * @param {Integer} id Tool type ID\n * @return {Promise} jQuery Deferred object\n */\n 'delete': function(id) {\n var request = {\n methodname: 'mod_lti_delete_tool_type',\n args: {\n id: id\n }\n };\n\n var promise = ajax.call([request])[0];\n\n promise.fail(notification.exception);\n\n return promise;\n },\n\n /**\n * Get a list of tool types from Moodle for the given\n * tool proxy id.\n *\n * @method query\n * @public\n * @param {Integer} id Tool type ID\n * @return {Promise} jQuery Deferred object\n */\n getFromToolProxyId: function(id) {\n return this.query({toolproxyid: id});\n },\n\n /**\n * Check if the given URL is a cartridge URL.\n *\n * The promise will fail if the URL is unreachable, so you must handle the fail result.\n *\n * @method isCartridge\n * @public\n * @param {String} url\n * @return {Promise} jQuery Deferred object\n */\n isCartridge: function(url) {\n var request = {\n methodname: 'mod_lti_is_cartridge',\n args: {\n url: url\n }\n };\n\n var promise = ajax.call([request])[0];\n\n return promise;\n },\n\n /**\n * Tool type constants.\n */\n constants: {\n state: {\n configured: 1,\n pending: 2,\n rejected: 3\n },\n }\n };\n});\n"],"file":"tool_type.min.js"} \ No newline at end of file diff --git a/mod/lti/amd/src/cartridge_registration_form.js b/mod/lti/amd/src/cartridge_registration_form.js index 8840f0e8edc01..aa9f9e9e13e08 100644 --- a/mod/lti/amd/src/cartridge_registration_form.js +++ b/mod/lti/amd/src/cartridge_registration_form.js @@ -20,7 +20,6 @@ * See template: mod_lti/cartridge_registration_form * * @module mod_lti/cartridge_registration_form - * @class cartridge_registration_form * @copyright 2015 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 diff --git a/mod/lti/amd/src/contentitem.js b/mod/lti/amd/src/contentitem.js index 1c8cccc967888..53f524bb37de4 100644 --- a/mod/lti/amd/src/contentitem.js +++ b/mod/lti/amd/src/contentitem.js @@ -20,7 +20,6 @@ * See template: mod_lti/contentitem * * @module mod_lti/contentitem - * @class contentitem * @copyright 2016 Jun Pataleta * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.2 diff --git a/mod/lti/amd/src/contentitem_return.js b/mod/lti/amd/src/contentitem_return.js index 8b4da254c0918..988eede418bf2 100644 --- a/mod/lti/amd/src/contentitem_return.js +++ b/mod/lti/amd/src/contentitem_return.js @@ -17,7 +17,6 @@ * Processes the result of LTI tool creation from a Content-Item message type. * * @module mod_lti/contentitem_return - * @class contentitem_return * @copyright 2016 Jun Pataleta * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.2 diff --git a/mod/lti/amd/src/external_registration.js b/mod/lti/amd/src/external_registration.js index c58449d21c81f..fc52f4ae5bb84 100644 --- a/mod/lti/amd/src/external_registration.js +++ b/mod/lti/amd/src/external_registration.js @@ -23,7 +23,6 @@ * See template: mod_lti/external_registration * * @module mod_lti/external_registration - * @class external_registration * @copyright 2015 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 @@ -628,7 +627,7 @@ define(['jquery', 'core/ajax', 'core/notification', 'core/templates', 'mod_lti/e }; }; - return /** @alias module:mod_lti/external_registration */ { + return { /** * Initialise this module. diff --git a/mod/lti/amd/src/external_registration_return.js b/mod/lti/amd/src/external_registration_return.js index f9822acd032a8..a91a4c6b10e26 100644 --- a/mod/lti/amd/src/external_registration_return.js +++ b/mod/lti/amd/src/external_registration_return.js @@ -20,14 +20,12 @@ * See also: mod/lti/externalregistrationreturn.php * * @module mod_lti/external_registration_return - * @class external_registration_return * @copyright 2015 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 */ define([], function() { - - return /** @alias module:mod_lti/external_registration_return */ { + return { /** * If this was rendered in an iframe then trigger the external registration diff --git a/mod/lti/amd/src/form-field.js b/mod/lti/amd/src/form-field.js index 9030ddedb63e6..e723f784da015 100644 --- a/mod/lti/amd/src/form-field.js +++ b/mod/lti/amd/src/form-field.js @@ -17,7 +17,6 @@ * A module that enables the setting of form field values on the client side. * * @module mod_lti/form-field - * @class form-field * @copyright 2016 Jun Pataleta * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.2 diff --git a/mod/lti/amd/src/tool_card_controller.js b/mod/lti/amd/src/tool_card_controller.js index 3b4b29c348d84..2bbbfb56dd3e1 100644 --- a/mod/lti/amd/src/tool_card_controller.js +++ b/mod/lti/amd/src/tool_card_controller.js @@ -20,7 +20,6 @@ * See template: mod_lti/tool_card * * @module mod_lti/tool_card_controller - * @class tool_card_controller * @copyright 2015 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 diff --git a/mod/lti/amd/src/tool_configure_controller.js b/mod/lti/amd/src/tool_configure_controller.js index 4e3ae80811898..26628dcc60f9a 100644 --- a/mod/lti/amd/src/tool_configure_controller.js +++ b/mod/lti/amd/src/tool_configure_controller.js @@ -19,7 +19,6 @@ * In addition, it can batch multiple requests and return multiple responses. * * @module mod_lti/tool_configure_controller - * @class tool_configure_controller * @copyright 2015 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 diff --git a/mod/lti/amd/src/tool_proxy.js b/mod/lti/amd/src/tool_proxy.js index 857c7e0df6448..4d55943f084ec 100644 --- a/mod/lti/amd/src/tool_proxy.js +++ b/mod/lti/amd/src/tool_proxy.js @@ -17,13 +17,12 @@ * Provides an interface for a tool proxy in the Moodle server. * * @module mod_lti/tool_proxy - * @class tool_proxy * @copyright 2015 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 */ define(['core/ajax', 'core/notification'], function(ajax, notification) { - return /** @alias module:mod_lti/tool_proxy */ { + return { /** * Get a list of tool types from Moodle for the given * search args. diff --git a/mod/lti/amd/src/tool_proxy_card_controller.js b/mod/lti/amd/src/tool_proxy_card_controller.js index 4e2bafad1cdfa..1718d5ef422ac 100644 --- a/mod/lti/amd/src/tool_proxy_card_controller.js +++ b/mod/lti/amd/src/tool_proxy_card_controller.js @@ -20,7 +20,6 @@ * See template: mod_lti/tool_proxy_card * * @module mod_lti/tool_proxy_card_controller - * @class tool_card_controller * @copyright 2016 John Okely * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 diff --git a/mod/lti/amd/src/tool_type.js b/mod/lti/amd/src/tool_type.js index a8b1e60733ed4..ef8f7685c9fd2 100644 --- a/mod/lti/amd/src/tool_type.js +++ b/mod/lti/amd/src/tool_type.js @@ -17,13 +17,12 @@ * Provides an interface for a tool type in the Moodle server. * * @module mod_lti/tool_type - * @class tool_type * @copyright 2015 Ryan Wyllie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 */ define(['core/ajax', 'core/notification'], function(ajax, notification) { - return /** @alias module:mod_lti/tool_type */ { + return { /** * Get a list of tool types from Moodle for the given * search args. diff --git a/mod/quiz/accessrule/seb/amd/build/managetemplates.min.js.map b/mod/quiz/accessrule/seb/amd/build/managetemplates.min.js.map index 7e82e3ccfce69..aa8331d4498d7 100644 --- a/mod/quiz/accessrule/seb/amd/build/managetemplates.min.js.map +++ b/mod/quiz/accessrule/seb/amd/build/managetemplates.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/managetemplates.js"],"names":["define","$","ajax","str","notification","manager","removeTemplate","e","preventDefault","targetUrl","currentTarget","attr","get_strings","key","component","then","s","confirm","window","location","catch","setup","delegate"],"mappings":"AAOAA,OAAM,kCACF,CAAC,QAAD,CAAW,WAAX,CAAwB,UAAxB,CAAoC,mBAApC,CADE,CAEF,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAuBC,CAAvB,CAAqC,CACjC,GAAIC,CAAAA,CAAO,CAAG,CAOVC,cAAc,CAAE,wBAASC,CAAT,CAAY,CACxBA,CAAC,CAACC,cAAF,GACA,GAAIC,CAAAA,CAAS,CAAGR,CAAC,CAACM,CAAC,CAACG,aAAH,CAAD,CAAmBC,IAAnB,CAAwB,MAAxB,CAAhB,CACAR,CAAG,CAACS,WAAJ,CAAgB,CACZ,CACIC,GAAG,CAAS,6BADhB,CAEIC,SAAS,CAAG,gBAFhB,CADY,CAKZ,CACID,GAAG,CAAS,gCADhB,CAEIC,SAAS,CAAG,gBAFhB,CALY,CASZ,CACID,GAAG,CAAS,KADhB,CAEIC,SAAS,CAAG,QAFhB,CATY,CAaZ,CACID,GAAG,CAAS,IADhB,CAEIC,SAAS,CAAG,QAFhB,CAbY,CAAhB,EAkBCC,IAlBD,CAkBM,SAASC,CAAT,CAAY,CACdZ,CAAY,CAACa,OAAb,CAAqBD,CAAC,CAAC,CAAD,CAAtB,CAA2BA,CAAC,CAAC,CAAD,CAA5B,CAAiCA,CAAC,CAAC,CAAD,CAAlC,CAAuCA,CAAC,CAAC,CAAD,CAAxC,CAA6C,UAAW,CACpDE,MAAM,CAACC,QAAP,CAAkBV,CACrB,CAFD,CAKH,CAxBD,EAyBCW,KAzBD,EA0BH,CApCS,CA2CVC,KAAK,CAAE,gBAAW,CACdpB,CAAC,CAAC,MAAD,CAAD,CAAUqB,QAAV,CAAmB,0BAAnB,CAA6C,OAA7C,CAAsDjB,CAAO,CAACC,cAA9D,CACH,CA7CS,CAAd,CAgDA,MAA2D,CAMvDe,KAAK,CAAEhB,CAAO,CAACgB,KANwC,CAQ9D,CA3DC,CAAN","sourcesContent":["/**\n * Template management code.\n *\n * @module quizaccess_seb/managetemplates\n * @class managetemplates\n * @copyright 2020 Dmitrii Metelkin \n */\ndefine(\n ['jquery', 'core/ajax', 'core/str', 'core/notification'],\n function($, ajax, str, notification) {\n var manager = {\n /**\n * Confirm removal of the specified template.\n *\n * @method removeTemplate\n * @param {EventFacade} e The EventFacade\n */\n removeTemplate: function(e) {\n e.preventDefault();\n var targetUrl = $(e.currentTarget).attr('href');\n str.get_strings([\n {\n key: 'confirmtemplateremovaltitle',\n component: 'quizaccess_seb'\n },\n {\n key: 'confirmtemplateremovalquestion',\n component: 'quizaccess_seb'\n },\n {\n key: 'yes',\n component: 'moodle'\n },\n {\n key: 'no',\n component: 'moodle'\n }\n ])\n .then(function(s) {\n notification.confirm(s[0], s[1], s[2], s[3], function() {\n window.location = targetUrl;\n });\n\n return;\n })\n .catch();\n },\n\n /**\n * Setup the template management UI.\n *\n * @method setup\n */\n setup: function() {\n $('body').delegate('[data-action=\"delete\"]', 'click', manager.removeTemplate);\n }\n };\n\n return /** @alias module:quizaccess_seb/managetemplates */ {\n /**\n * Setup the template management UI.\n *\n * @method setup\n */\n setup: manager.setup\n };\n });\n"],"file":"managetemplates.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/managetemplates.js"],"names":["define","$","ajax","str","notification","manager","removeTemplate","e","preventDefault","targetUrl","currentTarget","attr","get_strings","key","component","then","s","confirm","window","location","catch","setup","delegate"],"mappings":"AAMAA,OAAM,kCACF,CAAC,QAAD,CAAW,WAAX,CAAwB,UAAxB,CAAoC,mBAApC,CADE,CAEF,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAuBC,CAAvB,CAAqC,CACjC,GAAIC,CAAAA,CAAO,CAAG,CAOVC,cAAc,CAAE,wBAASC,CAAT,CAAY,CACxBA,CAAC,CAACC,cAAF,GACA,GAAIC,CAAAA,CAAS,CAAGR,CAAC,CAACM,CAAC,CAACG,aAAH,CAAD,CAAmBC,IAAnB,CAAwB,MAAxB,CAAhB,CACAR,CAAG,CAACS,WAAJ,CAAgB,CACZ,CACIC,GAAG,CAAS,6BADhB,CAEIC,SAAS,CAAG,gBAFhB,CADY,CAKZ,CACID,GAAG,CAAS,gCADhB,CAEIC,SAAS,CAAG,gBAFhB,CALY,CASZ,CACID,GAAG,CAAS,KADhB,CAEIC,SAAS,CAAG,QAFhB,CATY,CAaZ,CACID,GAAG,CAAS,IADhB,CAEIC,SAAS,CAAG,QAFhB,CAbY,CAAhB,EAkBCC,IAlBD,CAkBM,SAASC,CAAT,CAAY,CACdZ,CAAY,CAACa,OAAb,CAAqBD,CAAC,CAAC,CAAD,CAAtB,CAA2BA,CAAC,CAAC,CAAD,CAA5B,CAAiCA,CAAC,CAAC,CAAD,CAAlC,CAAuCA,CAAC,CAAC,CAAD,CAAxC,CAA6C,UAAW,CACpDE,MAAM,CAACC,QAAP,CAAkBV,CACrB,CAFD,CAKH,CAxBD,EAyBCW,KAzBD,EA0BH,CApCS,CA2CVC,KAAK,CAAE,gBAAW,CACdpB,CAAC,CAAC,MAAD,CAAD,CAAUqB,QAAV,CAAmB,0BAAnB,CAA6C,OAA7C,CAAsDjB,CAAO,CAACC,cAA9D,CACH,CA7CS,CAAd,CAgDA,MAA2D,CAMvDe,KAAK,CAAEhB,CAAO,CAACgB,KANwC,CAQ9D,CA3DC,CAAN","sourcesContent":["/**\n * Template management code.\n *\n * @module quizaccess_seb/managetemplates\n * @copyright 2020 Dmitrii Metelkin \n */\ndefine(\n ['jquery', 'core/ajax', 'core/str', 'core/notification'],\n function($, ajax, str, notification) {\n var manager = {\n /**\n * Confirm removal of the specified template.\n *\n * @method removeTemplate\n * @param {EventFacade} e The EventFacade\n */\n removeTemplate: function(e) {\n e.preventDefault();\n var targetUrl = $(e.currentTarget).attr('href');\n str.get_strings([\n {\n key: 'confirmtemplateremovaltitle',\n component: 'quizaccess_seb'\n },\n {\n key: 'confirmtemplateremovalquestion',\n component: 'quizaccess_seb'\n },\n {\n key: 'yes',\n component: 'moodle'\n },\n {\n key: 'no',\n component: 'moodle'\n }\n ])\n .then(function(s) {\n notification.confirm(s[0], s[1], s[2], s[3], function() {\n window.location = targetUrl;\n });\n\n return;\n })\n .catch();\n },\n\n /**\n * Setup the template management UI.\n *\n * @method setup\n */\n setup: function() {\n $('body').delegate('[data-action=\"delete\"]', 'click', manager.removeTemplate);\n }\n };\n\n return /** @alias module:quizaccess_seb/managetemplates */ {\n /**\n * Setup the template management UI.\n *\n * @method setup\n */\n setup: manager.setup\n };\n });\n"],"file":"managetemplates.min.js"} \ No newline at end of file diff --git a/mod/quiz/accessrule/seb/amd/src/managetemplates.js b/mod/quiz/accessrule/seb/amd/src/managetemplates.js index beb950c5f908b..47a5ad0bb4ba8 100644 --- a/mod/quiz/accessrule/seb/amd/src/managetemplates.js +++ b/mod/quiz/accessrule/seb/amd/src/managetemplates.js @@ -2,7 +2,6 @@ * Template management code. * * @module quizaccess_seb/managetemplates - * @class managetemplates * @copyright 2020 Dmitrii Metelkin */ define( diff --git a/mod/quiz/amd/build/preflightcheck.min.js.map b/mod/quiz/amd/build/preflightcheck.min.js.map index 9ab3c7638a056..8b931686589d2 100644 --- a/mod/quiz/amd/build/preflightcheck.min.js.map +++ b/mod/quiz/amd/build/preflightcheck.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/preflightcheck.js"],"names":["define","$","Y","t","confirmDialogue","init","startButton","confirmationTitle","confirmationForm","popupoptions","finalStartButton","use","one","M","core","dialogue","headerContent","bodyContent","draggable","visible","center","modal","width","extraClasses","on","displayDialogue","hideDialogue","get","launchQuizPopup","e","halt","show","hide","core_formchangechecker","reset_form_dirty_state","form","target","ancestor","window","openpopup","url","IO","stringify","replace","windowname","options","fullscreen"],"mappings":"AA2BAA,OAAM,2BAAC,CAAC,QAAD,CAAW,UAAX,CAAD,CAAyB,SAASC,CAAT,CAAYC,CAAZ,CAAe,CAK1C,GAAIC,CAAAA,CAAC,CAAG,CACJC,eAAe,CAAE,IADb,CAWJC,IAAI,CAAE,cAASC,CAAT,CAAsBC,CAAtB,CAAyCC,CAAzC,CAA2DC,CAA3D,CAAyE,CAC3E,GAAIC,CAAAA,CAAgB,CAAGJ,CAAvB,CAEAJ,CAAC,CAACS,GAAF,CAAM,0BAAN,CAAkC,UAAW,CACzC,GAAIT,CAAC,CAACU,GAAF,CAAMJ,CAAN,CAAJ,CAA6B,CACzBL,CAAC,CAACC,eAAF,CAAoB,GAAIS,CAAAA,CAAC,CAACC,IAAF,CAAOC,QAAX,CAAoB,CACpCC,aAAa,CAAET,CADqB,CAEpCU,WAAW,CAAEf,CAAC,CAACU,GAAF,CAAMJ,CAAN,CAFuB,CAGpCU,SAAS,GAH2B,CAIpCC,OAAO,GAJ6B,CAKpCC,MAAM,GAL8B,CAMpCC,KAAK,GAN+B,CAOpCC,KAAK,CAAE,IAP6B,CAQpCC,YAAY,CAAE,CAAC,0BAAD,CARsB,CAApB,CAApB,CAWArB,CAAC,CAACU,GAAF,CAAMN,CAAN,EAAmBkB,EAAnB,CAAsB,OAAtB,CAA+BrB,CAAC,CAACsB,eAAjC,EACAvB,CAAC,CAACU,GAAF,CAAM,YAAN,EAAoBY,EAApB,CAAuB,OAAvB,CAAgCrB,CAAC,CAACuB,YAAlC,EAE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AAA,CACV,CAvFK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * This class manages the confirmation pop-up (also called the pre-flight check)\n * that is sometimes shown when a use clicks the start attempt button.\n *\n * This is also responsible for opening the pop-up window, if the quiz requires to be in one.\n *\n * @module mod_quiz/preflightcheck\n * @class preflightcheck\n * @copyright 2016 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/yui'], function($, Y) {\n\n /**\n * @alias module:mod_quiz/preflightcheck\n */\n var t = {\n confirmDialogue: null,\n\n /**\n * Initialise the start attempt button.\n *\n * @param {String} startButton the id of the start attempt button that we will be enhancing.\n * @param {String} confirmationTitle the title of the dialogue.\n * @param {String} confirmationForm selector for the confirmation form to show in the dialogue.\n * @param {String} popupoptions If not null, the quiz should be launced in a pop-up.\n */\n init: function(startButton, confirmationTitle, confirmationForm, popupoptions) {\n var finalStartButton = startButton;\n\n Y.use('moodle-core-notification', function() {\n if (Y.one(confirmationForm)) {\n t.confirmDialogue = new M.core.dialogue({\n headerContent: confirmationTitle,\n bodyContent: Y.one(confirmationForm),\n draggable: true,\n visible: false,\n center: true,\n modal: true,\n width: null,\n extraClasses: ['mod_quiz_preflight_popup']\n });\n\n Y.one(startButton).on('click', t.displayDialogue);\n Y.one('#id_cancel').on('click', t.hideDialogue);\n\n finalStartButton = t.confirmDialogue.get('boundingBox').one('[name=\"submitbutton\"]');\n }\n\n if (popupoptions) {\n Y.one(finalStartButton).on('click', t.launchQuizPopup, t, popupoptions);\n }\n });\n },\n\n /**\n * Display the dialogue.\n * @param {Y.EventFacade} e the event being responded to, if any.\n */\n displayDialogue: function(e) {\n if (e) {\n e.halt();\n }\n t.confirmDialogue.show();\n },\n\n /**\n * Hide the dialogue.\n * @param {Y.EventFacade} e the event being responded to, if any.\n */\n hideDialogue: function(e) {\n if (e) {\n e.halt();\n }\n t.confirmDialogue.hide(e);\n },\n\n /**\n * Event handler for the quiz start attempt button.\n * @param {Event} e the event being responded to\n * @param {Object} popupoptions\n */\n launchQuizPopup: function(e, popupoptions) {\n e.halt();\n Y.use('moodle-core-formchangechecker', 'io-form', function() {\n M.core_formchangechecker.reset_form_dirty_state();\n var form = e.target.ancestor('form');\n window.openpopup(e, {\n url: form.get('action') + '?' + Y.IO.stringify(form).replace(/\\bcancel=/, 'x='),\n windowname: 'quizpopup',\n options: popupoptions,\n fullscreen: true,\n });\n });\n }\n };\n\n return t;\n});\n"],"file":"preflightcheck.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/preflightcheck.js"],"names":["define","$","Y","t","confirmDialogue","init","startButton","confirmationTitle","confirmationForm","popupoptions","finalStartButton","use","one","M","core","dialogue","headerContent","bodyContent","draggable","visible","center","modal","width","extraClasses","on","displayDialogue","hideDialogue","get","launchQuizPopup","e","halt","show","hide","core_formchangechecker","reset_form_dirty_state","form","target","ancestor","window","openpopup","url","IO","stringify","replace","windowname","options","fullscreen"],"mappings":"AA0BAA,OAAM,2BAAC,CAAC,QAAD,CAAW,UAAX,CAAD,CAAyB,SAASC,CAAT,CAAYC,CAAZ,CAAe,CAK1C,GAAIC,CAAAA,CAAC,CAAG,CACJC,eAAe,CAAE,IADb,CAWJC,IAAI,CAAE,cAASC,CAAT,CAAsBC,CAAtB,CAAyCC,CAAzC,CAA2DC,CAA3D,CAAyE,CAC3E,GAAIC,CAAAA,CAAgB,CAAGJ,CAAvB,CAEAJ,CAAC,CAACS,GAAF,CAAM,0BAAN,CAAkC,UAAW,CACzC,GAAIT,CAAC,CAAC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,CAA0B,CACvCoB,CAAC,CAACC,IAAF,GACA5B,CAAC,CAACS,GAAF,CAAM,+BAAN,CAAuC,SAAvC,CAAkD,UAAW,CACzDE,CAAC,CAACoB,sBAAF,CAAyBC,sBAAzB,GACA,GAAIC,CAAAA,CAAI,CAAGN,CAAC,CAACO,MAAF,CAASC,QAAT,CAAkB,MAAlB,CAAX,CACAC,MAAM,CAACC,SAAP,CAAiBV,CAAjB,CAAoB,CAChBW,GAAG,CAAEL,CAAI,CAACR,GAAL,CAAS,QAAT,EAAqB,GAArB,CAA2BzB,CAAC,CAACuC,EAAF,CAAKC,SAAL,CAAeP,CAAf,EAAqBQ,OAArB,CAA6B,WAA7B,CAA0C,IAA1C,CADhB,CAEhBC,UAAU,CAAE,WAFI,CAGhBC,OAAO,CAAEpC,CAHO,CAIhBqC,UAAU,GAJM,CAApB,CAMH,CATD,CAUH,CA9EG,CAAR,CAiFA,MAAO3C,CAAAA,CACV,CAvFK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * This class manages the confirmation pop-up (also called the pre-flight check)\n * that is sometimes shown when a use clicks the start attempt button.\n *\n * This is also responsible for opening the pop-up window, if the quiz requires to be in one.\n *\n * @module mod_quiz/preflightcheck\n * @copyright 2016 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.1\n */\ndefine(['jquery', 'core/yui'], function($, Y) {\n\n /**\n * @alias module:mod_quiz/preflightcheck\n */\n var t = {\n confirmDialogue: null,\n\n /**\n * Initialise the start attempt button.\n *\n * @param {String} startButton the id of the start attempt button that we will be enhancing.\n * @param {String} confirmationTitle the title of the dialogue.\n * @param {String} confirmationForm selector for the confirmation form to show in the dialogue.\n * @param {String} popupoptions If not null, the quiz should be launced in a pop-up.\n */\n init: function(startButton, confirmationTitle, confirmationForm, popupoptions) {\n var finalStartButton = startButton;\n\n Y.use('moodle-core-notification', function() {\n if (Y.one(confirmationForm)) {\n t.confirmDialogue = new M.core.dialogue({\n headerContent: confirmationTitle,\n bodyContent: Y.one(confirmationForm),\n draggable: true,\n visible: false,\n center: true,\n modal: true,\n width: null,\n extraClasses: ['mod_quiz_preflight_popup']\n });\n\n Y.one(startButton).on('click', t.displayDialogue);\n Y.one('#id_cancel').on('click', t.hideDialogue);\n\n finalStartButton = t.confirmDialogue.get('boundingBox').one('[name=\"submitbutton\"]');\n }\n\n if (popupoptions) {\n Y.one(finalStartButton).on('click', t.launchQuizPopup, t, popupoptions);\n }\n });\n },\n\n /**\n * Display the dialogue.\n * @param {Y.EventFacade} e the event being responded to, if any.\n */\n displayDialogue: function(e) {\n if (e) {\n e.halt();\n }\n t.confirmDialogue.show();\n },\n\n /**\n * Hide the dialogue.\n * @param {Y.EventFacade} e the event being responded to, if any.\n */\n hideDialogue: function(e) {\n if (e) {\n e.halt();\n }\n t.confirmDialogue.hide(e);\n },\n\n /**\n * Event handler for the quiz start attempt button.\n * @param {Event} e the event being responded to\n * @param {Object} popupoptions\n */\n launchQuizPopup: function(e, popupoptions) {\n e.halt();\n Y.use('moodle-core-formchangechecker', 'io-form', function() {\n M.core_formchangechecker.reset_form_dirty_state();\n var form = e.target.ancestor('form');\n window.openpopup(e, {\n url: form.get('action') + '?' + Y.IO.stringify(form).replace(/\\bcancel=/, 'x='),\n windowname: 'quizpopup',\n options: popupoptions,\n fullscreen: true,\n });\n });\n }\n };\n\n return t;\n});\n"],"file":"preflightcheck.min.js"} \ No newline at end of file diff --git a/mod/quiz/amd/src/preflightcheck.js b/mod/quiz/amd/src/preflightcheck.js index 2c4fae4325e34..1a1e69a434d45 100644 --- a/mod/quiz/amd/src/preflightcheck.js +++ b/mod/quiz/amd/src/preflightcheck.js @@ -20,7 +20,6 @@ * This is also responsible for opening the pop-up window, if the quiz requires to be in one. * * @module mod_quiz/preflightcheck - * @class preflightcheck * @copyright 2016 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 3.1 diff --git a/question/amd/build/repository.min.js.map b/question/amd/build/repository.min.js.map index 6240e4a96aa8d..6ab5340c9dae3 100644 --- a/question/amd/build/repository.min.js.map +++ b/question/amd/build/repository.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/repository.js"],"names":["define","$","Ajax","submitTagCreateUpdateForm","questionId","contextId","formdata","call","methodname","args","questionid","contextid"],"mappings":"AAuBAA,OAAM,4BAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAsB9C,MAAO,CACHC,yBAAyB,CAdG,QAA5BA,CAAAA,yBAA4B,CAASC,CAAT,CAAqBC,CAArB,CAAgCC,CAAhC,CAA0C,CAUtE,MAAOJ,CAAAA,CAAI,CAACK,IAAL,CAAU,CATH,CACVC,UAAU,CAAE,gCADF,CAEVC,IAAI,CAAE,CACFC,UAAU,CAAEN,CADV,CAEFO,SAAS,CAAEN,CAFT,CAGFC,QAAQ,CAAEA,CAHR,CAFI,CASG,CAAV,EAAqB,CAArB,CACV,CAEM,CAGV,CAzBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle question ajax actions.\n *\n * @module core_question/repository\n * @class repository\n * @copyright 2017 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n /**\n * Submit the form data for the question tags form.\n *\n * @method submitTagCreateUpdateForm\n * @param {string} formdata The URL encoded values from the form\n * @return {promise}\n */\n var submitTagCreateUpdateForm = function(questionId, contextId, formdata) {\n var request = {\n methodname: 'core_question_submit_tags_form',\n args: {\n questionid: questionId,\n contextid: contextId,\n formdata: formdata\n }\n };\n\n return Ajax.call([request])[0];\n };\n\n return {\n submitTagCreateUpdateForm: submitTagCreateUpdateForm\n };\n});\n"],"file":"repository.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/repository.js"],"names":["define","$","Ajax","submitTagCreateUpdateForm","questionId","contextId","formdata","call","methodname","args","questionid","contextid"],"mappings":"AAsBAA,OAAM,4BAAC,CAAC,QAAD,CAAW,WAAX,CAAD,CAA0B,SAASC,CAAT,CAAYC,CAAZ,CAAkB,CAsB9C,MAAO,CACHC,yBAAyB,CAdG,QAA5BA,CAAAA,yBAA4B,CAASC,CAAT,CAAqBC,CAArB,CAAgCC,CAAhC,CAA0C,CAUtE,MAAOJ,CAAAA,CAAI,CAACK,IAAL,CAAU,CATH,CACVC,UAAU,CAAE,gCADF,CAEVC,IAAI,CAAE,CACFC,UAAU,CAAEN,CADV,CAEFO,SAAS,CAAEN,CAFT,CAGFC,QAAQ,CAAEA,CAHR,CAFI,CASG,CAAV,EAAqB,CAArB,CACV,CAEM,CAGV,CAzBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle question ajax actions.\n *\n * @module core_question/repository\n * @copyright 2017 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax'], function($, Ajax) {\n\n /**\n * Submit the form data for the question tags form.\n *\n * @method submitTagCreateUpdateForm\n * @param {string} formdata The URL encoded values from the form\n * @return {promise}\n */\n var submitTagCreateUpdateForm = function(questionId, contextId, formdata) {\n var request = {\n methodname: 'core_question_submit_tags_form',\n args: {\n questionid: questionId,\n contextid: contextId,\n formdata: formdata\n }\n };\n\n return Ajax.call([request])[0];\n };\n\n return {\n submitTagCreateUpdateForm: submitTagCreateUpdateForm\n };\n});\n"],"file":"repository.min.js"} \ No newline at end of file diff --git a/question/amd/src/repository.js b/question/amd/src/repository.js index fb3bd686ca3cf..bb054c7898167 100644 --- a/question/amd/src/repository.js +++ b/question/amd/src/repository.js @@ -17,7 +17,6 @@ * A javascript module to handle question ajax actions. * * @module core_question/repository - * @class repository * @copyright 2017 Simey Lameze * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/question/type/ddimageortext/amd/build/form.min.js.map b/question/type/ddimageortext/amd/build/form.min.js.map index 974bd20c027ad..6d83d64179593 100644 --- a/question/type/ddimageortext/amd/build/form.min.js.map +++ b/question/type/ddimageortext/amd/build/form.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/form.js"],"names":["define","$","dragDrop","dragDropToImageForm","maxBgImageSize","maxDragImageSize","fp","init","filePickers","append","updateVisibilityOfFilePickers","setOptionsForDragItemSelectors","setupEventHandlers","waitForFilePickerToInitialise","file","href","setTimeout","M","util","js_pending","on","loadPreviewImage","one","afterPreviewImageLoaded","attr","createDropZones","js_complete","dropZoneHolder","empty","bgimageurl","numDrops","form","getFormValue","dropNo","dragNo","group","label","imgUrl","waitForAllDropImagesToBeLoaded","notYetLoadedImages","not","i","imgNode","imageIsLoaded","length","updateDropZones","imgElement","complete","naturalHeight","dropBackgroundPosition","offset","drop","left","parseInt","top","is","html","css","numGroups","first","find","resizeAllDragsAndDropsInGroup","drops","maxWidth","maxHeight","each","Math","max","ceil","offsetWidth","offsetHeight","round","floor","e","input","target","closest","hasClass","dragStart","window","numDrags","picker","show","hide","dragItemOptions","toNameWithIndex","name","selector","selectedvalue","val","remove","value","hasOwnProperty","optionnode","isItemUsed","filter","selectNode","info","prepare","start","x","y","dragMove","dragEnd","backgroundImage","backgroundPosition","data","dropPosition","min","outerWidth","outerHeight","setFormValue","indexes","indexString","getEl","elements","el","type","checked","draftItemIdsToName","nameToParentNode","index","filepicker","parentNode","fileAnchor","get","innerHTML","draftitemid"],"mappings":"AAsBAA,OAAM,4BAAC,CAAC,QAAD,CAAW,eAAX,CAAD,CAA8B,SAASC,CAAT,CAAYC,CAAZ,CAAsB,CAEtD,aAOA,GAAIC,CAAAA,CAAmB,CAAG,CAItBC,cAAc,CAAE,IAJM,CAStBC,gBAAgB,CAAE,IATI,CActBC,EAAE,CAAE,IAdkB,CAmBtBC,IAAI,CAAE,eAAW,CACbJ,CAAmB,CAACG,EAApB,CAAyBH,CAAmB,CAACK,WAApB,EAAzB,CAEAP,CAAC,CAAC,uBAAD,CAAD,CAA2BQ,MAA3B,6LASAN,CAAmB,CAACO,6BAApB,GACAP,CAAmB,CAACQ,8BAApB,GACAR,CAAmB,CAACS,kBAApB,GACAT,CAAmB,CAACU,6BAApB,EACH,CAnCqB,CAwCtBA,6BAA6B,CAAE,wCAAW,CACtC,GAAoD,IAAhD,GAAAV,CAAmB,CAACG,EAApB,CAAuBQ,IAAvB,CAA4B,SAA5B,EAAuCC,IAA3C,CAA0D,CAGtDC,UAAU,CAACb,CAAmB,CAACU,6BAArB,CAAoD,GAApD,CAAV,CACA,MACH,CACDI,CAAC,CAACC,IAAF,CAAOC,UAAP,CAAkB,qBAAlB,EAKAlB,CAAC,CAAC,0CAAD,CAAD,CA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A,CAGjB,GAAIgE,CAAU,CAAChF,MAAf,CAAuB,CACnB,MAAO,CAAC7B,IAAI,CAAE6G,CAAU,CAACC,GAAX,CAAe,CAAf,EAAkB9G,IAAzB,CAA+BuE,IAAI,CAAEsC,CAAU,CAACC,GAAX,CAAe,CAAf,EAAkBC,SAAvD,CACV,CAFD,IAEO,CACH,MAAO,CAAC/G,IAAI,CAAE,IAAP,CAAauE,IAAI,CAAE,IAAnB,CACV,CACJ,CATE,CAWHA,IAAI,CAAE,cAASyC,CAAT,CAAsB,CACxB,MAAOR,CAAAA,CAAkB,CAACQ,CAAD,CAC5B,CAbE,CAeV,CAtdqB,CAA1B,CA4dA,MAAO,CAIHxH,IAAI,CAAEJ,CAAmB,CAACI,IAJvB,CAMV,CA3eK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/*\n * JavaScript to allow dragging options to slots (using mouse down or touch) or tab through slots using keyboard.\n *\n * @module qtype_ddimageortext/form\n * @copyright 2018 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/dragdrop'], function($, dragDrop) {\n\n \"use strict\";\n\n /**\n * Singleton object to handle progressive enhancement of the\n * drag-drop onto image question editing form.\n * @type {Object}\n */\n var dragDropToImageForm = {\n /**\n * @var {Object} with properties width and height.\n */\n maxBgImageSize: null,\n\n /**\n * @var {Object} with properties width and height.\n */\n maxDragImageSize: null,\n\n /**\n * @var {object} for interacting with the file pickers.\n */\n fp: null, // Object containing functions associated with the file picker.\n\n /**\n * Initialise the form javascript features.\n */\n init: function() {\n dragDropToImageForm.fp = dragDropToImageForm.filePickers();\n\n $('#id_previewareaheader').append(\n '
' +\n '
' +\n ' ' +\n '
' +\n '
' +\n '
' +\n '
');\n\n dragDropToImageForm.updateVisibilityOfFilePickers();\n dragDropToImageForm.setOptionsForDragItemSelectors();\n dragDropToImageForm.setupEventHandlers();\n dragDropToImageForm.waitForFilePickerToInitialise();\n },\n\n /**\n * Waits for the file-pickers to be sufficiently ready before initialising the preview.\n */\n waitForFilePickerToInitialise: function() {\n if (dragDropToImageForm.fp.file('bgimage').href === null) {\n // It would be better to use an onload or onchange event rather than this timeout.\n // Unfortunately attempts to do this early are overwritten by filepicker during its loading.\n setTimeout(dragDropToImageForm.waitForFilePickerToInitialise, 1000);\n return;\n }\n M.util.js_pending('dragDropToImageForm');\n\n // From now on, when a new file gets loaded into the filepicker, update the preview.\n // This is not in the setupEventHandlers section as it needs to be delayed until\n // after filepicker's javascript has finished.\n $('form.mform[data-qtype=\"ddimageortext\"]').on('change', '.filepickerhidden', function() {\n M.util.js_pending('dragDropToImageForm');\n dragDropToImageForm.loadPreviewImage();\n });\n\n dragDropToImageForm.loadPreviewImage();\n },\n\n /**\n * Loads the preview background image.\n */\n loadPreviewImage: function() {\n $('fieldset#id_previewareaheader .dropbackground')\n .one('load', dragDropToImageForm.afterPreviewImageLoaded)\n .attr('src', dragDropToImageForm.fp.file('bgimage').href);\n },\n\n /**\n * After the background image is loaded, continue setting up the preview.\n */\n afterPreviewImageLoaded: function() {\n dragDropToImageForm.createDropZones();\n M.util.js_complete('dragDropToImageForm');\n },\n\n /**\n * Create, or recreate all the drop zones.\n */\n createDropZones: function() {\n var dropZoneHolder = $('.dropzones');\n dropZoneHolder.empty();\n\n var bgimageurl = dragDropToImageForm.fp.file('bgimage').href;\n if (bgimageurl === null) {\n return; // There is not currently a valid preview to update.\n }\n\n var numDrops = dragDropToImageForm.form.getFormValue('nodropzone', []);\n for (var dropNo = 0; dropNo < numDrops; dropNo++) {\n var dragNo = dragDropToImageForm.form.getFormValue('drops', [dropNo, 'choice']);\n if (dragNo === '0') {\n continue;\n }\n dragNo = dragNo - 1;\n var group = dragDropToImageForm.form.getFormValue('drags', [dragNo, 'draggroup']),\n label = dragDropToImageForm.form.getFormValue('draglabel', [dragNo]);\n if ('image' === dragDropToImageForm.form.getFormValue('drags', [dragNo, 'dragitemtype'])) {\n var imgUrl = dragDropToImageForm.fp.file('dragitem[' + dragNo + ']').href;\n if (imgUrl === null) {\n continue;\n }\n // Althoug these are previews of drops, we also add the class name 'drag',\n dropZoneHolder.append('\"'');\n\n } else if (label !== '') {\n dropZoneHolder.append('
' + label + '
');\n }\n }\n\n dragDropToImageForm.waitForAllDropImagesToBeLoaded();\n },\n\n /**\n * This polls until all the drop-zone images have loaded, and then calls updateDropZones().\n */\n waitForAllDropImagesToBeLoaded: function() {\n var notYetLoadedImages = $('.dropzones img').not(function(i, imgNode) {\n return dragDropToImageForm.imageIsLoaded(imgNode);\n });\n\n if (notYetLoadedImages.length > 0) {\n setTimeout(function() {\n dragDropToImageForm.waitForAllDropImagesToBeLoaded();\n }, 100);\n return;\n }\n\n dragDropToImageForm.updateDropZones();\n },\n\n /**\n * Check if an image has loaded without errors.\n *\n * @param {HTMLImageElement} imgElement an image.\n * @returns {boolean} true if this image has loaded without errors.\n */\n imageIsLoaded: function(imgElement) {\n return imgElement.complete && imgElement.naturalHeight !== 0;\n },\n\n /**\n * Set the size and position of all the drop zones.\n */\n updateDropZones: function() {\n var bgimageurl = dragDropToImageForm.fp.file('bgimage').href;\n if (bgimageurl === null) {\n return; // There is not currently a valid preview to update.\n }\n\n var dropBackgroundPosition = $('fieldset#id_previewareaheader .dropbackground').offset(),\n numDrops = dragDropToImageForm.form.getFormValue('nodropzone', []);\n\n // Move each drop to the right position and update the text.\n for (var dropNo = 0; dropNo < numDrops; dropNo++) {\n var drop = $('.dropzones .drop' + dropNo);\n if (drop.length === 0) {\n continue;\n }\n var dragNo = dragDropToImageForm.form.getFormValue('drops', [dropNo, 'choice']) - 1;\n\n drop.offset({\n left: dropBackgroundPosition.left +\n parseInt(dragDropToImageForm.form.getFormValue('drops', [dropNo, 'xleft'])),\n top: dropBackgroundPosition.top +\n parseInt(dragDropToImageForm.form.getFormValue('drops', [dropNo, 'ytop']))\n });\n\n var label = dragDropToImageForm.form.getFormValue('draglabel', [dragNo]);\n if (drop.is('img')) {\n drop.attr('alt', label);\n } else {\n drop.html(label);\n }\n }\n\n // Resize them to the same size.\n $('.dropzones .droppreview').css('padding', '0');\n var numGroups = $('.draggroup select').first().find('option').length;\n for (var group = 1; group <= numGroups; group++) {\n dragDropToImageForm.resizeAllDragsAndDropsInGroup(group);\n }\n },\n\n /**\n * In a given group, set all the drags and drops to be the same size.\n *\n * @param {int} group the group number.\n */\n resizeAllDragsAndDropsInGroup: function(group) {\n var drops = $('.dropzones .droppreview.group' + group),\n maxWidth = 0,\n maxHeight = 0;\n\n // Find the maximum size of any drag in this groups.\n drops.each(function(i, drop) {\n maxWidth = Math.max(maxWidth, Math.ceil(drop.offsetWidth));\n maxHeight = Math.max(maxHeight, Math.ceil(drop.offsetHeight));\n });\n\n // The size we will want to set is a bit bigger than this.\n maxWidth += 10;\n maxHeight += 10;\n\n // Set each drag home to that size.\n drops.each(function(i, drop) {\n var left = Math.round((maxWidth - drop.offsetWidth) / 2),\n top = Math.floor((maxHeight - drop.offsetHeight) / 2);\n // Set top and left padding so the item is centred.\n $(drop).css({\n 'padding-left': left + 'px',\n 'padding-right': (maxWidth - drop.offsetWidth - left) + 'px',\n 'padding-top': top + 'px',\n 'padding-bottom': (maxHeight - drop.offsetHeight - top) + 'px'\n });\n });\n },\n\n /**\n * Events linked to form actions.\n */\n setupEventHandlers: function() {\n // Changes to settings in the draggable items section.\n $('fieldset#id_draggableitemheader')\n .on('change input', 'input, select', function(e) {\n var input = $(e.target).closest('select, input');\n if (input.hasClass('dragitemtype')) {\n dragDropToImageForm.updateVisibilityOfFilePickers();\n }\n\n dragDropToImageForm.setOptionsForDragItemSelectors();\n\n if (input.is('.dragitemtype, .draggroup')) {\n dragDropToImageForm.createDropZones();\n } else if (input.is('.draglabel')) {\n dragDropToImageForm.updateDropZones();\n }\n });\n\n // Changes to Drop zones section: left, top and drag item.\n $('fieldset#id_dropzoneheader').on('change input', 'input, select', function(e) {\n var input = $(e.target).closest('select, input');\n if (input.is('select')) {\n dragDropToImageForm.createDropZones();\n } else {\n dragDropToImageForm.updateDropZones();\n }\n });\n\n // Moving drop zones in the preview.\n $('fieldset#id_previewareaheader').on('mousedown touchstart', '.droppreview', function(e) {\n dragDropToImageForm.dragStart(e);\n });\n\n $(window).on('resize', function() {\n dragDropToImageForm.updateDropZones();\n });\n },\n\n /**\n * Update all the drag item filepickers, so they are only shown for\n */\n updateVisibilityOfFilePickers: function() {\n var numDrags = dragDropToImageForm.form.getFormValue('noitems', []);\n for (var dragNo = 0; dragNo < numDrags; dragNo++) {\n var picker = $('input#id_dragitem_' + dragNo).closest('.fitem_ffilepicker');\n if ('image' === dragDropToImageForm.form.getFormValue('drags', [dragNo, 'dragitemtype'])) {\n picker.show();\n } else {\n picker.hide();\n }\n }\n },\n\n\n setOptionsForDragItemSelectors: function() {\n var dragItemOptions = {'0': ''},\n numDrags = dragDropToImageForm.form.getFormValue('noitems', []),\n numDrops = dragDropToImageForm.form.getFormValue('nodropzone', []);\n\n // Work out the list of options.\n for (var dragNo = 0; dragNo < numDrags; dragNo++) {\n var label = dragDropToImageForm.form.getFormValue('draglabel', [dragNo]);\n var file = dragDropToImageForm.fp.file(dragDropToImageForm.form.toNameWithIndex('dragitem', [dragNo]));\n if ('image' === dragDropToImageForm.form.getFormValue('drags', [dragNo, 'dragitemtype']) && file.name !== null) {\n dragItemOptions[dragNo + 1] = (dragNo + 1) + '. ' + label + ' (' + file.name + ')';\n } else if (label !== '') {\n dragItemOptions[dragNo + 1] = (dragNo + 1) + '. ' + label;\n }\n }\n\n // Initialise each select.\n for (var dropNo = 0; dropNo < numDrops; dropNo++) {\n var selector = $('#id_drops_' + dropNo + '_choice');\n\n var selectedvalue = selector.val();\n selector.find('option').remove();\n for (var value in dragItemOptions) {\n if (!dragItemOptions.hasOwnProperty(value)) {\n continue;\n }\n selector.append('');\n var optionnode = selector.find('option[value=\"' + value + '\"]');\n if (parseInt(value) === parseInt(selectedvalue)) {\n optionnode.attr('selected', true);\n } else if (dragDropToImageForm.isItemUsed(parseInt(value))) {\n optionnode.attr('disabled', true);\n }\n }\n }\n },\n\n /**\n * Checks if the specified drag option is already used somewhere.\n *\n * @param {Number} value of the drag item to check\n * @return {Boolean} true if item is allocated to dropzone\n */\n isItemUsed: function(value) {\n if (value === 0) {\n return false; // None option can always be selected.\n }\n\n if (dragDropToImageForm.form.getFormValue('drags', [value - 1, 'infinite'])) {\n return false; // Infinite, so can't be used up.\n }\n\n return $('fieldset#id_dropzoneheader select').filter(function(i, selectNode) {\n return parseInt($(selectNode).val()) === value;\n }).length !== 0;\n },\n\n /**\n * Handles when a dropzone in dragged in the preview.\n * @param {Object} e Event object\n */\n dragStart: function(e) {\n var drop = $(e.target).closest('.droppreview');\n\n var info = dragDrop.prepare(e);\n if (!info.start) {\n return;\n }\n\n dragDrop.start(e, drop, function(x, y, drop) {\n dragDropToImageForm.dragMove(drop);\n }, function() {\n dragDropToImageForm.dragEnd();\n });\n },\n\n /**\n * Handles update while a drop is being dragged.\n *\n * @param {jQuery} drop the drop preview being moved.\n */\n dragMove: function(drop) {\n var backgroundImage = $('fieldset#id_previewareaheader .dropbackground'),\n backgroundPosition = backgroundImage.offset(),\n dropNo = drop.data('dropNo'),\n dropPosition = drop.offset(),\n left = Math.round(dropPosition.left - backgroundPosition.left),\n top = Math.round(dropPosition.top - backgroundPosition.top);\n\n // Constrain coordinates to be inside the background.\n left = Math.round(Math.max(0, Math.min(left, backgroundImage.outerWidth() - drop.outerWidth())));\n top = Math.round(Math.max(0, Math.min(top, backgroundImage.outerHeight() - drop.outerHeight())));\n\n // Update the form.\n dragDropToImageForm.form.setFormValue('drops', [dropNo, 'xleft'], left);\n dragDropToImageForm.form.setFormValue('drops', [dropNo, 'ytop'], top);\n },\n\n /**\n * Handles when the drag ends.\n */\n dragEnd: function() {\n // Redraw, in case the position was constrained.\n dragDropToImageForm.updateDropZones();\n },\n\n /**\n * Low level operations on form.\n */\n form: {\n toNameWithIndex: function(name, indexes) {\n var indexString = name;\n for (var i = 0; i < indexes.length; i++) {\n indexString = indexString + '[' + indexes[i] + ']';\n }\n return indexString;\n },\n\n getEl: function(name, indexes) {\n var form = $('form.mform[data-qtype=\"ddimageortext\"]')[0];\n return form.elements[this.toNameWithIndex(name, indexes)];\n },\n\n /**\n * Helper to get the value of a form elements with name like \"drops[0][xleft]\".\n *\n * @param {String} name the base name, e.g. 'drops'.\n * @param {String[]} indexes the indexes, e.g. ['0', 'xleft'].\n * @return {String} the value of that field.\n */\n getFormValue: function(name, indexes) {\n var el = this.getEl(name, indexes);\n if (!el.type) {\n el = el[el.length - 1];\n }\n if (el.type === 'checkbox') {\n return el.checked;\n } else {\n return el.value;\n }\n },\n\n /**\n * Helper to get the value of a form elements with name like \"drops[0][xleft]\".\n *\n * @param {String} name the base name, e.g. 'drops'.\n * @param {String[]} indexes the indexes, e.g. ['0', 'xleft'].\n * @param {String|Number} value the value to set.\n */\n setFormValue: function(name, indexes, value) {\n var el = this.getEl(name, indexes);\n if (el.type === 'checkbox') {\n el.checked = value;\n } else {\n el.value = value;\n }\n }\n },\n\n /**\n * Utility to get the file name and url from the filepicker.\n * @returns {Object} object containing functions {file, name}\n */\n filePickers: function() {\n var draftItemIdsToName;\n var nameToParentNode;\n\n if (draftItemIdsToName === undefined) {\n draftItemIdsToName = {};\n nameToParentNode = {};\n var fp = $('form.mform[data-qtype=\"ddimageortext\"] input.filepickerhidden');\n fp.each(function(index, filepicker) {\n draftItemIdsToName[filepicker.value] = filepicker.name;\n nameToParentNode[filepicker.name] = filepicker.parentNode;\n });\n }\n\n return {\n file: function(name) {\n var parentNode = $(nameToParentNode[name]);\n var fileAnchor = parentNode.find('div.filepicker-filelist a');\n if (fileAnchor.length) {\n return {href: fileAnchor.get(0).href, name: fileAnchor.get(0).innerHTML};\n } else {\n return {href: null, name: null};\n }\n },\n\n name: function(draftitemid) {\n return draftItemIdsToName[draftitemid];\n }\n };\n }\n };\n\n /**\n * @alias module:qtype_ddimageortext/form\n */\n return {\n /**\n * Initialise the form JavaScript features.\n */\n init: dragDropToImageForm.init\n };\n});\n"],"file":"form.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/form.js"],"names":["define","$","dragDrop","dragDropToImageForm","maxBgImageSize","maxDragImageSize","fp","init","filePickers","append","updateVisibilityOfFilePickers","setOptionsForDragItemSelectors","setupEventHandlers","waitForFilePickerToInitialise","file","href","setTimeout","M","util","js_pending","on","loadPreviewImage","one","afterPreviewImageLoaded","attr","createDropZones","js_complete","dropZoneHolder","empty","bgimageurl","numDrops","form","getFormValue","dropNo","dragNo","group","label","imgUrl","waitForAllDropImagesToBeLoaded","notYetLoadedImages","not","i","imgNode","imageIsLoaded","length","updateDropZones","imgElement","complete","naturalHeight","dropBackgroundPosition","offset","drop","left","parseInt","top","is","html","css","numGroups","first","find","resizeAllDragsAndDropsInGroup","drops","maxWidth","maxHeight","each","Math","max","ceil","offsetWidth","offsetHeight","round","floor","e","input","target","closest","hasClass","dragStart","window","numDrags","picker","show","hide","dragItemOptions","toNameWithIndex","name","selector","selectedvalue","val","remove","value","hasOwnProperty","optionnode","isItemUsed","filter","selectNode","info","prepare","start","x","y","dragMove","dragEnd","backgroundImage","backgroundPosition","data","dropPosition","min","outerWidth","outerHeight","setFormValue","indexes","indexString","getEl","elements","el","type","checked","draftItemIdsToName","nameToParentNode","index","filepicker","parentNode","fileAnchor","get","innerHTML","draftitemid"],"mappings":"AAsBAA,OAAM,4BAAC,CAAC,QAAD,CAAW,eAAX,CAAD,CAA8B,SAASC,CAAT,CAAYC,CAAZ,CAAsB,CAEtD,aAOA,GAAIC,CAAAA,CAAmB,CAAG,CAKt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btBnF,WAAW,CAAE,sBAAW,IAChB+G,CAAAA,CADgB,CAEhBC,CAFgB,CAIpB,GAAID,CAAkB,SAAtB,CAAsC,CAClCA,CAAkB,CAAG,EAArB,CACAC,CAAgB,CAAG,EAAnB,CACA,GAAIlH,CAAAA,CAAE,CAAGL,CAAC,CAAC,iEAAD,CAAV,CACAK,CAAE,CAAC2D,IAAH,CAAQ,SAASwD,CAAT,CAAgBC,CAAhB,CAA4B,CAChCH,CAAkB,CAACG,CAAU,CAAC/B,KAAZ,CAAlB,CAAuC+B,CAAU,CAACpC,IAAlD,CACAkC,CAAgB,CAACE,CAAU,CAACpC,IAAZ,CAAhB,CAAoCoC,CAAU,CAACC,UAClD,CAHD,CAIH,CAED,MAAO,CACH7G,IAAI,CAAE,cAASwE,CAAT,CAAe,IACbqC,CAAAA,CAAU,CAAG1H,CAAC,CAACuH,CAAgB,CAAClC,CAAD,CAAjB,CADD,CAEbsC,CAAU,CAAGD,CAAU,CAAC/D,IAAX,CAAgB,2BAAhB,CAFA,CAGjB,GAAIgE,CAAU,CAAChF,MAAf,CAAuB,CACnB,MAAO,CAAC7B,IAAI,CAAE6G,CAAU,CAACC,GAAX,CAAe,CAAf,EAAkB9G,IAAzB,CAA+BuE,IAAI,CAAEsC,CAAU,CAACC,GAAX,CAAe,CAAf,EAAkBC,SAAvD,CACV,CAFD,IAEO,CACH,MAAO,CAAC/G,IAAI,CAAE,IAAP,CAAauE,IAAI,CAAE,IAAnB,CACV,CACJ,CATE,CAWHA,IAAI,CAAE,cAASyC,CAAT,CAAsB,CACxB,MAAOR,CAAAA,CAAkB,CAACQ,CAAD,CAC5B,CAbE,CAeV,CA3dqB,CAA1B,CA8dA,MAAO,CACHxH,IAAI,CAAEJ,CAAmB,CAACI,IADvB,CAGV,CA1eK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/*\n * JavaScript to allow dragging options to slots (using mouse down or touch) or tab through slots using keyboard.\n *\n * @module qtype_ddimageortext/form\n * @copyright 2018 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/dragdrop'], function($, dragDrop) {\n\n \"use strict\";\n\n /**\n * Singleton object to handle progressive enhancement of the\n * drag-drop onto image question editing form.\n * @type {Object}\n */\n var dragDropToImageForm = {\n /**\n * @var {Object} maxBgImageSize Properties width and height.\n * @private\n */\n maxBgImageSize: null,\n\n /**\n * @var {Object} maxDragImageSize with properties width and height.\n * @private\n */\n maxDragImageSize: null,\n\n /**\n * @property {object} fp for interacting with the file pickers.\n * @private\n */\n fp: null, // Object containing functions associated with the file picker.\n\n /**\n * Initialise the form javascript features.\n *\n * @method\n */\n init: function() {\n dragDropToImageForm.fp = dragDropToImageForm.filePickers();\n\n $('#id_previewareaheader').append(\n '
' +\n '
' +\n ' ' +\n '
' +\n '
' +\n '
' +\n '
');\n\n dragDropToImageForm.updateVisibilityOfFilePickers();\n dragDropToImageForm.setOptionsForDragItemSelectors();\n dragDropToImageForm.setupEventHandlers();\n dragDropToImageForm.waitForFilePickerToInitialise();\n },\n\n /**\n * Waits for the file-pickers to be sufficiently ready before initialising the preview.\n */\n waitForFilePickerToInitialise: function() {\n if (dragDropToImageForm.fp.file('bgimage').href === null) {\n // It would be better to use an onload or onchange event rather than this timeout.\n // Unfortunately attempts to do this early are overwritten by filepicker during its loading.\n setTimeout(dragDropToImageForm.waitForFilePickerToInitialise, 1000);\n return;\n }\n M.util.js_pending('dragDropToImageForm');\n\n // From now on, when a new file gets loaded into the filepicker, update the preview.\n // This is not in the setupEventHandlers section as it needs to be delayed until\n // after filepicker's javascript has finished.\n $('form.mform[data-qtype=\"ddimageortext\"]').on('change', '.filepickerhidden', function() {\n M.util.js_pending('dragDropToImageForm');\n dragDropToImageForm.loadPreviewImage();\n });\n\n dragDropToImageForm.loadPreviewImage();\n },\n\n /**\n * Loads the preview background image.\n */\n loadPreviewImage: function() {\n $('fieldset#id_previewareaheader .dropbackground')\n .one('load', dragDropToImageForm.afterPreviewImageLoaded)\n .attr('src', dragDropToImageForm.fp.file('bgimage').href);\n },\n\n /**\n * After the background image is loaded, continue setting up the preview.\n */\n afterPreviewImageLoaded: function() {\n dragDropToImageForm.createDropZones();\n M.util.js_complete('dragDropToImageForm');\n },\n\n /**\n * Create, or recreate all the drop zones.\n */\n createDropZones: function() {\n var dropZoneHolder = $('.dropzones');\n dropZoneHolder.empty();\n\n var bgimageurl = dragDropToImageForm.fp.file('bgimage').href;\n if (bgimageurl === null) {\n return; // There is not currently a valid preview to update.\n }\n\n var numDrops = dragDropToImageForm.form.getFormValue('nodropzone', []);\n for (var dropNo = 0; dropNo < numDrops; dropNo++) {\n var dragNo = dragDropToImageForm.form.getFormValue('drops', [dropNo, 'choice']);\n if (dragNo === '0') {\n continue;\n }\n dragNo = dragNo - 1;\n var group = dragDropToImageForm.form.getFormValue('drags', [dragNo, 'draggroup']),\n label = dragDropToImageForm.form.getFormValue('draglabel', [dragNo]);\n if ('image' === dragDropToImageForm.form.getFormValue('drags', [dragNo, 'dragitemtype'])) {\n var imgUrl = dragDropToImageForm.fp.file('dragitem[' + dragNo + ']').href;\n if (imgUrl === null) {\n continue;\n }\n // Althoug these are previews of drops, we also add the class name 'drag',\n dropZoneHolder.append('\"'');\n\n } else if (label !== '') {\n dropZoneHolder.append('
' + label + '
');\n }\n }\n\n dragDropToImageForm.waitForAllDropImagesToBeLoaded();\n },\n\n /**\n * This polls until all the drop-zone images have loaded, and then calls updateDropZones().\n */\n waitForAllDropImagesToBeLoaded: function() {\n var notYetLoadedImages = $('.dropzones img').not(function(i, imgNode) {\n return dragDropToImageForm.imageIsLoaded(imgNode);\n });\n\n if (notYetLoadedImages.length > 0) {\n setTimeout(function() {\n dragDropToImageForm.waitForAllDropImagesToBeLoaded();\n }, 100);\n return;\n }\n\n dragDropToImageForm.updateDropZones();\n },\n\n /**\n * Check if an image has loaded without errors.\n *\n * @param {HTMLImageElement} imgElement an image.\n * @returns {boolean} true if this image has loaded without errors.\n */\n imageIsLoaded: function(imgElement) {\n return imgElement.complete && imgElement.naturalHeight !== 0;\n },\n\n /**\n * Set the size and position of all the drop zones.\n */\n updateDropZones: function() {\n var bgimageurl = dragDropToImageForm.fp.file('bgimage').href;\n if (bgimageurl === null) {\n return; // There is not currently a valid preview to update.\n }\n\n var dropBackgroundPosition = $('fieldset#id_previewareaheader .dropbackground').offset(),\n numDrops = dragDropToImageForm.form.getFormValue('nodropzone', []);\n\n // Move each drop to the right position and update the text.\n for (var dropNo = 0; dropNo < numDrops; dropNo++) {\n var drop = $('.dropzones .drop' + dropNo);\n if (drop.length === 0) {\n continue;\n }\n var dragNo = dragDropToImageForm.form.getFormValue('drops', [dropNo, 'choice']) - 1;\n\n drop.offset({\n left: dropBackgroundPosition.left +\n parseInt(dragDropToImageForm.form.getFormValue('drops', [dropNo, 'xleft'])),\n top: dropBackgroundPosition.top +\n parseInt(dragDropToImageForm.form.getFormValue('drops', [dropNo, 'ytop']))\n });\n\n var label = dragDropToImageForm.form.getFormValue('draglabel', [dragNo]);\n if (drop.is('img')) {\n drop.attr('alt', label);\n } else {\n drop.html(label);\n }\n }\n\n // Resize them to the same size.\n $('.dropzones .droppreview').css('padding', '0');\n var numGroups = $('.draggroup select').first().find('option').length;\n for (var group = 1; group <= numGroups; group++) {\n dragDropToImageForm.resizeAllDragsAndDropsInGroup(group);\n }\n },\n\n /**\n * In a given group, set all the drags and drops to be the same size.\n *\n * @param {int} group the group number.\n */\n resizeAllDragsAndDropsInGroup: function(group) {\n var drops = $('.dropzones .droppreview.group' + group),\n maxWidth = 0,\n maxHeight = 0;\n\n // Find the maximum size of any drag in this groups.\n drops.each(function(i, drop) {\n maxWidth = Math.max(maxWidth, Math.ceil(drop.offsetWidth));\n maxHeight = Math.max(maxHeight, Math.ceil(drop.offsetHeight));\n });\n\n // The size we will want to set is a bit bigger than this.\n maxWidth += 10;\n maxHeight += 10;\n\n // Set each drag home to that size.\n drops.each(function(i, drop) {\n var left = Math.round((maxWidth - drop.offsetWidth) / 2),\n top = Math.floor((maxHeight - drop.offsetHeight) / 2);\n // Set top and left padding so the item is centred.\n $(drop).css({\n 'padding-left': left + 'px',\n 'padding-right': (maxWidth - drop.offsetWidth - left) + 'px',\n 'padding-top': top + 'px',\n 'padding-bottom': (maxHeight - drop.offsetHeight - top) + 'px'\n });\n });\n },\n\n /**\n * Events linked to form actions.\n */\n setupEventHandlers: function() {\n // Changes to settings in the draggable items section.\n $('fieldset#id_draggableitemheader')\n .on('change input', 'input, select', function(e) {\n var input = $(e.target).closest('select, input');\n if (input.hasClass('dragitemtype')) {\n dragDropToImageForm.updateVisibilityOfFilePickers();\n }\n\n dragDropToImageForm.setOptionsForDragItemSelectors();\n\n if (input.is('.dragitemtype, .draggroup')) {\n dragDropToImageForm.createDropZones();\n } else if (input.is('.draglabel')) {\n dragDropToImageForm.updateDropZones();\n }\n });\n\n // Changes to Drop zones section: left, top and drag item.\n $('fieldset#id_dropzoneheader').on('change input', 'input, select', function(e) {\n var input = $(e.target).closest('select, input');\n if (input.is('select')) {\n dragDropToImageForm.createDropZones();\n } else {\n dragDropToImageForm.updateDropZones();\n }\n });\n\n // Moving drop zones in the preview.\n $('fieldset#id_previewareaheader').on('mousedown touchstart', '.droppreview', function(e) {\n dragDropToImageForm.dragStart(e);\n });\n\n $(window).on('resize', function() {\n dragDropToImageForm.updateDropZones();\n });\n },\n\n /**\n * Update all the drag item filepickers, so they are only shown for\n */\n updateVisibilityOfFilePickers: function() {\n var numDrags = dragDropToImageForm.form.getFormValue('noitems', []);\n for (var dragNo = 0; dragNo < numDrags; dragNo++) {\n var picker = $('input#id_dragitem_' + dragNo).closest('.fitem_ffilepicker');\n if ('image' === dragDropToImageForm.form.getFormValue('drags', [dragNo, 'dragitemtype'])) {\n picker.show();\n } else {\n picker.hide();\n }\n }\n },\n\n\n setOptionsForDragItemSelectors: function() {\n var dragItemOptions = {'0': ''},\n numDrags = dragDropToImageForm.form.getFormValue('noitems', []),\n numDrops = dragDropToImageForm.form.getFormValue('nodropzone', []);\n\n // Work out the list of options.\n for (var dragNo = 0; dragNo < numDrags; dragNo++) {\n var label = dragDropToImageForm.form.getFormValue('draglabel', [dragNo]);\n var file = dragDropToImageForm.fp.file(dragDropToImageForm.form.toNameWithIndex('dragitem', [dragNo]));\n if ('image' === dragDropToImageForm.form.getFormValue('drags', [dragNo, 'dragitemtype']) && file.name !== null) {\n dragItemOptions[dragNo + 1] = (dragNo + 1) + '. ' + label + ' (' + file.name + ')';\n } else if (label !== '') {\n dragItemOptions[dragNo + 1] = (dragNo + 1) + '. ' + label;\n }\n }\n\n // Initialise each select.\n for (var dropNo = 0; dropNo < numDrops; dropNo++) {\n var selector = $('#id_drops_' + dropNo + '_choice');\n\n var selectedvalue = selector.val();\n selector.find('option').remove();\n for (var value in dragItemOptions) {\n if (!dragItemOptions.hasOwnProperty(value)) {\n continue;\n }\n selector.append('');\n var optionnode = selector.find('option[value=\"' + value + '\"]');\n if (parseInt(value) === parseInt(selectedvalue)) {\n optionnode.attr('selected', true);\n } else if (dragDropToImageForm.isItemUsed(parseInt(value))) {\n optionnode.attr('disabled', true);\n }\n }\n }\n },\n\n /**\n * Checks if the specified drag option is already used somewhere.\n *\n * @param {Number} value of the drag item to check\n * @return {Boolean} true if item is allocated to dropzone\n */\n isItemUsed: function(value) {\n if (value === 0) {\n return false; // None option can always be selected.\n }\n\n if (dragDropToImageForm.form.getFormValue('drags', [value - 1, 'infinite'])) {\n return false; // Infinite, so can't be used up.\n }\n\n return $('fieldset#id_dropzoneheader select').filter(function(i, selectNode) {\n return parseInt($(selectNode).val()) === value;\n }).length !== 0;\n },\n\n /**\n * Handles when a dropzone in dragged in the preview.\n * @param {Object} e Event object\n */\n dragStart: function(e) {\n var drop = $(e.target).closest('.droppreview');\n\n var info = dragDrop.prepare(e);\n if (!info.start) {\n return;\n }\n\n dragDrop.start(e, drop, function(x, y, drop) {\n dragDropToImageForm.dragMove(drop);\n }, function() {\n dragDropToImageForm.dragEnd();\n });\n },\n\n /**\n * Handles update while a drop is being dragged.\n *\n * @param {jQuery} drop the drop preview being moved.\n */\n dragMove: function(drop) {\n var backgroundImage = $('fieldset#id_previewareaheader .dropbackground'),\n backgroundPosition = backgroundImage.offset(),\n dropNo = drop.data('dropNo'),\n dropPosition = drop.offset(),\n left = Math.round(dropPosition.left - backgroundPosition.left),\n top = Math.round(dropPosition.top - backgroundPosition.top);\n\n // Constrain coordinates to be inside the background.\n left = Math.round(Math.max(0, Math.min(left, backgroundImage.outerWidth() - drop.outerWidth())));\n top = Math.round(Math.max(0, Math.min(top, backgroundImage.outerHeight() - drop.outerHeight())));\n\n // Update the form.\n dragDropToImageForm.form.setFormValue('drops', [dropNo, 'xleft'], left);\n dragDropToImageForm.form.setFormValue('drops', [dropNo, 'ytop'], top);\n },\n\n /**\n * Handles when the drag ends.\n */\n dragEnd: function() {\n // Redraw, in case the position was constrained.\n dragDropToImageForm.updateDropZones();\n },\n\n /**\n * Low level operations on form.\n */\n form: {\n toNameWithIndex: function(name, indexes) {\n var indexString = name;\n for (var i = 0; i < indexes.length; i++) {\n indexString = indexString + '[' + indexes[i] + ']';\n }\n return indexString;\n },\n\n getEl: function(name, indexes) {\n var form = $('form.mform[data-qtype=\"ddimageortext\"]')[0];\n return form.elements[this.toNameWithIndex(name, indexes)];\n },\n\n /**\n * Helper to get the value of a form elements with name like \"drops[0][xleft]\".\n *\n * @param {String} name the base name, e.g. 'drops'.\n * @param {String[]} indexes the indexes, e.g. ['0', 'xleft'].\n * @return {String} the value of that field.\n */\n getFormValue: function(name, indexes) {\n var el = this.getEl(name, indexes);\n if (!el.type) {\n el = el[el.length - 1];\n }\n if (el.type === 'checkbox') {\n return el.checked;\n } else {\n return el.value;\n }\n },\n\n /**\n * Helper to get the value of a form elements with name like \"drops[0][xleft]\".\n *\n * @param {String} name the base name, e.g. 'drops'.\n * @param {String[]} indexes the indexes, e.g. ['0', 'xleft'].\n * @param {String|Number} value the value to set.\n */\n setFormValue: function(name, indexes, value) {\n var el = this.getEl(name, indexes);\n if (el.type === 'checkbox') {\n el.checked = value;\n } else {\n el.value = value;\n }\n }\n },\n\n /**\n * Utility to get the file name and url from the filepicker.\n * @returns {Object} object containing functions {file, name}\n */\n filePickers: function() {\n var draftItemIdsToName;\n var nameToParentNode;\n\n if (draftItemIdsToName === undefined) {\n draftItemIdsToName = {};\n nameToParentNode = {};\n var fp = $('form.mform[data-qtype=\"ddimageortext\"] input.filepickerhidden');\n fp.each(function(index, filepicker) {\n draftItemIdsToName[filepicker.value] = filepicker.name;\n nameToParentNode[filepicker.name] = filepicker.parentNode;\n });\n }\n\n return {\n file: function(name) {\n var parentNode = $(nameToParentNode[name]);\n var fileAnchor = parentNode.find('div.filepicker-filelist a');\n if (fileAnchor.length) {\n return {href: fileAnchor.get(0).href, name: fileAnchor.get(0).innerHTML};\n } else {\n return {href: null, name: null};\n }\n },\n\n name: function(draftitemid) {\n return draftItemIdsToName[draftitemid];\n }\n };\n }\n };\n\n return {\n init: dragDropToImageForm.init\n };\n});\n"],"file":"form.min.js"} \ No newline at end of file diff --git a/question/type/ddimageortext/amd/build/question.min.js.map b/question/type/ddimageortext/amd/build/question.min.js.map index 62a32ea1e2d86..92e785416c058 100644 --- a/question/type/ddimageortext/amd/build/question.min.js.map +++ b/question/type/ddimageortext/amd/build/question.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/question.js"],"names":["define","$","dragDrop","keys","DragDropOntoImageQuestion","containerId","readOnly","places","M","util","js_pending","allImagesLoaded","imageLoadingTimeoutId","isPrinting","getRoot","addClass","thisQ","getNotYetLoadedImages","one","waitForAllImagesToBeLoaded","prototype","clearTimeout","length","setTimeout","setupQuestion","find","not","i","imgNode","imageIsLoaded","imgElement","complete","naturalHeight","resizeAllDragsAndDrops","cloneDrags","positionDragsAndDrops","js_complete","each","node","resizeAllDragsAndDropsInGroup","getClassnameNumericSuffix","group","root","dragHomes","maxWidth","maxHeight","drag","Math","max","ceil","offsetWidth","offsetHeight","left","round","top","floor","css","hasOwnProperty","place","label","text","parseInt","get_string","append","width","height","index","dragHome","placeHolder","clone","removeClass","getChoice","getGroup","before","cloneDragsForOneChoice","hasClass","noOfDrags","noOfDropsInGroup","cloneDrag","offset","bgRatio","dropNode","drop","getPlace","xy","data","handleElementScale","dragNode","currentPlace","removeAttr","inputNode","input","choice","val","unplacedDrag","getUnplacedChoice","hiddenDrag","getDragClone","getInfiniteDragClones","after","sendDragToDrop","handleDragStart","e","target","closest","currentIndex","calculateZIndex","info","prepare","start","setInputValue","hiddenDrop","getDrop","questionManager","addEventHandlersToDrag","x","y","dragMove","dragEnd","pageX","pageY","highlighted","isPointInDrop","isDragSameAsDrop","placed","placedNode","placedDrag","sendDragHome","oldDrag","getCurrentDragInPlace","focus","attr","animateTo","getDragHome","handleKeyPress","currentDrag","nextDrag","keyCode","space","arrowRight","arrowDown","getNextDrag","arrowLeft","arrowUp","getPreviousDrag","escape","isKeyboardNavigation","preventDefault","numChoices","noOfChoicesInGroup","next","previous","currentPos","targetPos","animate","duration","done","trigger","position","outerWidth","outerHeight","document","getElementById","bgImage","is","slice","prefix","classes","classesArr","split","patt1","RegExp","test","match","exec","inHome","handleResize","parseFloat","key","bgImg","bgImgNaturalWidth","get","naturalWidth","bgImgClientWidth","element","type","zIndex","itemZIndex","eventHandlersInitialised","questions","init","setupEventHandlers","on","handleDragMoved","window","handleWindowResize","addEventListener","fixLayoutIfThingsMoved","unbind","question","getQuestionForEvent","removeData","first","remove","currentTarget"],"mappings":"AAsBAA,OAAM,gCAAC,CAAC,QAAD,CAAW,eAAX,C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ACkG,UAAP,CAAkB,SAAlB,CACH,CACD,GAAIxF,CAAe,CAACiC,oBAApB,CAA0C,CACtCjC,CAAe,CAACiC,oBAAhB,GACH,CACJ,CA3KiB,CAkLlBsD,mBAAmB,CAAE,6BAASlG,CAAT,CAAY,CAC7B,GAAIjG,CAAAA,CAAW,CAAGJ,CAAC,CAACqG,CAAC,CAACsG,aAAH,CAAD,CAAmBpG,OAAnB,CAA2B,oBAA3B,EAAiD2B,IAAjD,CAAsD,IAAtD,CAAlB,CACA,MAAOlB,CAAAA,CAAe,CAAC4E,SAAhB,CAA0BxL,CAA1B,CACV,CArLiB,CAAtB,CA2LA,MAAO,CAQHyL,IAAI,CAAE7E,CAAe,CAAC6E,IARnB,CAUV,CA7lCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/*\n * JavaScript to allow dragging options to slots (using mouse down or touch) or tab through slots using keyboard.\n *\n * @module qtype_ddimageortext/question\n * @copyright 2018 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/dragdrop', 'core/key_codes'], function($, dragDrop, keys) {\n\n \"use strict\";\n\n /**\n * Initialise one drag-drop onto image question.\n *\n * @param {String} containerId id of the outer div for this question.\n * @param {boolean} readOnly whether the question is being displayed read-only.\n * @param {Array} places Information about the drop places.\n * @constructor\n */\n function DragDropOntoImageQuestion(containerId, readOnly, places) {\n this.containerId = containerId;\n M.util.js_pending('qtype_ddimageortext-init-' + this.containerId);\n this.places = places;\n this.allImagesLoaded = false;\n this.imageLoadingTimeoutId = null;\n this.isPrinting = false;\n if (readOnly) {\n this.getRoot().addClass('qtype_ddimageortext-readonly');\n }\n\n var thisQ = this;\n this.getNotYetLoadedImages().one('load', function() {\n thisQ.waitForAllImagesToBeLoaded();\n });\n this.waitForAllImagesToBeLoaded();\n }\n\n /**\n * Waits until all images are loaded before calling setupQuestion().\n *\n * This function is called from the onLoad of each image, and also polls with\n * a time-out, because image on-loads are allegedly unreliable.\n */\n DragDropOntoImageQuestion.prototype.waitForAllImagesToBeLoaded = function() {\n var thisQ = this;\n\n // This method may get called multiple times (via image on-loads or timeouts.\n // If we are already done, don't do it again.\n if (this.allImagesLoaded) {\n return;\n }\n\n // Clear any current timeout, if set.\n if (this.imageLoadingTimeoutId !== null) {\n clearTimeout(this.imageLoadingTimeoutId);\n }\n\n // If we have not yet loaded all images, set a timeout to\n // call ourselves again, since apparently images on-load\n // events are flakey.\n if (this.getNotYetLoadedImages().length > 0) {\n this.imageLoadingTimeoutId = setTimeout(function() {\n thisQ.waitForAllImagesToBeLoaded();\n }, 100);\n return;\n }\n\n // We now have all images. Carry on, but only after giving the layout a chance to settle down.\n this.allImagesLoaded = true;\n thisQ.setupQuestion();\n };\n\n /**\n * Get any of the images in the drag-drop area that are not yet fully loaded.\n *\n * @returns {jQuery} those images.\n */\n DragDropOntoImageQuestion.prototype.getNotYetLoadedImages = function() {\n var thisQ = this;\n return this.getRoot().find('.ddarea img').not(function(i, imgNode) {\n return thisQ.imageIsLoaded(imgNode);\n });\n };\n\n /**\n * Check if an image has loaded without errors.\n *\n * @param {HTMLImageElement} imgElement an image.\n * @returns {boolean} true if this image has loaded without errors.\n */\n DragDropOntoImageQuestion.prototype.imageIsLoaded = function(imgElement) {\n return imgElement.complete && imgElement.naturalHeight !== 0;\n };\n\n /**\n * Set up the question, once all images have been loaded.\n */\n DragDropOntoImageQuestion.prototype.setupQuestion = function() {\n this.resizeAllDragsAndDrops();\n this.cloneDrags();\n this.positionDragsAndDrops();\n M.util.js_complete('qtype_ddimageortext-init-' + this.containerId);\n };\n\n /**\n * In each group, resize all the items to be the same size.\n */\n DragDropOntoImageQuestion.prototype.resizeAllDragsAndDrops = function() {\n var thisQ = this;\n this.getRoot().find('.draghomes > div').each(function(i, node) {\n thisQ.resizeAllDragsAndDropsInGroup(\n thisQ.getClassnameNumericSuffix($(node), 'dragitemgroup'));\n });\n };\n\n /**\n * In a given group, set all the drags and drops to be the same size.\n *\n * @param {int} group the group number.\n */\n DragDropOntoImageQuestion.prototype.resizeAllDragsAndDropsInGroup = function(group) {\n var root = this.getRoot(),\n dragHomes = root.find('.dragitemgroup' + group + ' .draghome'),\n maxWidth = 0,\n maxHeight = 0;\n\n // Find the maximum size of any drag in this groups.\n dragHomes.each(function(i, drag) {\n maxWidth = Math.max(maxWidth, Math.ceil(drag.offsetWidth));\n maxHeight = Math.max(maxHeight, Math.ceil(drag.offsetHeight));\n });\n\n // The size we will want to set is a bit bigger than this.\n maxWidth += 10;\n maxHeight += 10;\n\n // Set each drag home to that size.\n dragHomes.each(function(i, drag) {\n var left = Math.round((maxWidth - drag.offsetWidth) / 2),\n top = Math.floor((maxHeight - drag.offsetHeight) / 2);\n // Set top and left padding so the item is centred.\n $(drag).css({\n 'padding-left': left + 'px',\n 'padding-right': (maxWidth - drag.offsetWidth - left) + 'px',\n 'padding-top': top + 'px',\n 'padding-bottom': (maxHeight - drag.offsetHeight - top) + 'px'\n });\n });\n\n // Create the drops and make them the right size.\n for (var i in this.places) {\n if (!this.places.hasOwnProperty((i))) {\n continue;\n }\n var place = this.places[i],\n label = place.text;\n if (parseInt(place.group) !== group) {\n continue;\n }\n if (label === '') {\n label = M.util.get_string('blank', 'qtype_ddimageortext');\n }\n root.find('.dropzones').append('
' +\n '' + label + ' 
');\n root.find('.dropzone.place' + i).width(maxWidth - 2).height(maxHeight - 2);\n }\n };\n\n /**\n * Invisible 'drag homes' are output by the renderer. These have the same properties\n * as the drag items but are invisible. We clone these invisible elements to make the\n * actual drag items.\n */\n DragDropOntoImageQuestion.prototype.cloneDrags = function() {\n var thisQ = this;\n thisQ.getRoot().find('.draghome').each(function(index, dragHome) {\n var drag = $(dragHome);\n var placeHolder = drag.clone();\n placeHolder.removeClass();\n placeHolder.addClass('draghome choice' +\n thisQ.getChoice(drag) + ' group' +\n thisQ.getGroup(drag) + ' dragplaceholder');\n drag.before(placeHolder);\n });\n };\n\n /**\n * Clone drag item for one choice.\n *\n * @param {jQuery} dragHome the drag home to clone.\n */\n DragDropOntoImageQuestion.prototype.cloneDragsForOneChoice = function(dragHome) {\n if (dragHome.hasClass('infinite')) {\n var noOfDrags = this.noOfDropsInGroup(this.getGroup(dragHome));\n for (var i = 0; i < noOfDrags; i++) {\n this.cloneDrag(dragHome);\n }\n } else {\n this.cloneDrag(dragHome);\n }\n };\n\n /**\n * Clone drag item.\n *\n * @param {jQuery} dragHome\n */\n DragDropOntoImageQuestion.prototype.cloneDrag = function(dragHome) {\n var drag = dragHome.clone();\n drag.removeClass('draghome')\n .addClass('drag unplaced moodle-has-zindex')\n .offset(dragHome.offset());\n this.getRoot().find('.dragitems').append(drag);\n };\n\n /**\n * Update the position of drags.\n */\n DragDropOntoImageQuestion.prototype.positionDragsAndDrops = function() {\n var thisQ = this,\n root = this.getRoot(),\n bgRatio = this.bgRatio();\n\n // Move the drops into position.\n root.find('.ddarea .dropzone').each(function(i, dropNode) {\n var drop = $(dropNode),\n place = thisQ.places[thisQ.getPlace(drop)];\n // The xy values come from PHP as strings, so we need parseInt to stop JS doing string concatenation.\n drop.css('left', parseInt(place.xy[0]) * bgRatio)\n .css('top', parseInt(place.xy[1]) * bgRatio);\n drop.data('originX', parseInt(place.xy[0]))\n .data('originY', parseInt(place.xy[1]));\n thisQ.handleElementScale(drop, 'left top');\n });\n\n // First move all items back home.\n root.find('.draghome').not('.dragplaceholder').each(function(i, dragNode) {\n var drag = $(dragNode),\n currentPlace = thisQ.getClassnameNumericSuffix(drag, 'inplace');\n drag.addClass('unplaced')\n .removeClass('placed');\n drag.removeAttr('tabindex');\n if (currentPlace !== null) {\n drag.removeClass('inplace' + currentPlace);\n }\n });\n\n // Then place the ones that should be placed.\n root.find('input.placeinput').each(function(i, inputNode) {\n var input = $(inputNode),\n choice = input.val();\n if (choice.length === 0 || (choice.length > 0 && choice === '0')) {\n // No item in this place.\n return;\n }\n\n var place = thisQ.getPlace(input);\n // Get the unplaced drag.\n var unplacedDrag = thisQ.getUnplacedChoice(thisQ.getGroup(input), choice);\n // Get the clone of the drag.\n var hiddenDrag = thisQ.getDragClone(unplacedDrag);\n if (hiddenDrag.length) {\n if (unplacedDrag.hasClass('infinite')) {\n var noOfDrags = thisQ.noOfDropsInGroup(thisQ.getGroup(unplacedDrag));\n var cloneDrags = thisQ.getInfiniteDragClones(unplacedDrag, false);\n if (cloneDrags.length < noOfDrags) {\n var cloneDrag = unplacedDrag.clone();\n cloneDrag.removeClass('beingdragged');\n cloneDrag.removeAttr('tabindex');\n hiddenDrag.after(cloneDrag);\n } else {\n hiddenDrag.addClass('active');\n }\n } else {\n hiddenDrag.addClass('active');\n }\n }\n\n // Send the drag to drop.\n var drop = root.find('.dropzone.place' + place);\n thisQ.sendDragToDrop(unplacedDrag, drop);\n });\n };\n\n /**\n * Handles the start of dragging an item.\n *\n * @param {Event} e the touch start or mouse down event.\n */\n DragDropOntoImageQuestion.prototype.handleDragStart = function(e) {\n var thisQ = this,\n drag = $(e.target).closest('.draghome'),\n currentIndex = this.calculateZIndex(),\n newIndex = currentIndex + 2;\n\n var info = dragDrop.prepare(e);\n if (!info.start) {\n return;\n }\n\n drag.addClass('beingdragged').css('transform', '').css('z-index', newIndex);\n var currentPlace = this.getClassnameNumericSuffix(drag, 'inplace');\n if (currentPlace !== null) {\n this.setInputValue(currentPlace, 0);\n drag.removeClass('inplace' + currentPlace);\n var hiddenDrop = thisQ.getDrop(drag, currentPlace);\n if (hiddenDrop.length) {\n hiddenDrop.addClass('active');\n drag.offset(hiddenDrop.offset());\n }\n } else {\n var hiddenDrag = thisQ.getDragClone(drag);\n if (hiddenDrag.length) {\n if (drag.hasClass('infinite')) {\n var noOfDrags = this.noOfDropsInGroup(thisQ.getGroup(drag));\n var cloneDrags = this.getInfiniteDragClones(drag, false);\n if (cloneDrags.length < noOfDrags) {\n var cloneDrag = drag.clone();\n cloneDrag.removeClass('beingdragged');\n cloneDrag.removeAttr('tabindex');\n hiddenDrag.after(cloneDrag);\n questionManager.addEventHandlersToDrag(cloneDrag);\n drag.offset(cloneDrag.offset());\n } else {\n hiddenDrag.addClass('active');\n drag.offset(hiddenDrag.offset());\n }\n } else {\n hiddenDrag.addClass('active');\n drag.offset(hiddenDrag.offset());\n }\n }\n }\n\n dragDrop.start(e, drag, function(x, y, drag) {\n thisQ.dragMove(x, y, drag);\n }, function(x, y, drag) {\n thisQ.dragEnd(x, y, drag);\n });\n };\n\n /**\n * Called whenever the currently dragged items moves.\n *\n * @param {Number} pageX the x position.\n * @param {Number} pageY the y position.\n * @param {jQuery} drag the item being moved.\n */\n DragDropOntoImageQuestion.prototype.dragMove = function(pageX, pageY, drag) {\n var thisQ = this,\n highlighted = false;\n this.getRoot().find('.dropzone.group' + this.getGroup(drag)).each(function(i, dropNode) {\n var drop = $(dropNode);\n if (thisQ.isPointInDrop(pageX, pageY, drop) && !highlighted) {\n highlighted = true;\n drop.addClass('valid-drag-over-drop');\n } else {\n drop.removeClass('valid-drag-over-drop');\n }\n });\n this.getRoot().find('.draghome.placed.group' + this.getGroup(drag)).not('.beingdragged').each(function(i, dropNode) {\n var drop = $(dropNode);\n if (thisQ.isPointInDrop(pageX, pageY, drop) && !highlighted && !thisQ.isDragSameAsDrop(drag, drop)) {\n highlighted = true;\n drop.addClass('valid-drag-over-drop');\n } else {\n drop.removeClass('valid-drag-over-drop');\n }\n });\n };\n\n /**\n * Called when user drops a drag item.\n *\n * @param {Number} pageX the x position.\n * @param {Number} pageY the y position.\n * @param {jQuery} drag the item being moved.\n */\n DragDropOntoImageQuestion.prototype.dragEnd = function(pageX, pageY, drag) {\n var thisQ = this,\n root = this.getRoot(),\n placed = false;\n\n // Looking for drag that was dropped on a dropzone.\n root.find('.dropzone.group' + this.getGroup(drag)).each(function(i, dropNode) {\n var drop = $(dropNode);\n if (!thisQ.isPointInDrop(pageX, pageY, drop)) {\n // Not this drop.\n return true;\n }\n\n // Now put this drag into the drop.\n drop.removeClass('valid-drag-over-drop');\n thisQ.sendDragToDrop(drag, drop);\n placed = true;\n return false; // Stop the each() here.\n });\n\n if (!placed) {\n // Looking for drag that was dropped on a placed drag.\n root.find('.draghome.placed.group' + this.getGroup(drag)).not('.beingdragged').each(function(i, placedNode) {\n var placedDrag = $(placedNode);\n if (!thisQ.isPointInDrop(pageX, pageY, placedDrag) || thisQ.isDragSameAsDrop(drag, placedDrag)) {\n // Not this placed drag.\n return true;\n }\n\n // Now put this drag into the drop.\n placedDrag.removeClass('valid-drag-over-drop');\n var currentPlace = thisQ.getClassnameNumericSuffix(placedDrag, 'inplace');\n var drop = thisQ.getDrop(drag, currentPlace);\n thisQ.sendDragToDrop(drag, drop);\n placed = true;\n return false; // Stop the each() here.\n });\n }\n\n if (!placed) {\n this.sendDragHome(drag);\n }\n };\n\n /**\n * Animate a drag item into a given place (or back home).\n *\n * @param {jQuery|null} drag the item to place. If null, clear the place.\n * @param {jQuery} drop the place to put it.\n */\n DragDropOntoImageQuestion.prototype.sendDragToDrop = function(drag, drop) {\n // Is there already a drag in this drop? if so, evict it.\n var oldDrag = this.getCurrentDragInPlace(this.getPlace(drop));\n if (oldDrag.length !== 0) {\n oldDrag.addClass('beingdragged');\n oldDrag.offset(oldDrag.offset());\n var currentPlace = this.getClassnameNumericSuffix(oldDrag, 'inplace');\n var hiddenDrop = this.getDrop(oldDrag, currentPlace);\n hiddenDrop.addClass('active');\n this.sendDragHome(oldDrag);\n }\n\n if (drag.length === 0) {\n this.setInputValue(this.getPlace(drop), 0);\n if (drop.data('isfocus')) {\n drop.focus();\n }\n } else {\n this.setInputValue(this.getPlace(drop), this.getChoice(drag));\n drag.removeClass('unplaced')\n .addClass('placed inplace' + this.getPlace(drop));\n drag.attr('tabindex', 0);\n this.animateTo(drag, drop);\n }\n };\n\n /**\n * Animate a drag back to its home.\n *\n * @param {jQuery} drag the item being moved.\n */\n DragDropOntoImageQuestion.prototype.sendDragHome = function(drag) {\n var currentPlace = this.getClassnameNumericSuffix(drag, 'inplace');\n if (currentPlace !== null) {\n drag.removeClass('inplace' + currentPlace);\n }\n drag.data('unplaced', true);\n\n this.animateTo(drag, this.getDragHome(this.getGroup(drag), this.getChoice(drag)));\n };\n\n /**\n * Handles keyboard events on drops.\n *\n * Drops are focusable. Once focused, right/down/space switches to the next choice, and\n * left/up switches to the previous. Escape clear.\n *\n * @param {KeyboardEvent} e\n */\n DragDropOntoImageQuestion.prototype.handleKeyPress = function(e) {\n var drop = $(e.target).closest('.dropzone');\n if (drop.length === 0) {\n var placedDrag = $(e.target);\n var currentPlace = this.getClassnameNumericSuffix(placedDrag, 'inplace');\n if (currentPlace !== null) {\n drop = this.getDrop(placedDrag, currentPlace);\n }\n }\n var currentDrag = this.getCurrentDragInPlace(this.getPlace(drop)),\n nextDrag = $();\n\n switch (e.keyCode) {\n case keys.space:\n case keys.arrowRight:\n case keys.arrowDown:\n nextDrag = this.getNextDrag(this.getGroup(drop), currentDrag);\n break;\n\n case keys.arrowLeft:\n case keys.arrowUp:\n nextDrag = this.getPreviousDrag(this.getGroup(drop), currentDrag);\n break;\n\n case keys.escape:\n questionManager.isKeyboardNavigation = false;\n break;\n\n default:\n questionManager.isKeyboardNavigation = false;\n return; // To avoid the preventDefault below.\n }\n\n if (nextDrag.length) {\n nextDrag.data('isfocus', true);\n nextDrag.addClass('beingdragged');\n var hiddenDrag = this.getDragClone(nextDrag);\n if (hiddenDrag.length) {\n if (nextDrag.hasClass('infinite')) {\n var noOfDrags = this.noOfDropsInGroup(this.getGroup(nextDrag));\n var cloneDrags = this.getInfiniteDragClones(nextDrag, false);\n if (cloneDrags.length < noOfDrags) {\n var cloneDrag = nextDrag.clone();\n cloneDrag.removeClass('beingdragged');\n cloneDrag.removeAttr('tabindex');\n hiddenDrag.after(cloneDrag);\n questionManager.addEventHandlersToDrag(cloneDrag);\n nextDrag.offset(cloneDrag.offset());\n } else {\n hiddenDrag.addClass('active');\n nextDrag.offset(hiddenDrag.offset());\n }\n } else {\n hiddenDrag.addClass('active');\n nextDrag.offset(hiddenDrag.offset());\n }\n }\n } else {\n drop.data('isfocus', true);\n }\n\n e.preventDefault();\n this.sendDragToDrop(nextDrag, drop);\n };\n\n /**\n * Choose the next drag in a group.\n *\n * @param {int} group which group.\n * @param {jQuery} drag current choice (empty jQuery if there isn't one).\n * @return {jQuery} the next drag in that group, or null if there wasn't one.\n */\n DragDropOntoImageQuestion.prototype.getNextDrag = function(group, drag) {\n var choice,\n numChoices = this.noOfChoicesInGroup(group);\n\n if (drag.length === 0) {\n choice = 1; // Was empty, so we want to select the first choice.\n } else {\n choice = this.getChoice(drag) + 1;\n }\n\n var next = this.getUnplacedChoice(group, choice);\n while (next.length === 0 && choice < numChoices) {\n choice++;\n next = this.getUnplacedChoice(group, choice);\n }\n\n return next;\n };\n\n /**\n * Choose the previous drag in a group.\n *\n * @param {int} group which group.\n * @param {jQuery} drag current choice (empty jQuery if there isn't one).\n * @return {jQuery} the next drag in that group, or null if there wasn't one.\n */\n DragDropOntoImageQuestion.prototype.getPreviousDrag = function(group, drag) {\n var choice;\n\n if (drag.length === 0) {\n choice = this.noOfChoicesInGroup(group);\n } else {\n choice = this.getChoice(drag) - 1;\n }\n\n var previous = this.getUnplacedChoice(group, choice);\n while (previous.length === 0 && choice > 1) {\n choice--;\n previous = this.getUnplacedChoice(group, choice);\n }\n\n // Does this choice exist?\n return previous;\n };\n\n /**\n * Animate an object to the given destination.\n *\n * @param {jQuery} drag the element to be animated.\n * @param {jQuery} target element marking the place to move it to.\n */\n DragDropOntoImageQuestion.prototype.animateTo = function(drag, target) {\n var currentPos = drag.offset(),\n targetPos = target.offset(),\n thisQ = this;\n\n M.util.js_pending('qtype_ddimageortext-animate-' + thisQ.containerId);\n // Animate works in terms of CSS position, whereas locating an object\n // on the page works best with jQuery offset() function. So, to get\n // the right target position, we work out the required change in\n // offset() and then add that to the current CSS position.\n drag.animate(\n {\n left: parseInt(drag.css('left')) + targetPos.left - currentPos.left,\n top: parseInt(drag.css('top')) + targetPos.top - currentPos.top\n },\n {\n duration: 'fast',\n done: function() {\n $('body').trigger('qtype_ddimageortext-dragmoved', [drag, target, thisQ]);\n M.util.js_complete('qtype_ddimageortext-animate-' + thisQ.containerId);\n }\n }\n );\n };\n\n /**\n * Detect if a point is inside a given DOM node.\n *\n * @param {Number} pageX the x position.\n * @param {Number} pageY the y position.\n * @param {jQuery} drop the node to check (typically a drop).\n * @return {boolean} whether the point is inside the node.\n */\n DragDropOntoImageQuestion.prototype.isPointInDrop = function(pageX, pageY, drop) {\n var position = drop.offset();\n if (drop.hasClass('draghome')) {\n return pageX >= position.left && pageX < position.left + drop.outerWidth()\n && pageY >= position.top && pageY < position.top + drop.outerHeight();\n }\n return pageX >= position.left && pageX < position.left + drop.width()\n && pageY >= position.top && pageY < position.top + drop.height();\n };\n\n /**\n * Set the value of the hidden input for a place, to record what is currently there.\n *\n * @param {int} place which place to set the input value for.\n * @param {int} choice the value to set.\n */\n DragDropOntoImageQuestion.prototype.setInputValue = function(place, choice) {\n this.getRoot().find('input.placeinput.place' + place).val(choice);\n };\n\n /**\n * Get the outer div for this question.\n *\n * @returns {jQuery} containing that div.\n */\n DragDropOntoImageQuestion.prototype.getRoot = function() {\n return $(document.getElementById(this.containerId));\n };\n\n /**\n * Get the img that is the background image.\n * @returns {jQuery} containing that img.\n */\n DragDropOntoImageQuestion.prototype.bgImage = function() {\n return this.getRoot().find('img.dropbackground');\n };\n\n /**\n * Get drag home for a given choice.\n *\n * @param {int} group the group.\n * @param {int} choice the choice number.\n * @returns {jQuery} containing that div.\n */\n DragDropOntoImageQuestion.prototype.getDragHome = function(group, choice) {\n if (!this.getRoot().find('.draghome.dragplaceholder.group' + group + '.choice' + choice).is(':visible')) {\n return this.getRoot().find('.dragitemgroup' + group +\n ' .draghome.infinite' +\n '.choice' + choice +\n '.group' + group);\n }\n return this.getRoot().find('.draghome.dragplaceholder.group' + group + '.choice' + choice);\n };\n\n /**\n * Get an unplaced choice for a particular group.\n *\n * @param {int} group the group.\n * @param {int} choice the choice number.\n * @returns {jQuery} jQuery wrapping the unplaced choice. If there isn't one, the jQuery will be empty.\n */\n DragDropOntoImageQuestion.prototype.getUnplacedChoice = function(group, choice) {\n return this.getRoot().find('.ddarea .draghome.group' + group + '.choice' + choice + '.unplaced').slice(0, 1);\n };\n\n /**\n * Get the drag that is currently in a given place.\n *\n * @param {int} place the place number.\n * @return {jQuery} the current drag (or an empty jQuery if none).\n */\n DragDropOntoImageQuestion.prototype.getCurrentDragInPlace = function(place) {\n return this.getRoot().find('.ddarea .draghome.inplace' + place);\n };\n\n /**\n * Return the number of blanks in a given group.\n *\n * @param {int} group the group number.\n * @returns {int} the number of drops.\n */\n DragDropOntoImageQuestion.prototype.noOfDropsInGroup = function(group) {\n return this.getRoot().find('.dropzone.group' + group).length;\n };\n\n /**\n * Return the number of choices in a given group.\n *\n * @param {int} group the group number.\n * @returns {int} the number of choices.\n */\n DragDropOntoImageQuestion.prototype.noOfChoicesInGroup = function(group) {\n return this.getRoot().find('.dragitemgroup' + group + ' .draghome').length;\n };\n\n /**\n * Return the number at the end of the CSS class name with the given prefix.\n *\n * @param {jQuery} node\n * @param {String} prefix name prefix\n * @returns {Number|null} the suffix if found, else null.\n */\n DragDropOntoImageQuestion.prototype.getClassnameNumericSuffix = function(node, prefix) {\n var classes = node.attr('class');\n if (classes !== '') {\n var classesArr = classes.split(' ');\n for (var index = 0; index < classesArr.length; index++) {\n var patt1 = new RegExp('^' + prefix + '([0-9])+$');\n if (patt1.test(classesArr[index])) {\n var patt2 = new RegExp('([0-9])+$');\n var match = patt2.exec(classesArr[index]);\n return Number(match[0]);\n }\n }\n }\n return null;\n };\n\n /**\n * Get the choice number of a drag.\n *\n * @param {jQuery} drag the drag.\n * @returns {Number} the choice number.\n */\n DragDropOntoImageQuestion.prototype.getChoice = function(drag) {\n return this.getClassnameNumericSuffix(drag, 'choice');\n };\n\n /**\n * Given a DOM node that is significant to this question\n * (drag, drop, ...) get the group it belongs to.\n *\n * @param {jQuery} node a DOM node.\n * @returns {Number} the group it belongs to.\n */\n DragDropOntoImageQuestion.prototype.getGroup = function(node) {\n return this.getClassnameNumericSuffix(node, 'group');\n };\n\n /**\n * Get the place number of a drop, or its corresponding hidden input.\n *\n * @param {jQuery} node the DOM node.\n * @returns {Number} the place number.\n */\n DragDropOntoImageQuestion.prototype.getPlace = function(node) {\n return this.getClassnameNumericSuffix(node, 'place');\n };\n\n /**\n * Get drag clone for a given drag.\n *\n * @param {jQuery} drag the drag.\n * @returns {jQuery} the drag's clone.\n */\n DragDropOntoImageQuestion.prototype.getDragClone = function(drag) {\n return this.getRoot().find('.dragitemgroup' +\n this.getGroup(drag) +\n ' .draghome' +\n '.choice' + this.getChoice(drag) +\n '.group' + this.getGroup(drag) +\n '.dragplaceholder');\n };\n\n /**\n * Get infinite drag clones for given drag.\n *\n * @param {jQuery} drag the drag.\n * @param {Boolean} inHome in the home area or not.\n * @returns {jQuery} the drag's clones.\n */\n DragDropOntoImageQuestion.prototype.getInfiniteDragClones = function(drag, inHome) {\n if (inHome) {\n return this.getRoot().find('.dragitemgroup' +\n this.getGroup(drag) +\n ' .draghome' +\n '.choice' + this.getChoice(drag) +\n '.group' + this.getGroup(drag) +\n '.infinite').not('.dragplaceholder');\n }\n return this.getRoot().find('.draghome' +\n '.choice' + this.getChoice(drag) +\n '.group' + this.getGroup(drag) +\n '.infinite').not('.dragplaceholder');\n };\n\n /**\n * Get drop for a given drag and place.\n *\n * @param {jQuery} drag the drag.\n * @param {Integer} currentPlace the current place of drag.\n * @returns {jQuery} the drop's clone.\n */\n DragDropOntoImageQuestion.prototype.getDrop = function(drag, currentPlace) {\n return this.getRoot().find('.dropzone.group' + this.getGroup(drag) + '.place' + currentPlace);\n };\n\n /**\n * Handle when the window is resized.\n */\n DragDropOntoImageQuestion.prototype.handleResize = function() {\n var thisQ = this,\n bgRatio = this.bgRatio();\n if (this.isPrinting) {\n bgRatio = 1;\n }\n\n this.getRoot().find('.ddarea .dropzone').each(function(i, dropNode) {\n $(dropNode)\n .css('left', parseInt($(dropNode).data('originX')) * parseFloat(bgRatio))\n .css('top', parseInt($(dropNode).data('originY')) * parseFloat(bgRatio));\n thisQ.handleElementScale(dropNode, 'left top');\n });\n\n this.getRoot().find('div.droparea .draghome').not('.beingdragged').each(function(key, drag) {\n $(drag)\n .css('left', parseFloat($(drag).data('originX')) * parseFloat(bgRatio))\n .css('top', parseFloat($(drag).data('originY')) * parseFloat(bgRatio));\n thisQ.handleElementScale(drag, 'left top');\n });\n };\n\n /**\n * Return the background ratio.\n *\n * @returns {number} Background ratio.\n */\n DragDropOntoImageQuestion.prototype.bgRatio = function() {\n var bgImg = this.bgImage();\n var bgImgNaturalWidth = bgImg.get(0).naturalWidth;\n var bgImgClientWidth = bgImg.width();\n\n return bgImgClientWidth / bgImgNaturalWidth;\n };\n\n /**\n * Scale the drag if needed.\n *\n * @param {jQuery} element the item to place.\n * @param {String} type scaling type\n */\n DragDropOntoImageQuestion.prototype.handleElementScale = function(element, type) {\n var bgRatio = parseFloat(this.bgRatio());\n if (this.isPrinting) {\n bgRatio = 1;\n }\n $(element).css({\n '-webkit-transform': 'scale(' + bgRatio + ')',\n '-moz-transform': 'scale(' + bgRatio + ')',\n '-ms-transform': 'scale(' + bgRatio + ')',\n '-o-transform': 'scale(' + bgRatio + ')',\n 'transform': 'scale(' + bgRatio + ')',\n 'transform-origin': type\n });\n };\n\n /**\n * Calculate z-index value.\n *\n * @returns {number} z-index value\n */\n DragDropOntoImageQuestion.prototype.calculateZIndex = function() {\n var zIndex = 0;\n this.getRoot().find('.ddarea .dropzone, div.droparea .draghome').each(function(i, dropNode) {\n dropNode = $(dropNode);\n // Note that webkit browsers won't return the z-index value from the CSS stylesheet\n // if the element doesn't have a position specified. Instead it'll return \"auto\".\n var itemZIndex = dropNode.css('z-index') ? parseInt(dropNode.css('z-index')) : 0;\n\n if (itemZIndex > zIndex) {\n zIndex = itemZIndex;\n }\n });\n\n return zIndex;\n };\n\n /**\n * Check that the drag is drop to it's clone.\n *\n * @param {jQuery} drag The drag.\n * @param {jQuery} drop The drop.\n * @returns {boolean}\n */\n DragDropOntoImageQuestion.prototype.isDragSameAsDrop = function(drag, drop) {\n return this.getChoice(drag) === this.getChoice(drop) && this.getGroup(drag) === this.getGroup(drop);\n };\n\n /**\n * Singleton object that handles all the DragDropOntoImageQuestions\n * on the page, and deals with event dispatching.\n * @type {Object}\n */\n var questionManager = {\n\n /**\n * {boolean} ensures that the event handlers are only initialised once per page.\n */\n eventHandlersInitialised: false,\n\n /**\n * {boolean} is printing or not.\n */\n isPrinting: false,\n\n /**\n * {boolean} is keyboard navigation or not.\n */\n isKeyboardNavigation: false,\n\n /**\n * {Object} all the questions on this page, indexed by containerId (id on the .que div).\n */\n questions: {}, // An object containing all the information about each question on the page.\n\n /**\n * Initialise one question.\n *\n * @param {String} containerId the id of the div.que that contains this question.\n * @param {boolean} readOnly whether the question is read-only.\n * @param {Array} places data.\n */\n init: function(containerId, readOnly, places) {\n questionManager.questions[containerId] =\n new DragDropOntoImageQuestion(containerId, readOnly, places);\n if (!questionManager.eventHandlersInitialised) {\n questionManager.setupEventHandlers();\n questionManager.eventHandlersInitialised = true;\n }\n },\n\n /**\n * Set up the event handlers that make this question type work. (Done once per page.)\n */\n setupEventHandlers: function() {\n // We do not use the body event here to prevent the other event on Mobile device, such as scroll event.\n questionManager.addEventHandlersToDrag($('.que.ddimageortext:not(.qtype_ddimageortext-readonly) .draghome'));\n $('body')\n .on('keydown',\n '.que.ddimageortext:not(.qtype_ddimageortext-readonly) .dropzones .dropzone',\n questionManager.handleKeyPress)\n .on('keydown',\n '.que.ddimageortext:not(.qtype_ddimageortext-readonly) .draghome.placed:not(.beingdragged)',\n questionManager.handleKeyPress)\n .on('qtype_ddimageortext-dragmoved', questionManager.handleDragMoved);\n $(window).on('resize', function() {\n questionManager.handleWindowResize(false);\n });\n window.addEventListener('beforeprint', function() {\n questionManager.isPrinting = true;\n questionManager.handleWindowResize(questionManager.isPrinting);\n });\n window.addEventListener('afterprint', function() {\n questionManager.isPrinting = false;\n questionManager.handleWindowResize(questionManager.isPrinting);\n });\n setTimeout(function() {\n questionManager.fixLayoutIfThingsMoved();\n }, 100);\n },\n\n /**\n * Binding the drag/touch event again for newly created element.\n *\n * @param {jQuery} element Element to bind the event\n */\n addEventHandlersToDrag: function(element) {\n // Unbind all the mousedown and touchstart events to prevent double binding.\n element.unbind('mousedown touchstart');\n element.on('mousedown touchstart', questionManager.handleDragStart);\n },\n\n /**\n * Handle mouse down / touch start events on drags.\n * @param {Event} e the DOM event.\n */\n handleDragStart: function(e) {\n e.preventDefault();\n var question = questionManager.getQuestionForEvent(e);\n if (question) {\n question.handleDragStart(e);\n }\n },\n\n /**\n * Handle key down / press events on drags.\n * @param {KeyboardEvent} e\n */\n handleKeyPress: function(e) {\n if (questionManager.isKeyboardNavigation) {\n return;\n }\n questionManager.isKeyboardNavigation = true;\n var question = questionManager.getQuestionForEvent(e);\n if (question) {\n question.handleKeyPress(e);\n }\n },\n\n /**\n * Handle when the window is resized.\n * @param {boolean} isPrinting\n */\n handleWindowResize: function(isPrinting) {\n for (var containerId in questionManager.questions) {\n if (questionManager.questions.hasOwnProperty(containerId)) {\n questionManager.questions[containerId].isPrinting = isPrinting;\n questionManager.questions[containerId].handleResize();\n }\n }\n },\n\n /**\n * Sometimes, despite our best efforts, things change in a way that cannot\n * be specifically caught (e.g. dock expanding or collapsing in Boost).\n * Therefore, we need to periodically check everything is in the right position.\n */\n fixLayoutIfThingsMoved: function() {\n this.handleWindowResize(questionManager.isPrinting);\n // We use setTimeout after finishing work, rather than setInterval,\n // in case positioning things is slow. We want 100 ms gap\n // between executions, not what setInterval does.\n setTimeout(function() {\n questionManager.fixLayoutIfThingsMoved(questionManager.isPrinting);\n }, 100);\n },\n\n /**\n * Handle when drag moved.\n *\n * @param {Event} e the event.\n * @param {jQuery} drag the drag\n * @param {jQuery} target the target\n * @param {DragDropOntoImageQuestion} thisQ the question.\n */\n handleDragMoved: function(e, drag, target, thisQ) {\n drag.removeClass('beingdragged').css('z-index', '');\n drag.css('top', target.position().top).css('left', target.position().left);\n target.after(drag);\n target.removeClass('active');\n if (typeof drag.data('unplaced') !== 'undefined' && drag.data('unplaced') === true) {\n drag.removeClass('placed').addClass('unplaced');\n drag.removeAttr('tabindex');\n drag.removeData('unplaced');\n drag.css('top', '')\n .css('left', '')\n .css('transform', '');\n if (drag.hasClass('infinite') && thisQ.getInfiniteDragClones(drag, true).length > 1) {\n thisQ.getInfiniteDragClones(drag, true).first().remove();\n }\n } else {\n drag.data('originX', target.data('originX')).data('originY', target.data('originY'));\n thisQ.handleElementScale(drag, 'left top');\n }\n if (typeof drag.data('isfocus') !== 'undefined' && drag.data('isfocus') === true) {\n drag.focus();\n drag.removeData('isfocus');\n }\n if (typeof target.data('isfocus') !== 'undefined' && target.data('isfocus') === true) {\n target.removeData('isfocus');\n }\n if (questionManager.isKeyboardNavigation) {\n questionManager.isKeyboardNavigation = false;\n }\n },\n\n /**\n * Given an event, work out which question it effects.\n * @param {Event} e the event.\n * @returns {DragDropOntoImageQuestion|undefined} The question, or undefined.\n */\n getQuestionForEvent: function(e) {\n var containerId = $(e.currentTarget).closest('.que.ddimageortext').attr('id');\n return questionManager.questions[containerId];\n }\n };\n\n /**\n * @alias module:qtype_ddimageortext/question\n */\n return {\n /**\n * Initialise one drag-drop onto image question.\n *\n * @param {String} containerId id of the outer div for this question.\n * @param {boolean} readOnly whether the question is being displayed read-only.\n * @param {Array} Information about the drop places.\n */\n init: questionManager.init\n };\n});\n"],"file":"question.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/question.js"],"names":["define","$","dragDrop","keys","DragDropOntoImageQuestion","containerId","readOnly","places","M","util","js_pending","allImagesLoaded","imageLoadingTimeoutId","isPrinting","getRoot","addClass","thisQ","getNotYetLoadedImages","one","waitForAllImagesToBeLoaded","prototype","clearTimeout","length","setTimeout","setupQuestion","find","not","i","imgNode","imageIsLoaded","imgElement","complete","naturalHeight","resizeAllDragsAndDrops","cloneDrags","positionDragsAndDrops","js_complete","each","node","resizeAllDragsAndDropsInGroup","getClassnameNumericSuffix","group","root","dragHomes","maxWidth","maxHeight","drag","Math","max","ceil","offsetWidth","offsetHeight","left","round","top","floor","css","hasOwnProperty","place","label","text","parseInt","get_string","append","width","height","index","dragHome","placeHolder","clone","removeClass","getChoice","getGroup","before","cloneDragsForOneChoice","hasClass","noOfDrags","noOfDropsInGroup","cloneDrag","offset","bgRatio","dropNode","drop","getPlace","xy","data","handleElementScale","dragNode","currentPlace","removeAttr","inputNode","input","choice","val","unplacedDrag","getUnplacedChoice","hiddenDrag","getDragClone","getInfiniteDragClones","after","sendDragToDrop","handleDragStart","e","target","closest","currentIndex","calculateZIndex","info","prepare","start","setInputValue","hiddenDrop","getDrop","questionManager","addEventHandlersToDrag","x","y","dragMove","dragEnd","pageX","pageY","highlighted","isPointInDrop","isDragSameAsDrop","placed","placedNode","placedDrag","sendDragHome","oldDrag","getCurrentDragInPlace","focus","attr","animateTo","getDragHome","handleKeyPress","currentDrag","nextDrag","keyCode","space","arrowRight","arrowDown","getNextDrag","arrowLeft","arrowUp","getPreviousDrag","escape","isKeyboardNavigation","preventDefault","numChoices","noOfChoicesInGroup","next","previous","currentPos","targetPos","animate","duration","done","trigger","position","outerWidth","outerHeight","document","getElementById","bgImage","is","slice","prefix","classes","classesArr","split","patt1","RegExp","test","match","exec","inHome","handleResize","parseFloat","key","bgImg","bgImgNaturalWidth","get","naturalWidth","bgImgClientWidth","element","type","zIndex","itemZIndex","eventHandlersInitialised","questions","init","setupEventHandlers","on","handleDragMoved","window","handleWindowResize","addEventListener","fixLayoutIfThingsM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P,CAAY,SAAZ,CAAP,EAAiD,KAAAkB,CAAM,CAAClB,IAAP,CAAY,SAAZ,CAArD,CAAsF,CAClFkB,CAAM,CAACkG,UAAP,CAAkB,SAAlB,CACH,CACD,GAAIxF,CAAe,CAACiC,oBAApB,CAA0C,CACtCjC,CAAe,CAACiC,oBAAhB,GACH,CACJ,CA5KiB,CAmLlBsD,mBAAmB,CAAE,6BAASlG,CAAT,CAAY,CAC7B,GAAIjG,CAAAA,CAAW,CAAGJ,CAAC,CAACqG,CAAC,CAACsG,aAAH,CAAD,CAAmBpG,OAAnB,CAA2B,oBAA3B,EAAiD2B,IAAjD,CAAsD,IAAtD,CAAlB,CACA,MAAOlB,CAAAA,CAAe,CAAC4E,SAAhB,CAA0BxL,CAA1B,CACV,CAtLiB,CAAtB,CA4LA,MAAO,CACHyL,IAAI,CAAE7E,CAAe,CAAC6E,IADnB,CAGV,CAvlCK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/*\n * JavaScript to allow dragging options to slots (using mouse down or touch) or tab through slots using keyboard.\n *\n * @module qtype_ddimageortext/question\n * @copyright 2018 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/dragdrop', 'core/key_codes'], function($, dragDrop, keys) {\n\n \"use strict\";\n\n /**\n * Initialise one drag-drop onto image question.\n *\n * @param {String} containerId id of the outer div for this question.\n * @param {boolean} readOnly whether the question is being displayed read-only.\n * @param {Array} places Information about the drop places.\n * @constructor\n */\n function DragDropOntoImageQuestion(containerId, readOnly, places) {\n this.containerId = containerId;\n M.util.js_pending('qtype_ddimageortext-init-' + this.containerId);\n this.places = places;\n this.allImagesLoaded = false;\n this.imageLoadingTimeoutId = null;\n this.isPrinting = false;\n if (readOnly) {\n this.getRoot().addClass('qtype_ddimageortext-readonly');\n }\n\n var thisQ = this;\n this.getNotYetLoadedImages().one('load', function() {\n thisQ.waitForAllImagesToBeLoaded();\n });\n this.waitForAllImagesToBeLoaded();\n }\n\n /**\n * Waits until all images are loaded before calling setupQuestion().\n *\n * This function is called from the onLoad of each image, and also polls with\n * a time-out, because image on-loads are allegedly unreliable.\n */\n DragDropOntoImageQuestion.prototype.waitForAllImagesToBeLoaded = function() {\n var thisQ = this;\n\n // This method may get called multiple times (via image on-loads or timeouts.\n // If we are already done, don't do it again.\n if (this.allImagesLoaded) {\n return;\n }\n\n // Clear any current timeout, if set.\n if (this.imageLoadingTimeoutId !== null) {\n clearTimeout(this.imageLoadingTimeoutId);\n }\n\n // If we have not yet loaded all images, set a timeout to\n // call ourselves again, since apparently images on-load\n // events are flakey.\n if (this.getNotYetLoadedImages().length > 0) {\n this.imageLoadingTimeoutId = setTimeout(function() {\n thisQ.waitForAllImagesToBeLoaded();\n }, 100);\n return;\n }\n\n // We now have all images. Carry on, but only after giving the layout a chance to settle down.\n this.allImagesLoaded = true;\n thisQ.setupQuestion();\n };\n\n /**\n * Get any of the images in the drag-drop area that are not yet fully loaded.\n *\n * @returns {jQuery} those images.\n */\n DragDropOntoImageQuestion.prototype.getNotYetLoadedImages = function() {\n var thisQ = this;\n return this.getRoot().find('.ddarea img').not(function(i, imgNode) {\n return thisQ.imageIsLoaded(imgNode);\n });\n };\n\n /**\n * Check if an image has loaded without errors.\n *\n * @param {HTMLImageElement} imgElement an image.\n * @returns {boolean} true if this image has loaded without errors.\n */\n DragDropOntoImageQuestion.prototype.imageIsLoaded = function(imgElement) {\n return imgElement.complete && imgElement.naturalHeight !== 0;\n };\n\n /**\n * Set up the question, once all images have been loaded.\n */\n DragDropOntoImageQuestion.prototype.setupQuestion = function() {\n this.resizeAllDragsAndDrops();\n this.cloneDrags();\n this.positionDragsAndDrops();\n M.util.js_complete('qtype_ddimageortext-init-' + this.containerId);\n };\n\n /**\n * In each group, resize all the items to be the same size.\n */\n DragDropOntoImageQuestion.prototype.resizeAllDragsAndDrops = function() {\n var thisQ = this;\n this.getRoot().find('.draghomes > div').each(function(i, node) {\n thisQ.resizeAllDragsAndDropsInGroup(\n thisQ.getClassnameNumericSuffix($(node), 'dragitemgroup'));\n });\n };\n\n /**\n * In a given group, set all the drags and drops to be the same size.\n *\n * @param {int} group the group number.\n */\n DragDropOntoImageQuestion.prototype.resizeAllDragsAndDropsInGroup = function(group) {\n var root = this.getRoot(),\n dragHomes = root.find('.dragitemgroup' + group + ' .draghome'),\n maxWidth = 0,\n maxHeight = 0;\n\n // Find the maximum size of any drag in this groups.\n dragHomes.each(function(i, drag) {\n maxWidth = Math.max(maxWidth, Math.ceil(drag.offsetWidth));\n maxHeight = Math.max(maxHeight, Math.ceil(drag.offsetHeight));\n });\n\n // The size we will want to set is a bit bigger than this.\n maxWidth += 10;\n maxHeight += 10;\n\n // Set each drag home to that size.\n dragHomes.each(function(i, drag) {\n var left = Math.round((maxWidth - drag.offsetWidth) / 2),\n top = Math.floor((maxHeight - drag.offsetHeight) / 2);\n // Set top and left padding so the item is centred.\n $(drag).css({\n 'padding-left': left + 'px',\n 'padding-right': (maxWidth - drag.offsetWidth - left) + 'px',\n 'padding-top': top + 'px',\n 'padding-bottom': (maxHeight - drag.offsetHeight - top) + 'px'\n });\n });\n\n // Create the drops and make them the right size.\n for (var i in this.places) {\n if (!this.places.hasOwnProperty((i))) {\n continue;\n }\n var place = this.places[i],\n label = place.text;\n if (parseInt(place.group) !== group) {\n continue;\n }\n if (label === '') {\n label = M.util.get_string('blank', 'qtype_ddimageortext');\n }\n root.find('.dropzones').append('
' +\n '' + label + ' 
');\n root.find('.dropzone.place' + i).width(maxWidth - 2).height(maxHeight - 2);\n }\n };\n\n /**\n * Invisible 'drag homes' are output by the renderer. These have the same properties\n * as the drag items but are invisible. We clone these invisible elements to make the\n * actual drag items.\n */\n DragDropOntoImageQuestion.prototype.cloneDrags = function() {\n var thisQ = this;\n thisQ.getRoot().find('.draghome').each(function(index, dragHome) {\n var drag = $(dragHome);\n var placeHolder = drag.clone();\n placeHolder.removeClass();\n placeHolder.addClass('draghome choice' +\n thisQ.getChoice(drag) + ' group' +\n thisQ.getGroup(drag) + ' dragplaceholder');\n drag.before(placeHolder);\n });\n };\n\n /**\n * Clone drag item for one choice.\n *\n * @param {jQuery} dragHome the drag home to clone.\n */\n DragDropOntoImageQuestion.prototype.cloneDragsForOneChoice = function(dragHome) {\n if (dragHome.hasClass('infinite')) {\n var noOfDrags = this.noOfDropsInGroup(this.getGroup(dragHome));\n for (var i = 0; i < noOfDrags; i++) {\n this.cloneDrag(dragHome);\n }\n } else {\n this.cloneDrag(dragHome);\n }\n };\n\n /**\n * Clone drag item.\n *\n * @param {jQuery} dragHome\n */\n DragDropOntoImageQuestion.prototype.cloneDrag = function(dragHome) {\n var drag = dragHome.clone();\n drag.removeClass('draghome')\n .addClass('drag unplaced moodle-has-zindex')\n .offset(dragHome.offset());\n this.getRoot().find('.dragitems').append(drag);\n };\n\n /**\n * Update the position of drags.\n */\n DragDropOntoImageQuestion.prototype.positionDragsAndDrops = function() {\n var thisQ = this,\n root = this.getRoot(),\n bgRatio = this.bgRatio();\n\n // Move the drops into position.\n root.find('.ddarea .dropzone').each(function(i, dropNode) {\n var drop = $(dropNode),\n place = thisQ.places[thisQ.getPlace(drop)];\n // The xy values come from PHP as strings, so we need parseInt to stop JS doing string concatenation.\n drop.css('left', parseInt(place.xy[0]) * bgRatio)\n .css('top', parseInt(place.xy[1]) * bgRatio);\n drop.data('originX', parseInt(place.xy[0]))\n .data('originY', parseInt(place.xy[1]));\n thisQ.handleElementScale(drop, 'left top');\n });\n\n // First move all items back home.\n root.find('.draghome').not('.dragplaceholder').each(function(i, dragNode) {\n var drag = $(dragNode),\n currentPlace = thisQ.getClassnameNumericSuffix(drag, 'inplace');\n drag.addClass('unplaced')\n .removeClass('placed');\n drag.removeAttr('tabindex');\n if (currentPlace !== null) {\n drag.removeClass('inplace' + currentPlace);\n }\n });\n\n // Then place the ones that should be placed.\n root.find('input.placeinput').each(function(i, inputNode) {\n var input = $(inputNode),\n choice = input.val();\n if (choice.length === 0 || (choice.length > 0 && choice === '0')) {\n // No item in this place.\n return;\n }\n\n var place = thisQ.getPlace(input);\n // Get the unplaced drag.\n var unplacedDrag = thisQ.getUnplacedChoice(thisQ.getGroup(input), choice);\n // Get the clone of the drag.\n var hiddenDrag = thisQ.getDragClone(unplacedDrag);\n if (hiddenDrag.length) {\n if (unplacedDrag.hasClass('infinite')) {\n var noOfDrags = thisQ.noOfDropsInGroup(thisQ.getGroup(unplacedDrag));\n var cloneDrags = thisQ.getInfiniteDragClones(unplacedDrag, false);\n if (cloneDrags.length < noOfDrags) {\n var cloneDrag = unplacedDrag.clone();\n cloneDrag.removeClass('beingdragged');\n cloneDrag.removeAttr('tabindex');\n hiddenDrag.after(cloneDrag);\n } else {\n hiddenDrag.addClass('active');\n }\n } else {\n hiddenDrag.addClass('active');\n }\n }\n\n // Send the drag to drop.\n var drop = root.find('.dropzone.place' + place);\n thisQ.sendDragToDrop(unplacedDrag, drop);\n });\n };\n\n /**\n * Handles the start of dragging an item.\n *\n * @param {Event} e the touch start or mouse down event.\n */\n DragDropOntoImageQuestion.prototype.handleDragStart = function(e) {\n var thisQ = this,\n drag = $(e.target).closest('.draghome'),\n currentIndex = this.calculateZIndex(),\n newIndex = currentIndex + 2;\n\n var info = dragDrop.prepare(e);\n if (!info.start) {\n return;\n }\n\n drag.addClass('beingdragged').css('transform', '').css('z-index', newIndex);\n var currentPlace = this.getClassnameNumericSuffix(drag, 'inplace');\n if (currentPlace !== null) {\n this.setInputValue(currentPlace, 0);\n drag.removeClass('inplace' + currentPlace);\n var hiddenDrop = thisQ.getDrop(drag, currentPlace);\n if (hiddenDrop.length) {\n hiddenDrop.addClass('active');\n drag.offset(hiddenDrop.offset());\n }\n } else {\n var hiddenDrag = thisQ.getDragClone(drag);\n if (hiddenDrag.length) {\n if (drag.hasClass('infinite')) {\n var noOfDrags = this.noOfDropsInGroup(thisQ.getGroup(drag));\n var cloneDrags = this.getInfiniteDragClones(drag, false);\n if (cloneDrags.length < noOfDrags) {\n var cloneDrag = drag.clone();\n cloneDrag.removeClass('beingdragged');\n cloneDrag.removeAttr('tabindex');\n hiddenDrag.after(cloneDrag);\n questionManager.addEventHandlersToDrag(cloneDrag);\n drag.offset(cloneDrag.offset());\n } else {\n hiddenDrag.addClass('active');\n drag.offset(hiddenDrag.offset());\n }\n } else {\n hiddenDrag.addClass('active');\n drag.offset(hiddenDrag.offset());\n }\n }\n }\n\n dragDrop.start(e, drag, function(x, y, drag) {\n thisQ.dragMove(x, y, drag);\n }, function(x, y, drag) {\n thisQ.dragEnd(x, y, drag);\n });\n };\n\n /**\n * Called whenever the currently dragged items moves.\n *\n * @param {Number} pageX the x position.\n * @param {Number} pageY the y position.\n * @param {jQuery} drag the item being moved.\n */\n DragDropOntoImageQuestion.prototype.dragMove = function(pageX, pageY, drag) {\n var thisQ = this,\n highlighted = false;\n this.getRoot().find('.dropzone.group' + this.getGroup(drag)).each(function(i, dropNode) {\n var drop = $(dropNode);\n if (thisQ.isPointInDrop(pageX, pageY, drop) && !highlighted) {\n highlighted = true;\n drop.addClass('valid-drag-over-drop');\n } else {\n drop.removeClass('valid-drag-over-drop');\n }\n });\n this.getRoot().find('.draghome.placed.group' + this.getGroup(drag)).not('.beingdragged').each(function(i, dropNode) {\n var drop = $(dropNode);\n if (thisQ.isPointInDrop(pageX, pageY, drop) && !highlighted && !thisQ.isDragSameAsDrop(drag, drop)) {\n highlighted = true;\n drop.addClass('valid-drag-over-drop');\n } else {\n drop.removeClass('valid-drag-over-drop');\n }\n });\n };\n\n /**\n * Called when user drops a drag item.\n *\n * @param {Number} pageX the x position.\n * @param {Number} pageY the y position.\n * @param {jQuery} drag the item being moved.\n */\n DragDropOntoImageQuestion.prototype.dragEnd = function(pageX, pageY, drag) {\n var thisQ = this,\n root = this.getRoot(),\n placed = false;\n\n // Looking for drag that was dropped on a dropzone.\n root.find('.dropzone.group' + this.getGroup(drag)).each(function(i, dropNode) {\n var drop = $(dropNode);\n if (!thisQ.isPointInDrop(pageX, pageY, drop)) {\n // Not this drop.\n return true;\n }\n\n // Now put this drag into the drop.\n drop.removeClass('valid-drag-over-drop');\n thisQ.sendDragToDrop(drag, drop);\n placed = true;\n return false; // Stop the each() here.\n });\n\n if (!placed) {\n // Looking for drag that was dropped on a placed drag.\n root.find('.draghome.placed.group' + this.getGroup(drag)).not('.beingdragged').each(function(i, placedNode) {\n var placedDrag = $(placedNode);\n if (!thisQ.isPointInDrop(pageX, pageY, placedDrag) || thisQ.isDragSameAsDrop(drag, placedDrag)) {\n // Not this placed drag.\n return true;\n }\n\n // Now put this drag into the drop.\n placedDrag.removeClass('valid-drag-over-drop');\n var currentPlace = thisQ.getClassnameNumericSuffix(placedDrag, 'inplace');\n var drop = thisQ.getDrop(drag, currentPlace);\n thisQ.sendDragToDrop(drag, drop);\n placed = true;\n return false; // Stop the each() here.\n });\n }\n\n if (!placed) {\n this.sendDragHome(drag);\n }\n };\n\n /**\n * Animate a drag item into a given place (or back home).\n *\n * @param {jQuery|null} drag the item to place. If null, clear the place.\n * @param {jQuery} drop the place to put it.\n */\n DragDropOntoImageQuestion.prototype.sendDragToDrop = function(drag, drop) {\n // Is there already a drag in this drop? if so, evict it.\n var oldDrag = this.getCurrentDragInPlace(this.getPlace(drop));\n if (oldDrag.length !== 0) {\n oldDrag.addClass('beingdragged');\n oldDrag.offset(oldDrag.offset());\n var currentPlace = this.getClassnameNumericSuffix(oldDrag, 'inplace');\n var hiddenDrop = this.getDrop(oldDrag, currentPlace);\n hiddenDrop.addClass('active');\n this.sendDragHome(oldDrag);\n }\n\n if (drag.length === 0) {\n this.setInputValue(this.getPlace(drop), 0);\n if (drop.data('isfocus')) {\n drop.focus();\n }\n } else {\n this.setInputValue(this.getPlace(drop), this.getChoice(drag));\n drag.removeClass('unplaced')\n .addClass('placed inplace' + this.getPlace(drop));\n drag.attr('tabindex', 0);\n this.animateTo(drag, drop);\n }\n };\n\n /**\n * Animate a drag back to its home.\n *\n * @param {jQuery} drag the item being moved.\n */\n DragDropOntoImageQuestion.prototype.sendDragHome = function(drag) {\n var currentPlace = this.getClassnameNumericSuffix(drag, 'inplace');\n if (currentPlace !== null) {\n drag.removeClass('inplace' + currentPlace);\n }\n drag.data('unplaced', true);\n\n this.animateTo(drag, this.getDragHome(this.getGroup(drag), this.getChoice(drag)));\n };\n\n /**\n * Handles keyboard events on drops.\n *\n * Drops are focusable. Once focused, right/down/space switches to the next choice, and\n * left/up switches to the previous. Escape clear.\n *\n * @param {KeyboardEvent} e\n */\n DragDropOntoImageQuestion.prototype.handleKeyPress = function(e) {\n var drop = $(e.target).closest('.dropzone');\n if (drop.length === 0) {\n var placedDrag = $(e.target);\n var currentPlace = this.getClassnameNumericSuffix(placedDrag, 'inplace');\n if (currentPlace !== null) {\n drop = this.getDrop(placedDrag, currentPlace);\n }\n }\n var currentDrag = this.getCurrentDragInPlace(this.getPlace(drop)),\n nextDrag = $();\n\n switch (e.keyCode) {\n case keys.space:\n case keys.arrowRight:\n case keys.arrowDown:\n nextDrag = this.getNextDrag(this.getGroup(drop), currentDrag);\n break;\n\n case keys.arrowLeft:\n case keys.arrowUp:\n nextDrag = this.getPreviousDrag(this.getGroup(drop), currentDrag);\n break;\n\n case keys.escape:\n questionManager.isKeyboardNavigation = false;\n break;\n\n default:\n questionManager.isKeyboardNavigation = false;\n return; // To avoid the preventDefault below.\n }\n\n if (nextDrag.length) {\n nextDrag.data('isfocus', true);\n nextDrag.addClass('beingdragged');\n var hiddenDrag = this.getDragClone(nextDrag);\n if (hiddenDrag.length) {\n if (nextDrag.hasClass('infinite')) {\n var noOfDrags = this.noOfDropsInGroup(this.getGroup(nextDrag));\n var cloneDrags = this.getInfiniteDragClones(nextDrag, false);\n if (cloneDrags.length < noOfDrags) {\n var cloneDrag = nextDrag.clone();\n cloneDrag.removeClass('beingdragged');\n cloneDrag.removeAttr('tabindex');\n hiddenDrag.after(cloneDrag);\n questionManager.addEventHandlersToDrag(cloneDrag);\n nextDrag.offset(cloneDrag.offset());\n } else {\n hiddenDrag.addClass('active');\n nextDrag.offset(hiddenDrag.offset());\n }\n } else {\n hiddenDrag.addClass('active');\n nextDrag.offset(hiddenDrag.offset());\n }\n }\n } else {\n drop.data('isfocus', true);\n }\n\n e.preventDefault();\n this.sendDragToDrop(nextDrag, drop);\n };\n\n /**\n * Choose the next drag in a group.\n *\n * @param {int} group which group.\n * @param {jQuery} drag current choice (empty jQuery if there isn't one).\n * @return {jQuery} the next drag in that group, or null if there wasn't one.\n */\n DragDropOntoImageQuestion.prototype.getNextDrag = function(group, drag) {\n var choice,\n numChoices = this.noOfChoicesInGroup(group);\n\n if (drag.length === 0) {\n choice = 1; // Was empty, so we want to select the first choice.\n } else {\n choice = this.getChoice(drag) + 1;\n }\n\n var next = this.getUnplacedChoice(group, choice);\n while (next.length === 0 && choice < numChoices) {\n choice++;\n next = this.getUnplacedChoice(group, choice);\n }\n\n return next;\n };\n\n /**\n * Choose the previous drag in a group.\n *\n * @param {int} group which group.\n * @param {jQuery} drag current choice (empty jQuery if there isn't one).\n * @return {jQuery} the next drag in that group, or null if there wasn't one.\n */\n DragDropOntoImageQuestion.prototype.getPreviousDrag = function(group, drag) {\n var choice;\n\n if (drag.length === 0) {\n choice = this.noOfChoicesInGroup(group);\n } else {\n choice = this.getChoice(drag) - 1;\n }\n\n var previous = this.getUnplacedChoice(group, choice);\n while (previous.length === 0 && choice > 1) {\n choice--;\n previous = this.getUnplacedChoice(group, choice);\n }\n\n // Does this choice exist?\n return previous;\n };\n\n /**\n * Animate an object to the given destination.\n *\n * @param {jQuery} drag the element to be animated.\n * @param {jQuery} target element marking the place to move it to.\n */\n DragDropOntoImageQuestion.prototype.animateTo = function(drag, target) {\n var currentPos = drag.offset(),\n targetPos = target.offset(),\n thisQ = this;\n\n M.util.js_pending('qtype_ddimageortext-animate-' + thisQ.containerId);\n // Animate works in terms of CSS position, whereas locating an object\n // on the page works best with jQuery offset() function. So, to get\n // the right target position, we work out the required change in\n // offset() and then add that to the current CSS position.\n drag.animate(\n {\n left: parseInt(drag.css('left')) + targetPos.left - currentPos.left,\n top: parseInt(drag.css('top')) + targetPos.top - currentPos.top\n },\n {\n duration: 'fast',\n done: function() {\n $('body').trigger('qtype_ddimageortext-dragmoved', [drag, target, thisQ]);\n M.util.js_complete('qtype_ddimageortext-animate-' + thisQ.containerId);\n }\n }\n );\n };\n\n /**\n * Detect if a point is inside a given DOM node.\n *\n * @param {Number} pageX the x position.\n * @param {Number} pageY the y position.\n * @param {jQuery} drop the node to check (typically a drop).\n * @return {boolean} whether the point is inside the node.\n */\n DragDropOntoImageQuestion.prototype.isPointInDrop = function(pageX, pageY, drop) {\n var position = drop.offset();\n if (drop.hasClass('draghome')) {\n return pageX >= position.left && pageX < position.left + drop.outerWidth()\n && pageY >= position.top && pageY < position.top + drop.outerHeight();\n }\n return pageX >= position.left && pageX < position.left + drop.width()\n && pageY >= position.top && pageY < position.top + drop.height();\n };\n\n /**\n * Set the value of the hidden input for a place, to record what is currently there.\n *\n * @param {int} place which place to set the input value for.\n * @param {int} choice the value to set.\n */\n DragDropOntoImageQuestion.prototype.setInputValue = function(place, choice) {\n this.getRoot().find('input.placeinput.place' + place).val(choice);\n };\n\n /**\n * Get the outer div for this question.\n *\n * @returns {jQuery} containing that div.\n */\n DragDropOntoImageQuestion.prototype.getRoot = function() {\n return $(document.getElementById(this.containerId));\n };\n\n /**\n * Get the img that is the background image.\n * @returns {jQuery} containing that img.\n */\n DragDropOntoImageQuestion.prototype.bgImage = function() {\n return this.getRoot().find('img.dropbackground');\n };\n\n /**\n * Get drag home for a given choice.\n *\n * @param {int} group the group.\n * @param {int} choice the choice number.\n * @returns {jQuery} containing that div.\n */\n DragDropOntoImageQuestion.prototype.getDragHome = function(group, choice) {\n if (!this.getRoot().find('.draghome.dragplaceholder.group' + group + '.choice' + choice).is(':visible')) {\n return this.getRoot().find('.dragitemgroup' + group +\n ' .draghome.infinite' +\n '.choice' + choice +\n '.group' + group);\n }\n return this.getRoot().find('.draghome.dragplaceholder.group' + group + '.choice' + choice);\n };\n\n /**\n * Get an unplaced choice for a particular group.\n *\n * @param {int} group the group.\n * @param {int} choice the choice number.\n * @returns {jQuery} jQuery wrapping the unplaced choice. If there isn't one, the jQuery will be empty.\n */\n DragDropOntoImageQuestion.prototype.getUnplacedChoice = function(group, choice) {\n return this.getRoot().find('.ddarea .draghome.group' + group + '.choice' + choice + '.unplaced').slice(0, 1);\n };\n\n /**\n * Get the drag that is currently in a given place.\n *\n * @param {int} place the place number.\n * @return {jQuery} the current drag (or an empty jQuery if none).\n */\n DragDropOntoImageQuestion.prototype.getCurrentDragInPlace = function(place) {\n return this.getRoot().find('.ddarea .draghome.inplace' + place);\n };\n\n /**\n * Return the number of blanks in a given group.\n *\n * @param {int} group the group number.\n * @returns {int} the number of drops.\n */\n DragDropOntoImageQuestion.prototype.noOfDropsInGroup = function(group) {\n return this.getRoot().find('.dropzone.group' + group).length;\n };\n\n /**\n * Return the number of choices in a given group.\n *\n * @param {int} group the group number.\n * @returns {int} the number of choices.\n */\n DragDropOntoImageQuestion.prototype.noOfChoicesInGroup = function(group) {\n return this.getRoot().find('.dragitemgroup' + group + ' .draghome').length;\n };\n\n /**\n * Return the number at the end of the CSS class name with the given prefix.\n *\n * @param {jQuery} node\n * @param {String} prefix name prefix\n * @returns {Number|null} the suffix if found, else null.\n */\n DragDropOntoImageQuestion.prototype.getClassnameNumericSuffix = function(node, prefix) {\n var classes = node.attr('class');\n if (classes !== '') {\n var classesArr = classes.split(' ');\n for (var index = 0; index < classesArr.length; index++) {\n var patt1 = new RegExp('^' + prefix + '([0-9])+$');\n if (patt1.test(classesArr[index])) {\n var patt2 = new RegExp('([0-9])+$');\n var match = patt2.exec(classesArr[index]);\n return Number(match[0]);\n }\n }\n }\n return null;\n };\n\n /**\n * Get the choice number of a drag.\n *\n * @param {jQuery} drag the drag.\n * @returns {Number} the choice number.\n */\n DragDropOntoImageQuestion.prototype.getChoice = function(drag) {\n return this.getClassnameNumericSuffix(drag, 'choice');\n };\n\n /**\n * Given a DOM node that is significant to this question\n * (drag, drop, ...) get the group it belongs to.\n *\n * @param {jQuery} node a DOM node.\n * @returns {Number} the group it belongs to.\n */\n DragDropOntoImageQuestion.prototype.getGroup = function(node) {\n return this.getClassnameNumericSuffix(node, 'group');\n };\n\n /**\n * Get the place number of a drop, or its corresponding hidden input.\n *\n * @param {jQuery} node the DOM node.\n * @returns {Number} the place number.\n */\n DragDropOntoImageQuestion.prototype.getPlace = function(node) {\n return this.getClassnameNumericSuffix(node, 'place');\n };\n\n /**\n * Get drag clone for a given drag.\n *\n * @param {jQuery} drag the drag.\n * @returns {jQuery} the drag's clone.\n */\n DragDropOntoImageQuestion.prototype.getDragClone = function(drag) {\n return this.getRoot().find('.dragitemgroup' +\n this.getGroup(drag) +\n ' .draghome' +\n '.choice' + this.getChoice(drag) +\n '.group' + this.getGroup(drag) +\n '.dragplaceholder');\n };\n\n /**\n * Get infinite drag clones for given drag.\n *\n * @param {jQuery} drag the drag.\n * @param {Boolean} inHome in the home area or not.\n * @returns {jQuery} the drag's clones.\n */\n DragDropOntoImageQuestion.prototype.getInfiniteDragClones = function(drag, inHome) {\n if (inHome) {\n return this.getRoot().find('.dragitemgroup' +\n this.getGroup(drag) +\n ' .draghome' +\n '.choice' + this.getChoice(drag) +\n '.group' + this.getGroup(drag) +\n '.infinite').not('.dragplaceholder');\n }\n return this.getRoot().find('.draghome' +\n '.choice' + this.getChoice(drag) +\n '.group' + this.getGroup(drag) +\n '.infinite').not('.dragplaceholder');\n };\n\n /**\n * Get drop for a given drag and place.\n *\n * @param {jQuery} drag the drag.\n * @param {Integer} currentPlace the current place of drag.\n * @returns {jQuery} the drop's clone.\n */\n DragDropOntoImageQuestion.prototype.getDrop = function(drag, currentPlace) {\n return this.getRoot().find('.dropzone.group' + this.getGroup(drag) + '.place' + currentPlace);\n };\n\n /**\n * Handle when the window is resized.\n */\n DragDropOntoImageQuestion.prototype.handleResize = function() {\n var thisQ = this,\n bgRatio = this.bgRatio();\n if (this.isPrinting) {\n bgRatio = 1;\n }\n\n this.getRoot().find('.ddarea .dropzone').each(function(i, dropNode) {\n $(dropNode)\n .css('left', parseInt($(dropNode).data('originX')) * parseFloat(bgRatio))\n .css('top', parseInt($(dropNode).data('originY')) * parseFloat(bgRatio));\n thisQ.handleElementScale(dropNode, 'left top');\n });\n\n this.getRoot().find('div.droparea .draghome').not('.beingdragged').each(function(key, drag) {\n $(drag)\n .css('left', parseFloat($(drag).data('originX')) * parseFloat(bgRatio))\n .css('top', parseFloat($(drag).data('originY')) * parseFloat(bgRatio));\n thisQ.handleElementScale(drag, 'left top');\n });\n };\n\n /**\n * Return the background ratio.\n *\n * @returns {number} Background ratio.\n */\n DragDropOntoImageQuestion.prototype.bgRatio = function() {\n var bgImg = this.bgImage();\n var bgImgNaturalWidth = bgImg.get(0).naturalWidth;\n var bgImgClientWidth = bgImg.width();\n\n return bgImgClientWidth / bgImgNaturalWidth;\n };\n\n /**\n * Scale the drag if needed.\n *\n * @param {jQuery} element the item to place.\n * @param {String} type scaling type\n */\n DragDropOntoImageQuestion.prototype.handleElementScale = function(element, type) {\n var bgRatio = parseFloat(this.bgRatio());\n if (this.isPrinting) {\n bgRatio = 1;\n }\n $(element).css({\n '-webkit-transform': 'scale(' + bgRatio + ')',\n '-moz-transform': 'scale(' + bgRatio + ')',\n '-ms-transform': 'scale(' + bgRatio + ')',\n '-o-transform': 'scale(' + bgRatio + ')',\n 'transform': 'scale(' + bgRatio + ')',\n 'transform-origin': type\n });\n };\n\n /**\n * Calculate z-index value.\n *\n * @returns {number} z-index value\n */\n DragDropOntoImageQuestion.prototype.calculateZIndex = function() {\n var zIndex = 0;\n this.getRoot().find('.ddarea .dropzone, div.droparea .draghome').each(function(i, dropNode) {\n dropNode = $(dropNode);\n // Note that webkit browsers won't return the z-index value from the CSS stylesheet\n // if the element doesn't have a position specified. Instead it'll return \"auto\".\n var itemZIndex = dropNode.css('z-index') ? parseInt(dropNode.css('z-index')) : 0;\n\n if (itemZIndex > zIndex) {\n zIndex = itemZIndex;\n }\n });\n\n return zIndex;\n };\n\n /**\n * Check that the drag is drop to it's clone.\n *\n * @param {jQuery} drag The drag.\n * @param {jQuery} drop The drop.\n * @returns {boolean}\n */\n DragDropOntoImageQuestion.prototype.isDragSameAsDrop = function(drag, drop) {\n return this.getChoice(drag) === this.getChoice(drop) && this.getGroup(drag) === this.getGroup(drop);\n };\n\n /**\n * Singleton object that handles all the DragDropOntoImageQuestions\n * on the page, and deals with event dispatching.\n * @type {Object}\n */\n var questionManager = {\n\n /**\n * {boolean} ensures that the event handlers are only initialised once per page.\n */\n eventHandlersInitialised: false,\n\n /**\n * {boolean} is printing or not.\n */\n isPrinting: false,\n\n /**\n * {boolean} is keyboard navigation or not.\n */\n isKeyboardNavigation: false,\n\n /**\n * {Object} all the questions on this page, indexed by containerId (id on the .que div).\n */\n questions: {}, // An object containing all the information about each question on the page.\n\n /**\n * Initialise one question.\n *\n * @method\n * @param {String} containerId the id of the div.que that contains this question.\n * @param {boolean} readOnly whether the question is read-only.\n * @param {Array} places data.\n */\n init: function(containerId, readOnly, places) {\n questionManager.questions[containerId] =\n new DragDropOntoImageQuestion(containerId, readOnly, places);\n if (!questionManager.eventHandlersInitialised) {\n questionManager.setupEventHandlers();\n questionManager.eventHandlersInitialised = true;\n }\n },\n\n /**\n * Set up the event handlers that make this question type work. (Done once per page.)\n */\n setupEventHandlers: function() {\n // We do not use the body event here to prevent the other event on Mobile device, such as scroll event.\n questionManager.addEventHandlersToDrag($('.que.ddimageortext:not(.qtype_ddimageortext-readonly) .draghome'));\n $('body')\n .on('keydown',\n '.que.ddimageortext:not(.qtype_ddimageortext-readonly) .dropzones .dropzone',\n questionManager.handleKeyPress)\n .on('keydown',\n '.que.ddimageortext:not(.qtype_ddimageortext-readonly) .draghome.placed:not(.beingdragged)',\n questionManager.handleKeyPress)\n .on('qtype_ddimageortext-dragmoved', questionManager.handleDragMoved);\n $(window).on('resize', function() {\n questionManager.handleWindowResize(false);\n });\n window.addEventListener('beforeprint', function() {\n questionManager.isPrinting = true;\n questionManager.handleWindowResize(questionManager.isPrinting);\n });\n window.addEventListener('afterprint', function() {\n questionManager.isPrinting = false;\n questionManager.handleWindowResize(questionManager.isPrinting);\n });\n setTimeout(function() {\n questionManager.fixLayoutIfThingsMoved();\n }, 100);\n },\n\n /**\n * Binding the drag/touch event again for newly created element.\n *\n * @param {jQuery} element Element to bind the event\n */\n addEventHandlersToDrag: function(element) {\n // Unbind all the mousedown and touchstart events to prevent double binding.\n element.unbind('mousedown touchstart');\n element.on('mousedown touchstart', questionManager.handleDragStart);\n },\n\n /**\n * Handle mouse down / touch start events on drags.\n * @param {Event} e the DOM event.\n */\n handleDragStart: function(e) {\n e.preventDefault();\n var question = questionManager.getQuestionForEvent(e);\n if (question) {\n question.handleDragStart(e);\n }\n },\n\n /**\n * Handle key down / press events on drags.\n * @param {KeyboardEvent} e\n */\n handleKeyPress: function(e) {\n if (questionManager.isKeyboardNavigation) {\n return;\n }\n questionManager.isKeyboardNavigation = true;\n var question = questionManager.getQuestionForEvent(e);\n if (question) {\n question.handleKeyPress(e);\n }\n },\n\n /**\n * Handle when the window is resized.\n * @param {boolean} isPrinting\n */\n handleWindowResize: function(isPrinting) {\n for (var containerId in questionManager.questions) {\n if (questionManager.questions.hasOwnProperty(containerId)) {\n questionManager.questions[containerId].isPrinting = isPrinting;\n questionManager.questions[containerId].handleResize();\n }\n }\n },\n\n /**\n * Sometimes, despite our best efforts, things change in a way that cannot\n * be specifically caught (e.g. dock expanding or collapsing in Boost).\n * Therefore, we need to periodically check everything is in the right position.\n */\n fixLayoutIfThingsMoved: function() {\n this.handleWindowResize(questionManager.isPrinting);\n // We use setTimeout after finishing work, rather than setInterval,\n // in case positioning things is slow. We want 100 ms gap\n // between executions, not what setInterval does.\n setTimeout(function() {\n questionManager.fixLayoutIfThingsMoved(questionManager.isPrinting);\n }, 100);\n },\n\n /**\n * Handle when drag moved.\n *\n * @param {Event} e the event.\n * @param {jQuery} drag the drag\n * @param {jQuery} target the target\n * @param {DragDropOntoImageQuestion} thisQ the question.\n */\n handleDragMoved: function(e, drag, target, thisQ) {\n drag.removeClass('beingdragged').css('z-index', '');\n drag.css('top', target.position().top).css('left', target.position().left);\n target.after(drag);\n target.removeClass('active');\n if (typeof drag.data('unplaced') !== 'undefined' && drag.data('unplaced') === true) {\n drag.removeClass('placed').addClass('unplaced');\n drag.removeAttr('tabindex');\n drag.removeData('unplaced');\n drag.css('top', '')\n .css('left', '')\n .css('transform', '');\n if (drag.hasClass('infinite') && thisQ.getInfiniteDragClones(drag, true).length > 1) {\n thisQ.getInfiniteDragClones(drag, true).first().remove();\n }\n } else {\n drag.data('originX', target.data('originX')).data('originY', target.data('originY'));\n thisQ.handleElementScale(drag, 'left top');\n }\n if (typeof drag.data('isfocus') !== 'undefined' && drag.data('isfocus') === true) {\n drag.focus();\n drag.removeData('isfocus');\n }\n if (typeof target.data('isfocus') !== 'undefined' && target.data('isfocus') === true) {\n target.removeData('isfocus');\n }\n if (questionManager.isKeyboardNavigation) {\n questionManager.isKeyboardNavigation = false;\n }\n },\n\n /**\n * Given an event, work out which question it effects.\n * @param {Event} e the event.\n * @returns {DragDropOntoImageQuestion|undefined} The question, or undefined.\n */\n getQuestionForEvent: function(e) {\n var containerId = $(e.currentTarget).closest('.que.ddimageortext').attr('id');\n return questionManager.questions[containerId];\n }\n };\n\n /**\n * @alias module:qtype_ddimageortext/question\n */\n return {\n init: questionManager.init\n };\n});\n"],"file":"question.min.js"} \ No newline at end of file diff --git a/question/type/ddimageortext/amd/src/form.js b/question/type/ddimageortext/amd/src/form.js index 18ecc2f21fb94..f4ae38295f069 100644 --- a/question/type/ddimageortext/amd/src/form.js +++ b/question/type/ddimageortext/amd/src/form.js @@ -31,22 +31,27 @@ define(['jquery', 'core/dragdrop'], function($, dragDrop) { */ var dragDropToImageForm = { /** - * @var {Object} with properties width and height. + * @var {Object} maxBgImageSize Properties width and height. + * @private */ maxBgImageSize: null, /** - * @var {Object} with properties width and height. + * @var {Object} maxDragImageSize with properties width and height. + * @private */ maxDragImageSize: null, /** - * @var {object} for interacting with the file pickers. + * @property {object} fp for interacting with the file pickers. + * @private */ fp: null, // Object containing functions associated with the file picker. /** * Initialise the form javascript features. + * + * @method */ init: function() { dragDropToImageForm.fp = dragDropToImageForm.filePickers(); @@ -502,13 +507,7 @@ define(['jquery', 'core/dragdrop'], function($, dragDrop) { } }; - /** - * @alias module:qtype_ddimageortext/form - */ return { - /** - * Initialise the form JavaScript features. - */ init: dragDropToImageForm.init }; }); diff --git a/question/type/ddimageortext/amd/src/question.js b/question/type/ddimageortext/amd/src/question.js index e78997d19690a..273d9d9a61b24 100644 --- a/question/type/ddimageortext/amd/src/question.js +++ b/question/type/ddimageortext/amd/src/question.js @@ -965,6 +965,7 @@ define(['jquery', 'core/dragdrop', 'core/key_codes'], function($, dragDrop, keys /** * Initialise one question. * + * @method * @param {String} containerId the id of the div.que that contains this question. * @param {boolean} readOnly whether the question is read-only. * @param {Array} places data. @@ -1128,13 +1129,6 @@ define(['jquery', 'core/dragdrop', 'core/key_codes'], function($, dragDrop, keys * @alias module:qtype_ddimageortext/question */ return { - /** - * Initialise one drag-drop onto image question. - * - * @param {String} containerId id of the outer div for this question. - * @param {boolean} readOnly whether the question is being displayed read-only. - * @param {Array} Information about the drop places. - */ init: questionManager.init }; }); diff --git a/question/type/ddmarker/amd/build/form.min.js.map b/question/type/ddmarker/amd/build/form.min.js.map index 7d5a4c11a19b6..e67eae4a7cfc7 100644 --- a/question/type/ddmarker/amd/build/form.min.js.map +++ b/question/type/ddmarker/amd/build/form.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/form.js"],"names":["define","$","dragDrop","Shapes","DropZoneManager","dropzoneNo","svgEl","shape","make","getShapeType","getLabel","updateCoordinatesFromForm","prototype","svg","coordinates","getCoordinates","currentNumPoints","getType","points","length","parse","currentyActive","isActive","removeFromSvg","addToSvg","setActive","updateSvgEl","setCoordinatesInForm","updateLabel","label","changeShape","newShapeType","getSimilar","Error","makeSvg","setAttribute","handles","getHandlePositions","moveHandle","createSvgElement","x","y","i","editHandles","makeEditHandle","index","point","editHandle","parentNode","removeChild","updateSvg","childNodes","getAttribute","match","parent","appendChild","dragDropForm","form","setFormValue","getFormValue","replace","getChoiceNo","getMarkerText","handleMove","e","info","prepare","start","movingDropZone","lastX","lastY","dragProxy","makeDragProxy","bgImg","maxX","width","maxY","height","pageX","pageY","move","document","body","handleEdit","handleIndex","ctrlKey","metaKey","addNewPointAfter","changingDropZone","edit","normalizeShape","createElement","style","position","top","left","fp","noDropZones","dropZones","init","filePickers","setupPreviewArea","setOptionsForDragItemSelectors","createShapes","setupEventHandlers","waitForFilePickerToInitialise","append","dragItemsOptions","noItems","selectedValues","selector","text","html","val","find","remove","value","option","optionnode","attr","noofdrags","k","on","ids","currentTarget","name","inputType","dropZone","getSvg","previewArea","data","currentlyActive","removeClass","closest","file","href","setTimeout","loadPreviewImage","one","afterPreviewImageLoaded","css","updateSvgDisplay","outerWidth","outerHeight","markerNo","toNameWithIndex","indexes","indexString","getEl","elements","el","type","checked","draftItemIdsToName","nameToParentNode","each","key","filepicker","fileAnchor","get","innerHTML","draftitemid"],"mappings":"AAuBAA,OAAM,uBAAC,CAAC,QAAD,CAAW,eAAX,CAA4B,uBAA5B,CAAD,CAAuD,SAASC,CAAT,CAAYC,CAAZ,CAAsBC,CAAtB,CAA8B,CAEvF,aAQA,QAASC,CAAAA,CAAT,CAAyBC,CAAzB,CAAqC,CACjC,KAAKA,UAAL,CAAkBA,CAAlB,CACA,KAAKC,KAAL,CAAa,I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I,CAAEuB,CAAU,CAACC,GAAX,CAAe,CAAf,EAAkBxB,IAAzB,CAA+BV,IAAI,CAAEiC,CAAU,CAACC,GAAX,CAAe,CAAf,EAAkBC,SAAvD,CACV,CAFD,IAEO,CACH,MAAO,CAACzB,IAAI,CAAE,IAAP,CAAaV,IAAI,CAAE,IAAnB,CACV,CACJ,CARE,CASHA,IAAI,CAAE,cAASoC,CAAT,CAAsB,CACxB,MAAOR,CAAAA,CAAkB,CAACQ,CAAD,CAC5B,CAXE,CAaV,CAtWc,CAAnB,CA4WA,MAAO,CAKH9D,IAAI,CAAE3C,CAAY,CAAC2C,IALhB,CAOV,CA7rBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * This class provides the enhancements to the drag-drop marker editing form.\n *\n * @subpackage form\n * @copyright 2018 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/dragdrop', 'qtype_ddmarker/shapes'], function($, dragDrop, Shapes) {\n\n \"use strict\";\n\n /**\n * Create the manager object that deals with keeping everything synchronised for one drop zone.\n *\n * @param {int} dropzoneNo the index of this drop zone in the form. 0, 1, ....\n * @constructor\n */\n function DropZoneManager(dropzoneNo) {\n this.dropzoneNo = dropzoneNo;\n this.svgEl = null;\n\n this.shape = Shapes.make(this.getShapeType(), this.getLabel());\n this.updateCoordinatesFromForm();\n }\n\n /**\n * Update the coordinates from a particular string.\n *\n * @param {SVGElement} [svg] the SVG element that is the preview.\n */\n DropZoneManager.prototype.updateCoordinatesFromForm = function(svg) {\n var coordinates = this.getCoordinates(),\n currentNumPoints = this.shape.getType() === 'polygon' && this.shape.points.length;\n if (this.shape.getCoordinates() === coordinates) {\n return;\n }\n // We don't need to scale the shape for editing form.\n if (!this.shape.parse(coordinates, 1)) {\n // Invalid coordinates. Don't update the preview.\n return;\n }\n\n if (this.shape.getType() === 'polygon' && currentNumPoints !== this.shape.points.length) {\n // Polygon, and size has changed.\n var currentyActive = this.isActive();\n this.removeFromSvg();\n if (svg) {\n this.addToSvg(svg);\n if (currentyActive) {\n this.setActive();\n }\n }\n } else {\n // Simple update.\n this.updateSvgEl();\n }\n // Update the rounded coordinates if needed.\n this.setCoordinatesInForm();\n };\n\n /**\n * Update the label.\n */\n DropZoneManager.prototype.updateLabel = function() {\n var label = this.getLabel();\n if (this.shape.label !== label) {\n this.shape.label = label;\n this.updateSvgEl();\n }\n };\n\n /**\n * Handle if the type of shape has changed.\n *\n * @param {SVGElement} [svg] an SVG element to add this new shape to.\n */\n DropZoneManager.prototype.changeShape = function(svg) {\n var newShapeType = this.getShapeType(),\n currentyActive = this.isActive();\n\n if (newShapeType === this.shape.getType()) {\n return;\n }\n\n // It has really changed.\n this.removeFromSvg();\n this.shape = Shapes.getSimilar(newShapeType, this.shape);\n if (svg) {\n this.addToSvg(svg);\n if (currentyActive) {\n this.setActive();\n }\n }\n this.setCoordinatesInForm();\n };\n\n /**\n * Add this drop zone to an SVG graphic.\n *\n * @param {SVGElement} svg the SVG image to which to add this drop zone.\n */\n DropZoneManager.prototype.addToSvg = function(svg) {\n if (this.svgEl !== null) {\n throw new Error('this.svgEl already set');\n }\n this.svgEl = this.shape.makeSvg(svg);\n if (!this.svgEl) {\n return;\n }\n this.svgEl.setAttribute('class', 'dropzone');\n this.svgEl.setAttribute('data-dropzone-no', this.dropzoneNo);\n\n // Add handles.\n var handles = this.shape.getHandlePositions();\n if (handles === null) {\n return;\n }\n\n var moveHandle = Shapes.createSvgElement(this.svgEl, 'circle');\n moveHandle.setAttribute('cx', handles.moveHandle.x);\n moveHandle.setAttribute('cy', handles.moveHandle.y);\n moveHandle.setAttribute('r', 7);\n moveHandle.setAttribute('class', 'handle move');\n\n for (var i = 0; i < handles.editHandles.length; ++i) {\n this.makeEditHandle(i, handles.editHandles[i]);\n }\n };\n\n /**\n * Add a new edit handle.\n *\n * @param {int} index the handle index.\n * @param {Point} point the point at which to add the handle.\n */\n DropZoneManager.prototype.makeEditHandle = function(index, point) {\n var editHandle = Shapes.createSvgElement(this.svgEl, 'rect');\n editHandle.setAttribute('x', point.x - 6);\n editHandle.setAttribute('y', point.y - 6);\n editHandle.setAttribute('width', 11);\n editHandle.setAttribute('height', 11);\n editHandle.setAttribute('class', 'handle edit');\n editHandle.setAttribute('data-edit-handle-no', index);\n };\n\n /**\n * Remove this drop zone from an SVG image.\n */\n DropZoneManager.prototype.removeFromSvg = function() {\n if (this.svgEl !== null) {\n this.svgEl.parentNode.removeChild(this.svgEl);\n this.svgEl = null;\n }\n };\n\n /**\n * Update the shape of this drop zone (but not type) in an SVG image.\n */\n DropZoneManager.prototype.updateSvgEl = function() {\n if (this.svgEl === null) {\n return;\n }\n\n this.shape.updateSvg(this.svgEl);\n\n // Adjust handles.\n var handles = this.shape.getHandlePositions();\n if (handles === null) {\n return;\n }\n\n // Move handle.\n // The shape + its label are the first two children of svgEl.\n // Then come the move handle followed by the edit handles.\n this.svgEl.childNodes[2].setAttribute('cx', handles.moveHandle.x);\n this.svgEl.childNodes[2].setAttribute('cy', handles.moveHandle.y);\n\n // Edit handles.\n for (var i = 0; i < handles.editHandles.length; ++i) {\n this.svgEl.childNodes[3 + i].setAttribute('x', handles.editHandles[i].x - 6);\n this.svgEl.childNodes[3 + i].setAttribute('y', handles.editHandles[i].y - 6);\n }\n };\n\n /**\n * Find out of this drop zone is currently being edited.\n *\n * @return {boolean} true if it is.\n */\n DropZoneManager.prototype.isActive = function() {\n return this.svgEl !== null && this.svgEl.getAttribute('class').match(/\\bactive\\b/);\n };\n\n /**\n * Set this drop zone as being edited.\n */\n DropZoneManager.prototype.setActive = function() {\n // Move this one to last, so that it is always on top.\n // (Otherwise the handles may not be able to receive events.)\n var parent = this.svgEl.parentNode;\n parent.removeChild(this.svgEl);\n parent.appendChild(this.svgEl);\n this.svgEl.setAttribute('class', this.svgEl.getAttribute('class') + ' active');\n };\n\n /**\n * Set the coordinates in the form to match the current shape.\n */\n DropZoneManager.prototype.setCoordinatesInForm = function() {\n dragDropForm.form.setFormValue('drops', [this.dropzoneNo, 'coords'], this.shape.getCoordinates());\n };\n\n /**\n * Returns the coordinates for a drop zone from the text input in the form.\n * @returns {string} the coordinates.\n */\n DropZoneManager.prototype.getCoordinates = function() {\n return dragDropForm.form.getFormValue('drops', [this.dropzoneNo, 'coords']).replace(/\\s*/g, '');\n };\n\n /**\n * Returns the selected marker number from the dropdown in the form.\n * @returns {int} choice number.\n */\n DropZoneManager.prototype.getChoiceNo = function() {\n return dragDropForm.form.getFormValue('drops', [this.dropzoneNo, 'choice']);\n };\n\n /**\n * Returns the selected marker number from the dropdown in the form.\n * @returns {String} marker label text.\n */\n DropZoneManager.prototype.getLabel = function() {\n return dragDropForm.form.getMarkerText(this.getChoiceNo());\n };\n\n\n /**\n * Returns the selected type of shape in the form.\n * @returns {String} 'circle', 'rectangle' or 'polygon'.\n */\n DropZoneManager.prototype.getShapeType = function() {\n return dragDropForm.form.getFormValue('drops', [this.dropzoneNo, 'shape']);\n };\n\n /**\n * Start responding to dragging the move handle.\n * @param {Event} e Event object\n */\n DropZoneManager.prototype.handleMove = function(e) {\n var info = dragDrop.prepare(e);\n if (!info.start) {\n return;\n }\n\n var movingDropZone = this,\n lastX = info.x,\n lastY = info.y,\n dragProxy = this.makeDragProxy(info.x, info.y),\n bgImg = $('fieldset#id_previewareaheader .dropbackground'),\n maxX = bgImg.width(),\n maxY = bgImg.height();\n\n dragDrop.start(e, $(dragProxy), function(pageX, pageY) {\n movingDropZone.shape.move(pageX - lastX, pageY - lastY, maxX, maxY);\n lastX = pageX;\n lastY = pageY;\n movingDropZone.updateSvgEl();\n movingDropZone.setCoordinatesInForm();\n }, function() {\n document.body.removeChild(dragProxy);\n });\n };\n\n /**\n * Start responding to dragging the move handle.\n * @param {Event} e Event object\n * @param {int} handleIndex\n * @param {SVGElement} [svg] an SVG element to add this new shape to.\n */\n DropZoneManager.prototype.handleEdit = function(e, handleIndex, svg) {\n var info = dragDrop.prepare(e);\n if (!info.start) {\n return;\n }\n\n // For polygons, CTRL + drag adds a new point.\n if (this.shape.getType() === 'polygon' && (e.ctrlKey || e.metaKey)) {\n this.shape.addNewPointAfter(handleIndex);\n this.removeFromSvg();\n this.addToSvg(svg);\n this.setActive();\n }\n\n var changingDropZone = this,\n lastX = info.x,\n lastY = info.y,\n dragProxy = this.makeDragProxy(info.x, info.y),\n bgImg = $('fieldset#id_previewareaheader .dropbackground'),\n maxX = bgImg.width(),\n maxY = bgImg.height();\n\n dragDrop.start(e, $(dragProxy), function(pageX, pageY) {\n changingDropZone.shape.edit(handleIndex, pageX - lastX, pageY - lastY, maxX, maxY);\n lastX = pageX;\n lastY = pageY;\n changingDropZone.updateSvgEl();\n changingDropZone.setCoordinatesInForm();\n }, function() {\n document.body.removeChild(dragProxy);\n changingDropZone.shape.normalizeShape();\n changingDropZone.updateSvgEl();\n changingDropZone.setCoordinatesInForm();\n });\n };\n\n /**\n * Make an invisible drag proxy.\n *\n * @param {int} x x position .\n * @param {int} y y position.\n * @returns {HTMLElement} the drag proxy.\n */\n DropZoneManager.prototype.makeDragProxy = function(x, y) {\n var dragProxy = document.createElement('div');\n dragProxy.style.position = 'absolute';\n dragProxy.style.top = y + 'px';\n dragProxy.style.left = x + 'px';\n dragProxy.style.width = '1px';\n dragProxy.style.height = '1px';\n document.body.appendChild(dragProxy);\n return dragProxy;\n };\n\n /**\n * Singleton object for managing all the parts of the form.\n */\n var dragDropForm = {\n\n /**\n * @var {object} for interacting with the file pickers.\n */\n fp: null, // Object containing functions associated with the file picker.\n\n /**\n * @var {int} the number of drop-zones on the form.\n */\n noDropZones: null,\n\n /**\n * @var {DropZoneManager[]} the drop zones in the preview, indexed by drop zone number.\n */\n dropZones: [],\n\n /**\n * Initialise the form.\n */\n init: function() {\n dragDropForm.fp = dragDropForm.filePickers();\n dragDropForm.noDropZones = dragDropForm.form.getFormValue('nodropzone', []);\n dragDropForm.setupPreviewArea();\n dragDropForm.setOptionsForDragItemSelectors();\n dragDropForm.createShapes();\n dragDropForm.setupEventHandlers();\n dragDropForm.waitForFilePickerToInitialise();\n },\n\n /**\n * Add html for the preview area.\n */\n setupPreviewArea: function() {\n $('fieldset#id_previewareaheader div.fcontainer').append(\n '
' +\n '
' +\n ' ' +\n '
' +\n '
' +\n '
' +\n '
');\n },\n\n /**\n * When a new marker is added this function updates the Marker dropdown controls in Drop zones.\n */\n setOptionsForDragItemSelectors: function() {\n var dragItemsOptions = {'0': ''};\n var noItems = dragDropForm.form.getFormValue('noitems', []);\n var selectedValues = [];\n var selector;\n var i, label;\n for (i = 1; i <= noItems; i++) {\n label = dragDropForm.form.getMarkerText(i);\n if (label !== \"\") {\n // HTML escape the label.\n dragItemsOptions[i] = $('
').text(label).html();\n }\n }\n // Get all the currently selected drags for each drop.\n for (i = 0; i < dragDropForm.noDropZones; i++) {\n selector = $('#id_drops_' + i + '_choice');\n selectedValues[i] = Number(selector.val());\n }\n for (i = 0; i < dragDropForm.noDropZones; i++) {\n selector = $('#id_drops_' + i + '_choice');\n // Remove all options for drag choice.\n selector.find('option').remove();\n // And recreate the options.\n for (var value in dragItemsOptions) {\n value = Number(value);\n var option = '';\n selector.append(option);\n var optionnode = selector.find('option[value=\"' + value + '\"]');\n\n\n if (value === 0) {\n continue; // The 'no item' option is always selectable.\n }\n\n // Is this the currently selected value?\n if (value === selectedValues[i]) {\n optionnode.attr('selected', true);\n continue; // If it s selected, we must leave it enabled.\n }\n\n // Count how many times it is used, and if necessary, disable.\n var noofdrags = dragDropForm.form.getFormValue('drags', [value - 1, 'noofdrags']);\n if (Number(noofdrags) === 0) { // 'noofdrags === 0' means infinite.\n continue; // Nothing to check.\n }\n\n // Go through all selected values in drop downs.\n for (var k in selectedValues) {\n if (Number(selectedValues[k]) !== value) {\n continue;\n }\n\n // Count down 'noofdrags' and if reach zero then set disabled option for this drag item.\n if (Number(noofdrags) === 1) {\n optionnode.attr('disabled', true);\n break;\n } else {\n noofdrags--;\n }\n }\n }\n\n if (dragDropForm.dropZones.length > 0) {\n dragDropForm.dropZones[i].updateLabel();\n }\n }\n },\n\n /**\n * Create the shape representation of each dropZone.\n */\n createShapes: function() {\n for (var dropzoneNo = 0; dropzoneNo < dragDropForm.noDropZones; dropzoneNo++) {\n dragDropForm.dropZones[dropzoneNo] = new DropZoneManager(dropzoneNo);\n }\n },\n\n /**\n * Events linked to form actions.\n */\n setupEventHandlers: function() {\n // Changes to labels in the Markers section.\n $('fieldset#id_draggableitemheader').on('change input', 'input, select', function() {\n dragDropForm.setOptionsForDragItemSelectors();\n });\n\n // Changes to Drop zones section: shape, coordinates and marker.\n $('fieldset#id_dropzoneheader').on('change input', 'input, select', function(e) {\n var ids = e.currentTarget.name.match(/^drops\\[(\\d+)]\\[([a-z]*)]$/);\n if (!ids) {\n return;\n }\n\n var dropzoneNo = ids[1],\n inputType = ids[2],\n dropZone = dragDropForm.dropZones[dropzoneNo];\n\n switch (inputType) {\n case 'shape':\n dropZone.changeShape(dragDropForm.form.getSvg());\n break;\n\n case 'coords':\n dropZone.updateCoordinatesFromForm(dragDropForm.form.getSvg());\n break;\n\n case 'choice':\n dropZone.updateLabel();\n break;\n }\n });\n\n // Click to toggle graphical editing.\n var previewArea = $('fieldset#id_previewareaheader');\n previewArea.on('click', 'g.dropzone', function(e) {\n var dropzoneNo = $(e.currentTarget).data('dropzone-no'),\n currentlyActive = dragDropForm.dropZones[dropzoneNo].isActive();\n\n $(dragDropForm.form.getSvg()).find('.dropzone.active').removeClass('active');\n\n if (!currentlyActive) {\n dragDropForm.dropZones[dropzoneNo].setActive();\n }\n });\n\n // Drag start on a move handle.\n previewArea.on('mousedown touchstart', '.dropzone .handle.move', function(e) {\n var dropzoneNo = $(e.currentTarget).closest('g').data('dropzoneNo');\n\n dragDropForm.dropZones[dropzoneNo].handleMove(e);\n });\n\n // Drag start on a move handle.\n previewArea.on('mousedown touchstart', '.dropzone .handle.edit', function(e) {\n var dropzoneNo = $(e.currentTarget).closest('g').data('dropzoneNo'),\n handleIndex = e.currentTarget.getAttribute('data-edit-handle-no');\n\n dragDropForm.dropZones[dropzoneNo].handleEdit(e, handleIndex, dragDropForm.form.getSvg());\n });\n },\n\n /**\n * Prevents adding drop zones until the preview background image is ready to load.\n */\n waitForFilePickerToInitialise: function() {\n if (dragDropForm.fp.file('bgimage').href === null) {\n // It would be better to use an onload or onchange event rather than this timeout.\n // Unfortunately attempts to do this early are overwritten by filepicker during its loading.\n setTimeout(dragDropForm.waitForFilePickerToInitialise, 1000);\n return;\n }\n\n // From now on, when a new file gets loaded into the filepicker, update the preview.\n // This is not in the setupEventHandlers section as it needs to be delayed until\n // after filepicker's javascript has finished.\n $('form.mform[data-qtype=\"ddmarker\"]').on('change', '#id_bgimage', dragDropForm.loadPreviewImage);\n\n dragDropForm.loadPreviewImage();\n },\n\n /**\n * Loads the preview background image.\n */\n loadPreviewImage: function() {\n $('fieldset#id_previewareaheader .dropbackground')\n .one('load', dragDropForm.afterPreviewImageLoaded)\n .attr('src', dragDropForm.fp.file('bgimage').href);\n },\n\n /**\n * Functions to run after background image loaded.\n */\n afterPreviewImageLoaded: function() {\n var bgImg = $('fieldset#id_previewareaheader .dropbackground');\n // Place the dropzone area over the background image (adding one to account for the border).\n $('#ddm-dropzone').css('position', 'relative').css('top', (bgImg.height() + 1) * -1);\n $('#ddm-droparea').css('height', bgImg.height() + 20);\n dragDropForm.updateSvgDisplay();\n },\n\n /**\n * Draws or re-draws all dropzones in the preview area based on form data.\n * Call this function when there is a change in the form data.\n */\n updateSvgDisplay: function() {\n var bgImg = $('fieldset#id_previewareaheader .dropbackground'),\n dropzoneNo;\n\n if (dragDropForm.form.getSvg()) {\n // Already exists, just need to be updated.\n for (dropzoneNo = 0; dropzoneNo < dragDropForm.noDropZones; dropzoneNo++) {\n dragDropForm.dropZones[dropzoneNo].updateSvgEl();\n }\n\n } else {\n // Create.\n $('#ddm-dropzone').html('');\n for (dropzoneNo = 0; dropzoneNo < dragDropForm.noDropZones; dropzoneNo++) {\n dragDropForm.dropZones[dropzoneNo].addToSvg(dragDropForm.form.getSvg());\n }\n }\n },\n\n /**\n * Helper to make it easy to work with form elements with names like \"drops[0][shape]\".\n */\n form: {\n /**\n * Returns the label text for a marker.\n * @param {int} markerNo\n * @returns {string} Marker text\n */\n getMarkerText: function(markerNo) {\n if (Number(markerNo) !== 0) {\n var label = dragDropForm.form.getFormValue('drags', [markerNo - 1, 'label']);\n return label.replace(new RegExp(\"^\\\\s*(.*)\\\\s*$\"), \"$1\");\n } else {\n return '';\n }\n },\n\n /**\n * Get the SVG element, if there is one, otherwise return null.\n *\n * @returns {SVGElement|null} the SVG element or null.\n */\n getSvg: function() {\n var svg = $('fieldset#id_previewareaheader svg');\n if (svg.length === 0) {\n return null;\n } else {\n return svg[0];\n }\n },\n\n toNameWithIndex: function(name, indexes) {\n var indexString = name;\n for (var i = 0; i < indexes.length; i++) {\n indexString = indexString + '[' + indexes[i] + ']';\n }\n return indexString;\n },\n\n getEl: function(name, indexes) {\n var form = $('form.mform[data-qtype=\"ddmarker\"]')[0];\n return form.elements[this.toNameWithIndex(name, indexes)];\n },\n\n /**\n * Helper to get the value of a form elements with name like \"drops[0][shape]\".\n *\n * @param {String} name the base name, e.g. 'drops'.\n * @param {String[]} indexes the indexes, e.g. ['0', 'shape'].\n * @return {String} the value of that field.\n */\n getFormValue: function(name, indexes) {\n var el = this.getEl(name, indexes);\n if (el.type === 'checkbox') {\n return el.checked;\n } else {\n return el.value;\n }\n },\n\n /**\n * Helper to get the value of a form elements with name like \"drops[0][shape]\".\n *\n * @param {String} name the base name, e.g. 'drops'.\n * @param {String[]} indexes the indexes, e.g. ['0', 'shape'].\n * @param {String} value the value to set.\n */\n setFormValue: function(name, indexes, value) {\n var el = this.getEl(name, indexes);\n if (el.type === 'checkbox') {\n el.checked = value;\n } else {\n el.value = value;\n }\n }\n },\n\n /**\n * Utility to get the file name and url from the filepicker.\n * @returns {Object} object containing functions {file, name}\n */\n filePickers: function() {\n var draftItemIdsToName;\n var nameToParentNode;\n if (draftItemIdsToName === undefined) {\n draftItemIdsToName = {};\n nameToParentNode = {};\n $('form.mform input.filepickerhidden').each(function(key, filepicker) {\n draftItemIdsToName[filepicker.value] = filepicker.name;\n nameToParentNode[filepicker.name] = filepicker.parentNode;\n });\n }\n return {\n file: function(name) {\n var fileAnchor = $(nameToParentNode[name]).find('div.filepicker-filelist a');\n if (fileAnchor.length) {\n return {href: fileAnchor.get(0).href, name: fileAnchor.get(0).innerHTML};\n } else {\n return {href: null, name: null};\n }\n },\n name: function(draftitemid) {\n return draftItemIdsToName[draftitemid];\n }\n };\n }\n };\n\n /**\n * @alias module:qtype_ddmarker/form\n */\n return {\n /**\n * Initialise the form javascript features.\n * @param {Object} maxBgimageSize object with two properties: width and height.\n */\n init: dragDropForm.init\n };\n});\n"],"file":"form.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/form.js"],"names":["define","$","dragDrop","Shapes","DropZoneManager","dropzoneNo","svgEl","shape","make","getShapeType","getLabel","updateCoordinatesFromForm","prototype","svg","coordinates","getCoordinates","currentNumPoints","getType","points","length","parse","currentyActive","isActive","removeFromSvg","addToSvg","setActive","updateSvgEl","setCoordinatesInForm","updateLabel","label","changeShape","newShapeType","getSimilar","Error","makeSvg","setAttribute","handles","getHandlePositions","moveHandle","createSvgElement","x","y","i","editHandles","makeEditHandle","index","point","editHandle","parentNode","removeChild","updateSvg","childNodes","getAttribute","match","parent","appendChild","dragDropForm","form","setFormValue","getFormValue","replace","getChoiceNo","getMarkerText","handleMove","e","info","prepare","start","movingDropZone","lastX","lastY","dragProxy","makeDragProxy","bgImg","maxX","width","maxY","height","pageX","pageY","move","document","body","handleEdit","handleIndex","ctrlKey","metaKey","addNewPointAfter","changingDropZone","edit","normalizeShape","createElement","style","position","top","left","fp","noDropZones","dropZones","init","filePickers","setupPreviewArea","setOptionsForDragItemSelectors","createShapes","setupEventHandlers","waitForFilePickerToInitialise","append","dragItemsOptions","noItems","selectedValues","selector","text","html","val","find","remove","value","option","optionnode","attr","noofdrags","k","on","ids","currentTarget","name","inputType","dropZone","getSvg","previewArea","data","currentlyActive","removeClass","closest","file","href","setTimeout","loadPreviewImage","one","afterPreviewImageLoaded","css","updateSvgDisplay","outerWidth","outerHeight","markerNo","toNameWithIndex","indexes","indexString","getEl","elements","el","type","checked","draftItemIdsToName","nameToParentNode","each","key","filepicker","fileAnchor","get","innerHTML","draftitemid"],"mappings":"AAuBAA,OAAM,uBAAC,CAAC,QAAD,CAAW,eAAX,CAA4B,uBAA5B,CAAD,CAAuD,SAASC,CAAT,CAAYC,CAAZ,CAAsBC,CAAtB,CAA8B,CAEvF,aAQA,QAASC,CAAAA,CAAT,CAAyBC,CAAzB,CAAqC,CACjC,KAAKA,UAAL,CAAkBA,CAAlB,CACA,KAAKC,KAAL,CAAa,IAAb,CAEA,KAAKC,KAAL,CAAaJ,CAAM,CAACK,IAAP,CAAY,KAAKC,YAAL,EAAZ,CAAiC,KAAKC,QAAL,EAAjC,CAAb,CACA,KAAKC,yBAAL,EACH,CAODP,CAAe,CAACQ,SAAhB,CAA0BD,yBAA1B,CAAsD,SAASE,CAAT,CAAc,CAChE,GAAIC,CAAAA,CAAW,CAAG,KAAKC,cAAL,EAAlB,CACIC,CAAgB,CAA4B,SAAzB,QAAKT,KAAL,CAAWU,OAAX,IAAsC,KAAKV,KAAL,CAAWW,MAAX,CAAkBC,MAD/E,CAEA,GAAI,KAAKZ,KAAL,CAAWQ,cAAX,KAAgCD,CAApC,CAAiD,CAC7C,MACH,CAED,GAAI,CAAC,KAAKP,KAAL,CAAWa,KAAX,CAAiBN,CAAjB,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AAH,CAAapC,CAChB,CAFD,IAEO,CACHkC,CAAE,CAAClC,KAAH,CAAWA,CACd,CACJ,CAxEC,CA/PS,CA8UfhB,WAAW,CAAE,sBAAW,IAChBqD,CAAAA,CADgB,CAEhBC,CAFgB,CAGpB,GAAID,CAAkB,SAAtB,CAAsC,CAClCA,CAAkB,CAAG,EAArB,CACAC,CAAgB,CAAG,EAAnB,CACAzJ,CAAC,CAAC,mCAAD,CAAD,CAAuC0J,IAAvC,CAA4C,SAASC,CAAT,CAAcC,CAAd,CAA0B,CAClEJ,CAAkB,CAACI,CAAU,CAACzC,KAAZ,CAAlB,CAAuCyC,CAAU,CAAChC,IAAlD,CACA6B,CAAgB,CAACG,CAAU,CAAChC,IAAZ,CAAhB,CAAoCgC,CAAU,CAAC7G,UAClD,CAHD,CAIH,CACD,MAAO,CACHsF,IAAI,CAAE,cAAST,CAAT,CAAe,CACjB,GAAIiC,CAAAA,CAAU,CAAG7J,CAAC,CAACyJ,CAAgB,CAAC7B,CAAD,CAAjB,CAAD,CAA0BX,IAA1B,CAA+B,2BAA/B,CAAjB,CACA,GAAI4C,CAAU,CAAC3I,MAAf,CAAuB,CACnB,MAAO,CAACoH,IAAI,CAAEuB,CAAU,CAACC,GAAX,CAAe,CAAf,EAAkBxB,IAAzB,CAA+BV,IAAI,CAAEiC,CAAU,CAACC,GAAX,CAAe,CAAf,EAAkBC,SAAvD,CACV,CAFD,IAEO,CACH,MAAO,CAACzB,IAAI,CAAE,IAAP,CAAaV,IAAI,CAAE,IAAnB,CACV,CACJ,CARE,CASHA,IAAI,CAAE,cAASoC,CAAT,CAAsB,CACxB,MAAOR,CAAAA,CAAkB,CAACQ,CAAD,CAC5B,CAXE,CAaV,CAtWc,CAAnB,CA4WA,MAAO,CAKH9D,IAAI,CAAE3C,CAAY,CAAC2C,IALhB,CAOV,CA7rBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * This class provides the enhancements to the drag-drop marker editing form.\n *\n * @module qtype_ddmarker/form\n * @copyright 2018 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/dragdrop', 'qtype_ddmarker/shapes'], function($, dragDrop, Shapes) {\n\n \"use strict\";\n\n /**\n * Create the manager object that deals with keeping everything synchronised for one drop zone.\n *\n * @param {int} dropzoneNo the index of this drop zone in the form. 0, 1, ....\n * @constructor\n */\n function DropZoneManager(dropzoneNo) {\n this.dropzoneNo = dropzoneNo;\n this.svgEl = null;\n\n this.shape = Shapes.make(this.getShapeType(), this.getLabel());\n this.updateCoordinatesFromForm();\n }\n\n /**\n * Update the coordinates from a particular string.\n *\n * @param {SVGElement} [svg] the SVG element that is the preview.\n */\n DropZoneManager.prototype.updateCoordinatesFromForm = function(svg) {\n var coordinates = this.getCoordinates(),\n currentNumPoints = this.shape.getType() === 'polygon' && this.shape.points.length;\n if (this.shape.getCoordinates() === coordinates) {\n return;\n }\n // We don't need to scale the shape for editing form.\n if (!this.shape.parse(coordinates, 1)) {\n // Invalid coordinates. Don't update the preview.\n return;\n }\n\n if (this.shape.getType() === 'polygon' && currentNumPoints !== this.shape.points.length) {\n // Polygon, and size has changed.\n var currentyActive = this.isActive();\n this.removeFromSvg();\n if (svg) {\n this.addToSvg(svg);\n if (currentyActive) {\n this.setActive();\n }\n }\n } else {\n // Simple update.\n this.updateSvgEl();\n }\n // Update the rounded coordinates if needed.\n this.setCoordinatesInForm();\n };\n\n /**\n * Update the label.\n */\n DropZoneManager.prototype.updateLabel = function() {\n var label = this.getLabel();\n if (this.shape.label !== label) {\n this.shape.label = label;\n this.updateSvgEl();\n }\n };\n\n /**\n * Handle if the type of shape has changed.\n *\n * @param {SVGElement} [svg] an SVG element to add this new shape to.\n */\n DropZoneManager.prototype.changeShape = function(svg) {\n var newShapeType = this.getShapeType(),\n currentyActive = this.isActive();\n\n if (newShapeType === this.shape.getType()) {\n return;\n }\n\n // It has really changed.\n this.removeFromSvg();\n this.shape = Shapes.getSimilar(newShapeType, this.shape);\n if (svg) {\n this.addToSvg(svg);\n if (currentyActive) {\n this.setActive();\n }\n }\n this.setCoordinatesInForm();\n };\n\n /**\n * Add this drop zone to an SVG graphic.\n *\n * @param {SVGElement} svg the SVG image to which to add this drop zone.\n */\n DropZoneManager.prototype.addToSvg = function(svg) {\n if (this.svgEl !== null) {\n throw new Error('this.svgEl already set');\n }\n this.svgEl = this.shape.makeSvg(svg);\n if (!this.svgEl) {\n return;\n }\n this.svgEl.setAttribute('class', 'dropzone');\n this.svgEl.setAttribute('data-dropzone-no', this.dropzoneNo);\n\n // Add handles.\n var handles = this.shape.getHandlePositions();\n if (handles === null) {\n return;\n }\n\n var moveHandle = Shapes.createSvgElement(this.svgEl, 'circle');\n moveHandle.setAttribute('cx', handles.moveHandle.x);\n moveHandle.setAttribute('cy', handles.moveHandle.y);\n moveHandle.setAttribute('r', 7);\n moveHandle.setAttribute('class', 'handle move');\n\n for (var i = 0; i < handles.editHandles.length; ++i) {\n this.makeEditHandle(i, handles.editHandles[i]);\n }\n };\n\n /**\n * Add a new edit handle.\n *\n * @param {int} index the handle index.\n * @param {Point} point the point at which to add the handle.\n */\n DropZoneManager.prototype.makeEditHandle = function(index, point) {\n var editHandle = Shapes.createSvgElement(this.svgEl, 'rect');\n editHandle.setAttribute('x', point.x - 6);\n editHandle.setAttribute('y', point.y - 6);\n editHandle.setAttribute('width', 11);\n editHandle.setAttribute('height', 11);\n editHandle.setAttribute('class', 'handle edit');\n editHandle.setAttribute('data-edit-handle-no', index);\n };\n\n /**\n * Remove this drop zone from an SVG image.\n */\n DropZoneManager.prototype.removeFromSvg = function() {\n if (this.svgEl !== null) {\n this.svgEl.parentNode.removeChild(this.svgEl);\n this.svgEl = null;\n }\n };\n\n /**\n * Update the shape of this drop zone (but not type) in an SVG image.\n */\n DropZoneManager.prototype.updateSvgEl = function() {\n if (this.svgEl === null) {\n return;\n }\n\n this.shape.updateSvg(this.svgEl);\n\n // Adjust handles.\n var handles = this.shape.getHandlePositions();\n if (handles === null) {\n return;\n }\n\n // Move handle.\n // The shape + its label are the first two children of svgEl.\n // Then come the move handle followed by the edit handles.\n this.svgEl.childNodes[2].setAttribute('cx', handles.moveHandle.x);\n this.svgEl.childNodes[2].setAttribute('cy', handles.moveHandle.y);\n\n // Edit handles.\n for (var i = 0; i < handles.editHandles.length; ++i) {\n this.svgEl.childNodes[3 + i].setAttribute('x', handles.editHandles[i].x - 6);\n this.svgEl.childNodes[3 + i].setAttribute('y', handles.editHandles[i].y - 6);\n }\n };\n\n /**\n * Find out of this drop zone is currently being edited.\n *\n * @return {boolean} true if it is.\n */\n DropZoneManager.prototype.isActive = function() {\n return this.svgEl !== null && this.svgEl.getAttribute('class').match(/\\bactive\\b/);\n };\n\n /**\n * Set this drop zone as being edited.\n */\n DropZoneManager.prototype.setActive = function() {\n // Move this one to last, so that it is always on top.\n // (Otherwise the handles may not be able to receive events.)\n var parent = this.svgEl.parentNode;\n parent.removeChild(this.svgEl);\n parent.appendChild(this.svgEl);\n this.svgEl.setAttribute('class', this.svgEl.getAttribute('class') + ' active');\n };\n\n /**\n * Set the coordinates in the form to match the current shape.\n */\n DropZoneManager.prototype.setCoordinatesInForm = function() {\n dragDropForm.form.setFormValue('drops', [this.dropzoneNo, 'coords'], this.shape.getCoordinates());\n };\n\n /**\n * Returns the coordinates for a drop zone from the text input in the form.\n * @returns {string} the coordinates.\n */\n DropZoneManager.prototype.getCoordinates = function() {\n return dragDropForm.form.getFormValue('drops', [this.dropzoneNo, 'coords']).replace(/\\s*/g, '');\n };\n\n /**\n * Returns the selected marker number from the dropdown in the form.\n * @returns {int} choice number.\n */\n DropZoneManager.prototype.getChoiceNo = function() {\n return dragDropForm.form.getFormValue('drops', [this.dropzoneNo, 'choice']);\n };\n\n /**\n * Returns the selected marker number from the dropdown in the form.\n * @returns {String} marker label text.\n */\n DropZoneManager.prototype.getLabel = function() {\n return dragDropForm.form.getMarkerText(this.getChoiceNo());\n };\n\n\n /**\n * Returns the selected type of shape in the form.\n * @returns {String} 'circle', 'rectangle' or 'polygon'.\n */\n DropZoneManager.prototype.getShapeType = function() {\n return dragDropForm.form.getFormValue('drops', [this.dropzoneNo, 'shape']);\n };\n\n /**\n * Start responding to dragging the move handle.\n * @param {Event} e Event object\n */\n DropZoneManager.prototype.handleMove = function(e) {\n var info = dragDrop.prepare(e);\n if (!info.start) {\n return;\n }\n\n var movingDropZone = this,\n lastX = info.x,\n lastY = info.y,\n dragProxy = this.makeDragProxy(info.x, info.y),\n bgImg = $('fieldset#id_previewareaheader .dropbackground'),\n maxX = bgImg.width(),\n maxY = bgImg.height();\n\n dragDrop.start(e, $(dragProxy), function(pageX, pageY) {\n movingDropZone.shape.move(pageX - lastX, pageY - lastY, maxX, maxY);\n lastX = pageX;\n lastY = pageY;\n movingDropZone.updateSvgEl();\n movingDropZone.setCoordinatesInForm();\n }, function() {\n document.body.removeChild(dragProxy);\n });\n };\n\n /**\n * Start responding to dragging the move handle.\n * @param {Event} e Event object\n * @param {int} handleIndex\n * @param {SVGElement} [svg] an SVG element to add this new shape to.\n */\n DropZoneManager.prototype.handleEdit = function(e, handleIndex, svg) {\n var info = dragDrop.prepare(e);\n if (!info.start) {\n return;\n }\n\n // For polygons, CTRL + drag adds a new point.\n if (this.shape.getType() === 'polygon' && (e.ctrlKey || e.metaKey)) {\n this.shape.addNewPointAfter(handleIndex);\n this.removeFromSvg();\n this.addToSvg(svg);\n this.setActive();\n }\n\n var changingDropZone = this,\n lastX = info.x,\n lastY = info.y,\n dragProxy = this.makeDragProxy(info.x, info.y),\n bgImg = $('fieldset#id_previewareaheader .dropbackground'),\n maxX = bgImg.width(),\n maxY = bgImg.height();\n\n dragDrop.start(e, $(dragProxy), function(pageX, pageY) {\n changingDropZone.shape.edit(handleIndex, pageX - lastX, pageY - lastY, maxX, maxY);\n lastX = pageX;\n lastY = pageY;\n changingDropZone.updateSvgEl();\n changingDropZone.setCoordinatesInForm();\n }, function() {\n document.body.removeChild(dragProxy);\n changingDropZone.shape.normalizeShape();\n changingDropZone.updateSvgEl();\n changingDropZone.setCoordinatesInForm();\n });\n };\n\n /**\n * Make an invisible drag proxy.\n *\n * @param {int} x x position .\n * @param {int} y y position.\n * @returns {HTMLElement} the drag proxy.\n */\n DropZoneManager.prototype.makeDragProxy = function(x, y) {\n var dragProxy = document.createElement('div');\n dragProxy.style.position = 'absolute';\n dragProxy.style.top = y + 'px';\n dragProxy.style.left = x + 'px';\n dragProxy.style.width = '1px';\n dragProxy.style.height = '1px';\n document.body.appendChild(dragProxy);\n return dragProxy;\n };\n\n /**\n * Singleton object for managing all the parts of the form.\n */\n var dragDropForm = {\n\n /**\n * @var {object} for interacting with the file pickers.\n */\n fp: null, // Object containing functions associated with the file picker.\n\n /**\n * @var {int} the number of drop-zones on the form.\n */\n noDropZones: null,\n\n /**\n * @var {DropZoneManager[]} the drop zones in the preview, indexed by drop zone number.\n */\n dropZones: [],\n\n /**\n * Initialise the form.\n */\n init: function() {\n dragDropForm.fp = dragDropForm.filePickers();\n dragDropForm.noDropZones = dragDropForm.form.getFormValue('nodropzone', []);\n dragDropForm.setupPreviewArea();\n dragDropForm.setOptionsForDragItemSelectors();\n dragDropForm.createShapes();\n dragDropForm.setupEventHandlers();\n dragDropForm.waitForFilePickerToInitialise();\n },\n\n /**\n * Add html for the preview area.\n */\n setupPreviewArea: function() {\n $('fieldset#id_previewareaheader div.fcontainer').append(\n '
' +\n '
' +\n ' ' +\n '
' +\n '
' +\n '
' +\n '
');\n },\n\n /**\n * When a new marker is added this function updates the Marker dropdown controls in Drop zones.\n */\n setOptionsForDragItemSelectors: function() {\n var dragItemsOptions = {'0': ''};\n var noItems = dragDropForm.form.getFormValue('noitems', []);\n var selectedValues = [];\n var selector;\n var i, label;\n for (i = 1; i <= noItems; i++) {\n label = dragDropForm.form.getMarkerText(i);\n if (label !== \"\") {\n // HTML escape the label.\n dragItemsOptions[i] = $('
').text(label).html();\n }\n }\n // Get all the currently selected drags for each drop.\n for (i = 0; i < dragDropForm.noDropZones; i++) {\n selector = $('#id_drops_' + i + '_choice');\n selectedValues[i] = Number(selector.val());\n }\n for (i = 0; i < dragDropForm.noDropZones; i++) {\n selector = $('#id_drops_' + i + '_choice');\n // Remove all options for drag choice.\n selector.find('option').remove();\n // And recreate the options.\n for (var value in dragItemsOptions) {\n value = Number(value);\n var option = '';\n selector.append(option);\n var optionnode = selector.find('option[value=\"' + value + '\"]');\n\n\n if (value === 0) {\n continue; // The 'no item' option is always selectable.\n }\n\n // Is this the currently selected value?\n if (value === selectedValues[i]) {\n optionnode.attr('selected', true);\n continue; // If it s selected, we must leave it enabled.\n }\n\n // Count how many times it is used, and if necessary, disable.\n var noofdrags = dragDropForm.form.getFormValue('drags', [value - 1, 'noofdrags']);\n if (Number(noofdrags) === 0) { // 'noofdrags === 0' means infinite.\n continue; // Nothing to check.\n }\n\n // Go through all selected values in drop downs.\n for (var k in selectedValues) {\n if (Number(selectedValues[k]) !== value) {\n continue;\n }\n\n // Count down 'noofdrags' and if reach zero then set disabled option for this drag item.\n if (Number(noofdrags) === 1) {\n optionnode.attr('disabled', true);\n break;\n } else {\n noofdrags--;\n }\n }\n }\n\n if (dragDropForm.dropZones.length > 0) {\n dragDropForm.dropZones[i].updateLabel();\n }\n }\n },\n\n /**\n * Create the shape representation of each dropZone.\n */\n createShapes: function() {\n for (var dropzoneNo = 0; dropzoneNo < dragDropForm.noDropZones; dropzoneNo++) {\n dragDropForm.dropZones[dropzoneNo] = new DropZoneManager(dropzoneNo);\n }\n },\n\n /**\n * Events linked to form actions.\n */\n setupEventHandlers: function() {\n // Changes to labels in the Markers section.\n $('fieldset#id_draggableitemheader').on('change input', 'input, select', function() {\n dragDropForm.setOptionsForDragItemSelectors();\n });\n\n // Changes to Drop zones section: shape, coordinates and marker.\n $('fieldset#id_dropzoneheader').on('change input', 'input, select', function(e) {\n var ids = e.currentTarget.name.match(/^drops\\[(\\d+)]\\[([a-z]*)]$/);\n if (!ids) {\n return;\n }\n\n var dropzoneNo = ids[1],\n inputType = ids[2],\n dropZone = dragDropForm.dropZones[dropzoneNo];\n\n switch (inputType) {\n case 'shape':\n dropZone.changeShape(dragDropForm.form.getSvg());\n break;\n\n case 'coords':\n dropZone.updateCoordinatesFromForm(dragDropForm.form.getSvg());\n break;\n\n case 'choice':\n dropZone.updateLabel();\n break;\n }\n });\n\n // Click to toggle graphical editing.\n var previewArea = $('fieldset#id_previewareaheader');\n previewArea.on('click', 'g.dropzone', function(e) {\n var dropzoneNo = $(e.currentTarget).data('dropzone-no'),\n currentlyActive = dragDropForm.dropZones[dropzoneNo].isActive();\n\n $(dragDropForm.form.getSvg()).find('.dropzone.active').removeClass('active');\n\n if (!currentlyActive) {\n dragDropForm.dropZones[dropzoneNo].setActive();\n }\n });\n\n // Drag start on a move handle.\n previewArea.on('mousedown touchstart', '.dropzone .handle.move', function(e) {\n var dropzoneNo = $(e.currentTarget).closest('g').data('dropzoneNo');\n\n dragDropForm.dropZones[dropzoneNo].handleMove(e);\n });\n\n // Drag start on a move handle.\n previewArea.on('mousedown touchstart', '.dropzone .handle.edit', function(e) {\n var dropzoneNo = $(e.currentTarget).closest('g').data('dropzoneNo'),\n handleIndex = e.currentTarget.getAttribute('data-edit-handle-no');\n\n dragDropForm.dropZones[dropzoneNo].handleEdit(e, handleIndex, dragDropForm.form.getSvg());\n });\n },\n\n /**\n * Prevents adding drop zones until the preview background image is ready to load.\n */\n waitForFilePickerToInitialise: function() {\n if (dragDropForm.fp.file('bgimage').href === null) {\n // It would be better to use an onload or onchange event rather than this timeout.\n // Unfortunately attempts to do this early are overwritten by filepicker during its loading.\n setTimeout(dragDropForm.waitForFilePickerToInitialise, 1000);\n return;\n }\n\n // From now on, when a new file gets loaded into the filepicker, update the preview.\n // This is not in the setupEventHandlers section as it needs to be delayed until\n // after filepicker's javascript has finished.\n $('form.mform[data-qtype=\"ddmarker\"]').on('change', '#id_bgimage', dragDropForm.loadPreviewImage);\n\n dragDropForm.loadPreviewImage();\n },\n\n /**\n * Loads the preview background image.\n */\n loadPreviewImage: function() {\n $('fieldset#id_previewareaheader .dropbackground')\n .one('load', dragDropForm.afterPreviewImageLoaded)\n .attr('src', dragDropForm.fp.file('bgimage').href);\n },\n\n /**\n * Functions to run after background image loaded.\n */\n afterPreviewImageLoaded: function() {\n var bgImg = $('fieldset#id_previewareaheader .dropbackground');\n // Place the dropzone area over the background image (adding one to account for the border).\n $('#ddm-dropzone').css('position', 'relative').css('top', (bgImg.height() + 1) * -1);\n $('#ddm-droparea').css('height', bgImg.height() + 20);\n dragDropForm.updateSvgDisplay();\n },\n\n /**\n * Draws or re-draws all dropzones in the preview area based on form data.\n * Call this function when there is a change in the form data.\n */\n updateSvgDisplay: function() {\n var bgImg = $('fieldset#id_previewareaheader .dropbackground'),\n dropzoneNo;\n\n if (dragDropForm.form.getSvg()) {\n // Already exists, just need to be updated.\n for (dropzoneNo = 0; dropzoneNo < dragDropForm.noDropZones; dropzoneNo++) {\n dragDropForm.dropZones[dropzoneNo].updateSvgEl();\n }\n\n } else {\n // Create.\n $('#ddm-dropzone').html('');\n for (dropzoneNo = 0; dropzoneNo < dragDropForm.noDropZones; dropzoneNo++) {\n dragDropForm.dropZones[dropzoneNo].addToSvg(dragDropForm.form.getSvg());\n }\n }\n },\n\n /**\n * Helper to make it easy to work with form elements with names like \"drops[0][shape]\".\n */\n form: {\n /**\n * Returns the label text for a marker.\n * @param {int} markerNo\n * @returns {string} Marker text\n */\n getMarkerText: function(markerNo) {\n if (Number(markerNo) !== 0) {\n var label = dragDropForm.form.getFormValue('drags', [markerNo - 1, 'label']);\n return label.replace(new RegExp(\"^\\\\s*(.*)\\\\s*$\"), \"$1\");\n } else {\n return '';\n }\n },\n\n /**\n * Get the SVG element, if there is one, otherwise return null.\n *\n * @returns {SVGElement|null} the SVG element or null.\n */\n getSvg: function() {\n var svg = $('fieldset#id_previewareaheader svg');\n if (svg.length === 0) {\n return null;\n } else {\n return svg[0];\n }\n },\n\n toNameWithIndex: function(name, indexes) {\n var indexString = name;\n for (var i = 0; i < indexes.length; i++) {\n indexString = indexString + '[' + indexes[i] + ']';\n }\n return indexString;\n },\n\n getEl: function(name, indexes) {\n var form = $('form.mform[data-qtype=\"ddmarker\"]')[0];\n return form.elements[this.toNameWithIndex(name, indexes)];\n },\n\n /**\n * Helper to get the value of a form elements with name like \"drops[0][shape]\".\n *\n * @param {String} name the base name, e.g. 'drops'.\n * @param {String[]} indexes the indexes, e.g. ['0', 'shape'].\n * @return {String} the value of that field.\n */\n getFormValue: function(name, indexes) {\n var el = this.getEl(name, indexes);\n if (el.type === 'checkbox') {\n return el.checked;\n } else {\n return el.value;\n }\n },\n\n /**\n * Helper to get the value of a form elements with name like \"drops[0][shape]\".\n *\n * @param {String} name the base name, e.g. 'drops'.\n * @param {String[]} indexes the indexes, e.g. ['0', 'shape'].\n * @param {String} value the value to set.\n */\n setFormValue: function(name, indexes, value) {\n var el = this.getEl(name, indexes);\n if (el.type === 'checkbox') {\n el.checked = value;\n } else {\n el.value = value;\n }\n }\n },\n\n /**\n * Utility to get the file name and url from the filepicker.\n * @returns {Object} object containing functions {file, name}\n */\n filePickers: function() {\n var draftItemIdsToName;\n var nameToParentNode;\n if (draftItemIdsToName === undefined) {\n draftItemIdsToName = {};\n nameToParentNode = {};\n $('form.mform input.filepickerhidden').each(function(key, filepicker) {\n draftItemIdsToName[filepicker.value] = filepicker.name;\n nameToParentNode[filepicker.name] = filepicker.parentNode;\n });\n }\n return {\n file: function(name) {\n var fileAnchor = $(nameToParentNode[name]).find('div.filepicker-filelist a');\n if (fileAnchor.length) {\n return {href: fileAnchor.get(0).href, name: fileAnchor.get(0).innerHTML};\n } else {\n return {href: null, name: null};\n }\n },\n name: function(draftitemid) {\n return draftItemIdsToName[draftitemid];\n }\n };\n }\n };\n\n /**\n * @alias module:qtype_ddmarker/form\n */\n return {\n /**\n * Initialise the form javascript features.\n * @param {Object} maxBgimageSize object with two properties: width and height.\n */\n init: dragDropForm.init\n };\n});\n"],"file":"form.min.js"} \ No newline at end of file diff --git a/question/type/ddmarker/amd/build/question.min.js.map b/question/type/ddmarker/amd/build/question.min.js.map index 204a5c9e6d34a..7b37ef0fdfb22 100644 --- a/question/type/ddmarker/amd/build/question.min.js.map +++ b/question/type/ddmarker/amd/build/question.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/question.js"],"names":["define","$","dragDrop","Shapes","keys","DragDropMarkersQuestion","containerId","readOnly","visibleDropZones","thisQ","shapes","shapeSVGs","isPrinting","getRoot","addClass","cloneDrags","repositionDrags","drawDropzones","prototype","length","bgImage","find","html","outerWidth","outerHeight","svg","nextColourIndex","dropZoneNo","colourClass","addDropzone","dropZone","shape","make","existingmarkertext","bgRatio","parse","coords","markertext","remove","append","markerspan","handles","getHandlePositions","positionLeft","moveHandle","x","positionTop","y","css","data","position","left","top","handleElementScale","shapeSVG","makeSvg","setAttribute","root","not","each","key","item","input","choiceNo","getChoiceNoFromElement","getCoords","drag","i","dragInDrop","clone","sendDragToDrop","getDragClone","cloneDragIfNeeded","inputNode","val","coordsStrings","split","convertToWindowXY","Point","point","offset","convertToBgImgXY","coordsInBgImg","bgPosition","width","height","document","getElementById","handleDragStart","e","dragged","target","closest","info","prepare","start","placed","hasClass","hiddenDrag","dragEnd","dragXY","bgImgXY","sendDragHome","removeDragIfNeeded","saveCoordsForChoice","items","thiQ","join","handleKeyPress","keyCode","arrowLeft","arrowRight","arrowDown","arrowUp","space","escape","preventDefault","constrainToBgImg","focus","windowxy","bgImg","Math","max","min","node","getClassnameNumericSuffix","prefix","classes","attr","classesarr","index","patt1","RegExp","test","match","exec","handleResize","parseFloat","originCoords","updateSvg","markerSpan","draghome","placeHolder","removeClass","getDragNoClass","before","getDragNo","includeSelector","className","isInfiniteDrag","dropArea","after","isScaling","getInput","noOfDrags","displayedDragsInDropArea","displayedDragsInDragHomes","dragClone","questionManager","addEventHandlersToMarker","dragsInHome","displayedDrags","first","bgImgNaturalWidth","get","naturalWidth","bgImgClientWidth","element","type","eventHandlersInitialised","isKeyboardNavigation","questions","init","setupEventHandlers","window","on","handleWindowResize","addEventListener","setTimeout","fixLayoutIfThingsMoved","focusin","handleKeyboardFocus","focusout","question","getQuestionForEvent","hasOwnProperty","isNavigating","currentTarget"],"mappings":"AAuBAA,OAAM,2BAAC,CAAC,QAAD,CAAW,eAAX,CAA4B,uBAA5B,CAAqD,gBAArD,CAAD,CAAyE,SAASC,CAAT,CAAYC,CAAZ,CAAsBC,CAAtB,CAA8BC,CAA9B,CAAoC,CAE/G,aAWA,QAASC,CAAAA,CAAT,CAAiCC,CAAjC,CAA8CC,CAA9C,CAAwDC,CAAxD,CAA0E,CACtE,GAAIC,CAAAA,CAAK,CAAG,IAAZ,CACA,KAAKH,WAAL,CAAmBA,CAAnB,CACA,KAAKE,gBAAL,CAAwBA,CAAxB,CACA,KAAKE,MAAL,CAAc,EAAd,CACA,KAAKC,SAAL,CAAiB,EAAjB,CACA,KAAKC,UAAL,IACA,GAAIL,CAAJ,CAAc,CACV,KAAKM,OAAL,GAAeC,QAAf,CAAwB,yBAAxB,CACH,CACDL,CAAK,CAACM,UAAN,GACAN,CAAK,CAACO,eAAN,GACAP,CAAK,CAACQ,aAAN,EACH,CAKDZ,CAAuB,CAACa,SAAxB,CAAkCD,aAAlC,CAAkD,UAAW,CACzD,GAAmC,CAA/B,MAAKT,gBAAL,CAAsBW,MAA1B,CAAsC,CAClC,GAAIC,CAAAA,CAAO,CAAG,KAAKA,OAAL,EAAd,CAEA,KAAKP,OAAL,GAAeQ,IAAf,CAAoB,eAApB,EAAqCC,IAArC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Ae,CAACY,oBAAhB,CAAuCgB,CAC1C,CAzHiB,CAgIlBP,sBAAsB,CAAE,iCAAW,CAC/B,GAAI,CAACrB,CAAe,CAACY,oBAArB,CAA2C,CACvC,KAAKM,kBAAL,CAAwBlB,CAAe,CAAClJ,UAAxC,CACH,CAIDsK,UAAU,CAAC,UAAW,CAClBpB,CAAe,CAACqB,sBAAhB,CAAuCrB,CAAe,CAAClJ,UAAvD,CACH,CAFS,CAEP,GAFO,CAGb,CA1IiB,CAiJlB4K,mBAAmB,CAAE,6BAAS/F,CAAT,CAAY,CAC7B,GAAInF,CAAAA,CAAW,CAAGL,CAAC,CAACwF,CAAC,CAACkG,aAAH,CAAD,CAAmB/F,OAAnB,CAA2B,eAA3B,EAA4CoC,IAA5C,CAAiD,IAAjD,CAAlB,CACA,MAAO8B,CAAAA,CAAe,CAACa,SAAhB,CAA0BrK,CAA1B,CACV,CApJiB,CAAtB,CA0JA,MAAO,CASHsK,IAAI,CAAEd,CAAe,CAACc,IATnB,CAWV,CAnzBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Question class for drag and drop marker question type, used to support the question and preview pages.\n *\n * @subpackage question\n * @copyright 2018 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/dragdrop', 'qtype_ddmarker/shapes', 'core/key_codes'], function($, dragDrop, Shapes, keys) {\n\n \"use strict\";\n\n /**\n * Object to handle one drag-drop markers question.\n *\n * @param {String} containerId id of the outer div for this question.\n * @param {boolean} readOnly whether the question is being displayed read-only.\n * @param {Object[]} visibleDropZones the geometry of any drop-zones to show.\n * Objects have fields shape, coords and markertext.\n * @constructor\n */\n function DragDropMarkersQuestion(containerId, readOnly, visibleDropZones) {\n var thisQ = this;\n this.containerId = containerId;\n this.visibleDropZones = visibleDropZones;\n this.shapes = [];\n this.shapeSVGs = [];\n this.isPrinting = false;\n if (readOnly) {\n this.getRoot().addClass('qtype_ddmarker-readonly');\n }\n thisQ.cloneDrags();\n thisQ.repositionDrags();\n thisQ.drawDropzones();\n }\n\n /**\n * Draws the svg shapes of any drop zones that should be visible for feedback purposes.\n */\n DragDropMarkersQuestion.prototype.drawDropzones = function() {\n if (this.visibleDropZones.length > 0) {\n var bgImage = this.bgImage();\n\n this.getRoot().find('div.dropzones').html('');\n var svg = this.getRoot().find('svg.dropzones');\n\n var nextColourIndex = 0;\n for (var dropZoneNo = 0; dropZoneNo < this.visibleDropZones.length; dropZoneNo++) {\n var colourClass = 'color' + nextColourIndex;\n nextColourIndex = (nextColourIndex + 1) % 8;\n this.addDropzone(svg, dropZoneNo, colourClass);\n }\n }\n };\n\n /**\n * Adds a dropzone shape with colour, coords and link provided to the array of shapes.\n *\n * @param {jQuery} svg the SVG image to which to add this drop zone.\n * @param {int} dropZoneNo which drop-zone to add.\n * @param {string} colourClass class name\n */\n DragDropMarkersQuestion.prototype.addDropzone = function(svg, dropZoneNo, colourClass) {\n var dropZone = this.visibleDropZones[dropZoneNo],\n shape = Shapes.make(dropZone.shape, ''),\n existingmarkertext,\n bgRatio = this.bgRatio();\n if (!shape.parse(dropZone.coords, bgRatio)) {\n return;\n }\n\n existingmarkertext = this.getRoot().find('div.markertexts span.markertext' + dropZoneNo);\n if (existingmarkertext.length) {\n if (dropZone.markertext !== '') {\n existingmarkertext.html(dropZone.markertext);\n } else {\n existingmarkertext.remove();\n }\n } else if (dropZone.markertext !== '') {\n var classnames = 'markertext markertext' + dropZoneNo;\n this.getRoot().find('div.markertexts').append('' +\n dropZone.markertext + '');\n var markerspan = this.getRoot().find('div.ddarea div.markertexts span.markertext' + dropZoneNo);\n if (markerspan.length) {\n var handles = shape.getHandlePositions();\n var positionLeft = handles.moveHandle.x - (markerspan.outerWidth() / 2) - 4;\n var positionTop = handles.moveHandle.y - (markerspan.outerHeight() / 2);\n markerspan\n .css('left', positionLeft)\n .css('top', positionTop);\n markerspan\n .data('originX', markerspan.position().left / bgRatio)\n .data('originY', markerspan.position().top / bgRatio);\n this.handleElementScale(markerspan, 'center');\n }\n }\n\n var shapeSVG = shape.makeSvg(svg[0]);\n shapeSVG.setAttribute('class', 'dropzone ' + colourClass);\n\n this.shapes[this.shapes.length] = shape;\n this.shapeSVGs[this.shapeSVGs.length] = shapeSVG;\n };\n\n /**\n * Draws the drag items on the page (and drop zones if required).\n * The idea is to re-draw all the drags and drops whenever there is a change\n * like a widow resize or an item dropped in place.\n */\n DragDropMarkersQuestion.prototype.repositionDrags = function() {\n var root = this.getRoot(),\n thisQ = this;\n\n root.find('div.draghomes .marker').not('.dragplaceholder').each(function(key, item) {\n $(item).addClass('unneeded');\n });\n\n root.find('input.choices').each(function(key, input) {\n var choiceNo = thisQ.getChoiceNoFromElement(input),\n coords = thisQ.getCoords(input);\n if (coords.length) {\n var drag = thisQ.getRoot().find('.draghomes' + ' span.marker' + '.choice' + choiceNo).not('.dragplaceholder');\n drag.remove();\n for (var i = 0; i < coords.length; i++) {\n var dragInDrop = drag.clone();\n dragInDrop.data('pagex', coords[i].x).data('pagey', coords[i].y);\n thisQ.sendDragToDrop(dragInDrop, false);\n }\n thisQ.getDragClone(drag).addClass('active');\n thisQ.cloneDragIfNeeded(drag);\n }\n });\n };\n\n /**\n * Determine what drag items need to be shown and\n * return coords of all drag items except any that are currently being dragged\n * based on contents of hidden inputs and whether drags are 'infinite' or how many\n * drags should be shown.\n *\n * @param {jQuery} inputNode\n * @returns {Point[]} coordinates of however many copies of the drag item should be shown.\n */\n DragDropMarkersQuestion.prototype.getCoords = function(inputNode) {\n var coords = [],\n val = $(inputNode).val();\n if (val !== '') {\n var coordsStrings = val.split(';');\n for (var i = 0; i < coordsStrings.length; i++) {\n coords[i] = this.convertToWindowXY(Shapes.Point.parse(coordsStrings[i]));\n }\n }\n return coords;\n };\n\n /**\n * Converts the relative x and y position coordinates into\n * absolute x and y position coordinates.\n *\n * @param {Point} point relative to the background image.\n * @returns {Point} point relative to the page.\n */\n DragDropMarkersQuestion.prototype.convertToWindowXY = function(point) {\n var bgImage = this.bgImage();\n // The +1 seems rather odd, but seems to give the best results in\n // the three main browsers at a range of zoom levels.\n // (Its due to the 1px border around the image, that shifts the\n // image pixels by 1 down and to the left.)\n return point.offset(bgImage.offset().left + 1, bgImage.offset().top + 1);\n };\n\n /**\n * Utility function converting window coordinates to relative to the\n * background image coordinates.\n *\n * @param {Point} point relative to the page.\n * @returns {Point} point relative to the background image.\n */\n DragDropMarkersQuestion.prototype.convertToBgImgXY = function(point) {\n var bgImage = this.bgImage();\n return point.offset(-bgImage.offset().left - 1, -bgImage.offset().top - 1);\n };\n\n /**\n * Is the point within the background image?\n *\n * @param {Point} point relative to the BG image.\n * @return {boolean} true it they are.\n */\n DragDropMarkersQuestion.prototype.coordsInBgImg = function(point) {\n var bgImage = this.bgImage();\n var bgPosition = bgImage.offset();\n\n return point.x >= bgPosition.left && point.x < bgPosition.left + bgImage.width()\n && point.y >= bgPosition.top && point.y < bgPosition.top + bgImage.height();\n };\n\n /**\n * Get the outer div for this question.\n * @returns {jQuery} containing that div.\n */\n DragDropMarkersQuestion.prototype.getRoot = function() {\n return $(document.getElementById(this.containerId));\n };\n\n /**\n * Get the img that is the background image.\n * @returns {jQuery} containing that img.\n */\n DragDropMarkersQuestion.prototype.bgImage = function() {\n return this.getRoot().find('img.dropbackground');\n };\n\n DragDropMarkersQuestion.prototype.handleDragStart = function(e) {\n var thisQ = this,\n dragged = $(e.target).closest('.marker');\n\n var info = dragDrop.prepare(e);\n if (!info.start) {\n return;\n }\n\n dragged.addClass('beingdragged').css('transform', '');\n\n var placed = !dragged.hasClass('unneeded');\n if (!placed) {\n var hiddenDrag = thisQ.getDragClone(dragged);\n if (hiddenDrag.length) {\n hiddenDrag.addClass('active');\n dragged.offset(hiddenDrag.offset());\n }\n }\n\n dragDrop.start(e, dragged, function() {\n void (1);\n }, function(x, y, dragged) {\n thisQ.dragEnd(dragged);\n });\n };\n\n /**\n * Functionality at the end of a drag drop.\n * @param {jQuery} dragged the marker that was dragged.\n */\n DragDropMarkersQuestion.prototype.dragEnd = function(dragged) {\n var placed = false,\n choiceNo = this.getChoiceNoFromElement(dragged),\n bgRatio = this.bgRatio(),\n dragXY;\n\n dragged.data('pagex', dragged.offset().left).data('pagey', dragged.offset().top);\n dragXY = new Shapes.Point(dragged.data('pagex'), dragged.data('pagey'));\n if (this.coordsInBgImg(dragXY)) {\n this.sendDragToDrop(dragged, true);\n placed = true;\n\n // It seems that the dragdrop sometimes leaves the drag\n // one pixel out of position. Put it in exactly the right place.\n var bgImgXY = this.convertToBgImgXY(dragXY);\n bgImgXY = new Shapes.Point(bgImgXY.x / bgRatio, bgImgXY.y / bgRatio);\n dragged.data('originX', bgImgXY.x).data('originY', bgImgXY.y);\n }\n\n if (!placed) {\n this.sendDragHome(dragged);\n this.removeDragIfNeeded(dragged);\n } else {\n this.cloneDragIfNeeded(dragged);\n }\n\n this.saveCoordsForChoice(choiceNo);\n };\n\n /**\n * Save the coordinates for a dropped item in the form field.\n * @param {Number} choiceNo which copy of the choice this was.\n */\n DragDropMarkersQuestion.prototype.saveCoordsForChoice = function(choiceNo) {\n var coords = [],\n items = this.getRoot().find('div.droparea span.marker.choice' + choiceNo),\n thiQ = this,\n bgRatio = this.bgRatio();\n\n if (items.length) {\n items.each(function() {\n var drag = $(this);\n if (!drag.hasClass('beingdragged')) {\n if (drag.data('scaleRatio') !== bgRatio) {\n // The scale ratio for the draggable item was changed. We need to update that.\n drag.data('pagex', drag.offset().left).data('pagey', drag.offset().top);\n }\n var dragXY = new Shapes.Point(drag.data('pagex'), drag.data('pagey'));\n if (thiQ.coordsInBgImg(dragXY)) {\n var bgImgXY = thiQ.convertToBgImgXY(dragXY);\n bgImgXY = new Shapes.Point(bgImgXY.x / bgRatio, bgImgXY.y / bgRatio);\n coords[coords.length] = bgImgXY;\n }\n }\n });\n }\n\n this.getRoot().find('input.choice' + choiceNo).val(coords.join(';'));\n };\n\n /**\n * Handle key down / press events on markers.\n * @param {KeyboardEvent} e\n */\n DragDropMarkersQuestion.prototype.handleKeyPress = function(e) {\n var drag = $(e.target).closest('.marker'),\n point = new Shapes.Point(drag.offset().left, drag.offset().top),\n choiceNo = this.getChoiceNoFromElement(drag);\n\n switch (e.keyCode) {\n case keys.arrowLeft:\n case 65: // A.\n point.x -= 1;\n break;\n case keys.arrowRight:\n case 68: // D.\n point.x += 1;\n break;\n case keys.arrowDown:\n case 83: // S.\n point.y += 1;\n break;\n case keys.arrowUp:\n case 87: // W.\n point.y -= 1;\n break;\n case keys.space:\n case keys.escape:\n point = null;\n break;\n default:\n return; // Ingore other keys.\n }\n e.preventDefault();\n\n if (point !== null) {\n point = this.constrainToBgImg(point);\n drag.offset({'left': point.x, 'top': point.y});\n drag.data('pagex', drag.offset().left).data('pagey', drag.offset().top);\n var dragXY = this.convertToBgImgXY(new Shapes.Point(drag.data('pagex'), drag.data('pagey')));\n drag.data('originX', dragXY.x / this.bgRatio()).data('originY', dragXY.y / this.bgRatio());\n if (this.coordsInBgImg(new Shapes.Point(drag.offset().left, drag.offset().top))) {\n if (drag.hasClass('unneeded')) {\n this.sendDragToDrop(drag, true);\n var hiddenDrag = this.getDragClone(drag);\n if (hiddenDrag.length) {\n hiddenDrag.addClass('active');\n }\n this.cloneDragIfNeeded(drag);\n }\n }\n } else {\n drag.css('left', '').css('top', '');\n drag.data('pagex', drag.offset().left).data('pagey', drag.offset().top);\n this.sendDragHome(drag);\n this.removeDragIfNeeded(drag);\n }\n drag.focus();\n this.saveCoordsForChoice(choiceNo);\n };\n\n /**\n * Makes sure the dragged item always exists within the background image area.\n *\n * @param {Point} windowxy\n * @returns {Point} coordinates\n */\n DragDropMarkersQuestion.prototype.constrainToBgImg = function(windowxy) {\n var bgImg = this.bgImage(),\n bgImgXY = this.convertToBgImgXY(windowxy);\n bgImgXY.x = Math.max(0, bgImgXY.x);\n bgImgXY.y = Math.max(0, bgImgXY.y);\n bgImgXY.x = Math.min(bgImg.width(), bgImgXY.x);\n bgImgXY.y = Math.min(bgImg.height(), bgImgXY.y);\n return this.convertToWindowXY(bgImgXY);\n };\n\n /**\n * Returns the choice number for a node.\n *\n * @param {Element|jQuery} node\n * @returns {Number}\n */\n DragDropMarkersQuestion.prototype.getChoiceNoFromElement = function(node) {\n return Number(this.getClassnameNumericSuffix(node, 'choice'));\n };\n\n /**\n * Returns the numeric part of a class with the given prefix.\n *\n * @param {Element|jQuery} node\n * @param {String} prefix\n * @returns {Number|null}\n */\n DragDropMarkersQuestion.prototype.getClassnameNumericSuffix = function(node, prefix) {\n var classes = $(node).attr('class');\n if (classes !== undefined && classes !== '') {\n var classesarr = classes.split(' ');\n for (var index = 0; index < classesarr.length; index++) {\n var patt1 = new RegExp('^' + prefix + '([0-9])+$');\n if (patt1.test(classesarr[index])) {\n var patt2 = new RegExp('([0-9])+$');\n var match = patt2.exec(classesarr[index]);\n return Number(match[0]);\n }\n }\n }\n return null;\n };\n\n /**\n * Handle when the window is resized.\n */\n DragDropMarkersQuestion.prototype.handleResize = function() {\n var thisQ = this,\n bgRatio = this.bgRatio();\n if (this.isPrinting) {\n bgRatio = 1;\n }\n\n this.getRoot().find('div.droparea .marker').not('.beingdragged').each(function(key, drag) {\n $(drag)\n .css('left', parseFloat($(drag).data('originX')) * parseFloat(bgRatio))\n .css('top', parseFloat($(drag).data('originY')) * parseFloat(bgRatio));\n thisQ.handleElementScale(drag, 'left top');\n });\n\n this.getRoot().find('div.droparea svg.dropzones')\n .width(this.bgImage().width())\n .height(this.bgImage().height());\n\n for (var dropZoneNo = 0; dropZoneNo < this.visibleDropZones.length; dropZoneNo++) {\n var dropZone = thisQ.visibleDropZones[dropZoneNo];\n var originCoords = dropZone.coords;\n var shape = thisQ.shapes[dropZoneNo];\n var shapeSVG = thisQ.shapeSVGs[dropZoneNo];\n shape.parse(originCoords, bgRatio);\n shape.updateSvg(shapeSVG);\n\n var handles = shape.getHandlePositions();\n var markerSpan = this.getRoot().find('div.ddarea div.markertexts span.markertext' + dropZoneNo);\n markerSpan\n .css('left', handles.moveHandle.x - (markerSpan.outerWidth() / 2) - 4)\n .css('top', handles.moveHandle.y - (markerSpan.outerHeight() / 2));\n thisQ.handleElementScale(markerSpan, 'center');\n }\n };\n\n /**\n * Clone the drag.\n */\n DragDropMarkersQuestion.prototype.cloneDrags = function() {\n var thisQ = this;\n this.getRoot().find('div.draghomes span.marker').each(function(index, draghome) {\n var drag = $(draghome);\n var placeHolder = drag.clone();\n placeHolder.removeClass();\n placeHolder.addClass('marker');\n placeHolder.addClass('choice' + thisQ.getChoiceNoFromElement(drag));\n placeHolder.addClass(thisQ.getDragNoClass(drag, false));\n placeHolder.addClass('dragplaceholder');\n drag.before(placeHolder);\n });\n };\n\n /**\n * Get the drag number of a drag.\n *\n * @param {jQuery} drag the drag.\n * @returns {Number} the drag number.\n */\n DragDropMarkersQuestion.prototype.getDragNo = function(drag) {\n return this.getClassnameNumericSuffix(drag, 'dragno');\n };\n\n /**\n * Get the drag number prefix of a drag.\n *\n * @param {jQuery} drag the drag.\n * @param {Boolean} includeSelector include the CSS selector prefix or not.\n * @return {String} Class name\n */\n DragDropMarkersQuestion.prototype.getDragNoClass = function(drag, includeSelector) {\n var className = 'dragno' + this.getDragNo(drag);\n if (this.isInfiniteDrag(drag)) {\n className = 'infinite';\n }\n\n if (includeSelector) {\n return '.' + className;\n }\n\n return className;\n };\n\n /**\n * Get drag clone for a given drag.\n *\n * @param {jQuery} drag the drag.\n * @returns {jQuery} the drag's clone.\n */\n DragDropMarkersQuestion.prototype.getDragClone = function(drag) {\n return this.getRoot().find('.draghomes' + ' span.marker' +\n '.choice' + this.getChoiceNoFromElement(drag) + this.getDragNoClass(drag, true) + '.dragplaceholder');\n };\n\n /**\n * Get the drop area element.\n * @returns {jQuery} droparea element.\n */\n DragDropMarkersQuestion.prototype.dropArea = function() {\n return this.getRoot().find('div.droparea');\n };\n\n /**\n * Animate a drag back to its home.\n *\n * @param {jQuery} drag the item being moved.\n */\n DragDropMarkersQuestion.prototype.sendDragHome = function(drag) {\n drag.removeClass('beingdragged')\n .addClass('unneeded')\n .css('top', '')\n .css('left', '')\n .css('transform', '');\n var placeHolder = this.getDragClone(drag);\n placeHolder.after(drag);\n placeHolder.removeClass('active');\n };\n\n /**\n * Animate a drag item into a given place.\n *\n * @param {jQuery} drag the item to place.\n * @param {boolean} isScaling Scaling or not\n */\n DragDropMarkersQuestion.prototype.sendDragToDrop = function(drag, isScaling) {\n var dropArea = this.dropArea(),\n bgRatio = this.bgRatio();\n drag.removeClass('beingdragged').removeClass('unneeded');\n var dragXY = this.convertToBgImgXY(new Shapes.Point(drag.data('pagex'), drag.data('pagey')));\n if (isScaling) {\n drag.data('originX', dragXY.x / bgRatio).data('originY', dragXY.y / bgRatio);\n drag.css('left', dragXY.x).css('top', dragXY.y);\n } else {\n drag.data('originX', dragXY.x).data('originY', dragXY.y);\n drag.css('left', dragXY.x * bgRatio).css('top', dragXY.y * bgRatio);\n }\n // We need to save the original scale ratio for each draggable item.\n drag.data('scaleRatio', bgRatio);\n dropArea.append(drag);\n this.handleElementScale(drag, 'left top');\n };\n\n /**\n * Clone the drag at the draghome area if needed.\n *\n * @param {jQuery} drag the item to place.\n */\n DragDropMarkersQuestion.prototype.cloneDragIfNeeded = function(drag) {\n var inputNode = this.getInput(drag),\n noOfDrags = Number(this.getClassnameNumericSuffix(inputNode, 'noofdrags')),\n displayedDragsInDropArea = this.getRoot().find('div.droparea .marker.choice' +\n this.getChoiceNoFromElement(drag) + this.getDragNoClass(drag, true)).length,\n displayedDragsInDragHomes = this.getRoot().find('div.draghomes .marker.choice' +\n this.getChoiceNoFromElement(drag) + this.getDragNoClass(drag, true)).not('.dragplaceholder').length;\n\n if ((this.isInfiniteDrag(drag) ||\n !this.isInfiniteDrag(drag) && displayedDragsInDropArea < noOfDrags) && displayedDragsInDragHomes === 0) {\n var dragClone = drag.clone();\n dragClone.addClass('unneeded')\n .css('top', '')\n .css('left', '')\n .css('transform', '');\n this.getDragClone(drag)\n .removeClass('active')\n .after(dragClone);\n questionManager.addEventHandlersToMarker(dragClone);\n }\n };\n\n /**\n * Remove the clone drag at the draghome area if needed.\n *\n * @param {jQuery} drag the item to place.\n */\n DragDropMarkersQuestion.prototype.removeDragIfNeeded = function(drag) {\n var dragsInHome = this.getRoot().find('div.draghomes .marker.choice' +\n this.getChoiceNoFromElement(drag) + this.getDragNoClass(drag, true)).not('.dragplaceholder');\n var displayedDrags = dragsInHome.length;\n while (displayedDrags > 1) {\n dragsInHome.first().remove();\n displayedDrags--;\n }\n };\n\n /**\n * Get the input belong to drag.\n *\n * @param {jQuery} drag the item to place.\n * @returns {jQuery} input element.\n */\n DragDropMarkersQuestion.prototype.getInput = function(drag) {\n var choiceNo = this.getChoiceNoFromElement(drag);\n return this.getRoot().find('input.choices.choice' + choiceNo);\n };\n\n /**\n * Return the background ratio.\n *\n * @returns {number} Background ratio.\n */\n DragDropMarkersQuestion.prototype.bgRatio = function() {\n var bgImg = this.bgImage();\n var bgImgNaturalWidth = bgImg.get(0).naturalWidth;\n var bgImgClientWidth = bgImg.width();\n\n return bgImgClientWidth / bgImgNaturalWidth;\n };\n\n /**\n * Scale the drag if needed.\n *\n * @param {jQuery} element the item to place.\n * @param {String} type scaling type\n */\n DragDropMarkersQuestion.prototype.handleElementScale = function(element, type) {\n var bgRatio = parseFloat(this.bgRatio());\n if (this.isPrinting) {\n bgRatio = 1;\n }\n $(element).css({\n '-webkit-transform': 'scale(' + bgRatio + ')',\n '-moz-transform': 'scale(' + bgRatio + ')',\n '-ms-transform': 'scale(' + bgRatio + ')',\n '-o-transform': 'scale(' + bgRatio + ')',\n 'transform': 'scale(' + bgRatio + ')',\n 'transform-origin': type\n });\n };\n\n /**\n * Check if the given drag is in infinite mode or not.\n *\n * @param {jQuery} drag The drag item need to check.\n */\n DragDropMarkersQuestion.prototype.isInfiniteDrag = function(drag) {\n return drag.hasClass('infinite');\n };\n\n /**\n * Singleton that tracks all the DragDropToTextQuestions on this page, and deals\n * with event dispatching.\n *\n * @type {Object}\n */\n var questionManager = {\n\n /**\n * {boolean} ensures that the event handlers are only initialised once per page.\n */\n eventHandlersInitialised: false,\n\n /**\n * {boolean} is printing or not.\n */\n isPrinting: false,\n\n /**\n * {boolean} is keyboard navigation.\n */\n isKeyboardNavigation: false,\n\n /**\n * {Object} all the questions on this page, indexed by containerId (id on the .que div).\n */\n questions: {}, // An object containing all the information about each question on the page.\n\n /**\n * Initialise one question.\n *\n * @param {String} containerId the id of the div.que that contains this question.\n * @param {boolean} readOnly whether the question is read-only.\n * @param {Object[]} visibleDropZones data on any drop zones to draw as part of the feedback.\n */\n init: function(containerId, readOnly, visibleDropZones) {\n questionManager.questions[containerId] =\n new DragDropMarkersQuestion(containerId, readOnly, visibleDropZones);\n if (!questionManager.eventHandlersInitialised) {\n questionManager.setupEventHandlers();\n questionManager.eventHandlersInitialised = true;\n }\n },\n\n /**\n * Set up the event handlers that make this question type work. (Done once per page.)\n */\n setupEventHandlers: function() {\n // We do not use the body event here to prevent the other event on Mobile device, such as scroll event.\n questionManager.addEventHandlersToMarker($('.que.ddmarker:not(.qtype_ddmarker-readonly) div.draghomes .marker'));\n questionManager.addEventHandlersToMarker($('.que.ddmarker:not(.qtype_ddmarker-readonly) div.droparea .marker'));\n $(window).on('resize', function() {\n questionManager.handleWindowResize(false);\n });\n window.addEventListener('beforeprint', function() {\n questionManager.isPrinting = true;\n questionManager.handleWindowResize(questionManager.isPrinting);\n });\n window.addEventListener('afterprint', function() {\n questionManager.isPrinting = false;\n questionManager.handleWindowResize(questionManager.isPrinting);\n });\n setTimeout(function() {\n questionManager.fixLayoutIfThingsMoved();\n }, 100);\n },\n\n /**\n * Binding the event again for newly created element.\n *\n * @param {jQuery} element Element to bind the event\n */\n addEventHandlersToMarker: function(element) {\n element\n .on('mousedown touchstart', questionManager.handleDragStart)\n .on('keydown keypress', questionManager.handleKeyPress)\n .focusin(function(e) {\n questionManager.handleKeyboardFocus(e, true);\n })\n .focusout(function(e) {\n questionManager.handleKeyboardFocus(e, false);\n });\n },\n\n /**\n * Handle mouse down / touch start events on markers.\n * @param {Event} e the DOM event.\n */\n handleDragStart: function(e) {\n e.preventDefault();\n var question = questionManager.getQuestionForEvent(e);\n if (question) {\n question.handleDragStart(e);\n }\n },\n\n /**\n * Handle key down / press events on markers.\n * @param {Event} e\n */\n handleKeyPress: function(e) {\n var question = questionManager.getQuestionForEvent(e);\n if (question) {\n question.handleKeyPress(e);\n }\n },\n\n /**\n * Handle when the window is resized.\n * @param {boolean} isPrinting\n */\n handleWindowResize: function(isPrinting) {\n for (var containerId in questionManager.questions) {\n if (questionManager.questions.hasOwnProperty(containerId)) {\n questionManager.questions[containerId].isPrinting = isPrinting;\n questionManager.questions[containerId].handleResize();\n }\n }\n },\n\n /**\n * Handle focus lost events on markers.\n * @param {Event} e\n * @param {boolean} isNavigating\n */\n handleKeyboardFocus: function(e, isNavigating) {\n questionManager.isKeyboardNavigation = isNavigating;\n },\n\n /**\n * Sometimes, despite our best efforts, things change in a way that cannot\n * be specifically caught (e.g. dock expanding or collapsing in Boost).\n * Therefore, we need to periodically check everything is in the right position.\n */\n fixLayoutIfThingsMoved: function() {\n if (!questionManager.isKeyboardNavigation) {\n this.handleWindowResize(questionManager.isPrinting);\n }\n // We use setTimeout after finishing work, rather than setInterval,\n // in case positioning things is slow. We want 100 ms gap\n // between executions, not what setInterval does.\n setTimeout(function() {\n questionManager.fixLayoutIfThingsMoved(questionManager.isPrinting);\n }, 100);\n },\n\n /**\n * Given an event, work out which question it effects.\n * @param {Event} e the event.\n * @returns {DragDropMarkersQuestion|undefined} The question, or undefined.\n */\n getQuestionForEvent: function(e) {\n var containerId = $(e.currentTarget).closest('.que.ddmarker').attr('id');\n return questionManager.questions[containerId];\n }\n };\n\n /**\n * @alias module:qtype_ddmarker/question\n */\n return {\n /**\n * Initialise one drag-drop markers question.\n *\n * @param {String} containerId id of the outer div for this question.\n * @param {String} bgImgUrl the URL of the background image.\n * @param {boolean} readOnly whether the question is being displayed read-only.\n * @param {String[]} visibleDropZones the geometry of any drop-zones to show.\n */\n init: questionManager.init\n };\n});\n"],"file":"question.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/question.js"],"names":["define","$","dragDrop","Shapes","keys","DragDropMarkersQuestion","containerId","readOnly","visibleDropZones","thisQ","shapes","shapeSVGs","isPrinting","getRoot","addClass","cloneDrags","repositionDrags","drawDropzones","prototype","length","bgImage","find","html","outerWidth","outerHeight","svg","nextColourIndex","dropZoneNo","colourClass","addDropzone","dropZone","shape","make","existingmarkertext","bgRatio","parse","coords","markertext","remove","append","markerspan","handles","getHandlePositions","positionLeft","moveHandle","x","positionTop","y","css","data","position","left","top","handleElementScale","shapeSVG","makeSvg","setAttribute","root","not","each","key","item","input","choiceNo","getChoiceNoFromElement","getCoords","drag","i","dragInDrop","clone","sendDragToDrop","getDragClone","cloneDragIfNeeded","inputNode","val","coordsStrings","split","convertToWindowXY","Point","point","offset","convertToBgImgXY","coordsInBgImg","bgPosition","width","height","document","getElementById","handleDragStart","e","dragged","target","closest","info","prepare","start","placed","hasClass","hiddenDrag","dragEnd","dragXY","bgImgXY","sendDragHome","removeDragIfNeeded","saveCoordsForChoice","items","thiQ","join","handleKeyPress","keyCode","arrowLeft","arrowRight","arrowDown","arrowUp","space","escape","preventDefault","constrainToBgImg","focus","windowxy","bgImg","Math","max","min","node","getClassnameNumericSuffix","prefix","classes","attr","classesarr","index","patt1","RegExp","test","match","exec","handleResize","parseFloat","originCoords","updateSvg","markerSpan","draghome","placeHolder","removeClass","getDragNoClass","before","getDragNo","includeSelector","className","isInfiniteDrag","dropArea","after","isScaling","getInput","noOfDrags","displayedDragsInDropArea","displayedDragsInDragHomes","dragClone","questionManager","addEventHandlersToMarker","dragsInHome","displayedDrags","first","bgImgNaturalWidth","get","naturalWidth","bgImgClientWidth","element","type","eventHandlersInitialised","isKeyboardNavigation","questions","init","setupEventHandlers","window","on","handleWindowResize","addEventListener","setTimeout","fixLayoutIfThingsMoved","focusin","handleKeyboardFocus","focusout","question","getQuestionForEvent","hasOwnProperty","isNavigating","currentTarget"],"mappings":"AAuBAA,OAAM,2BAAC,CAAC,QAAD,CAAW,eAAX,CAA4B,uBAA5B,CAAqD,gBAArD,CAAD,CAAyE,SAASC,CAAT,CAAYC,CAAZ,CAAsBC,CAAtB,CAA8BC,CAA9B,CAAoC,CAE/G,aAWA,QAASC,CAAAA,CAAT,CAAiCC,CAAjC,CAA8CC,CAA9C,CAAwDC,CAAxD,CAA0E,CACtE,GAAIC,CAAAA,CAAK,CAAG,IAAZ,CACA,KAAKH,WAAL,CAAmBA,CAAnB,CACA,KAAKE,gBAAL,CAAwBA,CAAxB,CACA,KAAKE,MAAL,CAAc,EAAd,CACA,KAAKC,SAAL,CAAiB,EAAjB,CACA,KAAKC,UAAL,IACA,GAAIL,CAAJ,CAAc,CACV,KAAKM,OAAL,GAAeC,QAAf,CAAwB,yBAAxB,CACH,CACDL,CAAK,CAACM,UAAN,GACAN,CAAK,CAACO,eAAN,GACAP,CAAK,CAACQ,aAAN,EACH,CAKDZ,CAAuB,CAACa,SAAxB,CAAkCD,aAAlC,CAAkD,UAAW,CACzD,GAAmC,CAA/B,MAAKT,gBAAL,CAAsBW,MAA1B,CAAsC,CAClC,GAAIC,CAAAA,CAAO,CAAG,KAAKA,OAAL,EAAd,CAEA,KAAKP,OAAL,GAAeQ,IAAf,CAAoB,eAApB,EAAqCC,IAArC,CAA0C,yEAC1BF,CAAO,CAACG,UAAR,EAD0B,gBAEzBH,CAAO,CAACI,WAAR,EAFyB,CAED,WAFzC,EAMA,OAHIC,CAAAA,CAAG,CAA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,CACvC,KAAKM,kBAAL,CAAwBlB,CAAe,CAAClJ,UAAxC,CACH,CAIDsK,UAAU,CAAC,UAAW,CAClBpB,CAAe,CAACqB,sBAAhB,CAAuCrB,CAAe,CAAClJ,UAAvD,CACH,CAFS,CAEP,GAFO,CAGb,CA1IiB,CAiJlB4K,mBAAmB,CAAE,6BAAS/F,CAAT,CAAY,CAC7B,GAAInF,CAAAA,CAAW,CAAGL,CAAC,CAACwF,CAAC,CAACkG,aAAH,CAAD,CAAmB/F,OAAnB,CAA2B,eAA3B,EAA4CoC,IAA5C,CAAiD,IAAjD,CAAlB,CACA,MAAO8B,CAAAA,CAAe,CAACa,SAAhB,CAA0BrK,CAA1B,CACV,CApJiB,CAAtB,CA0JA,MAAO,CASHsK,IAAI,CAAEd,CAAe,CAACc,IATnB,CAWV,CAnzBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Question class for drag and drop marker question type, used to support the question and preview pages.\n *\n * @module qtype_ddmarker/question\n * @copyright 2018 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/dragdrop', 'qtype_ddmarker/shapes', 'core/key_codes'], function($, dragDrop, Shapes, keys) {\n\n \"use strict\";\n\n /**\n * Object to handle one drag-drop markers question.\n *\n * @param {String} containerId id of the outer div for this question.\n * @param {boolean} readOnly whether the question is being displayed read-only.\n * @param {Object[]} visibleDropZones the geometry of any drop-zones to show.\n * Objects have fields shape, coords and markertext.\n * @constructor\n */\n function DragDropMarkersQuestion(containerId, readOnly, visibleDropZones) {\n var thisQ = this;\n this.containerId = containerId;\n this.visibleDropZones = visibleDropZones;\n this.shapes = [];\n this.shapeSVGs = [];\n this.isPrinting = false;\n if (readOnly) {\n this.getRoot().addClass('qtype_ddmarker-readonly');\n }\n thisQ.cloneDrags();\n thisQ.repositionDrags();\n thisQ.drawDropzones();\n }\n\n /**\n * Draws the svg shapes of any drop zones that should be visible for feedback purposes.\n */\n DragDropMarkersQuestion.prototype.drawDropzones = function() {\n if (this.visibleDropZones.length > 0) {\n var bgImage = this.bgImage();\n\n this.getRoot().find('div.dropzones').html('');\n var svg = this.getRoot().find('svg.dropzones');\n\n var nextColourIndex = 0;\n for (var dropZoneNo = 0; dropZoneNo < this.visibleDropZones.length; dropZoneNo++) {\n var colourClass = 'color' + nextColourIndex;\n nextColourIndex = (nextColourIndex + 1) % 8;\n this.addDropzone(svg, dropZoneNo, colourClass);\n }\n }\n };\n\n /**\n * Adds a dropzone shape with colour, coords and link provided to the array of shapes.\n *\n * @param {jQuery} svg the SVG image to which to add this drop zone.\n * @param {int} dropZoneNo which drop-zone to add.\n * @param {string} colourClass class name\n */\n DragDropMarkersQuestion.prototype.addDropzone = function(svg, dropZoneNo, colourClass) {\n var dropZone = this.visibleDropZones[dropZoneNo],\n shape = Shapes.make(dropZone.shape, ''),\n existingmarkertext,\n bgRatio = this.bgRatio();\n if (!shape.parse(dropZone.coords, bgRatio)) {\n return;\n }\n\n existingmarkertext = this.getRoot().find('div.markertexts span.markertext' + dropZoneNo);\n if (existingmarkertext.length) {\n if (dropZone.markertext !== '') {\n existingmarkertext.html(dropZone.markertext);\n } else {\n existingmarkertext.remove();\n }\n } else if (dropZone.markertext !== '') {\n var classnames = 'markertext markertext' + dropZoneNo;\n this.getRoot().find('div.markertexts').append('' +\n dropZone.markertext + '');\n var markerspan = this.getRoot().find('div.ddarea div.markertexts span.markertext' + dropZoneNo);\n if (markerspan.length) {\n var handles = shape.getHandlePositions();\n var positionLeft = handles.moveHandle.x - (markerspan.outerWidth() / 2) - 4;\n var positionTop = handles.moveHandle.y - (markerspan.outerHeight() / 2);\n markerspan\n .css('left', positionLeft)\n .css('top', positionTop);\n markerspan\n .data('originX', markerspan.position().left / bgRatio)\n .data('originY', markerspan.position().top / bgRatio);\n this.handleElementScale(markerspan, 'center');\n }\n }\n\n var shapeSVG = shape.makeSvg(svg[0]);\n shapeSVG.setAttribute('class', 'dropzone ' + colourClass);\n\n this.shapes[this.shapes.length] = shape;\n this.shapeSVGs[this.shapeSVGs.length] = shapeSVG;\n };\n\n /**\n * Draws the drag items on the page (and drop zones if required).\n * The idea is to re-draw all the drags and drops whenever there is a change\n * like a widow resize or an item dropped in place.\n */\n DragDropMarkersQuestion.prototype.repositionDrags = function() {\n var root = this.getRoot(),\n thisQ = this;\n\n root.find('div.draghomes .marker').not('.dragplaceholder').each(function(key, item) {\n $(item).addClass('unneeded');\n });\n\n root.find('input.choices').each(function(key, input) {\n var choiceNo = thisQ.getChoiceNoFromElement(input),\n coords = thisQ.getCoords(input);\n if (coords.length) {\n var drag = thisQ.getRoot().find('.draghomes' + ' span.marker' + '.choice' + choiceNo).not('.dragplaceholder');\n drag.remove();\n for (var i = 0; i < coords.length; i++) {\n var dragInDrop = drag.clone();\n dragInDrop.data('pagex', coords[i].x).data('pagey', coords[i].y);\n thisQ.sendDragToDrop(dragInDrop, false);\n }\n thisQ.getDragClone(drag).addClass('active');\n thisQ.cloneDragIfNeeded(drag);\n }\n });\n };\n\n /**\n * Determine what drag items need to be shown and\n * return coords of all drag items except any that are currently being dragged\n * based on contents of hidden inputs and whether drags are 'infinite' or how many\n * drags should be shown.\n *\n * @param {jQuery} inputNode\n * @returns {Point[]} coordinates of however many copies of the drag item should be shown.\n */\n DragDropMarkersQuestion.prototype.getCoords = function(inputNode) {\n var coords = [],\n val = $(inputNode).val();\n if (val !== '') {\n var coordsStrings = val.split(';');\n for (var i = 0; i < coordsStrings.length; i++) {\n coords[i] = this.convertToWindowXY(Shapes.Point.parse(coordsStrings[i]));\n }\n }\n return coords;\n };\n\n /**\n * Converts the relative x and y position coordinates into\n * absolute x and y position coordinates.\n *\n * @param {Point} point relative to the background image.\n * @returns {Point} point relative to the page.\n */\n DragDropMarkersQuestion.prototype.convertToWindowXY = function(point) {\n var bgImage = this.bgImage();\n // The +1 seems rather odd, but seems to give the best results in\n // the three main browsers at a range of zoom levels.\n // (Its due to the 1px border around the image, that shifts the\n // image pixels by 1 down and to the left.)\n return point.offset(bgImage.offset().left + 1, bgImage.offset().top + 1);\n };\n\n /**\n * Utility function converting window coordinates to relative to the\n * background image coordinates.\n *\n * @param {Point} point relative to the page.\n * @returns {Point} point relative to the background image.\n */\n DragDropMarkersQuestion.prototype.convertToBgImgXY = function(point) {\n var bgImage = this.bgImage();\n return point.offset(-bgImage.offset().left - 1, -bgImage.offset().top - 1);\n };\n\n /**\n * Is the point within the background image?\n *\n * @param {Point} point relative to the BG image.\n * @return {boolean} true it they are.\n */\n DragDropMarkersQuestion.prototype.coordsInBgImg = function(point) {\n var bgImage = this.bgImage();\n var bgPosition = bgImage.offset();\n\n return point.x >= bgPosition.left && point.x < bgPosition.left + bgImage.width()\n && point.y >= bgPosition.top && point.y < bgPosition.top + bgImage.height();\n };\n\n /**\n * Get the outer div for this question.\n * @returns {jQuery} containing that div.\n */\n DragDropMarkersQuestion.prototype.getRoot = function() {\n return $(document.getElementById(this.containerId));\n };\n\n /**\n * Get the img that is the background image.\n * @returns {jQuery} containing that img.\n */\n DragDropMarkersQuestion.prototype.bgImage = function() {\n return this.getRoot().find('img.dropbackground');\n };\n\n DragDropMarkersQuestion.prototype.handleDragStart = function(e) {\n var thisQ = this,\n dragged = $(e.target).closest('.marker');\n\n var info = dragDrop.prepare(e);\n if (!info.start) {\n return;\n }\n\n dragged.addClass('beingdragged').css('transform', '');\n\n var placed = !dragged.hasClass('unneeded');\n if (!placed) {\n var hiddenDrag = thisQ.getDragClone(dragged);\n if (hiddenDrag.length) {\n hiddenDrag.addClass('active');\n dragged.offset(hiddenDrag.offset());\n }\n }\n\n dragDrop.start(e, dragged, function() {\n void (1);\n }, function(x, y, dragged) {\n thisQ.dragEnd(dragged);\n });\n };\n\n /**\n * Functionality at the end of a drag drop.\n * @param {jQuery} dragged the marker that was dragged.\n */\n DragDropMarkersQuestion.prototype.dragEnd = function(dragged) {\n var placed = false,\n choiceNo = this.getChoiceNoFromElement(dragged),\n bgRatio = this.bgRatio(),\n dragXY;\n\n dragged.data('pagex', dragged.offset().left).data('pagey', dragged.offset().top);\n dragXY = new Shapes.Point(dragged.data('pagex'), dragged.data('pagey'));\n if (this.coordsInBgImg(dragXY)) {\n this.sendDragToDrop(dragged, true);\n placed = true;\n\n // It seems that the dragdrop sometimes leaves the drag\n // one pixel out of position. Put it in exactly the right place.\n var bgImgXY = this.convertToBgImgXY(dragXY);\n bgImgXY = new Shapes.Point(bgImgXY.x / bgRatio, bgImgXY.y / bgRatio);\n dragged.data('originX', bgImgXY.x).data('originY', bgImgXY.y);\n }\n\n if (!placed) {\n this.sendDragHome(dragged);\n this.removeDragIfNeeded(dragged);\n } else {\n this.cloneDragIfNeeded(dragged);\n }\n\n this.saveCoordsForChoice(choiceNo);\n };\n\n /**\n * Save the coordinates for a dropped item in the form field.\n * @param {Number} choiceNo which copy of the choice this was.\n */\n DragDropMarkersQuestion.prototype.saveCoordsForChoice = function(choiceNo) {\n var coords = [],\n items = this.getRoot().find('div.droparea span.marker.choice' + choiceNo),\n thiQ = this,\n bgRatio = this.bgRatio();\n\n if (items.length) {\n items.each(function() {\n var drag = $(this);\n if (!drag.hasClass('beingdragged')) {\n if (drag.data('scaleRatio') !== bgRatio) {\n // The scale ratio for the draggable item was changed. We need to update that.\n drag.data('pagex', drag.offset().left).data('pagey', drag.offset().top);\n }\n var dragXY = new Shapes.Point(drag.data('pagex'), drag.data('pagey'));\n if (thiQ.coordsInBgImg(dragXY)) {\n var bgImgXY = thiQ.convertToBgImgXY(dragXY);\n bgImgXY = new Shapes.Point(bgImgXY.x / bgRatio, bgImgXY.y / bgRatio);\n coords[coords.length] = bgImgXY;\n }\n }\n });\n }\n\n this.getRoot().find('input.choice' + choiceNo).val(coords.join(';'));\n };\n\n /**\n * Handle key down / press events on markers.\n * @param {KeyboardEvent} e\n */\n DragDropMarkersQuestion.prototype.handleKeyPress = function(e) {\n var drag = $(e.target).closest('.marker'),\n point = new Shapes.Point(drag.offset().left, drag.offset().top),\n choiceNo = this.getChoiceNoFromElement(drag);\n\n switch (e.keyCode) {\n case keys.arrowLeft:\n case 65: // A.\n point.x -= 1;\n break;\n case keys.arrowRight:\n case 68: // D.\n point.x += 1;\n break;\n case keys.arrowDown:\n case 83: // S.\n point.y += 1;\n break;\n case keys.arrowUp:\n case 87: // W.\n point.y -= 1;\n break;\n case keys.space:\n case keys.escape:\n point = null;\n break;\n default:\n return; // Ingore other keys.\n }\n e.preventDefault();\n\n if (point !== null) {\n point = this.constrainToBgImg(point);\n drag.offset({'left': point.x, 'top': point.y});\n drag.data('pagex', drag.offset().left).data('pagey', drag.offset().top);\n var dragXY = this.convertToBgImgXY(new Shapes.Point(drag.data('pagex'), drag.data('pagey')));\n drag.data('originX', dragXY.x / this.bgRatio()).data('originY', dragXY.y / this.bgRatio());\n if (this.coordsInBgImg(new Shapes.Point(drag.offset().left, drag.offset().top))) {\n if (drag.hasClass('unneeded')) {\n this.sendDragToDrop(drag, true);\n var hiddenDrag = this.getDragClone(drag);\n if (hiddenDrag.length) {\n hiddenDrag.addClass('active');\n }\n this.cloneDragIfNeeded(drag);\n }\n }\n } else {\n drag.css('left', '').css('top', '');\n drag.data('pagex', drag.offset().left).data('pagey', drag.offset().top);\n this.sendDragHome(drag);\n this.removeDragIfNeeded(drag);\n }\n drag.focus();\n this.saveCoordsForChoice(choiceNo);\n };\n\n /**\n * Makes sure the dragged item always exists within the background image area.\n *\n * @param {Point} windowxy\n * @returns {Point} coordinates\n */\n DragDropMarkersQuestion.prototype.constrainToBgImg = function(windowxy) {\n var bgImg = this.bgImage(),\n bgImgXY = this.convertToBgImgXY(windowxy);\n bgImgXY.x = Math.max(0, bgImgXY.x);\n bgImgXY.y = Math.max(0, bgImgXY.y);\n bgImgXY.x = Math.min(bgImg.width(), bgImgXY.x);\n bgImgXY.y = Math.min(bgImg.height(), bgImgXY.y);\n return this.convertToWindowXY(bgImgXY);\n };\n\n /**\n * Returns the choice number for a node.\n *\n * @param {Element|jQuery} node\n * @returns {Number}\n */\n DragDropMarkersQuestion.prototype.getChoiceNoFromElement = function(node) {\n return Number(this.getClassnameNumericSuffix(node, 'choice'));\n };\n\n /**\n * Returns the numeric part of a class with the given prefix.\n *\n * @param {Element|jQuery} node\n * @param {String} prefix\n * @returns {Number|null}\n */\n DragDropMarkersQuestion.prototype.getClassnameNumericSuffix = function(node, prefix) {\n var classes = $(node).attr('class');\n if (classes !== undefined && classes !== '') {\n var classesarr = classes.split(' ');\n for (var index = 0; index < classesarr.length; index++) {\n var patt1 = new RegExp('^' + prefix + '([0-9])+$');\n if (patt1.test(classesarr[index])) {\n var patt2 = new RegExp('([0-9])+$');\n var match = patt2.exec(classesarr[index]);\n return Number(match[0]);\n }\n }\n }\n return null;\n };\n\n /**\n * Handle when the window is resized.\n */\n DragDropMarkersQuestion.prototype.handleResize = function() {\n var thisQ = this,\n bgRatio = this.bgRatio();\n if (this.isPrinting) {\n bgRatio = 1;\n }\n\n this.getRoot().find('div.droparea .marker').not('.beingdragged').each(function(key, drag) {\n $(drag)\n .css('left', parseFloat($(drag).data('originX')) * parseFloat(bgRatio))\n .css('top', parseFloat($(drag).data('originY')) * parseFloat(bgRatio));\n thisQ.handleElementScale(drag, 'left top');\n });\n\n this.getRoot().find('div.droparea svg.dropzones')\n .width(this.bgImage().width())\n .height(this.bgImage().height());\n\n for (var dropZoneNo = 0; dropZoneNo < this.visibleDropZones.length; dropZoneNo++) {\n var dropZone = thisQ.visibleDropZones[dropZoneNo];\n var originCoords = dropZone.coords;\n var shape = thisQ.shapes[dropZoneNo];\n var shapeSVG = thisQ.shapeSVGs[dropZoneNo];\n shape.parse(originCoords, bgRatio);\n shape.updateSvg(shapeSVG);\n\n var handles = shape.getHandlePositions();\n var markerSpan = this.getRoot().find('div.ddarea div.markertexts span.markertext' + dropZoneNo);\n markerSpan\n .css('left', handles.moveHandle.x - (markerSpan.outerWidth() / 2) - 4)\n .css('top', handles.moveHandle.y - (markerSpan.outerHeight() / 2));\n thisQ.handleElementScale(markerSpan, 'center');\n }\n };\n\n /**\n * Clone the drag.\n */\n DragDropMarkersQuestion.prototype.cloneDrags = function() {\n var thisQ = this;\n this.getRoot().find('div.draghomes span.marker').each(function(index, draghome) {\n var drag = $(draghome);\n var placeHolder = drag.clone();\n placeHolder.removeClass();\n placeHolder.addClass('marker');\n placeHolder.addClass('choice' + thisQ.getChoiceNoFromElement(drag));\n placeHolder.addClass(thisQ.getDragNoClass(drag, false));\n placeHolder.addClass('dragplaceholder');\n drag.before(placeHolder);\n });\n };\n\n /**\n * Get the drag number of a drag.\n *\n * @param {jQuery} drag the drag.\n * @returns {Number} the drag number.\n */\n DragDropMarkersQuestion.prototype.getDragNo = function(drag) {\n return this.getClassnameNumericSuffix(drag, 'dragno');\n };\n\n /**\n * Get the drag number prefix of a drag.\n *\n * @param {jQuery} drag the drag.\n * @param {Boolean} includeSelector include the CSS selector prefix or not.\n * @return {String} Class name\n */\n DragDropMarkersQuestion.prototype.getDragNoClass = function(drag, includeSelector) {\n var className = 'dragno' + this.getDragNo(drag);\n if (this.isInfiniteDrag(drag)) {\n className = 'infinite';\n }\n\n if (includeSelector) {\n return '.' + className;\n }\n\n return className;\n };\n\n /**\n * Get drag clone for a given drag.\n *\n * @param {jQuery} drag the drag.\n * @returns {jQuery} the drag's clone.\n */\n DragDropMarkersQuestion.prototype.getDragClone = function(drag) {\n return this.getRoot().find('.draghomes' + ' span.marker' +\n '.choice' + this.getChoiceNoFromElement(drag) + this.getDragNoClass(drag, true) + '.dragplaceholder');\n };\n\n /**\n * Get the drop area element.\n * @returns {jQuery} droparea element.\n */\n DragDropMarkersQuestion.prototype.dropArea = function() {\n return this.getRoot().find('div.droparea');\n };\n\n /**\n * Animate a drag back to its home.\n *\n * @param {jQuery} drag the item being moved.\n */\n DragDropMarkersQuestion.prototype.sendDragHome = function(drag) {\n drag.removeClass('beingdragged')\n .addClass('unneeded')\n .css('top', '')\n .css('left', '')\n .css('transform', '');\n var placeHolder = this.getDragClone(drag);\n placeHolder.after(drag);\n placeHolder.removeClass('active');\n };\n\n /**\n * Animate a drag item into a given place.\n *\n * @param {jQuery} drag the item to place.\n * @param {boolean} isScaling Scaling or not\n */\n DragDropMarkersQuestion.prototype.sendDragToDrop = function(drag, isScaling) {\n var dropArea = this.dropArea(),\n bgRatio = this.bgRatio();\n drag.removeClass('beingdragged').removeClass('unneeded');\n var dragXY = this.convertToBgImgXY(new Shapes.Point(drag.data('pagex'), drag.data('pagey')));\n if (isScaling) {\n drag.data('originX', dragXY.x / bgRatio).data('originY', dragXY.y / bgRatio);\n drag.css('left', dragXY.x).css('top', dragXY.y);\n } else {\n drag.data('originX', dragXY.x).data('originY', dragXY.y);\n drag.css('left', dragXY.x * bgRatio).css('top', dragXY.y * bgRatio);\n }\n // We need to save the original scale ratio for each draggable item.\n drag.data('scaleRatio', bgRatio);\n dropArea.append(drag);\n this.handleElementScale(drag, 'left top');\n };\n\n /**\n * Clone the drag at the draghome area if needed.\n *\n * @param {jQuery} drag the item to place.\n */\n DragDropMarkersQuestion.prototype.cloneDragIfNeeded = function(drag) {\n var inputNode = this.getInput(drag),\n noOfDrags = Number(this.getClassnameNumericSuffix(inputNode, 'noofdrags')),\n displayedDragsInDropArea = this.getRoot().find('div.droparea .marker.choice' +\n this.getChoiceNoFromElement(drag) + this.getDragNoClass(drag, true)).length,\n displayedDragsInDragHomes = this.getRoot().find('div.draghomes .marker.choice' +\n this.getChoiceNoFromElement(drag) + this.getDragNoClass(drag, true)).not('.dragplaceholder').length;\n\n if ((this.isInfiniteDrag(drag) ||\n !this.isInfiniteDrag(drag) && displayedDragsInDropArea < noOfDrags) && displayedDragsInDragHomes === 0) {\n var dragClone = drag.clone();\n dragClone.addClass('unneeded')\n .css('top', '')\n .css('left', '')\n .css('transform', '');\n this.getDragClone(drag)\n .removeClass('active')\n .after(dragClone);\n questionManager.addEventHandlersToMarker(dragClone);\n }\n };\n\n /**\n * Remove the clone drag at the draghome area if needed.\n *\n * @param {jQuery} drag the item to place.\n */\n DragDropMarkersQuestion.prototype.removeDragIfNeeded = function(drag) {\n var dragsInHome = this.getRoot().find('div.draghomes .marker.choice' +\n this.getChoiceNoFromElement(drag) + this.getDragNoClass(drag, true)).not('.dragplaceholder');\n var displayedDrags = dragsInHome.length;\n while (displayedDrags > 1) {\n dragsInHome.first().remove();\n displayedDrags--;\n }\n };\n\n /**\n * Get the input belong to drag.\n *\n * @param {jQuery} drag the item to place.\n * @returns {jQuery} input element.\n */\n DragDropMarkersQuestion.prototype.getInput = function(drag) {\n var choiceNo = this.getChoiceNoFromElement(drag);\n return this.getRoot().find('input.choices.choice' + choiceNo);\n };\n\n /**\n * Return the background ratio.\n *\n * @returns {number} Background ratio.\n */\n DragDropMarkersQuestion.prototype.bgRatio = function() {\n var bgImg = this.bgImage();\n var bgImgNaturalWidth = bgImg.get(0).naturalWidth;\n var bgImgClientWidth = bgImg.width();\n\n return bgImgClientWidth / bgImgNaturalWidth;\n };\n\n /**\n * Scale the drag if needed.\n *\n * @param {jQuery} element the item to place.\n * @param {String} type scaling type\n */\n DragDropMarkersQuestion.prototype.handleElementScale = function(element, type) {\n var bgRatio = parseFloat(this.bgRatio());\n if (this.isPrinting) {\n bgRatio = 1;\n }\n $(element).css({\n '-webkit-transform': 'scale(' + bgRatio + ')',\n '-moz-transform': 'scale(' + bgRatio + ')',\n '-ms-transform': 'scale(' + bgRatio + ')',\n '-o-transform': 'scale(' + bgRatio + ')',\n 'transform': 'scale(' + bgRatio + ')',\n 'transform-origin': type\n });\n };\n\n /**\n * Check if the given drag is in infinite mode or not.\n *\n * @param {jQuery} drag The drag item need to check.\n */\n DragDropMarkersQuestion.prototype.isInfiniteDrag = function(drag) {\n return drag.hasClass('infinite');\n };\n\n /**\n * Singleton that tracks all the DragDropToTextQuestions on this page, and deals\n * with event dispatching.\n *\n * @type {Object}\n */\n var questionManager = {\n\n /**\n * {boolean} ensures that the event handlers are only initialised once per page.\n */\n eventHandlersInitialised: false,\n\n /**\n * {boolean} is printing or not.\n */\n isPrinting: false,\n\n /**\n * {boolean} is keyboard navigation.\n */\n isKeyboardNavigation: false,\n\n /**\n * {Object} all the questions on this page, indexed by containerId (id on the .que div).\n */\n questions: {}, // An object containing all the information about each question on the page.\n\n /**\n * Initialise one question.\n *\n * @param {String} containerId the id of the div.que that contains this question.\n * @param {boolean} readOnly whether the question is read-only.\n * @param {Object[]} visibleDropZones data on any drop zones to draw as part of the feedback.\n */\n init: function(containerId, readOnly, visibleDropZones) {\n questionManager.questions[containerId] =\n new DragDropMarkersQuestion(containerId, readOnly, visibleDropZones);\n if (!questionManager.eventHandlersInitialised) {\n questionManager.setupEventHandlers();\n questionManager.eventHandlersInitialised = true;\n }\n },\n\n /**\n * Set up the event handlers that make this question type work. (Done once per page.)\n */\n setupEventHandlers: function() {\n // We do not use the body event here to prevent the other event on Mobile device, such as scroll event.\n questionManager.addEventHandlersToMarker($('.que.ddmarker:not(.qtype_ddmarker-readonly) div.draghomes .marker'));\n questionManager.addEventHandlersToMarker($('.que.ddmarker:not(.qtype_ddmarker-readonly) div.droparea .marker'));\n $(window).on('resize', function() {\n questionManager.handleWindowResize(false);\n });\n window.addEventListener('beforeprint', function() {\n questionManager.isPrinting = true;\n questionManager.handleWindowResize(questionManager.isPrinting);\n });\n window.addEventListener('afterprint', function() {\n questionManager.isPrinting = false;\n questionManager.handleWindowResize(questionManager.isPrinting);\n });\n setTimeout(function() {\n questionManager.fixLayoutIfThingsMoved();\n }, 100);\n },\n\n /**\n * Binding the event again for newly created element.\n *\n * @param {jQuery} element Element to bind the event\n */\n addEventHandlersToMarker: function(element) {\n element\n .on('mousedown touchstart', questionManager.handleDragStart)\n .on('keydown keypress', questionManager.handleKeyPress)\n .focusin(function(e) {\n questionManager.handleKeyboardFocus(e, true);\n })\n .focusout(function(e) {\n questionManager.handleKeyboardFocus(e, false);\n });\n },\n\n /**\n * Handle mouse down / touch start events on markers.\n * @param {Event} e the DOM event.\n */\n handleDragStart: function(e) {\n e.preventDefault();\n var question = questionManager.getQuestionForEvent(e);\n if (question) {\n question.handleDragStart(e);\n }\n },\n\n /**\n * Handle key down / press events on markers.\n * @param {Event} e\n */\n handleKeyPress: function(e) {\n var question = questionManager.getQuestionForEvent(e);\n if (question) {\n question.handleKeyPress(e);\n }\n },\n\n /**\n * Handle when the window is resized.\n * @param {boolean} isPrinting\n */\n handleWindowResize: function(isPrinting) {\n for (var containerId in questionManager.questions) {\n if (questionManager.questions.hasOwnProperty(containerId)) {\n questionManager.questions[containerId].isPrinting = isPrinting;\n questionManager.questions[containerId].handleResize();\n }\n }\n },\n\n /**\n * Handle focus lost events on markers.\n * @param {Event} e\n * @param {boolean} isNavigating\n */\n handleKeyboardFocus: function(e, isNavigating) {\n questionManager.isKeyboardNavigation = isNavigating;\n },\n\n /**\n * Sometimes, despite our best efforts, things change in a way that cannot\n * be specifically caught (e.g. dock expanding or collapsing in Boost).\n * Therefore, we need to periodically check everything is in the right position.\n */\n fixLayoutIfThingsMoved: function() {\n if (!questionManager.isKeyboardNavigation) {\n this.handleWindowResize(questionManager.isPrinting);\n }\n // We use setTimeout after finishing work, rather than setInterval,\n // in case positioning things is slow. We want 100 ms gap\n // between executions, not what setInterval does.\n setTimeout(function() {\n questionManager.fixLayoutIfThingsMoved(questionManager.isPrinting);\n }, 100);\n },\n\n /**\n * Given an event, work out which question it effects.\n * @param {Event} e the event.\n * @returns {DragDropMarkersQuestion|undefined} The question, or undefined.\n */\n getQuestionForEvent: function(e) {\n var containerId = $(e.currentTarget).closest('.que.ddmarker').attr('id');\n return questionManager.questions[containerId];\n }\n };\n\n /**\n * @alias module:qtype_ddmarker/question\n */\n return {\n /**\n * Initialise one drag-drop markers question.\n *\n * @param {String} containerId id of the outer div for this question.\n * @param {String} bgImgUrl the URL of the background image.\n * @param {boolean} readOnly whether the question is being displayed read-only.\n * @param {String[]} visibleDropZones the geometry of any drop-zones to show.\n */\n init: questionManager.init\n };\n});\n"],"file":"question.min.js"} \ No newline at end of file diff --git a/question/type/ddmarker/amd/build/shapes.min.js.map b/question/type/ddmarker/amd/build/shapes.min.js.map index 598e8433f6ca4..5b97f100995d4 100644 --- a/question/type/ddmarker/amd/build/shapes.min.js.map +++ b/question/type/ddmarker/amd/build/shapes.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/shapes.js"],"names":["define","Point","x","y","prototype","toString","move","dx","dy","offset","offsetX","offsetY","parse","coordinates","bits","split","length","Error","Math","round","Shape","label","centre","getType","getCoordinates","ratio","edit","normalizeShape","makeSvg","updateSvg","makeSimilarCircle","makeSimilarRectangle","makeSimilarPolygon","getHandlePositions","Circle","radius","call","abs","svg","svgEl","createSvgShapeGroup","childNodes","setAttribute","textContent","match","parseFloat","maxX","maxY","handleIndex","limit","min","Rectangle","Polygon","moveHandle","editHandles","width","height","size","points","slice","i","replace","push","bbXMin","bbXMax","bbYMin","bbYMax","max","addNewPointAfter","pointIndex","splice","p","minX","minY","NullShape","createSvgElement","tagName","ownerDocument","createElementNS","appendChild","make","shapeType","getSimilar","shape"],"mappings":"AA4BAA,OAAM,yBAAC,UAAW,CAEd,aASA,QAASC,CAAAA,CAAT,CAAeC,CAAf,CAAkBC,CAAlB,CAAqB,CACjB,KAAKD,CAAL,CAASA,CAAT,CACA,KAAKC,CAAL,CAASA,CACZ,CAMDF,CAAK,CAACG,SAAN,CAAgBC,QAAhB,CAA2B,UAAW,CAClC,MAAO,MAAKH,CAAL,CAAS,GAAT,CAAe,KAAKC,CAC9B,CAFD,CASAF,CAAK,CAACG,SAAN,CAAgBE,IAAhB,CAAuB,SAASC,CAAT,CAAaC,CAAb,CAAiB,CACpC,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,CAAAA,CAAK,CAACpD,oBAAN,EAAP,CACJ,IAAK,SAAL,CACI,MAAOoD,CAAAA,CAAK,CAACnD,kBAAN,EAAP,CACJ,QACI,MAAO,IAAI0C,CAAAA,CAAJ,CAAcS,CAAK,CAAC9D,KAApB,CAAP,CARR,CAUH,CA9GE,CAgHV,CAhzBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/* eslint max-depth: [\"error\", 8] */\n\n/**\n * Library of classes for handling simple shapes.\n *\n * These classes can represent shapes, let you alter them, can go to and from a string\n * representation, and can give you an SVG representation.\n *\n * @subpackage shapes\n * @copyright 2018 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(function() {\n\n \"use strict\";\n\n /**\n * A point, with x and y coordinates.\n *\n * @param {int} x centre X.\n * @param {int} y centre Y.\n * @constructor\n */\n function Point(x, y) {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Standard toString method.\n * @returns {string} \"x;y\";\n */\n Point.prototype.toString = function() {\n return this.x + ',' + this.y;\n };\n\n /**\n * Move a point\n * @param {int} dx x offset\n * @param {int} dy y offset\n */\n Point.prototype.move = function(dx, dy) {\n this.x += dx;\n this.y += dy;\n };\n\n /**\n * Return a new point that is a certain position relative to this one.\n *\n * @param {(int|Point)} offsetX if a point, offset by this points coordinates, else and int x offset.\n * @param {int} [offsetY] used if offsetX is an int, the corresponding y offset.\n * @return {Point} the new point.\n */\n Point.prototype.offset = function(offsetX, offsetY) {\n if (offsetX instanceof Point) {\n offsetY = offsetX.y;\n offsetX = offsetX.x;\n }\n return new Point(this.x + offsetX, this.y + offsetY);\n };\n\n /**\n * Make a point from the string representation.\n *\n * @param {String} coordinates \"x,y\".\n * @return {Point} the point. Throws an exception if input is not valid.\n */\n Point.parse = function(coordinates) {\n var bits = coordinates.split(',');\n if (bits.length !== 2) {\n throw new Error(coordinates + ' is not a valid point');\n }\n return new Point(Math.round(bits[0]), Math.round(bits[1]));\n };\n\n\n /**\n * Shape constructor. Abstract class to represent the different types of drop zone shapes.\n *\n * @param {String} [label] name of this area.\n * @param {int} [x] centre X.\n * @param {int} [y] centre Y.\n * @constructor\n */\n function Shape(label, x, y) {\n this.label = label;\n this.centre = new Point(x || 0, y || 0);\n }\n\n /**\n * Get the type of shape.\n *\n * @return {String} 'circle', 'rectangle' or 'polygon';\n */\n Shape.prototype.getType = function() {\n throw new Error('Not implemented.');\n };\n\n /**\n * Get the string representation of this shape.\n *\n * @return {String} coordinates as they need to be typed into the form.\n */\n Shape.prototype.getCoordinates = function() {\n throw new Error('Not implemented.');\n };\n\n /**\n * Update the shape from the string representation.\n *\n * @param {String} coordinates in the form returned by getCoordinates.\n * @param {number} ratio Ratio to scale.\n * @return {boolean} true if the string could be parsed and the shape updated, else false.\n */\n Shape.prototype.parse = function(coordinates, ratio) {\n void (coordinates, ratio);\n throw new Error('Not implemented.');\n };\n\n /**\n * Move the entire shape by this offset.\n *\n * @param {int} dx x offset.\n * @param {int} dy y offset.\n * @param {int} maxX ensure that after editing, the shape lies between 0 and maxX on the x-axis.\n * @param {int} maxY ensure that after editing, the shape lies between 0 and maxX on the y-axis.\n */\n Shape.prototype.move = function(dx, dy, maxX, maxY) {\n void (maxY);\n };\n\n /**\n * Move one of the edit handles by this offset.\n *\n * @param {int} handleIndex which handle was moved.\n * @param {int} dx x offset.\n * @param {int} dy y offset.\n * @param {int} maxX ensure that after editing, the shape lies between 0 and maxX on the x-axis.\n * @param {int} maxY ensure that after editing, the shape lies between 0 and maxX on the y-axis.\n */\n Shape.prototype.edit = function(handleIndex, dx, dy, maxX, maxY) {\n void (maxY);\n };\n\n /**\n * Update the properties of this shape after a sequence of edits.\n *\n * For example make sure the circle radius is positive, of the polygon centre is centred.\n */\n Shape.prototype.normalizeShape = function() {\n void (1); // To make CiBoT happy.\n };\n\n /**\n * Get the string representation of this shape.\n *\n * @param {SVGElement} svg the SVG graphic to add this shape to.\n * @return {SVGElement} SVG representation of this shape.\n */\n Shape.prototype.makeSvg = function(svg) {\n void (svg);\n throw new Error('Not implemented.');\n };\n\n /**\n * Update the SVG representation of this shape.\n *\n * @param {SVGElement} svgEl the SVG representation of this shape.\n */\n Shape.prototype.updateSvg = function(svgEl) {\n void (svgEl);\n };\n\n /**\n * Make a circle similar to this shape.\n *\n * @return {Circle} a circle that is about the same size and position as this shape.\n */\n Shape.prototype.makeSimilarCircle = function() {\n throw new Error('Not implemented.');\n };\n\n /**\n * Make a rectangle similar to this shape.\n *\n * @return {Rectangle} a rectangle that is about the same size and position as this shape.\n */\n Shape.prototype.makeSimilarRectangle = function() {\n throw new Error('Not implemented.');\n };\n\n /**\n * Make a polygon similar to this shape.\n *\n * @return {Polygon} a polygon that is about the same size and position as this shape.\n */\n Shape.prototype.makeSimilarPolygon = function() {\n throw new Error('Not implemented.');\n };\n\n /**\n * Get the handles that should be offered to edit this shape, or null if not appropriate.\n *\n * @return {Object[]} with properties moveHandle {Point} and editHandles {Point[]}\n */\n Shape.prototype.getHandlePositions = function() {\n return null;\n };\n\n\n /**\n * A shape that is a circle.\n *\n * @param {String} label name of this area.\n * @param {int} [x] centre X.\n * @param {int} [y] centre Y.\n * @param {int} [radius] radius.\n * @constructor\n */\n function Circle(label, x, y, radius) {\n x = x || 15;\n y = y || 15;\n Shape.call(this, label, x, y);\n this.radius = radius || 15;\n }\n Circle.prototype = new Shape();\n\n Circle.prototype.getType = function() {\n return 'circle';\n };\n\n Circle.prototype.getCoordinates = function() {\n return this.centre + ';' + Math.abs(this.radius);\n };\n\n Circle.prototype.makeSvg = function(svg) {\n var svgEl = createSvgShapeGroup(svg, 'circle');\n this.updateSvg(svgEl);\n return svgEl;\n };\n\n Circle.prototype.updateSvg = function(svgEl) {\n svgEl.childNodes[0].setAttribute('cx', this.centre.x);\n svgEl.childNodes[0].setAttribute('cy', this.centre.y);\n svgEl.childNodes[0].setAttribute('r', Math.abs(this.radius));\n svgEl.childNodes[1].setAttribute('x', this.centre.x);\n svgEl.childNodes[1].setAttribute('y', this.centre.y + 15);\n svgEl.childNodes[1].textContent = this.label;\n };\n\n Circle.prototype.parse = function(coordinates, ratio) {\n if (!coordinates.match(/^\\d+(\\.\\d+)?,\\d+(\\.\\d+)?;\\d+(\\.\\d+)?$/)) {\n return false;\n }\n\n var bits = coordinates.split(';');\n this.centre = Point.parse(bits[0]);\n this.centre.x = this.centre.x * parseFloat(ratio);\n this.centre.y = this.centre.y * parseFloat(ratio);\n this.radius = Math.round(bits[1]) * parseFloat(ratio);\n return true;\n };\n\n Circle.prototype.move = function(dx, dy, maxX, maxY) {\n this.centre.move(dx, dy);\n if (this.centre.x < this.radius) {\n this.centre.x = this.radius;\n }\n if (this.centre.x > maxX - this.radius) {\n this.centre.x = maxX - this.radius;\n }\n if (this.centre.y < this.radius) {\n this.centre.y = this.radius;\n }\n if (this.centre.y > maxY - this.radius) {\n this.centre.y = maxY - this.radius;\n }\n };\n\n Circle.prototype.edit = function(handleIndex, dx, dy, maxX, maxY) {\n this.radius += dx;\n var limit = Math.min(this.centre.x, this.centre.y, maxX - this.centre.x, maxY - this.centre.y);\n if (this.radius > limit) {\n this.radius = limit;\n }\n if (this.radius < -limit) {\n this.radius = -limit;\n }\n };\n\n /**\n * Update the properties of this shape after a sequence of edits.\n *\n * For example make sure the circle radius is positive, of the polygon centre is centred.\n */\n Circle.prototype.normalizeShape = function() {\n this.radius = Math.abs(this.radius);\n };\n\n Circle.prototype.makeSimilarRectangle = function() {\n return new Rectangle(this.label,\n this.centre.x - this.radius, this.centre.y - this.radius,\n this.radius * 2, this.radius * 2);\n };\n\n Circle.prototype.makeSimilarPolygon = function() {\n // We make a similar square, so if you go to and from Rectangle afterwards, it is loss-less.\n return new Polygon(this.label, [\n this.centre.offset(-this.radius, -this.radius), this.centre.offset(-this.radius, this.radius),\n this.centre.offset(this.radius, this.radius), this.centre.offset(this.radius, -this.radius)]);\n };\n\n Circle.prototype.getHandlePositions = function() {\n return {\n moveHandle: this.centre,\n editHandles: [this.centre.offset(this.radius, 0)]\n };\n };\n\n\n /**\n * A shape that is a rectangle.\n *\n * @param {String} label name of this area.\n * @param {int} [x] top left X.\n * @param {int} [y] top left Y.\n * @param {int} [width] width.\n * @param {int} [height] height.\n * @constructor\n */\n function Rectangle(label, x, y, width, height) {\n Shape.call(this, label, x, y);\n this.width = width || 30;\n this.height = height || 30;\n }\n Rectangle.prototype = new Shape();\n\n Rectangle.prototype.getType = function() {\n return 'rectangle';\n };\n\n Rectangle.prototype.getCoordinates = function() {\n return this.centre + ';' + this.width + ',' + this.height;\n };\n\n Rectangle.prototype.makeSvg = function(svg) {\n var svgEl = createSvgShapeGroup(svg, 'rect');\n this.updateSvg(svgEl);\n return svgEl;\n };\n\n Rectangle.prototype.updateSvg = function(svgEl) {\n if (this.width >= 0) {\n svgEl.childNodes[0].setAttribute('x', this.centre.x);\n svgEl.childNodes[0].setAttribute('width', this.width);\n } else {\n svgEl.childNodes[0].setAttribute('x', this.centre.x + this.width);\n svgEl.childNodes[0].setAttribute('width', -this.width);\n }\n if (this.height >= 0) {\n svgEl.childNodes[0].setAttribute('y', this.centre.y);\n svgEl.childNodes[0].setAttribute('height', this.height);\n } else {\n svgEl.childNodes[0].setAttribute('y', this.centre.y + this.height);\n svgEl.childNodes[0].setAttribute('height', -this.height);\n }\n\n svgEl.childNodes[1].setAttribute('x', this.centre.x + this.width / 2);\n svgEl.childNodes[1].setAttribute('y', this.centre.y + this.height / 2 + 15);\n svgEl.childNodes[1].textContent = this.label;\n };\n\n Rectangle.prototype.parse = function(coordinates, ratio) {\n if (!coordinates.match(/^\\d+(\\.\\d+)?,\\d+(\\.\\d+)?;\\d+(\\.\\d+)?,\\d+(\\.\\d+)?$/)) {\n return false;\n }\n\n var bits = coordinates.split(';');\n this.centre = Point.parse(bits[0]);\n this.centre.x = this.centre.x * parseFloat(ratio);\n this.centre.y = this.centre.y * parseFloat(ratio);\n var size = Point.parse(bits[1]);\n this.width = size.x * parseFloat(ratio);\n this.height = size.y * parseFloat(ratio);\n return true;\n };\n\n Rectangle.prototype.move = function(dx, dy, maxX, maxY) {\n this.centre.move(dx, dy);\n if (this.centre.x < 0) {\n this.centre.x = 0;\n }\n if (this.centre.x > maxX - this.width) {\n this.centre.x = maxX - this.width;\n }\n if (this.centre.y < 0) {\n this.centre.y = 0;\n }\n if (this.centre.y > maxY - this.height) {\n this.centre.y = maxY - this.height;\n }\n };\n\n Rectangle.prototype.edit = function(handleIndex, dx, dy, maxX, maxY) {\n this.width += dx;\n this.height += dy;\n if (this.width < -this.centre.x) {\n this.width = -this.centre.x;\n }\n if (this.width > maxX - this.centre.x) {\n this.width = maxX - this.centre.x;\n }\n if (this.height < -this.centre.y) {\n this.height = -this.centre.y;\n }\n if (this.height > maxY - this.centre.y) {\n this.height = maxY - this.centre.y;\n }\n };\n\n /**\n * Update the properties of this shape after a sequence of edits.\n *\n * For example make sure the circle radius is positive, of the polygon centre is centred.\n */\n Rectangle.prototype.normalizeShape = function() {\n if (this.width < 0) {\n this.centre.x += this.width;\n this.width = -this.width;\n }\n if (this.height < 0) {\n this.centre.y += this.height;\n this.height = -this.height;\n }\n };\n\n Rectangle.prototype.makeSimilarCircle = function() {\n return new Circle(this.label,\n Math.round(this.centre.x + this.width / 2),\n Math.round(this.centre.y + this.height / 2),\n Math.round((this.width + this.height) / 4));\n };\n\n Rectangle.prototype.makeSimilarPolygon = function() {\n return new Polygon(this.label, [\n this.centre, this.centre.offset(0, this.height),\n this.centre.offset(this.width, this.height), this.centre.offset(this.width, 0)]);\n };\n\n Rectangle.prototype.getHandlePositions = function() {\n return {\n moveHandle: this.centre.offset(this.width / 2, this.height / 2),\n editHandles: [this.centre.offset(this.width, this.height)]\n };\n };\n\n\n /**\n * A shape that is a polygon.\n *\n * @param {String} label name of this area.\n * @param {Point[]} [points] position of the vertices relative to (centreX, centreY).\n * each object in the array should have two\n * @constructor\n */\n function Polygon(label, points) {\n Shape.call(this, label, 0, 0);\n this.points = points ? points.slice() : [new Point(10, 10), new Point(40, 10), new Point(10, 40)];\n this.normalizeShape();\n this.ratio = 1;\n }\n Polygon.prototype = new Shape();\n\n Polygon.prototype.getType = function() {\n return 'polygon';\n };\n\n Polygon.prototype.getCoordinates = function() {\n var coordinates = '';\n for (var i = 0; i < this.points.length; i++) {\n coordinates += this.centre.offset(this.points[i]) + ';';\n }\n return coordinates.slice(0, coordinates.length - 1); // Strip off the last ';'.\n };\n\n Polygon.prototype.makeSvg = function(svg) {\n var svgEl = createSvgShapeGroup(svg, 'polygon');\n this.updateSvg(svgEl);\n return svgEl;\n };\n\n Polygon.prototype.updateSvg = function(svgEl) {\n svgEl.childNodes[0].setAttribute('points', this.getCoordinates().replace(/[,;]/g, ' '));\n svgEl.childNodes[0].setAttribute('transform', 'scale(' + parseFloat(this.ratio) + ')');\n svgEl.childNodes[1].setAttribute('x', this.centre.x);\n svgEl.childNodes[1].setAttribute('y', this.centre.y + 15);\n svgEl.childNodes[1].textContent = this.label;\n };\n\n Polygon.prototype.parse = function(coordinates, ratio) {\n if (!coordinates.match(/^\\d+(\\.\\d+)?,\\d+(\\.\\d+)?(?:;\\d+(\\.\\d+)?,\\d+(\\.\\d+)?)*$/)) {\n return false;\n }\n\n var bits = coordinates.split(';');\n var points = [];\n for (var i = 0; i < bits.length; i++) {\n points.push(Point.parse(bits[i]));\n }\n\n this.points = points;\n this.centre.x = 0;\n this.centre.y = 0;\n this.ratio = ratio;\n this.normalizeShape();\n\n return true;\n };\n\n Polygon.prototype.move = function(dx, dy, maxX, maxY) {\n this.centre.move(dx, dy);\n var bbXMin = maxX,\n bbXMax = 0,\n bbYMin = maxY,\n bbYMax = 0;\n // Computer centre.\n for (var i = 0; i < this.points.length; i++) {\n bbXMin = Math.min(bbXMin, this.points[i].x);\n bbXMax = Math.max(bbXMax, this.points[i].x);\n bbYMin = Math.min(bbYMin, this.points[i].y);\n bbYMax = Math.max(bbYMax, this.points[i].y);\n }\n if (this.centre.x < -bbXMin) {\n this.centre.x = -bbXMin;\n }\n if (this.centre.x > maxX - bbXMax) {\n this.centre.x = maxX - bbXMax;\n }\n if (this.centre.y < -bbYMin) {\n this.centre.y = -bbYMin;\n }\n if (this.centre.y > maxY - bbYMax) {\n this.centre.y = maxY - bbYMax;\n }\n };\n\n Polygon.prototype.edit = function(handleIndex, dx, dy, maxX, maxY) {\n this.points[handleIndex].move(dx, dy);\n if (this.points[handleIndex].x < -this.centre.x) {\n this.points[handleIndex].x = -this.centre.x;\n }\n if (this.points[handleIndex].x > maxX - this.centre.x) {\n this.points[handleIndex].x = maxX - this.centre.x;\n }\n if (this.points[handleIndex].y < -this.centre.y) {\n this.points[handleIndex].y = -this.centre.y;\n }\n if (this.points[handleIndex].y > maxY - this.centre.y) {\n this.points[handleIndex].y = maxY - this.centre.y;\n }\n };\n\n /**\n * Add a new point after the given point, with the same co-ordinates.\n *\n * This does not automatically normalise.\n *\n * @param {int} pointIndex the index of the vertex after which to insert this new one.\n */\n Polygon.prototype.addNewPointAfter = function(pointIndex) {\n this.points.splice(pointIndex, 0,\n new Point(this.points[pointIndex].x, this.points[pointIndex].y));\n };\n\n Polygon.prototype.normalizeShape = function() {\n var i,\n x = 0,\n y = 0;\n\n if (this.points.length === 0) {\n return;\n }\n\n // Computer centre.\n for (i = 0; i < this.points.length; i++) {\n x += this.points[i].x;\n y += this.points[i].y;\n }\n x = Math.round(x / this.points.length);\n y = Math.round(y / this.points.length);\n\n if (x === 0 && y === 0) {\n return;\n }\n\n for (i = 0; i < this.points.length; i++) {\n this.points[i].move(-x, -y);\n }\n this.centre.move(x, y);\n };\n\n Polygon.prototype.makeSimilarCircle = function() {\n return this.makeSimilarRectangle().makeSimilarCircle();\n };\n\n Polygon.prototype.makeSimilarRectangle = function() {\n var p,\n minX = 0,\n maxX = 0,\n minY = 0,\n maxY = 0;\n for (var i = 0; i < this.points.length; i++) {\n p = this.points[i];\n minX = Math.min(minX, p.x);\n maxX = Math.max(maxX, p.x);\n minY = Math.min(minY, p.y);\n maxY = Math.max(maxY, p.y);\n }\n return new Rectangle(this.label,\n this.centre.x + minX, this.centre.y + minY,\n Math.max(maxX - minX, 10), Math.max(maxY - minY, 10));\n };\n\n Polygon.prototype.getHandlePositions = function() {\n var editHandles = [];\n for (var i = 0; i < this.points.length; i++) {\n editHandles.push(this.points[i].offset(this.centre.x, this.centre.y));\n }\n\n this.centre.x = this.centre.x * parseFloat(this.ratio);\n this.centre.y = this.centre.y * parseFloat(this.ratio);\n\n return {\n moveHandle: this.centre,\n editHandles: editHandles\n };\n };\n\n\n /**\n * Not a shape (null object pattern).\n *\n * @param {String} label name of this area.\n * @constructor\n */\n function NullShape(label) {\n Shape.call(this, label);\n }\n NullShape.prototype = new Shape();\n\n NullShape.prototype.getType = function() {\n return 'null';\n };\n\n NullShape.prototype.getCoordinates = function() {\n return '';\n };\n\n NullShape.prototype.makeSvg = function(svg) {\n void (svg);\n return null;\n };\n\n NullShape.prototype.updateSvg = function(svgEl) {\n void (svgEl);\n };\n\n NullShape.prototype.parse = function(coordinates) {\n void (coordinates);\n return false;\n };\n\n NullShape.prototype.makeSimilarCircle = function() {\n return new Circle(this.label);\n };\n\n NullShape.prototype.makeSimilarRectangle = function() {\n return new Rectangle(this.label);\n };\n\n NullShape.prototype.makeSimilarPolygon = function() {\n return new Polygon(this.label);\n };\n\n\n /**\n * Make a new SVG DOM element as a child of svg.\n *\n * @param {SVGElement} svg the parent node.\n * @param {String} tagName the tag name.\n * @return {SVGElement} the newly created node.\n */\n function createSvgElement(svg, tagName) {\n var svgEl = svg.ownerDocument.createElementNS('http://www.w3.org/2000/svg', tagName);\n svg.appendChild(svgEl);\n return svgEl;\n }\n\n /**\n * Make a group SVG DOM elements containing a shape of the given type as first child,\n * and a text label as the second child.\n *\n * @param {SVGElement} svg the parent node.\n * @param {String} tagName the tag name.\n * @return {SVGElement} the newly created g element.\n */\n function createSvgShapeGroup(svg, tagName) {\n var svgEl = createSvgElement(svg, 'g');\n createSvgElement(svgEl, tagName).setAttribute('class', 'shape');\n createSvgElement(svgEl, 'text').setAttribute('class', 'shapeLabel');\n return svgEl;\n }\n\n /**\n * @alias module:qtype_ddmarker/shapes\n */\n return {\n /**\n * A point, with x and y coordinates.\n *\n * @param {int} x centre X.\n * @param {int} y centre Y.\n * @constructor\n */\n Point: Point,\n\n /**\n * A point, with x and y coordinates.\n *\n * @param {int} x centre X.\n * @param {int} y centre Y.\n * @constructor\n */\n Shape: Shape,\n\n /**\n * A shape that is a circle.\n *\n * @param {String} label name of this area.\n * @param {int} [x] centre X.\n * @param {int} [y] centre Y.\n * @param {int} [radius] radius.\n * @constructor\n */\n Circle: Circle,\n\n /**\n * A shape that is a rectangle.\n *\n * @param {String} label name of this area.\n * @param {int} [x] top left X.\n * @param {int} [y] top left Y.\n * @param {int} [width] width.\n * @param {int} [height] height.\n * @constructor\n */\n Rectangle: Rectangle,\n\n /**\n * A shape that is a polygon.\n *\n * @param {String} label name of this area.\n * @param {Point[]} [points] position of the vertices relative to (centreX, centreY).\n * each object in the array should have two\n * @constructor\n */\n Polygon: Polygon,\n\n /**\n * Not a shape (null object pattern).\n *\n * @param {String} label name of this area.\n * @constructor\n */\n NullShape: NullShape,\n\n /**\n * Make a new SVG DOM element as a child of svg.\n *\n * @param {SVGElement} svg the parent node.\n * @param {String} tagName the tag name.\n * @return {SVGElement} the newly created node.\n */\n createSvgElement: createSvgElement,\n\n /**\n * Make a shape of the given type.\n *\n * @param {String} shapeType\n * @param {String} label\n * @return {Shape} the requested shape.\n */\n make: function(shapeType, label) {\n switch (shapeType) {\n case 'circle':\n return new Circle(label);\n case 'rectangle':\n return new Rectangle(label);\n case 'polygon':\n return new Polygon(label);\n default:\n return new NullShape(label);\n }\n },\n\n /**\n * Make a shape of the given type that is similar to the shape of the original type.\n *\n * @param {String} shapeType the new type of shape to make\n * @param {Shape} shape the shape to copy\n * @return {Shape} the similar shape of a different type.\n */\n getSimilar: function(shapeType, shape) {\n if (shapeType === shape.getType()) {\n return shape;\n }\n switch (shapeType) {\n case 'circle':\n return shape.makeSimilarCircle();\n case 'rectangle':\n return shape.makeSimilarRectangle();\n case 'polygon':\n return shape.makeSimilarPolygon();\n default:\n return new NullShape(shape.label);\n }\n }\n };\n});\n"],"file":"shapes.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/shapes.js"],"names":["define","Point","x","y","prototype","toString","move","dx","dy","offset","offsetX","offsetY","parse","coordinates","bits","split","length","Error","Math","round","Shape","label","centre","getType","getCoordinates","ratio","edit","normalizeShape","makeSvg","updateSvg","makeSimilarCircle","makeSimilarRectangle","makeSimilarPolygon","getHandlePositions","Circle","radius","call","abs","svg","svgEl","createSvgShapeGroup","childNodes","setAttribute","textContent","match","parseFloat","maxX","maxY","handleIndex","limit","min","Rectangle","Polygon","moveHandle","editHandles","width","height","size","points","slice","i","replace","push","bbXMin","bbXMax","bbYMin","bbYMax","max","addNewPointAfter","pointIndex","splice","p","minX","minY","NullShape","createSvgElement","tagName","ownerDocument","createElementNS","appendChild","make","shapeType","getSimilar","shape"],"mappings":"AA4BAA,OAAM,yBAAC,UAAW,CAEd,aASA,QAASC,CAAAA,CAAT,CAAeC,CAAf,CAAkBC,CAAlB,CAAqB,CACjB,KAAKD,CAAL,CAASA,CAAT,CACA,KAAKC,CAAL,CAASA,CACZ,CAMDF,CAAK,CAACG,SAAN,CAAgBC,QAAhB,CAA2B,UAAW,CAClC,MAAO,MAAKH,CAAL,CAAS,GAAT,CAAe,KAAKC,CAC9B,CAFD,CASAF,CAAK,CAACG,SAAN,CAAgBE,IAAhB,CAAuB,SAASC,CAAT,CAAaC,CAAb,CAAiB,CACpC,KAAKN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A,CAAK,CAACpD,oBAAN,EAAP,CACJ,IAAK,SAAL,CACI,MAAOoD,CAAAA,CAAK,CAACnD,kBAAN,EAAP,CACJ,QACI,MAAO,IAAI0C,CAAAA,CAAJ,CAAcS,CAAK,CAAC9D,KAApB,CAAP,CARR,CAUH,CA9GE,CAgHV,CAhzBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/* eslint max-depth: [\"error\", 8] */\n\n/**\n * Library of classes for handling simple shapes.\n *\n * These classes can represent shapes, let you alter them, can go to and from a string\n * representation, and can give you an SVG representation.\n *\n * @module qtype_ddmarker/shapes\n * @copyright 2018 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(function() {\n\n \"use strict\";\n\n /**\n * A point, with x and y coordinates.\n *\n * @param {int} x centre X.\n * @param {int} y centre Y.\n * @constructor\n */\n function Point(x, y) {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Standard toString method.\n * @returns {string} \"x;y\";\n */\n Point.prototype.toString = function() {\n return this.x + ',' + this.y;\n };\n\n /**\n * Move a point\n * @param {int} dx x offset\n * @param {int} dy y offset\n */\n Point.prototype.move = function(dx, dy) {\n this.x += dx;\n this.y += dy;\n };\n\n /**\n * Return a new point that is a certain position relative to this one.\n *\n * @param {(int|Point)} offsetX if a point, offset by this points coordinates, else and int x offset.\n * @param {int} [offsetY] used if offsetX is an int, the corresponding y offset.\n * @return {Point} the new point.\n */\n Point.prototype.offset = function(offsetX, offsetY) {\n if (offsetX instanceof Point) {\n offsetY = offsetX.y;\n offsetX = offsetX.x;\n }\n return new Point(this.x + offsetX, this.y + offsetY);\n };\n\n /**\n * Make a point from the string representation.\n *\n * @param {String} coordinates \"x,y\".\n * @return {Point} the point. Throws an exception if input is not valid.\n */\n Point.parse = function(coordinates) {\n var bits = coordinates.split(',');\n if (bits.length !== 2) {\n throw new Error(coordinates + ' is not a valid point');\n }\n return new Point(Math.round(bits[0]), Math.round(bits[1]));\n };\n\n\n /**\n * Shape constructor. Abstract class to represent the different types of drop zone shapes.\n *\n * @param {String} [label] name of this area.\n * @param {int} [x] centre X.\n * @param {int} [y] centre Y.\n * @constructor\n */\n function Shape(label, x, y) {\n this.label = label;\n this.centre = new Point(x || 0, y || 0);\n }\n\n /**\n * Get the type of shape.\n *\n * @return {String} 'circle', 'rectangle' or 'polygon';\n */\n Shape.prototype.getType = function() {\n throw new Error('Not implemented.');\n };\n\n /**\n * Get the string representation of this shape.\n *\n * @return {String} coordinates as they need to be typed into the form.\n */\n Shape.prototype.getCoordinates = function() {\n throw new Error('Not implemented.');\n };\n\n /**\n * Update the shape from the string representation.\n *\n * @param {String} coordinates in the form returned by getCoordinates.\n * @param {number} ratio Ratio to scale.\n * @return {boolean} true if the string could be parsed and the shape updated, else false.\n */\n Shape.prototype.parse = function(coordinates, ratio) {\n void (coordinates, ratio);\n throw new Error('Not implemented.');\n };\n\n /**\n * Move the entire shape by this offset.\n *\n * @param {int} dx x offset.\n * @param {int} dy y offset.\n * @param {int} maxX ensure that after editing, the shape lies between 0 and maxX on the x-axis.\n * @param {int} maxY ensure that after editing, the shape lies between 0 and maxX on the y-axis.\n */\n Shape.prototype.move = function(dx, dy, maxX, maxY) {\n void (maxY);\n };\n\n /**\n * Move one of the edit handles by this offset.\n *\n * @param {int} handleIndex which handle was moved.\n * @param {int} dx x offset.\n * @param {int} dy y offset.\n * @param {int} maxX ensure that after editing, the shape lies between 0 and maxX on the x-axis.\n * @param {int} maxY ensure that after editing, the shape lies between 0 and maxX on the y-axis.\n */\n Shape.prototype.edit = function(handleIndex, dx, dy, maxX, maxY) {\n void (maxY);\n };\n\n /**\n * Update the properties of this shape after a sequence of edits.\n *\n * For example make sure the circle radius is positive, of the polygon centre is centred.\n */\n Shape.prototype.normalizeShape = function() {\n void (1); // To make CiBoT happy.\n };\n\n /**\n * Get the string representation of this shape.\n *\n * @param {SVGElement} svg the SVG graphic to add this shape to.\n * @return {SVGElement} SVG representation of this shape.\n */\n Shape.prototype.makeSvg = function(svg) {\n void (svg);\n throw new Error('Not implemented.');\n };\n\n /**\n * Update the SVG representation of this shape.\n *\n * @param {SVGElement} svgEl the SVG representation of this shape.\n */\n Shape.prototype.updateSvg = function(svgEl) {\n void (svgEl);\n };\n\n /**\n * Make a circle similar to this shape.\n *\n * @return {Circle} a circle that is about the same size and position as this shape.\n */\n Shape.prototype.makeSimilarCircle = function() {\n throw new Error('Not implemented.');\n };\n\n /**\n * Make a rectangle similar to this shape.\n *\n * @return {Rectangle} a rectangle that is about the same size and position as this shape.\n */\n Shape.prototype.makeSimilarRectangle = function() {\n throw new Error('Not implemented.');\n };\n\n /**\n * Make a polygon similar to this shape.\n *\n * @return {Polygon} a polygon that is about the same size and position as this shape.\n */\n Shape.prototype.makeSimilarPolygon = function() {\n throw new Error('Not implemented.');\n };\n\n /**\n * Get the handles that should be offered to edit this shape, or null if not appropriate.\n *\n * @return {Object[]} with properties moveHandle {Point} and editHandles {Point[]}\n */\n Shape.prototype.getHandlePositions = function() {\n return null;\n };\n\n\n /**\n * A shape that is a circle.\n *\n * @param {String} label name of this area.\n * @param {int} [x] centre X.\n * @param {int} [y] centre Y.\n * @param {int} [radius] radius.\n * @constructor\n */\n function Circle(label, x, y, radius) {\n x = x || 15;\n y = y || 15;\n Shape.call(this, label, x, y);\n this.radius = radius || 15;\n }\n Circle.prototype = new Shape();\n\n Circle.prototype.getType = function() {\n return 'circle';\n };\n\n Circle.prototype.getCoordinates = function() {\n return this.centre + ';' + Math.abs(this.radius);\n };\n\n Circle.prototype.makeSvg = function(svg) {\n var svgEl = createSvgShapeGroup(svg, 'circle');\n this.updateSvg(svgEl);\n return svgEl;\n };\n\n Circle.prototype.updateSvg = function(svgEl) {\n svgEl.childNodes[0].setAttribute('cx', this.centre.x);\n svgEl.childNodes[0].setAttribute('cy', this.centre.y);\n svgEl.childNodes[0].setAttribute('r', Math.abs(this.radius));\n svgEl.childNodes[1].setAttribute('x', this.centre.x);\n svgEl.childNodes[1].setAttribute('y', this.centre.y + 15);\n svgEl.childNodes[1].textContent = this.label;\n };\n\n Circle.prototype.parse = function(coordinates, ratio) {\n if (!coordinates.match(/^\\d+(\\.\\d+)?,\\d+(\\.\\d+)?;\\d+(\\.\\d+)?$/)) {\n return false;\n }\n\n var bits = coordinates.split(';');\n this.centre = Point.parse(bits[0]);\n this.centre.x = this.centre.x * parseFloat(ratio);\n this.centre.y = this.centre.y * parseFloat(ratio);\n this.radius = Math.round(bits[1]) * parseFloat(ratio);\n return true;\n };\n\n Circle.prototype.move = function(dx, dy, maxX, maxY) {\n this.centre.move(dx, dy);\n if (this.centre.x < this.radius) {\n this.centre.x = this.radius;\n }\n if (this.centre.x > maxX - this.radius) {\n this.centre.x = maxX - this.radius;\n }\n if (this.centre.y < this.radius) {\n this.centre.y = this.radius;\n }\n if (this.centre.y > maxY - this.radius) {\n this.centre.y = maxY - this.radius;\n }\n };\n\n Circle.prototype.edit = function(handleIndex, dx, dy, maxX, maxY) {\n this.radius += dx;\n var limit = Math.min(this.centre.x, this.centre.y, maxX - this.centre.x, maxY - this.centre.y);\n if (this.radius > limit) {\n this.radius = limit;\n }\n if (this.radius < -limit) {\n this.radius = -limit;\n }\n };\n\n /**\n * Update the properties of this shape after a sequence of edits.\n *\n * For example make sure the circle radius is positive, of the polygon centre is centred.\n */\n Circle.prototype.normalizeShape = function() {\n this.radius = Math.abs(this.radius);\n };\n\n Circle.prototype.makeSimilarRectangle = function() {\n return new Rectangle(this.label,\n this.centre.x - this.radius, this.centre.y - this.radius,\n this.radius * 2, this.radius * 2);\n };\n\n Circle.prototype.makeSimilarPolygon = function() {\n // We make a similar square, so if you go to and from Rectangle afterwards, it is loss-less.\n return new Polygon(this.label, [\n this.centre.offset(-this.radius, -this.radius), this.centre.offset(-this.radius, this.radius),\n this.centre.offset(this.radius, this.radius), this.centre.offset(this.radius, -this.radius)]);\n };\n\n Circle.prototype.getHandlePositions = function() {\n return {\n moveHandle: this.centre,\n editHandles: [this.centre.offset(this.radius, 0)]\n };\n };\n\n\n /**\n * A shape that is a rectangle.\n *\n * @param {String} label name of this area.\n * @param {int} [x] top left X.\n * @param {int} [y] top left Y.\n * @param {int} [width] width.\n * @param {int} [height] height.\n * @constructor\n */\n function Rectangle(label, x, y, width, height) {\n Shape.call(this, label, x, y);\n this.width = width || 30;\n this.height = height || 30;\n }\n Rectangle.prototype = new Shape();\n\n Rectangle.prototype.getType = function() {\n return 'rectangle';\n };\n\n Rectangle.prototype.getCoordinates = function() {\n return this.centre + ';' + this.width + ',' + this.height;\n };\n\n Rectangle.prototype.makeSvg = function(svg) {\n var svgEl = createSvgShapeGroup(svg, 'rect');\n this.updateSvg(svgEl);\n return svgEl;\n };\n\n Rectangle.prototype.updateSvg = function(svgEl) {\n if (this.width >= 0) {\n svgEl.childNodes[0].setAttribute('x', this.centre.x);\n svgEl.childNodes[0].setAttribute('width', this.width);\n } else {\n svgEl.childNodes[0].setAttribute('x', this.centre.x + this.width);\n svgEl.childNodes[0].setAttribute('width', -this.width);\n }\n if (this.height >= 0) {\n svgEl.childNodes[0].setAttribute('y', this.centre.y);\n svgEl.childNodes[0].setAttribute('height', this.height);\n } else {\n svgEl.childNodes[0].setAttribute('y', this.centre.y + this.height);\n svgEl.childNodes[0].setAttribute('height', -this.height);\n }\n\n svgEl.childNodes[1].setAttribute('x', this.centre.x + this.width / 2);\n svgEl.childNodes[1].setAttribute('y', this.centre.y + this.height / 2 + 15);\n svgEl.childNodes[1].textContent = this.label;\n };\n\n Rectangle.prototype.parse = function(coordinates, ratio) {\n if (!coordinates.match(/^\\d+(\\.\\d+)?,\\d+(\\.\\d+)?;\\d+(\\.\\d+)?,\\d+(\\.\\d+)?$/)) {\n return false;\n }\n\n var bits = coordinates.split(';');\n this.centre = Point.parse(bits[0]);\n this.centre.x = this.centre.x * parseFloat(ratio);\n this.centre.y = this.centre.y * parseFloat(ratio);\n var size = Point.parse(bits[1]);\n this.width = size.x * parseFloat(ratio);\n this.height = size.y * parseFloat(ratio);\n return true;\n };\n\n Rectangle.prototype.move = function(dx, dy, maxX, maxY) {\n this.centre.move(dx, dy);\n if (this.centre.x < 0) {\n this.centre.x = 0;\n }\n if (this.centre.x > maxX - this.width) {\n this.centre.x = maxX - this.width;\n }\n if (this.centre.y < 0) {\n this.centre.y = 0;\n }\n if (this.centre.y > maxY - this.height) {\n this.centre.y = maxY - this.height;\n }\n };\n\n Rectangle.prototype.edit = function(handleIndex, dx, dy, maxX, maxY) {\n this.width += dx;\n this.height += dy;\n if (this.width < -this.centre.x) {\n this.width = -this.centre.x;\n }\n if (this.width > maxX - this.centre.x) {\n this.width = maxX - this.centre.x;\n }\n if (this.height < -this.centre.y) {\n this.height = -this.centre.y;\n }\n if (this.height > maxY - this.centre.y) {\n this.height = maxY - this.centre.y;\n }\n };\n\n /**\n * Update the properties of this shape after a sequence of edits.\n *\n * For example make sure the circle radius is positive, of the polygon centre is centred.\n */\n Rectangle.prototype.normalizeShape = function() {\n if (this.width < 0) {\n this.centre.x += this.width;\n this.width = -this.width;\n }\n if (this.height < 0) {\n this.centre.y += this.height;\n this.height = -this.height;\n }\n };\n\n Rectangle.prototype.makeSimilarCircle = function() {\n return new Circle(this.label,\n Math.round(this.centre.x + this.width / 2),\n Math.round(this.centre.y + this.height / 2),\n Math.round((this.width + this.height) / 4));\n };\n\n Rectangle.prototype.makeSimilarPolygon = function() {\n return new Polygon(this.label, [\n this.centre, this.centre.offset(0, this.height),\n this.centre.offset(this.width, this.height), this.centre.offset(this.width, 0)]);\n };\n\n Rectangle.prototype.getHandlePositions = function() {\n return {\n moveHandle: this.centre.offset(this.width / 2, this.height / 2),\n editHandles: [this.centre.offset(this.width, this.height)]\n };\n };\n\n\n /**\n * A shape that is a polygon.\n *\n * @param {String} label name of this area.\n * @param {Point[]} [points] position of the vertices relative to (centreX, centreY).\n * each object in the array should have two\n * @constructor\n */\n function Polygon(label, points) {\n Shape.call(this, label, 0, 0);\n this.points = points ? points.slice() : [new Point(10, 10), new Point(40, 10), new Point(10, 40)];\n this.normalizeShape();\n this.ratio = 1;\n }\n Polygon.prototype = new Shape();\n\n Polygon.prototype.getType = function() {\n return 'polygon';\n };\n\n Polygon.prototype.getCoordinates = function() {\n var coordinates = '';\n for (var i = 0; i < this.points.length; i++) {\n coordinates += this.centre.offset(this.points[i]) + ';';\n }\n return coordinates.slice(0, coordinates.length - 1); // Strip off the last ';'.\n };\n\n Polygon.prototype.makeSvg = function(svg) {\n var svgEl = createSvgShapeGroup(svg, 'polygon');\n this.updateSvg(svgEl);\n return svgEl;\n };\n\n Polygon.prototype.updateSvg = function(svgEl) {\n svgEl.childNodes[0].setAttribute('points', this.getCoordinates().replace(/[,;]/g, ' '));\n svgEl.childNodes[0].setAttribute('transform', 'scale(' + parseFloat(this.ratio) + ')');\n svgEl.childNodes[1].setAttribute('x', this.centre.x);\n svgEl.childNodes[1].setAttribute('y', this.centre.y + 15);\n svgEl.childNodes[1].textContent = this.label;\n };\n\n Polygon.prototype.parse = function(coordinates, ratio) {\n if (!coordinates.match(/^\\d+(\\.\\d+)?,\\d+(\\.\\d+)?(?:;\\d+(\\.\\d+)?,\\d+(\\.\\d+)?)*$/)) {\n return false;\n }\n\n var bits = coordinates.split(';');\n var points = [];\n for (var i = 0; i < bits.length; i++) {\n points.push(Point.parse(bits[i]));\n }\n\n this.points = points;\n this.centre.x = 0;\n this.centre.y = 0;\n this.ratio = ratio;\n this.normalizeShape();\n\n return true;\n };\n\n Polygon.prototype.move = function(dx, dy, maxX, maxY) {\n this.centre.move(dx, dy);\n var bbXMin = maxX,\n bbXMax = 0,\n bbYMin = maxY,\n bbYMax = 0;\n // Computer centre.\n for (var i = 0; i < this.points.length; i++) {\n bbXMin = Math.min(bbXMin, this.points[i].x);\n bbXMax = Math.max(bbXMax, this.points[i].x);\n bbYMin = Math.min(bbYMin, this.points[i].y);\n bbYMax = Math.max(bbYMax, this.points[i].y);\n }\n if (this.centre.x < -bbXMin) {\n this.centre.x = -bbXMin;\n }\n if (this.centre.x > maxX - bbXMax) {\n this.centre.x = maxX - bbXMax;\n }\n if (this.centre.y < -bbYMin) {\n this.centre.y = -bbYMin;\n }\n if (this.centre.y > maxY - bbYMax) {\n this.centre.y = maxY - bbYMax;\n }\n };\n\n Polygon.prototype.edit = function(handleIndex, dx, dy, maxX, maxY) {\n this.points[handleIndex].move(dx, dy);\n if (this.points[handleIndex].x < -this.centre.x) {\n this.points[handleIndex].x = -this.centre.x;\n }\n if (this.points[handleIndex].x > maxX - this.centre.x) {\n this.points[handleIndex].x = maxX - this.centre.x;\n }\n if (this.points[handleIndex].y < -this.centre.y) {\n this.points[handleIndex].y = -this.centre.y;\n }\n if (this.points[handleIndex].y > maxY - this.centre.y) {\n this.points[handleIndex].y = maxY - this.centre.y;\n }\n };\n\n /**\n * Add a new point after the given point, with the same co-ordinates.\n *\n * This does not automatically normalise.\n *\n * @param {int} pointIndex the index of the vertex after which to insert this new one.\n */\n Polygon.prototype.addNewPointAfter = function(pointIndex) {\n this.points.splice(pointIndex, 0,\n new Point(this.points[pointIndex].x, this.points[pointIndex].y));\n };\n\n Polygon.prototype.normalizeShape = function() {\n var i,\n x = 0,\n y = 0;\n\n if (this.points.length === 0) {\n return;\n }\n\n // Computer centre.\n for (i = 0; i < this.points.length; i++) {\n x += this.points[i].x;\n y += this.points[i].y;\n }\n x = Math.round(x / this.points.length);\n y = Math.round(y / this.points.length);\n\n if (x === 0 && y === 0) {\n return;\n }\n\n for (i = 0; i < this.points.length; i++) {\n this.points[i].move(-x, -y);\n }\n this.centre.move(x, y);\n };\n\n Polygon.prototype.makeSimilarCircle = function() {\n return this.makeSimilarRectangle().makeSimilarCircle();\n };\n\n Polygon.prototype.makeSimilarRectangle = function() {\n var p,\n minX = 0,\n maxX = 0,\n minY = 0,\n maxY = 0;\n for (var i = 0; i < this.points.length; i++) {\n p = this.points[i];\n minX = Math.min(minX, p.x);\n maxX = Math.max(maxX, p.x);\n minY = Math.min(minY, p.y);\n maxY = Math.max(maxY, p.y);\n }\n return new Rectangle(this.label,\n this.centre.x + minX, this.centre.y + minY,\n Math.max(maxX - minX, 10), Math.max(maxY - minY, 10));\n };\n\n Polygon.prototype.getHandlePositions = function() {\n var editHandles = [];\n for (var i = 0; i < this.points.length; i++) {\n editHandles.push(this.points[i].offset(this.centre.x, this.centre.y));\n }\n\n this.centre.x = this.centre.x * parseFloat(this.ratio);\n this.centre.y = this.centre.y * parseFloat(this.ratio);\n\n return {\n moveHandle: this.centre,\n editHandles: editHandles\n };\n };\n\n\n /**\n * Not a shape (null object pattern).\n *\n * @param {String} label name of this area.\n * @constructor\n */\n function NullShape(label) {\n Shape.call(this, label);\n }\n NullShape.prototype = new Shape();\n\n NullShape.prototype.getType = function() {\n return 'null';\n };\n\n NullShape.prototype.getCoordinates = function() {\n return '';\n };\n\n NullShape.prototype.makeSvg = function(svg) {\n void (svg);\n return null;\n };\n\n NullShape.prototype.updateSvg = function(svgEl) {\n void (svgEl);\n };\n\n NullShape.prototype.parse = function(coordinates) {\n void (coordinates);\n return false;\n };\n\n NullShape.prototype.makeSimilarCircle = function() {\n return new Circle(this.label);\n };\n\n NullShape.prototype.makeSimilarRectangle = function() {\n return new Rectangle(this.label);\n };\n\n NullShape.prototype.makeSimilarPolygon = function() {\n return new Polygon(this.label);\n };\n\n\n /**\n * Make a new SVG DOM element as a child of svg.\n *\n * @param {SVGElement} svg the parent node.\n * @param {String} tagName the tag name.\n * @return {SVGElement} the newly created node.\n */\n function createSvgElement(svg, tagName) {\n var svgEl = svg.ownerDocument.createElementNS('http://www.w3.org/2000/svg', tagName);\n svg.appendChild(svgEl);\n return svgEl;\n }\n\n /**\n * Make a group SVG DOM elements containing a shape of the given type as first child,\n * and a text label as the second child.\n *\n * @param {SVGElement} svg the parent node.\n * @param {String} tagName the tag name.\n * @return {SVGElement} the newly created g element.\n */\n function createSvgShapeGroup(svg, tagName) {\n var svgEl = createSvgElement(svg, 'g');\n createSvgElement(svgEl, tagName).setAttribute('class', 'shape');\n createSvgElement(svgEl, 'text').setAttribute('class', 'shapeLabel');\n return svgEl;\n }\n\n /**\n * @alias module:qtype_ddmarker/shapes\n */\n return {\n /**\n * A point, with x and y coordinates.\n *\n * @param {int} x centre X.\n * @param {int} y centre Y.\n * @constructor\n */\n Point: Point,\n\n /**\n * A point, with x and y coordinates.\n *\n * @param {int} x centre X.\n * @param {int} y centre Y.\n * @constructor\n */\n Shape: Shape,\n\n /**\n * A shape that is a circle.\n *\n * @param {String} label name of this area.\n * @param {int} [x] centre X.\n * @param {int} [y] centre Y.\n * @param {int} [radius] radius.\n * @constructor\n */\n Circle: Circle,\n\n /**\n * A shape that is a rectangle.\n *\n * @param {String} label name of this area.\n * @param {int} [x] top left X.\n * @param {int} [y] top left Y.\n * @param {int} [width] width.\n * @param {int} [height] height.\n * @constructor\n */\n Rectangle: Rectangle,\n\n /**\n * A shape that is a polygon.\n *\n * @param {String} label name of this area.\n * @param {Point[]} [points] position of the vertices relative to (centreX, centreY).\n * each object in the array should have two\n * @constructor\n */\n Polygon: Polygon,\n\n /**\n * Not a shape (null object pattern).\n *\n * @param {String} label name of this area.\n * @constructor\n */\n NullShape: NullShape,\n\n /**\n * Make a new SVG DOM element as a child of svg.\n *\n * @param {SVGElement} svg the parent node.\n * @param {String} tagName the tag name.\n * @return {SVGElement} the newly created node.\n */\n createSvgElement: createSvgElement,\n\n /**\n * Make a shape of the given type.\n *\n * @param {String} shapeType\n * @param {String} label\n * @return {Shape} the requested shape.\n */\n make: function(shapeType, label) {\n switch (shapeType) {\n case 'circle':\n return new Circle(label);\n case 'rectangle':\n return new Rectangle(label);\n case 'polygon':\n return new Polygon(label);\n default:\n return new NullShape(label);\n }\n },\n\n /**\n * Make a shape of the given type that is similar to the shape of the original type.\n *\n * @param {String} shapeType the new type of shape to make\n * @param {Shape} shape the shape to copy\n * @return {Shape} the similar shape of a different type.\n */\n getSimilar: function(shapeType, shape) {\n if (shapeType === shape.getType()) {\n return shape;\n }\n switch (shapeType) {\n case 'circle':\n return shape.makeSimilarCircle();\n case 'rectangle':\n return shape.makeSimilarRectangle();\n case 'polygon':\n return shape.makeSimilarPolygon();\n default:\n return new NullShape(shape.label);\n }\n }\n };\n});\n"],"file":"shapes.min.js"} \ No newline at end of file diff --git a/question/type/ddmarker/amd/src/form.js b/question/type/ddmarker/amd/src/form.js index 428e26761a4ca..2fd00adab9f21 100644 --- a/question/type/ddmarker/amd/src/form.js +++ b/question/type/ddmarker/amd/src/form.js @@ -16,7 +16,7 @@ /** * This class provides the enhancements to the drag-drop marker editing form. * - * @subpackage form + * @module qtype_ddmarker/form * @copyright 2018 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/question/type/ddmarker/amd/src/question.js b/question/type/ddmarker/amd/src/question.js index f08eff492bec1..3b67c2cc5e8fb 100644 --- a/question/type/ddmarker/amd/src/question.js +++ b/question/type/ddmarker/amd/src/question.js @@ -16,7 +16,7 @@ /** * Question class for drag and drop marker question type, used to support the question and preview pages. * - * @subpackage question + * @module qtype_ddmarker/question * @copyright 2018 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/question/type/ddmarker/amd/src/shapes.js b/question/type/ddmarker/amd/src/shapes.js index a9631f4982808..4a27a3532e32c 100644 --- a/question/type/ddmarker/amd/src/shapes.js +++ b/question/type/ddmarker/amd/src/shapes.js @@ -21,7 +21,7 @@ * These classes can represent shapes, let you alter them, can go to and from a string * representation, and can give you an SVG representation. * - * @subpackage shapes + * @module qtype_ddmarker/shapes * @copyright 2018 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/report/competency/amd/build/grading_popup.min.js.map b/report/competency/amd/build/grading_popup.min.js.map index d6273ff5d3755..1aaee778d0f58 100644 --- a/report/competency/amd/build/grading_popup.min.js.map +++ b/report/competency/amd/build/grading_popup.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/grading_popup.js"],"names":["define","$","notification","str","ajax","log","templates","Dialogue","GradingPopup","regionSelector","userCompetencySelector","_regionSelector","_userCompetencySelector","on","_handleClick","bind","prototype","e","cell","target","closest","competencyId","data","courseId","userId","debug","requests","call","methodname","args","userid","competencyid","courseid","when","then","_contextLoaded","catch","exception","context","displayuser","M","util","js_pending","get_string","render","title","templateData","runTemplateJS","js_complete","_refresh","region","moduleId","moduleid","done","_pageContextLoaded","fail","html","js","replaceNode"],"mappings":"AAsBAA,OAAM,mCAAC,CAAC,QAAD,CAAW,mBAAX,CAAgC,UAAhC,CAA4C,WAA5C,CAAyD,UAAzD,CAAqE,gBAArE,CAAuF,kBAAvF,CAAD,CACC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAA+BC,CAA/B,CAAqCC,CAArC,CAA0CC,CAA1C,CAAqDC,CAArD,CAA+D,CAQlE,GAAIC,CAAAA,CAAY,CAAG,SAASC,CAAT,CAAyBC,CAAzB,CAAiD,CAChE,KAAKC,eAAL,CAAuBF,CAAvB,CACA,KAAKG,uBAAL,CAA+BF,CAA/B,CAEAT,CAAC,CAAC,KAAKU,eAAN,CAAD,CAAwBE,EAAxB,CAA2B,OAA3B,CAAoC,KAAKD,uBAAzC,CAAkE,KAAKE,YAAL,CAAkBC,IAAlB,CAAuB,IAAvB,CAAlE,CACH,CALD,CAaAP,CAAY,CAACQ,SAAb,CAAuBF,YAAvB,CAAsC,SAASG,CAAT,CAAY,IAC1CC,CAAAA,CAAI,CAAGjB,CAAC,CAACgB,CAAC,CAACE,MAAH,CAAD,CAAYC,OAAZ,CAAoB,KAAKR,uBAAzB,CADmC,CAE1CS,CAAY,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J,IADD,CACM,SAASsB,CAAT,CAAeC,CAAf,CAAmB,CACrBnD,CAAS,CAACoD,WAAV,CAAsB,KAAK/C,eAA3B,CAA4C6C,CAA5C,CAAkDC,CAAlD,CAGH,CAJK,CAIJ1C,IAJI,CAIC,IAJD,CADN,EAMCqB,KAND,CAMOlC,CAAY,CAACmC,SANpB,CAOH,CARD,CAWA7B,CAAY,CAACQ,SAAb,CAAuBL,eAAvB,CAAyC,IAAzC,CAEAH,CAAY,CAACQ,SAAb,CAAuBJ,uBAAvB,CAAiD,IAAjD,CAEA,MAA4DJ,CAAAA,CAE/D,CA1HK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to enable inline editing of a comptency grade.\n *\n * @copyright 2015 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/log', 'core/templates', 'tool_lp/dialogue'],\n function($, notification, str, ajax, log, templates, Dialogue) {\n\n /**\n * GradingPopup\n *\n * @param {String} regionSelector The regionSelector\n * @param {String} userCompetencySelector The userCompetencySelector\n */\n var GradingPopup = function(regionSelector, userCompetencySelector) {\n this._regionSelector = regionSelector;\n this._userCompetencySelector = userCompetencySelector;\n\n $(this._regionSelector).on('click', this._userCompetencySelector, this._handleClick.bind(this));\n };\n\n /**\n * Get the data from the clicked cell and open the popup.\n *\n * @method _handleClick\n * @param {Event} e The event\n */\n GradingPopup.prototype._handleClick = function(e) {\n var cell = $(e.target).closest(this._userCompetencySelector);\n var competencyId = $(cell).data('competencyid');\n var courseId = $(cell).data('courseid');\n var userId = $(cell).data('userid');\n\n log.debug('Clicked on cell: competencyId=' + competencyId + ', courseId=' + courseId + ', userId=' + userId);\n\n var requests = ajax.call([{\n methodname: 'tool_lp_data_for_user_competency_summary_in_course',\n args: {userid: userId, competencyid: competencyId, courseid: courseId},\n }, {\n methodname: 'core_competency_user_competency_viewed_in_course',\n args: {userid: userId, competencyid: competencyId, courseid: courseId},\n }]);\n\n $.when(requests[0], requests[1])\n .then(this._contextLoaded.bind(this))\n .catch(notification.exception);\n };\n\n /**\n * We loaded the context, now render the template.\n *\n * @method _contextLoaded\n * @param {Object} context\n * @returns {Promise}\n */\n GradingPopup.prototype._contextLoaded = function(context) {\n // We have to display user info in popup.\n context.displayuser = true;\n\n M.util.js_pending('report_competency/grading_popup:_contextLoaded');\n\n return $.when(\n str.get_string('usercompetencysummary', 'report_competency'),\n templates.render('tool_lp/user_competency_summary_in_course', context)\n )\n .then(function(title, templateData) {\n return new Dialogue(\n title,\n templateData[0],\n function() {\n templates.runTemplateJS(templateData[1]);\n M.util.js_complete('report_competency/grading_popup:_contextLoaded');\n },\n this._refresh.bind(this),\n true\n );\n }.bind(this));\n };\n\n /**\n * Refresh the page.\n *\n * @method _refresh\n * @returns {Promise}\n */\n GradingPopup.prototype._refresh = function() {\n var region = $(this._regionSelector);\n var courseId = region.data('courseid');\n var moduleId = region.data('moduleid');\n var userId = region.data('userid');\n\n // The module id is expected to be an integer, so don't pass empty string.\n if (moduleId === '') {\n moduleId = 0;\n }\n\n return ajax.call([{\n methodname: 'report_competency_data_for_report',\n args: {courseid: courseId, userid: userId, moduleid: moduleId},\n done: this._pageContextLoaded.bind(this),\n fail: notification.exception\n }]);\n };\n\n /**\n * We loaded the context, now render the template.\n *\n * @method _pageContextLoaded\n * @param {Object} context\n */\n GradingPopup.prototype._pageContextLoaded = function(context) {\n templates.render('report_competency/report', context)\n .then(function(html, js) {\n templates.replaceNode(this._regionSelector, html, js);\n\n return;\n }.bind(this))\n .catch(notification.exception);\n };\n\n /** @property {String} The selector for the region with the user competencies */\n GradingPopup.prototype._regionSelector = null;\n /** @property {String} The selector for the region with a single user competencies */\n GradingPopup.prototype._userCompetencySelector = null;\n\n return /** @alias module:report_competency/grading_popup */ GradingPopup;\n\n});\n"],"file":"grading_popup.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/grading_popup.js"],"names":["define","$","notification","str","ajax","log","templates","Dialogue","GradingPopup","regionSelector","userCompetencySelector","_regionSelector","_userCompetencySelector","on","_handleClick","bind","prototype","e","cell","target","closest","competencyId","data","courseId","userId","debug","requests","call","methodname","args","userid","competencyid","courseid","when","then","_contextLoaded","catch","exception","context","displayuser","M","util","js_pending","get_string","render","title","templateData","runTemplateJS","js_complete","_refresh","region","moduleId","moduleid","done","_pageContextLoaded","fail","html","js","replaceNode"],"mappings":"AAuBAA,OAAM,mCAAC,CAAC,QAAD,CAAW,mBAAX,CAAgC,UAAhC,CAA4C,WAA5C,CAAyD,UAAzD,CAAqE,gBAArE,CAAuF,kBAAvF,CAAD,CACC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAA+BC,CAA/B,CAAqCC,CAArC,CAA0CC,CAA1C,CAAqDC,CAArD,CAA+D,CASlE,GAAIC,CAAAA,CAAY,CAAG,SAASC,CAAT,CAAyBC,CAAzB,CAAiD,CAChE,KAAKC,eAAL,CAAuBF,CAAvB,CACA,KAAKG,uBAAL,CAA+BF,CAA/B,CAEAT,CAAC,CAAC,KAAKU,eAAN,CAAD,CAAwBE,EAAxB,CAA2B,OAA3B,CAAoC,KAAKD,uBAAzC,CAAkE,KAAKE,YAAL,CAAkBC,IAAlB,CAAuB,IAAvB,CAAlE,CACH,CALD,CAaAP,CAAY,CAACQ,SAAb,CAAuBF,YAAvB,CAAsC,SAASG,CAAT,CAAY,IAC1CC,CAAAA,CAAI,CAAGjB,CAAC,CAACgB,CAAC,CAACE,MAAH,CAAD,CAAYC,OAAZ,C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,MAAV,CAAiB,0BAAjB,CAA6CN,CAA7C,EACCJ,IADD,CACM,SAASsB,CAAT,CAAeC,CAAf,CAAmB,CACrBnD,CAAS,CAACoD,WAAV,CAAsB,KAAK/C,eAA3B,CAA4C6C,CAA5C,CAAkDC,CAAlD,CAGH,CAJK,CAIJ1C,IAJI,CAIC,IAJD,CADN,EAMCqB,KAND,CAMOlC,CAAY,CAACmC,SANpB,CAOH,CARD,CAWA7B,CAAY,CAACQ,SAAb,CAAuBL,eAAvB,CAAyC,IAAzC,CAEAH,CAAY,CAACQ,SAAb,CAAuBJ,uBAAvB,CAAiD,IAAjD,CAEA,MAAOJ,CAAAA,CACV,CA1HK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to enable inline editing of a comptency grade.\n *\n * @module report_competency/grading_popup\n * @copyright 2015 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/log', 'core/templates', 'tool_lp/dialogue'],\n function($, notification, str, ajax, log, templates, Dialogue) {\n\n /**\n * GradingPopup\n *\n * @class report_competency/grading_popup\n * @param {String} regionSelector The regionSelector\n * @param {String} userCompetencySelector The userCompetencySelector\n */\n var GradingPopup = function(regionSelector, userCompetencySelector) {\n this._regionSelector = regionSelector;\n this._userCompetencySelector = userCompetencySelector;\n\n $(this._regionSelector).on('click', this._userCompetencySelector, this._handleClick.bind(this));\n };\n\n /**\n * Get the data from the clicked cell and open the popup.\n *\n * @method _handleClick\n * @param {Event} e The event\n */\n GradingPopup.prototype._handleClick = function(e) {\n var cell = $(e.target).closest(this._userCompetencySelector);\n var competencyId = $(cell).data('competencyid');\n var courseId = $(cell).data('courseid');\n var userId = $(cell).data('userid');\n\n log.debug('Clicked on cell: competencyId=' + competencyId + ', courseId=' + courseId + ', userId=' + userId);\n\n var requests = ajax.call([{\n methodname: 'tool_lp_data_for_user_competency_summary_in_course',\n args: {userid: userId, competencyid: competencyId, courseid: courseId},\n }, {\n methodname: 'core_competency_user_competency_viewed_in_course',\n args: {userid: userId, competencyid: competencyId, courseid: courseId},\n }]);\n\n $.when(requests[0], requests[1])\n .then(this._contextLoaded.bind(this))\n .catch(notification.exception);\n };\n\n /**\n * We loaded the context, now render the template.\n *\n * @method _contextLoaded\n * @param {Object} context\n * @returns {Promise}\n */\n GradingPopup.prototype._contextLoaded = function(context) {\n // We have to display user info in popup.\n context.displayuser = true;\n\n M.util.js_pending('report_competency/grading_popup:_contextLoaded');\n\n return $.when(\n str.get_string('usercompetencysummary', 'report_competency'),\n templates.render('tool_lp/user_competency_summary_in_course', context)\n )\n .then(function(title, templateData) {\n return new Dialogue(\n title,\n templateData[0],\n function() {\n templates.runTemplateJS(templateData[1]);\n M.util.js_complete('report_competency/grading_popup:_contextLoaded');\n },\n this._refresh.bind(this),\n true\n );\n }.bind(this));\n };\n\n /**\n * Refresh the page.\n *\n * @method _refresh\n * @returns {Promise}\n */\n GradingPopup.prototype._refresh = function() {\n var region = $(this._regionSelector);\n var courseId = region.data('courseid');\n var moduleId = region.data('moduleid');\n var userId = region.data('userid');\n\n // The module id is expected to be an integer, so don't pass empty string.\n if (moduleId === '') {\n moduleId = 0;\n }\n\n return ajax.call([{\n methodname: 'report_competency_data_for_report',\n args: {courseid: courseId, userid: userId, moduleid: moduleId},\n done: this._pageContextLoaded.bind(this),\n fail: notification.exception\n }]);\n };\n\n /**\n * We loaded the context, now render the template.\n *\n * @method _pageContextLoaded\n * @param {Object} context\n */\n GradingPopup.prototype._pageContextLoaded = function(context) {\n templates.render('report_competency/report', context)\n .then(function(html, js) {\n templates.replaceNode(this._regionSelector, html, js);\n\n return;\n }.bind(this))\n .catch(notification.exception);\n };\n\n /** @property {String} The selector for the region with the user competencies */\n GradingPopup.prototype._regionSelector = null;\n /** @property {String} The selector for the region with a single user competencies */\n GradingPopup.prototype._userCompetencySelector = null;\n\n return GradingPopup;\n});\n"],"file":"grading_popup.min.js"} \ No newline at end of file diff --git a/report/competency/amd/build/user_course_navigation.min.js.map b/report/competency/amd/build/user_course_navigation.min.js.map index e270f1d0c4126..1b2a6e38d6fb8 100644 --- a/report/competency/amd/build/user_course_navigation.min.js.map +++ b/report/competency/amd/build/user_course_navigation.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/user_course_navigation.js"],"names":["define","$","UserCourseNavigation","userSelector","moduleSelector","baseUrl","userId","courseId","moduleId","_baseUrl","_userId","_courseId","_moduleId","on","_userChanged","bind","_moduleChanged","prototype","e","M","util","js_pending","newUserId","target","val","queryStr","document","location","newModuleId"],"mappings":"AAsBAA,OAAM,4CAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAY3B,GAAIC,CAAAA,CAAoB,CAAG,SAASC,CAAT,CAAuBC,CAAvB,CAAuCC,CAAvC,CAAgDC,CAAhD,CAAwDC,CAAxD,CAAkEC,CAAlE,CAA4E,CACnG,KAAKC,QAAL,CAAgBJ,CAAhB,CACA,KAAKK,OAAL,CAAeJ,CAAM,CAAG,EAAxB,CACA,KAAKK,SAAL,CAAiBJ,CAAjB,CACA,KAAKK,SAAL,CAAiBJ,CAAjB,CAEAP,CAAC,CAACE,CAAD,CAAD,CAAgBU,EAAhB,CAAmB,QAAnB,CAA6B,KAAKC,YAAL,CAAkBC,IAAlB,CAAuB,IAAvB,CAA7B,EACAd,CAAC,CAACG,CAAD,CAAD,CAAkBS,EAAlB,CAAqB,QAArB,CAA+B,KAAKG,cAAL,CAAoBD,IAApB,CAAyB,IAAzB,CAA/B,CACH,CARD,CAgBAb,CAAoB,CAACe,SAArB,CAA+BH,YAA/B,CAA8C,SAASI,CAAT,CAAY,CAEtDC,CAAC,CAACC,IAAF,CAAOC,UAAP,CAAkB,uDAAlB,EAFsD,GAGlDC,CAAAA,CAAS,CAAGrB,CAAC,CAACiB,CAAC,CAACK,MAAH,CAAD,CAAYC,GAAZ,EAHsC,CAIlDC,CAAQ,CAAG,SAAWH,CAAX,CAAuB,MAAvB,CAAgC,KAAKX,SAArC,CAAiD,OAAjD,CAA2D,KAAKC,SAJzB,CAKtDc,QAAQ,CAACC,QAAT,CAAoB,KAAKlB,QAAL,CAAgBgB,CACvC,CAND,CAcAvB,CAAoB,CAACe,SAArB,CAA+BD,cAA/B,CAAgD,SAASE,CAAT,CAAY,CAExDC,CAAC,CAACC,IAAF,CAAOC,UAAP,CAAkB,yDAAlB,EAFwD,GAGpDO,CAAAA,CAAW,CAAG3B,CAAC,CAACiB,CAAC,CAACK,MAAH,CAAD,CAAYC,GAAZ,EAHsC,CAIpDC,CAAQ,CAAG,QAAUG,CAAV,CAAwB,MAAxB,CAAiC,KAAKjB,SAAtC,CAAkD,QAAlD,CAA6D,KAAKD,OAJzB,CAKxDgB,QAAQ,CAACC,QAAT,CAAoB,KAAKlB,QAAL,CAAgBgB,CACvC,CAND,CASAvB,CAAoB,CAACe,SAArB,CAA+BP,OAA/B,CAAyC,IAAzC,CAEAR,CAAoB,CAACe,SAArB,CAA+BL,SAA/B,CAA2C,IAA3C,CAEAV,CAAoB,CAACe,SAArB,CAA+BN,SAA/B,CAA2C,IAA3C,CAEAT,CAAoB,CAACe,SAArB,CAA+BR,QAA/B,CAA0C,IAA1C,CAEA,MAAqEP,CAAAA,CAExE,CA7DK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to navigation between users in a course.\n *\n * @copyright 2015 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n /**\n * UserCourseNavigation\n *\n * @param {String} userSelector The selector of the user element.\n * @param {String} moduleSelector The selector of the module element.\n * @param {String} baseUrl The base url for the page (no params).\n * @param {Number} userId The course id\n * @param {Number} courseId The user id\n * @param {Number} moduleId The activity module (filter)\n */\n var UserCourseNavigation = function(userSelector, moduleSelector, baseUrl, userId, courseId, moduleId) {\n this._baseUrl = baseUrl;\n this._userId = userId + '';\n this._courseId = courseId;\n this._moduleId = moduleId;\n\n $(userSelector).on('change', this._userChanged.bind(this));\n $(moduleSelector).on('change', this._moduleChanged.bind(this));\n };\n\n /**\n * The user was changed in the select list.\n *\n * @method _userChanged\n * @param {Event} e the event\n */\n UserCourseNavigation.prototype._userChanged = function(e) {\n // Note: This change causes a page reload and is intentionally not paired with a js_complete call.\n M.util.js_pending('report_competency/user_course_navigation:_userChanged');\n var newUserId = $(e.target).val();\n var queryStr = '?user=' + newUserId + '&id=' + this._courseId + '&mod=' + this._moduleId;\n document.location = this._baseUrl + queryStr;\n };\n\n /**\n * The module was changed in the select list.\n *\n * @method _moduleChanged\n * @param {Event} e the event\n */\n UserCourseNavigation.prototype._moduleChanged = function(e) {\n // Note: This change causes a page reload and is intentionally not paired with a js_complete call.\n M.util.js_pending('report_competency/user_course_navigation:_moduleChanged');\n var newModuleId = $(e.target).val();\n var queryStr = '?mod=' + newModuleId + '&id=' + this._courseId + '&user=' + this._userId;\n document.location = this._baseUrl + queryStr;\n };\n\n /** @property {Number} The id of the user. */\n UserCourseNavigation.prototype._userId = null;\n /** @property {Number} The id of the module. */\n UserCourseNavigation.prototype._moduleId = null;\n /** @property {Number} The id of the course. */\n UserCourseNavigation.prototype._courseId = null;\n /** @property {String} Plugin base url. */\n UserCourseNavigation.prototype._baseUrl = null;\n\n return /** @alias module:report_competency/user_course_navigation */ UserCourseNavigation;\n\n});\n"],"file":"user_course_navigation.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/user_course_navigation.js"],"names":["define","$","UserCourseNavigation","userSelector","moduleSelector","baseUrl","userId","courseId","moduleId","_baseUrl","_userId","_courseId","_moduleId","on","_userChanged","bind","_moduleChanged","prototype","e","M","util","js_pending","newUserId","target","val","queryStr","document","location","newModuleId"],"mappings":"AAuBAA,OAAM,4CAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAa3B,GAAIC,CAAAA,CAAoB,CAAG,SAASC,CAAT,CAAuBC,CAAvB,CAAuCC,CAAvC,CAAgDC,CAAhD,CAAwDC,CAAxD,CAAkEC,CAAlE,CAA4E,CACnG,KAAKC,QAAL,CAAgBJ,CAAhB,CACA,KAAKK,OAAL,CAAeJ,CAAM,CAAG,EAAxB,CACA,KAAKK,SAAL,CAAiBJ,CAAjB,CACA,KAAKK,SAAL,CAAiBJ,CAAjB,CAEAP,CAAC,CAACE,CAAD,CAAD,CAAgBU,EAAhB,CAAmB,QAAnB,CAA6B,KAAKC,YAAL,CAAkBC,IAAlB,CAAuB,IAAvB,CAA7B,EACAd,CAAC,CAACG,CAAD,CAAD,CAAkBS,EAAlB,CAAqB,QAArB,CAA+B,KAAKG,cAAL,CAAoBD,IAApB,CAAyB,IAAzB,CAA/B,CACH,CARD,CAgBAb,CAAoB,CAACe,SAArB,CAA+BH,YAA/B,CAA8C,SAASI,CAAT,CAAY,CAEtDC,CAAC,CAACC,IAAF,CAAOC,UAAP,CAAkB,uDAAlB,EAFsD,GAGlDC,CAAAA,CAAS,CAAGrB,CAAC,CAACiB,CAAC,CAACK,MAAH,CAAD,CAAYC,GAAZ,EAHsC,CAIlDC,CAAQ,CAAG,SAAWH,CAAX,CAAuB,MAAvB,CAAgC,KAAKX,SAArC,CAAiD,OAAjD,CAA2D,KAAKC,SAJzB,CAKtDc,QAAQ,CAACC,QAAT,CAAoB,KAAKlB,QAAL,CAAgBgB,CACvC,CAND,CAcAvB,CAAoB,CAACe,SAArB,CAA+BD,cAA/B,CAAgD,SAASE,CAAT,CAAY,CAExDC,CAAC,CAACC,IAAF,CAAOC,UAAP,CAAkB,yDAAlB,EAFwD,GAGpDO,CAAAA,CAAW,CAAG3B,CAAC,CAACiB,CAAC,CAACK,MAAH,CAAD,CAAYC,GAAZ,EAHsC,CAIpDC,CAAQ,CAAG,QAAUG,CAAV,CAAwB,MAAxB,CAAiC,KAAKjB,SAAtC,CAAkD,QAAlD,CAA6D,KAAKD,OAJzB,CAKxDgB,QAAQ,CAACC,QAAT,CAAoB,KAAKlB,QAAL,CAAgBgB,CACvC,CAND,CASAvB,CAAoB,CAACe,SAArB,CAA+BP,OAA/B,CAAyC,IAAzC,CAEAR,CAAoB,CAACe,SAArB,CAA+BL,SAA/B,CAA2C,IAA3C,CAEAV,CAAoB,CAACe,SAArB,CAA+BN,SAA/B,CAA2C,IAA3C,CAEAT,CAAoB,CAACe,SAArB,CAA+BR,QAA/B,CAA0C,IAA1C,CAEA,MAAOP,CAAAA,CACV,CA7DK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to navigation between users in a course.\n *\n * @module report_competency/user_course_navigation\n * @copyright 2015 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n /**\n * UserCourseNavigation\n *\n * @class report_competency/user_course_navigation\n * @param {String} userSelector The selector of the user element.\n * @param {String} moduleSelector The selector of the module element.\n * @param {String} baseUrl The base url for the page (no params).\n * @param {Number} userId The course id\n * @param {Number} courseId The user id\n * @param {Number} moduleId The activity module (filter)\n */\n var UserCourseNavigation = function(userSelector, moduleSelector, baseUrl, userId, courseId, moduleId) {\n this._baseUrl = baseUrl;\n this._userId = userId + '';\n this._courseId = courseId;\n this._moduleId = moduleId;\n\n $(userSelector).on('change', this._userChanged.bind(this));\n $(moduleSelector).on('change', this._moduleChanged.bind(this));\n };\n\n /**\n * The user was changed in the select list.\n *\n * @method _userChanged\n * @param {Event} e the event\n */\n UserCourseNavigation.prototype._userChanged = function(e) {\n // Note: This change causes a page reload and is intentionally not paired with a js_complete call.\n M.util.js_pending('report_competency/user_course_navigation:_userChanged');\n var newUserId = $(e.target).val();\n var queryStr = '?user=' + newUserId + '&id=' + this._courseId + '&mod=' + this._moduleId;\n document.location = this._baseUrl + queryStr;\n };\n\n /**\n * The module was changed in the select list.\n *\n * @method _moduleChanged\n * @param {Event} e the event\n */\n UserCourseNavigation.prototype._moduleChanged = function(e) {\n // Note: This change causes a page reload and is intentionally not paired with a js_complete call.\n M.util.js_pending('report_competency/user_course_navigation:_moduleChanged');\n var newModuleId = $(e.target).val();\n var queryStr = '?mod=' + newModuleId + '&id=' + this._courseId + '&user=' + this._userId;\n document.location = this._baseUrl + queryStr;\n };\n\n /** @property {Number} The id of the user. */\n UserCourseNavigation.prototype._userId = null;\n /** @property {Number} The id of the module. */\n UserCourseNavigation.prototype._moduleId = null;\n /** @property {Number} The id of the course. */\n UserCourseNavigation.prototype._courseId = null;\n /** @property {String} Plugin base url. */\n UserCourseNavigation.prototype._baseUrl = null;\n\n return UserCourseNavigation;\n});\n"],"file":"user_course_navigation.min.js"} \ No newline at end of file diff --git a/report/competency/amd/src/grading_popup.js b/report/competency/amd/src/grading_popup.js index b41d0a28f4cd7..5bb4804c63666 100644 --- a/report/competency/amd/src/grading_popup.js +++ b/report/competency/amd/src/grading_popup.js @@ -16,6 +16,7 @@ /** * Module to enable inline editing of a comptency grade. * + * @module report_competency/grading_popup * @copyright 2015 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -26,6 +27,7 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/log', 'cor /** * GradingPopup * + * @class report_competency/grading_popup * @param {String} regionSelector The regionSelector * @param {String} userCompetencySelector The userCompetencySelector */ @@ -140,6 +142,5 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/log', 'cor /** @property {String} The selector for the region with a single user competencies */ GradingPopup.prototype._userCompetencySelector = null; - return /** @alias module:report_competency/grading_popup */ GradingPopup; - + return GradingPopup; }); diff --git a/report/competency/amd/src/user_course_navigation.js b/report/competency/amd/src/user_course_navigation.js index 228bbe35a7685..c0f0bdf92dd30 100644 --- a/report/competency/amd/src/user_course_navigation.js +++ b/report/competency/amd/src/user_course_navigation.js @@ -16,6 +16,7 @@ /** * Module to navigation between users in a course. * + * @module report_competency/user_course_navigation * @copyright 2015 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,6 +26,7 @@ define(['jquery'], function($) { /** * UserCourseNavigation * + * @class report_competency/user_course_navigation * @param {String} userSelector The selector of the user element. * @param {String} moduleSelector The selector of the module element. * @param {String} baseUrl The base url for the page (no params). @@ -79,6 +81,5 @@ define(['jquery'], function($) { /** @property {String} Plugin base url. */ UserCourseNavigation.prototype._baseUrl = null; - return /** @alias module:report_competency/user_course_navigation */ UserCourseNavigation; - + return UserCourseNavigation; }); diff --git a/search/amd/build/form-search-user-selector.min.js.map b/search/amd/build/form-search-user-selector.min.js.map index 051e0c92bc30a..778fb5fb07cb3 100644 --- a/search/amd/build/form-search-user-selector.min.js.map +++ b/search/amd/build/form-search-user-selector.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/form-search-user-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","promise","args","courseid","attr","val","call","methodname","then","promises","render","when","apply","arguments","i","fail"],"mappings":"AAwBAA,OAAM,yCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAE3E,MAAkE,CAE9DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAK,CAAG,EAAZ,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCH,CAAK,CAACI,IAAN,CAAW,CACPC,KAAK,CAAEF,CAAI,CAACG,EADL,CAEPC,KAAK,CAAEJ,CAAI,CAACK,MAFL,CAAX,CAIH,CALD,EAMA,MAAOR,CAAAA,CACV,CAX6D,CAa9DS,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,IAC/CC,CAAAA,CAD+C,CAK/CC,CAAI,CAAG,CAACJ,KAAK,CAAEA,CAAR,CALwC,CAM/CK,CAAQ,CAAGrB,CAAC,CAACI,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,gBAAjB,CANoC,CAOnD,GAAwB,WAApB,QAAOD,CAAAA,CAAP,EAAmE,EAAhC,GAAArB,CAAC,CAAC,kBAAD,CAAD,CAAsBuB,GAAtB,EAAvC,CAA2E,CACvEH,CAAI,CAACC,QAAL,CAAgBA,CACnB,CAFD,IAEO,CACHD,CAAI,CAACC,QAAL,CAAgB,CACnB,CAGDF,CAAO,CAAGlB,CAAI,CAACuB,IAAL,CAAU,CAAC,CAACC,UAAU,CAAE,gCAAb,CAA+CL,IAAI,CAAEA,CAArD,CAAD,CAAV,CAAV,CAGAD,CAAO,CAAC,CAAD,CAAP,CAAWO,IAAX,CAAgB,SAASrB,CAAT,CAAkB,CAC9B,GAAIsB,CAAAA,CAAQ,CAAG,EAAf,CAGA3B,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCkB,CAAQ,CAACjB,IAAT,CAAcR,CAAS,CAAC0B,MAAV,CAAiB,2CAAjB,CAA8DnB,CAA9D,CAAd,CACH,CAFD,EAKA,MAAOT,CAAAA,CAAC,CAAC6B,IAAF,CAAOC,KAAP,CAAa9B,CAAC,CAAC6B,IAAf,CAAqBF,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,IAC9CN,CAAAA,CAAI,CAAGW,SADuC,CAE9CC,CAAC,CAAG,CAF0C,CAGlDhC,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCA,CAAI,CAACK,MAAL,CAAcM,CAAI,CAACY,CAAC,EAAF,CACrB,CAFD,EAGAf,CAAO,CAACZ,CAAD,CAEV,CARM,CAUV,CAnBD,EAmBG4B,IAnBH,CAmBQf,CAnBR,CAoBH,CAlD6D,CAsDrE,CAxDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Search user selector module.\n *\n * @module core_search/form-search-user-selector\n * @class form-search-user-selector\n * @copyright 2017 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:core_search/form-search-user-selector */ {\n\n processResults: function(selector, results) {\n var users = [];\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n // Search within specific course if known and if the 'search within' dropdown is set\n // to search within course or activity.\n var args = {query: query};\n var courseid = $(selector).attr('withincourseid');\n if (typeof courseid !== \"undefined\" && $('#id_searchwithin').val() !== '') {\n args.courseid = courseid;\n } else {\n args.courseid = 0;\n }\n\n // Call AJAX request.\n promise = Ajax.call([{methodname: 'core_search_get_relevant_users', args: args}]);\n\n // When AJAX request returns, handle the results.\n promise[0].then(function(results) {\n var promises = [];\n\n // Render label with user name and picture.\n $.each(results, function(index, user) {\n promises.push(Templates.render('core_search/form-user-selector-suggestion', user));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n var i = 0;\n $.each(results, function(index, user) {\n user._label = args[i++];\n });\n success(results);\n return;\n });\n\n }).fail(failure);\n }\n\n };\n\n});\n"],"file":"form-search-user-selector.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/form-search-user-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","promise","args","courseid","attr","val","call","methodname","then","promises","render","when","apply","arguments","i","fail"],"mappings":"AAuBAA,OAAM,yCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAE3E,MAAkE,CAE9DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAK,CAAG,EAAZ,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCH,CAAK,CAACI,IAAN,CAAW,CACPC,KAAK,CAAEF,CAAI,CAACG,EADL,CAEPC,KAAK,CAAEJ,CAAI,CAACK,M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L,CAAcM,CAAI,CAACY,CAAC,EAAF,CACrB,CAFD,EAGAf,CAAO,CAACZ,CAAD,CAEV,CARM,CAUV,CAnBD,EAmBG4B,IAnBH,CAmBQf,CAnBR,CAoBH,CAlD6D,CAsDrE,CAxDK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Search user selector module.\n *\n * @module core_search/form-search-user-selector\n * @copyright 2017 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:core_search/form-search-user-selector */ {\n\n processResults: function(selector, results) {\n var users = [];\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n // Search within specific course if known and if the 'search within' dropdown is set\n // to search within course or activity.\n var args = {query: query};\n var courseid = $(selector).attr('withincourseid');\n if (typeof courseid !== \"undefined\" && $('#id_searchwithin').val() !== '') {\n args.courseid = courseid;\n } else {\n args.courseid = 0;\n }\n\n // Call AJAX request.\n promise = Ajax.call([{methodname: 'core_search_get_relevant_users', args: args}]);\n\n // When AJAX request returns, handle the results.\n promise[0].then(function(results) {\n var promises = [];\n\n // Render label with user name and picture.\n $.each(results, function(index, user) {\n promises.push(Templates.render('core_search/form-user-selector-suggestion', user));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n var i = 0;\n $.each(results, function(index, user) {\n user._label = args[i++];\n });\n success(results);\n return;\n });\n\n }).fail(failure);\n }\n\n };\n\n});\n"],"file":"form-search-user-selector.min.js"} \ No newline at end of file diff --git a/search/amd/src/form-search-user-selector.js b/search/amd/src/form-search-user-selector.js index 8a865ac81486c..6ce41e55aa13c 100644 --- a/search/amd/src/form-search-user-selector.js +++ b/search/amd/src/form-search-user-selector.js @@ -17,7 +17,6 @@ * Search user selector module. * * @module core_search/form-search-user-selector - * @class form-search-user-selector * @copyright 2017 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/theme/boost/amd/build/drawer.min.js.map b/theme/boost/amd/build/drawer.min.js.map index d66fe1c3d91dd..45033333ea220 100644 --- a/theme/boost/amd/build/drawer.min.js.map +++ b/theme/boost/amd/build/drawer.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/drawer.js"],"names":["define","$","CustomEvents","Log","PubSub","Aria","SELECTORS","TOGGLE_REGION","TOGGLE_ACTION","TOGGLE_TARGET","TOGGLE_SIDE","BODY","SECTION","DRAWER","small","document","width","Drawer","length","debug","each","index","ele","trigger","find","drawerid","attr","drawer","getElementById","hidden","side","body","preference","M","util","set_user_preference","on","preventPageScroll","addClass","bind","registerEventListeners","closeAll","prototype","removeClass","hide","get","toggleDrawer","e","target","closest","open","unhide","focus","delay","queue","hasClass","dequeue","publish","delta","wheelDelta","originalEvent","detail","bottomOverflow","scrollTop","outerHeight","scrollHeight","topOverflow","preventDefault","element","events","activate","data","click"],"mappings":"AAqBAA,OAAM,sBAAC,CAAC,QAAD,CAAW,gCAAX,CAA6C,UAA7C,CAAyD,aAAzD,CAAwE,WAAxE,CAAD,CACD,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAA+BC,CAA/B,CAAuCC,CAAvC,CAA6C,IAE1CC,CAAAA,CAAS,CAAG,CACZC,aAAa,CAAE,iCADH,CAEZC,aAAa,CAAE,iCAFH,CAGZC,aAAa,CAAE,eAHH,CAIZC,WAAW,CAAE,MAJD,CAKZC,I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,CAAhC,EACArE,CAAC,CAACmE,CAAD,CAAD,CAAWhC,EAAX,CAAclC,CAAY,CAACmE,MAAb,CAAoBC,QAAlC,CAA4C,SAASvB,CAAT,CAAYwB,CAAZ,CAAkB,CAC1D,KAAKzB,YAAL,CAAkByB,CAAI,CAACX,aAAvB,EACAW,CAAI,CAACX,aAAL,CAAmBO,cAAnB,EACH,CAH2C,CAG1C5B,IAH0C,CAGrC,IAHqC,CAA5C,CAIH,CAN+B,CAM9BA,IAN8B,CAMzB,IANyB,CAAhC,EAQAtC,CAAC,CAACK,CAAS,CAACM,OAAX,CAAD,CAAqB4D,KAArB,CAA2B,UAAW,CAClC,GAAI1D,CAAJ,CAAW,CACP,KAAK2B,QAAL,EACH,CACJ,CAJ0B,CAIzBF,IAJyB,CAIpB,IAJoB,CAA3B,EAQAtC,CAAC,CAACK,CAAS,CAACO,MAAX,CAAD,CAAoBuB,EAApB,CAAuB,mDAAvB,CAA4E,SAASW,CAAT,CAAY,IAChFpB,CAAAA,CAAM,CAAG1B,CAAC,CAAC8C,CAAC,CAACC,MAAH,CAAD,CAAYC,OAAZ,CAAoB3C,CAAS,CAACO,MAA9B,CADuE,CAGhFqC,CAAI,CAAG,CAAC,CAACvB,CAAM,CAACD,IAAP,CAAY,aAAZ,CAHuE,CAIpFtB,CAAM,CAACqD,OAAP,CAAe,uBAAf,CAAwCP,CAAxC,CACH,CALD,CAMH,CAxBD,CA0BA,MAAO,CACH,KAAQ,eAAW,CACf,MAAO,IAAIjC,CAAAA,CACd,CAHE,CAKV,CAlLK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the logic for a drawer.\n *\n * @copyright 2016 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/custom_interaction_events', 'core/log', 'core/pubsub', 'core/aria'],\n function($, CustomEvents, Log, PubSub, Aria) {\n\n var SELECTORS = {\n TOGGLE_REGION: '[data-region=\"drawer-toggle\"]',\n TOGGLE_ACTION: '[data-action=\"toggle-drawer\"]',\n TOGGLE_TARGET: 'aria-controls',\n TOGGLE_SIDE: 'left',\n BODY: 'body',\n SECTION: '.list-group-item[href*=\"#section-\"]',\n DRAWER: '#nav-drawer'\n };\n\n var small = $(document).width() < 768;\n\n /**\n * Constructor for the Drawer.\n *\n * @param {object} root The root jQuery element for the modal\n */\n var Drawer = function() {\n\n if (!$(SELECTORS.TOGGLE_REGION).length) {\n Log.debug('Page is missing a drawer region');\n }\n if (!$(SELECTORS.TOGGLE_ACTION).length) {\n Log.debug('Page is missing a drawer toggle link');\n }\n $(SELECTORS.TOGGLE_REGION).each(function(index, ele) {\n var trigger = $(ele).find(SELECTORS.TOGGLE_ACTION);\n var drawerid = trigger.attr('aria-controls');\n var drawer = $(document.getElementById(drawerid));\n var hidden = trigger.attr('aria-expanded') == 'false';\n var side = trigger.attr('data-side');\n var body = $(SELECTORS.BODY);\n var preference = trigger.attr('data-preference');\n if (small) {\n M.util.set_user_preference(preference, 'false');\n }\n\n drawer.on('mousewheel DOMMouseScroll', this.preventPageScroll);\n\n if (!hidden) {\n body.addClass('drawer-open-' + side);\n trigger.attr('aria-expanded', 'true');\n } else {\n trigger.attr('aria-expanded', 'false');\n }\n }.bind(this));\n\n this.registerEventListeners();\n if (small) {\n this.closeAll();\n }\n };\n\n Drawer.prototype.closeAll = function() {\n $(SELECTORS.TOGGLE_REGION).each(function(index, ele) {\n var trigger = $(ele).find(SELECTORS.TOGGLE_ACTION);\n var side = trigger.attr('data-side');\n var body = $(SELECTORS.BODY);\n var drawerid = trigger.attr('aria-controls');\n var drawer = $(document.getElementById(drawerid));\n var preference = trigger.attr('data-preference');\n\n trigger.attr('aria-expanded', 'false');\n body.removeClass('drawer-open-' + side);\n Aria.hide(drawer.get());\n drawer.addClass('closed');\n if (!small) {\n M.util.set_user_preference(preference, 'false');\n }\n });\n };\n\n /**\n * Open / close the blocks drawer.\n *\n * @method toggleDrawer\n * @param {Event} e\n */\n Drawer.prototype.toggleDrawer = function(e) {\n var trigger = $(e.target).closest('[data-action=toggle-drawer]');\n var drawerid = trigger.attr('aria-controls');\n var drawer = $(document.getElementById(drawerid));\n var body = $(SELECTORS.BODY);\n var side = trigger.attr('data-side');\n var preference = trigger.attr('data-preference');\n if (small) {\n M.util.set_user_preference(preference, 'false');\n }\n\n body.addClass('drawer-ease');\n var open = trigger.attr('aria-expanded') == 'true';\n if (!open) {\n // Open.\n trigger.attr('aria-expanded', 'true');\n Aria.unhide(drawer.get());\n drawer.focus();\n body.addClass('drawer-open-' + side);\n drawer.removeClass('closed');\n if (!small) {\n M.util.set_user_preference(preference, 'true');\n }\n } else {\n // Close.\n body.removeClass('drawer-open-' + side);\n trigger.attr('aria-expanded', 'false');\n drawer.addClass('closed').delay(500).queue(function() {\n // Ensure that during the delay, the drawer wasn't re-opened.\n if ($(this).hasClass('closed')) {\n Aria.hide(this);\n }\n $(this).dequeue();\n });\n if (!small) {\n M.util.set_user_preference(preference, 'false');\n }\n }\n\n // Publish an event to tell everything that the drawer has been toggled.\n // The drawer transitions closed so another event will fire once teh transition\n // has completed.\n PubSub.publish('nav-drawer-toggle-start', open);\n };\n\n /**\n * Prevent the page from scrolling when the drawer is at max scroll.\n *\n * @method preventPageScroll\n * @param {Event} e\n */\n Drawer.prototype.preventPageScroll = function(e) {\n var delta = e.wheelDelta || (e.originalEvent && e.originalEvent.wheelDelta) || -e.originalEvent.detail,\n bottomOverflow = (this.scrollTop + $(this).outerHeight() - this.scrollHeight) >= 0,\n topOverflow = this.scrollTop <= 0;\n\n if ((delta < 0 && bottomOverflow) || (delta > 0 && topOverflow)) {\n e.preventDefault();\n }\n };\n\n /**\n * Set up all of the event handling for the modal.\n *\n * @method registerEventListeners\n */\n Drawer.prototype.registerEventListeners = function() {\n\n $(SELECTORS.TOGGLE_ACTION).each(function(index, element) {\n CustomEvents.define($(element), [CustomEvents.events.activate]);\n $(element).on(CustomEvents.events.activate, function(e, data) {\n this.toggleDrawer(data.originalEvent);\n data.originalEvent.preventDefault();\n }.bind(this));\n }.bind(this));\n\n $(SELECTORS.SECTION).click(function() {\n if (small) {\n this.closeAll();\n }\n }.bind(this));\n\n // Publish an event to tell everything that the drawer completed the transition\n // to either an open or closed state.\n $(SELECTORS.DRAWER).on('webkitTransitionEnd msTransitionEnd transitionend', function(e) {\n var drawer = $(e.target).closest(SELECTORS.DRAWER);\n // Note: aria-hidden is either present, or absent. It should not be set to false.\n var open = !!drawer.attr('aria-hidden');\n PubSub.publish('nav-drawer-toggle-end', open);\n });\n };\n\n return {\n 'init': function() {\n return new Drawer();\n }\n };\n});\n"],"file":"drawer.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/drawer.js"],"names":["define","$","CustomEvents","Log","PubSub","Aria","SELECTORS","TOGGLE_REGION","TOGGLE_ACTION","TOGGLE_TARGET","TOGGLE_SIDE","BODY","SECTION","DRAWER","small","document","width","Drawer","length","debug","each","index","ele","trigger","find","drawerid","attr","drawer","getElementById","hidden","side","body","preference","M","util","set_user_preference","on","preventPageScroll","addClass","bind","registerEventListeners","closeAll","prototype","removeClass","hide","get","toggleDrawer","e","target","closest","open","unhide","focus","delay","queue","hasClass","dequeue","publish","delta","wheelDelta","originalEvent","detail","bottomOverflow","scrollTop","outerHeight","scrollHeight","topOverflow","preventDefault","element","events","activate","data","click"],"mappings":"AAsBAA,OAAM,sBAAC,CAAC,QAAD,CAAW,gCAAX,CAA6C,UAA7C,CAAyD,aAAzD,CAAwE,WAAxE,CAAD,CACD,SAASC,CAAT,CAAYC,CAAZ,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,CAAS,CAACE,aAAX,CAAD,CAA2BY,IAA3B,CAAgC,SAASC,CAAT,CAAgB+C,CAAhB,CAAyB,CACrDlE,CAAY,CAACF,MAAb,CAAoBC,CAAC,CAACmE,CAAD,CAArB,CAAgC,CAAClE,CAAY,CAACmE,MAAb,CAAoBC,QAArB,CAAhC,EACArE,CAAC,CAACmE,CAAD,CAAD,CAAWhC,EAAX,CAAclC,CAAY,CAACmE,MAAb,CAAoBC,QAAlC,CAA4C,SAASvB,CAAT,CAAYwB,CAAZ,CAAkB,CAC1D,KAAKzB,YAAL,CAAkByB,CAAI,CAACX,aAAvB,EACAW,CAAI,CAACX,aAAL,CAAmBO,cAAnB,EACH,CAH2C,CAG1C5B,IAH0C,CAGrC,IAHqC,CAA5C,CAIH,CAN+B,CAM9BA,IAN8B,CAMzB,IANyB,CAAhC,EAQAtC,CAAC,CAACK,CAAS,CAACM,OAAX,CAAD,CAAqB4D,KAArB,CAA2B,UAAW,CAClC,GAAI1D,CAAJ,CAAW,CACP,KAAK2B,QAAL,EACH,CACJ,CAJ0B,CAIzBF,IAJyB,CAIpB,IAJoB,CAA3B,EAQAtC,CAAC,CAACK,CAAS,CAACO,MAAX,CAAD,CAAoBuB,EAApB,CAAuB,mDAAvB,CAA4E,SAASW,CAAT,CAAY,IAChFpB,CAAAA,CAAM,CAAG1B,CAAC,CAAC8C,CAAC,CAACC,MAAH,CAAD,CAAYC,OAAZ,CAAoB3C,CAAS,CAACO,MAA9B,CADuE,CAGhFqC,CAAI,CAAG,CAAC,CAACvB,CAAM,CAACD,IAAP,CAAY,aAAZ,CAHuE,CAIpFtB,CAAM,CAACqD,OAAP,CAAe,uBAAf,CAAwCP,CAAxC,CACH,CALD,CAMH,CAxBD,CA0BA,MAAO,CACH,KAAQ,eAAW,CACf,MAAO,IAAIjC,CAAAA,CACd,CAHE,CAKV,CAlLK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the logic for a drawer.\n *\n * @module theme_boost/drawer\n * @copyright 2016 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/custom_interaction_events', 'core/log', 'core/pubsub', 'core/aria'],\n function($, CustomEvents, Log, PubSub, Aria) {\n\n var SELECTORS = {\n TOGGLE_REGION: '[data-region=\"drawer-toggle\"]',\n TOGGLE_ACTION: '[data-action=\"toggle-drawer\"]',\n TOGGLE_TARGET: 'aria-controls',\n TOGGLE_SIDE: 'left',\n BODY: 'body',\n SECTION: '.list-group-item[href*=\"#section-\"]',\n DRAWER: '#nav-drawer'\n };\n\n var small = $(document).width() < 768;\n\n /**\n * Constructor for the Drawer.\n *\n * @param {object} root The root jQuery element for the modal\n */\n var Drawer = function() {\n\n if (!$(SELECTORS.TOGGLE_REGION).length) {\n Log.debug('Page is missing a drawer region');\n }\n if (!$(SELECTORS.TOGGLE_ACTION).length) {\n Log.debug('Page is missing a drawer toggle link');\n }\n $(SELECTORS.TOGGLE_REGION).each(function(index, ele) {\n var trigger = $(ele).find(SELECTORS.TOGGLE_ACTION);\n var drawerid = trigger.attr('aria-controls');\n var drawer = $(document.getElementById(drawerid));\n var hidden = trigger.attr('aria-expanded') == 'false';\n var side = trigger.attr('data-side');\n var body = $(SELECTORS.BODY);\n var preference = trigger.attr('data-preference');\n if (small) {\n M.util.set_user_preference(preference, 'false');\n }\n\n drawer.on('mousewheel DOMMouseScroll', this.preventPageScroll);\n\n if (!hidden) {\n body.addClass('drawer-open-' + side);\n trigger.attr('aria-expanded', 'true');\n } else {\n trigger.attr('aria-expanded', 'false');\n }\n }.bind(this));\n\n this.registerEventListeners();\n if (small) {\n this.closeAll();\n }\n };\n\n Drawer.prototype.closeAll = function() {\n $(SELECTORS.TOGGLE_REGION).each(function(index, ele) {\n var trigger = $(ele).find(SELECTORS.TOGGLE_ACTION);\n var side = trigger.attr('data-side');\n var body = $(SELECTORS.BODY);\n var drawerid = trigger.attr('aria-controls');\n var drawer = $(document.getElementById(drawerid));\n var preference = trigger.attr('data-preference');\n\n trigger.attr('aria-expanded', 'false');\n body.removeClass('drawer-open-' + side);\n Aria.hide(drawer.get());\n drawer.addClass('closed');\n if (!small) {\n M.util.set_user_preference(preference, 'false');\n }\n });\n };\n\n /**\n * Open / close the blocks drawer.\n *\n * @method toggleDrawer\n * @param {Event} e\n */\n Drawer.prototype.toggleDrawer = function(e) {\n var trigger = $(e.target).closest('[data-action=toggle-drawer]');\n var drawerid = trigger.attr('aria-controls');\n var drawer = $(document.getElementById(drawerid));\n var body = $(SELECTORS.BODY);\n var side = trigger.attr('data-side');\n var preference = trigger.attr('data-preference');\n if (small) {\n M.util.set_user_preference(preference, 'false');\n }\n\n body.addClass('drawer-ease');\n var open = trigger.attr('aria-expanded') == 'true';\n if (!open) {\n // Open.\n trigger.attr('aria-expanded', 'true');\n Aria.unhide(drawer.get());\n drawer.focus();\n body.addClass('drawer-open-' + side);\n drawer.removeClass('closed');\n if (!small) {\n M.util.set_user_preference(preference, 'true');\n }\n } else {\n // Close.\n body.removeClass('drawer-open-' + side);\n trigger.attr('aria-expanded', 'false');\n drawer.addClass('closed').delay(500).queue(function() {\n // Ensure that during the delay, the drawer wasn't re-opened.\n if ($(this).hasClass('closed')) {\n Aria.hide(this);\n }\n $(this).dequeue();\n });\n if (!small) {\n M.util.set_user_preference(preference, 'false');\n }\n }\n\n // Publish an event to tell everything that the drawer has been toggled.\n // The drawer transitions closed so another event will fire once teh transition\n // has completed.\n PubSub.publish('nav-drawer-toggle-start', open);\n };\n\n /**\n * Prevent the page from scrolling when the drawer is at max scroll.\n *\n * @method preventPageScroll\n * @param {Event} e\n */\n Drawer.prototype.preventPageScroll = function(e) {\n var delta = e.wheelDelta || (e.originalEvent && e.originalEvent.wheelDelta) || -e.originalEvent.detail,\n bottomOverflow = (this.scrollTop + $(this).outerHeight() - this.scrollHeight) >= 0,\n topOverflow = this.scrollTop <= 0;\n\n if ((delta < 0 && bottomOverflow) || (delta > 0 && topOverflow)) {\n e.preventDefault();\n }\n };\n\n /**\n * Set up all of the event handling for the modal.\n *\n * @method registerEventListeners\n */\n Drawer.prototype.registerEventListeners = function() {\n\n $(SELECTORS.TOGGLE_ACTION).each(function(index, element) {\n CustomEvents.define($(element), [CustomEvents.events.activate]);\n $(element).on(CustomEvents.events.activate, function(e, data) {\n this.toggleDrawer(data.originalEvent);\n data.originalEvent.preventDefault();\n }.bind(this));\n }.bind(this));\n\n $(SELECTORS.SECTION).click(function() {\n if (small) {\n this.closeAll();\n }\n }.bind(this));\n\n // Publish an event to tell everything that the drawer completed the transition\n // to either an open or closed state.\n $(SELECTORS.DRAWER).on('webkitTransitionEnd msTransitionEnd transitionend', function(e) {\n var drawer = $(e.target).closest(SELECTORS.DRAWER);\n // Note: aria-hidden is either present, or absent. It should not be set to false.\n var open = !!drawer.attr('aria-hidden');\n PubSub.publish('nav-drawer-toggle-end', open);\n });\n };\n\n return {\n 'init': function() {\n return new Drawer();\n }\n };\n});\n"],"file":"drawer.min.js"} \ No newline at end of file diff --git a/theme/boost/amd/build/loader.min.js.map b/theme/boost/amd/build/loader.min.js.map index 0714b36847052..d799def455e7f 100644 --- a/theme/boost/amd/build/loader.min.js.map +++ b/theme/boost/amd/build/loader.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/loader.js"],"names":["rememberTabs","on","e","hash","target","attr","history","replaceState","location","window","tab","document","querySelector","click","enablePopovers","popover","container","selector","trigger","addEventListener","key","closest","enableTooltips","tooltip","pendingPromise","Pending","Aria","init","Scroll","$","fn","dropdown","Constructor","Default","flip","resolve"],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AEKO,CAAc,CAAG,GAAIC,UAAJ,CAAY,yBAAZ,C,CAGvB,gBAGAC,CAAI,CAACC,IAAL,GAGA3B,CAAY,GAGZc,CAAc,GAGdQ,CAAc,GAGb,GAAIM,UAAJ,EAAD,CAAeD,IAAf,GAGAE,UAAEC,EAAF,CAAKC,QAAL,CAAcC,WAAd,CAA0BC,OAA1B,CAAkCC,IAAlC,IAEAV,CAAc,CAACW,OAAf,E","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Template renderer for Moodle. Load and render Moodle templates with Mustache.\n *\n * @module core/templates\n * @class templates\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 2.9\n */\n\nimport $ from 'jquery';\nimport * as Aria from './aria';\nimport Bootstrap from './index';\nimport Pending from 'core/pending';\nimport Scroll from './scroll';\nimport setupBootstrapPendingChecks from './pending';\n\n/**\n * Rember the last visited tabs.\n */\nconst rememberTabs = () => {\n $('a[data-toggle=\"tab\"]').on('shown.bs.tab', function(e) {\n var hash = $(e.target).attr('href');\n if (history.replaceState) {\n history.replaceState(null, null, hash);\n } else {\n location.hash = hash;\n }\n });\n const hash = window.location.hash;\n if (hash) {\n const tab = document.querySelector('.nav-link[href=\"' + hash + '\"]');\n if (tab) {\n tab.click();\n }\n }\n};\n\n/**\n * Enable all popovers\n *\n */\nconst enablePopovers = () => {\n $('body').popover({\n container: 'body',\n selector: '[data-toggle=\"popover\"]',\n trigger: 'focus',\n });\n\n document.addEventListener('keydown', e => {\n if (e.key === 'Escape' && e.target.closest('[data-toggle=\"popover\"]')) {\n $(e.target).popover('hide');\n }\n });\n};\n\n/**\n * Enable tooltips\n *\n */\nconst enableTooltips = () => {\n $('body').tooltip({\n container: 'body',\n selector: '[data-toggle=\"tooltip\"]',\n });\n};\n\nconst pendingPromise = new Pending('theme_boost/loader:init');\n\n// Add pending promise event listeners to relevant Bootstrap custom events.\nsetupBootstrapPendingChecks();\n\n// Setup Aria helpers for Bootstrap features.\nAria.init();\n\n// Remember the last visited tabs.\nrememberTabs();\n\n// Enable all popovers.\nenablePopovers();\n\n// Enable all tooltips.\nenableTooltips();\n\n// Add scroll handling.\n(new Scroll()).init();\n\n// Disables flipping the dropdowns up and getting hidden behind the navbar.\n$.fn.dropdown.Constructor.Default.flip = false;\n\npendingPromise.resolve();\n\nexport {\n Bootstrap,\n};\n"],"file":"loader.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/loader.js"],"names":["rememberTabs","on","e","hash","target","attr","history","replaceState","location","window","tab","document","querySelector","click","enablePopovers","popover","container","selector","trigger","addEventListener","key","closest","enableTooltips","tooltip","pendingPromise","Pending","Aria","init","Scroll","$","fn","dropdown","Constructor","Default","flip","resolve"],"mappings":"8jBAwBA,OACA,OACA,OACA,OACA,OACA,O,4lBAKMA,CAAAA,CAAY,CAAG,UAAM,CACvB,cAAE,wBAAF,EAA0BC,EAA1B,CAA6B,cAA7B,CAA6C,SAASC,CAAT,CAAY,CACrD,GAAIC,CAAAA,CAAI,CAAG,cAAED,CAAC,CAACE,MAAJ,EAAYC,IAAZ,CAAiB,MAAjB,CAAX,CACA,GAAIC,OAAO,CAACC,YAAZ,CAA0B,CACtBD,OAAO,CAACC,YAAR,CAAqB,IAArB,CAA2B,IAA3B,CAAiCJ,CAAjC,CACH,CAFD,IAEO,CACHK,QAAQ,CAACL,IAAT,CAAgBA,CACnB,CACJ,CAPD,EAQA,GAAMA,CAAAA,CAAI,CAAGM,MAAM,CAACD,QAAP,CAAgBL,IAA7B,CACA,GAAIA,CAAJ,CAAU,CACN,GAAMO,CAAAA,CAAG,CAAGC,QAAQ,CAACC,aAAT,CAAuB,oBAAqBT,CAArB,CAA4B,KAAnD,CAAZ,CACA,GAAIO,CAAJ,CAAS,CACLA,CAAG,CAACG,KAAJ,EACH,CACJ,CACJ,C,CAMKC,CAAc,CAAG,UAAM,CACzB,cAAE,MAAF,EAAUC,OAAV,CAAkB,CACdC,SAAS,CAAE,MADG,CAEdC,QAAQ,CAAE,2BAFI,CAGdC,OAAO,CAAE,OAHK,CAAlB,EAMAP,QAAQ,CAACQ,gBAAT,CAA0B,SAA1B,CAAqC,SAAAjB,CAAC,CAAI,CACtC,GAAc,QAAV,GAAAA,CAAC,CAACkB,GAAF,EAAsBlB,CAAC,CAACE,MAAF,CAASiB,OAAT,CAAiB,2BAAjB,CAA1B,CAAuE,CACnE,cAAEnB,CAAC,CAACE,MAAJ,EAAYW,OAAZ,CAAoB,MAApB,CACH,CACJ,CAJD,CAKH,C,CAMKO,CAAc,CAAG,UAAM,CACzB,cAAE,MAAF,EAAUC,OAAV,CAAkB,CACdP,SAAS,CAAE,MADG,CAEdC,QAAQ,CAAE,2BAFI,CAAlB,CAIH,C,CAEKO,CAAc,CAAG,GAAIC,UAAJ,CAAY,yBAAZ,C,CAGvB,gBAGAC,CAAI,CAACC,IAAL,GAGA3B,CAAY,GAGZc,CAAc,GAGdQ,CAAc,GAGb,GAAIM,UAAJ,EAAD,CAAeD,IAAf,GAGAE,UAAEC,EAAF,CAAKC,QAAL,CAAcC,WAAd,CAA0BC,OAA1B,CAAkCC,IAAlC,IAEAV,CAAc,CAACW,OAAf,E","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Template renderer for Moodle. Load and render Moodle templates with Mustache.\n *\n * @module theme_boost/loader\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 2.9\n */\n\nimport $ from 'jquery';\nimport * as Aria from './aria';\nimport Bootstrap from './index';\nimport Pending from 'core/pending';\nimport Scroll from './scroll';\nimport setupBootstrapPendingChecks from './pending';\n\n/**\n * Rember the last visited tabs.\n */\nconst rememberTabs = () => {\n $('a[data-toggle=\"tab\"]').on('shown.bs.tab', function(e) {\n var hash = $(e.target).attr('href');\n if (history.replaceState) {\n history.replaceState(null, null, hash);\n } else {\n location.hash = hash;\n }\n });\n const hash = window.location.hash;\n if (hash) {\n const tab = document.querySelector('.nav-link[href=\"' + hash + '\"]');\n if (tab) {\n tab.click();\n }\n }\n};\n\n/**\n * Enable all popovers\n *\n */\nconst enablePopovers = () => {\n $('body').popover({\n container: 'body',\n selector: '[data-toggle=\"popover\"]',\n trigger: 'focus',\n });\n\n document.addEventListener('keydown', e => {\n if (e.key === 'Escape' && e.target.closest('[data-toggle=\"popover\"]')) {\n $(e.target).popover('hide');\n }\n });\n};\n\n/**\n * Enable tooltips\n *\n */\nconst enableTooltips = () => {\n $('body').tooltip({\n container: 'body',\n selector: '[data-toggle=\"tooltip\"]',\n });\n};\n\nconst pendingPromise = new Pending('theme_boost/loader:init');\n\n// Add pending promise event listeners to relevant Bootstrap custom events.\nsetupBootstrapPendingChecks();\n\n// Setup Aria helpers for Bootstrap features.\nAria.init();\n\n// Remember the last visited tabs.\nrememberTabs();\n\n// Enable all popovers.\nenablePopovers();\n\n// Enable all tooltips.\nenableTooltips();\n\n// Add scroll handling.\n(new Scroll()).init();\n\n// Disables flipping the dropdowns up and getting hidden behind the navbar.\n$.fn.dropdown.Constructor.Default.flip = false;\n\npendingPromise.resolve();\n\nexport {\n Bootstrap,\n};\n"],"file":"loader.min.js"} \ No newline at end of file diff --git a/theme/boost/amd/build/scroll.min.js.map b/theme/boost/amd/build/scroll.min.js.map index 5bafaafd94077..eeeb0459be225 100644 --- a/theme/boost/amd/build/scroll.min.js.map +++ b/theme/boost/amd/build/scroll.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/scroll.js"],"names":["MoodleScroll","scrollY","window","addEventListener","scrollHandler","bind","pageYOffset","document","documentElement","scrollTop","body","querySelector","getScrollPosition","innerHeight","classList","add","remove"],"mappings":"wcA6BqBA,CAAAA,C,yEASV,CACH,KAAKC,OAAL,CAAe,CAAf,CACAC,MAAM,CAACC,gBAAP,CAAwB,QAAxB,CAAkC,KAAKC,aAAL,CAAmBC,IAAnB,CAAwB,IAAxB,CAAlC,EACA,MAAO,KACV,C,6DASmB,CAChB,MAAOH,CAAAA,MAAM,CAACI,WAAP,EAAsBC,QAAQ,CAACC,eAAT,CAAyBC,SACzD,C,qDAQe,IACNC,CAAAA,CAAI,CAAGH,QAAQ,CAACI,aAAT,CAAuB,MAAvB,CADD,CAENV,CAAO,CAAG,KAAKW,iBAAL,EAFJ,CAGZ,GAAIX,CAAO,EAAIC,MAAM,CAACW,WAAtB,CAAmC,CAC/BH,CAAI,CAACI,SAAL,CAAeC,GAAf,CAAmB,UAAnB,CACH,CAFD,IAEO,CACHL,CAAI,CAACI,SAAL,CAAeE,MAAf,CAAsB,UAAtB,CACH,CACJ,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Manage user scroll in Moodle for future floating elements.\n *\n * @copyright 2020 Ferran Recio \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * Moodle scroll handling. For now it just handle a \"scrolled\" class\n * on the body tag but in the near future could handle more floating\n * elements like option bars, docked elements or other active elements.\n *\n * @class MoodleScroll\n */\nexport default class MoodleScroll {\n\n /**\n * Initialise the scroll monitoring.\n *\n * @method init\n * @chainable\n * @return {Object} this.\n */\n init() {\n this.scrollY = 0;\n window.addEventListener(\"scroll\", this.scrollHandler.bind(this));\n return this;\n }\n\n /**\n * Add special classes to body depending on scroll position.\n *\n * @method update\n * @chainable\n * @return {Integer} current scroll position.\n */\n getScrollPosition() {\n return window.pageYOffset || document.documentElement.scrollTop;\n }\n\n /**\n * Add special classes to body depending on scroll position.\n *\n * @method update\n * @chainable\n */\n scrollHandler() {\n const body = document.querySelector('body');\n const scrollY = this.getScrollPosition();\n if (scrollY >= window.innerHeight) {\n body.classList.add('scrolled');\n } else {\n body.classList.remove('scrolled');\n }\n }\n}\n"],"file":"scroll.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/scroll.js"],"names":["MoodleScroll","scrollY","window","addEventListener","scrollHandler","bind","pageYOffset","document","documentElement","scrollTop","body","querySelector","getScrollPosition","innerHeight","classList","add","remove"],"mappings":"wcA8BqBA,CAAAA,C,yEASV,CACH,KAAKC,OAAL,CAAe,CAAf,CACAC,MAAM,CAACC,gBAAP,CAAwB,QAAxB,CAAkC,KAAKC,aAAL,CAAmBC,IAAnB,CAAwB,IAAxB,CAAlC,EACA,MAAO,KACV,C,6DASmB,CAChB,MAAOH,CAAAA,MAAM,CAACI,WAAP,EAAsBC,QAAQ,CAACC,eAAT,CAAyBC,SACzD,C,qDAQe,IACNC,CAAAA,CAAI,CAAGH,QAAQ,CAACI,aAAT,CAAuB,MAAvB,CADD,CAENV,CAAO,CAAG,KAAKW,iBAAL,EAFJ,CAGZ,GAAIX,CAAO,EAAIC,MAAM,CAACW,WAAtB,CAAmC,CAC/BH,CAAI,CAACI,SAAL,CAAeC,GAAf,CAAmB,UAAnB,CACH,CAFD,IAEO,CACHL,CAAI,CAACI,SAAL,CAAeE,MAAf,CAAsB,UAAtB,CACH,CACJ,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Manage user scroll in Moodle for future floating elements.\n *\n * @module theme_boost/scroll\n * @copyright 2020 Ferran Recio \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * Moodle scroll handling. For now it just handle a \"scrolled\" class\n * on the body tag but in the near future could handle more floating\n * elements like option bars, docked elements or other active elements.\n *\n * @class theme_boost/scroll\n */\nexport default class MoodleScroll {\n\n /**\n * Initialise the scroll monitoring.\n *\n * @method init\n * @chainable\n * @return {Object} this.\n */\n init() {\n this.scrollY = 0;\n window.addEventListener(\"scroll\", this.scrollHandler.bind(this));\n return this;\n }\n\n /**\n * Add special classes to body depending on scroll position.\n *\n * @method update\n * @chainable\n * @return {Integer} current scroll position.\n */\n getScrollPosition() {\n return window.pageYOffset || document.documentElement.scrollTop;\n }\n\n /**\n * Add special classes to body depending on scroll position.\n *\n * @method update\n * @chainable\n */\n scrollHandler() {\n const body = document.querySelector('body');\n const scrollY = this.getScrollPosition();\n if (scrollY >= window.innerHeight) {\n body.classList.add('scrolled');\n } else {\n body.classList.remove('scrolled');\n }\n }\n}\n"],"file":"scroll.min.js"} \ No newline at end of file diff --git a/theme/boost/amd/src/drawer.js b/theme/boost/amd/src/drawer.js index b73739c64d4c2..d33337e7077eb 100644 --- a/theme/boost/amd/src/drawer.js +++ b/theme/boost/amd/src/drawer.js @@ -16,6 +16,7 @@ /** * Contain the logic for a drawer. * + * @module theme_boost/drawer * @copyright 2016 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/theme/boost/amd/src/loader.js b/theme/boost/amd/src/loader.js index cd18880ea6c74..55e0be4488a68 100644 --- a/theme/boost/amd/src/loader.js +++ b/theme/boost/amd/src/loader.js @@ -16,8 +16,7 @@ /** * Template renderer for Moodle. Load and render Moodle templates with Mustache. * - * @module core/templates - * @class templates + * @module theme_boost/loader * @copyright 2015 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @since 2.9 diff --git a/theme/boost/amd/src/scroll.js b/theme/boost/amd/src/scroll.js index a0ded31349f1b..b067f3eca388a 100644 --- a/theme/boost/amd/src/scroll.js +++ b/theme/boost/amd/src/scroll.js @@ -16,6 +16,7 @@ /** * Manage user scroll in Moodle for future floating elements. * + * @module theme_boost/scroll * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -25,7 +26,7 @@ * on the body tag but in the near future could handle more floating * elements like option bars, docked elements or other active elements. * - * @class MoodleScroll + * @class theme_boost/scroll */ export default class MoodleScroll {
').text(c.getTitle()));\n }\n\n // Write the column headers.\n node = $('
'));\n }\n series.forEach(function(serie) {\n node.append(\n $('')\n .text(serie.getLabel())\n .attr('scope', 'col')\n );\n });\n tbl.append(node);\n\n // Write rows.\n for (var rowId = 0; rowId < rowCount; rowId++) {\n node = $('
')\n .text(labels[rowId])\n .attr('scope', 'row')\n );\n }\n for (var serieId = 0; serieId < series.length; serieId++) {\n value = series[serieId].getValues()[rowId];\n seriesLabels = series[serieId].getLabels();\n if (seriesLabels !== null) {\n value = series[serieId].getLabels()[rowId];\n }\n node.append($('').text(value));\n }\n tbl.append(node);\n }\n\n return tbl;\n };\n\n /** @override */\n Output.prototype.update = function() {\n this._build();\n };\n\n return Output;\n\n});\n"],"file":"chart_output_htmltable.min.js"} \ No newline at end of file diff --git a/lib/amd/build/chart_pie.min.js.map b/lib/amd/build/chart_pie.min.js.map index 5af7778395be2..6216ff5293c53 100644 --- a/lib/amd/build/chart_pie.min.js.map +++ b/lib/amd/build/chart_pie.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/chart_pie.js"],"names":["define","Base","Pie","prototype","constructor","apply","arguments","Object","create","TYPE","_doughnut","Klass","data","chart","setDoughnut","doughnut","addSeries","series","getColor","colors","configColorSet","getConfigColorSet","COLORSET","i","getCount","push","length","setColors","getDoughnut","_validateSeries","_series","Error"],"mappings":"AAsBAA,OAAM,kBAAC,CAAC,iBAAD,CAAD,CAAsB,SAASC,CAAT,CAAe,CASvC,QAASC,CAAAA,CAAT,EAAe,CACXD,CAAI,CAACE,SAAL,CAAeC,WAAf,CAA2BC,KAA3B,CAAiC,IAAjC,CAAuCC,SAAvC,CACH,CACDJ,CAAG,CAACC,SAAJ,CAAgBI,MAAM,CAACC,MAAP,CAAcP,CAAI,CAACE,SAAnB,CAAhB,CAGAD,CAAG,CAACC,SAAJ,CAAcM,IAAd,CAAqB,KAArB,CAQAP,CAAG,CAACC,SAAJ,CAAcO,SAAd,CAA0B,IAA1B,CAGAR,CAAG,CAACC,SAAJ,CAAcK,MAAd,CAAuB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CACzC,GAAIC,CAAAA,CAAK,CAAGZ,CAAI,CAACE,SAAL,CAAeK,MAAf,CAAsBH,KAAtB,CAA4B,IAA5B,CAAkCC,SAAlC,CAAZ,CACAO,CAAK,CAACC,WAAN,CAAkBF,CAAI,CAACG,QAAvB,EACA,MAAOF,CAAAA,CACV,CAJD,CAWAX,CAAG,CAACC,SAAJ,CAAca,SAAd,CAA0B,SAASC,CAAT,CAAiB,CACvC,GAA0B,IAAtB,GAAAA,CAAM,CAACC,QAAP,EAAJ,CAAgC,CAG5B,OAFIC,CAAAA,CAAM,CAAG,EAEb,CADIC,CAAc,CAAG,KAAKC,iBAAL,IAA4BpB,CAAI,CAACE,SAAL,CAAemB,QAChE,CAASC,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGN,CAAM,CAACO,QAAP,EAApB,CAAuCD,CAAC,EAAxC,CAA4C,CACxCJ,CAAM,CAACM,IAAP,CAAYL,CAAc,CAACG,CAAC,CAAGH,CAAc,CAACM,MAApB,CAA1B,CACH,CACDT,CAAM,CAACU,SAAP,CAAiBR,CAAjB,CACH,CACD,MAAOlB,CAAAA,CAAI,CAACE,SAAL,CAAea,SAAf,CAAyBX,KAAzB,CAA+B,IAA/B,CAAqCC,SAArC,CACV,CAVD,CAkBAJ,CAAG,CAACC,SAAJ,CAAcyB,WAAd,CAA4B,UAAW,CACnC,MAAO,MAAKlB,SACf,CAFD,CAUAR,CAAG,CAACC,SAAJ,CAAcW,WAAd,CAA4B,SAASC,CAAT,CAAmB,CAC3C,KAAKL,SAAL,GAAyBK,CAC5B,CAFD,CAYAb,CAAG,CAACC,SAAJ,CAAc0B,eAAd,CAAgC,UAAW,CACvC,GAA2B,CAAvB,OAAKC,OAAL,CAAaJ,MAAjB,CAA8B,CAC1B,KAAM,IAAIK,CAAAA,KAAJ,CAAU,oCAAV,CACT,CACD,MAAO9B,CAAAA,CAAI,CAACE,SAAL,CAAe0B,eAAf,CAA+BxB,KAA/B,CAAqC,IAArC,CAA2CC,SAA3C,CACV,CALD,CAOA,MAAOJ,CAAAA,CAEV,CAtFK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart pie.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_pie\n */\ndefine(['core/chart_base'], function(Base) {\n\n /**\n * Pie chart.\n *\n * @class\n * @alias module:core/chart_pie\n * @extends {module:core/chart_base}\n */\n function Pie() {\n Base.prototype.constructor.apply(this, arguments);\n }\n Pie.prototype = Object.create(Base.prototype);\n\n /** @override */\n Pie.prototype.TYPE = 'pie';\n\n /**\n * Whether the chart should be displayed as doughnut or not.\n *\n * @type {Bool}\n * @protected\n */\n Pie.prototype._doughnut = null;\n\n /** @override */\n Pie.prototype.create = function(Klass, data) {\n var chart = Base.prototype.create.apply(this, arguments);\n chart.setDoughnut(data.doughnut);\n return chart;\n };\n\n /**\n * Overridden to add appropriate colors to the series.\n *\n * @override\n */\n Pie.prototype.addSeries = function(series) {\n if (series.getColor() === null) {\n var colors = [];\n var configColorSet = this.getConfigColorSet() || Base.prototype.COLORSET;\n for (var i = 0; i < series.getCount(); i++) {\n colors.push(configColorSet[i % configColorSet.length]);\n }\n series.setColors(colors);\n }\n return Base.prototype.addSeries.apply(this, arguments);\n };\n\n /**\n * Get whether the chart should be displayed as doughnut or not.\n *\n * @method getDoughnut\n * @returns {Bool}\n */\n Pie.prototype.getDoughnut = function() {\n return this._doughnut;\n };\n\n /**\n * Set whether the chart should be displayed as doughnut or not.\n *\n * @method setDoughnut\n * @param {Bool} doughnut True for doughnut type, false for pie.\n */\n Pie.prototype.setDoughnut = function(doughnut) {\n this._doughnut = Boolean(doughnut);\n };\n\n /**\n * Validate a series.\n *\n * Overrides parent implementation to validate that there is only\n * one series per chart instance.\n *\n * @override\n */\n Pie.prototype._validateSeries = function() {\n if (this._series.length >= 1) {\n throw new Error('Pie charts only support one serie.');\n }\n return Base.prototype._validateSeries.apply(this, arguments);\n };\n\n return Pie;\n\n});\n"],"file":"chart_pie.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/chart_pie.js"],"names":["define","Base","Pie","prototype","constructor","apply","arguments","Object","create","TYPE","_doughnut","Klass","data","chart","setDoughnut","doughnut","addSeries","series","getColor","colors","configColorSet","getConfigColorSet","COLORSET","i","getCount","push","length","setColors","getDoughnut","_validateSeries","_series","Error"],"mappings":"AAsBAA,OAAM,kBAAC,CAAC,iBAAD,CAAD,CAAsB,SAASC,CAAT,CAAe,CAQvC,QAASC,CAAAA,CAAT,EAAe,CACXD,CAAI,CAACE,SAAL,CAAeC,WAAf,CAA2BC,KAA3B,CAAiC,IAAjC,CAAuCC,SAAvC,CACH,CACDJ,CAAG,CAACC,SAAJ,CAAgBI,MAAM,CAACC,MAAP,CAAcP,CAAI,CAACE,SAAnB,CAAhB,CAGAD,CAAG,CAACC,SAAJ,CAAcM,IAAd,CAAqB,KAArB,CAQAP,CAAG,CAACC,SAAJ,CAAcO,SAAd,CAA0B,IAA1B,CAGAR,CAAG,CAACC,SAAJ,CAAcK,MAAd,CAAuB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CACzC,GAAIC,CAAAA,CAAK,CAAGZ,CAAI,CAACE,SAAL,CAAeK,MAAf,CAAsBH,KAAtB,CAA4B,IAA5B,CAAkCC,SAAlC,CAAZ,CACAO,CAAK,CAACC,WAAN,CAAkBF,CAAI,CAACG,QAAvB,EACA,MAAOF,CAAAA,CACV,CAJD,CAWAX,CAAG,CAACC,SAAJ,CAAca,SAAd,CAA0B,SAASC,CAAT,CAAiB,CACvC,GAA0B,IAAtB,GAAAA,CAAM,CAACC,QAAP,EAAJ,CAAgC,CAG5B,OAFIC,CAAAA,CAAM,CAAG,EAEb,CADIC,CAAc,CAAG,KAAKC,iBAAL,IAA4BpB,CAAI,CAACE,SAAL,CAAemB,QAChE,CAASC,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGN,CAAM,CAACO,QAAP,EAApB,CAAuCD,CAAC,EAAxC,CAA4C,CACxCJ,CAAM,CAACM,IAAP,CAAYL,CAAc,CAACG,CAAC,CAAGH,CAAc,CAACM,MAApB,CAA1B,CACH,CACDT,CAAM,CAACU,SAAP,CAAiBR,CAAjB,CACH,CACD,MAAOlB,CAAAA,CAAI,CAACE,SAAL,CAAea,SAAf,CAAyBX,KAAzB,CAA+B,IAA/B,CAAqCC,SAArC,CACV,CAVD,CAkBAJ,CAAG,CAACC,SAAJ,CAAcyB,WAAd,CAA4B,UAAW,CACnC,MAAO,MAAKlB,SACf,CAFD,CAUAR,CAAG,CAACC,SAAJ,CAAcW,WAAd,CAA4B,SAASC,CAAT,CAAmB,CAC3C,KAAKL,SAAL,GAAyBK,CAC5B,CAFD,CAYAb,CAAG,CAACC,SAAJ,CAAc0B,eAAd,CAAgC,UAAW,CACvC,GAA2B,CAAvB,OAAKC,OAAL,CAAaJ,MAAjB,CAA8B,CAC1B,KAAM,IAAIK,CAAAA,KAAJ,CAAU,oCAAV,CACT,CACD,MAAO9B,CAAAA,CAAI,CAACE,SAAL,CAAe0B,eAAf,CAA+BxB,KAA/B,CAAqC,IAArC,CAA2CC,SAA3C,CACV,CALD,CAOA,MAAOJ,CAAAA,CAEV,CArFK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart pie.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_pie\n */\ndefine(['core/chart_base'], function(Base) {\n\n /**\n * Pie chart.\n *\n * @class\n * @extends {module:core/chart_base}\n */\n function Pie() {\n Base.prototype.constructor.apply(this, arguments);\n }\n Pie.prototype = Object.create(Base.prototype);\n\n /** @override */\n Pie.prototype.TYPE = 'pie';\n\n /**\n * Whether the chart should be displayed as doughnut or not.\n *\n * @type {Bool}\n * @protected\n */\n Pie.prototype._doughnut = null;\n\n /** @override */\n Pie.prototype.create = function(Klass, data) {\n var chart = Base.prototype.create.apply(this, arguments);\n chart.setDoughnut(data.doughnut);\n return chart;\n };\n\n /**\n * Overridden to add appropriate colors to the series.\n *\n * @override\n */\n Pie.prototype.addSeries = function(series) {\n if (series.getColor() === null) {\n var colors = [];\n var configColorSet = this.getConfigColorSet() || Base.prototype.COLORSET;\n for (var i = 0; i < series.getCount(); i++) {\n colors.push(configColorSet[i % configColorSet.length]);\n }\n series.setColors(colors);\n }\n return Base.prototype.addSeries.apply(this, arguments);\n };\n\n /**\n * Get whether the chart should be displayed as doughnut or not.\n *\n * @method getDoughnut\n * @returns {Bool}\n */\n Pie.prototype.getDoughnut = function() {\n return this._doughnut;\n };\n\n /**\n * Set whether the chart should be displayed as doughnut or not.\n *\n * @method setDoughnut\n * @param {Bool} doughnut True for doughnut type, false for pie.\n */\n Pie.prototype.setDoughnut = function(doughnut) {\n this._doughnut = Boolean(doughnut);\n };\n\n /**\n * Validate a series.\n *\n * Overrides parent implementation to validate that there is only\n * one series per chart instance.\n *\n * @override\n */\n Pie.prototype._validateSeries = function() {\n if (this._series.length >= 1) {\n throw new Error('Pie charts only support one serie.');\n }\n return Base.prototype._validateSeries.apply(this, arguments);\n };\n\n return Pie;\n\n});\n"],"file":"chart_pie.min.js"} \ No newline at end of file diff --git a/lib/amd/build/chart_series.min.js.map b/lib/amd/build/chart_series.min.js.map index f69999c653712..6356e5468fd9b 100644 --- a/lib/amd/build/chart_series.min.js.map +++ b/lib/amd/build/chart_series.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/chart_series.js"],"names":["define","Series","label","values","Error","length","_colors","_label","_values","prototype","TYPE_DEFAULT","TYPE_LINE","_fill","_labels","_smooth","_type","_xaxis","_yaxis","create","obj","s","setType","type","setXAxis","axes","x","setYAxis","y","setLabels","labels","colors","setColors","setColor","setFill","fill","setSmooth","smooth","getColor","getColors","getCount","getFill","getLabel","getLabels","getSmooth","getType","getValues","getXAxis","getYAxis","hasColoredValues","color","_validateLabels","index"],"mappings":"mSAsBAA,OAAM,qBAAC,EAAD,CAAK,UAAW,CAUlB,QAASC,CAAAA,CAAT,CAAgBC,CAAhB,CAAuBC,CAAvB,CAA+B,CAC3B,GAAqB,QAAjB,QAAOD,CAAAA,CAAX,CAA+B,CAC3B,KAAM,IAAIE,CAAAA,KAAJ,CAAU,2BAAV,CAET,CAHD,IAGO,IAAsB,QAAlB,WAAOD,CAAP,CAAJ,CAAgC,CACnC,KAAM,IAAIC,CAAAA,KAAJ,CAAU,uCAAV,CAET,CAHM,IAGA,IAAoB,CAAhB,CAAAD,CAAM,CAACE,MAAX,CAAuB,CAC1B,KAAM,IAAID,CAAAA,KAAJ,CAAU,qCAAV,CACT,CAED,KAAKE,OAAL,CAAe,EAAf,CACA,KAAKC,MAAL,CAAcL,CAAd,CACA,KAAKM,OAAL,CAAeL,CAClB,CAQDF,CAAM,CAACQ,SAAP,CAAiBC,YAAjB,CAAgC,IAAhC,CAQAT,CAAM,CAACQ,SAAP,CAAiBE,SAAjB,CAA6B,MAA7B,CAQAV,CAAM,CAACQ,SAAP,CAAiBH,OAAjB,CAA2B,IAA3B,CAQAL,CAAM,CAACQ,SAAP,CAAiBG,KAAjB,IAQAX,CAAM,CAACQ,SAAP,CAAiBF,MAAjB,CAA0B,IAA1B,CAQCN,CAAM,CAACQ,SAAP,CAAiBI,OAAjB,CAA2B,IAA3B,CAQDZ,CAAM,CAACQ,SAAP,CAAiBK,OAAjB,IAQAb,CAAM,CAACQ,SAAP,CAAiBM,KAAjB,CAAyBd,CAAM,CAACQ,SAAP,CAAiBC,YAA1C,CAQAT,CAAM,CAACQ,SAAP,CAAiBD,OAAjB,CAA2B,IAA3B,CAQAP,CAAM,CAACQ,SAAP,CAAiBO,MAAjB,CAA0B,IAA1B,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A,MAAOH,CAAAA,CAEV,CA3VK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart series.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_series\n */\ndefine([], function() {\n\n /**\n * Chart data series.\n *\n * @class\n * @alias module:core/chart_series\n * @param {String} label The series label.\n * @param {Number[]} values The values.\n */\n function Series(label, values) {\n if (typeof label !== 'string') {\n throw new Error('Invalid label for series.');\n\n } else if (typeof values !== 'object') {\n throw new Error('Values for a series must be an array.');\n\n } else if (values.length < 1) {\n throw new Error('Invalid values received for series.');\n }\n\n this._colors = [];\n this._label = label;\n this._values = values;\n }\n\n /**\n * The default type of series.\n *\n * @type {Null}\n * @const\n */\n Series.prototype.TYPE_DEFAULT = null;\n\n /**\n * Type of series 'line'.\n *\n * @type {String}\n * @const\n */\n Series.prototype.TYPE_LINE = 'line';\n\n /**\n * The colors of the series.\n *\n * @type {String[]}\n * @protected\n */\n Series.prototype._colors = null;\n\n /**\n * The fill mode of the series.\n *\n * @type {Object}\n * @protected\n */\n Series.prototype._fill = false;\n\n /**\n * The label of the series.\n *\n * @type {String}\n * @protected\n */\n Series.prototype._label = null;\n\n /**\n * The labels for the values of the series.\n *\n * @type {String[]}\n * @protected\n */\n Series.prototype._labels = null;\n\n /**\n * Whether the line of the serie should be smooth or not.\n *\n * @type {Bool}\n * @protected\n */\n Series.prototype._smooth = false;\n\n /**\n * The type of the series.\n *\n * @type {String}\n * @protected\n */\n Series.prototype._type = Series.prototype.TYPE_DEFAULT;\n\n /**\n * The values in the series.\n *\n * @type {Number[]}\n * @protected\n */\n Series.prototype._values = null;\n\n /**\n * The index of the X axis.\n *\n * @type {Number[]}\n * @protected\n */\n Series.prototype._xaxis = null;\n\n /**\n * The index of the Y axis.\n *\n * @type {Number[]}\n * @protected\n */\n Series.prototype._yaxis = null;\n\n /**\n * Create a new instance of a series from serialised data.\n *\n * @static\n * @method create\n * @param {Object} obj The data of the series.\n * @return {module:core/chart_series}\n */\n Series.prototype.create = function(obj) {\n var s = new Series(obj.label, obj.values);\n s.setType(obj.type);\n s.setXAxis(obj.axes.x);\n s.setYAxis(obj.axes.y);\n s.setLabels(obj.labels);\n\n // Colors are exported as an array with 1, or n values.\n if (obj.colors && obj.colors.length > 1) {\n s.setColors(obj.colors);\n } else {\n s.setColor(obj.colors[0]);\n }\n\n s.setFill(obj.fill);\n s.setSmooth(obj.smooth);\n return s;\n };\n\n /**\n * Get the color.\n *\n * @return {String}\n */\n Series.prototype.getColor = function() {\n return this._colors[0] || null;\n };\n\n /**\n * Get the colors for each value in the series.\n *\n * @return {String[]}\n */\n Series.prototype.getColors = function() {\n return this._colors;\n };\n\n /**\n * Get the number of values in the series.\n *\n * @return {Number}\n */\n Series.prototype.getCount = function() {\n return this._values.length;\n };\n\n /**\n * Get the fill mode of the series.\n *\n * @return {Object}\n */\n Series.prototype.getFill = function() {\n return this._fill;\n };\n\n /**\n * Get the series label.\n *\n * @return {String}\n */\n Series.prototype.getLabel = function() {\n return this._label;\n };\n\n /**\n * Get labels for the values of the series.\n *\n * @return {String[]}\n */\n Series.prototype.getLabels = function() {\n return this._labels;\n };\n\n /**\n * Get whether the line of the serie should be smooth or not.\n *\n * @returns {Bool}\n */\n Series.prototype.getSmooth = function() {\n return this._smooth;\n };\n\n /**\n * Get the series type.\n *\n * @return {String}\n */\n Series.prototype.getType = function() {\n return this._type;\n };\n\n /**\n * Get the series values.\n *\n * @return {Number[]}\n */\n Series.prototype.getValues = function() {\n return this._values;\n };\n\n /**\n * Get the index of the X axis.\n *\n * @return {Number}\n */\n Series.prototype.getXAxis = function() {\n return this._xaxis;\n };\n\n /**\n * Get the index of the Y axis.\n *\n * @return {Number}\n */\n Series.prototype.getYAxis = function() {\n return this._yaxis;\n };\n\n /**\n * Whether there is a color per value.\n *\n * @return {Bool}\n */\n Series.prototype.hasColoredValues = function() {\n return this._colors.length == this.getCount();\n };\n\n /**\n * Set the series color.\n *\n * @param {String} color A CSS-compatible color.\n */\n Series.prototype.setColor = function(color) {\n this._colors = [color];\n };\n\n /**\n * Set a color for each value in the series.\n *\n * @param {String[]} colors CSS-compatible colors.\n */\n Series.prototype.setColors = function(colors) {\n if (colors && colors.length != this.getCount()) {\n throw new Error('When setting multiple colors there must be one per value.');\n }\n this._colors = colors || [];\n };\n\n /**\n * Set the fill mode for the series.\n *\n * @param {Object} fill\n */\n Series.prototype.setFill = function(fill) {\n this._fill = typeof fill === 'undefined' ? null : fill;\n };\n\n /**\n * Set the labels for the values of the series.\n *\n * @param {String[]} labels the labels of the series values.\n */\n Series.prototype.setLabels = function(labels) {\n this._validateLabels(labels);\n labels = typeof labels === 'undefined' ? null : labels;\n this._labels = labels;\n };\n\n /**\n * Set Whether the line of the serie should be smooth or not.\n *\n * Only applicable for line chart or a line series, if null it assumes the chart default (not smooth).\n *\n * @param {Bool} smooth True if the lines should be smooth, false for tensioned lines.\n */\n Series.prototype.setSmooth = function(smooth) {\n smooth = typeof smooth === 'undefined' ? null : smooth;\n this._smooth = smooth;\n };\n\n /**\n * Set the type of the series.\n *\n * @param {String} type A type constant value.\n */\n Series.prototype.setType = function(type) {\n if (type != this.TYPE_DEFAULT && type != this.TYPE_LINE) {\n throw new Error('Invalid serie type.');\n }\n this._type = type || null;\n };\n\n /**\n * Set the index of the X axis.\n *\n * @param {Number} index The index.\n */\n Series.prototype.setXAxis = function(index) {\n this._xaxis = index || null;\n };\n\n\n /**\n * Set the index of the Y axis.\n *\n * @param {Number} index The index.\n */\n Series.prototype.setYAxis = function(index) {\n this._yaxis = index || null;\n };\n\n /**\n * Validate series labels.\n *\n * @protected\n * @param {String[]} labels The labels of the serie.\n */\n Series.prototype._validateLabels = function(labels) {\n if (labels && labels.length > 0 && labels.length != this.getCount()) {\n throw new Error('Series labels must match series values.');\n }\n };\n\n return Series;\n\n});\n"],"file":"chart_series.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/chart_series.js"],"names":["define","Series","label","values","Error","length","_colors","_label","_values","prototype","TYPE_DEFAULT","TYPE_LINE","_fill","_labels","_smooth","_type","_xaxis","_yaxis","create","obj","s","setType","type","setXAxis","axes","x","setYAxis","y","setLabels","labels","colors","setColors","setColor","setFill","fill","setSmooth","smooth","getColor","getColors","getCount","getFill","getLabel","getLabels","getSmooth","getType","getValues","getXAxis","getYAxis","hasColoredValues","color","_validateLabels","index"],"mappings":"mSAsBAA,OAAM,qBAAC,EAAD,CAAK,UAAW,CASlB,QAASC,CAAAA,CAAT,CAAgBC,CAAhB,CAAuBC,CAAvB,CAA+B,CAC3B,GAAqB,QAAjB,QAAOD,CAAAA,CAAX,CAA+B,CAC3B,KAAM,IAAIE,CAAAA,KAAJ,CAAU,2BAAV,CAET,CAHD,IAGO,IAAsB,QAAlB,WAAOD,CAAP,CAAJ,CAAgC,CACnC,KAAM,IAAIC,CAAAA,KAAJ,CAAU,uCAAV,CAET,CAHM,IAGA,IAAoB,CAAhB,CAAAD,CAAM,CAACE,MAAX,CAAuB,CAC1B,KAAM,IAAID,CAAAA,KAAJ,CAAU,qCAAV,CACT,CAED,KAAKE,OAAL,CAAe,EAAf,CACA,KAAKC,MAAL,CAAcL,CAAd,CACA,KAAKM,OAAL,CAAeL,CAClB,CAQDF,CAAM,CAACQ,SAAP,CAAiBC,YAAjB,CAAgC,IAAhC,CAQAT,CAAM,CAACQ,SAAP,CAAiBE,SAAjB,CAA6B,MAA7B,CAQAV,CAAM,CAACQ,SAAP,CAAiBH,OAAjB,CAA2B,IAA3B,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B,CAFD,CAUAlD,CAAM,CAACQ,SAAP,CAAiBiB,QAAjB,CAA4B,SAASyB,CAAT,CAAgB,CACxC,KAAKlC,MAAL,CAAckC,CAAK,EAAI,IAC1B,CAFD,CAUAlD,CAAM,CAACQ,SAAP,CAAiByC,eAAjB,CAAmC,SAASrB,CAAT,CAAiB,CAChD,GAAIA,CAAM,EAAoB,CAAhB,CAAAA,CAAM,CAACxB,MAAjB,EAA+BwB,CAAM,CAACxB,MAAP,EAAiB,KAAKkC,QAAL,EAApD,CAAqE,CACjE,KAAM,IAAInC,CAAAA,KAAJ,CAAU,yCAAV,CACT,CACJ,CAJD,CAMA,MAAOH,CAAAA,CAEV,CA1VK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Chart series.\n *\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @module core/chart_series\n */\ndefine([], function() {\n\n /**\n * Chart data series.\n *\n * @class\n * @param {String} label The series label.\n * @param {Number[]} values The values.\n */\n function Series(label, values) {\n if (typeof label !== 'string') {\n throw new Error('Invalid label for series.');\n\n } else if (typeof values !== 'object') {\n throw new Error('Values for a series must be an array.');\n\n } else if (values.length < 1) {\n throw new Error('Invalid values received for series.');\n }\n\n this._colors = [];\n this._label = label;\n this._values = values;\n }\n\n /**\n * The default type of series.\n *\n * @type {Null}\n * @const\n */\n Series.prototype.TYPE_DEFAULT = null;\n\n /**\n * Type of series 'line'.\n *\n * @type {String}\n * @const\n */\n Series.prototype.TYPE_LINE = 'line';\n\n /**\n * The colors of the series.\n *\n * @type {String[]}\n * @protected\n */\n Series.prototype._colors = null;\n\n /**\n * The fill mode of the series.\n *\n * @type {Object}\n * @protected\n */\n Series.prototype._fill = false;\n\n /**\n * The label of the series.\n *\n * @type {String}\n * @protected\n */\n Series.prototype._label = null;\n\n /**\n * The labels for the values of the series.\n *\n * @type {String[]}\n * @protected\n */\n Series.prototype._labels = null;\n\n /**\n * Whether the line of the serie should be smooth or not.\n *\n * @type {Bool}\n * @protected\n */\n Series.prototype._smooth = false;\n\n /**\n * The type of the series.\n *\n * @type {String}\n * @protected\n */\n Series.prototype._type = Series.prototype.TYPE_DEFAULT;\n\n /**\n * The values in the series.\n *\n * @type {Number[]}\n * @protected\n */\n Series.prototype._values = null;\n\n /**\n * The index of the X axis.\n *\n * @type {Number[]}\n * @protected\n */\n Series.prototype._xaxis = null;\n\n /**\n * The index of the Y axis.\n *\n * @type {Number[]}\n * @protected\n */\n Series.prototype._yaxis = null;\n\n /**\n * Create a new instance of a series from serialised data.\n *\n * @static\n * @method create\n * @param {Object} obj The data of the series.\n * @return {module:core/chart_series}\n */\n Series.prototype.create = function(obj) {\n var s = new Series(obj.label, obj.values);\n s.setType(obj.type);\n s.setXAxis(obj.axes.x);\n s.setYAxis(obj.axes.y);\n s.setLabels(obj.labels);\n\n // Colors are exported as an array with 1, or n values.\n if (obj.colors && obj.colors.length > 1) {\n s.setColors(obj.colors);\n } else {\n s.setColor(obj.colors[0]);\n }\n\n s.setFill(obj.fill);\n s.setSmooth(obj.smooth);\n return s;\n };\n\n /**\n * Get the color.\n *\n * @return {String}\n */\n Series.prototype.getColor = function() {\n return this._colors[0] || null;\n };\n\n /**\n * Get the colors for each value in the series.\n *\n * @return {String[]}\n */\n Series.prototype.getColors = function() {\n return this._colors;\n };\n\n /**\n * Get the number of values in the series.\n *\n * @return {Number}\n */\n Series.prototype.getCount = function() {\n return this._values.length;\n };\n\n /**\n * Get the fill mode of the series.\n *\n * @return {Object}\n */\n Series.prototype.getFill = function() {\n return this._fill;\n };\n\n /**\n * Get the series label.\n *\n * @return {String}\n */\n Series.prototype.getLabel = function() {\n return this._label;\n };\n\n /**\n * Get labels for the values of the series.\n *\n * @return {String[]}\n */\n Series.prototype.getLabels = function() {\n return this._labels;\n };\n\n /**\n * Get whether the line of the serie should be smooth or not.\n *\n * @returns {Bool}\n */\n Series.prototype.getSmooth = function() {\n return this._smooth;\n };\n\n /**\n * Get the series type.\n *\n * @return {String}\n */\n Series.prototype.getType = function() {\n return this._type;\n };\n\n /**\n * Get the series values.\n *\n * @return {Number[]}\n */\n Series.prototype.getValues = function() {\n return this._values;\n };\n\n /**\n * Get the index of the X axis.\n *\n * @return {Number}\n */\n Series.prototype.getXAxis = function() {\n return this._xaxis;\n };\n\n /**\n * Get the index of the Y axis.\n *\n * @return {Number}\n */\n Series.prototype.getYAxis = function() {\n return this._yaxis;\n };\n\n /**\n * Whether there is a color per value.\n *\n * @return {Bool}\n */\n Series.prototype.hasColoredValues = function() {\n return this._colors.length == this.getCount();\n };\n\n /**\n * Set the series color.\n *\n * @param {String} color A CSS-compatible color.\n */\n Series.prototype.setColor = function(color) {\n this._colors = [color];\n };\n\n /**\n * Set a color for each value in the series.\n *\n * @param {String[]} colors CSS-compatible colors.\n */\n Series.prototype.setColors = function(colors) {\n if (colors && colors.length != this.getCount()) {\n throw new Error('When setting multiple colors there must be one per value.');\n }\n this._colors = colors || [];\n };\n\n /**\n * Set the fill mode for the series.\n *\n * @param {Object} fill\n */\n Series.prototype.setFill = function(fill) {\n this._fill = typeof fill === 'undefined' ? null : fill;\n };\n\n /**\n * Set the labels for the values of the series.\n *\n * @param {String[]} labels the labels of the series values.\n */\n Series.prototype.setLabels = function(labels) {\n this._validateLabels(labels);\n labels = typeof labels === 'undefined' ? null : labels;\n this._labels = labels;\n };\n\n /**\n * Set Whether the line of the serie should be smooth or not.\n *\n * Only applicable for line chart or a line series, if null it assumes the chart default (not smooth).\n *\n * @param {Bool} smooth True if the lines should be smooth, false for tensioned lines.\n */\n Series.prototype.setSmooth = function(smooth) {\n smooth = typeof smooth === 'undefined' ? null : smooth;\n this._smooth = smooth;\n };\n\n /**\n * Set the type of the series.\n *\n * @param {String} type A type constant value.\n */\n Series.prototype.setType = function(type) {\n if (type != this.TYPE_DEFAULT && type != this.TYPE_LINE) {\n throw new Error('Invalid serie type.');\n }\n this._type = type || null;\n };\n\n /**\n * Set the index of the X axis.\n *\n * @param {Number} index The index.\n */\n Series.prototype.setXAxis = function(index) {\n this._xaxis = index || null;\n };\n\n\n /**\n * Set the index of the Y axis.\n *\n * @param {Number} index The index.\n */\n Series.prototype.setYAxis = function(index) {\n this._yaxis = index || null;\n };\n\n /**\n * Validate series labels.\n *\n * @protected\n * @param {String[]} labels The labels of the serie.\n */\n Series.prototype._validateLabels = function(labels) {\n if (labels && labels.length > 0 && labels.length != this.getCount()) {\n throw new Error('Series labels must match series values.');\n }\n };\n\n return Series;\n\n});\n"],"file":"chart_series.min.js"} \ No newline at end of file diff --git a/lib/amd/build/config.min.js.map b/lib/amd/build/config.min.js.map index f7a82a752399b..ffdbad9211df3 100644 --- a/lib/amd/build/config.min.js.map +++ b/lib/amd/build/config.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/config.js"],"names":["define","M","cfg"],"mappings":"AAwBAA,OAAM,eAAC,UAAW,CAGd,MAAwCC,CAAAA,CAAC,CAACC,GAC7C,CAJK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Expose the M.cfg global variable.\n *\n * @module core/config\n * @class config\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 2.9\n */\ndefine(function() {\n\n // This module exposes only the raw data from M.cfg;\n return /** @alias module:core/config */ M.cfg;\n});\n"],"file":"config.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/config.js"],"names":["define","M","cfg"],"mappings":"AAuBAA,OAAM,eAAC,UAAW,CAEd,MAAOC,CAAAA,CAAC,CAACC,GACZ,CAHK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Expose the M.cfg global variable.\n *\n * @module core/config\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 2.9\n */\ndefine(function() {\n // This module exposes only the raw data from M.cfg;\n return M.cfg;\n});\n"],"file":"config.min.js"} \ No newline at end of file diff --git a/lib/amd/build/custom_interaction_events.min.js.map b/lib/amd/build/custom_interaction_events.min.js.map index 6113e0086ad70..60d8611973c2f 100644 --- a/lib/amd/build/custom_interaction_events.min.js.map +++ b/lib/amd/build/custom_interaction_events.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/custom_interaction_events.js"],"names":["define","$","keyCodes","events","activate","keyboardActivate","escape","down","up","home","end","next","previous","asterix","scrollLock","scrollTop","scrollBottom","ctrlPageUp","ctrlPageDown","enter","accessibleChange","triggeredEvents","shouldAddEvent","eventType","include","length","indexOf","isModifierPressed","e","shiftKey","metaKey","altKey","ctrlKey","triggerEvent","eventName","eventTypeKey","hasOwnProperty","type","timeStamp","target","trigger","originalEvent","addKeyboardEvent","element","event","keyCode","off","on","addActivateListener","space","addKeyboardActivateListener","addEscapeListener","addDownListener","arrowDown","addUpListener","arrowUp","addHomeListener","addEndListener","addNextListener","attr","arrowLeft","arrowRight","addPreviousListener","addAsterixListener","addScrollTopListener","addScrollBottomListener","innerHeight","scrollHeight","addScrollLockListener","height","delta","detail","wheelDelta","stopPropagation","preventDefault","returnValue","addCtrlPageUpListener","pageUp","addCtrlPageDownListener","pageDown","addEnterListener","addAccessibleChangeListener","onMac","navigator","userAgent","touchEnabled","window","msMaxTouchPoints","setInitialValue","dataset","initValue","value","resetToInitialValue","checkAndTriggerAccessibleChange","nativeElement","get","addEventListener","which","ignoreChange","getHandlers","handlers","each","handler"],"mappings":"AAyBAA,OAAM,kCAAC,CAAC,QAAD,CAAW,gBAAX,CAAD,CAA+B,SAASC,CAAT,CAAYC,CAAZ,CAAsB,IAEnDC,CAAAA,CAAM,CAAG,CACTC,QAAQ,CAAE,cADD,CAETC,gBAAgB,CAAE,sBAFT,CAGTC,MAAM,CAAE,YAHC,CAITC,IAAI,CAAE,UAJG,CAKTC,EAAE,CAAE,QALK,CAMTC,IAAI,CAAE,UANG,CAOTC,GAAG,CAAE,SAPI,CAQTC,IAAI,CAAE,UARG,CASTC,QAAQ,CAAE,cATD,CAUTC,OAAO,CAAE,aAVA,CAWTC,UAAU,CAAE,gBAXH,CAYTC,SAAS,CAAE,eAZF,CAaTC,YAAY,CAAE,kBAbL,CAcTC,UAAU,CAAE,gBAdH,CAeTC,YAAY,CAAE,kBAfL,CAgBTC,KAAK,CAAE,WAhBE,CAiBTC,gBAAgB,CAAE,sBAjBT,CAF0C,CAwBnDC,CAAe,CAAG,EAxBiC,CAoCnDC,CAAc,CAAG,SAASC,CAAT,CAAoBC,CAApB,CAA6B,CAC9CA,CAAO,CAAGA,CAAO,EAAI,EAArB,CAEA,GAAIA,CAAO,CAACC,MAAR,EAAiD,CAAC,CAAhC,GAAAD,CAAO,CA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A9B,CACAwB,CAAQ,CAACjG,CAAM,CAACe,YAAR,CAAR,CAAgC4D,CAAhC,CACAsB,CAAQ,CAACjG,CAAM,CAACgB,KAAR,CAAR,CAAyB6D,CAAzB,CACAoB,CAAQ,CAACjG,CAAM,CAACiB,gBAAR,CAAR,CAAoC6D,CAApC,CAEA,MAAOmB,CAAAA,CACV,CA7gBsD,CAsiBvD,MAAqD,CACjDpG,MAAM,CAhBG,QAATA,CAAAA,MAAS,CAAS2C,CAAT,CAAkBnB,CAAlB,CAA2B,CACpCmB,CAAO,CAAG1C,CAAC,CAAC0C,CAAD,CAAX,CACAnB,CAAO,CAAGA,CAAO,EAAI,EAArB,CAEA,GAAI,CAACmB,CAAO,CAAClB,MAAT,EAAmB,CAACD,CAAO,CAACC,MAAhC,CAAwC,CACpC,MACH,CAEDxB,CAAC,CAACoG,IAAF,CAAOF,CAAW,EAAlB,CAAsB,SAAS5E,CAAT,CAAoB+E,CAApB,CAA6B,CAC/C,GAAIhF,CAAc,CAACC,CAAD,CAAYC,CAAZ,CAAlB,CAAwC,CACpC8E,CAAO,CAAC3D,CAAD,CACV,CACJ,CAJD,CAKH,CAEoD,CAEjDxC,MAAM,CAAEA,CAFyC,CAIxD,CA1iBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * This module provides a wrapper to encapsulate a lot of the common combinations of\n * user interaction we use in Moodle.\n *\n * @module core/custom_interaction_events\n * @class custom_interaction_events\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.2\n */\ndefine(['jquery', 'core/key_codes'], function($, keyCodes) {\n // The list of events provided by this module. Namespaced to avoid clashes.\n var events = {\n activate: 'cie:activate',\n keyboardActivate: 'cie:keyboardactivate',\n escape: 'cie:escape',\n down: 'cie:down',\n up: 'cie:up',\n home: 'cie:home',\n end: 'cie:end',\n next: 'cie:next',\n previous: 'cie:previous',\n asterix: 'cie:asterix',\n scrollLock: 'cie:scrollLock',\n scrollTop: 'cie:scrollTop',\n scrollBottom: 'cie:scrollBottom',\n ctrlPageUp: 'cie:ctrlPageUp',\n ctrlPageDown: 'cie:ctrlPageDown',\n enter: 'cie:enter',\n accessibleChange: 'cie:accessibleChange',\n };\n // Static cache of jQuery events that have been handled. This should\n // only be populated by JavaScript generated events (which will keep it\n // fairly small).\n var triggeredEvents = {};\n\n /**\n * Check if the caller has asked for the given event type to be\n * registered.\n *\n * @method shouldAddEvent\n * @private\n * @param {string} eventType name of the event (see events above)\n * @param {array} include the list of events to be added\n * @return {bool} true if the event should be added, false otherwise.\n */\n var shouldAddEvent = function(eventType, include) {\n include = include || [];\n\n if (include.length && include.indexOf(eventType) !== -1) {\n return true;\n }\n\n return false;\n };\n\n /**\n * Check if any of the modifier keys have been pressed on the event.\n *\n * @method isModifierPressed\n * @private\n * @param {event} e jQuery event\n * @return {bool} true if shift, meta (command on Mac), alt or ctrl are pressed\n */\n var isModifierPressed = function(e) {\n return (e.shiftKey || e.metaKey || e.altKey || e.ctrlKey);\n };\n\n /**\n * Trigger the custom event for the given jQuery event.\n *\n * This function will only fire the custom event if one hasn't already been\n * fired for the jQuery event.\n *\n * This is to prevent multiple custom event handlers triggering multiple\n * custom events for a single jQuery event as it bubbles up the stack.\n *\n * @param {string} eventName The name of the custom event\n * @param {event} e The jQuery event\n * @return {void}\n */\n var triggerEvent = function(eventName, e) {\n var eventTypeKey = \"\";\n\n if (!e.hasOwnProperty('originalEvent')) {\n // This is a jQuery event generated from JavaScript not a browser event so\n // we need to build the cache key for the event.\n eventTypeKey = \"\" + eventName + e.type + e.timeStamp;\n\n if (!triggeredEvents.hasOwnProperty(eventTypeKey)) {\n // If we haven't seen this jQuery event before then fire a custom\n // event for it and remember the event for later.\n triggeredEvents[eventTypeKey] = true;\n $(e.target).trigger(eventName, [{originalEvent: e}]);\n }\n return;\n }\n\n eventTypeKey = \"triggeredCustom_\" + eventName;\n if (!e.originalEvent.hasOwnProperty(eventTypeKey)) {\n // If this is a jQuery event generated by the browser then set a\n // property on the original event to track that we've seen it before.\n // The property is set on the original event because it's the only part\n // of the jQuery event that is maintained through multiple event handlers.\n e.originalEvent[eventTypeKey] = true;\n $(e.target).trigger(eventName, [{originalEvent: e}]);\n return;\n }\n };\n\n /**\n * Register a keyboard event that ignores modifier keys.\n *\n * @method addKeyboardEvent\n * @private\n * @param {object} element A jQuery object of the element to bind events to\n * @param {string} event The custom interaction event name\n * @param {int} keyCode The key code.\n */\n var addKeyboardEvent = function(element, event, keyCode) {\n element.off('keydown.' + event).on('keydown.' + event, function(e) {\n if (!isModifierPressed(e)) {\n if (e.keyCode == keyCode) {\n triggerEvent(event, e);\n }\n }\n });\n };\n\n /**\n * Trigger the activate event on the given element if it is clicked or the enter\n * or space key are pressed without a modifier key.\n *\n * @method addActivateListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addActivateListener = function(element) {\n element.off('click.cie.activate').on('click.cie.activate', function(e) {\n triggerEvent(events.activate, e);\n });\n element.off('keydown.cie.activate').on('keydown.cie.activate', function(e) {\n if (!isModifierPressed(e)) {\n if (e.keyCode == keyCodes.enter || e.keyCode == keyCodes.space) {\n triggerEvent(events.activate, e);\n }\n }\n });\n };\n\n /**\n * Trigger the keyboard activate event on the given element if the enter\n * or space key are pressed without a modifier key.\n *\n * @method addKeyboardActivateListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addKeyboardActivateListener = function(element) {\n element.off('keydown.cie.keyboardactivate').on('keydown.cie.keyboardactivate', function(e) {\n if (!isModifierPressed(e)) {\n if (e.keyCode == keyCodes.enter || e.keyCode == keyCodes.space) {\n triggerEvent(events.keyboardActivate, e);\n }\n }\n });\n };\n\n /**\n * Trigger the escape event on the given element if the escape key is pressed\n * without a modifier key.\n *\n * @method addEscapeListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addEscapeListener = function(element) {\n addKeyboardEvent(element, events.escape, keyCodes.escape);\n };\n\n /**\n * Trigger the down event on the given element if the down arrow key is pressed\n * without a modifier key.\n *\n * @method addDownListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addDownListener = function(element) {\n addKeyboardEvent(element, events.down, keyCodes.arrowDown);\n };\n\n /**\n * Trigger the up event on the given element if the up arrow key is pressed\n * without a modifier key.\n *\n * @method addUpListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addUpListener = function(element) {\n addKeyboardEvent(element, events.up, keyCodes.arrowUp);\n };\n\n /**\n * Trigger the home event on the given element if the home key is pressed\n * without a modifier key.\n *\n * @method addHomeListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addHomeListener = function(element) {\n addKeyboardEvent(element, events.home, keyCodes.home);\n };\n\n /**\n * Trigger the end event on the given element if the end key is pressed\n * without a modifier key.\n *\n * @method addEndListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addEndListener = function(element) {\n addKeyboardEvent(element, events.end, keyCodes.end);\n };\n\n /**\n * Trigger the next event on the given element if the right arrow key is pressed\n * without a modifier key in LTR mode or left arrow key in RTL mode.\n *\n * @method addNextListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addNextListener = function(element) {\n // Left and right are flipped in RTL mode.\n var keyCode = $('html').attr('dir') == \"rtl\" ? keyCodes.arrowLeft : keyCodes.arrowRight;\n\n addKeyboardEvent(element, events.next, keyCode);\n };\n\n /**\n * Trigger the previous event on the given element if the left arrow key is pressed\n * without a modifier key in LTR mode or right arrow key in RTL mode.\n *\n * @method addPreviousListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addPreviousListener = function(element) {\n // Left and right are flipped in RTL mode.\n var keyCode = $('html').attr('dir') == \"rtl\" ? keyCodes.arrowRight : keyCodes.arrowLeft;\n\n addKeyboardEvent(element, events.previous, keyCode);\n };\n\n /**\n * Trigger the asterix event on the given element if the asterix key is pressed\n * without a modifier key.\n *\n * @method addAsterixListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addAsterixListener = function(element) {\n addKeyboardEvent(element, events.asterix, keyCodes.asterix);\n };\n\n\n /**\n * Trigger the scrollTop event on the given element if the user scrolls to\n * the top of the given element.\n *\n * @method addScrollTopListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addScrollTopListener = function(element) {\n element.off('scroll.cie.scrollTop').on('scroll.cie.scrollTop', function(e) {\n var scrollTop = element.scrollTop();\n if (scrollTop === 0) {\n triggerEvent(events.scrollTop, e);\n }\n });\n };\n\n /**\n * Trigger the scrollBottom event on the given element if the user scrolls to\n * the bottom of the given element.\n *\n * @method addScrollBottomListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addScrollBottomListener = function(element) {\n element.off('scroll.cie.scrollBottom').on('scroll.cie.scrollBottom', function(e) {\n var scrollTop = element.scrollTop();\n var innerHeight = element.innerHeight();\n var scrollHeight = element[0].scrollHeight;\n\n if (scrollTop + innerHeight >= scrollHeight) {\n triggerEvent(events.scrollBottom, e);\n }\n });\n };\n\n /**\n * Trigger the scrollLock event on the given element if the user scrolls to\n * the bottom or top of the given element.\n *\n * @method addScrollLockListener\n * @private\n * @param {jQuery} element jQuery object to add event listeners to\n */\n var addScrollLockListener = function(element) {\n // Lock mousewheel scrolling within the element to stop the annoying window scroll.\n element.off('DOMMouseScroll.cie.DOMMouseScrollLock mousewheel.cie.mousewheelLock')\n .on('DOMMouseScroll.cie.DOMMouseScrollLock mousewheel.cie.mousewheelLock', function(e) {\n var scrollTop = element.scrollTop();\n var scrollHeight = element[0].scrollHeight;\n var height = element.height();\n var delta = (e.type == 'DOMMouseScroll' ?\n e.originalEvent.detail * -40 :\n e.originalEvent.wheelDelta);\n var up = delta > 0;\n\n if (!up && -delta > scrollHeight - height - scrollTop) {\n // Scrolling down past the bottom.\n element.scrollTop(scrollHeight);\n e.stopPropagation();\n e.preventDefault();\n e.returnValue = false;\n // Fire the scroll lock event.\n triggerEvent(events.scrollLock, e);\n\n return false;\n } else if (up && delta > scrollTop) {\n // Scrolling up past the top.\n element.scrollTop(0);\n e.stopPropagation();\n e.preventDefault();\n e.returnValue = false;\n // Fire the scroll lock event.\n triggerEvent(events.scrollLock, e);\n\n return false;\n }\n\n return true;\n });\n };\n\n /**\n * Trigger the ctrlPageUp event on the given element if the user presses the\n * control and page up key.\n *\n * @method addCtrlPageUpListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addCtrlPageUpListener = function(element) {\n element.off('keydown.cie.ctrlpageup').on('keydown.cie.ctrlpageup', function(e) {\n if (e.ctrlKey) {\n if (e.keyCode == keyCodes.pageUp) {\n triggerEvent(events.ctrlPageUp, e);\n }\n }\n });\n };\n\n /**\n * Trigger the ctrlPageDown event on the given element if the user presses the\n * control and page down key.\n *\n * @method addCtrlPageDownListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addCtrlPageDownListener = function(element) {\n element.off('keydown.cie.ctrlpagedown').on('keydown.cie.ctrlpagedown', function(e) {\n if (e.ctrlKey) {\n if (e.keyCode == keyCodes.pageDown) {\n triggerEvent(events.ctrlPageDown, e);\n }\n }\n });\n };\n\n /**\n * Trigger the enter event on the given element if the enter key is pressed\n * without a modifier key.\n *\n * @method addEnterListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addEnterListener = function(element) {\n addKeyboardEvent(element, events.enter, keyCodes.enter);\n };\n\n /**\n * Trigger the AccessibleChange event on the given element if the value of the element is changed.\n *\n * @method addAccessibleChangeListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addAccessibleChangeListener = function(element) {\n var onMac = navigator.userAgent.indexOf('Macintosh') !== -1;\n var touchEnabled = ('ontouchstart' in window) || (('msMaxTouchPoints' in navigator) && (navigator.msMaxTouchPoints > 0));\n if (onMac || touchEnabled) {\n // On Mac devices, and touch-enabled devices, the change event seems to be handled correctly and\n // consistently at this time.\n element.on('change', function(e) {\n triggerEvent(events.accessibleChange, e);\n });\n } else {\n // Some browsers have non-normalised behaviour for handling the selection of values in a boxes as a single-select,\n // and make use of a dropdown of action links like the Bootstrap Dropdown menu.\n var setInitialValue = function(target) {\n target.dataset.initValue = target.value;\n };\n var resetToInitialValue = function(target) {\n if ('initValue' in target.dataset) {\n target.value = target.dataset.initValue;\n }\n };\n var checkAndTriggerAccessibleChange = function(e) {\n if (!('initValue' in e.target.dataset)) {\n // Some browsers trigger click before focus, therefore it is possible that initValue is undefined.\n // In this case it's likely that it's being focused for the first time and we should therefore not submit.\n return;\n }\n\n if (e.target.value !== e.target.dataset.initValue) {\n // Update the initValue when the event is triggered.\n // This means that if the click handler fires before the focus handler on a subsequent interaction\n // with the element, the currently dispalyed value will be the best guess current value.\n e.target.dataset.initValue = e.target.value;\n triggerEvent(events.accessibleChange, e);\n }\n };\n var nativeElement = element.get()[0];\n // The `focus` and `blur` events do not support bubbling. Use Event Capture instead.\n nativeElement.addEventListener('focus', function(e) {\n setInitialValue(e.target);\n }, true);\n nativeElement.addEventListener('blur', function(e) {\n checkAndTriggerAccessibleChange(e);\n }, true);\n element.on('keydown', function(e) {\n if ((e.which === keyCodes.enter)) {\n checkAndTriggerAccessibleChange(e);\n } else if (e.which === keyCodes.escape) {\n resetToInitialValue(e.target);\n e.target.dataset.ignoreChange = true;\n } else {\n // Firefox triggers a change event when using the keyboard to scroll through the selection.\n // Set a data- attribute that the change listener can use to ignore the change event where it was\n // generated from a keyboard change such as typing to complete a value, or using arrow keys.\n e.target.dataset.ignoreChange = true;\n\n }\n });\n element.on('change', function(e) {\n if (e.target.dataset.ignoreChange) {\n // This change event was triggered from a keyboard change which is not yet complete.\n // Do not trigger the accessibleChange event until the selection is completed using the [return]\n // key.\n return;\n }\n\n checkAndTriggerAccessibleChange(e);\n });\n element.on('keyup', function(e) {\n // The key has been lifted. Stop ignoring the change event.\n delete e.target.dataset.ignoreChange;\n });\n element.on('click', function(e) {\n checkAndTriggerAccessibleChange(e);\n });\n }\n };\n\n /**\n * Get the list of events and their handlers.\n *\n * @method getHandlers\n * @private\n * @return {object} object key of event names and value of handler functions\n */\n var getHandlers = function() {\n var handlers = {};\n\n handlers[events.activate] = addActivateListener;\n handlers[events.keyboardActivate] = addKeyboardActivateListener;\n handlers[events.escape] = addEscapeListener;\n handlers[events.down] = addDownListener;\n handlers[events.up] = addUpListener;\n handlers[events.home] = addHomeListener;\n handlers[events.end] = addEndListener;\n handlers[events.next] = addNextListener;\n handlers[events.previous] = addPreviousListener;\n handlers[events.asterix] = addAsterixListener;\n handlers[events.scrollLock] = addScrollLockListener;\n handlers[events.scrollTop] = addScrollTopListener;\n handlers[events.scrollBottom] = addScrollBottomListener;\n handlers[events.ctrlPageUp] = addCtrlPageUpListener;\n handlers[events.ctrlPageDown] = addCtrlPageDownListener;\n handlers[events.enter] = addEnterListener;\n handlers[events.accessibleChange] = addAccessibleChangeListener;\n\n return handlers;\n };\n\n /**\n * Add all of the listeners on the given element for the requested events.\n *\n * @method define\n * @public\n * @param {object} element the DOM element to register event listeners on\n * @param {array} include the array of events to be triggered\n */\n var define = function(element, include) {\n element = $(element);\n include = include || [];\n\n if (!element.length || !include.length) {\n return;\n }\n\n $.each(getHandlers(), function(eventType, handler) {\n if (shouldAddEvent(eventType, include)) {\n handler(element);\n }\n });\n };\n\n return /** @module core/custom_interaction_events */ {\n define: define,\n events: events,\n };\n});\n"],"file":"custom_interaction_events.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/custom_interaction_events.js"],"names":["define","$","keyCodes","events","activate","keyboardActivate","escape","down","up","home","end","next","previous","asterix","scrollLock","scrollTop","scrollBottom","ctrlPageUp","ctrlPageDown","enter","accessibleChange","triggeredEvents","shouldAddEvent","eventType","include","length","indexOf","isModifierPressed","e","shiftKey","metaKey","altKey","ctrlKey","triggerEvent","eventName","eventTypeKey","hasOwnProperty","type","timeStamp","target","trigger","originalEvent","addKeyboardEvent","element","event","keyCode","off","on","addActivateListener","space","addKeyboardActivateListener","addEscapeListener","addDownListener","arrowDown","addUpListener","arrowUp","addHomeListener","addEndListener","addNextListener","attr","arrowLeft","arrowRight","addPreviousListener","addAsterixListener","addScrollTopListener","addScrollBottomListener","innerHeight","scrollHeight","addScrollLockListener","height","delta","detail","wheelDelta","stopPropagation","preventDefault","returnValue","addCtrlPageUpListener","pageUp","addCtrlPageDownListener","pageDown","addEnterListener","addAccessibleChangeListener","onMac","navigator","userAgent","touchEnabled","window","msMaxTouchPoints","setInitialValue","dataset","initValue","value","resetToInitialValue","checkAndTriggerAccessibleChange","nativeElement","get","addEventListener","which","ignoreChange","getHandlers","handlers","each","handler"],"mappings":"AAwBAA,OAAM,kCAAC,CAAC,QAAD,CAAW,gBAAX,CAAD,CAA+B,SAASC,CAAT,CAAYC,CAAZ,CAAsB,IAEnDC,CAAAA,CAAM,CAAG,CACTC,QAAQ,CAAE,cADD,CAETC,gBAAgB,CAAE,sBAFT,CAGTC,MAAM,CAAE,YAHC,CAITC,IAAI,CAAE,UAJG,CAKTC,EAAE,CAAE,QALK,CAMTC,IAAI,CAAE,UANG,CAOTC,GAAG,CAAE,SAPI,CAQTC,IAAI,CAAE,UARG,CASTC,QAAQ,CAAE,cATD,CAUTC,OAAO,CAAE,aAVA,CAWTC,UAAU,CAAE,gBAXH,CAYTC,SAAS,CAAE,eAZF,CAaTC,YAAY,CAAE,kBAbL,CAcTC,UAAU,CAAE,gBAdH,CAeTC,YAAY,CAAE,kBAfL,CAgBTC,KAAK,CAAE,WAhBE,CAiBTC,gBAAgB,CAAE,sBAjBT,CAF0C,CAwBnDC,CAAe,CAAG,EAxBiC,CAoCnDC,CAAc,CAAG,SAASC,CAAT,CAAoBC,CAApB,CAA6B,CAC9CA,CAAO,CA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ACa,YAAR,CAAR,CAAgCiD,CAAhC,CACAmC,CAAQ,CAACjG,CAAM,CAACc,UAAR,CAAR,CAA8B2D,CAA9B,CACAwB,CAAQ,CAACjG,CAAM,CAACe,YAAR,CAAR,CAAgC4D,CAAhC,CACAsB,CAAQ,CAACjG,CAAM,CAACgB,KAAR,CAAR,CAAyB6D,CAAzB,CACAoB,CAAQ,CAACjG,CAAM,CAACiB,gBAAR,CAAR,CAAoC6D,CAApC,CAEA,MAAOmB,CAAAA,CACV,CA7gBsD,CAsiBvD,MAAO,CACHpG,MAAM,CAhBG,QAATA,CAAAA,MAAS,CAAS2C,CAAT,CAAkBnB,CAAlB,CAA2B,CACpCmB,CAAO,CAAG1C,CAAC,CAAC0C,CAAD,CAAX,CACAnB,CAAO,CAAGA,CAAO,EAAI,EAArB,CAEA,GAAI,CAACmB,CAAO,CAAClB,MAAT,EAAmB,CAACD,CAAO,CAACC,MAAhC,CAAwC,CACpC,MACH,CAEDxB,CAAC,CAACoG,IAAF,CAAOF,CAAW,EAAlB,CAAsB,SAAS5E,CAAT,CAAoB+E,CAApB,CAA6B,CAC/C,GAAIhF,CAAc,CAACC,CAAD,CAAYC,CAAZ,CAAlB,CAAwC,CACpC8E,CAAO,CAAC3D,CAAD,CACV,CACJ,CAJD,CAKH,CAEM,CAEHxC,MAAM,CAAEA,CAFL,CAIV,CA1iBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * This module provides a wrapper to encapsulate a lot of the common combinations of\n * user interaction we use in Moodle.\n *\n * @module core/custom_interaction_events\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.2\n */\ndefine(['jquery', 'core/key_codes'], function($, keyCodes) {\n // The list of events provided by this module. Namespaced to avoid clashes.\n var events = {\n activate: 'cie:activate',\n keyboardActivate: 'cie:keyboardactivate',\n escape: 'cie:escape',\n down: 'cie:down',\n up: 'cie:up',\n home: 'cie:home',\n end: 'cie:end',\n next: 'cie:next',\n previous: 'cie:previous',\n asterix: 'cie:asterix',\n scrollLock: 'cie:scrollLock',\n scrollTop: 'cie:scrollTop',\n scrollBottom: 'cie:scrollBottom',\n ctrlPageUp: 'cie:ctrlPageUp',\n ctrlPageDown: 'cie:ctrlPageDown',\n enter: 'cie:enter',\n accessibleChange: 'cie:accessibleChange',\n };\n // Static cache of jQuery events that have been handled. This should\n // only be populated by JavaScript generated events (which will keep it\n // fairly small).\n var triggeredEvents = {};\n\n /**\n * Check if the caller has asked for the given event type to be\n * registered.\n *\n * @method shouldAddEvent\n * @private\n * @param {string} eventType name of the event (see events above)\n * @param {array} include the list of events to be added\n * @return {bool} true if the event should be added, false otherwise.\n */\n var shouldAddEvent = function(eventType, include) {\n include = include || [];\n\n if (include.length && include.indexOf(eventType) !== -1) {\n return true;\n }\n\n return false;\n };\n\n /**\n * Check if any of the modifier keys have been pressed on the event.\n *\n * @method isModifierPressed\n * @private\n * @param {event} e jQuery event\n * @return {bool} true if shift, meta (command on Mac), alt or ctrl are pressed\n */\n var isModifierPressed = function(e) {\n return (e.shiftKey || e.metaKey || e.altKey || e.ctrlKey);\n };\n\n /**\n * Trigger the custom event for the given jQuery event.\n *\n * This function will only fire the custom event if one hasn't already been\n * fired for the jQuery event.\n *\n * This is to prevent multiple custom event handlers triggering multiple\n * custom events for a single jQuery event as it bubbles up the stack.\n *\n * @param {string} eventName The name of the custom event\n * @param {event} e The jQuery event\n * @return {void}\n */\n var triggerEvent = function(eventName, e) {\n var eventTypeKey = \"\";\n\n if (!e.hasOwnProperty('originalEvent')) {\n // This is a jQuery event generated from JavaScript not a browser event so\n // we need to build the cache key for the event.\n eventTypeKey = \"\" + eventName + e.type + e.timeStamp;\n\n if (!triggeredEvents.hasOwnProperty(eventTypeKey)) {\n // If we haven't seen this jQuery event before then fire a custom\n // event for it and remember the event for later.\n triggeredEvents[eventTypeKey] = true;\n $(e.target).trigger(eventName, [{originalEvent: e}]);\n }\n return;\n }\n\n eventTypeKey = \"triggeredCustom_\" + eventName;\n if (!e.originalEvent.hasOwnProperty(eventTypeKey)) {\n // If this is a jQuery event generated by the browser then set a\n // property on the original event to track that we've seen it before.\n // The property is set on the original event because it's the only part\n // of the jQuery event that is maintained through multiple event handlers.\n e.originalEvent[eventTypeKey] = true;\n $(e.target).trigger(eventName, [{originalEvent: e}]);\n return;\n }\n };\n\n /**\n * Register a keyboard event that ignores modifier keys.\n *\n * @method addKeyboardEvent\n * @private\n * @param {object} element A jQuery object of the element to bind events to\n * @param {string} event The custom interaction event name\n * @param {int} keyCode The key code.\n */\n var addKeyboardEvent = function(element, event, keyCode) {\n element.off('keydown.' + event).on('keydown.' + event, function(e) {\n if (!isModifierPressed(e)) {\n if (e.keyCode == keyCode) {\n triggerEvent(event, e);\n }\n }\n });\n };\n\n /**\n * Trigger the activate event on the given element if it is clicked or the enter\n * or space key are pressed without a modifier key.\n *\n * @method addActivateListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addActivateListener = function(element) {\n element.off('click.cie.activate').on('click.cie.activate', function(e) {\n triggerEvent(events.activate, e);\n });\n element.off('keydown.cie.activate').on('keydown.cie.activate', function(e) {\n if (!isModifierPressed(e)) {\n if (e.keyCode == keyCodes.enter || e.keyCode == keyCodes.space) {\n triggerEvent(events.activate, e);\n }\n }\n });\n };\n\n /**\n * Trigger the keyboard activate event on the given element if the enter\n * or space key are pressed without a modifier key.\n *\n * @method addKeyboardActivateListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addKeyboardActivateListener = function(element) {\n element.off('keydown.cie.keyboardactivate').on('keydown.cie.keyboardactivate', function(e) {\n if (!isModifierPressed(e)) {\n if (e.keyCode == keyCodes.enter || e.keyCode == keyCodes.space) {\n triggerEvent(events.keyboardActivate, e);\n }\n }\n });\n };\n\n /**\n * Trigger the escape event on the given element if the escape key is pressed\n * without a modifier key.\n *\n * @method addEscapeListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addEscapeListener = function(element) {\n addKeyboardEvent(element, events.escape, keyCodes.escape);\n };\n\n /**\n * Trigger the down event on the given element if the down arrow key is pressed\n * without a modifier key.\n *\n * @method addDownListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addDownListener = function(element) {\n addKeyboardEvent(element, events.down, keyCodes.arrowDown);\n };\n\n /**\n * Trigger the up event on the given element if the up arrow key is pressed\n * without a modifier key.\n *\n * @method addUpListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addUpListener = function(element) {\n addKeyboardEvent(element, events.up, keyCodes.arrowUp);\n };\n\n /**\n * Trigger the home event on the given element if the home key is pressed\n * without a modifier key.\n *\n * @method addHomeListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addHomeListener = function(element) {\n addKeyboardEvent(element, events.home, keyCodes.home);\n };\n\n /**\n * Trigger the end event on the given element if the end key is pressed\n * without a modifier key.\n *\n * @method addEndListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addEndListener = function(element) {\n addKeyboardEvent(element, events.end, keyCodes.end);\n };\n\n /**\n * Trigger the next event on the given element if the right arrow key is pressed\n * without a modifier key in LTR mode or left arrow key in RTL mode.\n *\n * @method addNextListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addNextListener = function(element) {\n // Left and right are flipped in RTL mode.\n var keyCode = $('html').attr('dir') == \"rtl\" ? keyCodes.arrowLeft : keyCodes.arrowRight;\n\n addKeyboardEvent(element, events.next, keyCode);\n };\n\n /**\n * Trigger the previous event on the given element if the left arrow key is pressed\n * without a modifier key in LTR mode or right arrow key in RTL mode.\n *\n * @method addPreviousListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addPreviousListener = function(element) {\n // Left and right are flipped in RTL mode.\n var keyCode = $('html').attr('dir') == \"rtl\" ? keyCodes.arrowRight : keyCodes.arrowLeft;\n\n addKeyboardEvent(element, events.previous, keyCode);\n };\n\n /**\n * Trigger the asterix event on the given element if the asterix key is pressed\n * without a modifier key.\n *\n * @method addAsterixListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addAsterixListener = function(element) {\n addKeyboardEvent(element, events.asterix, keyCodes.asterix);\n };\n\n\n /**\n * Trigger the scrollTop event on the given element if the user scrolls to\n * the top of the given element.\n *\n * @method addScrollTopListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addScrollTopListener = function(element) {\n element.off('scroll.cie.scrollTop').on('scroll.cie.scrollTop', function(e) {\n var scrollTop = element.scrollTop();\n if (scrollTop === 0) {\n triggerEvent(events.scrollTop, e);\n }\n });\n };\n\n /**\n * Trigger the scrollBottom event on the given element if the user scrolls to\n * the bottom of the given element.\n *\n * @method addScrollBottomListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addScrollBottomListener = function(element) {\n element.off('scroll.cie.scrollBottom').on('scroll.cie.scrollBottom', function(e) {\n var scrollTop = element.scrollTop();\n var innerHeight = element.innerHeight();\n var scrollHeight = element[0].scrollHeight;\n\n if (scrollTop + innerHeight >= scrollHeight) {\n triggerEvent(events.scrollBottom, e);\n }\n });\n };\n\n /**\n * Trigger the scrollLock event on the given element if the user scrolls to\n * the bottom or top of the given element.\n *\n * @method addScrollLockListener\n * @private\n * @param {jQuery} element jQuery object to add event listeners to\n */\n var addScrollLockListener = function(element) {\n // Lock mousewheel scrolling within the element to stop the annoying window scroll.\n element.off('DOMMouseScroll.cie.DOMMouseScrollLock mousewheel.cie.mousewheelLock')\n .on('DOMMouseScroll.cie.DOMMouseScrollLock mousewheel.cie.mousewheelLock', function(e) {\n var scrollTop = element.scrollTop();\n var scrollHeight = element[0].scrollHeight;\n var height = element.height();\n var delta = (e.type == 'DOMMouseScroll' ?\n e.originalEvent.detail * -40 :\n e.originalEvent.wheelDelta);\n var up = delta > 0;\n\n if (!up && -delta > scrollHeight - height - scrollTop) {\n // Scrolling down past the bottom.\n element.scrollTop(scrollHeight);\n e.stopPropagation();\n e.preventDefault();\n e.returnValue = false;\n // Fire the scroll lock event.\n triggerEvent(events.scrollLock, e);\n\n return false;\n } else if (up && delta > scrollTop) {\n // Scrolling up past the top.\n element.scrollTop(0);\n e.stopPropagation();\n e.preventDefault();\n e.returnValue = false;\n // Fire the scroll lock event.\n triggerEvent(events.scrollLock, e);\n\n return false;\n }\n\n return true;\n });\n };\n\n /**\n * Trigger the ctrlPageUp event on the given element if the user presses the\n * control and page up key.\n *\n * @method addCtrlPageUpListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addCtrlPageUpListener = function(element) {\n element.off('keydown.cie.ctrlpageup').on('keydown.cie.ctrlpageup', function(e) {\n if (e.ctrlKey) {\n if (e.keyCode == keyCodes.pageUp) {\n triggerEvent(events.ctrlPageUp, e);\n }\n }\n });\n };\n\n /**\n * Trigger the ctrlPageDown event on the given element if the user presses the\n * control and page down key.\n *\n * @method addCtrlPageDownListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addCtrlPageDownListener = function(element) {\n element.off('keydown.cie.ctrlpagedown').on('keydown.cie.ctrlpagedown', function(e) {\n if (e.ctrlKey) {\n if (e.keyCode == keyCodes.pageDown) {\n triggerEvent(events.ctrlPageDown, e);\n }\n }\n });\n };\n\n /**\n * Trigger the enter event on the given element if the enter key is pressed\n * without a modifier key.\n *\n * @method addEnterListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addEnterListener = function(element) {\n addKeyboardEvent(element, events.enter, keyCodes.enter);\n };\n\n /**\n * Trigger the AccessibleChange event on the given element if the value of the element is changed.\n *\n * @method addAccessibleChangeListener\n * @private\n * @param {object} element jQuery object to add event listeners to\n */\n var addAccessibleChangeListener = function(element) {\n var onMac = navigator.userAgent.indexOf('Macintosh') !== -1;\n var touchEnabled = ('ontouchstart' in window) || (('msMaxTouchPoints' in navigator) && (navigator.msMaxTouchPoints > 0));\n if (onMac || touchEnabled) {\n // On Mac devices, and touch-enabled devices, the change event seems to be handled correctly and\n // consistently at this time.\n element.on('change', function(e) {\n triggerEvent(events.accessibleChange, e);\n });\n } else {\n // Some browsers have non-normalised behaviour for handling the selection of values in a boxes as a single-select,\n // and make use of a dropdown of action links like the Bootstrap Dropdown menu.\n var setInitialValue = function(target) {\n target.dataset.initValue = target.value;\n };\n var resetToInitialValue = function(target) {\n if ('initValue' in target.dataset) {\n target.value = target.dataset.initValue;\n }\n };\n var checkAndTriggerAccessibleChange = function(e) {\n if (!('initValue' in e.target.dataset)) {\n // Some browsers trigger click before focus, therefore it is possible that initValue is undefined.\n // In this case it's likely that it's being focused for the first time and we should therefore not submit.\n return;\n }\n\n if (e.target.value !== e.target.dataset.initValue) {\n // Update the initValue when the event is triggered.\n // This means that if the click handler fires before the focus handler on a subsequent interaction\n // with the element, the currently dispalyed value will be the best guess current value.\n e.target.dataset.initValue = e.target.value;\n triggerEvent(events.accessibleChange, e);\n }\n };\n var nativeElement = element.get()[0];\n // The `focus` and `blur` events do not support bubbling. Use Event Capture instead.\n nativeElement.addEventListener('focus', function(e) {\n setInitialValue(e.target);\n }, true);\n nativeElement.addEventListener('blur', function(e) {\n checkAndTriggerAccessibleChange(e);\n }, true);\n element.on('keydown', function(e) {\n if ((e.which === keyCodes.enter)) {\n checkAndTriggerAccessibleChange(e);\n } else if (e.which === keyCodes.escape) {\n resetToInitialValue(e.target);\n e.target.dataset.ignoreChange = true;\n } else {\n // Firefox triggers a change event when using the keyboard to scroll through the selection.\n // Set a data- attribute that the change listener can use to ignore the change event where it was\n // generated from a keyboard change such as typing to complete a value, or using arrow keys.\n e.target.dataset.ignoreChange = true;\n\n }\n });\n element.on('change', function(e) {\n if (e.target.dataset.ignoreChange) {\n // This change event was triggered from a keyboard change which is not yet complete.\n // Do not trigger the accessibleChange event until the selection is completed using the [return]\n // key.\n return;\n }\n\n checkAndTriggerAccessibleChange(e);\n });\n element.on('keyup', function(e) {\n // The key has been lifted. Stop ignoring the change event.\n delete e.target.dataset.ignoreChange;\n });\n element.on('click', function(e) {\n checkAndTriggerAccessibleChange(e);\n });\n }\n };\n\n /**\n * Get the list of events and their handlers.\n *\n * @method getHandlers\n * @private\n * @return {object} object key of event names and value of handler functions\n */\n var getHandlers = function() {\n var handlers = {};\n\n handlers[events.activate] = addActivateListener;\n handlers[events.keyboardActivate] = addKeyboardActivateListener;\n handlers[events.escape] = addEscapeListener;\n handlers[events.down] = addDownListener;\n handlers[events.up] = addUpListener;\n handlers[events.home] = addHomeListener;\n handlers[events.end] = addEndListener;\n handlers[events.next] = addNextListener;\n handlers[events.previous] = addPreviousListener;\n handlers[events.asterix] = addAsterixListener;\n handlers[events.scrollLock] = addScrollLockListener;\n handlers[events.scrollTop] = addScrollTopListener;\n handlers[events.scrollBottom] = addScrollBottomListener;\n handlers[events.ctrlPageUp] = addCtrlPageUpListener;\n handlers[events.ctrlPageDown] = addCtrlPageDownListener;\n handlers[events.enter] = addEnterListener;\n handlers[events.accessibleChange] = addAccessibleChangeListener;\n\n return handlers;\n };\n\n /**\n * Add all of the listeners on the given element for the requested events.\n *\n * @method define\n * @public\n * @param {object} element the DOM element to register event listeners on\n * @param {array} include the array of events to be triggered\n */\n var define = function(element, include) {\n element = $(element);\n include = include || [];\n\n if (!element.length || !include.length) {\n return;\n }\n\n $.each(getHandlers(), function(eventType, handler) {\n if (shouldAddEvent(eventType, include)) {\n handler(element);\n }\n });\n };\n\n return {\n define: define,\n events: events,\n };\n});\n"],"file":"custom_interaction_events.min.js"} \ No newline at end of file diff --git a/lib/amd/build/dragdrop.min.js.map b/lib/amd/build/dragdrop.min.js.map index 31ecb4a9f94ab..d93eb51e89f38 100644 --- a/lib/amd/build/dragdrop.min.js.map +++ b/lib/amd/build/dragdrop.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/dragdrop.js"],"names":["define","$","autoScroll","dragdrop","eventCaptureOptions","passive","capture","dragProxy","onMove","onDrop","initialPosition","initialX","initialY","touching","prepare","event","preventDefault","start","type","changedTouches","length","which","details","getEventXY","xy","x","y","offset","addEventSpecial","mouseMove","mouseUp","touchEnd","touchMove","identifier","Error","scroll","handler","window","addEventListener","ex","pageX","pageY","e","i","handleMove","current","topOffset","top","parseInt","css","leftOffset","left","maxY","document","height","outerHeight","maxX","width","outerWidth","initial","position","Math","max","min","handleEnd","removeEventListener","stop","currentPosition"],"mappings":"AA4BAA,OAAM,iBAAC,CAAC,QAAD,CAAW,iBAAX,CAAD,CAAgC,SAASC,CAAT,CAAYC,CAAZ,CAAwB,CAI1D,GAAIC,CAAAA,CAAQ,CAAG,CAKXC,mBAAmB,CAAE,CAACC,OAAO,GAAR,CAAiBC,OAAO,GAAxB,CALV,CAWXC,SAAS,CAAE,IAXA,CAiBXC,MAAM,CAAE,IAjBG,CAuBXC,MAAM,CAAE,IAvBG,CA4BXC,eAAe,CAAE,IA5BN,CAiCXC,QAAQ,CAAE,IAjCC,CAsCXC,QAAQ,CAAE,IAtCC,CA2CXC,QAAQ,CAAE,IA3CC,CAwDXC,OAAO,CAAE,iBAASC,CAAT,CAAgB,CACrBA,CAAK,CAACC,cAAN,GACA,GAAIC,CAAAA,CAAJ,CACA,GAAmB,YAAf,GAAAF,CAAK,CAACG,IAAV,CAAiC,CAG7BD,CAAK,CAA0B,IAAtB,GAAAd,CAAQ,CAACU,QAAV,EAA8D,CAA9B,CAAAE,CAAK,CAACI,cAAN,CAAqBC,MAChE,CAJD,IAIO,CAEHH,CAAK,CAAmB,CAAhB,GAAAF,CAAK,CAACM,KACjB,CACD,GAAIJ,CAAJ,CAAW,CACP,GAAIK,CAAAA,CAAO,CAAGnB,CAAQ,CAACoB,UAAT,CAAoBR,CAApB,CAAd,CACAO,CAAO,CAACL,KA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C,mBAArE,EACAD,CAAQ,CAACU,QAAT,CAAoB,IACvB,CALD,IAKO,CACHwB,MAAM,CAAC4B,mBAAP,CAA2B,WAA3B,CAAwC9D,CAAQ,CAAC0B,SAAjD,CAA4D1B,CAAQ,CAACC,mBAArE,EACAiC,MAAM,CAAC4B,mBAAP,CAA2B,SAA3B,CAAsC9D,CAAQ,CAAC2B,OAA/C,CAAwD3B,CAAQ,CAACC,mBAAjE,CACH,CACDF,CAAU,CAACgE,IAAX,GACA/D,CAAQ,CAACM,MAAT,CAAgB+B,CAAhB,CAAuBC,CAAvB,CAA8BtC,CAAQ,CAACI,SAAvC,CACH,CA/PU,CAuQX4B,MAAM,CAAE,gBAASR,CAAT,CAAiB,IAEjByB,CAAAA,CAAI,CAAGnD,CAAC,CAACoD,QAAD,CAAD,CAAYC,MAAZ,GAAuBnD,CAAQ,CAACI,SAAT,CAAmBgD,WAAnB,EAFb,CAGjBY,CAAe,CAAGhE,CAAQ,CAACI,SAAT,CAAmBoB,MAAnB,EAHD,CAIrBwC,CAAe,CAACpB,GAAhB,CAAsBc,IAAI,CAACE,GAAL,CAASX,CAAT,CAAee,CAAe,CAACpB,GAAhB,CAAsBpB,CAArC,CAAtB,CACAxB,CAAQ,CAACI,SAAT,CAAmB0C,GAAnB,CAAuBkB,CAAvB,CACH,CA7QU,CAAf,CAgRA,MAAO,CAWHrD,OAAO,CAAEX,CAAQ,CAACW,OAXf,CAgCHG,KAAK,CAAEd,CAAQ,CAACc,KAhCb,CAkCV,CAtTK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/*\n * JavaScript to handle drag operations, including automatic scrolling.\n *\n * Note: this module is defined statically. It is a singleton. You\n * can only have one use of it active at any time. However, you\n * can only drag one thing at a time, this is not a problem in practice.\n *\n * @module core/dragdrop\n * @class dragdrop\n * @copyright 2016 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.6\n */\ndefine(['jquery', 'core/autoscroll'], function($, autoScroll) {\n /**\n * @alias module:core/dragdrop\n */\n var dragdrop = {\n /**\n * A boolean or options argument depending on whether browser supports passive events.\n * @private\n */\n eventCaptureOptions: {passive: false, capture: true},\n\n /**\n * Drag proxy if any.\n * @private\n */\n dragProxy: null,\n\n /**\n * Function called on move.\n * @private\n */\n onMove: null,\n\n /**\n * Function called on drop.\n * @private\n */\n onDrop: null,\n\n /**\n * Initial position of proxy at drag start.\n */\n initialPosition: null,\n\n /**\n * Initial page X of cursor at drag start.\n */\n initialX: null,\n\n /**\n * Initial page Y of cursor at drag start.\n */\n initialY: null,\n\n /**\n * If touch event is in progress, this will be the id, otherwise null\n */\n touching: null,\n\n /**\n * Prepares to begin a drag operation - call with a mousedown or touchstart event.\n *\n * If the returned object has 'start' true, then you can set up a drag proxy, and call\n * start. This function will call preventDefault automatically regardless of whether\n * starting or not.\n *\n * @public\n * @param {Object} event Event (should be either mousedown or touchstart)\n * @return {Object} Object with start (boolean flag) and x, y (only if flag true) values\n */\n prepare: function(event) {\n event.preventDefault();\n var start;\n if (event.type === 'touchstart') {\n // For touch, start if there's at least one touch and we are not currently doing\n // a touch event.\n start = (dragdrop.touching === null) && event.changedTouches.length > 0;\n } else {\n // For mousedown, start if it's the left button.\n start = event.which === 1;\n }\n if (start) {\n var details = dragdrop.getEventXY(event);\n details.start = true;\n return details;\n } else {\n return {start: false};\n }\n },\n\n /**\n * Call to start a drag operation, in response to a mouse down or touch start event.\n * Normally call this after calling prepare and receiving start true (you can probably\n * skip prepare if only supporting drag not touch).\n *\n * Note: The caller is responsible for creating a 'drag proxy' which is the\n * thing that actually gets dragged. At present, this doesn't really work\n * properly unless it is added directly within the body tag.\n *\n * You also need to ensure that there is CSS so the proxy is absolutely positioned,\n * and styled to look like it is floating.\n *\n * You also need to absolutely position the proxy where you want it to start.\n *\n * @public\n * @param {Object} event Event (should be either mousedown or touchstart)\n * @param {jQuery} dragProxy An absolute-positioned element for dragging\n * @param {Object} onMove Function that receives X and Y page locations for a move\n * @param {Object} onDrop Function that receives X and Y page locations when dropped\n */\n start: function(event, dragProxy, onMove, onDrop) {\n var xy = dragdrop.getEventXY(event);\n dragdrop.initialX = xy.x;\n dragdrop.initialY = xy.y;\n dragdrop.initialPosition = dragProxy.offset();\n dragdrop.dragProxy = dragProxy;\n dragdrop.onMove = onMove;\n dragdrop.onDrop = onDrop;\n\n switch (event.type) {\n case 'mousedown':\n // Cannot use jQuery 'on' because events need to not be passive.\n dragdrop.addEventSpecial('mousemove', dragdrop.mouseMove);\n dragdrop.addEventSpecial('mouseup', dragdrop.mouseUp);\n break;\n case 'touchstart':\n dragdrop.addEventSpecial('touchend', dragdrop.touchEnd);\n dragdrop.addEventSpecial('touchcancel', dragdrop.touchEnd);\n dragdrop.addEventSpecial('touchmove', dragdrop.touchMove);\n dragdrop.touching = event.changedTouches[0].identifier;\n break;\n default:\n throw new Error('Unexpected event type: ' + event.type);\n }\n autoScroll.start(dragdrop.scroll);\n },\n\n /**\n * Adds an event listener with special event capture options (capture, not passive). If the\n * browser does not support passive events, it will fall back to the boolean for capture.\n *\n * @private\n * @param {Object} event Event type string\n * @param {Object} handler Handler function\n */\n addEventSpecial: function(event, handler) {\n try {\n window.addEventListener(event, handler, dragdrop.eventCaptureOptions);\n } catch (ex) {\n dragdrop.eventCaptureOptions = true;\n window.addEventListener(event, handler, dragdrop.eventCaptureOptions);\n }\n },\n\n /**\n * Gets X/Y co-ordinates of an event, which can be either touchstart or mousedown.\n *\n * @private\n * @param {Object} event Event (should be either mousedown or touchstart)\n * @return {Object} X/Y co-ordinates\n */\n getEventXY: function(event) {\n switch (event.type) {\n case 'touchstart':\n return {x: event.changedTouches[0].pageX,\n y: event.changedTouches[0].pageY};\n case 'mousedown':\n return {x: event.pageX, y: event.pageY};\n default:\n throw new Error('Unexpected event type: ' + event.type);\n }\n },\n\n /**\n * Event handler for touch move.\n *\n * @private\n * @param {Object} e Event\n */\n touchMove: function(e) {\n e.preventDefault();\n for (var i = 0; i < e.changedTouches.length; i++) {\n if (e.changedTouches[i].identifier === dragdrop.touching) {\n dragdrop.handleMove(e.changedTouches[i].pageX, e.changedTouches[i].pageY);\n }\n }\n },\n\n /**\n * Event handler for mouse move.\n *\n * @private\n * @param {Object} e Event\n */\n mouseMove: function(e) {\n dragdrop.handleMove(e.pageX, e.pageY);\n },\n\n /**\n * Shared handler for move event (mouse or touch).\n *\n * @private\n * @param {number} pageX X co-ordinate\n * @param {number} pageY Y co-ordinate\n */\n handleMove: function(pageX, pageY) {\n // Move the drag proxy, not letting you move it out of screen or window bounds.\n var current = dragdrop.dragProxy.offset();\n var topOffset = current.top - parseInt(dragdrop.dragProxy.css('top'));\n var leftOffset = current.left - parseInt(dragdrop.dragProxy.css('left'));\n var maxY = $(document).height() - dragdrop.dragProxy.outerHeight() - topOffset;\n var maxX = $(document).width() - dragdrop.dragProxy.outerWidth() - leftOffset;\n var minY = -topOffset;\n var minX = -leftOffset;\n var initial = dragdrop.initialPosition;\n var position = {\n top: Math.max(minY, Math.min(maxY, initial.top + (pageY - dragdrop.initialY) - topOffset)),\n left: Math.max(minX, Math.min(maxX, initial.left + (pageX - dragdrop.initialX) - leftOffset))\n };\n dragdrop.dragProxy.css(position);\n\n // Trigger move handler.\n dragdrop.onMove(pageX, pageY, dragdrop.dragProxy);\n },\n\n /**\n * Event handler for touch end.\n *\n * @private\n * @param {Object} e Event\n */\n touchEnd: function(e) {\n e.preventDefault();\n for (var i = 0; i < e.changedTouches.length; i++) {\n if (e.changedTouches[i].identifier === dragdrop.touching) {\n dragdrop.handleEnd(e.changedTouches[i].pageX, e.changedTouches[i].pageY);\n }\n }\n },\n\n /**\n * Event handler for mouse up.\n *\n * @private\n * @param {Object} e Event\n */\n mouseUp: function(e) {\n dragdrop.handleEnd(e.pageX, e.pageY);\n },\n\n /**\n * Shared handler for end drag (mouse or touch).\n *\n * @private\n * @param {number} pageX X\n * @param {number} pageY Y\n */\n handleEnd: function(pageX, pageY) {\n if (dragdrop.touching !== null) {\n window.removeEventListener('touchend', dragdrop.touchEnd, dragdrop.eventCaptureOptions);\n window.removeEventListener('touchcancel', dragdrop.touchEnd, dragdrop.eventCaptureOptions);\n window.removeEventListener('touchmove', dragdrop.touchMove, dragdrop.eventCaptureOptions);\n dragdrop.touching = null;\n } else {\n window.removeEventListener('mousemove', dragdrop.mouseMove, dragdrop.eventCaptureOptions);\n window.removeEventListener('mouseup', dragdrop.mouseUp, dragdrop.eventCaptureOptions);\n }\n autoScroll.stop();\n dragdrop.onDrop(pageX, pageY, dragdrop.dragProxy);\n },\n\n /**\n * Called when the page scrolls.\n *\n * @private\n * @param {number} offset Amount of scroll\n */\n scroll: function(offset) {\n // Move the proxy to match.\n var maxY = $(document).height() - dragdrop.dragProxy.outerHeight();\n var currentPosition = dragdrop.dragProxy.offset();\n currentPosition.top = Math.min(maxY, currentPosition.top + offset);\n dragdrop.dragProxy.css(currentPosition);\n }\n };\n\n return {\n /**\n * Prepares to begin a drag operation - call with a mousedown or touchstart event.\n *\n * If the returned object has 'start' true, then you can set up a drag proxy, and call\n * start. This function will call preventDefault automatically regardless of whether\n * starting or not.\n *\n * @param {Object} event Event (should be either mousedown or touchstart)\n * @return {Object} Object with start (boolean flag) and x, y (only if flag true) values\n */\n prepare: dragdrop.prepare,\n\n /**\n * Call to start a drag operation, in response to a mouse down or touch start event.\n * Normally call this after calling prepare and receiving start true (you can probably\n * skip prepare if only supporting drag not touch).\n *\n * Note: The caller is responsible for creating a 'drag proxy' which is the\n * thing that actually gets dragged. At present, this doesn't really work\n * properly unless it is added directly within the body tag.\n *\n * You also need to ensure that there is CSS so the proxy is absolutely positioned,\n * and styled to look like it is floating.\n *\n * You also need to absolutely position the proxy where you want it to start.\n *\n * @param {Object} event Event (should be either mousedown or touchstart)\n * @param {jQuery} dragProxy An absolute-positioned element for dragging\n * @param {Object} onMove Function that receives X and Y page locations for a move\n * @param {Object} onDrop Function that receives X and Y page locations when dropped\n */\n start: dragdrop.start\n };\n});\n"],"file":"dragdrop.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/dragdrop.js"],"names":["define","$","autoScroll","dragdrop","eventCaptureOptions","passive","capture","dragProxy","onMove","onDrop","initialPosition","initialX","initialY","touching","prepare","event","preventDefault","start","type","changedTouches","length","which","details","getEventXY","xy","x","y","offset","addEventSpecial","mouseMove","mouseUp","touchEnd","touchMove","identifier","Error","scroll","handler","window","addEventListener","ex","pageX","pageY","e","i","handleMove","current","topOffset","top","parseInt","css","leftOffset","left","maxY","document","height","outerHeight","maxX","width","outerWidth","initial","position","Math","max","min","handleEnd","removeEventListener","stop","currentPosition"],"mappings":"AA2BAA,OAAM,iBAAC,CAAC,QAAD,CAAW,iBAAX,CAAD,CAAgC,SAASC,CAAT,CAAYC,CAAZ,CAAwB,CAC1D,GAAIC,CAAAA,CAAQ,CAAG,CAKXC,mBAAmB,CAAE,CAACC,OAAO,GAAR,CAAiBC,OAAO,GAAxB,CALV,CAWXC,SAAS,CAAE,IAXA,CAiBXC,MAAM,CAAE,IAjBG,CAuBXC,MAAM,CAAE,IAvBG,CA4BXC,eAAe,CAAE,IA5BN,CAiCXC,QAAQ,CAAE,IAjCC,CAsCXC,QAAQ,CAAE,IAtCC,CA2CXC,QAAQ,CAAE,IA3CC,CAwDXC,OAAO,CAAE,iBAASC,CAAT,CAAgB,CACrBA,CAAK,CAACC,cAAN,GACA,GAAIC,CAAAA,CAAJ,CACA,GAAmB,YAAf,GAAAF,CAAK,CAACG,IAAV,CAAiC,CAG7BD,CAAK,CAA0B,IAAtB,GAAAd,CAAQ,CAACU,QAAV,EAA8D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istribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/*\n * JavaScript to handle drag operations, including automatic scrolling.\n *\n * Note: this module is defined statically. It is a singleton. You\n * can only have one use of it active at any time. However, you\n * can only drag one thing at a time, this is not a problem in practice.\n *\n * @module core/dragdrop\n * @copyright 2016 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 3.6\n */\ndefine(['jquery', 'core/autoscroll'], function($, autoScroll) {\n var dragdrop = {\n /**\n * A boolean or options argument depending on whether browser supports passive events.\n * @private\n */\n eventCaptureOptions: {passive: false, capture: true},\n\n /**\n * Drag proxy if any.\n * @private\n */\n dragProxy: null,\n\n /**\n * Function called on move.\n * @private\n */\n onMove: null,\n\n /**\n * Function called on drop.\n * @private\n */\n onDrop: null,\n\n /**\n * Initial position of proxy at drag start.\n */\n initialPosition: null,\n\n /**\n * Initial page X of cursor at drag start.\n */\n initialX: null,\n\n /**\n * Initial page Y of cursor at drag start.\n */\n initialY: null,\n\n /**\n * If touch event is in progress, this will be the id, otherwise null\n */\n touching: null,\n\n /**\n * Prepares to begin a drag operation - call with a mousedown or touchstart event.\n *\n * If the returned object has 'start' true, then you can set up a drag proxy, and call\n * start. This function will call preventDefault automatically regardless of whether\n * starting or not.\n *\n * @public\n * @param {Object} event Event (should be either mousedown or touchstart)\n * @return {Object} Object with start (boolean flag) and x, y (only if flag true) values\n */\n prepare: function(event) {\n event.preventDefault();\n var start;\n if (event.type === 'touchstart') {\n // For touch, start if there's at least one touch and we are not currently doing\n // a touch event.\n start = (dragdrop.touching === null) && event.changedTouches.length > 0;\n } else {\n // For mousedown, start if it's the left button.\n start = event.which === 1;\n }\n if (start) {\n var details = dragdrop.getEventXY(event);\n details.start = true;\n return details;\n } else {\n return {start: false};\n }\n },\n\n /**\n * Call to start a drag operation, in response to a mouse down or touch start event.\n * Normally call this after calling prepare and receiving start true (you can probably\n * skip prepare if only supporting drag not touch).\n *\n * Note: The caller is responsible for creating a 'drag proxy' which is the\n * thing that actually gets dragged. At present, this doesn't really work\n * properly unless it is added directly within the body tag.\n *\n * You also need to ensure that there is CSS so the proxy is absolutely positioned,\n * and styled to look like it is floating.\n *\n * You also need to absolutely position the proxy where you want it to start.\n *\n * @public\n * @param {Object} event Event (should be either mousedown or touchstart)\n * @param {jQuery} dragProxy An absolute-positioned element for dragging\n * @param {Object} onMove Function that receives X and Y page locations for a move\n * @param {Object} onDrop Function that receives X and Y page locations when dropped\n */\n start: function(event, dragProxy, onMove, onDrop) {\n var xy = dragdrop.getEventXY(event);\n dragdrop.initialX = xy.x;\n dragdrop.initialY = xy.y;\n dragdrop.initialPosition = dragProxy.offset();\n dragdrop.dragProxy = dragProxy;\n dragdrop.onMove = onMove;\n dragdrop.onDrop = onDrop;\n\n switch (event.type) {\n case 'mousedown':\n // Cannot use jQuery 'on' because events need to not be passive.\n dragdrop.addEventSpecial('mousemove', dragdrop.mouseMove);\n dragdrop.addEventSpecial('mouseup', dragdrop.mouseUp);\n break;\n case 'touchstart':\n dragdrop.addEventSpecial('touchend', dragdrop.touchEnd);\n dragdrop.addEventSpecial('touchcancel', dragdrop.touchEnd);\n dragdrop.addEventSpecial('touchmove', dragdrop.touchMove);\n dragdrop.touching = event.changedTouches[0].identifier;\n break;\n default:\n throw new Error('Unexpected event type: ' + event.type);\n }\n autoScroll.start(dragdrop.scroll);\n },\n\n /**\n * Adds an event listener with special event capture options (capture, not passive). If the\n * browser does not support passive events, it will fall back to the boolean for capture.\n *\n * @private\n * @param {Object} event Event type string\n * @param {Object} handler Handler function\n */\n addEventSpecial: function(event, handler) {\n try {\n window.addEventListener(event, handler, dragdrop.eventCaptureOptions);\n } catch (ex) {\n dragdrop.eventCaptureOptions = true;\n window.addEventListener(event, handler, dragdrop.eventCaptureOptions);\n }\n },\n\n /**\n * Gets X/Y co-ordinates of an event, which can be either touchstart or mousedown.\n *\n * @private\n * @param {Object} event Event (should be either mousedown or touchstart)\n * @return {Object} X/Y co-ordinates\n */\n getEventXY: function(event) {\n switch (event.type) {\n case 'touchstart':\n return {x: event.changedTouches[0].pageX,\n y: event.changedTouches[0].pageY};\n case 'mousedown':\n return {x: event.pageX, y: event.pageY};\n default:\n throw new Error('Unexpected event type: ' + event.type);\n }\n },\n\n /**\n * Event handler for touch move.\n *\n * @private\n * @param {Object} e Event\n */\n touchMove: function(e) {\n e.preventDefault();\n for (var i = 0; i < e.changedTouches.length; i++) {\n if (e.changedTouches[i].identifier === dragdrop.touching) {\n dragdrop.handleMove(e.changedTouches[i].pageX, e.changedTouches[i].pageY);\n }\n }\n },\n\n /**\n * Event handler for mouse move.\n *\n * @private\n * @param {Object} e Event\n */\n mouseMove: function(e) {\n dragdrop.handleMove(e.pageX, e.pageY);\n },\n\n /**\n * Shared handler for move event (mouse or touch).\n *\n * @private\n * @param {number} pageX X co-ordinate\n * @param {number} pageY Y co-ordinate\n */\n handleMove: function(pageX, pageY) {\n // Move the drag proxy, not letting you move it out of screen or window bounds.\n var current = dragdrop.dragProxy.offset();\n var topOffset = current.top - parseInt(dragdrop.dragProxy.css('top'));\n var leftOffset = current.left - parseInt(dragdrop.dragProxy.css('left'));\n var maxY = $(document).height() - dragdrop.dragProxy.outerHeight() - topOffset;\n var maxX = $(document).width() - dragdrop.dragProxy.outerWidth() - leftOffset;\n var minY = -topOffset;\n var minX = -leftOffset;\n var initial = dragdrop.initialPosition;\n var position = {\n top: Math.max(minY, Math.min(maxY, initial.top + (pageY - dragdrop.initialY) - topOffset)),\n left: Math.max(minX, Math.min(maxX, initial.left + (pageX - dragdrop.initialX) - leftOffset))\n };\n dragdrop.dragProxy.css(position);\n\n // Trigger move handler.\n dragdrop.onMove(pageX, pageY, dragdrop.dragProxy);\n },\n\n /**\n * Event handler for touch end.\n *\n * @private\n * @param {Object} e Event\n */\n touchEnd: function(e) {\n e.preventDefault();\n for (var i = 0; i < e.changedTouches.length; i++) {\n if (e.changedTouches[i].identifier === dragdrop.touching) {\n dragdrop.handleEnd(e.changedTouches[i].pageX, e.changedTouches[i].pageY);\n }\n }\n },\n\n /**\n * Event handler for mouse up.\n *\n * @private\n * @param {Object} e Event\n */\n mouseUp: function(e) {\n dragdrop.handleEnd(e.pageX, e.pageY);\n },\n\n /**\n * Shared handler for end drag (mouse or touch).\n *\n * @private\n * @param {number} pageX X\n * @param {number} pageY Y\n */\n handleEnd: function(pageX, pageY) {\n if (dragdrop.touching !== null) {\n window.removeEventListener('touchend', dragdrop.touchEnd, dragdrop.eventCaptureOptions);\n window.removeEventListener('touchcancel', dragdrop.touchEnd, dragdrop.eventCaptureOptions);\n window.removeEventListener('touchmove', dragdrop.touchMove, dragdrop.eventCaptureOptions);\n dragdrop.touching = null;\n } else {\n window.removeEventListener('mousemove', dragdrop.mouseMove, dragdrop.eventCaptureOptions);\n window.removeEventListener('mouseup', dragdrop.mouseUp, dragdrop.eventCaptureOptions);\n }\n autoScroll.stop();\n dragdrop.onDrop(pageX, pageY, dragdrop.dragProxy);\n },\n\n /**\n * Called when the page scrolls.\n *\n * @private\n * @param {number} offset Amount of scroll\n */\n scroll: function(offset) {\n // Move the proxy to match.\n var maxY = $(document).height() - dragdrop.dragProxy.outerHeight();\n var currentPosition = dragdrop.dragProxy.offset();\n currentPosition.top = Math.min(maxY, currentPosition.top + offset);\n dragdrop.dragProxy.css(currentPosition);\n }\n };\n\n return {\n /**\n * Prepares to begin a drag operation - call with a mousedown or touchstart event.\n *\n * If the returned object has 'start' true, then you can set up a drag proxy, and call\n * start. This function will call preventDefault automatically regardless of whether\n * starting or not.\n *\n * @param {Object} event Event (should be either mousedown or touchstart)\n * @return {Object} Object with start (boolean flag) and x, y (only if flag true) values\n */\n prepare: dragdrop.prepare,\n\n /**\n * Call to start a drag operation, in response to a mouse down or touch start event.\n * Normally call this after calling prepare and receiving start true (you can probably\n * skip prepare if only supporting drag not touch).\n *\n * Note: The caller is responsible for creating a 'drag proxy' which is the\n * thing that actually gets dragged. At present, this doesn't really work\n * properly unless it is added directly within the body tag.\n *\n * You also need to ensure that there is CSS so the proxy is absolutely positioned,\n * and styled to look like it is floating.\n *\n * You also need to absolutely position the proxy where you want it to start.\n *\n * @param {Object} event Event (should be either mousedown or touchstart)\n * @param {jQuery} dragProxy An absolute-positioned element for dragging\n * @param {Object} onMove Function that receives X and Y page locations for a move\n * @param {Object} onDrop Function that receives X and Y page locations when dropped\n */\n start: dragdrop.start\n };\n});\n"],"file":"dragdrop.min.js"} \ No newline at end of file diff --git a/lib/amd/build/emoji/auto_complete.min.js.map b/lib/amd/build/emoji/auto_complete.min.js.map index f61d05b6c0cf2..431bc2f6fc3ae 100644 --- a/lib/amd/build/emoji/auto_complete.min.js.map +++ b/lib/amd/build/emoji/auto_complete.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../src/emoji/auto_complete.js"],"names":["RECENT_EMOJIS_STORAGE_KEY","SELECTORS","EMOJI_BUTTON","ACTIVE_EMOJI_BUTTON","getRecentEmojis","storedData","LocalStorage","get","JSON","parse","addRecentEmoji","unified","shortName","newEmoji","shortnames","recentEmojis","newRecentEmojis","filter","emoji","slice","set","stringify","getEmojiTextFromShortName","EmojiData","byShortName","charCodes","split","map","code","String","fromCodePoint","apply","render","root","shortNames","renderContext","emojis","index","active","emojitext","displayshortname","shortname","html","innerHTML","searchEmojis","searchTerm","limit","data","toLowerCase","Object","keys","includes","getWordFromPosition","text","position","startMatches","match","endMatches","startText","endText","length","isCompleteShortName","test","isPartialShortName","getShortNameFromText","replace","getActiveEmojiSuggestion","querySelector","selectPreviousEmojiSuggestion","activeEmojiSuggestion","previousSuggestion","previousElementSibling","classList","remove","add","scrollIntoView","behaviour","inline","selectNextEmojiSuggestion","nextSuggestion","nextElementSibling","selectEmojiElement","element","selectCallback","getAttribute","trim","textArea","hasSuggestionCallback","hasSuggestions","previousSearchText","addEventListener","value","cursorPos","selectionStart","searchText","emojiText","suggestions","e","isModifierPressed","shiftKey","metaKey","altKey","ctrlKey","which","KeyCodes","escape","arrowLeft","preventDefault","arrowRight","enter","stopPropagation","target","matches"],"mappings":"4gBAqBA,OAGA,OACA,O,4oDAKMA,CAAAA,CAAyB,CAAG,sB,CAE5BC,CAAS,CAAG,CACdC,YAAY,CAAE,gCADA,CAEdC,mBAAmB,CAAE,uCAFP,C,CAUZC,CAAe,CAAG,UAAM,CAC1B,GAAMC,CAAAA,CAAU,CAAGC,UAAaC,GAAb,CAAiBP,CAAjB,CAAnB,CACA,MAAOK,CAAAA,CAAU,CAAGG,IAAI,CAACC,KAAL,CAAWJ,CAAX,CAAH,CAA4B,EAChD,C,CASKK,CAAc,CAAG,SAACC,CAAD,CAAUC,CAAV,CAAwB,IACrCC,CAAAA,CAAQ,CAAG,CACbF,OAAO,CAAPA,CADa,CAEbG,UAAU,CAAE,CAACF,CAAD,CAFC,CAD0B,CAKrCG,CAAY,CAAGX,CAAe,EALO,CAOvCY,CAAe,EAAIH,CAAJ,WAAiBE,CAAY,CAACE,MAAb,CAAoB,SAAAC,CAAK,QAAIA,CAAAA,CAAK,CAACP,OAAN,EAAiBE,CAAQ,CAACF,OAA9B,CAAzB,CAAjB,EAPwB,CAS3CK,CAAe,CAAGA,CAAe,CAACG,KAAhB,CAAsB,CAAtB,CAlCG,EAkCH,CAAlB,CAEAb,UAAac,GAAb,CAAiBpB,CAAjB,CAA4CQ,IAAI,CAACa,SAAL,CAAeL,CAAf,CAA5C,CACH,C,CAQKM,CAAyB,CAAG,SAACV,CAAD,CAAe,CAC7C,GAAMD,CAAAA,CAAO,CAAGY,CAAS,CAACC,WAAV,CAAsBZ,CAAtB,CAAhB,CAEA,GAAID,CAAJ,CAAa,CACT,GAAMc,CAAAA,CAAS,CAAGd,CAAO,CAACe,KAAR,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ACJ,IAAKH,WAASK,KAAd,CAEI5B,CAAkB,CAACf,CAAwB,CAACjC,CAAD,CAAzB,CAAiCkD,CAAjC,CAAlB,CACAc,CAAC,CAACU,cAAF,GACAV,CAAC,CAACa,eAAF,GACA,MArBR,CAuBH,CACJ,CACJ,CA7BD,EA+BA7E,CAAI,CAACyD,gBAAL,CAAsB,OAAtB,CAA+B,SAACO,CAAD,CAAO,CAClC,GAAMc,CAAAA,CAAM,CAAGd,CAAC,CAACc,MAAjB,CACA,GAAIA,CAAM,CAACC,OAAP,CAAe/G,CAAS,CAACC,YAAzB,CAAJ,CAA4C,CACxC+E,CAAkB,CAAC8B,CAAD,CAAS5B,CAAT,CACrB,CACJ,CALD,CAMH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Emoji auto complete.\n *\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport * as EmojiData from 'core/emoji/data';\nimport {render as renderTemplate} from 'core/templates';\nimport {debounce} from 'core/utils';\nimport LocalStorage from 'core/localstorage';\nimport KeyCodes from 'core/key_codes';\n\nconst INPUT_DEBOUNCE_TIMER = 200;\nconst SUGGESTION_LIMIT = 50;\nconst MAX_RECENT_COUNT = 27;\nconst RECENT_EMOJIS_STORAGE_KEY = 'moodle-recent-emojis';\n\nconst SELECTORS = {\n EMOJI_BUTTON: '[data-region=\"emoji-button\"]',\n ACTIVE_EMOJI_BUTTON: '[data-region=\"emoji-button\"].active',\n};\n\n/**\n * Get the list of recent emojis data from local storage.\n *\n * @return {Array}\n */\nconst getRecentEmojis = () => {\n const storedData = LocalStorage.get(RECENT_EMOJIS_STORAGE_KEY);\n return storedData ? JSON.parse(storedData) : [];\n};\n\n/**\n * Add an emoji data to the set of recent emojis. The new set of recent emojis are\n * saved in local storage.\n *\n * @param {String} unified The char chodes for the emoji\n * @param {String} shortName The emoji short name\n */\nconst addRecentEmoji = (unified, shortName) => {\n const newEmoji = {\n unified,\n shortnames: [shortName]\n };\n const recentEmojis = getRecentEmojis();\n // Add the new emoji to the start of the list of recent emojis.\n let newRecentEmojis = [newEmoji, ...recentEmojis.filter(emoji => emoji.unified != newEmoji.unified)];\n // Limit the number of recent emojis.\n newRecentEmojis = newRecentEmojis.slice(0, MAX_RECENT_COUNT);\n\n LocalStorage.set(RECENT_EMOJIS_STORAGE_KEY, JSON.stringify(newRecentEmojis));\n};\n\n/**\n * Get the actual emoji string from the short name.\n *\n * @param {String} shortName Emoji short name\n * @return {String|null}\n */\nconst getEmojiTextFromShortName = (shortName) => {\n const unified = EmojiData.byShortName[shortName];\n\n if (unified) {\n const charCodes = unified.split('-').map(code => `0x${code}`);\n return String.fromCodePoint.apply(null, charCodes);\n } else {\n return null;\n }\n};\n\n/**\n * Render the auto complete list for the given short names.\n *\n * @param {Element} root The root container for the emoji auto complete\n * @param {Array} shortNames The list of short names for emoji suggestions to show\n */\nconst render = async (root, shortNames) => {\n const renderContext = {\n emojis: shortNames.map((shortName, index) => {\n return {\n active: index === 0,\n emojitext: getEmojiTextFromShortName(shortName),\n displayshortname: `:${shortName}:`,\n shortname: shortName,\n unified: EmojiData.byShortName[shortName]\n };\n })\n };\n const html = await renderTemplate('core/emoji/auto_complete', renderContext);\n root.innerHTML = html;\n};\n\n/**\n * Get the list of emoji short names that include the given search term. If\n * the search term is an empty string then the list of recently used emojis\n * will be returned.\n *\n * @param {String} searchTerm Text to match on\n * @param {Number} limit Maximum number of results to return\n * @return {Array}\n */\nconst searchEmojis = (searchTerm, limit) => {\n if (searchTerm === '') {\n return getRecentEmojis().map(data => data.shortnames[0]).slice(0, limit);\n } else {\n searchTerm = searchTerm.toLowerCase();\n return Object.keys(EmojiData.byShortName)\n .filter(shortName => shortName.includes(searchTerm))\n .slice(0, limit);\n }\n};\n\n/**\n * Get the current word at the given position (index) within the text.\n *\n * @param {String} text The text to process\n * @param {Number} position The position (index) within the text to match the word\n * @return {String}\n */\nconst getWordFromPosition = (text, position) => {\n const startMatches = text.slice(0, position).match(/(\\S*)$/);\n const endMatches = text.slice(position).match(/^(\\S*)/);\n let startText = '';\n let endText = '';\n\n if (startMatches) {\n startText = startMatches[startMatches.length - 1];\n }\n\n if (endMatches) {\n endText = endMatches[endMatches.length - 1];\n }\n\n return `${startText}${endText}`;\n};\n\n/**\n * Check if the given text is a full short name, i.e. has leading and trialing colon\n * characters.\n *\n * @param {String} text The text to process\n * @return {Bool}\n */\nconst isCompleteShortName = text => /^:[^:\\s]+:$/.test(text);\n\n/**\n * Check if the given text is a partial short name, i.e. has a leading colon but no\n * trailing colon.\n *\n * @param {String} text The text to process\n * @return {Bool}\n */\nconst isPartialShortName = text => /^:[^:\\s]*$/.test(text);\n\n/**\n * Remove the colon characters from the given text.\n *\n * @param {String} text The text to process\n * @return {String}\n */\nconst getShortNameFromText = text => text.replace(/:/g, '');\n\n/**\n * Get the currently active emoji button element in the list of suggestions.\n *\n * @param {Element} root The emoji auto complete container element\n * @return {Element|null}\n */\nconst getActiveEmojiSuggestion = (root) => {\n return root.querySelector(SELECTORS.ACTIVE_EMOJI_BUTTON);\n};\n\n/**\n * Make the previous sibling of the current active emoji active.\n *\n * @param {Element} root The emoji auto complete container element\n */\nconst selectPreviousEmojiSuggestion = (root) => {\n const activeEmojiSuggestion = getActiveEmojiSuggestion(root);\n const previousSuggestion = activeEmojiSuggestion.previousElementSibling;\n\n if (previousSuggestion) {\n activeEmojiSuggestion.classList.remove('active');\n previousSuggestion.classList.add('active');\n previousSuggestion.scrollIntoView({behaviour: 'smooth', inline: 'center'});\n }\n};\n\n/**\n * Make the next sibling to the current active emoji active.\n *\n * @param {Element} root The emoji auto complete container element\n */\nconst selectNextEmojiSuggestion = (root) => {\n const activeEmojiSuggestion = getActiveEmojiSuggestion(root);\n const nextSuggestion = activeEmojiSuggestion.nextElementSibling;\n\n if (nextSuggestion) {\n activeEmojiSuggestion.classList.remove('active');\n nextSuggestion.classList.add('active');\n nextSuggestion.scrollIntoView({behaviour: 'smooth', inline: 'center'});\n }\n};\n\n/**\n * Trigger the select callback for the given emoji button element.\n *\n * @param {Element} element The emoji button element\n * @param {Function} selectCallback The callback for when the user selects an emoji\n */\nconst selectEmojiElement = (element, selectCallback) => {\n const shortName = element.getAttribute('data-short-name');\n const unified = element.getAttribute('data-unified');\n addRecentEmoji(unified, shortName);\n selectCallback(element.innerHTML.trim());\n};\n\n/**\n * Initialise the emoji auto complete.\n *\n * @param {Element} root The root container element for the auto complete\n * @param {Element} textArea The text area element to monitor for auto complete\n * @param {Function} hasSuggestionCallback Callback for when there are auto-complete suggestions\n * @param {Function} selectCallback Callback for when the user selects an emoji\n */\nexport default (root, textArea, hasSuggestionCallback, selectCallback) => {\n let hasSuggestions = false;\n let previousSearchText = '';\n\n // Debounce the listener so that each keypress delays the execution of the handler. The\n // handler should only run 200 milliseconds after the last keypress.\n textArea.addEventListener('keyup', debounce(() => {\n // This is a \"keyup\" listener so that it only executes after the text area value\n // has been updated.\n const text = textArea.value;\n const cursorPos = textArea.selectionStart;\n const searchText = getWordFromPosition(text, cursorPos);\n\n if (searchText === previousSearchText) {\n // Nothing has changed so no need to take any action.\n return;\n } else {\n previousSearchText = searchText;\n }\n\n if (isCompleteShortName(searchText)) {\n // If the user has entered a full short name (with leading and trialing colons)\n // then see if we can find a match for it and auto complete it.\n const shortName = getShortNameFromText(searchText);\n const emojiText = getEmojiTextFromShortName(shortName);\n hasSuggestions = false;\n if (emojiText) {\n addRecentEmoji(EmojiData.byShortName[shortName], shortName);\n selectCallback(emojiText);\n }\n } else if (isPartialShortName(searchText)) {\n // If the user has entered a partial short name (leading colon but no trailing) then\n // search on the text to see if we can find some suggestions for them.\n const suggestions = searchEmojis(getShortNameFromText(searchText), SUGGESTION_LIMIT);\n\n if (suggestions.length) {\n render(root, suggestions);\n hasSuggestions = true;\n } else {\n hasSuggestions = false;\n }\n } else {\n hasSuggestions = false;\n }\n\n hasSuggestionCallback(hasSuggestions);\n }, INPUT_DEBOUNCE_TIMER));\n\n textArea.addEventListener('keydown', (e) => {\n if (hasSuggestions) {\n const isModifierPressed = (e.shiftKey || e.metaKey || e.altKey || e.ctrlKey);\n if (!isModifierPressed) {\n switch (e.which) {\n case KeyCodes.escape:\n // Escape key closes the auto complete.\n hasSuggestions = false;\n hasSuggestionCallback(false);\n break;\n case KeyCodes.arrowLeft:\n // Arrow keys navigate through the list of suggetions.\n selectPreviousEmojiSuggestion(root);\n e.preventDefault();\n break;\n case KeyCodes.arrowRight:\n // Arrow keys navigate through the list of suggetions.\n selectNextEmojiSuggestion(root);\n e.preventDefault();\n break;\n case KeyCodes.enter:\n // Enter key selects the current suggestion.\n selectEmojiElement(getActiveEmojiSuggestion(root), selectCallback);\n e.preventDefault();\n e.stopPropagation();\n break;\n }\n }\n }\n });\n\n root.addEventListener('click', (e) => {\n const target = e.target;\n if (target.matches(SELECTORS.EMOJI_BUTTON)) {\n selectEmojiElement(target, selectCallback);\n }\n });\n};"],"file":"auto_complete.min.js"} \ No newline at end of file +{"version":3,"sources":["../../src/emoji/auto_complete.js"],"names":["RECENT_EMOJIS_STORAGE_KEY","SELECTORS","EMOJI_BUTTON","ACTIVE_EMOJI_BUTTON","getRecentEmojis","storedData","LocalStorage","get","JSON","parse","addRecentEmoji","unified","shortName","newEmoji","shortnames","recentEmojis","newRecentEmojis","filter","emoji","slice","set","stringify","getEmojiTextFromShortName","EmojiData","byShortName","charCodes","split","map","code","String","fromCodePoint","apply","render","root","shortNames","renderContext","emojis","index","active","emojitext","displayshortname","shortname","html","innerHTML","searchEmojis","searchTerm","limit","data","toLowerCase","Object","keys","includes","getWordFromPosition","text","position","startMatches","match","endMatches","startText","endText","length","isCompleteShortName","test","isPartialShortName","getShortNameFromText","replace","getActiveEmojiSuggestion","querySelector","selectPreviousEmojiSuggestion","activeEmojiSuggestion","previousSuggestion","previousElementSibling","classList","remove","add","scrollIntoView","behaviour","inline","selectNextEmojiSuggestion","nextSuggestion","nextElementSibling","selectEmojiElement","element","selectCallback","getAttribute","trim","textArea","hasSuggestionCallback","hasSuggestions","previousSearchText","addEventListener","value","cursorPos","selectionStart","searchText","emojiText","suggestions","e","isModifierPressed","shiftKey","metaKey","altKey","ctrlKey","which","KeyCodes","escape","arrowLeft","preventDefault","arrowRight","enter","stopPropagation","target","matches"],"mappings":"4gBAsBA,OAGA,OACA,O,4oDAKMA,CAAAA,CAAyB,CAAG,sB,CAE5BC,CAAS,CAAG,CACdC,YAAY,CAAE,gCADA,CAEdC,mBAAmB,CAAE,uCAFP,C,CAUZC,CAAe,CAAG,UAAM,CAC1B,GAAMC,CAAAA,CAAU,CAAGC,UAAaC,GAAb,CAAiBP,CAAjB,CAAnB,CACA,MAAOK,CAAAA,CAAU,CAAGG,IAAI,CAACC,KAAL,CAAWJ,CAAX,CAAH,CAA4B,EAChD,C,CASKK,CAAc,CAAG,SAACC,CAAD,CAAUC,CAAV,CAAwB,IACrCC,CAAAA,CAAQ,CAAG,CACbF,OAAO,CAAPA,CADa,CAEbG,UAAU,CAAE,CAACF,CAAD,CAFC,CAD0B,CAKrCG,CAAY,CAAGX,CAAe,EALO,CAOvCY,CAAe,EAAIH,CAAJ,WAAiBE,CAAY,CAACE,MAAb,CAAoB,SAAAC,CAAK,QAAIA,CAAAA,CAAK,CAACP,OAAN,EAAiBE,CAAQ,CAACF,OAA9B,CAAzB,CAAjB,EAPwB,CAS3CK,CAAe,CAAGA,CAAe,CAACG,KAAhB,CAAsB,CAAtB,CAlCG,EAkCH,CAAlB,CAEAb,UAAac,GAAb,CAAiBpB,CAAjB,CAA4CQ,IAAI,CAACa,S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IjB,CAAc,GAAd,CACAD,CAAqB,IAArB,CACA,MACJ,IAAKiB,WAASE,SAAd,CAEItC,CAA6B,CAACnC,CAAD,CAA7B,CACAgE,CAAC,CAACU,cAAF,GACA,MACJ,IAAKH,WAASI,UAAd,CAEI9B,CAAyB,CAAC7C,CAAD,CAAzB,CACAgE,CAAC,CAACU,cAAF,GACA,MACJ,IAAKH,WAASK,KAAd,CAEI5B,CAAkB,CAACf,CAAwB,CAACjC,CAAD,CAAzB,CAAiCkD,CAAjC,CAAlB,CACAc,CAAC,CAACU,cAAF,GACAV,CAAC,CAACa,eAAF,GACA,MArBR,CAuBH,CACJ,CACJ,CA7BD,EA+BA7E,CAAI,CAACyD,gBAAL,CAAsB,OAAtB,CAA+B,SAACO,CAAD,CAAO,CAClC,GAAMc,CAAAA,CAAM,CAAGd,CAAC,CAACc,MAAjB,CACA,GAAIA,CAAM,CAACC,OAAP,CAAe/G,CAAS,CAACC,YAAzB,CAAJ,CAA4C,CACxC+E,CAAkB,CAAC8B,CAAD,CAAS5B,CAAT,CACrB,CACJ,CALD,CAMH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Emoji auto complete.\n *\n * @module core/emoji/auto_complete\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport * as EmojiData from 'core/emoji/data';\nimport {render as renderTemplate} from 'core/templates';\nimport {debounce} from 'core/utils';\nimport LocalStorage from 'core/localstorage';\nimport KeyCodes from 'core/key_codes';\n\nconst INPUT_DEBOUNCE_TIMER = 200;\nconst SUGGESTION_LIMIT = 50;\nconst MAX_RECENT_COUNT = 27;\nconst RECENT_EMOJIS_STORAGE_KEY = 'moodle-recent-emojis';\n\nconst SELECTORS = {\n EMOJI_BUTTON: '[data-region=\"emoji-button\"]',\n ACTIVE_EMOJI_BUTTON: '[data-region=\"emoji-button\"].active',\n};\n\n/**\n * Get the list of recent emojis data from local storage.\n *\n * @return {Array}\n */\nconst getRecentEmojis = () => {\n const storedData = LocalStorage.get(RECENT_EMOJIS_STORAGE_KEY);\n return storedData ? JSON.parse(storedData) : [];\n};\n\n/**\n * Add an emoji data to the set of recent emojis. The new set of recent emojis are\n * saved in local storage.\n *\n * @param {String} unified The char chodes for the emoji\n * @param {String} shortName The emoji short name\n */\nconst addRecentEmoji = (unified, shortName) => {\n const newEmoji = {\n unified,\n shortnames: [shortName]\n };\n const recentEmojis = getRecentEmojis();\n // Add the new emoji to the start of the list of recent emojis.\n let newRecentEmojis = [newEmoji, ...recentEmojis.filter(emoji => emoji.unified != newEmoji.unified)];\n // Limit the number of recent emojis.\n newRecentEmojis = newRecentEmojis.slice(0, MAX_RECENT_COUNT);\n\n LocalStorage.set(RECENT_EMOJIS_STORAGE_KEY, JSON.stringify(newRecentEmojis));\n};\n\n/**\n * Get the actual emoji string from the short name.\n *\n * @param {String} shortName Emoji short name\n * @return {String|null}\n */\nconst getEmojiTextFromShortName = (shortName) => {\n const unified = EmojiData.byShortName[shortName];\n\n if (unified) {\n const charCodes = unified.split('-').map(code => `0x${code}`);\n return String.fromCodePoint.apply(null, charCodes);\n } else {\n return null;\n }\n};\n\n/**\n * Render the auto complete list for the given short names.\n *\n * @param {Element} root The root container for the emoji auto complete\n * @param {Array} shortNames The list of short names for emoji suggestions to show\n */\nconst render = async(root, shortNames) => {\n const renderContext = {\n emojis: shortNames.map((shortName, index) => {\n return {\n active: index === 0,\n emojitext: getEmojiTextFromShortName(shortName),\n displayshortname: `:${shortName}:`,\n shortname: shortName,\n unified: EmojiData.byShortName[shortName]\n };\n })\n };\n const html = await renderTemplate('core/emoji/auto_complete', renderContext);\n root.innerHTML = html;\n};\n\n/**\n * Get the list of emoji short names that include the given search term. If\n * the search term is an empty string then the list of recently used emojis\n * will be returned.\n *\n * @param {String} searchTerm Text to match on\n * @param {Number} limit Maximum number of results to return\n * @return {Array}\n */\nconst searchEmojis = (searchTerm, limit) => {\n if (searchTerm === '') {\n return getRecentEmojis().map(data => data.shortnames[0]).slice(0, limit);\n } else {\n searchTerm = searchTerm.toLowerCase();\n return Object.keys(EmojiData.byShortName)\n .filter(shortName => shortName.includes(searchTerm))\n .slice(0, limit);\n }\n};\n\n/**\n * Get the current word at the given position (index) within the text.\n *\n * @param {String} text The text to process\n * @param {Number} position The position (index) within the text to match the word\n * @return {String}\n */\nconst getWordFromPosition = (text, position) => {\n const startMatches = text.slice(0, position).match(/(\\S*)$/);\n const endMatches = text.slice(position).match(/^(\\S*)/);\n let startText = '';\n let endText = '';\n\n if (startMatches) {\n startText = startMatches[startMatches.length - 1];\n }\n\n if (endMatches) {\n endText = endMatches[endMatches.length - 1];\n }\n\n return `${startText}${endText}`;\n};\n\n/**\n * Check if the given text is a full short name, i.e. has leading and trialing colon\n * characters.\n *\n * @param {String} text The text to process\n * @return {Bool}\n */\nconst isCompleteShortName = text => /^:[^:\\s]+:$/.test(text);\n\n/**\n * Check if the given text is a partial short name, i.e. has a leading colon but no\n * trailing colon.\n *\n * @param {String} text The text to process\n * @return {Bool}\n */\nconst isPartialShortName = text => /^:[^:\\s]*$/.test(text);\n\n/**\n * Remove the colon characters from the given text.\n *\n * @param {String} text The text to process\n * @return {String}\n */\nconst getShortNameFromText = text => text.replace(/:/g, '');\n\n/**\n * Get the currently active emoji button element in the list of suggestions.\n *\n * @param {Element} root The emoji auto complete container element\n * @return {Element|null}\n */\nconst getActiveEmojiSuggestion = (root) => {\n return root.querySelector(SELECTORS.ACTIVE_EMOJI_BUTTON);\n};\n\n/**\n * Make the previous sibling of the current active emoji active.\n *\n * @param {Element} root The emoji auto complete container element\n */\nconst selectPreviousEmojiSuggestion = (root) => {\n const activeEmojiSuggestion = getActiveEmojiSuggestion(root);\n const previousSuggestion = activeEmojiSuggestion.previousElementSibling;\n\n if (previousSuggestion) {\n activeEmojiSuggestion.classList.remove('active');\n previousSuggestion.classList.add('active');\n previousSuggestion.scrollIntoView({behaviour: 'smooth', inline: 'center'});\n }\n};\n\n/**\n * Make the next sibling to the current active emoji active.\n *\n * @param {Element} root The emoji auto complete container element\n */\nconst selectNextEmojiSuggestion = (root) => {\n const activeEmojiSuggestion = getActiveEmojiSuggestion(root);\n const nextSuggestion = activeEmojiSuggestion.nextElementSibling;\n\n if (nextSuggestion) {\n activeEmojiSuggestion.classList.remove('active');\n nextSuggestion.classList.add('active');\n nextSuggestion.scrollIntoView({behaviour: 'smooth', inline: 'center'});\n }\n};\n\n/**\n * Trigger the select callback for the given emoji button element.\n *\n * @param {Element} element The emoji button element\n * @param {Function} selectCallback The callback for when the user selects an emoji\n */\nconst selectEmojiElement = (element, selectCallback) => {\n const shortName = element.getAttribute('data-short-name');\n const unified = element.getAttribute('data-unified');\n addRecentEmoji(unified, shortName);\n selectCallback(element.innerHTML.trim());\n};\n\n/**\n * Initialise the emoji auto complete.\n *\n * @method\n * @param {Element} root The root container element for the auto complete\n * @param {Element} textArea The text area element to monitor for auto complete\n * @param {Function} hasSuggestionCallback Callback for when there are auto-complete suggestions\n * @param {Function} selectCallback Callback for when the user selects an emoji\n */\nexport default (root, textArea, hasSuggestionCallback, selectCallback) => {\n let hasSuggestions = false;\n let previousSearchText = '';\n\n // Debounce the listener so that each keypress delays the execution of the handler. The\n // handler should only run 200 milliseconds after the last keypress.\n textArea.addEventListener('keyup', debounce(() => {\n // This is a \"keyup\" listener so that it only executes after the text area value\n // has been updated.\n const text = textArea.value;\n const cursorPos = textArea.selectionStart;\n const searchText = getWordFromPosition(text, cursorPos);\n\n if (searchText === previousSearchText) {\n // Nothing has changed so no need to take any action.\n return;\n } else {\n previousSearchText = searchText;\n }\n\n if (isCompleteShortName(searchText)) {\n // If the user has entered a full short name (with leading and trialing colons)\n // then see if we can find a match for it and auto complete it.\n const shortName = getShortNameFromText(searchText);\n const emojiText = getEmojiTextFromShortName(shortName);\n hasSuggestions = false;\n if (emojiText) {\n addRecentEmoji(EmojiData.byShortName[shortName], shortName);\n selectCallback(emojiText);\n }\n } else if (isPartialShortName(searchText)) {\n // If the user has entered a partial short name (leading colon but no trailing) then\n // search on the text to see if we can find some suggestions for them.\n const suggestions = searchEmojis(getShortNameFromText(searchText), SUGGESTION_LIMIT);\n\n if (suggestions.length) {\n render(root, suggestions);\n hasSuggestions = true;\n } else {\n hasSuggestions = false;\n }\n } else {\n hasSuggestions = false;\n }\n\n hasSuggestionCallback(hasSuggestions);\n }, INPUT_DEBOUNCE_TIMER));\n\n textArea.addEventListener('keydown', (e) => {\n if (hasSuggestions) {\n const isModifierPressed = (e.shiftKey || e.metaKey || e.altKey || e.ctrlKey);\n if (!isModifierPressed) {\n switch (e.which) {\n case KeyCodes.escape:\n // Escape key closes the auto complete.\n hasSuggestions = false;\n hasSuggestionCallback(false);\n break;\n case KeyCodes.arrowLeft:\n // Arrow keys navigate through the list of suggetions.\n selectPreviousEmojiSuggestion(root);\n e.preventDefault();\n break;\n case KeyCodes.arrowRight:\n // Arrow keys navigate through the list of suggetions.\n selectNextEmojiSuggestion(root);\n e.preventDefault();\n break;\n case KeyCodes.enter:\n // Enter key selects the current suggestion.\n selectEmojiElement(getActiveEmojiSuggestion(root), selectCallback);\n e.preventDefault();\n e.stopPropagation();\n break;\n }\n }\n }\n });\n\n root.addEventListener('click', (e) => {\n const target = e.target;\n if (target.matches(SELECTORS.EMOJI_BUTTON)) {\n selectEmojiElement(target, selectCallback);\n }\n });\n};\n"],"file":"auto_complete.min.js"} \ No newline at end of file diff --git a/lib/amd/build/emoji/data.min.js.map b/lib/amd/build/emoji/data.min.js.map index a6a2840af49d6..580f079308c81 100644 --- a/lib/amd/build/emoji/data.min.js.map +++ b/lib/amd/build/emoji/data.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../src/emoji/data.js"],"names":[],"mappings":"+JAsB0B,CACtB,CACI,KAAQ,mBADZ,CAEI,OAAU,CACN,CACI,QAAW,OADf,CAEI,WAAc,CACV,UADU,CAFlB,CADM,CAON,CACI,QAAW,OADf,CAEI,WAAc,CACV,QADU,CAFlB,CAPM,CAaN,CACI,QAAW,OADf,CAEI,WAAc,CACV,OADU,CAFlB,CAbM,CAmBN,CACI,QAAW,OADf,CAEI,WAAc,CACV,MADU,CAFlB,CAnBM,CAyBN,CACI,QAAW,OADf,CAEI,WAAc,CACV,UADU,CAFlB,CAzBM,CA+BN,CACI,QAAW,OADf,CAEI,WAAc,CACV,aADU,CAFlB,CA/BM,CAqCN,CACI,QAAW,OADf,CAEI,WAAc,CACV,+BADU,CAFlB,CArCM,CA2CN,CACI,QAAW,OADf,CAEI,WAAc,CACV,KADU,CAFlB,CA3CM,CAiDN,CACI,QAAW,OADf,CAEI,WAAc,CACV,uBADU,CAFlB,CAjDM,CAuDN,CACI,QAAW,OADf,CAEI,WAAc,CACV,kBADU,CAFlB,CAvDM,CA6DN,CACI,QAAW,OADf,CAEI,WAAc,CACV,MADU,CAFlB,CA7DM,CAmEN,CACI,QAAW,OADf,CAEI,WAAc,CACV,OADU,CAFlB,CAnEM,CAyEN,CACI,QAAW,OADf,CAEI,WAAc,CACV,UADU,CAFlB,CAzEM,CA+EN,CACI,QAAW,OADf,CAEI,WAAc,CACV,4BADU,CAFlB,CA/EM,CAqFN,CACI,QAAW,OADf,CAEI,WAAc,CACV,YADU,CAFlB,CArFM,CA2FN,CACI,QAAW,OADf,CAEI,WAAc,CACV,aADU,CAFlB,CA3FM,CAiGN,CACI,QAAW,OADf,CAEI,WAAc,CACV,eADU,CAFlB,CAjGM,CAuGN,CACI,QAAW,OADf,CAEI,WAAc,CACV,SADU,CAFlB,CAvGM,CA6GN,CACI,QAAW,WADf,CAEI,WAAc,CACV,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AlvDF,CAmvDvB,yBAA4B,WAnvDL,CAovDvB,UAAa,WApvDU,CAqvDvB,QAAW,WArvDY,CAsvDvB,EAAK,MAtvDkB,CAuvDvB,4BAA+B,MAvvDR,CAwvDvB,SAAY,MAxvDW,CAyvDvB,cAAiB,MAzvDM,CA0vDvB,iBAAoB,MA1vDG,CA2vDvB,YAAe,MA3vDQ,CA4vDvB,sCAAyC,WA5vDlB,CA6vDvB,MAAS,WA7vDc,CA8vDvB,gBAAmB,MA9vDI,CA+vDvB,iBAAoB,MA/vDG,CAgwDvB,oBAAuB,MAhwDA,CAiwDvB,YAAe,WAjwDQ,CAkwDvB,WAAc,MAlwDS,CAmwDvB,KAAQ,MAnwDe,CAowDvB,iBAAoB,WApwDG,CAqwDvB,mBAAsB,WArwDC,CAswDvB,WAAc,WAtwDS,CAuwDvB,SAAY,WAvwDW,CAwwDvB,WAAc,WAxwDS,CAywDvB,mBAAsB,MAzwDC,CA0wDvB,mBAAsB,MA1wDC,CA2wDvB,KAAQ,MA3wDe,CA4wDvB,EAAK,MA5wDkB,CA6wDvB,UAAa,WA7wDU,CA8wDvB,sBAAyB,WA9wDF,CA+wDvB,gBAAmB,WA/wDI,CAgxDvB,OAAU,WAhxDa,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Emoji data based on the data available from https://github.com/iamcal/emoji-data.\n *\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport const byCategory = [\n {\n \"name\": \"Smileys & Emotion\",\n \"emojis\": [\n {\n \"unified\": \"1F600\",\n \"shortnames\": [\n \"grinning\"\n ]\n },\n {\n \"unified\": \"1F603\",\n \"shortnames\": [\n \"smiley\"\n ]\n },\n {\n \"unified\": \"1F604\",\n \"shortnames\": [\n \"smile\"\n ]\n },\n {\n \"unified\": \"1F601\",\n \"shortnames\": [\n \"grin\"\n ]\n },\n {\n \"unified\": \"1F606\",\n \"shortnames\": [\n \"laughing\"\n ]\n },\n {\n \"unified\": \"1F605\",\n \"shortnames\": [\n \"sweat_smile\"\n ]\n },\n {\n \"unified\": \"1F923\",\n \"shortnames\": [\n \"rolling_on_the_floor_laughing\"\n ]\n },\n {\n \"unified\": \"1F602\",\n \"shortnames\": [\n \"joy\"\n ]\n },\n {\n \"unified\": \"1F642\",\n \"shortnames\": [\n \"slightly_smiling_face\"\n ]\n },\n {\n \"unified\": \"1F643\",\n \"shortnames\": [\n \"upside_down_face\"\n ]\n },\n {\n \"unified\": \"1F609\",\n \"shortnames\": [\n \"wink\"\n ]\n },\n {\n \"unified\": \"1F60A\",\n \"shortnames\": [\n \"blush\"\n ]\n },\n {\n \"unified\": \"1F607\",\n \"shortnames\": [\n \"innocent\"\n ]\n },\n {\n \"unified\": \"1F970\",\n \"shortnames\": [\n \"smiling_face_with_3_hearts\"\n ]\n },\n {\n \"unified\": \"1F60D\",\n \"shortnames\": [\n \"heart_eyes\"\n ]\n },\n {\n \"unified\": \"1F929\",\n \"shortnames\": [\n \"star-struck\"\n ]\n },\n {\n \"unified\": \"1F618\",\n \"shortnames\": [\n \"kissing_heart\"\n ]\n },\n {\n \"unified\": \"1F617\",\n \"shortnames\": [\n \"kissing\"\n ]\n },\n {\n \"unified\": \"263A-FE0F\",\n \"shortnames\": [\n \"relaxed\"\n ]\n },\n {\n \"unified\": \"1F61A\",\n \"shortnames\": [\n \"kissing_closed_eyes\"\n ]\n },\n {\n \"unified\": \"1F619\",\n \"shortnames\": [\n \"kissing_smiling_eyes\"\n ]\n },\n {\n \"unified\": \"1F972\",\n \"shortnames\": [\n \"smiling_face_with_tear\"\n ]\n },\n {\n \"unified\": \"1F60B\",\n \"shortnames\": [\n \"yum\"\n ]\n },\n {\n \"unified\": \"1F61B\",\n \"shortnames\": [\n \"stuck_out_tongue\"\n ]\n },\n {\n \"unified\": \"1F61C\",\n \"shortnames\": [\n \"stuck_out_tongue_winking_eye\"\n ]\n },\n {\n \"unified\": \"1F92A\",\n \"shortnames\": [\n \"zany_face\"\n ]\n },\n {\n \"unified\": \"1F61D\",\n \"shortnames\": [\n \"stuck_out_tongue_closed_eyes\"\n ]\n },\n {\n \"unified\": \"1F911\",\n \"shortnames\": [\n \"money_mouth_face\"\n ]\n },\n {\n \"unified\": \"1F917\",\n \"shortnames\": [\n \"hugging_face\"\n ]\n },\n {\n \"unified\": \"1F92D\",\n \"shortnames\": [\n \"face_with_hand_over_mouth\"\n ]\n },\n {\n \"unified\": \"1F92B\",\n \"shortnames\": [\n \"shushing_face\"\n ]\n },\n {\n \"unified\": \"1F914\",\n \"shortnames\": [\n \"thinking_face\"\n ]\n },\n {\n \"unified\": \"1F910\",\n \"shortnames\": [\n \"zipper_mouth_face\"\n ]\n },\n {\n \"unified\": \"1F928\",\n \"shortnames\": [\n \"face_with_raised_eyebrow\"\n ]\n },\n {\n \"unified\": \"1F610\",\n \"shortnames\": [\n \"neutral_face\"\n ]\n },\n {\n \"unified\": \"1F611\",\n \"shortnames\": [\n \"expressionless\"\n ]\n },\n {\n \"unified\": \"1F636\",\n \"shortnames\": [\n \"no_mouth\"\n ]\n },\n {\n \"unified\": \"1F60F\",\n \"shortnames\": [\n \"smirk\"\n ]\n },\n {\n \"unified\": \"1F612\",\n \"shortnames\": [\n \"unamused\"\n ]\n },\n {\n \"unified\": \"1F644\",\n \"shortnames\": [\n \"face_with_rolling_eyes\"\n ]\n },\n {\n \"unified\": \"1F62C\",\n \"shortnames\": [\n \"grimacing\"\n ]\n },\n {\n \"unified\": \"1F925\",\n \"shortnames\": [\n \"lying_face\"\n ]\n },\n {\n \"unified\": \"1F60C\",\n \"shortnames\": [\n \"relieved\"\n ]\n },\n {\n \"unified\": \"1F614\",\n \"shortnames\": [\n \"pensive\"\n ]\n },\n {\n \"unified\": \"1F62A\",\n \"shortnames\": [\n \"sleepy\"\n ]\n },\n {\n \"unified\": \"1F924\",\n \"shortnames\": [\n \"drooling_face\"\n ]\n },\n {\n \"unified\": \"1F634\",\n \"shortnames\": [\n \"sleeping\"\n ]\n },\n {\n \"unified\": \"1F637\",\n \"shortnames\": [\n \"mask\"\n ]\n },\n {\n \"unified\": \"1F912\",\n \"shortnames\": [\n \"face_with_thermometer\"\n ]\n },\n {\n \"unified\": \"1F915\",\n \"shortnames\": [\n \"face_with_head_bandage\"\n ]\n },\n {\n \"unified\": \"1F922\",\n \"shortnames\": [\n \"nauseated_face\"\n ]\n },\n {\n \"unified\": \"1F92E\",\n \"shortnames\": [\n \"face_vomiting\"\n ]\n },\n {\n \"unified\": \"1F927\",\n \"shortnames\": [\n \"sneezing_face\"\n ]\n },\n {\n \"unified\": \"1F975\",\n \"shortnames\": [\n \"hot_face\"\n ]\n },\n {\n \"unified\": \"1F976\",\n \"shortnames\": [\n \"cold_face\"\n ]\n },\n {\n \"unified\": \"1F974\",\n \"shortnames\": [\n \"woozy_face\"\n ]\n },\n {\n \"unified\": \"1F635\",\n \"shortnames\": [\n \"dizzy_face\"\n ]\n },\n {\n \"unified\": \"1F92F\",\n \"shortnames\": [\n \"exploding_head\"\n ]\n },\n {\n \"unified\": \"1F920\",\n \"shortnames\": [\n \"face_with_cowboy_hat\"\n ]\n },\n {\n \"unified\": \"1F973\",\n \"shortnames\": [\n \"partying_face\"\n ]\n },\n {\n \"unified\": \"1F978\",\n \"shortnames\": [\n \"disguised_face\"\n ]\n },\n {\n \"unified\": \"1F60E\",\n \"shortnames\": [\n \"sunglasses\"\n ]\n },\n {\n \"unified\": \"1F913\",\n \"shortnames\": [\n \"nerd_face\"\n ]\n },\n {\n \"unified\": \"1F9D0\",\n \"shortnames\": [\n \"face_with_monocle\"\n ]\n },\n {\n \"unified\": \"1F615\",\n \"shortnames\": [\n \"confused\"\n ]\n },\n {\n \"unified\": \"1F61F\",\n \"shortnames\": [\n \"worried\"\n ]\n },\n {\n \"unified\": \"1F641\",\n \"shortnames\": [\n \"slightly_frowning_face\"\n ]\n },\n {\n \"unified\": \"2639-FE0F\",\n \"shortnames\": [\n \"white_frowning_face\"\n ]\n },\n {\n \"unified\": \"1F62E\",\n \"shortnames\": [\n \"open_mouth\"\n ]\n },\n {\n \"unified\": \"1F62F\",\n \"shortnames\": [\n \"hushed\"\n ]\n },\n {\n \"unified\": \"1F632\",\n \"shortnames\": [\n \"astonished\"\n ]\n },\n {\n \"unified\": \"1F633\",\n \"shortnames\": [\n \"flushed\"\n ]\n },\n {\n \"unified\": \"1F97A\",\n \"shortnames\": [\n \"pleading_face\"\n ]\n },\n {\n \"unified\": \"1F626\",\n \"shortnames\": [\n \"frowning\"\n ]\n },\n {\n \"unified\": \"1F627\",\n \"shortnames\": [\n \"anguished\"\n ]\n },\n {\n \"unified\": \"1F628\",\n \"shortnames\": [\n \"fearful\"\n ]\n },\n {\n \"unified\": \"1F630\",\n \"shortnames\": [\n \"cold_sweat\"\n ]\n },\n {\n \"unified\": \"1F625\",\n \"shortnames\": [\n \"disappointed_relieved\"\n ]\n },\n {\n \"unified\": \"1F622\",\n \"shortnames\": [\n \"cry\"\n ]\n },\n {\n \"unified\": \"1F62D\",\n \"shortnames\": [\n \"sob\"\n ]\n },\n {\n \"unified\": \"1F631\",\n \"shortnames\": [\n \"scream\"\n ]\n },\n {\n \"unified\": \"1F616\",\n \"shortnames\": [\n \"confounded\"\n ]\n },\n {\n \"unified\": \"1F623\",\n \"shortnames\": [\n \"persevere\"\n ]\n },\n {\n \"unified\": \"1F61E\",\n \"shortnames\": [\n \"disappointed\"\n ]\n },\n {\n \"unified\": \"1F613\",\n \"shortnames\": [\n \"sweat\"\n ]\n },\n {\n \"unified\": \"1F629\",\n \"shortnames\": [\n \"weary\"\n ]\n },\n {\n \"unified\": \"1F62B\",\n \"shortnames\": [\n \"tired_face\"\n ]\n },\n {\n \"unified\": \"1F971\",\n \"shortnames\": [\n \"yawning_face\"\n ]\n },\n {\n \"unified\": \"1F624\",\n \"shortnames\": [\n \"triumph\"\n ]\n },\n {\n \"unified\": \"1F621\",\n \"shortnames\": [\n \"rage\"\n ]\n },\n {\n \"unified\": \"1F620\",\n \"shortnames\": [\n \"angry\"\n ]\n },\n {\n \"unified\": \"1F92C\",\n \"shortnames\": [\n \"face_with_symbols_on_mouth\"\n ]\n },\n {\n \"unified\": \"1F608\",\n \"shortnames\": [\n \"smiling_imp\"\n ]\n },\n {\n \"unified\": \"1F47F\",\n \"shortnames\": [\n \"imp\"\n ]\n },\n {\n \"unified\": \"1F480\",\n \"shortnames\": [\n \"skull\"\n ]\n },\n {\n \"unified\": \"2620-FE0F\",\n \"shortnames\": [\n \"skull_and_crossbones\"\n ]\n },\n {\n \"unified\": \"1F4A9\",\n \"shortnames\": [\n \"hankey\"\n ]\n },\n {\n \"unified\": \"1F921\",\n \"shortnames\": [\n \"clown_face\"\n ]\n },\n {\n \"unified\": \"1F479\",\n \"shortnames\": [\n \"japanese_ogre\"\n ]\n },\n {\n \"unified\": \"1F47A\",\n \"shortnames\": [\n \"japanese_goblin\"\n ]\n },\n {\n \"unified\": \"1F47B\",\n \"shortnames\": [\n \"ghost\"\n ]\n },\n {\n \"unified\": \"1F47D\",\n \"shortnames\": [\n \"alien\"\n ]\n },\n {\n \"unified\": \"1F47E\",\n \"shortnames\": [\n \"space_invader\"\n ]\n },\n {\n \"unified\": \"1F916\",\n \"shortnames\": [\n \"robot_face\"\n ]\n },\n {\n \"unified\": \"1F63A\",\n \"shortnames\": [\n \"smiley_cat\"\n ]\n },\n {\n \"unified\": \"1F638\",\n \"shortnames\": [\n \"smile_cat\"\n ]\n },\n {\n \"unified\": \"1F639\",\n \"shortnames\": [\n \"joy_cat\"\n ]\n },\n {\n \"unified\": \"1F63B\",\n \"shortnames\": [\n \"heart_eyes_cat\"\n ]\n },\n {\n \"unified\": \"1F63C\",\n \"shortnames\": [\n \"smirk_cat\"\n ]\n },\n {\n \"unified\": \"1F63D\",\n \"shortnames\": [\n \"kissing_cat\"\n ]\n },\n {\n \"unified\": \"1F640\",\n \"shortnames\": [\n \"scream_cat\"\n ]\n },\n {\n \"unified\": \"1F63F\",\n \"shortnames\": [\n \"crying_cat_face\"\n ]\n },\n {\n \"unified\": \"1F63E\",\n \"shortnames\": [\n \"pouting_cat\"\n ]\n },\n {\n \"unified\": \"1F648\",\n \"shortnames\": [\n \"see_no_evil\"\n ]\n },\n {\n \"unified\": \"1F649\",\n \"shortnames\": [\n \"hear_no_evil\"\n ]\n },\n {\n \"unified\": \"1F64A\",\n \"shortnames\": [\n \"speak_no_evil\"\n ]\n },\n {\n \"unified\": \"1F48B\",\n \"shortnames\": [\n \"kiss\"\n ]\n },\n {\n \"unified\": \"1F48C\",\n \"shortnames\": [\n \"love_letter\"\n ]\n },\n {\n \"unified\": \"1F498\",\n \"shortnames\": [\n \"cupid\"\n ]\n },\n {\n \"unified\": \"1F49D\",\n \"shortnames\": [\n \"gift_heart\"\n ]\n },\n {\n \"unified\": \"1F496\",\n \"shortnames\": [\n \"sparkling_heart\"\n ]\n },\n {\n \"unified\": \"1F497\",\n \"shortnames\": [\n \"heartpulse\"\n ]\n },\n {\n \"unified\": \"1F493\",\n \"shortnames\": [\n \"heartbeat\"\n ]\n },\n {\n \"unified\": \"1F49E\",\n \"shortnames\": [\n \"revolving_hearts\"\n ]\n },\n {\n \"unified\": \"1F495\",\n \"shortnames\": [\n \"two_hearts\"\n ]\n },\n {\n \"unified\": \"1F49F\",\n \"shortnames\": [\n \"heart_decoration\"\n ]\n },\n {\n \"unified\": \"2763-FE0F\",\n \"shortnames\": [\n \"heavy_heart_exclamation_mark_ornament\"\n ]\n },\n {\n \"unified\": \"1F494\",\n \"shortnames\": [\n \"broken_heart\"\n ]\n },\n {\n \"unified\": \"2764-FE0F\",\n \"shortnames\": [\n \"heart\"\n ]\n },\n {\n \"unified\": \"1F9E1\",\n \"shortnames\": [\n \"orange_heart\"\n ]\n },\n {\n \"unified\": \"1F49B\",\n \"shortnames\": [\n \"yellow_heart\"\n ]\n },\n {\n \"unified\": \"1F49A\",\n \"shortnames\": [\n \"green_heart\"\n ]\n },\n {\n \"unified\": \"1F499\",\n \"shortnames\": [\n \"blue_heart\"\n ]\n },\n {\n \"unified\": \"1F49C\",\n \"shortnames\": [\n \"purple_heart\"\n ]\n },\n {\n \"unified\": \"1F90E\",\n \"shortnames\": [\n \"brown_heart\"\n ]\n },\n {\n \"unified\": \"1F5A4\",\n \"shortnames\": [\n \"black_heart\"\n ]\n },\n {\n \"unified\": \"1F90D\",\n \"shortnames\": [\n \"white_heart\"\n ]\n },\n {\n \"unified\": \"1F4AF\",\n \"shortnames\": [\n \"100\"\n ]\n },\n {\n \"unified\": \"1F4A2\",\n \"shortnames\": [\n \"anger\"\n ]\n },\n {\n \"unified\": \"1F4A5\",\n \"shortnames\": [\n \"boom\"\n ]\n },\n {\n \"unified\": \"1F4AB\",\n \"shortnames\": [\n \"dizzy\"\n ]\n },\n {\n \"unified\": \"1F4A6\",\n \"shortnames\": [\n \"sweat_drops\"\n ]\n },\n {\n \"unified\": \"1F4A8\",\n \"shortnames\": [\n \"dash\"\n ]\n },\n {\n \"unified\": \"1F573-FE0F\",\n \"shortnames\": [\n \"hole\"\n ]\n },\n {\n \"unified\": \"1F4A3\",\n \"shortnames\": [\n \"bomb\"\n ]\n },\n {\n \"unified\": \"1F4AC\",\n \"shortnames\": [\n \"speech_balloon\"\n ]\n },\n {\n \"unified\": \"1F441-FE0F-200D-1F5E8-FE0F\",\n \"shortnames\": [\n \"eye-in-speech-bubble\"\n ]\n },\n {\n \"unified\": \"1F5E8-FE0F\",\n \"shortnames\": [\n \"left_speech_bubble\"\n ]\n },\n {\n \"unified\": \"1F5EF-FE0F\",\n \"shortnames\": [\n \"right_anger_bubble\"\n ]\n },\n {\n \"unified\": \"1F4AD\",\n \"shortnames\": [\n \"thought_balloon\"\n ]\n },\n {\n \"unified\": \"1F4A4\",\n \"shortnames\": [\n \"zzz\"\n ]\n }\n ]\n },\n {\n \"name\": \"People & Body\",\n \"emojis\": [\n {\n \"unified\": \"1F44B\",\n \"shortnames\": [\n \"wave\"\n ]\n },\n {\n \"unified\": \"1F91A\",\n \"shortnames\": [\n \"raised_back_of_hand\"\n ]\n },\n {\n \"unified\": \"1F590-FE0F\",\n \"shortnames\": [\n \"raised_hand_with_fingers_splayed\"\n ]\n },\n {\n \"unified\": \"270B\",\n \"shortnames\": [\n \"hand\"\n ]\n },\n {\n \"unified\": \"1F596\",\n \"shortnames\": [\n \"spock-hand\"\n ]\n },\n {\n \"unified\": \"1F44C\",\n \"shortnames\": [\n \"ok_hand\"\n ]\n },\n {\n \"unified\": \"1F90C\",\n \"shortnames\": [\n \"pinched_fingers\"\n ]\n },\n {\n \"unified\": \"1F90F\",\n \"shortnames\": [\n \"pinching_hand\"\n ]\n },\n {\n \"unified\": \"270C-FE0F\",\n \"shortnames\": [\n \"v\"\n ]\n },\n {\n \"unified\": \"1F91E\",\n \"shortnames\": [\n \"crossed_fingers\"\n ]\n },\n {\n \"unified\": \"1F91F\",\n \"shortnames\": [\n \"i_love_you_hand_sign\"\n ]\n },\n {\n \"unified\": \"1F918\",\n \"shortnames\": [\n \"the_horns\"\n ]\n },\n {\n \"unified\": \"1F919\",\n \"shortnames\": [\n \"call_me_hand\"\n ]\n },\n {\n \"unified\": \"1F448\",\n \"shortnames\": [\n \"point_left\"\n ]\n },\n {\n \"unified\": \"1F449\",\n \"shortnames\": [\n \"point_right\"\n ]\n },\n {\n \"unified\": \"1F446\",\n \"shortnames\": [\n \"point_up_2\"\n ]\n },\n {\n \"unified\": \"1F595\",\n \"shortnames\": [\n \"middle_finger\"\n ]\n },\n {\n \"unified\": \"1F447\",\n \"shortnames\": [\n \"point_down\"\n ]\n },\n {\n \"unified\": \"261D-FE0F\",\n \"shortnames\": [\n \"point_up\"\n ]\n },\n {\n \"unified\": \"1F44D\",\n \"shortnames\": [\n \"+1\"\n ]\n },\n {\n \"unified\": \"1F44E\",\n \"shortnames\": [\n \"-1\"\n ]\n },\n {\n \"unified\": \"270A\",\n \"shortnames\": [\n \"fist\"\n ]\n },\n {\n \"unified\": \"1F44A\",\n \"shortnames\": [\n \"facepunch\"\n ]\n },\n {\n \"unified\": \"1F91B\",\n \"shortnames\": [\n \"left-facing_fist\"\n ]\n },\n {\n \"unified\": \"1F91C\",\n \"shortnames\": [\n \"right-facing_fist\"\n ]\n },\n {\n \"unified\": \"1F44F\",\n \"shortnames\": [\n \"clap\"\n ]\n },\n {\n \"unified\": \"1F64C\",\n \"shortnames\": [\n \"raised_hands\"\n ]\n },\n {\n \"unified\": \"1F450\",\n \"shortnames\": [\n \"open_hands\"\n ]\n },\n {\n \"unified\": \"1F932\",\n \"shortnames\": [\n \"palms_up_together\"\n ]\n },\n {\n \"unified\": \"1F91D\",\n \"shortnames\": [\n \"handshake\"\n ]\n },\n {\n \"unified\": \"1F64F\",\n \"shortnames\": [\n \"pray\"\n ]\n },\n {\n \"unified\": \"270D-FE0F\",\n \"shortnames\": [\n \"writing_hand\"\n ]\n },\n {\n \"unified\": \"1F485\",\n \"shortnames\": [\n \"nail_care\"\n ]\n },\n {\n \"unified\": \"1F933\",\n \"shortnames\": [\n \"selfie\"\n ]\n },\n {\n \"unified\": \"1F4AA\",\n \"shortnames\": [\n \"muscle\"\n ]\n },\n {\n \"unified\": \"1F9BE\",\n \"shortnames\": [\n \"mechanical_arm\"\n ]\n },\n {\n \"unified\": \"1F9BF\",\n \"shortnames\": [\n \"mechanical_leg\"\n ]\n },\n {\n \"unified\": \"1F9B5\",\n \"shortnames\": [\n \"leg\"\n ]\n },\n {\n \"unified\": \"1F9B6\",\n \"shortnames\": [\n \"foot\"\n ]\n },\n {\n \"unified\": \"1F442\",\n \"shortnames\": [\n \"ear\"\n ]\n },\n {\n \"unified\": \"1F9BB\",\n \"shortnames\": [\n \"ear_with_hearing_aid\"\n ]\n },\n {\n \"unified\": \"1F443\",\n \"shortnames\": [\n \"nose\"\n ]\n },\n {\n \"unified\": \"1F9E0\",\n \"shortnames\": [\n \"brain\"\n ]\n },\n {\n \"unified\": \"1FAC0\",\n \"shortnames\": [\n \"anatomical_heart\"\n ]\n },\n {\n \"unified\": \"1FAC1\",\n \"shortnames\": [\n \"lungs\"\n ]\n },\n {\n \"unified\": \"1F9B7\",\n \"shortnames\": [\n \"tooth\"\n ]\n },\n {\n \"unified\": \"1F9B4\",\n \"shortnames\": [\n \"bone\"\n ]\n },\n {\n \"unified\": \"1F440\",\n \"shortnames\": [\n \"eyes\"\n ]\n },\n {\n \"unified\": \"1F441-FE0F\",\n \"shortnames\": [\n \"eye\"\n ]\n },\n {\n \"unified\": \"1F445\",\n \"shortnames\": [\n \"tongue\"\n ]\n },\n {\n \"unified\": \"1F444\",\n \"shortnames\": [\n \"lips\"\n ]\n },\n {\n \"unified\": \"1F476\",\n \"shortnames\": [\n \"baby\"\n ]\n },\n {\n \"unified\": \"1F9D2\",\n \"shortnames\": [\n \"child\"\n ]\n },\n {\n \"unified\": \"1F466\",\n \"shortnames\": [\n \"boy\"\n ]\n },\n {\n \"unified\": \"1F467\",\n \"shortnames\": [\n \"girl\"\n ]\n },\n {\n \"unified\": \"1F9D1\",\n \"shortnames\": [\n \"adult\"\n ]\n },\n {\n \"unified\": \"1F468\",\n \"shortnames\": [\n \"man\"\n ]\n },\n {\n \"unified\": \"1F9D4\",\n \"shortnames\": [\n \"bearded_person\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9B0\",\n \"shortnames\": [\n \"red_haired_man\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9B1\",\n \"shortnames\": [\n \"curly_haired_man\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9B3\",\n \"shortnames\": [\n \"white_haired_man\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9B2\",\n \"shortnames\": [\n \"bald_man\"\n ]\n },\n {\n \"unified\": \"1F469\",\n \"shortnames\": [\n \"woman\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9B0\",\n \"shortnames\": [\n \"red_haired_woman\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9B0\",\n \"shortnames\": [\n \"red_haired_person\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9B1\",\n \"shortnames\": [\n \"curly_haired_woman\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9B1\",\n \"shortnames\": [\n \"curly_haired_person\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9B3\",\n \"shortnames\": [\n \"white_haired_woman\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9B3\",\n \"shortnames\": [\n \"white_haired_person\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9B2\",\n \"shortnames\": [\n \"bald_woman\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9B2\",\n \"shortnames\": [\n \"bald_person\"\n ]\n },\n {\n \"unified\": \"1F471-200D-2640-FE0F\",\n \"shortnames\": [\n \"blond-haired-woman\"\n ]\n },\n {\n \"unified\": \"1F471-200D-2642-FE0F\",\n \"shortnames\": [\n \"blond-haired-man\",\n \"person_with_blond_hair\"\n ]\n },\n {\n \"unified\": \"1F9D3\",\n \"shortnames\": [\n \"older_adult\"\n ]\n },\n {\n \"unified\": \"1F474\",\n \"shortnames\": [\n \"older_man\"\n ]\n },\n {\n \"unified\": \"1F475\",\n \"shortnames\": [\n \"older_woman\"\n ]\n },\n {\n \"unified\": \"1F64D-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-frowning\"\n ]\n },\n {\n \"unified\": \"1F64D-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-frowning\",\n \"person_frowning\"\n ]\n },\n {\n \"unified\": \"1F64E-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-pouting\"\n ]\n },\n {\n \"unified\": \"1F64E-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-pouting\",\n \"person_with_pouting_face\"\n ]\n },\n {\n \"unified\": \"1F645-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-gesturing-no\"\n ]\n },\n {\n \"unified\": \"1F645-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-gesturing-no\",\n \"no_good\"\n ]\n },\n {\n \"unified\": \"1F646-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-gesturing-ok\"\n ]\n },\n {\n \"unified\": \"1F646-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-gesturing-ok\",\n \"ok_woman\"\n ]\n },\n {\n \"unified\": \"1F481-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-tipping-hand\"\n ]\n },\n {\n \"unified\": \"1F481-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-tipping-hand\",\n \"information_desk_person\"\n ]\n },\n {\n \"unified\": \"1F64B-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-raising-hand\"\n ]\n },\n {\n \"unified\": \"1F64B-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-raising-hand\",\n \"raising_hand\"\n ]\n },\n {\n \"unified\": \"1F9CF\",\n \"shortnames\": [\n \"deaf_person\"\n ]\n },\n {\n \"unified\": \"1F9CF-200D-2642-FE0F\",\n \"shortnames\": [\n \"deaf_man\"\n ]\n },\n {\n \"unified\": \"1F9CF-200D-2640-FE0F\",\n \"shortnames\": [\n \"deaf_woman\"\n ]\n },\n {\n \"unified\": \"1F647-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-bowing\",\n \"bow\"\n ]\n },\n {\n \"unified\": \"1F647-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-bowing\"\n ]\n },\n {\n \"unified\": \"1F926\",\n \"shortnames\": [\n \"face_palm\"\n ]\n },\n {\n \"unified\": \"1F926-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-facepalming\"\n ]\n },\n {\n \"unified\": \"1F926-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-facepalming\"\n ]\n },\n {\n \"unified\": \"1F937\",\n \"shortnames\": [\n \"shrug\"\n ]\n },\n {\n \"unified\": \"1F937-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-shrugging\"\n ]\n },\n {\n \"unified\": \"1F937-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-shrugging\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-2695-FE0F\",\n \"shortnames\": [\n \"health_worker\"\n ]\n },\n {\n \"unified\": \"1F468-200D-2695-FE0F\",\n \"shortnames\": [\n \"male-doctor\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2695-FE0F\",\n \"shortnames\": [\n \"female-doctor\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F393\",\n \"shortnames\": [\n \"student\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F393\",\n \"shortnames\": [\n \"male-student\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F393\",\n \"shortnames\": [\n \"female-student\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F3EB\",\n \"shortnames\": [\n \"teacher\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F3EB\",\n \"shortnames\": [\n \"male-teacher\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F3EB\",\n \"shortnames\": [\n \"female-teacher\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-2696-FE0F\",\n \"shortnames\": [\n \"judge\"\n ]\n },\n {\n \"unified\": \"1F468-200D-2696-FE0F\",\n \"shortnames\": [\n \"male-judge\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2696-FE0F\",\n \"shortnames\": [\n \"female-judge\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F33E\",\n \"shortnames\": [\n \"farmer\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F33E\",\n \"shortnames\": [\n \"male-farmer\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F33E\",\n \"shortnames\": [\n \"female-farmer\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F373\",\n \"shortnames\": [\n \"cook\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F373\",\n \"shortnames\": [\n \"male-cook\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F373\",\n \"shortnames\": [\n \"female-cook\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F527\",\n \"shortnames\": [\n \"mechanic\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F527\",\n \"shortnames\": [\n \"male-mechanic\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F527\",\n \"shortnames\": [\n \"female-mechanic\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F3ED\",\n \"shortnames\": [\n \"factory_worker\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F3ED\",\n \"shortnames\": [\n \"male-factory-worker\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F3ED\",\n \"shortnames\": [\n \"female-factory-worker\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F4BC\",\n \"shortnames\": [\n \"office_worker\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F4BC\",\n \"shortnames\": [\n \"male-office-worker\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F4BC\",\n \"shortnames\": [\n \"female-office-worker\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F52C\",\n \"shortnames\": [\n \"scientist\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F52C\",\n \"shortnames\": [\n \"male-scientist\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F52C\",\n \"shortnames\": [\n \"female-scientist\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F4BB\",\n \"shortnames\": [\n \"technologist\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F4BB\",\n \"shortnames\": [\n \"male-technologist\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F4BB\",\n \"shortnames\": [\n \"female-technologist\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F3A4\",\n \"shortnames\": [\n \"singer\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F3A4\",\n \"shortnames\": [\n \"male-singer\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F3A4\",\n \"shortnames\": [\n \"female-singer\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F3A8\",\n \"shortnames\": [\n \"artist\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F3A8\",\n \"shortnames\": [\n \"male-artist\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F3A8\",\n \"shortnames\": [\n \"female-artist\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-2708-FE0F\",\n \"shortnames\": [\n \"pilot\"\n ]\n },\n {\n \"unified\": \"1F468-200D-2708-FE0F\",\n \"shortnames\": [\n \"male-pilot\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2708-FE0F\",\n \"shortnames\": [\n \"female-pilot\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F680\",\n \"shortnames\": [\n \"astronaut\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F680\",\n \"shortnames\": [\n \"male-astronaut\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F680\",\n \"shortnames\": [\n \"female-astronaut\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F692\",\n \"shortnames\": [\n \"firefighter\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F692\",\n \"shortnames\": [\n \"male-firefighter\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F692\",\n \"shortnames\": [\n \"female-firefighter\"\n ]\n },\n {\n \"unified\": \"1F46E-200D-2642-FE0F\",\n \"shortnames\": [\n \"male-police-officer\",\n \"cop\"\n ]\n },\n {\n \"unified\": \"1F46E-200D-2640-FE0F\",\n \"shortnames\": [\n \"female-police-officer\"\n ]\n },\n {\n \"unified\": \"1F575-FE0F-200D-2642-FE0F\",\n \"shortnames\": [\n \"male-detective\",\n \"sleuth_or_spy\"\n ]\n },\n {\n \"unified\": \"1F575-FE0F-200D-2640-FE0F\",\n \"shortnames\": [\n \"female-detective\"\n ]\n },\n {\n \"unified\": \"1F482-200D-2642-FE0F\",\n \"shortnames\": [\n \"male-guard\",\n \"guardsman\"\n ]\n },\n {\n \"unified\": \"1F482-200D-2640-FE0F\",\n \"shortnames\": [\n \"female-guard\"\n ]\n },\n {\n \"unified\": \"1F977\",\n \"shortnames\": [\n \"ninja\"\n ]\n },\n {\n \"unified\": \"1F477-200D-2642-FE0F\",\n \"shortnames\": [\n \"male-construction-worker\",\n \"construction_worker\"\n ]\n },\n {\n \"unified\": \"1F477-200D-2640-FE0F\",\n \"shortnames\": [\n \"female-construction-worker\"\n ]\n },\n {\n \"unified\": \"1F934\",\n \"shortnames\": [\n \"prince\"\n ]\n },\n {\n \"unified\": \"1F478\",\n \"shortnames\": [\n \"princess\"\n ]\n },\n {\n \"unified\": \"1F473-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-wearing-turban\",\n \"man_with_turban\"\n ]\n },\n {\n \"unified\": \"1F473-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-wearing-turban\"\n ]\n },\n {\n \"unified\": \"1F472\",\n \"shortnames\": [\n \"man_with_gua_pi_mao\"\n ]\n },\n {\n \"unified\": \"1F9D5\",\n \"shortnames\": [\n \"person_with_headscarf\"\n ]\n },\n {\n \"unified\": \"1F935-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_in_tuxedo\"\n ]\n },\n {\n \"unified\": \"1F935-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_in_tuxedo\"\n ]\n },\n {\n \"unified\": \"1F470\",\n \"shortnames\": [\n \"bride_with_veil\"\n ]\n },\n {\n \"unified\": \"1F470-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_with_veil\"\n ]\n },\n {\n \"unified\": \"1F470-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_with_veil\"\n ]\n },\n {\n \"unified\": \"1F930\",\n \"shortnames\": [\n \"pregnant_woman\"\n ]\n },\n {\n \"unified\": \"1F931\",\n \"shortnames\": [\n \"breast-feeding\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F37C\",\n \"shortnames\": [\n \"woman_feeding_baby\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F37C\",\n \"shortnames\": [\n \"man_feeding_baby\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F37C\",\n \"shortnames\": [\n \"person_feeding_baby\"\n ]\n },\n {\n \"unified\": \"1F47C\",\n \"shortnames\": [\n \"angel\"\n ]\n },\n {\n \"unified\": \"1F385\",\n \"shortnames\": [\n \"santa\"\n ]\n },\n {\n \"unified\": \"1F936\",\n \"shortnames\": [\n \"mrs_claus\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F384\",\n \"shortnames\": [\n \"mx_claus\"\n ]\n },\n {\n \"unified\": \"1F9B8\",\n \"shortnames\": [\n \"superhero\"\n ]\n },\n {\n \"unified\": \"1F9B8-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_superhero\"\n ]\n },\n {\n \"unified\": \"1F9B8-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_superhero\"\n ]\n },\n {\n \"unified\": \"1F9B9\",\n \"shortnames\": [\n \"supervillain\"\n ]\n },\n {\n \"unified\": \"1F9B9-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_supervillain\"\n ]\n },\n {\n \"unified\": \"1F9B9-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_supervillain\"\n ]\n },\n {\n \"unified\": \"1F9D9-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_mage\"\n ]\n },\n {\n \"unified\": \"1F9D9-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_mage\",\n \"mage\"\n ]\n },\n {\n \"unified\": \"1F9DA-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_fairy\"\n ]\n },\n {\n \"unified\": \"1F9DA-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_fairy\",\n \"fairy\"\n ]\n },\n {\n \"unified\": \"1F9DB-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_vampire\"\n ]\n },\n {\n \"unified\": \"1F9DB-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_vampire\",\n \"vampire\"\n ]\n },\n {\n \"unified\": \"1F9DC-200D-2642-FE0F\",\n \"shortnames\": [\n \"merman\",\n \"merperson\"\n ]\n },\n {\n \"unified\": \"1F9DC-200D-2640-FE0F\",\n \"shortnames\": [\n \"mermaid\"\n ]\n },\n {\n \"unified\": \"1F9DD-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_elf\",\n \"elf\"\n ]\n },\n {\n \"unified\": \"1F9DD-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_elf\"\n ]\n },\n {\n \"unified\": \"1F9DE-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_genie\",\n \"genie\"\n ]\n },\n {\n \"unified\": \"1F9DE-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_genie\"\n ]\n },\n {\n \"unified\": \"1F9DF-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_zombie\",\n \"zombie\"\n ]\n },\n {\n \"unified\": \"1F9DF-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_zombie\"\n ]\n },\n {\n \"unified\": \"1F486-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-getting-massage\"\n ]\n },\n {\n \"unified\": \"1F486-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-getting-massage\",\n \"massage\"\n ]\n },\n {\n \"unified\": \"1F487-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-getting-haircut\"\n ]\n },\n {\n \"unified\": \"1F487-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-getting-haircut\",\n \"haircut\"\n ]\n },\n {\n \"unified\": \"1F6B6-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-walking\",\n \"walking\"\n ]\n },\n {\n \"unified\": \"1F6B6-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-walking\"\n ]\n },\n {\n \"unified\": \"1F9CD\",\n \"shortnames\": [\n \"standing_person\"\n ]\n },\n {\n \"unified\": \"1F9CD-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_standing\"\n ]\n },\n {\n \"unified\": \"1F9CD-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_standing\"\n ]\n },\n {\n \"unified\": \"1F9CE\",\n \"shortnames\": [\n \"kneeling_person\"\n ]\n },\n {\n \"unified\": \"1F9CE-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_kneeling\"\n ]\n },\n {\n \"unified\": \"1F9CE-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_kneeling\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9AF\",\n \"shortnames\": [\n \"person_with_probing_cane\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9AF\",\n \"shortnames\": [\n \"man_with_probing_cane\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9AF\",\n \"shortnames\": [\n \"woman_with_probing_cane\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9BC\",\n \"shortnames\": [\n \"person_in_motorized_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9BC\",\n \"shortnames\": [\n \"man_in_motorized_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9BC\",\n \"shortnames\": [\n \"woman_in_motorized_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9BD\",\n \"shortnames\": [\n \"person_in_manual_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9BD\",\n \"shortnames\": [\n \"man_in_manual_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9BD\",\n \"shortnames\": [\n \"woman_in_manual_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F3C3-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-running\",\n \"runner\"\n ]\n },\n {\n \"unified\": \"1F3C3-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-running\"\n ]\n },\n {\n \"unified\": \"1F483\",\n \"shortnames\": [\n \"dancer\"\n ]\n },\n {\n \"unified\": \"1F57A\",\n \"shortnames\": [\n \"man_dancing\"\n ]\n },\n {\n \"unified\": \"1F574-FE0F\",\n \"shortnames\": [\n \"man_in_business_suit_levitating\"\n ]\n },\n {\n \"unified\": \"1F46F-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-with-bunny-ears-partying\"\n ]\n },\n {\n \"unified\": \"1F46F-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-with-bunny-ears-partying\",\n \"dancers\"\n ]\n },\n {\n \"unified\": \"1F9D6-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_in_steamy_room\",\n \"person_in_steamy_room\"\n ]\n },\n {\n \"unified\": \"1F9D6-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_in_steamy_room\"\n ]\n },\n {\n \"unified\": \"1F9D7-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_climbing\"\n ]\n },\n {\n \"unified\": \"1F9D7-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_climbing\",\n \"person_climbing\"\n ]\n },\n {\n \"unified\": \"1F93A\",\n \"shortnames\": [\n \"fencer\"\n ]\n },\n {\n \"unified\": \"1F3C7\",\n \"shortnames\": [\n \"horse_racing\"\n ]\n },\n {\n \"unified\": \"26F7-FE0F\",\n \"shortnames\": [\n \"skier\"\n ]\n },\n {\n \"unified\": \"1F3C2\",\n \"shortnames\": [\n \"snowboarder\"\n ]\n },\n {\n \"unified\": \"1F3CC-FE0F-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-golfing\",\n \"golfer\"\n ]\n },\n {\n \"unified\": \"1F3CC-FE0F-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-golfing\"\n ]\n },\n {\n \"unified\": \"1F3C4-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-surfing\",\n \"surfer\"\n ]\n },\n {\n \"unified\": \"1F3C4-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-surfing\"\n ]\n },\n {\n \"unified\": \"1F6A3-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-rowing-boat\",\n \"rowboat\"\n ]\n },\n {\n \"unified\": \"1F6A3-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-rowing-boat\"\n ]\n },\n {\n \"unified\": \"1F3CA-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-swimming\",\n \"swimmer\"\n ]\n },\n {\n \"unified\": \"1F3CA-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-swimming\"\n ]\n },\n {\n \"unified\": \"26F9-FE0F-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-bouncing-ball\",\n \"person_with_ball\"\n ]\n },\n {\n \"unified\": \"26F9-FE0F-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-bouncing-ball\"\n ]\n },\n {\n \"unified\": \"1F3CB-FE0F-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-lifting-weights\",\n \"weight_lifter\"\n ]\n },\n {\n \"unified\": \"1F3CB-FE0F-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-lifting-weights\"\n ]\n },\n {\n \"unified\": \"1F6B4-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-biking\",\n \"bicyclist\"\n ]\n },\n {\n \"unified\": \"1F6B4-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-biking\"\n ]\n },\n {\n \"unified\": \"1F6B5-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-mountain-biking\",\n \"mountain_bicyclist\"\n ]\n },\n {\n \"unified\": \"1F6B5-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-mountain-biking\"\n ]\n },\n {\n \"unified\": \"1F938\",\n \"shortnames\": [\n \"person_doing_cartwheel\"\n ]\n },\n {\n \"unified\": \"1F938-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-cartwheeling\"\n ]\n },\n {\n \"unified\": \"1F938-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-cartwheeling\"\n ]\n },\n {\n \"unified\": \"1F93C\",\n \"shortnames\": [\n \"wrestlers\"\n ]\n },\n {\n \"unified\": \"1F93C-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-wrestling\"\n ]\n },\n {\n \"unified\": \"1F93C-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-wrestling\"\n ]\n },\n {\n \"unified\": \"1F93D\",\n \"shortnames\": [\n \"water_polo\"\n ]\n },\n {\n \"unified\": \"1F93D-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-playing-water-polo\"\n ]\n },\n {\n \"unified\": \"1F93D-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-playing-water-polo\"\n ]\n },\n {\n \"unified\": \"1F93E\",\n \"shortnames\": [\n \"handball\"\n ]\n },\n {\n \"unified\": \"1F93E-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-playing-handball\"\n ]\n },\n {\n \"unified\": \"1F93E-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-playing-handball\"\n ]\n },\n {\n \"unified\": \"1F939\",\n \"shortnames\": [\n \"juggling\"\n ]\n },\n {\n \"unified\": \"1F939-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-juggling\"\n ]\n },\n {\n \"unified\": \"1F939-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-juggling\"\n ]\n },\n {\n \"unified\": \"1F9D8-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_in_lotus_position\"\n ]\n },\n {\n \"unified\": \"1F9D8-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_in_lotus_position\",\n \"person_in_lotus_position\"\n ]\n },\n {\n \"unified\": \"1F6C0\",\n \"shortnames\": [\n \"bath\"\n ]\n },\n {\n \"unified\": \"1F6CC\",\n \"shortnames\": [\n \"sleeping_accommodation\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F91D-200D-1F9D1\",\n \"shortnames\": [\n \"people_holding_hands\"\n ]\n },\n {\n \"unified\": \"1F46D\",\n \"shortnames\": [\n \"two_women_holding_hands\"\n ]\n },\n {\n \"unified\": \"1F46B\",\n \"shortnames\": [\n \"couple\"\n ]\n },\n {\n \"unified\": \"1F46C\",\n \"shortnames\": [\n \"two_men_holding_hands\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2764-FE0F-200D-1F48B-200D-1F468\",\n \"shortnames\": [\n \"woman-kiss-man\",\n \"couplekiss\"\n ]\n },\n {\n \"unified\": \"1F468-200D-2764-FE0F-200D-1F48B-200D-1F468\",\n \"shortnames\": [\n \"man-kiss-man\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2764-FE0F-200D-1F48B-200D-1F469\",\n \"shortnames\": [\n \"woman-kiss-woman\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2764-FE0F-200D-1F468\",\n \"shortnames\": [\n \"woman-heart-man\",\n \"couple_with_heart\"\n ]\n },\n {\n \"unified\": \"1F468-200D-2764-FE0F-200D-1F468\",\n \"shortnames\": [\n \"man-heart-man\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2764-FE0F-200D-1F469\",\n \"shortnames\": [\n \"woman-heart-woman\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F469-200D-1F466\",\n \"shortnames\": [\n \"man-woman-boy\",\n \"family\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F469-200D-1F467\",\n \"shortnames\": [\n \"man-woman-girl\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F469-200D-1F467-200D-1F466\",\n \"shortnames\": [\n \"man-woman-girl-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F469-200D-1F466-200D-1F466\",\n \"shortnames\": [\n \"man-woman-boy-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F469-200D-1F467-200D-1F467\",\n \"shortnames\": [\n \"man-woman-girl-girl\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F468-200D-1F466\",\n \"shortnames\": [\n \"man-man-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F468-200D-1F467\",\n \"shortnames\": [\n \"man-man-girl\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F468-200D-1F467-200D-1F466\",\n \"shortnames\": [\n \"man-man-girl-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F468-200D-1F466-200D-1F466\",\n \"shortnames\": [\n \"man-man-boy-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F468-200D-1F467-200D-1F467\",\n \"shortnames\": [\n \"man-man-girl-girl\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F469-200D-1F466\",\n \"shortnames\": [\n \"woman-woman-boy\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F469-200D-1F467\",\n \"shortnames\": [\n \"woman-woman-girl\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F469-200D-1F467-200D-1F466\",\n \"shortnames\": [\n \"woman-woman-girl-boy\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F469-200D-1F466-200D-1F466\",\n \"shortnames\": [\n \"woman-woman-boy-boy\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F469-200D-1F467-200D-1F467\",\n \"shortnames\": [\n \"woman-woman-girl-girl\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F466\",\n \"shortnames\": [\n \"man-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F466-200D-1F466\",\n \"shortnames\": [\n \"man-boy-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F467\",\n \"shortnames\": [\n \"man-girl\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F467-200D-1F466\",\n \"shortnames\": [\n \"man-girl-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F467-200D-1F467\",\n \"shortnames\": [\n \"man-girl-girl\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F466\",\n \"shortnames\": [\n \"woman-boy\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F466-200D-1F466\",\n \"shortnames\": [\n \"woman-boy-boy\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F467\",\n \"shortnames\": [\n \"woman-girl\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F467-200D-1F466\",\n \"shortnames\": [\n \"woman-girl-boy\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F467-200D-1F467\",\n \"shortnames\": [\n \"woman-girl-girl\"\n ]\n },\n {\n \"unified\": \"1F5E3-FE0F\",\n \"shortnames\": [\n \"speaking_head_in_silhouette\"\n ]\n },\n {\n \"unified\": \"1F464\",\n \"shortnames\": [\n \"bust_in_silhouette\"\n ]\n },\n {\n \"unified\": \"1F465\",\n \"shortnames\": [\n \"busts_in_silhouette\"\n ]\n },\n {\n \"unified\": \"1FAC2\",\n \"shortnames\": [\n \"people_hugging\"\n ]\n },\n {\n \"unified\": \"1F463\",\n \"shortnames\": [\n \"footprints\"\n ]\n },\n {\n \"unified\": \"1F935\",\n \"shortnames\": [\n \"man_in_tuxedo\"\n ]\n }\n ]\n },\n {\n \"name\": \"Animals & Nature\",\n \"emojis\": [\n {\n \"unified\": \"1F435\",\n \"shortnames\": [\n \"monkey_face\"\n ]\n },\n {\n \"unified\": \"1F412\",\n \"shortnames\": [\n \"monkey\"\n ]\n },\n {\n \"unified\": \"1F98D\",\n \"shortnames\": [\n \"gorilla\"\n ]\n },\n {\n \"unified\": \"1F9A7\",\n \"shortnames\": [\n \"orangutan\"\n ]\n },\n {\n \"unified\": \"1F436\",\n \"shortnames\": [\n \"dog\"\n ]\n },\n {\n \"unified\": \"1F415\",\n \"shortnames\": [\n \"dog2\"\n ]\n },\n {\n \"unified\": \"1F9AE\",\n \"shortnames\": [\n \"guide_dog\"\n ]\n },\n {\n \"unified\": \"1F415-200D-1F9BA\",\n \"shortnames\": [\n \"service_dog\"\n ]\n },\n {\n \"unified\": \"1F429\",\n \"shortnames\": [\n \"poodle\"\n ]\n },\n {\n \"unified\": \"1F43A\",\n \"shortnames\": [\n \"wolf\"\n ]\n },\n {\n \"unified\": \"1F98A\",\n \"shortnames\": [\n \"fox_face\"\n ]\n },\n {\n \"unified\": \"1F99D\",\n \"shortnames\": [\n \"raccoon\"\n ]\n },\n {\n \"unified\": \"1F431\",\n \"shortnames\": [\n \"cat\"\n ]\n },\n {\n \"unified\": \"1F408\",\n \"shortnames\": [\n \"cat2\"\n ]\n },\n {\n \"unified\": \"1F408-200D-2B1B\",\n \"shortnames\": [\n \"black_cat\"\n ]\n },\n {\n \"unified\": \"1F981\",\n \"shortnames\": [\n \"lion_face\"\n ]\n },\n {\n \"unified\": \"1F42F\",\n \"shortnames\": [\n \"tiger\"\n ]\n },\n {\n \"unified\": \"1F405\",\n \"shortnames\": [\n \"tiger2\"\n ]\n },\n {\n \"unified\": \"1F406\",\n \"shortnames\": [\n \"leopard\"\n ]\n },\n {\n \"unified\": \"1F434\",\n \"shortnames\": [\n \"horse\"\n ]\n },\n {\n \"unified\": \"1F40E\",\n \"shortnames\": [\n \"racehorse\"\n ]\n },\n {\n \"unified\": \"1F984\",\n \"shortnames\": [\n \"unicorn_face\"\n ]\n },\n {\n \"unified\": \"1F993\",\n \"shortnames\": [\n \"zebra_face\"\n ]\n },\n {\n \"unified\": \"1F98C\",\n \"shortnames\": [\n \"deer\"\n ]\n },\n {\n \"unified\": \"1F9AC\",\n \"shortnames\": [\n \"bison\"\n ]\n },\n {\n \"unified\": \"1F42E\",\n \"shortnames\": [\n \"cow\"\n ]\n },\n {\n \"unified\": \"1F402\",\n \"shortnames\": [\n \"ox\"\n ]\n },\n {\n \"unified\": \"1F403\",\n \"shortnames\": [\n \"water_buffalo\"\n ]\n },\n {\n \"unified\": \"1F404\",\n \"shortnames\": [\n \"cow2\"\n ]\n },\n {\n \"unified\": \"1F437\",\n \"shortnames\": [\n \"pig\"\n ]\n },\n {\n \"unified\": \"1F416\",\n \"shortnames\": [\n \"pig2\"\n ]\n },\n {\n \"unified\": \"1F417\",\n \"shortnames\": [\n \"boar\"\n ]\n },\n {\n \"unified\": \"1F43D\",\n \"shortnames\": [\n \"pig_nose\"\n ]\n },\n {\n \"unified\": \"1F40F\",\n \"shortnames\": [\n \"ram\"\n ]\n },\n {\n \"unified\": \"1F411\",\n \"shortnames\": [\n \"sheep\"\n ]\n },\n {\n \"unified\": \"1F410\",\n \"shortnames\": [\n \"goat\"\n ]\n },\n {\n \"unified\": \"1F42A\",\n \"shortnames\": [\n \"dromedary_camel\"\n ]\n },\n {\n \"unified\": \"1F42B\",\n \"shortnames\": [\n \"camel\"\n ]\n },\n {\n \"unified\": \"1F999\",\n \"shortnames\": [\n \"llama\"\n ]\n },\n {\n \"unified\": \"1F992\",\n \"shortnames\": [\n \"giraffe_face\"\n ]\n },\n {\n \"unified\": \"1F418\",\n \"shortnames\": [\n \"elephant\"\n ]\n },\n {\n \"unified\": \"1F9A3\",\n \"shortnames\": [\n \"mammoth\"\n ]\n },\n {\n \"unified\": \"1F98F\",\n \"shortnames\": [\n \"rhinoceros\"\n ]\n },\n {\n \"unified\": \"1F99B\",\n \"shortnames\": [\n \"hippopotamus\"\n ]\n },\n {\n \"unified\": \"1F42D\",\n \"shortnames\": [\n \"mouse\"\n ]\n },\n {\n \"unified\": \"1F401\",\n \"shortnames\": [\n \"mouse2\"\n ]\n },\n {\n \"unified\": \"1F400\",\n \"shortnames\": [\n \"rat\"\n ]\n },\n {\n \"unified\": \"1F439\",\n \"shortnames\": [\n \"hamster\"\n ]\n },\n {\n \"unified\": \"1F430\",\n \"shortnames\": [\n \"rabbit\"\n ]\n },\n {\n \"unified\": \"1F407\",\n \"shortnames\": [\n \"rabbit2\"\n ]\n },\n {\n \"unified\": \"1F43F-FE0F\",\n \"shortnames\": [\n \"chipmunk\"\n ]\n },\n {\n \"unified\": \"1F9AB\",\n \"shortnames\": [\n \"beaver\"\n ]\n },\n {\n \"unified\": \"1F994\",\n \"shortnames\": [\n \"hedgehog\"\n ]\n },\n {\n \"unified\": \"1F987\",\n \"shortnames\": [\n \"bat\"\n ]\n },\n {\n \"unified\": \"1F43B\",\n \"shortnames\": [\n \"bear\"\n ]\n },\n {\n \"unified\": \"1F43B-200D-2744-FE0F\",\n \"shortnames\": [\n \"polar_bear\"\n ]\n },\n {\n \"unified\": \"1F428\",\n \"shortnames\": [\n \"koala\"\n ]\n },\n {\n \"unified\": \"1F43C\",\n \"shortnames\": [\n \"panda_face\"\n ]\n },\n {\n \"unified\": \"1F9A5\",\n \"shortnames\": [\n \"sloth\"\n ]\n },\n {\n \"unified\": \"1F9A6\",\n \"shortnames\": [\n \"otter\"\n ]\n },\n {\n \"unified\": \"1F9A8\",\n \"shortnames\": [\n \"skunk\"\n ]\n },\n {\n \"unified\": \"1F998\",\n \"shortnames\": [\n \"kangaroo\"\n ]\n },\n {\n \"unified\": \"1F9A1\",\n \"shortnames\": [\n \"badger\"\n ]\n },\n {\n \"unified\": \"1F43E\",\n \"shortnames\": [\n \"feet\"\n ]\n },\n {\n \"unified\": \"1F983\",\n \"shortnames\": [\n \"turkey\"\n ]\n },\n {\n \"unified\": \"1F414\",\n \"shortnames\": [\n \"chicken\"\n ]\n },\n {\n \"unified\": \"1F413\",\n \"shortnames\": [\n \"rooster\"\n ]\n },\n {\n \"unified\": \"1F423\",\n \"shortnames\": [\n \"hatching_chick\"\n ]\n },\n {\n \"unified\": \"1F424\",\n \"shortnames\": [\n \"baby_chick\"\n ]\n },\n {\n \"unified\": \"1F425\",\n \"shortnames\": [\n \"hatched_chick\"\n ]\n },\n {\n \"unified\": \"1F426\",\n \"shortnames\": [\n \"bird\"\n ]\n },\n {\n \"unified\": \"1F427\",\n \"shortnames\": [\n \"penguin\"\n ]\n },\n {\n \"unified\": \"1F54A-FE0F\",\n \"shortnames\": [\n \"dove_of_peace\"\n ]\n },\n {\n \"unified\": \"1F985\",\n \"shortnames\": [\n \"eagle\"\n ]\n },\n {\n \"unified\": \"1F986\",\n \"shortnames\": [\n \"duck\"\n ]\n },\n {\n \"unified\": \"1F9A2\",\n \"shortnames\": [\n \"swan\"\n ]\n },\n {\n \"unified\": \"1F989\",\n \"shortnames\": [\n \"owl\"\n ]\n },\n {\n \"unified\": \"1F9A4\",\n \"shortnames\": [\n \"dodo\"\n ]\n },\n {\n \"unified\": \"1FAB6\",\n \"shortnames\": [\n \"feather\"\n ]\n },\n {\n \"unified\": \"1F9A9\",\n \"shortnames\": [\n \"flamingo\"\n ]\n },\n {\n \"unified\": \"1F99A\",\n \"shortnames\": [\n \"peacock\"\n ]\n },\n {\n \"unified\": \"1F99C\",\n \"shortnames\": [\n \"parrot\"\n ]\n },\n {\n \"unified\": \"1F438\",\n \"shortnames\": [\n \"frog\"\n ]\n },\n {\n \"unified\": \"1F40A\",\n \"shortnames\": [\n \"crocodile\"\n ]\n },\n {\n \"unified\": \"1F422\",\n \"shortnames\": [\n \"turtle\"\n ]\n },\n {\n \"unified\": \"1F98E\",\n \"shortnames\": [\n \"lizard\"\n ]\n },\n {\n \"unified\": \"1F40D\",\n \"shortnames\": [\n \"snake\"\n ]\n },\n {\n \"unified\": \"1F432\",\n \"shortnames\": [\n \"dragon_face\"\n ]\n },\n {\n \"unified\": \"1F409\",\n \"shortnames\": [\n \"dragon\"\n ]\n },\n {\n \"unified\": \"1F995\",\n \"shortnames\": [\n \"sauropod\"\n ]\n },\n {\n \"unified\": \"1F996\",\n \"shortnames\": [\n \"t-rex\"\n ]\n },\n {\n \"unified\": \"1F433\",\n \"shortnames\": [\n \"whale\"\n ]\n },\n {\n \"unified\": \"1F40B\",\n \"shortnames\": [\n \"whale2\"\n ]\n },\n {\n \"unified\": \"1F42C\",\n \"shortnames\": [\n \"dolphin\"\n ]\n },\n {\n \"unified\": \"1F9AD\",\n \"shortnames\": [\n \"seal\"\n ]\n },\n {\n \"unified\": \"1F41F\",\n \"shortnames\": [\n \"fish\"\n ]\n },\n {\n \"unified\": \"1F420\",\n \"shortnames\": [\n \"tropical_fish\"\n ]\n },\n {\n \"unified\": \"1F421\",\n \"shortnames\": [\n \"blowfish\"\n ]\n },\n {\n \"unified\": \"1F988\",\n \"shortnames\": [\n \"shark\"\n ]\n },\n {\n \"unified\": \"1F419\",\n \"shortnames\": [\n \"octopus\"\n ]\n },\n {\n \"unified\": \"1F41A\",\n \"shortnames\": [\n \"shell\"\n ]\n },\n {\n \"unified\": \"1F40C\",\n \"shortnames\": [\n \"snail\"\n ]\n },\n {\n \"unified\": \"1F98B\",\n \"shortnames\": [\n \"butterfly\"\n ]\n },\n {\n \"unified\": \"1F41B\",\n \"shortnames\": [\n \"bug\"\n ]\n },\n {\n \"unified\": \"1F41C\",\n \"shortnames\": [\n \"ant\"\n ]\n },\n {\n \"unified\": \"1F41D\",\n \"shortnames\": [\n \"bee\"\n ]\n },\n {\n \"unified\": \"1FAB2\",\n \"shortnames\": [\n \"beetle\"\n ]\n },\n {\n \"unified\": \"1F997\",\n \"shortnames\": [\n \"cricket\"\n ]\n },\n {\n \"unified\": \"1FAB3\",\n \"shortnames\": [\n \"cockroach\"\n ]\n },\n {\n \"unified\": \"1F577-FE0F\",\n \"shortnames\": [\n \"spider\"\n ]\n },\n {\n \"unified\": \"1F578-FE0F\",\n \"shortnames\": [\n \"spider_web\"\n ]\n },\n {\n \"unified\": \"1F982\",\n \"shortnames\": [\n \"scorpion\"\n ]\n },\n {\n \"unified\": \"1F99F\",\n \"shortnames\": [\n \"mosquito\"\n ]\n },\n {\n \"unified\": \"1FAB0\",\n \"shortnames\": [\n \"fly\"\n ]\n },\n {\n \"unified\": \"1FAB1\",\n \"shortnames\": [\n \"worm\"\n ]\n },\n {\n \"unified\": \"1F9A0\",\n \"shortnames\": [\n \"microbe\"\n ]\n },\n {\n \"unified\": \"1F490\",\n \"shortnames\": [\n \"bouquet\"\n ]\n },\n {\n \"unified\": \"1F338\",\n \"shortnames\": [\n \"cherry_blossom\"\n ]\n },\n {\n \"unified\": \"1F4AE\",\n \"shortnames\": [\n \"white_flower\"\n ]\n },\n {\n \"unified\": \"1F3F5-FE0F\",\n \"shortnames\": [\n \"rosette\"\n ]\n },\n {\n \"unified\": \"1F339\",\n \"shortnames\": [\n \"rose\"\n ]\n },\n {\n \"unified\": \"1F940\",\n \"shortnames\": [\n \"wilted_flower\"\n ]\n },\n {\n \"unified\": \"1F33A\",\n \"shortnames\": [\n \"hibiscus\"\n ]\n },\n {\n \"unified\": \"1F33B\",\n \"shortnames\": [\n \"sunflower\"\n ]\n },\n {\n \"unified\": \"1F33C\",\n \"shortnames\": [\n \"blossom\"\n ]\n },\n {\n \"unified\": \"1F337\",\n \"shortnames\": [\n \"tulip\"\n ]\n },\n {\n \"unified\": \"1F331\",\n \"shortnames\": [\n \"seedling\"\n ]\n },\n {\n \"unified\": \"1FAB4\",\n \"shortnames\": [\n \"potted_plant\"\n ]\n },\n {\n \"unified\": \"1F332\",\n \"shortnames\": [\n \"evergreen_tree\"\n ]\n },\n {\n \"unified\": \"1F333\",\n \"shortnames\": [\n \"deciduous_tree\"\n ]\n },\n {\n \"unified\": \"1F334\",\n \"shortnames\": [\n \"palm_tree\"\n ]\n },\n {\n \"unified\": \"1F335\",\n \"shortnames\": [\n \"cactus\"\n ]\n },\n {\n \"unified\": \"1F33E\",\n \"shortnames\": [\n \"ear_of_rice\"\n ]\n },\n {\n \"unified\": \"1F33F\",\n \"shortnames\": [\n \"herb\"\n ]\n },\n {\n \"unified\": \"2618-FE0F\",\n \"shortnames\": [\n \"shamrock\"\n ]\n },\n {\n \"unified\": \"1F340\",\n \"shortnames\": [\n \"four_leaf_clover\"\n ]\n },\n {\n \"unified\": \"1F341\",\n \"shortnames\": [\n \"maple_leaf\"\n ]\n },\n {\n \"unified\": \"1F342\",\n \"shortnames\": [\n \"fallen_leaf\"\n ]\n },\n {\n \"unified\": \"1F343\",\n \"shortnames\": [\n \"leaves\"\n ]\n },\n {\n \"unified\": \"1F41E\",\n \"shortnames\": [\n \"beetle\"\n ]\n }\n ]\n },\n {\n \"name\": \"Food & Drink\",\n \"emojis\": [\n {\n \"unified\": \"1F347\",\n \"shortnames\": [\n \"grapes\"\n ]\n },\n {\n \"unified\": \"1F348\",\n \"shortnames\": [\n \"melon\"\n ]\n },\n {\n \"unified\": \"1F349\",\n \"shortnames\": [\n \"watermelon\"\n ]\n },\n {\n \"unified\": \"1F34A\",\n \"shortnames\": [\n \"tangerine\"\n ]\n },\n {\n \"unified\": \"1F34B\",\n \"shortnames\": [\n \"lemon\"\n ]\n },\n {\n \"unified\": \"1F34C\",\n \"shortnames\": [\n \"banana\"\n ]\n },\n {\n \"unified\": \"1F34D\",\n \"shortnames\": [\n \"pineapple\"\n ]\n },\n {\n \"unified\": \"1F96D\",\n \"shortnames\": [\n \"mango\"\n ]\n },\n {\n \"unified\": \"1F34E\",\n \"shortnames\": [\n \"apple\"\n ]\n },\n {\n \"unified\": \"1F34F\",\n \"shortnames\": [\n \"green_apple\"\n ]\n },\n {\n \"unified\": \"1F350\",\n \"shortnames\": [\n \"pear\"\n ]\n },\n {\n \"unified\": \"1F351\",\n \"shortnames\": [\n \"peach\"\n ]\n },\n {\n \"unified\": \"1F352\",\n \"shortnames\": [\n \"cherries\"\n ]\n },\n {\n \"unified\": \"1F353\",\n \"shortnames\": [\n \"strawberry\"\n ]\n },\n {\n \"unified\": \"1FAD0\",\n \"shortnames\": [\n \"blueberries\"\n ]\n },\n {\n \"unified\": \"1F95D\",\n \"shortnames\": [\n \"kiwifruit\"\n ]\n },\n {\n \"unified\": \"1F345\",\n \"shortnames\": [\n \"tomato\"\n ]\n },\n {\n \"unified\": \"1FAD2\",\n \"shortnames\": [\n \"olive\"\n ]\n },\n {\n \"unified\": \"1F965\",\n \"shortnames\": [\n \"coconut\"\n ]\n },\n {\n \"unified\": \"1F951\",\n \"shortnames\": [\n \"avocado\"\n ]\n },\n {\n \"unified\": \"1F346\",\n \"shortnames\": [\n \"eggplant\"\n ]\n },\n {\n \"unified\": \"1F954\",\n \"shortnames\": [\n \"potato\"\n ]\n },\n {\n \"unified\": \"1F955\",\n \"shortnames\": [\n \"carrot\"\n ]\n },\n {\n \"unified\": \"1F33D\",\n \"shortnames\": [\n \"corn\"\n ]\n },\n {\n \"unified\": \"1F336-FE0F\",\n \"shortnames\": [\n \"hot_pepper\"\n ]\n },\n {\n \"unified\": \"1FAD1\",\n \"shortnames\": [\n \"bell_pepper\"\n ]\n },\n {\n \"unified\": \"1F952\",\n \"shortnames\": [\n \"cucumber\"\n ]\n },\n {\n \"unified\": \"1F96C\",\n \"shortnames\": [\n \"leafy_green\"\n ]\n },\n {\n \"unified\": \"1F966\",\n \"shortnames\": [\n \"broccoli\"\n ]\n },\n {\n \"unified\": \"1F9C4\",\n \"shortnames\": [\n \"garlic\"\n ]\n },\n {\n \"unified\": \"1F9C5\",\n \"shortnames\": [\n \"onion\"\n ]\n },\n {\n \"unified\": \"1F344\",\n \"shortnames\": [\n \"mushroom\"\n ]\n },\n {\n \"unified\": \"1F95C\",\n \"shortnames\": [\n \"peanuts\"\n ]\n },\n {\n \"unified\": \"1F330\",\n \"shortnames\": [\n \"chestnut\"\n ]\n },\n {\n \"unified\": \"1F35E\",\n \"shortnames\": [\n \"bread\"\n ]\n },\n {\n \"unified\": \"1F950\",\n \"shortnames\": [\n \"croissant\"\n ]\n },\n {\n \"unified\": \"1F956\",\n \"shortnames\": [\n \"baguette_bread\"\n ]\n },\n {\n \"unified\": \"1FAD3\",\n \"shortnames\": [\n \"flatbread\"\n ]\n },\n {\n \"unified\": \"1F968\",\n \"shortnames\": [\n \"pretzel\"\n ]\n },\n {\n \"unified\": \"1F96F\",\n \"shortnames\": [\n \"bagel\"\n ]\n },\n {\n \"unified\": \"1F95E\",\n \"shortnames\": [\n \"pancakes\"\n ]\n },\n {\n \"unified\": \"1F9C7\",\n \"shortnames\": [\n \"waffle\"\n ]\n },\n {\n \"unified\": \"1F9C0\",\n \"shortnames\": [\n \"cheese_wedge\"\n ]\n },\n {\n \"unified\": \"1F356\",\n \"shortnames\": [\n \"meat_on_bone\"\n ]\n },\n {\n \"unified\": \"1F357\",\n \"shortnames\": [\n \"poultry_leg\"\n ]\n },\n {\n \"unified\": \"1F969\",\n \"shortnames\": [\n \"cut_of_meat\"\n ]\n },\n {\n \"unified\": \"1F953\",\n \"shortnames\": [\n \"bacon\"\n ]\n },\n {\n \"unified\": \"1F354\",\n \"shortnames\": [\n \"hamburger\"\n ]\n },\n {\n \"unified\": \"1F35F\",\n \"shortnames\": [\n \"fries\"\n ]\n },\n {\n \"unified\": \"1F355\",\n \"shortnames\": [\n \"pizza\"\n ]\n },\n {\n \"unified\": \"1F32D\",\n \"shortnames\": [\n \"hotdog\"\n ]\n },\n {\n \"unified\": \"1F96A\",\n \"shortnames\": [\n \"sandwich\"\n ]\n },\n {\n \"unified\": \"1F32E\",\n \"shortnames\": [\n \"taco\"\n ]\n },\n {\n \"unified\": \"1F32F\",\n \"shortnames\": [\n \"burrito\"\n ]\n },\n {\n \"unified\": \"1FAD4\",\n \"shortnames\": [\n \"tamale\"\n ]\n },\n {\n \"unified\": \"1F959\",\n \"shortnames\": [\n \"stuffed_flatbread\"\n ]\n },\n {\n \"unified\": \"1F9C6\",\n \"shortnames\": [\n \"falafel\"\n ]\n },\n {\n \"unified\": \"1F95A\",\n \"shortnames\": [\n \"egg\"\n ]\n },\n {\n \"unified\": \"1F373\",\n \"shortnames\": [\n \"fried_egg\"\n ]\n },\n {\n \"unified\": \"1F958\",\n \"shortnames\": [\n \"shallow_pan_of_food\"\n ]\n },\n {\n \"unified\": \"1F372\",\n \"shortnames\": [\n \"stew\"\n ]\n },\n {\n \"unified\": \"1FAD5\",\n \"shortnames\": [\n \"fondue\"\n ]\n },\n {\n \"unified\": \"1F963\",\n \"shortnames\": [\n \"bowl_with_spoon\"\n ]\n },\n {\n \"unified\": \"1F957\",\n \"shortnames\": [\n \"green_salad\"\n ]\n },\n {\n \"unified\": \"1F37F\",\n \"shortnames\": [\n \"popcorn\"\n ]\n },\n {\n \"unified\": \"1F9C8\",\n \"shortnames\": [\n \"butter\"\n ]\n },\n {\n \"unified\": \"1F9C2\",\n \"shortnames\": [\n \"salt\"\n ]\n },\n {\n \"unified\": \"1F96B\",\n \"shortnames\": [\n \"canned_food\"\n ]\n },\n {\n \"unified\": \"1F371\",\n \"shortnames\": [\n \"bento\"\n ]\n },\n {\n \"unified\": \"1F358\",\n \"shortnames\": [\n \"rice_cracker\"\n ]\n },\n {\n \"unified\": \"1F359\",\n \"shortnames\": [\n \"rice_ball\"\n ]\n },\n {\n \"unified\": \"1F35A\",\n \"shortnames\": [\n \"rice\"\n ]\n },\n {\n \"unified\": \"1F35B\",\n \"shortnames\": [\n \"curry\"\n ]\n },\n {\n \"unified\": \"1F35C\",\n \"shortnames\": [\n \"ramen\"\n ]\n },\n {\n \"unified\": \"1F35D\",\n \"shortnames\": [\n \"spaghetti\"\n ]\n },\n {\n \"unified\": \"1F360\",\n \"shortnames\": [\n \"sweet_potato\"\n ]\n },\n {\n \"unified\": \"1F362\",\n \"shortnames\": [\n \"oden\"\n ]\n },\n {\n \"unified\": \"1F363\",\n \"shortnames\": [\n \"sushi\"\n ]\n },\n {\n \"unified\": \"1F364\",\n \"shortnames\": [\n \"fried_shrimp\"\n ]\n },\n {\n \"unified\": \"1F365\",\n \"shortnames\": [\n \"fish_cake\"\n ]\n },\n {\n \"unified\": \"1F96E\",\n \"shortnames\": [\n \"moon_cake\"\n ]\n },\n {\n \"unified\": \"1F361\",\n \"shortnames\": [\n \"dango\"\n ]\n },\n {\n \"unified\": \"1F95F\",\n \"shortnames\": [\n \"dumpling\"\n ]\n },\n {\n \"unified\": \"1F960\",\n \"shortnames\": [\n \"fortune_cookie\"\n ]\n },\n {\n \"unified\": \"1F961\",\n \"shortnames\": [\n \"takeout_box\"\n ]\n },\n {\n \"unified\": \"1F980\",\n \"shortnames\": [\n \"crab\"\n ]\n },\n {\n \"unified\": \"1F99E\",\n \"shortnames\": [\n \"lobster\"\n ]\n },\n {\n \"unified\": \"1F990\",\n \"shortnames\": [\n \"shrimp\"\n ]\n },\n {\n \"unified\": \"1F991\",\n \"shortnames\": [\n \"squid\"\n ]\n },\n {\n \"unified\": \"1F9AA\",\n \"shortnames\": [\n \"oyster\"\n ]\n },\n {\n \"unified\": \"1F366\",\n \"shortnames\": [\n \"icecream\"\n ]\n },\n {\n \"unified\": \"1F367\",\n \"shortnames\": [\n \"shaved_ice\"\n ]\n },\n {\n \"unified\": \"1F368\",\n \"shortnames\": [\n \"ice_cream\"\n ]\n },\n {\n \"unified\": \"1F369\",\n \"shortnames\": [\n \"doughnut\"\n ]\n },\n {\n \"unified\": \"1F36A\",\n \"shortnames\": [\n \"cookie\"\n ]\n },\n {\n \"unified\": \"1F382\",\n \"shortnames\": [\n \"birthday\"\n ]\n },\n {\n \"unified\": \"1F370\",\n \"shortnames\": [\n \"cake\"\n ]\n },\n {\n \"unified\": \"1F9C1\",\n \"shortnames\": [\n \"cupcake\"\n ]\n },\n {\n \"unified\": \"1F967\",\n \"shortnames\": [\n \"pie\"\n ]\n },\n {\n \"unified\": \"1F36B\",\n \"shortnames\": [\n \"chocolate_bar\"\n ]\n },\n {\n \"unified\": \"1F36C\",\n \"shortnames\": [\n \"candy\"\n ]\n },\n {\n \"unified\": \"1F36D\",\n \"shortnames\": [\n \"lollipop\"\n ]\n },\n {\n \"unified\": \"1F36E\",\n \"shortnames\": [\n \"custard\"\n ]\n },\n {\n \"unified\": \"1F36F\",\n \"shortnames\": [\n \"honey_pot\"\n ]\n },\n {\n \"unified\": \"1F37C\",\n \"shortnames\": [\n \"baby_bottle\"\n ]\n },\n {\n \"unified\": \"1F95B\",\n \"shortnames\": [\n \"glass_of_milk\"\n ]\n },\n {\n \"unified\": \"2615\",\n \"shortnames\": [\n \"coffee\"\n ]\n },\n {\n \"unified\": \"1FAD6\",\n \"shortnames\": [\n \"teapot\"\n ]\n },\n {\n \"unified\": \"1F375\",\n \"shortnames\": [\n \"tea\"\n ]\n },\n {\n \"unified\": \"1F376\",\n \"shortnames\": [\n \"sake\"\n ]\n },\n {\n \"unified\": \"1F37E\",\n \"shortnames\": [\n \"champagne\"\n ]\n },\n {\n \"unified\": \"1F377\",\n \"shortnames\": [\n \"wine_glass\"\n ]\n },\n {\n \"unified\": \"1F378\",\n \"shortnames\": [\n \"cocktail\"\n ]\n },\n {\n \"unified\": \"1F379\",\n \"shortnames\": [\n \"tropical_drink\"\n ]\n },\n {\n \"unified\": \"1F37A\",\n \"shortnames\": [\n \"beer\"\n ]\n },\n {\n \"unified\": \"1F37B\",\n \"shortnames\": [\n \"beers\"\n ]\n },\n {\n \"unified\": \"1F942\",\n \"shortnames\": [\n \"clinking_glasses\"\n ]\n },\n {\n \"unified\": \"1F943\",\n \"shortnames\": [\n \"tumbler_glass\"\n ]\n },\n {\n \"unified\": \"1F964\",\n \"shortnames\": [\n \"cup_with_straw\"\n ]\n },\n {\n \"unified\": \"1F9CB\",\n \"shortnames\": [\n \"bubble_tea\"\n ]\n },\n {\n \"unified\": \"1F9C3\",\n \"shortnames\": [\n \"beverage_box\"\n ]\n },\n {\n \"unified\": \"1F9C9\",\n \"shortnames\": [\n \"mate_drink\"\n ]\n },\n {\n \"unified\": \"1F9CA\",\n \"shortnames\": [\n \"ice_cube\"\n ]\n },\n {\n \"unified\": \"1F962\",\n \"shortnames\": [\n \"chopsticks\"\n ]\n },\n {\n \"unified\": \"1F37D-FE0F\",\n \"shortnames\": [\n \"knife_fork_plate\"\n ]\n },\n {\n \"unified\": \"1F374\",\n \"shortnames\": [\n \"fork_and_knife\"\n ]\n },\n {\n \"unified\": \"1F944\",\n \"shortnames\": [\n \"spoon\"\n ]\n },\n {\n \"unified\": \"1F52A\",\n \"shortnames\": [\n \"hocho\"\n ]\n },\n {\n \"unified\": \"1F3FA\",\n \"shortnames\": [\n \"amphora\"\n ]\n }\n ]\n },\n {\n \"name\": \"Travel & Places\",\n \"emojis\": [\n {\n \"unified\": \"1F30D\",\n \"shortnames\": [\n \"earth_africa\"\n ]\n },\n {\n \"unified\": \"1F30E\",\n \"shortnames\": [\n \"earth_americas\"\n ]\n },\n {\n \"unified\": \"1F30F\",\n \"shortnames\": [\n \"earth_asia\"\n ]\n },\n {\n \"unified\": \"1F310\",\n \"shortnames\": [\n \"globe_with_meridians\"\n ]\n },\n {\n \"unified\": \"1F5FA-FE0F\",\n \"shortnames\": [\n \"world_map\"\n ]\n },\n {\n \"unified\": \"1F5FE\",\n \"shortnames\": [\n \"japan\"\n ]\n },\n {\n \"unified\": \"1F9ED\",\n \"shortnames\": [\n \"compass\"\n ]\n },\n {\n \"unified\": \"1F3D4-FE0F\",\n \"shortnames\": [\n \"snow_capped_mountain\"\n ]\n },\n {\n \"unified\": \"26F0-FE0F\",\n \"shortnames\": [\n \"mountain\"\n ]\n },\n {\n \"unified\": \"1F30B\",\n \"shortnames\": [\n \"volcano\"\n ]\n },\n {\n \"unified\": \"1F5FB\",\n \"shortnames\": [\n \"mount_fuji\"\n ]\n },\n {\n \"unified\": \"1F3D5-FE0F\",\n \"shortnames\": [\n \"camping\"\n ]\n },\n {\n \"unified\": \"1F3D6-FE0F\",\n \"shortnames\": [\n \"beach_with_umbrella\"\n ]\n },\n {\n \"unified\": \"1F3DC-FE0F\",\n \"shortnames\": [\n \"desert\"\n ]\n },\n {\n \"unified\": \"1F3DD-FE0F\",\n \"shortnames\": [\n \"desert_island\"\n ]\n },\n {\n \"unified\": \"1F3DE-FE0F\",\n \"shortnames\": [\n \"national_park\"\n ]\n },\n {\n \"unified\": \"1F3DF-FE0F\",\n \"shortnames\": [\n \"stadium\"\n ]\n },\n {\n \"unified\": \"1F3DB-FE0F\",\n \"shortnames\": [\n \"classical_building\"\n ]\n },\n {\n \"unified\": \"1F3D7-FE0F\",\n \"shortnames\": [\n \"building_construction\"\n ]\n },\n {\n \"unified\": \"1F9F1\",\n \"shortnames\": [\n \"bricks\"\n ]\n },\n {\n \"unified\": \"1FAA8\",\n \"shortnames\": [\n \"rock\"\n ]\n },\n {\n \"unified\": \"1FAB5\",\n \"shortnames\": [\n \"wood\"\n ]\n },\n {\n \"unified\": \"1F6D6\",\n \"shortnames\": [\n \"hut\"\n ]\n },\n {\n \"unified\": \"1F3D8-FE0F\",\n \"shortnames\": [\n \"house_buildings\"\n ]\n },\n {\n \"unified\": \"1F3DA-FE0F\",\n \"shortnames\": [\n \"derelict_house_building\"\n ]\n },\n {\n \"unified\": \"1F3E0\",\n \"shortnames\": [\n \"house\"\n ]\n },\n {\n \"unified\": \"1F3E1\",\n \"shortnames\": [\n \"house_with_garden\"\n ]\n },\n {\n \"unified\": \"1F3E2\",\n \"shortnames\": [\n \"office\"\n ]\n },\n {\n \"unified\": \"1F3E3\",\n \"shortnames\": [\n \"post_office\"\n ]\n },\n {\n \"unified\": \"1F3E4\",\n \"shortnames\": [\n \"european_post_office\"\n ]\n },\n {\n \"unified\": \"1F3E5\",\n \"shortnames\": [\n \"hospital\"\n ]\n },\n {\n \"unified\": \"1F3E6\",\n \"shortnames\": [\n \"bank\"\n ]\n },\n {\n \"unified\": \"1F3E8\",\n \"shortnames\": [\n \"hotel\"\n ]\n },\n {\n \"unified\": \"1F3E9\",\n \"shortnames\": [\n \"love_hotel\"\n ]\n },\n {\n \"unified\": \"1F3EA\",\n \"shortnames\": [\n \"convenience_store\"\n ]\n },\n {\n \"unified\": \"1F3EB\",\n \"shortnames\": [\n \"school\"\n ]\n },\n {\n \"unified\": \"1F3EC\",\n \"shortnames\": [\n \"department_store\"\n ]\n },\n {\n \"unified\": \"1F3ED\",\n \"shortnames\": [\n \"factory\"\n ]\n },\n {\n \"unified\": \"1F3EF\",\n \"shortnames\": [\n \"japanese_castle\"\n ]\n },\n {\n \"unified\": \"1F3F0\",\n \"shortnames\": [\n \"european_castle\"\n ]\n },\n {\n \"unified\": \"1F492\",\n \"shortnames\": [\n \"wedding\"\n ]\n },\n {\n \"unified\": \"1F5FC\",\n \"shortnames\": [\n \"tokyo_tower\"\n ]\n },\n {\n \"unified\": \"1F5FD\",\n \"shortnames\": [\n \"statue_of_liberty\"\n ]\n },\n {\n \"unified\": \"26EA\",\n \"shortnames\": [\n \"church\"\n ]\n },\n {\n \"unified\": \"1F54C\",\n \"shortnames\": [\n \"mosque\"\n ]\n },\n {\n \"unified\": \"1F6D5\",\n \"shortnames\": [\n \"hindu_temple\"\n ]\n },\n {\n \"unified\": \"1F54D\",\n \"shortnames\": [\n \"synagogue\"\n ]\n },\n {\n \"unified\": \"26E9-FE0F\",\n \"shortnames\": [\n \"shinto_shrine\"\n ]\n },\n {\n \"unified\": \"1F54B\",\n \"shortnames\": [\n \"kaaba\"\n ]\n },\n {\n \"unified\": \"26F2\",\n \"shortnames\": [\n \"fountain\"\n ]\n },\n {\n \"unified\": \"26FA\",\n \"shortnames\": [\n \"tent\"\n ]\n },\n {\n \"unified\": \"1F301\",\n \"shortnames\": [\n \"foggy\"\n ]\n },\n {\n \"unified\": \"1F303\",\n \"shortnames\": [\n \"night_with_stars\"\n ]\n },\n {\n \"unified\": \"1F3D9-FE0F\",\n \"shortnames\": [\n \"cityscape\"\n ]\n },\n {\n \"unified\": \"1F304\",\n \"shortnames\": [\n \"sunrise_over_mountains\"\n ]\n },\n {\n \"unified\": \"1F305\",\n \"shortnames\": [\n \"sunrise\"\n ]\n },\n {\n \"unified\": \"1F306\",\n \"shortnames\": [\n \"city_sunset\"\n ]\n },\n {\n \"unified\": \"1F307\",\n \"shortnames\": [\n \"city_sunrise\"\n ]\n },\n {\n \"unified\": \"1F309\",\n \"shortnames\": [\n \"bridge_at_night\"\n ]\n },\n {\n \"unified\": \"2668-FE0F\",\n \"shortnames\": [\n \"hotsprings\"\n ]\n },\n {\n \"unified\": \"1F3A0\",\n \"shortnames\": [\n \"carousel_horse\"\n ]\n },\n {\n \"unified\": \"1F3A1\",\n \"shortnames\": [\n \"ferris_wheel\"\n ]\n },\n {\n \"unified\": \"1F3A2\",\n \"shortnames\": [\n \"roller_coaster\"\n ]\n },\n {\n \"unified\": \"1F488\",\n \"shortnames\": [\n \"barber\"\n ]\n },\n {\n \"unified\": \"1F3AA\",\n \"shortnames\": [\n \"circus_tent\"\n ]\n },\n {\n \"unified\": \"1F682\",\n \"shortnames\": [\n \"steam_locomotive\"\n ]\n },\n {\n \"unified\": \"1F683\",\n \"shortnames\": [\n \"railway_car\"\n ]\n },\n {\n \"unified\": \"1F684\",\n \"shortnames\": [\n \"bullettrain_side\"\n ]\n },\n {\n \"unified\": \"1F685\",\n \"shortnames\": [\n \"bullettrain_front\"\n ]\n },\n {\n \"unified\": \"1F686\",\n \"shortnames\": [\n \"train2\"\n ]\n },\n {\n \"unified\": \"1F687\",\n \"shortnames\": [\n \"metro\"\n ]\n },\n {\n \"unified\": \"1F688\",\n \"shortnames\": [\n \"light_rail\"\n ]\n },\n {\n \"unified\": \"1F689\",\n \"shortnames\": [\n \"station\"\n ]\n },\n {\n \"unified\": \"1F68A\",\n \"shortnames\": [\n \"tram\"\n ]\n },\n {\n \"unified\": \"1F69D\",\n \"shortnames\": [\n \"monorail\"\n ]\n },\n {\n \"unified\": \"1F69E\",\n \"shortnames\": [\n \"mountain_railway\"\n ]\n },\n {\n \"unified\": \"1F68B\",\n \"shortnames\": [\n \"train\"\n ]\n },\n {\n \"unified\": \"1F68C\",\n \"shortnames\": [\n \"bus\"\n ]\n },\n {\n \"unified\": \"1F68D\",\n \"shortnames\": [\n \"oncoming_bus\"\n ]\n },\n {\n \"unified\": \"1F68E\",\n \"shortnames\": [\n \"trolleybus\"\n ]\n },\n {\n \"unified\": \"1F690\",\n \"shortnames\": [\n \"minibus\"\n ]\n },\n {\n \"unified\": \"1F691\",\n \"shortnames\": [\n \"ambulance\"\n ]\n },\n {\n \"unified\": \"1F692\",\n \"shortnames\": [\n \"fire_engine\"\n ]\n },\n {\n \"unified\": \"1F693\",\n \"shortnames\": [\n \"police_car\"\n ]\n },\n {\n \"unified\": \"1F694\",\n \"shortnames\": [\n \"oncoming_police_car\"\n ]\n },\n {\n \"unified\": \"1F695\",\n \"shortnames\": [\n \"taxi\"\n ]\n },\n {\n \"unified\": \"1F696\",\n \"shortnames\": [\n \"oncoming_taxi\"\n ]\n },\n {\n \"unified\": \"1F697\",\n \"shortnames\": [\n \"car\"\n ]\n },\n {\n \"unified\": \"1F698\",\n \"shortnames\": [\n \"oncoming_automobile\"\n ]\n },\n {\n \"unified\": \"1F699\",\n \"shortnames\": [\n \"blue_car\"\n ]\n },\n {\n \"unified\": \"1F6FB\",\n \"shortnames\": [\n \"pickup_truck\"\n ]\n },\n {\n \"unified\": \"1F69A\",\n \"shortnames\": [\n \"truck\"\n ]\n },\n {\n \"unified\": \"1F69B\",\n \"shortnames\": [\n \"articulated_lorry\"\n ]\n },\n {\n \"unified\": \"1F69C\",\n \"shortnames\": [\n \"tractor\"\n ]\n },\n {\n \"unified\": \"1F3CE-FE0F\",\n \"shortnames\": [\n \"racing_car\"\n ]\n },\n {\n \"unified\": \"1F3CD-FE0F\",\n \"shortnames\": [\n \"racing_motorcycle\"\n ]\n },\n {\n \"unified\": \"1F6F5\",\n \"shortnames\": [\n \"motor_scooter\"\n ]\n },\n {\n \"unified\": \"1F9BD\",\n \"shortnames\": [\n \"manual_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F9BC\",\n \"shortnames\": [\n \"motorized_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F6FA\",\n \"shortnames\": [\n \"auto_rickshaw\"\n ]\n },\n {\n \"unified\": \"1F6B2\",\n \"shortnames\": [\n \"bike\"\n ]\n },\n {\n \"unified\": \"1F6F4\",\n \"shortnames\": [\n \"scooter\"\n ]\n },\n {\n \"unified\": \"1F6F9\",\n \"shortnames\": [\n \"skateboard\"\n ]\n },\n {\n \"unified\": \"1F6FC\",\n \"shortnames\": [\n \"roller_skate\"\n ]\n },\n {\n \"unified\": \"1F68F\",\n \"shortnames\": [\n \"busstop\"\n ]\n },\n {\n \"unified\": \"1F6E3-FE0F\",\n \"shortnames\": [\n \"motorway\"\n ]\n },\n {\n \"unified\": \"1F6E4-FE0F\",\n \"shortnames\": [\n \"railway_track\"\n ]\n },\n {\n \"unified\": \"1F6E2-FE0F\",\n \"shortnames\": [\n \"oil_drum\"\n ]\n },\n {\n \"unified\": \"26FD\",\n \"shortnames\": [\n \"fuelpump\"\n ]\n },\n {\n \"unified\": \"1F6A8\",\n \"shortnames\": [\n \"rotating_light\"\n ]\n },\n {\n \"unified\": \"1F6A5\",\n \"shortnames\": [\n \"traffic_light\"\n ]\n },\n {\n \"unified\": \"1F6A6\",\n \"shortnames\": [\n \"vertical_traffic_light\"\n ]\n },\n {\n \"unified\": \"1F6D1\",\n \"shortnames\": [\n \"octagonal_sign\"\n ]\n },\n {\n \"unified\": \"1F6A7\",\n \"shortnames\": [\n \"construction\"\n ]\n },\n {\n \"unified\": \"2693\",\n \"shortnames\": [\n \"anchor\"\n ]\n },\n {\n \"unified\": \"26F5\",\n \"shortnames\": [\n \"boat\"\n ]\n },\n {\n \"unified\": \"1F6F6\",\n \"shortnames\": [\n \"canoe\"\n ]\n },\n {\n \"unified\": \"1F6A4\",\n \"shortnames\": [\n \"speedboat\"\n ]\n },\n {\n \"unified\": \"1F6F3-FE0F\",\n \"shortnames\": [\n \"passenger_ship\"\n ]\n },\n {\n \"unified\": \"26F4-FE0F\",\n \"shortnames\": [\n \"ferry\"\n ]\n },\n {\n \"unified\": \"1F6E5-FE0F\",\n \"shortnames\": [\n \"motor_boat\"\n ]\n },\n {\n \"unified\": \"1F6A2\",\n \"shortnames\": [\n \"ship\"\n ]\n },\n {\n \"unified\": \"2708-FE0F\",\n \"shortnames\": [\n \"airplane\"\n ]\n },\n {\n \"unified\": \"1F6E9-FE0F\",\n \"shortnames\": [\n \"small_airplane\"\n ]\n },\n {\n \"unified\": \"1F6EB\",\n \"shortnames\": [\n \"airplane_departure\"\n ]\n },\n {\n \"unified\": \"1F6EC\",\n \"shortnames\": [\n \"airplane_arriving\"\n ]\n },\n {\n \"unified\": \"1FA82\",\n \"shortnames\": [\n \"parachute\"\n ]\n },\n {\n \"unified\": \"1F4BA\",\n \"shortnames\": [\n \"seat\"\n ]\n },\n {\n \"unified\": \"1F681\",\n \"shortnames\": [\n \"helicopter\"\n ]\n },\n {\n \"unified\": \"1F69F\",\n \"shortnames\": [\n \"suspension_railway\"\n ]\n },\n {\n \"unified\": \"1F6A0\",\n \"shortnames\": [\n \"mountain_cableway\"\n ]\n },\n {\n \"unified\": \"1F6A1\",\n \"shortnames\": [\n \"aerial_tramway\"\n ]\n },\n {\n \"unified\": \"1F6F0-FE0F\",\n \"shortnames\": [\n \"satellite\"\n ]\n },\n {\n \"unified\": \"1F680\",\n \"shortnames\": [\n \"rocket\"\n ]\n },\n {\n \"unified\": \"1F6F8\",\n \"shortnames\": [\n \"flying_saucer\"\n ]\n },\n {\n \"unified\": \"1F6CE-FE0F\",\n \"shortnames\": [\n \"bellhop_bell\"\n ]\n },\n {\n \"unified\": \"1F9F3\",\n \"shortnames\": [\n \"luggage\"\n ]\n },\n {\n \"unified\": \"231B\",\n \"shortnames\": [\n \"hourglass\"\n ]\n },\n {\n \"unified\": \"23F3\",\n \"shortnames\": [\n \"hourglass_flowing_sand\"\n ]\n },\n {\n \"unified\": \"231A\",\n \"shortnames\": [\n \"watch\"\n ]\n },\n {\n \"unified\": \"23F0\",\n \"shortnames\": [\n \"alarm_clock\"\n ]\n },\n {\n \"unified\": \"23F1-FE0F\",\n \"shortnames\": [\n \"stopwatch\"\n ]\n },\n {\n \"unified\": \"23F2-FE0F\",\n \"shortnames\": [\n \"timer_clock\"\n ]\n },\n {\n \"unified\": \"1F570-FE0F\",\n \"shortnames\": [\n \"mantelpiece_clock\"\n ]\n },\n {\n \"unified\": \"1F55B\",\n \"shortnames\": [\n \"clock12\"\n ]\n },\n {\n \"unified\": \"1F567\",\n \"shortnames\": [\n \"clock1230\"\n ]\n },\n {\n \"unified\": \"1F550\",\n \"shortnames\": [\n \"clock1\"\n ]\n },\n {\n \"unified\": \"1F55C\",\n \"shortnames\": [\n \"clock130\"\n ]\n },\n {\n \"unified\": \"1F551\",\n \"shortnames\": [\n \"clock2\"\n ]\n },\n {\n \"unified\": \"1F55D\",\n \"shortnames\": [\n \"clock230\"\n ]\n },\n {\n \"unified\": \"1F552\",\n \"shortnames\": [\n \"clock3\"\n ]\n },\n {\n \"unified\": \"1F55E\",\n \"shortnames\": [\n \"clock330\"\n ]\n },\n {\n \"unified\": \"1F553\",\n \"shortnames\": [\n \"clock4\"\n ]\n },\n {\n \"unified\": \"1F55F\",\n \"shortnames\": [\n \"clock430\"\n ]\n },\n {\n \"unified\": \"1F554\",\n \"shortnames\": [\n \"clock5\"\n ]\n },\n {\n \"unified\": \"1F560\",\n \"shortnames\": [\n \"clock530\"\n ]\n },\n {\n \"unified\": \"1F555\",\n \"shortnames\": [\n \"clock6\"\n ]\n },\n {\n \"unified\": \"1F561\",\n \"shortnames\": [\n \"clock630\"\n ]\n },\n {\n \"unified\": \"1F556\",\n \"shortnames\": [\n \"clock7\"\n ]\n },\n {\n \"unified\": \"1F562\",\n \"shortnames\": [\n \"clock730\"\n ]\n },\n {\n \"unified\": \"1F557\",\n \"shortnames\": [\n \"clock8\"\n ]\n },\n {\n \"unified\": \"1F563\",\n \"shortnames\": [\n \"clock830\"\n ]\n },\n {\n \"unified\": \"1F558\",\n \"shortnames\": [\n \"clock9\"\n ]\n },\n {\n \"unified\": \"1F564\",\n \"shortnames\": [\n \"clock930\"\n ]\n },\n {\n \"unified\": \"1F559\",\n \"shortnames\": [\n \"clock10\"\n ]\n },\n {\n \"unified\": \"1F565\",\n \"shortnames\": [\n \"clock1030\"\n ]\n },\n {\n \"unified\": \"1F55A\",\n \"shortnames\": [\n \"clock11\"\n ]\n },\n {\n \"unified\": \"1F566\",\n \"shortnames\": [\n \"clock1130\"\n ]\n },\n {\n \"unified\": \"1F311\",\n \"shortnames\": [\n \"new_moon\"\n ]\n },\n {\n \"unified\": \"1F312\",\n \"shortnames\": [\n \"waxing_crescent_moon\"\n ]\n },\n {\n \"unified\": \"1F313\",\n \"shortnames\": [\n \"first_quarter_moon\"\n ]\n },\n {\n \"unified\": \"1F314\",\n \"shortnames\": [\n \"moon\"\n ]\n },\n {\n \"unified\": \"1F315\",\n \"shortnames\": [\n \"full_moon\"\n ]\n },\n {\n \"unified\": \"1F316\",\n \"shortnames\": [\n \"waning_gibbous_moon\"\n ]\n },\n {\n \"unified\": \"1F317\",\n \"shortnames\": [\n \"last_quarter_moon\"\n ]\n },\n {\n \"unified\": \"1F318\",\n \"shortnames\": [\n \"waning_crescent_moon\"\n ]\n },\n {\n \"unified\": \"1F319\",\n \"shortnames\": [\n \"crescent_moon\"\n ]\n },\n {\n \"unified\": \"1F31A\",\n \"shortnames\": [\n \"new_moon_with_face\"\n ]\n },\n {\n \"unified\": \"1F31B\",\n \"shortnames\": [\n \"first_quarter_moon_with_face\"\n ]\n },\n {\n \"unified\": \"1F31C\",\n \"shortnames\": [\n \"last_quarter_moon_with_face\"\n ]\n },\n {\n \"unified\": \"1F321-FE0F\",\n \"shortnames\": [\n \"thermometer\"\n ]\n },\n {\n \"unified\": \"2600-FE0F\",\n \"shortnames\": [\n \"sunny\"\n ]\n },\n {\n \"unified\": \"1F31D\",\n \"shortnames\": [\n \"full_moon_with_face\"\n ]\n },\n {\n \"unified\": \"1F31E\",\n \"shortnames\": [\n \"sun_with_face\"\n ]\n },\n {\n \"unified\": \"1FA90\",\n \"shortnames\": [\n \"ringed_planet\"\n ]\n },\n {\n \"unified\": \"2B50\",\n \"shortnames\": [\n \"star\"\n ]\n },\n {\n \"unified\": \"1F31F\",\n \"shortnames\": [\n \"star2\"\n ]\n },\n {\n \"unified\": \"1F320\",\n \"shortnames\": [\n \"stars\"\n ]\n },\n {\n \"unified\": \"1F30C\",\n \"shortnames\": [\n \"milky_way\"\n ]\n },\n {\n \"unified\": \"2601-FE0F\",\n \"shortnames\": [\n \"cloud\"\n ]\n },\n {\n \"unified\": \"26C5\",\n \"shortnames\": [\n \"partly_sunny\"\n ]\n },\n {\n \"unified\": \"26C8-FE0F\",\n \"shortnames\": [\n \"thunder_cloud_and_rain\"\n ]\n },\n {\n \"unified\": \"1F324-FE0F\",\n \"shortnames\": [\n \"mostly_sunny\"\n ]\n },\n {\n \"unified\": \"1F325-FE0F\",\n \"shortnames\": [\n \"barely_sunny\"\n ]\n },\n {\n \"unified\": \"1F326-FE0F\",\n \"shortnames\": [\n \"partly_sunny_rain\"\n ]\n },\n {\n \"unified\": \"1F327-FE0F\",\n \"shortnames\": [\n \"rain_cloud\"\n ]\n },\n {\n \"unified\": \"1F328-FE0F\",\n \"shortnames\": [\n \"snow_cloud\"\n ]\n },\n {\n \"unified\": \"1F329-FE0F\",\n \"shortnames\": [\n \"lightning\"\n ]\n },\n {\n \"unified\": \"1F32A-FE0F\",\n \"shortnames\": [\n \"tornado\"\n ]\n },\n {\n \"unified\": \"1F32B-FE0F\",\n \"shortnames\": [\n \"fog\"\n ]\n },\n {\n \"unified\": \"1F32C-FE0F\",\n \"shortnames\": [\n \"wind_blowing_face\"\n ]\n },\n {\n \"unified\": \"1F300\",\n \"shortnames\": [\n \"cyclone\"\n ]\n },\n {\n \"unified\": \"1F308\",\n \"shortnames\": [\n \"rainbow\"\n ]\n },\n {\n \"unified\": \"1F302\",\n \"shortnames\": [\n \"closed_umbrella\"\n ]\n },\n {\n \"unified\": \"2602-FE0F\",\n \"shortnames\": [\n \"umbrella\"\n ]\n },\n {\n \"unified\": \"2614\",\n \"shortnames\": [\n \"umbrella_with_rain_drops\"\n ]\n },\n {\n \"unified\": \"26F1-FE0F\",\n \"shortnames\": [\n \"umbrella_on_ground\"\n ]\n },\n {\n \"unified\": \"26A1\",\n \"shortnames\": [\n \"zap\"\n ]\n },\n {\n \"unified\": \"2744-FE0F\",\n \"shortnames\": [\n \"snowflake\"\n ]\n },\n {\n \"unified\": \"2603-FE0F\",\n \"shortnames\": [\n \"snowman\"\n ]\n },\n {\n \"unified\": \"26C4\",\n \"shortnames\": [\n \"snowman_without_snow\"\n ]\n },\n {\n \"unified\": \"2604-FE0F\",\n \"shortnames\": [\n \"comet\"\n ]\n },\n {\n \"unified\": \"1F525\",\n \"shortnames\": [\n \"fire\"\n ]\n },\n {\n \"unified\": \"1F4A7\",\n \"shortnames\": [\n \"droplet\"\n ]\n },\n {\n \"unified\": \"1F30A\",\n \"shortnames\": [\n \"ocean\"\n ]\n }\n ]\n },\n {\n \"name\": \"Activities\",\n \"emojis\": [\n {\n \"unified\": \"1F383\",\n \"shortnames\": [\n \"jack_o_lantern\"\n ]\n },\n {\n \"unified\": \"1F384\",\n \"shortnames\": [\n \"christmas_tree\"\n ]\n },\n {\n \"unified\": \"1F386\",\n \"shortnames\": [\n \"fireworks\"\n ]\n },\n {\n \"unified\": \"1F387\",\n \"shortnames\": [\n \"sparkler\"\n ]\n },\n {\n \"unified\": \"1F9E8\",\n \"shortnames\": [\n \"firecracker\"\n ]\n },\n {\n \"unified\": \"2728\",\n \"shortnames\": [\n \"sparkles\"\n ]\n },\n {\n \"unified\": \"1F388\",\n \"shortnames\": [\n \"balloon\"\n ]\n },\n {\n \"unified\": \"1F389\",\n \"shortnames\": [\n \"tada\"\n ]\n },\n {\n \"unified\": \"1F38A\",\n \"shortnames\": [\n \"confetti_ball\"\n ]\n },\n {\n \"unified\": \"1F38B\",\n \"shortnames\": [\n \"tanabata_tree\"\n ]\n },\n {\n \"unified\": \"1F38D\",\n \"shortnames\": [\n \"bamboo\"\n ]\n },\n {\n \"unified\": \"1F38E\",\n \"shortnames\": [\n \"dolls\"\n ]\n },\n {\n \"unified\": \"1F38F\",\n \"shortnames\": [\n \"flags\"\n ]\n },\n {\n \"unified\": \"1F390\",\n \"shortnames\": [\n \"wind_chime\"\n ]\n },\n {\n \"unified\": \"1F391\",\n \"shortnames\": [\n \"rice_scene\"\n ]\n },\n {\n \"unified\": \"1F9E7\",\n \"shortnames\": [\n \"red_envelope\"\n ]\n },\n {\n \"unified\": \"1F380\",\n \"shortnames\": [\n \"ribbon\"\n ]\n },\n {\n \"unified\": \"1F381\",\n \"shortnames\": [\n \"gift\"\n ]\n },\n {\n \"unified\": \"1F397-FE0F\",\n \"shortnames\": [\n \"reminder_ribbon\"\n ]\n },\n {\n \"unified\": \"1F39F-FE0F\",\n \"shortnames\": [\n \"admission_tickets\"\n ]\n },\n {\n \"unified\": \"1F3AB\",\n \"shortnames\": [\n \"ticket\"\n ]\n },\n {\n \"unified\": \"1F396-FE0F\",\n \"shortnames\": [\n \"medal\"\n ]\n },\n {\n \"unified\": \"1F3C6\",\n \"shortnames\": [\n \"trophy\"\n ]\n },\n {\n \"unified\": \"1F3C5\",\n \"shortnames\": [\n \"sports_medal\"\n ]\n },\n {\n \"unified\": \"1F947\",\n \"shortnames\": [\n \"first_place_medal\"\n ]\n },\n {\n \"unified\": \"1F948\",\n \"shortnames\": [\n \"second_place_medal\"\n ]\n },\n {\n \"unified\": \"1F949\",\n \"shortnames\": [\n \"third_place_medal\"\n ]\n },\n {\n \"unified\": \"26BD\",\n \"shortnames\": [\n \"soccer\"\n ]\n },\n {\n \"unified\": \"26BE\",\n \"shortnames\": [\n \"baseball\"\n ]\n },\n {\n \"unified\": \"1F94E\",\n \"shortnames\": [\n \"softball\"\n ]\n },\n {\n \"unified\": \"1F3C0\",\n \"shortnames\": [\n \"basketball\"\n ]\n },\n {\n \"unified\": \"1F3D0\",\n \"shortnames\": [\n \"volleyball\"\n ]\n },\n {\n \"unified\": \"1F3C8\",\n \"shortnames\": [\n \"football\"\n ]\n },\n {\n \"unified\": \"1F3C9\",\n \"shortnames\": [\n \"rugby_football\"\n ]\n },\n {\n \"unified\": \"1F3BE\",\n \"shortnames\": [\n \"tennis\"\n ]\n },\n {\n \"unified\": \"1F94F\",\n \"shortnames\": [\n \"flying_disc\"\n ]\n },\n {\n \"unified\": \"1F3B3\",\n \"shortnames\": [\n \"bowling\"\n ]\n },\n {\n \"unified\": \"1F3CF\",\n \"shortnames\": [\n \"cricket_bat_and_ball\"\n ]\n },\n {\n \"unified\": \"1F3D1\",\n \"shortnames\": [\n \"field_hockey_stick_and_ball\"\n ]\n },\n {\n \"unified\": \"1F3D2\",\n \"shortnames\": [\n \"ice_hockey_stick_and_puck\"\n ]\n },\n {\n \"unified\": \"1F94D\",\n \"shortnames\": [\n \"lacrosse\"\n ]\n },\n {\n \"unified\": \"1F3D3\",\n \"shortnames\": [\n \"table_tennis_paddle_and_ball\"\n ]\n },\n {\n \"unified\": \"1F3F8\",\n \"shortnames\": [\n \"badminton_racquet_and_shuttlecock\"\n ]\n },\n {\n \"unified\": \"1F94A\",\n \"shortnames\": [\n \"boxing_glove\"\n ]\n },\n {\n \"unified\": \"1F94B\",\n \"shortnames\": [\n \"martial_arts_uniform\"\n ]\n },\n {\n \"unified\": \"1F945\",\n \"shortnames\": [\n \"goal_net\"\n ]\n },\n {\n \"unified\": \"26F3\",\n \"shortnames\": [\n \"golf\"\n ]\n },\n {\n \"unified\": \"26F8-FE0F\",\n \"shortnames\": [\n \"ice_skate\"\n ]\n },\n {\n \"unified\": \"1F3A3\",\n \"shortnames\": [\n \"fishing_pole_and_fish\"\n ]\n },\n {\n \"unified\": \"1F93F\",\n \"shortnames\": [\n \"diving_mask\"\n ]\n },\n {\n \"unified\": \"1F3BD\",\n \"shortnames\": [\n \"running_shirt_with_sash\"\n ]\n },\n {\n \"unified\": \"1F3BF\",\n \"shortnames\": [\n \"ski\"\n ]\n },\n {\n \"unified\": \"1F6F7\",\n \"shortnames\": [\n \"sled\"\n ]\n },\n {\n \"unified\": \"1F94C\",\n \"shortnames\": [\n \"curling_stone\"\n ]\n },\n {\n \"unified\": \"1F3AF\",\n \"shortnames\": [\n \"dart\"\n ]\n },\n {\n \"unified\": \"1FA80\",\n \"shortnames\": [\n \"yo-yo\"\n ]\n },\n {\n \"unified\": \"1FA81\",\n \"shortnames\": [\n \"kite\"\n ]\n },\n {\n \"unified\": \"1F3B1\",\n \"shortnames\": [\n \"8ball\"\n ]\n },\n {\n \"unified\": \"1F52E\",\n \"shortnames\": [\n \"crystal_ball\"\n ]\n },\n {\n \"unified\": \"1FA84\",\n \"shortnames\": [\n \"magic_wand\"\n ]\n },\n {\n \"unified\": \"1F9FF\",\n \"shortnames\": [\n \"nazar_amulet\"\n ]\n },\n {\n \"unified\": \"1F3AE\",\n \"shortnames\": [\n \"video_game\"\n ]\n },\n {\n \"unified\": \"1F579-FE0F\",\n \"shortnames\": [\n \"joystick\"\n ]\n },\n {\n \"unified\": \"1F3B0\",\n \"shortnames\": [\n \"slot_machine\"\n ]\n },\n {\n \"unified\": \"1F3B2\",\n \"shortnames\": [\n \"game_die\"\n ]\n },\n {\n \"unified\": \"1F9E9\",\n \"shortnames\": [\n \"jigsaw\"\n ]\n },\n {\n \"unified\": \"1F9F8\",\n \"shortnames\": [\n \"teddy_bear\"\n ]\n },\n {\n \"unified\": \"1FA85\",\n \"shortnames\": [\n \"pinata\"\n ]\n },\n {\n \"unified\": \"1FA86\",\n \"shortnames\": [\n \"nesting_dolls\"\n ]\n },\n {\n \"unified\": \"2660-FE0F\",\n \"shortnames\": [\n \"spades\"\n ]\n },\n {\n \"unified\": \"2665-FE0F\",\n \"shortnames\": [\n \"hearts\"\n ]\n },\n {\n \"unified\": \"2666-FE0F\",\n \"shortnames\": [\n \"diamonds\"\n ]\n },\n {\n \"unified\": \"2663-FE0F\",\n \"shortnames\": [\n \"clubs\"\n ]\n },\n {\n \"unified\": \"265F-FE0F\",\n \"shortnames\": [\n \"chess_pawn\"\n ]\n },\n {\n \"unified\": \"1F0CF\",\n \"shortnames\": [\n \"black_joker\"\n ]\n },\n {\n \"unified\": \"1F004\",\n \"shortnames\": [\n \"mahjong\"\n ]\n },\n {\n \"unified\": \"1F3B4\",\n \"shortnames\": [\n \"flower_playing_cards\"\n ]\n },\n {\n \"unified\": \"1F3AD\",\n \"shortnames\": [\n \"performing_arts\"\n ]\n },\n {\n \"unified\": \"1F5BC-FE0F\",\n \"shortnames\": [\n \"frame_with_picture\"\n ]\n },\n {\n \"unified\": \"1F3A8\",\n \"shortnames\": [\n \"art\"\n ]\n },\n {\n \"unified\": \"1F9F5\",\n \"shortnames\": [\n \"thread\"\n ]\n },\n {\n \"unified\": \"1FAA1\",\n \"shortnames\": [\n \"sewing_needle\"\n ]\n },\n {\n \"unified\": \"1F9F6\",\n \"shortnames\": [\n \"yarn\"\n ]\n },\n {\n \"unified\": \"1FAA2\",\n \"shortnames\": [\n \"knot\"\n ]\n }\n ]\n },\n {\n \"name\": \"Objects\",\n \"emojis\": [\n {\n \"unified\": \"1F453\",\n \"shortnames\": [\n \"eyeglasses\"\n ]\n },\n {\n \"unified\": \"1F576-FE0F\",\n \"shortnames\": [\n \"dark_sunglasses\"\n ]\n },\n {\n \"unified\": \"1F97D\",\n \"shortnames\": [\n \"goggles\"\n ]\n },\n {\n \"unified\": \"1F97C\",\n \"shortnames\": [\n \"lab_coat\"\n ]\n },\n {\n \"unified\": \"1F9BA\",\n \"shortnames\": [\n \"safety_vest\"\n ]\n },\n {\n \"unified\": \"1F454\",\n \"shortnames\": [\n \"necktie\"\n ]\n },\n {\n \"unified\": \"1F455\",\n \"shortnames\": [\n \"shirt\"\n ]\n },\n {\n \"unified\": \"1F456\",\n \"shortnames\": [\n \"jeans\"\n ]\n },\n {\n \"unified\": \"1F9E3\",\n \"shortnames\": [\n \"scarf\"\n ]\n },\n {\n \"unified\": \"1F9E4\",\n \"shortnames\": [\n \"gloves\"\n ]\n },\n {\n \"unified\": \"1F9E5\",\n \"shortnames\": [\n \"coat\"\n ]\n },\n {\n \"unified\": \"1F9E6\",\n \"shortnames\": [\n \"socks\"\n ]\n },\n {\n \"unified\": \"1F457\",\n \"shortnames\": [\n \"dress\"\n ]\n },\n {\n \"unified\": \"1F458\",\n \"shortnames\": [\n \"kimono\"\n ]\n },\n {\n \"unified\": \"1F97B\",\n \"shortnames\": [\n \"sari\"\n ]\n },\n {\n \"unified\": \"1FA71\",\n \"shortnames\": [\n \"one-piece_swimsuit\"\n ]\n },\n {\n \"unified\": \"1FA72\",\n \"shortnames\": [\n \"briefs\"\n ]\n },\n {\n \"unified\": \"1FA73\",\n \"shortnames\": [\n \"shorts\"\n ]\n },\n {\n \"unified\": \"1F459\",\n \"shortnames\": [\n \"bikini\"\n ]\n },\n {\n \"unified\": \"1F45A\",\n \"shortnames\": [\n \"womans_clothes\"\n ]\n },\n {\n \"unified\": \"1F45B\",\n \"shortnames\": [\n \"purse\"\n ]\n },\n {\n \"unified\": \"1F45C\",\n \"shortnames\": [\n \"handbag\"\n ]\n },\n {\n \"unified\": \"1F45D\",\n \"shortnames\": [\n \"pouch\"\n ]\n },\n {\n \"unified\": \"1F6CD-FE0F\",\n \"shortnames\": [\n \"shopping_bags\"\n ]\n },\n {\n \"unified\": \"1F392\",\n \"shortnames\": [\n \"school_satchel\"\n ]\n },\n {\n \"unified\": \"1FA74\",\n \"shortnames\": [\n \"thong_sandal\"\n ]\n },\n {\n \"unified\": \"1F45E\",\n \"shortnames\": [\n \"mans_shoe\"\n ]\n },\n {\n \"unified\": \"1F45F\",\n \"shortnames\": [\n \"athletic_shoe\"\n ]\n },\n {\n \"unified\": \"1F97E\",\n \"shortnames\": [\n \"hiking_boot\"\n ]\n },\n {\n \"unified\": \"1F97F\",\n \"shortnames\": [\n \"womans_flat_shoe\"\n ]\n },\n {\n \"unified\": \"1F460\",\n \"shortnames\": [\n \"high_heel\"\n ]\n },\n {\n \"unified\": \"1F461\",\n \"shortnames\": [\n \"sandal\"\n ]\n },\n {\n \"unified\": \"1FA70\",\n \"shortnames\": [\n \"ballet_shoes\"\n ]\n },\n {\n \"unified\": \"1F462\",\n \"shortnames\": [\n \"boot\"\n ]\n },\n {\n \"unified\": \"1F451\",\n \"shortnames\": [\n \"crown\"\n ]\n },\n {\n \"unified\": \"1F452\",\n \"shortnames\": [\n \"womans_hat\"\n ]\n },\n {\n \"unified\": \"1F3A9\",\n \"shortnames\": [\n \"tophat\"\n ]\n },\n {\n \"unified\": \"1F393\",\n \"shortnames\": [\n \"mortar_board\"\n ]\n },\n {\n \"unified\": \"1F9E2\",\n \"shortnames\": [\n \"billed_cap\"\n ]\n },\n {\n \"unified\": \"1FA96\",\n \"shortnames\": [\n \"military_helmet\"\n ]\n },\n {\n \"unified\": \"26D1-FE0F\",\n \"shortnames\": [\n \"helmet_with_white_cross\"\n ]\n },\n {\n \"unified\": \"1F4FF\",\n \"shortnames\": [\n \"prayer_beads\"\n ]\n },\n {\n \"unified\": \"1F484\",\n \"shortnames\": [\n \"lipstick\"\n ]\n },\n {\n \"unified\": \"1F48D\",\n \"shortnames\": [\n \"ring\"\n ]\n },\n {\n \"unified\": \"1F48E\",\n \"shortnames\": [\n \"gem\"\n ]\n },\n {\n \"unified\": \"1F507\",\n \"shortnames\": [\n \"mute\"\n ]\n },\n {\n \"unified\": \"1F508\",\n \"shortnames\": [\n \"speaker\"\n ]\n },\n {\n \"unified\": \"1F509\",\n \"shortnames\": [\n \"sound\"\n ]\n },\n {\n \"unified\": \"1F50A\",\n \"shortnames\": [\n \"loud_sound\"\n ]\n },\n {\n \"unified\": \"1F4E2\",\n \"shortnames\": [\n \"loudspeaker\"\n ]\n },\n {\n \"unified\": \"1F4E3\",\n \"shortnames\": [\n \"mega\"\n ]\n },\n {\n \"unified\": \"1F4EF\",\n \"shortnames\": [\n \"postal_horn\"\n ]\n },\n {\n \"unified\": \"1F514\",\n \"shortnames\": [\n \"bell\"\n ]\n },\n {\n \"unified\": \"1F515\",\n \"shortnames\": [\n \"no_bell\"\n ]\n },\n {\n \"unified\": \"1F3BC\",\n \"shortnames\": [\n \"musical_score\"\n ]\n },\n {\n \"unified\": \"1F3B5\",\n \"shortnames\": [\n \"musical_note\"\n ]\n },\n {\n \"unified\": \"1F3B6\",\n \"shortnames\": [\n \"notes\"\n ]\n },\n {\n \"unified\": \"1F399-FE0F\",\n \"shortnames\": [\n \"studio_microphone\"\n ]\n },\n {\n \"unified\": \"1F39A-FE0F\",\n \"shortnames\": [\n \"level_slider\"\n ]\n },\n {\n \"unified\": \"1F39B-FE0F\",\n \"shortnames\": [\n \"control_knobs\"\n ]\n },\n {\n \"unified\": \"1F3A4\",\n \"shortnames\": [\n \"microphone\"\n ]\n },\n {\n \"unified\": \"1F3A7\",\n \"shortnames\": [\n \"headphones\"\n ]\n },\n {\n \"unified\": \"1F4FB\",\n \"shortnames\": [\n \"radio\"\n ]\n },\n {\n \"unified\": \"1F3B7\",\n \"shortnames\": [\n \"saxophone\"\n ]\n },\n {\n \"unified\": \"1FA97\",\n \"shortnames\": [\n \"accordion\"\n ]\n },\n {\n \"unified\": \"1F3B8\",\n \"shortnames\": [\n \"guitar\"\n ]\n },\n {\n \"unified\": \"1F3B9\",\n \"shortnames\": [\n \"musical_keyboard\"\n ]\n },\n {\n \"unified\": \"1F3BA\",\n \"shortnames\": [\n \"trumpet\"\n ]\n },\n {\n \"unified\": \"1F3BB\",\n \"shortnames\": [\n \"violin\"\n ]\n },\n {\n \"unified\": \"1FA95\",\n \"shortnames\": [\n \"banjo\"\n ]\n },\n {\n \"unified\": \"1F941\",\n \"shortnames\": [\n \"drum_with_drumsticks\"\n ]\n },\n {\n \"unified\": \"1FA98\",\n \"shortnames\": [\n \"long_drum\"\n ]\n },\n {\n \"unified\": \"1F4F1\",\n \"shortnames\": [\n \"iphone\"\n ]\n },\n {\n \"unified\": \"1F4F2\",\n \"shortnames\": [\n \"calling\"\n ]\n },\n {\n \"unified\": \"260E-FE0F\",\n \"shortnames\": [\n \"phone\"\n ]\n },\n {\n \"unified\": \"1F4DE\",\n \"shortnames\": [\n \"telephone_receiver\"\n ]\n },\n {\n \"unified\": \"1F4DF\",\n \"shortnames\": [\n \"pager\"\n ]\n },\n {\n \"unified\": \"1F4E0\",\n \"shortnames\": [\n \"fax\"\n ]\n },\n {\n \"unified\": \"1F50B\",\n \"shortnames\": [\n \"battery\"\n ]\n },\n {\n \"unified\": \"1F50C\",\n \"shortnames\": [\n \"electric_plug\"\n ]\n },\n {\n \"unified\": \"1F4BB\",\n \"shortnames\": [\n \"computer\"\n ]\n },\n {\n \"unified\": \"1F5A5-FE0F\",\n \"shortnames\": [\n \"desktop_computer\"\n ]\n },\n {\n \"unified\": \"1F5A8-FE0F\",\n \"shortnames\": [\n \"printer\"\n ]\n },\n {\n \"unified\": \"2328-FE0F\",\n \"shortnames\": [\n \"keyboard\"\n ]\n },\n {\n \"unified\": \"1F5B1-FE0F\",\n \"shortnames\": [\n \"three_button_mouse\"\n ]\n },\n {\n \"unified\": \"1F5B2-FE0F\",\n \"shortnames\": [\n \"trackball\"\n ]\n },\n {\n \"unified\": \"1F4BD\",\n \"shortnames\": [\n \"minidisc\"\n ]\n },\n {\n \"unified\": \"1F4BE\",\n \"shortnames\": [\n \"floppy_disk\"\n ]\n },\n {\n \"unified\": \"1F4BF\",\n \"shortnames\": [\n \"cd\"\n ]\n },\n {\n \"unified\": \"1F4C0\",\n \"shortnames\": [\n \"dvd\"\n ]\n },\n {\n \"unified\": \"1F9EE\",\n \"shortnames\": [\n \"abacus\"\n ]\n },\n {\n \"unified\": \"1F3A5\",\n \"shortnames\": [\n \"movie_camera\"\n ]\n },\n {\n \"unified\": \"1F39E-FE0F\",\n \"shortnames\": [\n \"film_frames\"\n ]\n },\n {\n \"unified\": \"1F4FD-FE0F\",\n \"shortnames\": [\n \"film_projector\"\n ]\n },\n {\n \"unified\": \"1F3AC\",\n \"shortnames\": [\n \"clapper\"\n ]\n },\n {\n \"unified\": \"1F4FA\",\n \"shortnames\": [\n \"tv\"\n ]\n },\n {\n \"unified\": \"1F4F7\",\n \"shortnames\": [\n \"camera\"\n ]\n },\n {\n \"unified\": \"1F4F8\",\n \"shortnames\": [\n \"camera_with_flash\"\n ]\n },\n {\n \"unified\": \"1F4F9\",\n \"shortnames\": [\n \"video_camera\"\n ]\n },\n {\n \"unified\": \"1F4FC\",\n \"shortnames\": [\n \"vhs\"\n ]\n },\n {\n \"unified\": \"1F50D\",\n \"shortnames\": [\n \"mag\"\n ]\n },\n {\n \"unified\": \"1F50E\",\n \"shortnames\": [\n \"mag_right\"\n ]\n },\n {\n \"unified\": \"1F56F-FE0F\",\n \"shortnames\": [\n \"candle\"\n ]\n },\n {\n \"unified\": \"1F4A1\",\n \"shortnames\": [\n \"bulb\"\n ]\n },\n {\n \"unified\": \"1F526\",\n \"shortnames\": [\n \"flashlight\"\n ]\n },\n {\n \"unified\": \"1F3EE\",\n \"shortnames\": [\n \"izakaya_lantern\"\n ]\n },\n {\n \"unified\": \"1FA94\",\n \"shortnames\": [\n \"diya_lamp\"\n ]\n },\n {\n \"unified\": \"1F4D4\",\n \"shortnames\": [\n \"notebook_with_decorative_cover\"\n ]\n },\n {\n \"unified\": \"1F4D5\",\n \"shortnames\": [\n \"closed_book\"\n ]\n },\n {\n \"unified\": \"1F4D6\",\n \"shortnames\": [\n \"book\"\n ]\n },\n {\n \"unified\": \"1F4D7\",\n \"shortnames\": [\n \"green_book\"\n ]\n },\n {\n \"unified\": \"1F4D8\",\n \"shortnames\": [\n \"blue_book\"\n ]\n },\n {\n \"unified\": \"1F4D9\",\n \"shortnames\": [\n \"orange_book\"\n ]\n },\n {\n \"unified\": \"1F4DA\",\n \"shortnames\": [\n \"books\"\n ]\n },\n {\n \"unified\": \"1F4D3\",\n \"shortnames\": [\n \"notebook\"\n ]\n },\n {\n \"unified\": \"1F4D2\",\n \"shortnames\": [\n \"ledger\"\n ]\n },\n {\n \"unified\": \"1F4C3\",\n \"shortnames\": [\n \"page_with_curl\"\n ]\n },\n {\n \"unified\": \"1F4DC\",\n \"shortnames\": [\n \"scroll\"\n ]\n },\n {\n \"unified\": \"1F4C4\",\n \"shortnames\": [\n \"page_facing_up\"\n ]\n },\n {\n \"unified\": \"1F4F0\",\n \"shortnames\": [\n \"newspaper\"\n ]\n },\n {\n \"unified\": \"1F5DE-FE0F\",\n \"shortnames\": [\n \"rolled_up_newspaper\"\n ]\n },\n {\n \"unified\": \"1F4D1\",\n \"shortnames\": [\n \"bookmark_tabs\"\n ]\n },\n {\n \"unified\": \"1F516\",\n \"shortnames\": [\n \"bookmark\"\n ]\n },\n {\n \"unified\": \"1F3F7-FE0F\",\n \"shortnames\": [\n \"label\"\n ]\n },\n {\n \"unified\": \"1F4B0\",\n \"shortnames\": [\n \"moneybag\"\n ]\n },\n {\n \"unified\": \"1FA99\",\n \"shortnames\": [\n \"coin\"\n ]\n },\n {\n \"unified\": \"1F4B4\",\n \"shortnames\": [\n \"yen\"\n ]\n },\n {\n \"unified\": \"1F4B5\",\n \"shortnames\": [\n \"dollar\"\n ]\n },\n {\n \"unified\": \"1F4B6\",\n \"shortnames\": [\n \"euro\"\n ]\n },\n {\n \"unified\": \"1F4B7\",\n \"shortnames\": [\n \"pound\"\n ]\n },\n {\n \"unified\": \"1F4B8\",\n \"shortnames\": [\n \"money_with_wings\"\n ]\n },\n {\n \"unified\": \"1F4B3\",\n \"shortnames\": [\n \"credit_card\"\n ]\n },\n {\n \"unified\": \"1F9FE\",\n \"shortnames\": [\n \"receipt\"\n ]\n },\n {\n \"unified\": \"1F4B9\",\n \"shortnames\": [\n \"chart\"\n ]\n },\n {\n \"unified\": \"2709-FE0F\",\n \"shortnames\": [\n \"email\"\n ]\n },\n {\n \"unified\": \"1F4E7\",\n \"shortnames\": [\n \"e-mail\"\n ]\n },\n {\n \"unified\": \"1F4E8\",\n \"shortnames\": [\n \"incoming_envelope\"\n ]\n },\n {\n \"unified\": \"1F4E9\",\n \"shortnames\": [\n \"envelope_with_arrow\"\n ]\n },\n {\n \"unified\": \"1F4E4\",\n \"shortnames\": [\n \"outbox_tray\"\n ]\n },\n {\n \"unified\": \"1F4E5\",\n \"shortnames\": [\n \"inbox_tray\"\n ]\n },\n {\n \"unified\": \"1F4E6\",\n \"shortnames\": [\n \"package\"\n ]\n },\n {\n \"unified\": \"1F4EB\",\n \"shortnames\": [\n \"mailbox\"\n ]\n },\n {\n \"unified\": \"1F4EA\",\n \"shortnames\": [\n \"mailbox_closed\"\n ]\n },\n {\n \"unified\": \"1F4EC\",\n \"shortnames\": [\n \"mailbox_with_mail\"\n ]\n },\n {\n \"unified\": \"1F4ED\",\n \"shortnames\": [\n \"mailbox_with_no_mail\"\n ]\n },\n {\n \"unified\": \"1F4EE\",\n \"shortnames\": [\n \"postbox\"\n ]\n },\n {\n \"unified\": \"1F5F3-FE0F\",\n \"shortnames\": [\n \"ballot_box_with_ballot\"\n ]\n },\n {\n \"unified\": \"270F-FE0F\",\n \"shortnames\": [\n \"pencil2\"\n ]\n },\n {\n \"unified\": \"2712-FE0F\",\n \"shortnames\": [\n \"black_nib\"\n ]\n },\n {\n \"unified\": \"1F58B-FE0F\",\n \"shortnames\": [\n \"lower_left_fountain_pen\"\n ]\n },\n {\n \"unified\": \"1F58A-FE0F\",\n \"shortnames\": [\n \"lower_left_ballpoint_pen\"\n ]\n },\n {\n \"unified\": \"1F58C-FE0F\",\n \"shortnames\": [\n \"lower_left_paintbrush\"\n ]\n },\n {\n \"unified\": \"1F58D-FE0F\",\n \"shortnames\": [\n \"lower_left_crayon\"\n ]\n },\n {\n \"unified\": \"1F4DD\",\n \"shortnames\": [\n \"memo\"\n ]\n },\n {\n \"unified\": \"1F4BC\",\n \"shortnames\": [\n \"briefcase\"\n ]\n },\n {\n \"unified\": \"1F4C1\",\n \"shortnames\": [\n \"file_folder\"\n ]\n },\n {\n \"unified\": \"1F4C2\",\n \"shortnames\": [\n \"open_file_folder\"\n ]\n },\n {\n \"unified\": \"1F5C2-FE0F\",\n \"shortnames\": [\n \"card_index_dividers\"\n ]\n },\n {\n \"unified\": \"1F4C5\",\n \"shortnames\": [\n \"date\"\n ]\n },\n {\n \"unified\": \"1F4C6\",\n \"shortnames\": [\n \"calendar\"\n ]\n },\n {\n \"unified\": \"1F5D2-FE0F\",\n \"shortnames\": [\n \"spiral_note_pad\"\n ]\n },\n {\n \"unified\": \"1F5D3-FE0F\",\n \"shortnames\": [\n \"spiral_calendar_pad\"\n ]\n },\n {\n \"unified\": \"1F4C7\",\n \"shortnames\": [\n \"card_index\"\n ]\n },\n {\n \"unified\": \"1F4C8\",\n \"shortnames\": [\n \"chart_with_upwards_trend\"\n ]\n },\n {\n \"unified\": \"1F4C9\",\n \"shortnames\": [\n \"chart_with_downwards_trend\"\n ]\n },\n {\n \"unified\": \"1F4CA\",\n \"shortnames\": [\n \"bar_chart\"\n ]\n },\n {\n \"unified\": \"1F4CB\",\n \"shortnames\": [\n \"clipboard\"\n ]\n },\n {\n \"unified\": \"1F4CC\",\n \"shortnames\": [\n \"pushpin\"\n ]\n },\n {\n \"unified\": \"1F4CD\",\n \"shortnames\": [\n \"round_pushpin\"\n ]\n },\n {\n \"unified\": \"1F4CE\",\n \"shortnames\": [\n \"paperclip\"\n ]\n },\n {\n \"unified\": \"1F587-FE0F\",\n \"shortnames\": [\n \"linked_paperclips\"\n ]\n },\n {\n \"unified\": \"1F4CF\",\n \"shortnames\": [\n \"straight_ruler\"\n ]\n },\n {\n \"unified\": \"1F4D0\",\n \"shortnames\": [\n \"triangular_ruler\"\n ]\n },\n {\n \"unified\": \"2702-FE0F\",\n \"shortnames\": [\n \"scissors\"\n ]\n },\n {\n \"unified\": \"1F5C3-FE0F\",\n \"shortnames\": [\n \"card_file_box\"\n ]\n },\n {\n \"unified\": \"1F5C4-FE0F\",\n \"shortnames\": [\n \"file_cabinet\"\n ]\n },\n {\n \"unified\": \"1F5D1-FE0F\",\n \"shortnames\": [\n \"wastebasket\"\n ]\n },\n {\n \"unified\": \"1F512\",\n \"shortnames\": [\n \"lock\"\n ]\n },\n {\n \"unified\": \"1F513\",\n \"shortnames\": [\n \"unlock\"\n ]\n },\n {\n \"unified\": \"1F50F\",\n \"shortnames\": [\n \"lock_with_ink_pen\"\n ]\n },\n {\n \"unified\": \"1F510\",\n \"shortnames\": [\n \"closed_lock_with_key\"\n ]\n },\n {\n \"unified\": \"1F511\",\n \"shortnames\": [\n \"key\"\n ]\n },\n {\n \"unified\": \"1F5DD-FE0F\",\n \"shortnames\": [\n \"old_key\"\n ]\n },\n {\n \"unified\": \"1F528\",\n \"shortnames\": [\n \"hammer\"\n ]\n },\n {\n \"unified\": \"1FA93\",\n \"shortnames\": [\n \"axe\"\n ]\n },\n {\n \"unified\": \"26CF-FE0F\",\n \"shortnames\": [\n \"pick\"\n ]\n },\n {\n \"unified\": \"2692-FE0F\",\n \"shortnames\": [\n \"hammer_and_pick\"\n ]\n },\n {\n \"unified\": \"1F6E0-FE0F\",\n \"shortnames\": [\n \"hammer_and_wrench\"\n ]\n },\n {\n \"unified\": \"1F5E1-FE0F\",\n \"shortnames\": [\n \"dagger_knife\"\n ]\n },\n {\n \"unified\": \"2694-FE0F\",\n \"shortnames\": [\n \"crossed_swords\"\n ]\n },\n {\n \"unified\": \"1F52B\",\n \"shortnames\": [\n \"gun\"\n ]\n },\n {\n \"unified\": \"1FA83\",\n \"shortnames\": [\n \"boomerang\"\n ]\n },\n {\n \"unified\": \"1F3F9\",\n \"shortnames\": [\n \"bow_and_arrow\"\n ]\n },\n {\n \"unified\": \"1F6E1-FE0F\",\n \"shortnames\": [\n \"shield\"\n ]\n },\n {\n \"unified\": \"1FA9A\",\n \"shortnames\": [\n \"carpentry_saw\"\n ]\n },\n {\n \"unified\": \"1F527\",\n \"shortnames\": [\n \"wrench\"\n ]\n },\n {\n \"unified\": \"1FA9B\",\n \"shortnames\": [\n \"screwdriver\"\n ]\n },\n {\n \"unified\": \"1F529\",\n \"shortnames\": [\n \"nut_and_bolt\"\n ]\n },\n {\n \"unified\": \"2699-FE0F\",\n \"shortnames\": [\n \"gear\"\n ]\n },\n {\n \"unified\": \"1F5DC-FE0F\",\n \"shortnames\": [\n \"compression\"\n ]\n },\n {\n \"unified\": \"2696-FE0F\",\n \"shortnames\": [\n \"scales\"\n ]\n },\n {\n \"unified\": \"1F9AF\",\n \"shortnames\": [\n \"probing_cane\"\n ]\n },\n {\n \"unified\": \"1F517\",\n \"shortnames\": [\n \"link\"\n ]\n },\n {\n \"unified\": \"26D3-FE0F\",\n \"shortnames\": [\n \"chains\"\n ]\n },\n {\n \"unified\": \"1FA9D\",\n \"shortnames\": [\n \"hook\"\n ]\n },\n {\n \"unified\": \"1F9F0\",\n \"shortnames\": [\n \"toolbox\"\n ]\n },\n {\n \"unified\": \"1F9F2\",\n \"shortnames\": [\n \"magnet\"\n ]\n },\n {\n \"unified\": \"1FA9C\",\n \"shortnames\": [\n \"ladder\"\n ]\n },\n {\n \"unified\": \"2697-FE0F\",\n \"shortnames\": [\n \"alembic\"\n ]\n },\n {\n \"unified\": \"1F9EA\",\n \"shortnames\": [\n \"test_tube\"\n ]\n },\n {\n \"unified\": \"1F9EB\",\n \"shortnames\": [\n \"petri_dish\"\n ]\n },\n {\n \"unified\": \"1F9EC\",\n \"shortnames\": [\n \"dna\"\n ]\n },\n {\n \"unified\": \"1F52C\",\n \"shortnames\": [\n \"microscope\"\n ]\n },\n {\n \"unified\": \"1F52D\",\n \"shortnames\": [\n \"telescope\"\n ]\n },\n {\n \"unified\": \"1F4E1\",\n \"shortnames\": [\n \"satellite_antenna\"\n ]\n },\n {\n \"unified\": \"1F489\",\n \"shortnames\": [\n \"syringe\"\n ]\n },\n {\n \"unified\": \"1FA78\",\n \"shortnames\": [\n \"drop_of_blood\"\n ]\n },\n {\n \"unified\": \"1F48A\",\n \"shortnames\": [\n \"pill\"\n ]\n },\n {\n \"unified\": \"1FA79\",\n \"shortnames\": [\n \"adhesive_bandage\"\n ]\n },\n {\n \"unified\": \"1FA7A\",\n \"shortnames\": [\n \"stethoscope\"\n ]\n },\n {\n \"unified\": \"1F6AA\",\n \"shortnames\": [\n \"door\"\n ]\n },\n {\n \"unified\": \"1F6D7\",\n \"shortnames\": [\n \"elevator\"\n ]\n },\n {\n \"unified\": \"1FA9E\",\n \"shortnames\": [\n \"mirror\"\n ]\n },\n {\n \"unified\": \"1FA9F\",\n \"shortnames\": [\n \"window\"\n ]\n },\n {\n \"unified\": \"1F6CF-FE0F\",\n \"shortnames\": [\n \"bed\"\n ]\n },\n {\n \"unified\": \"1F6CB-FE0F\",\n \"shortnames\": [\n \"couch_and_lamp\"\n ]\n },\n {\n \"unified\": \"1FA91\",\n \"shortnames\": [\n \"chair\"\n ]\n },\n {\n \"unified\": \"1F6BD\",\n \"shortnames\": [\n \"toilet\"\n ]\n },\n {\n \"unified\": \"1FAA0\",\n \"shortnames\": [\n \"plunger\"\n ]\n },\n {\n \"unified\": \"1F6BF\",\n \"shortnames\": [\n \"shower\"\n ]\n },\n {\n \"unified\": \"1F6C1\",\n \"shortnames\": [\n \"bathtub\"\n ]\n },\n {\n \"unified\": \"1FAA4\",\n \"shortnames\": [\n \"mouse_trap\"\n ]\n },\n {\n \"unified\": \"1FA92\",\n \"shortnames\": [\n \"razor\"\n ]\n },\n {\n \"unified\": \"1F9F4\",\n \"shortnames\": [\n \"lotion_bottle\"\n ]\n },\n {\n \"unified\": \"1F9F7\",\n \"shortnames\": [\n \"safety_pin\"\n ]\n },\n {\n \"unified\": \"1F9F9\",\n \"shortnames\": [\n \"broom\"\n ]\n },\n {\n \"unified\": \"1F9FA\",\n \"shortnames\": [\n \"basket\"\n ]\n },\n {\n \"unified\": \"1F9FB\",\n \"shortnames\": [\n \"roll_of_paper\"\n ]\n },\n {\n \"unified\": \"1FAA3\",\n \"shortnames\": [\n \"bucket\"\n ]\n },\n {\n \"unified\": \"1F9FC\",\n \"shortnames\": [\n \"soap\"\n ]\n },\n {\n \"unified\": \"1FAA5\",\n \"shortnames\": [\n \"toothbrush\"\n ]\n },\n {\n \"unified\": \"1F9FD\",\n \"shortnames\": [\n \"sponge\"\n ]\n },\n {\n \"unified\": \"1F9EF\",\n \"shortnames\": [\n \"fire_extinguisher\"\n ]\n },\n {\n \"unified\": \"1F6D2\",\n \"shortnames\": [\n \"shopping_trolley\"\n ]\n },\n {\n \"unified\": \"1F6AC\",\n \"shortnames\": [\n \"smoking\"\n ]\n },\n {\n \"unified\": \"26B0-FE0F\",\n \"shortnames\": [\n \"coffin\"\n ]\n },\n {\n \"unified\": \"1FAA6\",\n \"shortnames\": [\n \"headstone\"\n ]\n },\n {\n \"unified\": \"26B1-FE0F\",\n \"shortnames\": [\n \"funeral_urn\"\n ]\n },\n {\n \"unified\": \"1F5FF\",\n \"shortnames\": [\n \"moyai\"\n ]\n },\n {\n \"unified\": \"1FAA7\",\n \"shortnames\": [\n \"placard\"\n ]\n }\n ]\n },\n {\n \"name\": \"Symbols\",\n \"emojis\": [\n {\n \"unified\": \"1F3E7\",\n \"shortnames\": [\n \"atm\"\n ]\n },\n {\n \"unified\": \"1F6AE\",\n \"shortnames\": [\n \"put_litter_in_its_place\"\n ]\n },\n {\n \"unified\": \"1F6B0\",\n \"shortnames\": [\n \"potable_water\"\n ]\n },\n {\n \"unified\": \"267F\",\n \"shortnames\": [\n \"wheelchair\"\n ]\n },\n {\n \"unified\": \"1F6B9\",\n \"shortnames\": [\n \"mens\"\n ]\n },\n {\n \"unified\": \"1F6BA\",\n \"shortnames\": [\n \"womens\"\n ]\n },\n {\n \"unified\": \"1F6BB\",\n \"shortnames\": [\n \"restroom\"\n ]\n },\n {\n \"unified\": \"1F6BC\",\n \"shortnames\": [\n \"baby_symbol\"\n ]\n },\n {\n \"unified\": \"1F6BE\",\n \"shortnames\": [\n \"wc\"\n ]\n },\n {\n \"unified\": \"1F6C2\",\n \"shortnames\": [\n \"passport_control\"\n ]\n },\n {\n \"unified\": \"1F6C3\",\n \"shortnames\": [\n \"customs\"\n ]\n },\n {\n \"unified\": \"1F6C4\",\n \"shortnames\": [\n \"baggage_claim\"\n ]\n },\n {\n \"unified\": \"1F6C5\",\n \"shortnames\": [\n \"left_luggage\"\n ]\n },\n {\n \"unified\": \"26A0-FE0F\",\n \"shortnames\": [\n \"warning\"\n ]\n },\n {\n \"unified\": \"1F6B8\",\n \"shortnames\": [\n \"children_crossing\"\n ]\n },\n {\n \"unified\": \"26D4\",\n \"shortnames\": [\n \"no_entry\"\n ]\n },\n {\n \"unified\": \"1F6AB\",\n \"shortnames\": [\n \"no_entry_sign\"\n ]\n },\n {\n \"unified\": \"1F6B3\",\n \"shortnames\": [\n \"no_bicycles\"\n ]\n },\n {\n \"unified\": \"1F6AD\",\n \"shortnames\": [\n \"no_smoking\"\n ]\n },\n {\n \"unified\": \"1F6AF\",\n \"shortnames\": [\n \"do_not_litter\"\n ]\n },\n {\n \"unified\": \"1F6B1\",\n \"shortnames\": [\n \"non-potable_water\"\n ]\n },\n {\n \"unified\": \"1F6B7\",\n \"shortnames\": [\n \"no_pedestrians\"\n ]\n },\n {\n \"unified\": \"1F4F5\",\n \"shortnames\": [\n \"no_mobile_phones\"\n ]\n },\n {\n \"unified\": \"1F51E\",\n \"shortnames\": [\n \"underage\"\n ]\n },\n {\n \"unified\": \"2622-FE0F\",\n \"shortnames\": [\n \"radioactive_sign\"\n ]\n },\n {\n \"unified\": \"2623-FE0F\",\n \"shortnames\": [\n \"biohazard_sign\"\n ]\n },\n {\n \"unified\": \"2B06-FE0F\",\n \"shortnames\": [\n \"arrow_up\"\n ]\n },\n {\n \"unified\": \"2197-FE0F\",\n \"shortnames\": [\n \"arrow_upper_right\"\n ]\n },\n {\n \"unified\": \"27A1-FE0F\",\n \"shortnames\": [\n \"arrow_right\"\n ]\n },\n {\n \"unified\": \"2198-FE0F\",\n \"shortnames\": [\n \"arrow_lower_right\"\n ]\n },\n {\n \"unified\": \"2B07-FE0F\",\n \"shortnames\": [\n \"arrow_down\"\n ]\n },\n {\n \"unified\": \"2199-FE0F\",\n \"shortnames\": [\n \"arrow_lower_left\"\n ]\n },\n {\n \"unified\": \"2B05-FE0F\",\n \"shortnames\": [\n \"arrow_left\"\n ]\n },\n {\n \"unified\": \"2196-FE0F\",\n \"shortnames\": [\n \"arrow_upper_left\"\n ]\n },\n {\n \"unified\": \"2195-FE0F\",\n \"shortnames\": [\n \"arrow_up_down\"\n ]\n },\n {\n \"unified\": \"2194-FE0F\",\n \"shortnames\": [\n \"left_right_arrow\"\n ]\n },\n {\n \"unified\": \"21A9-FE0F\",\n \"shortnames\": [\n \"leftwards_arrow_with_hook\"\n ]\n },\n {\n \"unified\": \"21AA-FE0F\",\n \"shortnames\": [\n \"arrow_right_hook\"\n ]\n },\n {\n \"unified\": \"2934-FE0F\",\n \"shortnames\": [\n \"arrow_heading_up\"\n ]\n },\n {\n \"unified\": \"2935-FE0F\",\n \"shortnames\": [\n \"arrow_heading_down\"\n ]\n },\n {\n \"unified\": \"1F503\",\n \"shortnames\": [\n \"arrows_clockwise\"\n ]\n },\n {\n \"unified\": \"1F504\",\n \"shortnames\": [\n \"arrows_counterclockwise\"\n ]\n },\n {\n \"unified\": \"1F519\",\n \"shortnames\": [\n \"back\"\n ]\n },\n {\n \"unified\": \"1F51A\",\n \"shortnames\": [\n \"end\"\n ]\n },\n {\n \"unified\": \"1F51B\",\n \"shortnames\": [\n \"on\"\n ]\n },\n {\n \"unified\": \"1F51C\",\n \"shortnames\": [\n \"soon\"\n ]\n },\n {\n \"unified\": \"1F51D\",\n \"shortnames\": [\n \"top\"\n ]\n },\n {\n \"unified\": \"1F6D0\",\n \"shortnames\": [\n \"place_of_worship\"\n ]\n },\n {\n \"unified\": \"269B-FE0F\",\n \"shortnames\": [\n \"atom_symbol\"\n ]\n },\n {\n \"unified\": \"1F549-FE0F\",\n \"shortnames\": [\n \"om_symbol\"\n ]\n },\n {\n \"unified\": \"2721-FE0F\",\n \"shortnames\": [\n \"star_of_david\"\n ]\n },\n {\n \"unified\": \"2638-FE0F\",\n \"shortnames\": [\n \"wheel_of_dharma\"\n ]\n },\n {\n \"unified\": \"262F-FE0F\",\n \"shortnames\": [\n \"yin_yang\"\n ]\n },\n {\n \"unified\": \"271D-FE0F\",\n \"shortnames\": [\n \"latin_cross\"\n ]\n },\n {\n \"unified\": \"2626-FE0F\",\n \"shortnames\": [\n \"orthodox_cross\"\n ]\n },\n {\n \"unified\": \"262A-FE0F\",\n \"shortnames\": [\n \"star_and_crescent\"\n ]\n },\n {\n \"unified\": \"262E-FE0F\",\n \"shortnames\": [\n \"peace_symbol\"\n ]\n },\n {\n \"unified\": \"1F54E\",\n \"shortnames\": [\n \"menorah_with_nine_branches\"\n ]\n },\n {\n \"unified\": \"1F52F\",\n \"shortnames\": [\n \"six_pointed_star\"\n ]\n },\n {\n \"unified\": \"2648\",\n \"shortnames\": [\n \"aries\"\n ]\n },\n {\n \"unified\": \"2649\",\n \"shortnames\": [\n \"taurus\"\n ]\n },\n {\n \"unified\": \"264A\",\n \"shortnames\": [\n \"gemini\"\n ]\n },\n {\n \"unified\": \"264B\",\n \"shortnames\": [\n \"cancer\"\n ]\n },\n {\n \"unified\": \"264C\",\n \"shortnames\": [\n \"leo\"\n ]\n },\n {\n \"unified\": \"264D\",\n \"shortnames\": [\n \"virgo\"\n ]\n },\n {\n \"unified\": \"264E\",\n \"shortnames\": [\n \"libra\"\n ]\n },\n {\n \"unified\": \"264F\",\n \"shortnames\": [\n \"scorpius\"\n ]\n },\n {\n \"unified\": \"2650\",\n \"shortnames\": [\n \"sagittarius\"\n ]\n },\n {\n \"unified\": \"2651\",\n \"shortnames\": [\n \"capricorn\"\n ]\n },\n {\n \"unified\": \"2652\",\n \"shortnames\": [\n \"aquarius\"\n ]\n },\n {\n \"unified\": \"2653\",\n \"shortnames\": [\n \"pisces\"\n ]\n },\n {\n \"unified\": \"26CE\",\n \"shortnames\": [\n \"ophiuchus\"\n ]\n },\n {\n \"unified\": \"1F500\",\n \"shortnames\": [\n \"twisted_rightwards_arrows\"\n ]\n },\n {\n \"unified\": \"1F501\",\n \"shortnames\": [\n \"repeat\"\n ]\n },\n {\n \"unified\": \"1F502\",\n \"shortnames\": [\n \"repeat_one\"\n ]\n },\n {\n \"unified\": \"25B6-FE0F\",\n \"shortnames\": [\n \"arrow_forward\"\n ]\n },\n {\n \"unified\": \"23E9\",\n \"shortnames\": [\n \"fast_forward\"\n ]\n },\n {\n \"unified\": \"23ED-FE0F\",\n \"shortnames\": [\n \"black_right_pointing_double_triangle_with_vertical_bar\"\n ]\n },\n {\n \"unified\": \"23EF-FE0F\",\n \"shortnames\": [\n \"black_right_pointing_triangle_with_double_vertical_bar\"\n ]\n },\n {\n \"unified\": \"25C0-FE0F\",\n \"shortnames\": [\n \"arrow_backward\"\n ]\n },\n {\n \"unified\": \"23EA\",\n \"shortnames\": [\n \"rewind\"\n ]\n },\n {\n \"unified\": \"23EE-FE0F\",\n \"shortnames\": [\n \"black_left_pointing_double_triangle_with_vertical_bar\"\n ]\n },\n {\n \"unified\": \"1F53C\",\n \"shortnames\": [\n \"arrow_up_small\"\n ]\n },\n {\n \"unified\": \"23EB\",\n \"shortnames\": [\n \"arrow_double_up\"\n ]\n },\n {\n \"unified\": \"1F53D\",\n \"shortnames\": [\n \"arrow_down_small\"\n ]\n },\n {\n \"unified\": \"23EC\",\n \"shortnames\": [\n \"arrow_double_down\"\n ]\n },\n {\n \"unified\": \"23F8-FE0F\",\n \"shortnames\": [\n \"double_vertical_bar\"\n ]\n },\n {\n \"unified\": \"23F9-FE0F\",\n \"shortnames\": [\n \"black_square_for_stop\"\n ]\n },\n {\n \"unified\": \"23FA-FE0F\",\n \"shortnames\": [\n \"black_circle_for_record\"\n ]\n },\n {\n \"unified\": \"23CF-FE0F\",\n \"shortnames\": [\n \"eject\"\n ]\n },\n {\n \"unified\": \"1F3A6\",\n \"shortnames\": [\n \"cinema\"\n ]\n },\n {\n \"unified\": \"1F505\",\n \"shortnames\": [\n \"low_brightness\"\n ]\n },\n {\n \"unified\": \"1F506\",\n \"shortnames\": [\n \"high_brightness\"\n ]\n },\n {\n \"unified\": \"1F4F6\",\n \"shortnames\": [\n \"signal_strength\"\n ]\n },\n {\n \"unified\": \"1F4F3\",\n \"shortnames\": [\n \"vibration_mode\"\n ]\n },\n {\n \"unified\": \"1F4F4\",\n \"shortnames\": [\n \"mobile_phone_off\"\n ]\n },\n {\n \"unified\": \"2640-FE0F\",\n \"shortnames\": [\n \"female_sign\"\n ]\n },\n {\n \"unified\": \"2642-FE0F\",\n \"shortnames\": [\n \"male_sign\"\n ]\n },\n {\n \"unified\": \"26A7-FE0F\",\n \"shortnames\": [\n \"transgender_symbol\"\n ]\n },\n {\n \"unified\": \"2716-FE0F\",\n \"shortnames\": [\n \"heavy_multiplication_x\"\n ]\n },\n {\n \"unified\": \"2795\",\n \"shortnames\": [\n \"heavy_plus_sign\"\n ]\n },\n {\n \"unified\": \"2796\",\n \"shortnames\": [\n \"heavy_minus_sign\"\n ]\n },\n {\n \"unified\": \"2797\",\n \"shortnames\": [\n \"heavy_division_sign\"\n ]\n },\n {\n \"unified\": \"267E-FE0F\",\n \"shortnames\": [\n \"infinity\"\n ]\n },\n {\n \"unified\": \"203C-FE0F\",\n \"shortnames\": [\n \"bangbang\"\n ]\n },\n {\n \"unified\": \"2049-FE0F\",\n \"shortnames\": [\n \"interrobang\"\n ]\n },\n {\n \"unified\": \"2753\",\n \"shortnames\": [\n \"question\"\n ]\n },\n {\n \"unified\": \"2754\",\n \"shortnames\": [\n \"grey_question\"\n ]\n },\n {\n \"unified\": \"2755\",\n \"shortnames\": [\n \"grey_exclamation\"\n ]\n },\n {\n \"unified\": \"2757\",\n \"shortnames\": [\n \"exclamation\"\n ]\n },\n {\n \"unified\": \"3030-FE0F\",\n \"shortnames\": [\n \"wavy_dash\"\n ]\n },\n {\n \"unified\": \"1F4B1\",\n \"shortnames\": [\n \"currency_exchange\"\n ]\n },\n {\n \"unified\": \"1F4B2\",\n \"shortnames\": [\n \"heavy_dollar_sign\"\n ]\n },\n {\n \"unified\": \"2695-FE0F\",\n \"shortnames\": [\n \"medical_symbol\"\n ]\n },\n {\n \"unified\": \"267B-FE0F\",\n \"shortnames\": [\n \"recycle\"\n ]\n },\n {\n \"unified\": \"269C-FE0F\",\n \"shortnames\": [\n \"fleur_de_lis\"\n ]\n },\n {\n \"unified\": \"1F531\",\n \"shortnames\": [\n \"trident\"\n ]\n },\n {\n \"unified\": \"1F4DB\",\n \"shortnames\": [\n \"name_badge\"\n ]\n },\n {\n \"unified\": \"1F530\",\n \"shortnames\": [\n \"beginner\"\n ]\n },\n {\n \"unified\": \"2B55\",\n \"shortnames\": [\n \"o\"\n ]\n },\n {\n \"unified\": \"2705\",\n \"shortnames\": [\n \"white_check_mark\"\n ]\n },\n {\n \"unified\": \"2611-FE0F\",\n \"shortnames\": [\n \"ballot_box_with_check\"\n ]\n },\n {\n \"unified\": \"2714-FE0F\",\n \"shortnames\": [\n \"heavy_check_mark\"\n ]\n },\n {\n \"unified\": \"274C\",\n \"shortnames\": [\n \"x\"\n ]\n },\n {\n \"unified\": \"274E\",\n \"shortnames\": [\n \"negative_squared_cross_mark\"\n ]\n },\n {\n \"unified\": \"27B0\",\n \"shortnames\": [\n \"curly_loop\"\n ]\n },\n {\n \"unified\": \"27BF\",\n \"shortnames\": [\n \"loop\"\n ]\n },\n {\n \"unified\": \"303D-FE0F\",\n \"shortnames\": [\n \"part_alternation_mark\"\n ]\n },\n {\n \"unified\": \"2733-FE0F\",\n \"shortnames\": [\n \"eight_spoked_asterisk\"\n ]\n },\n {\n \"unified\": \"2734-FE0F\",\n \"shortnames\": [\n \"eight_pointed_black_star\"\n ]\n },\n {\n \"unified\": \"2747-FE0F\",\n \"shortnames\": [\n \"sparkle\"\n ]\n },\n {\n \"unified\": \"00A9-FE0F\",\n \"shortnames\": [\n \"copyright\"\n ]\n },\n {\n \"unified\": \"00AE-FE0F\",\n \"shortnames\": [\n \"registered\"\n ]\n },\n {\n \"unified\": \"2122-FE0F\",\n \"shortnames\": [\n \"tm\"\n ]\n },\n {\n \"unified\": \"0023-FE0F-20E3\",\n \"shortnames\": [\n \"hash\"\n ]\n },\n {\n \"unified\": \"002A-FE0F-20E3\",\n \"shortnames\": [\n \"keycap_star\"\n ]\n },\n {\n \"unified\": \"0030-FE0F-20E3\",\n \"shortnames\": [\n \"zero\"\n ]\n },\n {\n \"unified\": \"0031-FE0F-20E3\",\n \"shortnames\": [\n \"one\"\n ]\n },\n {\n \"unified\": \"0032-FE0F-20E3\",\n \"shortnames\": [\n \"two\"\n ]\n },\n {\n \"unified\": \"0033-FE0F-20E3\",\n \"shortnames\": [\n \"three\"\n ]\n },\n {\n \"unified\": \"0034-FE0F-20E3\",\n \"shortnames\": [\n \"four\"\n ]\n },\n {\n \"unified\": \"0035-FE0F-20E3\",\n \"shortnames\": [\n \"five\"\n ]\n },\n {\n \"unified\": \"0036-FE0F-20E3\",\n \"shortnames\": [\n \"six\"\n ]\n },\n {\n \"unified\": \"0037-FE0F-20E3\",\n \"shortnames\": [\n \"seven\"\n ]\n },\n {\n \"unified\": \"0038-FE0F-20E3\",\n \"shortnames\": [\n \"eight\"\n ]\n },\n {\n \"unified\": \"0039-FE0F-20E3\",\n \"shortnames\": [\n \"nine\"\n ]\n },\n {\n \"unified\": \"1F51F\",\n \"shortnames\": [\n \"keycap_ten\"\n ]\n },\n {\n \"unified\": \"1F520\",\n \"shortnames\": [\n \"capital_abcd\"\n ]\n },\n {\n \"unified\": \"1F521\",\n \"shortnames\": [\n \"abcd\"\n ]\n },\n {\n \"unified\": \"1F522\",\n \"shortnames\": [\n \"1234\"\n ]\n },\n {\n \"unified\": \"1F523\",\n \"shortnames\": [\n \"symbols\"\n ]\n },\n {\n \"unified\": \"1F524\",\n \"shortnames\": [\n \"abc\"\n ]\n },\n {\n \"unified\": \"1F170-FE0F\",\n \"shortnames\": [\n \"a\"\n ]\n },\n {\n \"unified\": \"1F18E\",\n \"shortnames\": [\n \"ab\"\n ]\n },\n {\n \"unified\": \"1F171-FE0F\",\n \"shortnames\": [\n \"b\"\n ]\n },\n {\n \"unified\": \"1F191\",\n \"shortnames\": [\n \"cl\"\n ]\n },\n {\n \"unified\": \"1F192\",\n \"shortnames\": [\n \"cool\"\n ]\n },\n {\n \"unified\": \"1F193\",\n \"shortnames\": [\n \"free\"\n ]\n },\n {\n \"unified\": \"2139-FE0F\",\n \"shortnames\": [\n \"information_source\"\n ]\n },\n {\n \"unified\": \"1F194\",\n \"shortnames\": [\n \"id\"\n ]\n },\n {\n \"unified\": \"24C2-FE0F\",\n \"shortnames\": [\n \"m\"\n ]\n },\n {\n \"unified\": \"1F195\",\n \"shortnames\": [\n \"new\"\n ]\n },\n {\n \"unified\": \"1F196\",\n \"shortnames\": [\n \"ng\"\n ]\n },\n {\n \"unified\": \"1F17E-FE0F\",\n \"shortnames\": [\n \"o2\"\n ]\n },\n {\n \"unified\": \"1F197\",\n \"shortnames\": [\n \"ok\"\n ]\n },\n {\n \"unified\": \"1F17F-FE0F\",\n \"shortnames\": [\n \"parking\"\n ]\n },\n {\n \"unified\": \"1F198\",\n \"shortnames\": [\n \"sos\"\n ]\n },\n {\n \"unified\": \"1F199\",\n \"shortnames\": [\n \"up\"\n ]\n },\n {\n \"unified\": \"1F19A\",\n \"shortnames\": [\n \"vs\"\n ]\n },\n {\n \"unified\": \"1F201\",\n \"shortnames\": [\n \"koko\"\n ]\n },\n {\n \"unified\": \"1F202-FE0F\",\n \"shortnames\": [\n \"sa\"\n ]\n },\n {\n \"unified\": \"1F237-FE0F\",\n \"shortnames\": [\n \"u6708\"\n ]\n },\n {\n \"unified\": \"1F236\",\n \"shortnames\": [\n \"u6709\"\n ]\n },\n {\n \"unified\": \"1F22F\",\n \"shortnames\": [\n \"u6307\"\n ]\n },\n {\n \"unified\": \"1F250\",\n \"shortnames\": [\n \"ideograph_advantage\"\n ]\n },\n {\n \"unified\": \"1F239\",\n \"shortnames\": [\n \"u5272\"\n ]\n },\n {\n \"unified\": \"1F21A\",\n \"shortnames\": [\n \"u7121\"\n ]\n },\n {\n \"unified\": \"1F232\",\n \"shortnames\": [\n \"u7981\"\n ]\n },\n {\n \"unified\": \"1F251\",\n \"shortnames\": [\n \"accept\"\n ]\n },\n {\n \"unified\": \"1F238\",\n \"shortnames\": [\n \"u7533\"\n ]\n },\n {\n \"unified\": \"1F234\",\n \"shortnames\": [\n \"u5408\"\n ]\n },\n {\n \"unified\": \"1F233\",\n \"shortnames\": [\n \"u7a7a\"\n ]\n },\n {\n \"unified\": \"3297-FE0F\",\n \"shortnames\": [\n \"congratulations\"\n ]\n },\n {\n \"unified\": \"3299-FE0F\",\n \"shortnames\": [\n \"secret\"\n ]\n },\n {\n \"unified\": \"1F23A\",\n \"shortnames\": [\n \"u55b6\"\n ]\n },\n {\n \"unified\": \"1F235\",\n \"shortnames\": [\n \"u6e80\"\n ]\n },\n {\n \"unified\": \"1F534\",\n \"shortnames\": [\n \"red_circle\"\n ]\n },\n {\n \"unified\": \"1F7E0\",\n \"shortnames\": [\n \"large_orange_circle\"\n ]\n },\n {\n \"unified\": \"1F7E1\",\n \"shortnames\": [\n \"large_yellow_circle\"\n ]\n },\n {\n \"unified\": \"1F7E2\",\n \"shortnames\": [\n \"large_green_circle\"\n ]\n },\n {\n \"unified\": \"1F535\",\n \"shortnames\": [\n \"large_blue_circle\"\n ]\n },\n {\n \"unified\": \"1F7E3\",\n \"shortnames\": [\n \"large_purple_circle\"\n ]\n },\n {\n \"unified\": \"1F7E4\",\n \"shortnames\": [\n \"large_brown_circle\"\n ]\n },\n {\n \"unified\": \"26AB\",\n \"shortnames\": [\n \"black_circle\"\n ]\n },\n {\n \"unified\": \"26AA\",\n \"shortnames\": [\n \"white_circle\"\n ]\n },\n {\n \"unified\": \"1F7E5\",\n \"shortnames\": [\n \"large_red_square\"\n ]\n },\n {\n \"unified\": \"1F7E7\",\n \"shortnames\": [\n \"large_orange_square\"\n ]\n },\n {\n \"unified\": \"1F7E8\",\n \"shortnames\": [\n \"large_yellow_square\"\n ]\n },\n {\n \"unified\": \"1F7E9\",\n \"shortnames\": [\n \"large_green_square\"\n ]\n },\n {\n \"unified\": \"1F7E6\",\n \"shortnames\": [\n \"large_blue_square\"\n ]\n },\n {\n \"unified\": \"1F7EA\",\n \"shortnames\": [\n \"large_purple_square\"\n ]\n },\n {\n \"unified\": \"1F7EB\",\n \"shortnames\": [\n \"large_brown_square\"\n ]\n },\n {\n \"unified\": \"2B1B\",\n \"shortnames\": [\n \"black_large_square\"\n ]\n },\n {\n \"unified\": \"2B1C\",\n \"shortnames\": [\n \"white_large_square\"\n ]\n },\n {\n \"unified\": \"25FC-FE0F\",\n \"shortnames\": [\n \"black_medium_square\"\n ]\n },\n {\n \"unified\": \"25FB-FE0F\",\n \"shortnames\": [\n \"white_medium_square\"\n ]\n },\n {\n \"unified\": \"25FE\",\n \"shortnames\": [\n \"black_medium_small_square\"\n ]\n },\n {\n \"unified\": \"25FD\",\n \"shortnames\": [\n \"white_medium_small_square\"\n ]\n },\n {\n \"unified\": \"25AA-FE0F\",\n \"shortnames\": [\n \"black_small_square\"\n ]\n },\n {\n \"unified\": \"25AB-FE0F\",\n \"shortnames\": [\n \"white_small_square\"\n ]\n },\n {\n \"unified\": \"1F536\",\n \"shortnames\": [\n \"large_orange_diamond\"\n ]\n },\n {\n \"unified\": \"1F537\",\n \"shortnames\": [\n \"large_blue_diamond\"\n ]\n },\n {\n \"unified\": \"1F538\",\n \"shortnames\": [\n \"small_orange_diamond\"\n ]\n },\n {\n \"unified\": \"1F539\",\n \"shortnames\": [\n \"small_blue_diamond\"\n ]\n },\n {\n \"unified\": \"1F53A\",\n \"shortnames\": [\n \"small_red_triangle\"\n ]\n },\n {\n \"unified\": \"1F53B\",\n \"shortnames\": [\n \"small_red_triangle_down\"\n ]\n },\n {\n \"unified\": \"1F4A0\",\n \"shortnames\": [\n \"diamond_shape_with_a_dot_inside\"\n ]\n },\n {\n \"unified\": \"1F518\",\n \"shortnames\": [\n \"radio_button\"\n ]\n },\n {\n \"unified\": \"1F533\",\n \"shortnames\": [\n \"white_square_button\"\n ]\n },\n {\n \"unified\": \"1F532\",\n \"shortnames\": [\n \"black_square_button\"\n ]\n }\n ]\n },\n {\n \"name\": \"Flags\",\n \"emojis\": [\n {\n \"unified\": \"1F3C1\",\n \"shortnames\": [\n \"checkered_flag\"\n ]\n },\n {\n \"unified\": \"1F6A9\",\n \"shortnames\": [\n \"triangular_flag_on_post\"\n ]\n },\n {\n \"unified\": \"1F38C\",\n \"shortnames\": [\n \"crossed_flags\"\n ]\n },\n {\n \"unified\": \"1F3F4\",\n \"shortnames\": [\n \"waving_black_flag\"\n ]\n },\n {\n \"unified\": \"1F3F3-FE0F\",\n \"shortnames\": [\n \"waving_white_flag\"\n ]\n },\n {\n \"unified\": \"1F3F3-FE0F-200D-1F308\",\n \"shortnames\": [\n \"rainbow-flag\"\n ]\n },\n {\n \"unified\": \"1F3F3-FE0F-200D-26A7-FE0F\",\n \"shortnames\": [\n \"transgender_flag\"\n ]\n },\n {\n \"unified\": \"1F3F4-200D-2620-FE0F\",\n \"shortnames\": [\n \"pirate_flag\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1E8\",\n \"shortnames\": [\n \"flag-ac\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1E9\",\n \"shortnames\": [\n \"flag-ad\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1EA\",\n \"shortnames\": [\n \"flag-ae\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1EB\",\n \"shortnames\": [\n \"flag-af\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1EC\",\n \"shortnames\": [\n \"flag-ag\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1EE\",\n \"shortnames\": [\n \"flag-ai\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F1\",\n \"shortnames\": [\n \"flag-al\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F2\",\n \"shortnames\": [\n \"flag-am\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F4\",\n \"shortnames\": [\n \"flag-ao\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F6\",\n \"shortnames\": [\n \"flag-aq\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F7\",\n \"shortnames\": [\n \"flag-ar\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F8\",\n \"shortnames\": [\n \"flag-as\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F9\",\n \"shortnames\": [\n \"flag-at\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1FA\",\n \"shortnames\": [\n \"flag-au\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1FC\",\n \"shortnames\": [\n \"flag-aw\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1FD\",\n \"shortnames\": [\n \"flag-ax\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1FF\",\n \"shortnames\": [\n \"flag-az\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1E6\",\n \"shortnames\": [\n \"flag-ba\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1E7\",\n \"shortnames\": [\n \"flag-bb\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1E9\",\n \"shortnames\": [\n \"flag-bd\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1EA\",\n \"shortnames\": [\n \"flag-be\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1EB\",\n \"shortnames\": [\n \"flag-bf\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1EC\",\n \"shortnames\": [\n \"flag-bg\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1ED\",\n \"shortnames\": [\n \"flag-bh\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1EE\",\n \"shortnames\": [\n \"flag-bi\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1EF\",\n \"shortnames\": [\n \"flag-bj\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F1\",\n \"shortnames\": [\n \"flag-bl\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F2\",\n \"shortnames\": [\n \"flag-bm\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F3\",\n \"shortnames\": [\n \"flag-bn\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F4\",\n \"shortnames\": [\n \"flag-bo\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F6\",\n \"shortnames\": [\n \"flag-bq\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F7\",\n \"shortnames\": [\n \"flag-br\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F8\",\n \"shortnames\": [\n \"flag-bs\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F9\",\n \"shortnames\": [\n \"flag-bt\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1FB\",\n \"shortnames\": [\n \"flag-bv\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1FC\",\n \"shortnames\": [\n \"flag-bw\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1FE\",\n \"shortnames\": [\n \"flag-by\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1FF\",\n \"shortnames\": [\n \"flag-bz\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1E6\",\n \"shortnames\": [\n \"flag-ca\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1E8\",\n \"shortnames\": [\n \"flag-cc\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1E9\",\n \"shortnames\": [\n \"flag-cd\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1EB\",\n \"shortnames\": [\n \"flag-cf\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1EC\",\n \"shortnames\": [\n \"flag-cg\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1ED\",\n \"shortnames\": [\n \"flag-ch\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1EE\",\n \"shortnames\": [\n \"flag-ci\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F0\",\n \"shortnames\": [\n \"flag-ck\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F1\",\n \"shortnames\": [\n \"flag-cl\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F2\",\n \"shortnames\": [\n \"flag-cm\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F3\",\n \"shortnames\": [\n \"cn\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F4\",\n \"shortnames\": [\n \"flag-co\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F5\",\n \"shortnames\": [\n \"flag-cp\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F7\",\n \"shortnames\": [\n \"flag-cr\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1FA\",\n \"shortnames\": [\n \"flag-cu\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1FB\",\n \"shortnames\": [\n \"flag-cv\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1FC\",\n \"shortnames\": [\n \"flag-cw\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1FD\",\n \"shortnames\": [\n \"flag-cx\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1FE\",\n \"shortnames\": [\n \"flag-cy\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1FF\",\n \"shortnames\": [\n \"flag-cz\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1EA\",\n \"shortnames\": [\n \"de\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1EC\",\n \"shortnames\": [\n \"flag-dg\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1EF\",\n \"shortnames\": [\n \"flag-dj\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1F0\",\n \"shortnames\": [\n \"flag-dk\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1F2\",\n \"shortnames\": [\n \"flag-dm\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1F4\",\n \"shortnames\": [\n \"flag-do\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1FF\",\n \"shortnames\": [\n \"flag-dz\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1E6\",\n \"shortnames\": [\n \"flag-ea\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1E8\",\n \"shortnames\": [\n \"flag-ec\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1EA\",\n \"shortnames\": [\n \"flag-ee\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1EC\",\n \"shortnames\": [\n \"flag-eg\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1ED\",\n \"shortnames\": [\n \"flag-eh\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1F7\",\n \"shortnames\": [\n \"flag-er\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1F8\",\n \"shortnames\": [\n \"es\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1F9\",\n \"shortnames\": [\n \"flag-et\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1FA\",\n \"shortnames\": [\n \"flag-eu\"\n ]\n },\n {\n \"unified\": \"1F1EB-1F1EE\",\n \"shortnames\": [\n \"flag-fi\"\n ]\n },\n {\n \"unified\": \"1F1EB-1F1EF\",\n \"shortnames\": [\n \"flag-fj\"\n ]\n },\n {\n \"unified\": \"1F1EB-1F1F0\",\n \"shortnames\": [\n \"flag-fk\"\n ]\n },\n {\n \"unified\": \"1F1EB-1F1F2\",\n \"shortnames\": [\n \"flag-fm\"\n ]\n },\n {\n \"unified\": \"1F1EB-1F1F4\",\n \"shortnames\": [\n \"flag-fo\"\n ]\n },\n {\n \"unified\": \"1F1EB-1F1F7\",\n \"shortnames\": [\n \"fr\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1E6\",\n \"shortnames\": [\n \"flag-ga\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1E7\",\n \"shortnames\": [\n \"gb\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1E9\",\n \"shortnames\": [\n \"flag-gd\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1EA\",\n \"shortnames\": [\n \"flag-ge\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1EB\",\n \"shortnames\": [\n \"flag-gf\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1EC\",\n \"shortnames\": [\n \"flag-gg\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1ED\",\n \"shortnames\": [\n \"flag-gh\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1EE\",\n \"shortnames\": [\n \"flag-gi\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F1\",\n \"shortnames\": [\n \"flag-gl\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F2\",\n \"shortnames\": [\n \"flag-gm\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F3\",\n \"shortnames\": [\n \"flag-gn\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F5\",\n \"shortnames\": [\n \"flag-gp\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F6\",\n \"shortnames\": [\n \"flag-gq\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F7\",\n \"shortnames\": [\n \"flag-gr\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F8\",\n \"shortnames\": [\n \"flag-gs\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F9\",\n \"shortnames\": [\n \"flag-gt\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1FA\",\n \"shortnames\": [\n \"flag-gu\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1FC\",\n \"shortnames\": [\n \"flag-gw\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1FE\",\n \"shortnames\": [\n \"flag-gy\"\n ]\n },\n {\n \"unified\": \"1F1ED-1F1F0\",\n \"shortnames\": [\n \"flag-hk\"\n ]\n },\n {\n \"unified\": \"1F1ED-1F1F2\",\n \"shortnames\": [\n \"flag-hm\"\n ]\n },\n {\n \"unified\": \"1F1ED-1F1F3\",\n \"shortnames\": [\n \"flag-hn\"\n ]\n },\n {\n \"unified\": \"1F1ED-1F1F7\",\n \"shortnames\": [\n \"flag-hr\"\n ]\n },\n {\n \"unified\": \"1F1ED-1F1F9\",\n \"shortnames\": [\n \"flag-ht\"\n ]\n },\n {\n \"unified\": \"1F1ED-1F1FA\",\n \"shortnames\": [\n \"flag-hu\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1E8\",\n \"shortnames\": [\n \"flag-ic\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1E9\",\n \"shortnames\": [\n \"flag-id\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1EA\",\n \"shortnames\": [\n \"flag-ie\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F1\",\n \"shortnames\": [\n \"flag-il\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F2\",\n \"shortnames\": [\n \"flag-im\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F3\",\n \"shortnames\": [\n \"flag-in\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F4\",\n \"shortnames\": [\n \"flag-io\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F6\",\n \"shortnames\": [\n \"flag-iq\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F7\",\n \"shortnames\": [\n \"flag-ir\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F8\",\n \"shortnames\": [\n \"flag-is\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F9\",\n \"shortnames\": [\n \"it\"\n ]\n },\n {\n \"unified\": \"1F1EF-1F1EA\",\n \"shortnames\": [\n \"flag-je\"\n ]\n },\n {\n \"unified\": \"1F1EF-1F1F2\",\n \"shortnames\": [\n \"flag-jm\"\n ]\n },\n {\n \"unified\": \"1F1EF-1F1F4\",\n \"shortnames\": [\n \"flag-jo\"\n ]\n },\n {\n \"unified\": \"1F1EF-1F1F5\",\n \"shortnames\": [\n \"jp\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1EA\",\n \"shortnames\": [\n \"flag-ke\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1EC\",\n \"shortnames\": [\n \"flag-kg\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1ED\",\n \"shortnames\": [\n \"flag-kh\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1EE\",\n \"shortnames\": [\n \"flag-ki\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1F2\",\n \"shortnames\": [\n \"flag-km\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1F3\",\n \"shortnames\": [\n \"flag-kn\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1F5\",\n \"shortnames\": [\n \"flag-kp\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1F7\",\n \"shortnames\": [\n \"kr\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1FC\",\n \"shortnames\": [\n \"flag-kw\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1FE\",\n \"shortnames\": [\n \"flag-ky\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1FF\",\n \"shortnames\": [\n \"flag-kz\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1E6\",\n \"shortnames\": [\n \"flag-la\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1E7\",\n \"shortnames\": [\n \"flag-lb\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1E8\",\n \"shortnames\": [\n \"flag-lc\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1EE\",\n \"shortnames\": [\n \"flag-li\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1F0\",\n \"shortnames\": [\n \"flag-lk\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1F7\",\n \"shortnames\": [\n \"flag-lr\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1F8\",\n \"shortnames\": [\n \"flag-ls\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1F9\",\n \"shortnames\": [\n \"flag-lt\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1FA\",\n \"shortnames\": [\n \"flag-lu\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1FB\",\n \"shortnames\": [\n \"flag-lv\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1FE\",\n \"shortnames\": [\n \"flag-ly\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1E6\",\n \"shortnames\": [\n \"flag-ma\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1E8\",\n \"shortnames\": [\n \"flag-mc\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1E9\",\n \"shortnames\": [\n \"flag-md\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1EA\",\n \"shortnames\": [\n \"flag-me\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1EB\",\n \"shortnames\": [\n \"flag-mf\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1EC\",\n \"shortnames\": [\n \"flag-mg\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1ED\",\n \"shortnames\": [\n \"flag-mh\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F0\",\n \"shortnames\": [\n \"flag-mk\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F1\",\n \"shortnames\": [\n \"flag-ml\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F2\",\n \"shortnames\": [\n \"flag-mm\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F3\",\n \"shortnames\": [\n \"flag-mn\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F4\",\n \"shortnames\": [\n \"flag-mo\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F5\",\n \"shortnames\": [\n \"flag-mp\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F6\",\n \"shortnames\": [\n \"flag-mq\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F7\",\n \"shortnames\": [\n \"flag-mr\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F8\",\n \"shortnames\": [\n \"flag-ms\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F9\",\n \"shortnames\": [\n \"flag-mt\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1FA\",\n \"shortnames\": [\n \"flag-mu\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1FB\",\n \"shortnames\": [\n \"flag-mv\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1FC\",\n \"shortnames\": [\n \"flag-mw\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1FD\",\n \"shortnames\": [\n \"flag-mx\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1FE\",\n \"shortnames\": [\n \"flag-my\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1FF\",\n \"shortnames\": [\n \"flag-mz\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1E6\",\n \"shortnames\": [\n \"flag-na\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1E8\",\n \"shortnames\": [\n \"flag-nc\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1EA\",\n \"shortnames\": [\n \"flag-ne\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1EB\",\n \"shortnames\": [\n \"flag-nf\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1EC\",\n \"shortnames\": [\n \"flag-ng\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1EE\",\n \"shortnames\": [\n \"flag-ni\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1F1\",\n \"shortnames\": [\n \"flag-nl\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1F4\",\n \"shortnames\": [\n \"flag-no\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1F5\",\n \"shortnames\": [\n \"flag-np\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1F7\",\n \"shortnames\": [\n \"flag-nr\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1FA\",\n \"shortnames\": [\n \"flag-nu\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1FF\",\n \"shortnames\": [\n \"flag-nz\"\n ]\n },\n {\n \"unified\": \"1F1F4-1F1F2\",\n \"shortnames\": [\n \"flag-om\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1E6\",\n \"shortnames\": [\n \"flag-pa\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1EA\",\n \"shortnames\": [\n \"flag-pe\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1EB\",\n \"shortnames\": [\n \"flag-pf\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1EC\",\n \"shortnames\": [\n \"flag-pg\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1ED\",\n \"shortnames\": [\n \"flag-ph\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F0\",\n \"shortnames\": [\n \"flag-pk\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F1\",\n \"shortnames\": [\n \"flag-pl\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F2\",\n \"shortnames\": [\n \"flag-pm\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F3\",\n \"shortnames\": [\n \"flag-pn\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F7\",\n \"shortnames\": [\n \"flag-pr\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F8\",\n \"shortnames\": [\n \"flag-ps\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F9\",\n \"shortnames\": [\n \"flag-pt\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1FC\",\n \"shortnames\": [\n \"flag-pw\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1FE\",\n \"shortnames\": [\n \"flag-py\"\n ]\n },\n {\n \"unified\": \"1F1F6-1F1E6\",\n \"shortnames\": [\n \"flag-qa\"\n ]\n },\n {\n \"unified\": \"1F1F7-1F1EA\",\n \"shortnames\": [\n \"flag-re\"\n ]\n },\n {\n \"unified\": \"1F1F7-1F1F4\",\n \"shortnames\": [\n \"flag-ro\"\n ]\n },\n {\n \"unified\": \"1F1F7-1F1F8\",\n \"shortnames\": [\n \"flag-rs\"\n ]\n },\n {\n \"unified\": \"1F1F7-1F1FA\",\n \"shortnames\": [\n \"ru\"\n ]\n },\n {\n \"unified\": \"1F1F7-1F1FC\",\n \"shortnames\": [\n \"flag-rw\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1E6\",\n \"shortnames\": [\n \"flag-sa\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1E7\",\n \"shortnames\": [\n \"flag-sb\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1E8\",\n \"shortnames\": [\n \"flag-sc\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1E9\",\n \"shortnames\": [\n \"flag-sd\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1EA\",\n \"shortnames\": [\n \"flag-se\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1EC\",\n \"shortnames\": [\n \"flag-sg\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1ED\",\n \"shortnames\": [\n \"flag-sh\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1EE\",\n \"shortnames\": [\n \"flag-si\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1EF\",\n \"shortnames\": [\n \"flag-sj\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F0\",\n \"shortnames\": [\n \"flag-sk\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F1\",\n \"shortnames\": [\n \"flag-sl\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F2\",\n \"shortnames\": [\n \"flag-sm\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F3\",\n \"shortnames\": [\n \"flag-sn\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F4\",\n \"shortnames\": [\n \"flag-so\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F7\",\n \"shortnames\": [\n \"flag-sr\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F8\",\n \"shortnames\": [\n \"flag-ss\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F9\",\n \"shortnames\": [\n \"flag-st\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1FB\",\n \"shortnames\": [\n \"flag-sv\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1FD\",\n \"shortnames\": [\n \"flag-sx\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1FE\",\n \"shortnames\": [\n \"flag-sy\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1FF\",\n \"shortnames\": [\n \"flag-sz\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1E6\",\n \"shortnames\": [\n \"flag-ta\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1E8\",\n \"shortnames\": [\n \"flag-tc\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1E9\",\n \"shortnames\": [\n \"flag-td\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1EB\",\n \"shortnames\": [\n \"flag-tf\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1EC\",\n \"shortnames\": [\n \"flag-tg\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1ED\",\n \"shortnames\": [\n \"flag-th\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1EF\",\n \"shortnames\": [\n \"flag-tj\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F0\",\n \"shortnames\": [\n \"flag-tk\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F1\",\n \"shortnames\": [\n \"flag-tl\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F2\",\n \"shortnames\": [\n \"flag-tm\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F3\",\n \"shortnames\": [\n \"flag-tn\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F4\",\n \"shortnames\": [\n \"flag-to\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F7\",\n \"shortnames\": [\n \"flag-tr\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F9\",\n \"shortnames\": [\n \"flag-tt\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1FB\",\n \"shortnames\": [\n \"flag-tv\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1FC\",\n \"shortnames\": [\n \"flag-tw\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1FF\",\n \"shortnames\": [\n \"flag-tz\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1E6\",\n \"shortnames\": [\n \"flag-ua\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1EC\",\n \"shortnames\": [\n \"flag-ug\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1F2\",\n \"shortnames\": [\n \"flag-um\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1F3\",\n \"shortnames\": [\n \"flag-un\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1F8\",\n \"shortnames\": [\n \"us\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1FE\",\n \"shortnames\": [\n \"flag-uy\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1FF\",\n \"shortnames\": [\n \"flag-uz\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1E6\",\n \"shortnames\": [\n \"flag-va\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1E8\",\n \"shortnames\": [\n \"flag-vc\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1EA\",\n \"shortnames\": [\n \"flag-ve\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1EC\",\n \"shortnames\": [\n \"flag-vg\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1EE\",\n \"shortnames\": [\n \"flag-vi\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1F3\",\n \"shortnames\": [\n \"flag-vn\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1FA\",\n \"shortnames\": [\n \"flag-vu\"\n ]\n },\n {\n \"unified\": \"1F1FC-1F1EB\",\n \"shortnames\": [\n \"flag-wf\"\n ]\n },\n {\n \"unified\": \"1F1FC-1F1F8\",\n \"shortnames\": [\n \"flag-ws\"\n ]\n },\n {\n \"unified\": \"1F1FD-1F1F0\",\n \"shortnames\": [\n \"flag-xk\"\n ]\n },\n {\n \"unified\": \"1F1FE-1F1EA\",\n \"shortnames\": [\n \"flag-ye\"\n ]\n },\n {\n \"unified\": \"1F1FE-1F1F9\",\n \"shortnames\": [\n \"flag-yt\"\n ]\n },\n {\n \"unified\": \"1F1FF-1F1E6\",\n \"shortnames\": [\n \"flag-za\"\n ]\n },\n {\n \"unified\": \"1F1FF-1F1F2\",\n \"shortnames\": [\n \"flag-zm\"\n ]\n },\n {\n \"unified\": \"1F1FF-1F1FC\",\n \"shortnames\": [\n \"flag-zw\"\n ]\n },\n {\n \"unified\": \"1F3F4-E0067-E0062-E0065-E006E-E0067-E007F\",\n \"shortnames\": [\n \"flag-england\"\n ]\n },\n {\n \"unified\": \"1F3F4-E0067-E0062-E0073-E0063-E0074-E007F\",\n \"shortnames\": [\n \"flag-scotland\"\n ]\n },\n {\n \"unified\": \"1F3F4-E0067-E0062-E0077-E006C-E0073-E007F\",\n \"shortnames\": [\n \"flag-wales\"\n ]\n }\n ]\n }\n];\n\nexport const byShortName = {\n \"hash\": \"0023-FE0F-20E3\",\n \"keycap_star\": \"002A-FE0F-20E3\",\n \"zero\": \"0030-FE0F-20E3\",\n \"one\": \"0031-FE0F-20E3\",\n \"two\": \"0032-FE0F-20E3\",\n \"three\": \"0033-FE0F-20E3\",\n \"four\": \"0034-FE0F-20E3\",\n \"five\": \"0035-FE0F-20E3\",\n \"six\": \"0036-FE0F-20E3\",\n \"seven\": \"0037-FE0F-20E3\",\n \"eight\": \"0038-FE0F-20E3\",\n \"nine\": \"0039-FE0F-20E3\",\n \"copyright\": \"00A9-FE0F\",\n \"registered\": \"00AE-FE0F\",\n \"mahjong\": \"1F004\",\n \"black_joker\": \"1F0CF\",\n \"a\": \"1F170-FE0F\",\n \"b\": \"1F171-FE0F\",\n \"o2\": \"1F17E-FE0F\",\n \"parking\": \"1F17F-FE0F\",\n \"ab\": \"1F18E\",\n \"cl\": \"1F191\",\n \"cool\": \"1F192\",\n \"free\": \"1F193\",\n \"id\": \"1F194\",\n \"new\": \"1F195\",\n \"ng\": \"1F196\",\n \"ok\": \"1F197\",\n \"sos\": \"1F198\",\n \"up\": \"1F199\",\n \"vs\": \"1F19A\",\n \"flag-ac\": \"1F1E6-1F1E8\",\n \"flag-ad\": \"1F1E6-1F1E9\",\n \"flag-ae\": \"1F1E6-1F1EA\",\n \"flag-af\": \"1F1E6-1F1EB\",\n \"flag-ag\": \"1F1E6-1F1EC\",\n \"flag-ai\": \"1F1E6-1F1EE\",\n \"flag-al\": \"1F1E6-1F1F1\",\n \"flag-am\": \"1F1E6-1F1F2\",\n \"flag-ao\": \"1F1E6-1F1F4\",\n \"flag-aq\": \"1F1E6-1F1F6\",\n \"flag-ar\": \"1F1E6-1F1F7\",\n \"flag-as\": \"1F1E6-1F1F8\",\n \"flag-at\": \"1F1E6-1F1F9\",\n \"flag-au\": \"1F1E6-1F1FA\",\n \"flag-aw\": \"1F1E6-1F1FC\",\n \"flag-ax\": \"1F1E6-1F1FD\",\n \"flag-az\": \"1F1E6-1F1FF\",\n \"flag-ba\": \"1F1E7-1F1E6\",\n \"flag-bb\": \"1F1E7-1F1E7\",\n \"flag-bd\": \"1F1E7-1F1E9\",\n \"flag-be\": \"1F1E7-1F1EA\",\n \"flag-bf\": \"1F1E7-1F1EB\",\n \"flag-bg\": \"1F1E7-1F1EC\",\n \"flag-bh\": \"1F1E7-1F1ED\",\n \"flag-bi\": \"1F1E7-1F1EE\",\n \"flag-bj\": \"1F1E7-1F1EF\",\n \"flag-bl\": \"1F1E7-1F1F1\",\n \"flag-bm\": \"1F1E7-1F1F2\",\n \"flag-bn\": \"1F1E7-1F1F3\",\n \"flag-bo\": \"1F1E7-1F1F4\",\n \"flag-bq\": \"1F1E7-1F1F6\",\n \"flag-br\": \"1F1E7-1F1F7\",\n \"flag-bs\": \"1F1E7-1F1F8\",\n \"flag-bt\": \"1F1E7-1F1F9\",\n \"flag-bv\": \"1F1E7-1F1FB\",\n \"flag-bw\": \"1F1E7-1F1FC\",\n \"flag-by\": \"1F1E7-1F1FE\",\n \"flag-bz\": \"1F1E7-1F1FF\",\n \"flag-ca\": \"1F1E8-1F1E6\",\n \"flag-cc\": \"1F1E8-1F1E8\",\n \"flag-cd\": \"1F1E8-1F1E9\",\n \"flag-cf\": \"1F1E8-1F1EB\",\n \"flag-cg\": \"1F1E8-1F1EC\",\n \"flag-ch\": \"1F1E8-1F1ED\",\n \"flag-ci\": \"1F1E8-1F1EE\",\n \"flag-ck\": \"1F1E8-1F1F0\",\n \"flag-cl\": \"1F1E8-1F1F1\",\n \"flag-cm\": \"1F1E8-1F1F2\",\n \"cn\": \"1F1E8-1F1F3\",\n \"flag-co\": \"1F1E8-1F1F4\",\n \"flag-cp\": \"1F1E8-1F1F5\",\n \"flag-cr\": \"1F1E8-1F1F7\",\n \"flag-cu\": \"1F1E8-1F1FA\",\n \"flag-cv\": \"1F1E8-1F1FB\",\n \"flag-cw\": \"1F1E8-1F1FC\",\n \"flag-cx\": \"1F1E8-1F1FD\",\n \"flag-cy\": \"1F1E8-1F1FE\",\n \"flag-cz\": \"1F1E8-1F1FF\",\n \"de\": \"1F1E9-1F1EA\",\n \"flag-dg\": \"1F1E9-1F1EC\",\n \"flag-dj\": \"1F1E9-1F1EF\",\n \"flag-dk\": \"1F1E9-1F1F0\",\n \"flag-dm\": \"1F1E9-1F1F2\",\n \"flag-do\": \"1F1E9-1F1F4\",\n \"flag-dz\": \"1F1E9-1F1FF\",\n \"flag-ea\": \"1F1EA-1F1E6\",\n \"flag-ec\": \"1F1EA-1F1E8\",\n \"flag-ee\": \"1F1EA-1F1EA\",\n \"flag-eg\": \"1F1EA-1F1EC\",\n \"flag-eh\": \"1F1EA-1F1ED\",\n \"flag-er\": \"1F1EA-1F1F7\",\n \"es\": \"1F1EA-1F1F8\",\n \"flag-et\": \"1F1EA-1F1F9\",\n \"flag-eu\": \"1F1EA-1F1FA\",\n \"flag-fi\": \"1F1EB-1F1EE\",\n \"flag-fj\": \"1F1EB-1F1EF\",\n \"flag-fk\": \"1F1EB-1F1F0\",\n \"flag-fm\": \"1F1EB-1F1F2\",\n \"flag-fo\": \"1F1EB-1F1F4\",\n \"fr\": \"1F1EB-1F1F7\",\n \"flag-ga\": \"1F1EC-1F1E6\",\n \"gb\": \"1F1EC-1F1E7\",\n \"flag-gd\": \"1F1EC-1F1E9\",\n \"flag-ge\": \"1F1EC-1F1EA\",\n \"flag-gf\": \"1F1EC-1F1EB\",\n \"flag-gg\": \"1F1EC-1F1EC\",\n \"flag-gh\": \"1F1EC-1F1ED\",\n \"flag-gi\": \"1F1EC-1F1EE\",\n \"flag-gl\": \"1F1EC-1F1F1\",\n \"flag-gm\": \"1F1EC-1F1F2\",\n \"flag-gn\": \"1F1EC-1F1F3\",\n \"flag-gp\": \"1F1EC-1F1F5\",\n \"flag-gq\": \"1F1EC-1F1F6\",\n \"flag-gr\": \"1F1EC-1F1F7\",\n \"flag-gs\": \"1F1EC-1F1F8\",\n \"flag-gt\": \"1F1EC-1F1F9\",\n \"flag-gu\": \"1F1EC-1F1FA\",\n \"flag-gw\": \"1F1EC-1F1FC\",\n \"flag-gy\": \"1F1EC-1F1FE\",\n \"flag-hk\": \"1F1ED-1F1F0\",\n \"flag-hm\": \"1F1ED-1F1F2\",\n \"flag-hn\": \"1F1ED-1F1F3\",\n \"flag-hr\": \"1F1ED-1F1F7\",\n \"flag-ht\": \"1F1ED-1F1F9\",\n \"flag-hu\": \"1F1ED-1F1FA\",\n \"flag-ic\": \"1F1EE-1F1E8\",\n \"flag-id\": \"1F1EE-1F1E9\",\n \"flag-ie\": \"1F1EE-1F1EA\",\n \"flag-il\": \"1F1EE-1F1F1\",\n \"flag-im\": \"1F1EE-1F1F2\",\n \"flag-in\": \"1F1EE-1F1F3\",\n \"flag-io\": \"1F1EE-1F1F4\",\n \"flag-iq\": \"1F1EE-1F1F6\",\n \"flag-ir\": \"1F1EE-1F1F7\",\n \"flag-is\": \"1F1EE-1F1F8\",\n \"it\": \"1F1EE-1F1F9\",\n \"flag-je\": \"1F1EF-1F1EA\",\n \"flag-jm\": \"1F1EF-1F1F2\",\n \"flag-jo\": \"1F1EF-1F1F4\",\n \"jp\": \"1F1EF-1F1F5\",\n \"flag-ke\": \"1F1F0-1F1EA\",\n \"flag-kg\": \"1F1F0-1F1EC\",\n \"flag-kh\": \"1F1F0-1F1ED\",\n \"flag-ki\": \"1F1F0-1F1EE\",\n \"flag-km\": \"1F1F0-1F1F2\",\n \"flag-kn\": \"1F1F0-1F1F3\",\n \"flag-kp\": \"1F1F0-1F1F5\",\n \"kr\": \"1F1F0-1F1F7\",\n \"flag-kw\": \"1F1F0-1F1FC\",\n \"flag-ky\": \"1F1F0-1F1FE\",\n \"flag-kz\": \"1F1F0-1F1FF\",\n \"flag-la\": \"1F1F1-1F1E6\",\n \"flag-lb\": \"1F1F1-1F1E7\",\n \"flag-lc\": \"1F1F1-1F1E8\",\n \"flag-li\": \"1F1F1-1F1EE\",\n \"flag-lk\": \"1F1F1-1F1F0\",\n \"flag-lr\": \"1F1F1-1F1F7\",\n \"flag-ls\": \"1F1F1-1F1F8\",\n \"flag-lt\": \"1F1F1-1F1F9\",\n \"flag-lu\": \"1F1F1-1F1FA\",\n \"flag-lv\": \"1F1F1-1F1FB\",\n \"flag-ly\": \"1F1F1-1F1FE\",\n \"flag-ma\": \"1F1F2-1F1E6\",\n \"flag-mc\": \"1F1F2-1F1E8\",\n \"flag-md\": \"1F1F2-1F1E9\",\n \"flag-me\": \"1F1F2-1F1EA\",\n \"flag-mf\": \"1F1F2-1F1EB\",\n \"flag-mg\": \"1F1F2-1F1EC\",\n \"flag-mh\": \"1F1F2-1F1ED\",\n \"flag-mk\": \"1F1F2-1F1F0\",\n \"flag-ml\": \"1F1F2-1F1F1\",\n \"flag-mm\": \"1F1F2-1F1F2\",\n \"flag-mn\": \"1F1F2-1F1F3\",\n \"flag-mo\": \"1F1F2-1F1F4\",\n \"flag-mp\": \"1F1F2-1F1F5\",\n \"flag-mq\": \"1F1F2-1F1F6\",\n \"flag-mr\": \"1F1F2-1F1F7\",\n \"flag-ms\": \"1F1F2-1F1F8\",\n \"flag-mt\": \"1F1F2-1F1F9\",\n \"flag-mu\": \"1F1F2-1F1FA\",\n \"flag-mv\": \"1F1F2-1F1FB\",\n \"flag-mw\": \"1F1F2-1F1FC\",\n \"flag-mx\": \"1F1F2-1F1FD\",\n \"flag-my\": \"1F1F2-1F1FE\",\n \"flag-mz\": \"1F1F2-1F1FF\",\n \"flag-na\": \"1F1F3-1F1E6\",\n \"flag-nc\": \"1F1F3-1F1E8\",\n \"flag-ne\": \"1F1F3-1F1EA\",\n \"flag-nf\": \"1F1F3-1F1EB\",\n \"flag-ng\": \"1F1F3-1F1EC\",\n \"flag-ni\": \"1F1F3-1F1EE\",\n \"flag-nl\": \"1F1F3-1F1F1\",\n \"flag-no\": \"1F1F3-1F1F4\",\n \"flag-np\": \"1F1F3-1F1F5\",\n \"flag-nr\": \"1F1F3-1F1F7\",\n \"flag-nu\": \"1F1F3-1F1FA\",\n \"flag-nz\": \"1F1F3-1F1FF\",\n \"flag-om\": \"1F1F4-1F1F2\",\n \"flag-pa\": \"1F1F5-1F1E6\",\n \"flag-pe\": \"1F1F5-1F1EA\",\n \"flag-pf\": \"1F1F5-1F1EB\",\n \"flag-pg\": \"1F1F5-1F1EC\",\n \"flag-ph\": \"1F1F5-1F1ED\",\n \"flag-pk\": \"1F1F5-1F1F0\",\n \"flag-pl\": \"1F1F5-1F1F1\",\n \"flag-pm\": \"1F1F5-1F1F2\",\n \"flag-pn\": \"1F1F5-1F1F3\",\n \"flag-pr\": \"1F1F5-1F1F7\",\n \"flag-ps\": \"1F1F5-1F1F8\",\n \"flag-pt\": \"1F1F5-1F1F9\",\n \"flag-pw\": \"1F1F5-1F1FC\",\n \"flag-py\": \"1F1F5-1F1FE\",\n \"flag-qa\": \"1F1F6-1F1E6\",\n \"flag-re\": \"1F1F7-1F1EA\",\n \"flag-ro\": \"1F1F7-1F1F4\",\n \"flag-rs\": \"1F1F7-1F1F8\",\n \"ru\": \"1F1F7-1F1FA\",\n \"flag-rw\": \"1F1F7-1F1FC\",\n \"flag-sa\": \"1F1F8-1F1E6\",\n \"flag-sb\": \"1F1F8-1F1E7\",\n \"flag-sc\": \"1F1F8-1F1E8\",\n \"flag-sd\": \"1F1F8-1F1E9\",\n \"flag-se\": \"1F1F8-1F1EA\",\n \"flag-sg\": \"1F1F8-1F1EC\",\n \"flag-sh\": \"1F1F8-1F1ED\",\n \"flag-si\": \"1F1F8-1F1EE\",\n \"flag-sj\": \"1F1F8-1F1EF\",\n \"flag-sk\": \"1F1F8-1F1F0\",\n \"flag-sl\": \"1F1F8-1F1F1\",\n \"flag-sm\": \"1F1F8-1F1F2\",\n \"flag-sn\": \"1F1F8-1F1F3\",\n \"flag-so\": \"1F1F8-1F1F4\",\n \"flag-sr\": \"1F1F8-1F1F7\",\n \"flag-ss\": \"1F1F8-1F1F8\",\n \"flag-st\": \"1F1F8-1F1F9\",\n \"flag-sv\": \"1F1F8-1F1FB\",\n \"flag-sx\": \"1F1F8-1F1FD\",\n \"flag-sy\": \"1F1F8-1F1FE\",\n \"flag-sz\": \"1F1F8-1F1FF\",\n \"flag-ta\": \"1F1F9-1F1E6\",\n \"flag-tc\": \"1F1F9-1F1E8\",\n \"flag-td\": \"1F1F9-1F1E9\",\n \"flag-tf\": \"1F1F9-1F1EB\",\n \"flag-tg\": \"1F1F9-1F1EC\",\n \"flag-th\": \"1F1F9-1F1ED\",\n \"flag-tj\": \"1F1F9-1F1EF\",\n \"flag-tk\": \"1F1F9-1F1F0\",\n \"flag-tl\": \"1F1F9-1F1F1\",\n \"flag-tm\": \"1F1F9-1F1F2\",\n \"flag-tn\": \"1F1F9-1F1F3\",\n \"flag-to\": \"1F1F9-1F1F4\",\n \"flag-tr\": \"1F1F9-1F1F7\",\n \"flag-tt\": \"1F1F9-1F1F9\",\n \"flag-tv\": \"1F1F9-1F1FB\",\n \"flag-tw\": \"1F1F9-1F1FC\",\n \"flag-tz\": \"1F1F9-1F1FF\",\n \"flag-ua\": \"1F1FA-1F1E6\",\n \"flag-ug\": \"1F1FA-1F1EC\",\n \"flag-um\": \"1F1FA-1F1F2\",\n \"flag-un\": \"1F1FA-1F1F3\",\n \"us\": \"1F1FA-1F1F8\",\n \"flag-uy\": \"1F1FA-1F1FE\",\n \"flag-uz\": \"1F1FA-1F1FF\",\n \"flag-va\": \"1F1FB-1F1E6\",\n \"flag-vc\": \"1F1FB-1F1E8\",\n \"flag-ve\": \"1F1FB-1F1EA\",\n \"flag-vg\": \"1F1FB-1F1EC\",\n \"flag-vi\": \"1F1FB-1F1EE\",\n \"flag-vn\": \"1F1FB-1F1F3\",\n \"flag-vu\": \"1F1FB-1F1FA\",\n \"flag-wf\": \"1F1FC-1F1EB\",\n \"flag-ws\": \"1F1FC-1F1F8\",\n \"flag-xk\": \"1F1FD-1F1F0\",\n \"flag-ye\": \"1F1FE-1F1EA\",\n \"flag-yt\": \"1F1FE-1F1F9\",\n \"flag-za\": \"1F1FF-1F1E6\",\n \"flag-zm\": \"1F1FF-1F1F2\",\n \"flag-zw\": \"1F1FF-1F1FC\",\n \"koko\": \"1F201\",\n \"sa\": \"1F202-FE0F\",\n \"u7121\": \"1F21A\",\n \"u6307\": \"1F22F\",\n \"u7981\": \"1F232\",\n \"u7a7a\": \"1F233\",\n \"u5408\": \"1F234\",\n \"u6e80\": \"1F235\",\n \"u6709\": \"1F236\",\n \"u6708\": \"1F237-FE0F\",\n \"u7533\": \"1F238\",\n \"u5272\": \"1F239\",\n \"u55b6\": \"1F23A\",\n \"ideograph_advantage\": \"1F250\",\n \"accept\": \"1F251\",\n \"cyclone\": \"1F300\",\n \"foggy\": \"1F301\",\n \"closed_umbrella\": \"1F302\",\n \"night_with_stars\": \"1F303\",\n \"sunrise_over_mountains\": \"1F304\",\n \"sunrise\": \"1F305\",\n \"city_sunset\": \"1F306\",\n \"city_sunrise\": \"1F307\",\n \"rainbow\": \"1F308\",\n \"bridge_at_night\": \"1F309\",\n \"ocean\": \"1F30A\",\n \"volcano\": \"1F30B\",\n \"milky_way\": \"1F30C\",\n \"earth_africa\": \"1F30D\",\n \"earth_americas\": \"1F30E\",\n \"earth_asia\": \"1F30F\",\n \"globe_with_meridians\": \"1F310\",\n \"new_moon\": \"1F311\",\n \"waxing_crescent_moon\": \"1F312\",\n \"first_quarter_moon\": \"1F313\",\n \"moon\": \"1F314\",\n \"full_moon\": \"1F315\",\n \"waning_gibbous_moon\": \"1F316\",\n \"last_quarter_moon\": \"1F317\",\n \"waning_crescent_moon\": \"1F318\",\n \"crescent_moon\": \"1F319\",\n \"new_moon_with_face\": \"1F31A\",\n \"first_quarter_moon_with_face\": \"1F31B\",\n \"last_quarter_moon_with_face\": \"1F31C\",\n \"full_moon_with_face\": \"1F31D\",\n \"sun_with_face\": \"1F31E\",\n \"star2\": \"1F31F\",\n \"stars\": \"1F320\",\n \"thermometer\": \"1F321-FE0F\",\n \"mostly_sunny\": \"1F324-FE0F\",\n \"barely_sunny\": \"1F325-FE0F\",\n \"partly_sunny_rain\": \"1F326-FE0F\",\n \"rain_cloud\": \"1F327-FE0F\",\n \"snow_cloud\": \"1F328-FE0F\",\n \"lightning\": \"1F329-FE0F\",\n \"tornado\": \"1F32A-FE0F\",\n \"fog\": \"1F32B-FE0F\",\n \"wind_blowing_face\": \"1F32C-FE0F\",\n \"hotdog\": \"1F32D\",\n \"taco\": \"1F32E\",\n \"burrito\": \"1F32F\",\n \"chestnut\": \"1F330\",\n \"seedling\": \"1F331\",\n \"evergreen_tree\": \"1F332\",\n \"deciduous_tree\": \"1F333\",\n \"palm_tree\": \"1F334\",\n \"cactus\": \"1F335\",\n \"hot_pepper\": \"1F336-FE0F\",\n \"tulip\": \"1F337\",\n \"cherry_blossom\": \"1F338\",\n \"rose\": \"1F339\",\n \"hibiscus\": \"1F33A\",\n \"sunflower\": \"1F33B\",\n \"blossom\": \"1F33C\",\n \"corn\": \"1F33D\",\n \"ear_of_rice\": \"1F33E\",\n \"herb\": \"1F33F\",\n \"four_leaf_clover\": \"1F340\",\n \"maple_leaf\": \"1F341\",\n \"fallen_leaf\": \"1F342\",\n \"leaves\": \"1F343\",\n \"mushroom\": \"1F344\",\n \"tomato\": \"1F345\",\n \"eggplant\": \"1F346\",\n \"grapes\": \"1F347\",\n \"melon\": \"1F348\",\n \"watermelon\": \"1F349\",\n \"tangerine\": \"1F34A\",\n \"lemon\": \"1F34B\",\n \"banana\": \"1F34C\",\n \"pineapple\": \"1F34D\",\n \"apple\": \"1F34E\",\n \"green_apple\": \"1F34F\",\n \"pear\": \"1F350\",\n \"peach\": \"1F351\",\n \"cherries\": \"1F352\",\n \"strawberry\": \"1F353\",\n \"hamburger\": \"1F354\",\n \"pizza\": \"1F355\",\n \"meat_on_bone\": \"1F356\",\n \"poultry_leg\": \"1F357\",\n \"rice_cracker\": \"1F358\",\n \"rice_ball\": \"1F359\",\n \"rice\": \"1F35A\",\n \"curry\": \"1F35B\",\n \"ramen\": \"1F35C\",\n \"spaghetti\": \"1F35D\",\n \"bread\": \"1F35E\",\n \"fries\": \"1F35F\",\n \"sweet_potato\": \"1F360\",\n \"dango\": \"1F361\",\n \"oden\": \"1F362\",\n \"sushi\": \"1F363\",\n \"fried_shrimp\": \"1F364\",\n \"fish_cake\": \"1F365\",\n \"icecream\": \"1F366\",\n \"shaved_ice\": \"1F367\",\n \"ice_cream\": \"1F368\",\n \"doughnut\": \"1F369\",\n \"cookie\": \"1F36A\",\n \"chocolate_bar\": \"1F36B\",\n \"candy\": \"1F36C\",\n \"lollipop\": \"1F36D\",\n \"custard\": \"1F36E\",\n \"honey_pot\": \"1F36F\",\n \"cake\": \"1F370\",\n \"bento\": \"1F371\",\n \"stew\": \"1F372\",\n \"fried_egg\": \"1F373\",\n \"fork_and_knife\": \"1F374\",\n \"tea\": \"1F375\",\n \"sake\": \"1F376\",\n \"wine_glass\": \"1F377\",\n \"cocktail\": \"1F378\",\n \"tropical_drink\": \"1F379\",\n \"beer\": \"1F37A\",\n \"beers\": \"1F37B\",\n \"baby_bottle\": \"1F37C\",\n \"knife_fork_plate\": \"1F37D-FE0F\",\n \"champagne\": \"1F37E\",\n \"popcorn\": \"1F37F\",\n \"ribbon\": \"1F380\",\n \"gift\": \"1F381\",\n \"birthday\": \"1F382\",\n \"jack_o_lantern\": \"1F383\",\n \"christmas_tree\": \"1F384\",\n \"santa\": \"1F385\",\n \"fireworks\": \"1F386\",\n \"sparkler\": \"1F387\",\n \"balloon\": \"1F388\",\n \"tada\": \"1F389\",\n \"confetti_ball\": \"1F38A\",\n \"tanabata_tree\": \"1F38B\",\n \"crossed_flags\": \"1F38C\",\n \"bamboo\": \"1F38D\",\n \"dolls\": \"1F38E\",\n \"flags\": \"1F38F\",\n \"wind_chime\": \"1F390\",\n \"rice_scene\": \"1F391\",\n \"school_satchel\": \"1F392\",\n \"mortar_board\": \"1F393\",\n \"medal\": \"1F396-FE0F\",\n \"reminder_ribbon\": \"1F397-FE0F\",\n \"studio_microphone\": \"1F399-FE0F\",\n \"level_slider\": \"1F39A-FE0F\",\n \"control_knobs\": \"1F39B-FE0F\",\n \"film_frames\": \"1F39E-FE0F\",\n \"admission_tickets\": \"1F39F-FE0F\",\n \"carousel_horse\": \"1F3A0\",\n \"ferris_wheel\": \"1F3A1\",\n \"roller_coaster\": \"1F3A2\",\n \"fishing_pole_and_fish\": \"1F3A3\",\n \"microphone\": \"1F3A4\",\n \"movie_camera\": \"1F3A5\",\n \"cinema\": \"1F3A6\",\n \"headphones\": \"1F3A7\",\n \"art\": \"1F3A8\",\n \"tophat\": \"1F3A9\",\n \"circus_tent\": \"1F3AA\",\n \"ticket\": \"1F3AB\",\n \"clapper\": \"1F3AC\",\n \"performing_arts\": \"1F3AD\",\n \"video_game\": \"1F3AE\",\n \"dart\": \"1F3AF\",\n \"slot_machine\": \"1F3B0\",\n \"8ball\": \"1F3B1\",\n \"game_die\": \"1F3B2\",\n \"bowling\": \"1F3B3\",\n \"flower_playing_cards\": \"1F3B4\",\n \"musical_note\": \"1F3B5\",\n \"notes\": \"1F3B6\",\n \"saxophone\": \"1F3B7\",\n \"guitar\": \"1F3B8\",\n \"musical_keyboard\": \"1F3B9\",\n \"trumpet\": \"1F3BA\",\n \"violin\": \"1F3BB\",\n \"musical_score\": \"1F3BC\",\n \"running_shirt_with_sash\": \"1F3BD\",\n \"tennis\": \"1F3BE\",\n \"ski\": \"1F3BF\",\n \"basketball\": \"1F3C0\",\n \"checkered_flag\": \"1F3C1\",\n \"snowboarder\": \"1F3C2\",\n \"woman-running\": \"1F3C3-200D-2640-FE0F\",\n \"man-running\": \"1F3C3-200D-2642-FE0F\",\n \"runner\": \"1F3C3-200D-2642-FE0F\",\n \"woman-surfing\": \"1F3C4-200D-2640-FE0F\",\n \"man-surfing\": \"1F3C4-200D-2642-FE0F\",\n \"surfer\": \"1F3C4-200D-2642-FE0F\",\n \"sports_medal\": \"1F3C5\",\n \"trophy\": \"1F3C6\",\n \"horse_racing\": \"1F3C7\",\n \"football\": \"1F3C8\",\n \"rugby_football\": \"1F3C9\",\n \"woman-swimming\": \"1F3CA-200D-2640-FE0F\",\n \"man-swimming\": \"1F3CA-200D-2642-FE0F\",\n \"swimmer\": \"1F3CA-200D-2642-FE0F\",\n \"woman-lifting-weights\": \"1F3CB-FE0F-200D-2640-FE0F\",\n \"man-lifting-weights\": \"1F3CB-FE0F-200D-2642-FE0F\",\n \"weight_lifter\": \"1F3CB-FE0F-200D-2642-FE0F\",\n \"woman-golfing\": \"1F3CC-FE0F-200D-2640-FE0F\",\n \"man-golfing\": \"1F3CC-FE0F-200D-2642-FE0F\",\n \"golfer\": \"1F3CC-FE0F-200D-2642-FE0F\",\n \"racing_motorcycle\": \"1F3CD-FE0F\",\n \"racing_car\": \"1F3CE-FE0F\",\n \"cricket_bat_and_ball\": \"1F3CF\",\n \"volleyball\": \"1F3D0\",\n \"field_hockey_stick_and_ball\": \"1F3D1\",\n \"ice_hockey_stick_and_puck\": \"1F3D2\",\n \"table_tennis_paddle_and_ball\": \"1F3D3\",\n \"snow_capped_mountain\": \"1F3D4-FE0F\",\n \"camping\": \"1F3D5-FE0F\",\n \"beach_with_umbrella\": \"1F3D6-FE0F\",\n \"building_construction\": \"1F3D7-FE0F\",\n \"house_buildings\": \"1F3D8-FE0F\",\n \"cityscape\": \"1F3D9-FE0F\",\n \"derelict_house_building\": \"1F3DA-FE0F\",\n \"classical_building\": \"1F3DB-FE0F\",\n \"desert\": \"1F3DC-FE0F\",\n \"desert_island\": \"1F3DD-FE0F\",\n \"national_park\": \"1F3DE-FE0F\",\n \"stadium\": \"1F3DF-FE0F\",\n \"house\": \"1F3E0\",\n \"house_with_garden\": \"1F3E1\",\n \"office\": \"1F3E2\",\n \"post_office\": \"1F3E3\",\n \"european_post_office\": \"1F3E4\",\n \"hospital\": \"1F3E5\",\n \"bank\": \"1F3E6\",\n \"atm\": \"1F3E7\",\n \"hotel\": \"1F3E8\",\n \"love_hotel\": \"1F3E9\",\n \"convenience_store\": \"1F3EA\",\n \"school\": \"1F3EB\",\n \"department_store\": \"1F3EC\",\n \"factory\": \"1F3ED\",\n \"izakaya_lantern\": \"1F3EE\",\n \"japanese_castle\": \"1F3EF\",\n \"european_castle\": \"1F3F0\",\n \"rainbow-flag\": \"1F3F3-FE0F-200D-1F308\",\n \"transgender_flag\": \"1F3F3-FE0F-200D-26A7-FE0F\",\n \"waving_white_flag\": \"1F3F3-FE0F\",\n \"pirate_flag\": \"1F3F4-200D-2620-FE0F\",\n \"flag-england\": \"1F3F4-E0067-E0062-E0065-E006E-E0067-E007F\",\n \"flag-scotland\": \"1F3F4-E0067-E0062-E0073-E0063-E0074-E007F\",\n \"flag-wales\": \"1F3F4-E0067-E0062-E0077-E006C-E0073-E007F\",\n \"waving_black_flag\": \"1F3F4\",\n \"rosette\": \"1F3F5-FE0F\",\n \"label\": \"1F3F7-FE0F\",\n \"badminton_racquet_and_shuttlecock\": \"1F3F8\",\n \"bow_and_arrow\": \"1F3F9\",\n \"amphora\": \"1F3FA\",\n \"skin-tone-2\": \"1F3FB\",\n \"skin-tone-3\": \"1F3FC\",\n \"skin-tone-4\": \"1F3FD\",\n \"skin-tone-5\": \"1F3FE\",\n \"skin-tone-6\": \"1F3FF\",\n \"rat\": \"1F400\",\n \"mouse2\": \"1F401\",\n \"ox\": \"1F402\",\n \"water_buffalo\": \"1F403\",\n \"cow2\": \"1F404\",\n \"tiger2\": \"1F405\",\n \"leopard\": \"1F406\",\n \"rabbit2\": \"1F407\",\n \"black_cat\": \"1F408-200D-2B1B\",\n \"cat2\": \"1F408\",\n \"dragon\": \"1F409\",\n \"crocodile\": \"1F40A\",\n \"whale2\": \"1F40B\",\n \"snail\": \"1F40C\",\n \"snake\": \"1F40D\",\n \"racehorse\": \"1F40E\",\n \"ram\": \"1F40F\",\n \"goat\": \"1F410\",\n \"sheep\": \"1F411\",\n \"monkey\": \"1F412\",\n \"rooster\": \"1F413\",\n \"chicken\": \"1F414\",\n \"service_dog\": \"1F415-200D-1F9BA\",\n \"dog2\": \"1F415\",\n \"pig2\": \"1F416\",\n \"boar\": \"1F417\",\n \"elephant\": \"1F418\",\n \"octopus\": \"1F419\",\n \"shell\": \"1F41A\",\n \"bug\": \"1F41B\",\n \"ant\": \"1F41C\",\n \"bee\": \"1F41D\",\n \"beetle\": \"1FAB2\",\n \"fish\": \"1F41F\",\n \"tropical_fish\": \"1F420\",\n \"blowfish\": \"1F421\",\n \"turtle\": \"1F422\",\n \"hatching_chick\": \"1F423\",\n \"baby_chick\": \"1F424\",\n \"hatched_chick\": \"1F425\",\n \"bird\": \"1F426\",\n \"penguin\": \"1F427\",\n \"koala\": \"1F428\",\n \"poodle\": \"1F429\",\n \"dromedary_camel\": \"1F42A\",\n \"camel\": \"1F42B\",\n \"dolphin\": \"1F42C\",\n \"mouse\": \"1F42D\",\n \"cow\": \"1F42E\",\n \"tiger\": \"1F42F\",\n \"rabbit\": \"1F430\",\n \"cat\": \"1F431\",\n \"dragon_face\": \"1F432\",\n \"whale\": \"1F433\",\n \"horse\": \"1F434\",\n \"monkey_face\": \"1F435\",\n \"dog\": \"1F436\",\n \"pig\": \"1F437\",\n \"frog\": \"1F438\",\n \"hamster\": \"1F439\",\n \"wolf\": \"1F43A\",\n \"polar_bear\": \"1F43B-200D-2744-FE0F\",\n \"bear\": \"1F43B\",\n \"panda_face\": \"1F43C\",\n \"pig_nose\": \"1F43D\",\n \"feet\": \"1F43E\",\n \"chipmunk\": \"1F43F-FE0F\",\n \"eyes\": \"1F440\",\n \"eye-in-speech-bubble\": \"1F441-FE0F-200D-1F5E8-FE0F\",\n \"eye\": \"1F441-FE0F\",\n \"ear\": \"1F442\",\n \"nose\": \"1F443\",\n \"lips\": \"1F444\",\n \"tongue\": \"1F445\",\n \"point_up_2\": \"1F446\",\n \"point_down\": \"1F447\",\n \"point_left\": \"1F448\",\n \"point_right\": \"1F449\",\n \"facepunch\": \"1F44A\",\n \"wave\": \"1F44B\",\n \"ok_hand\": \"1F44C\",\n \"+1\": \"1F44D\",\n \"-1\": \"1F44E\",\n \"clap\": \"1F44F\",\n \"open_hands\": \"1F450\",\n \"crown\": \"1F451\",\n \"womans_hat\": \"1F452\",\n \"eyeglasses\": \"1F453\",\n \"necktie\": \"1F454\",\n \"shirt\": \"1F455\",\n \"jeans\": \"1F456\",\n \"dress\": \"1F457\",\n \"kimono\": \"1F458\",\n \"bikini\": \"1F459\",\n \"womans_clothes\": \"1F45A\",\n \"purse\": \"1F45B\",\n \"handbag\": \"1F45C\",\n \"pouch\": \"1F45D\",\n \"mans_shoe\": \"1F45E\",\n \"athletic_shoe\": \"1F45F\",\n \"high_heel\": \"1F460\",\n \"sandal\": \"1F461\",\n \"boot\": \"1F462\",\n \"footprints\": \"1F463\",\n \"bust_in_silhouette\": \"1F464\",\n \"busts_in_silhouette\": \"1F465\",\n \"boy\": \"1F466\",\n \"girl\": \"1F467\",\n \"male-farmer\": \"1F468-200D-1F33E\",\n \"male-cook\": \"1F468-200D-1F373\",\n \"man_feeding_baby\": \"1F468-200D-1F37C\",\n \"male-student\": \"1F468-200D-1F393\",\n \"male-singer\": \"1F468-200D-1F3A4\",\n \"male-artist\": \"1F468-200D-1F3A8\",\n \"male-teacher\": \"1F468-200D-1F3EB\",\n \"male-factory-worker\": \"1F468-200D-1F3ED\",\n \"man-boy-boy\": \"1F468-200D-1F466-200D-1F466\",\n \"man-boy\": \"1F468-200D-1F466\",\n \"man-girl-boy\": \"1F468-200D-1F467-200D-1F466\",\n \"man-girl-girl\": \"1F468-200D-1F467-200D-1F467\",\n \"man-girl\": \"1F468-200D-1F467\",\n \"man-man-boy\": \"1F468-200D-1F468-200D-1F466\",\n \"man-man-boy-boy\": \"1F468-200D-1F468-200D-1F466-200D-1F466\",\n \"man-man-girl\": \"1F468-200D-1F468-200D-1F467\",\n \"man-man-girl-boy\": \"1F468-200D-1F468-200D-1F467-200D-1F466\",\n \"man-man-girl-girl\": \"1F468-200D-1F468-200D-1F467-200D-1F467\",\n \"man-woman-boy\": \"1F468-200D-1F469-200D-1F466\",\n \"man-woman-boy-boy\": \"1F468-200D-1F469-200D-1F466-200D-1F466\",\n \"man-woman-girl\": \"1F468-200D-1F469-200D-1F467\",\n \"man-woman-girl-boy\": \"1F468-200D-1F469-200D-1F467-200D-1F466\",\n \"man-woman-girl-girl\": \"1F468-200D-1F469-200D-1F467-200D-1F467\",\n \"male-technologist\": \"1F468-200D-1F4BB\",\n \"male-office-worker\": \"1F468-200D-1F4BC\",\n \"male-mechanic\": \"1F468-200D-1F527\",\n \"male-scientist\": \"1F468-200D-1F52C\",\n \"male-astronaut\": \"1F468-200D-1F680\",\n \"male-firefighter\": \"1F468-200D-1F692\",\n \"man_with_probing_cane\": \"1F468-200D-1F9AF\",\n \"red_haired_man\": \"1F468-200D-1F9B0\",\n \"curly_haired_man\": \"1F468-200D-1F9B1\",\n \"bald_man\": \"1F468-200D-1F9B2\",\n \"white_haired_man\": \"1F468-200D-1F9B3\",\n \"man_in_motorized_wheelchair\": \"1F468-200D-1F9BC\",\n \"man_in_manual_wheelchair\": \"1F468-200D-1F9BD\",\n \"male-doctor\": \"1F468-200D-2695-FE0F\",\n \"male-judge\": \"1F468-200D-2696-FE0F\",\n \"male-pilot\": \"1F468-200D-2708-FE0F\",\n \"man-heart-man\": \"1F468-200D-2764-FE0F-200D-1F468\",\n \"man-kiss-man\": \"1F468-200D-2764-FE0F-200D-1F48B-200D-1F468\",\n \"man\": \"1F468\",\n \"female-farmer\": \"1F469-200D-1F33E\",\n \"female-cook\": \"1F469-200D-1F373\",\n \"woman_feeding_baby\": \"1F469-200D-1F37C\",\n \"female-student\": \"1F469-200D-1F393\",\n \"female-singer\": \"1F469-200D-1F3A4\",\n \"female-artist\": \"1F469-200D-1F3A8\",\n \"female-teacher\": \"1F469-200D-1F3EB\",\n \"female-factory-worker\": \"1F469-200D-1F3ED\",\n \"woman-boy-boy\": \"1F469-200D-1F466-200D-1F466\",\n \"woman-boy\": \"1F469-200D-1F466\",\n \"woman-girl-boy\": \"1F469-200D-1F467-200D-1F466\",\n \"woman-girl-girl\": \"1F469-200D-1F467-200D-1F467\",\n \"woman-girl\": \"1F469-200D-1F467\",\n \"woman-woman-boy\": \"1F469-200D-1F469-200D-1F466\",\n \"woman-woman-boy-boy\": \"1F469-200D-1F469-200D-1F466-200D-1F466\",\n \"woman-woman-girl\": \"1F469-200D-1F469-200D-1F467\",\n \"woman-woman-girl-boy\": \"1F469-200D-1F469-200D-1F467-200D-1F466\",\n \"woman-woman-girl-girl\": \"1F469-200D-1F469-200D-1F467-200D-1F467\",\n \"female-technologist\": \"1F469-200D-1F4BB\",\n \"female-office-worker\": \"1F469-200D-1F4BC\",\n \"female-mechanic\": \"1F469-200D-1F527\",\n \"female-scientist\": \"1F469-200D-1F52C\",\n \"female-astronaut\": \"1F469-200D-1F680\",\n \"female-firefighter\": \"1F469-200D-1F692\",\n \"woman_with_probing_cane\": \"1F469-200D-1F9AF\",\n \"red_haired_woman\": \"1F469-200D-1F9B0\",\n \"curly_haired_woman\": \"1F469-200D-1F9B1\",\n \"bald_woman\": \"1F469-200D-1F9B2\",\n \"white_haired_woman\": \"1F469-200D-1F9B3\",\n \"woman_in_motorized_wheelchair\": \"1F469-200D-1F9BC\",\n \"woman_in_manual_wheelchair\": \"1F469-200D-1F9BD\",\n \"female-doctor\": \"1F469-200D-2695-FE0F\",\n \"female-judge\": \"1F469-200D-2696-FE0F\",\n \"female-pilot\": \"1F469-200D-2708-FE0F\",\n \"woman-heart-man\": \"1F469-200D-2764-FE0F-200D-1F468\",\n \"woman-heart-woman\": \"1F469-200D-2764-FE0F-200D-1F469\",\n \"woman-kiss-man\": \"1F469-200D-2764-FE0F-200D-1F48B-200D-1F468\",\n \"woman-kiss-woman\": \"1F469-200D-2764-FE0F-200D-1F48B-200D-1F469\",\n \"woman\": \"1F469\",\n \"family\": \"1F468-200D-1F469-200D-1F466\",\n \"couple\": \"1F46B\",\n \"two_men_holding_hands\": \"1F46C\",\n \"two_women_holding_hands\": \"1F46D\",\n \"female-police-officer\": \"1F46E-200D-2640-FE0F\",\n \"male-police-officer\": \"1F46E-200D-2642-FE0F\",\n \"cop\": \"1F46E-200D-2642-FE0F\",\n \"woman-with-bunny-ears-partying\": \"1F46F-200D-2640-FE0F\",\n \"man-with-bunny-ears-partying\": \"1F46F-200D-2642-FE0F\",\n \"dancers\": \"1F46F-200D-2640-FE0F\",\n \"woman_with_veil\": \"1F470-200D-2640-FE0F\",\n \"man_with_veil\": \"1F470-200D-2642-FE0F\",\n \"bride_with_veil\": \"1F470\",\n \"blond-haired-woman\": \"1F471-200D-2640-FE0F\",\n \"blond-haired-man\": \"1F471-200D-2642-FE0F\",\n \"person_with_blond_hair\": \"1F471-200D-2642-FE0F\",\n \"man_with_gua_pi_mao\": \"1F472\",\n \"woman-wearing-turban\": \"1F473-200D-2640-FE0F\",\n \"man-wearing-turban\": \"1F473-200D-2642-FE0F\",\n \"man_with_turban\": \"1F473-200D-2642-FE0F\",\n \"older_man\": \"1F474\",\n \"older_woman\": \"1F475\",\n \"baby\": \"1F476\",\n \"female-construction-worker\": \"1F477-200D-2640-FE0F\",\n \"male-construction-worker\": \"1F477-200D-2642-FE0F\",\n \"construction_worker\": \"1F477-200D-2642-FE0F\",\n \"princess\": \"1F478\",\n \"japanese_ogre\": \"1F479\",\n \"japanese_goblin\": \"1F47A\",\n \"ghost\": \"1F47B\",\n \"angel\": \"1F47C\",\n \"alien\": \"1F47D\",\n \"space_invader\": \"1F47E\",\n \"imp\": \"1F47F\",\n \"skull\": \"1F480\",\n \"woman-tipping-hand\": \"1F481-200D-2640-FE0F\",\n \"man-tipping-hand\": \"1F481-200D-2642-FE0F\",\n \"information_desk_person\": \"1F481-200D-2640-FE0F\",\n \"female-guard\": \"1F482-200D-2640-FE0F\",\n \"male-guard\": \"1F482-200D-2642-FE0F\",\n \"guardsman\": \"1F482-200D-2642-FE0F\",\n \"dancer\": \"1F483\",\n \"lipstick\": \"1F484\",\n \"nail_care\": \"1F485\",\n \"woman-getting-massage\": \"1F486-200D-2640-FE0F\",\n \"man-getting-massage\": \"1F486-200D-2642-FE0F\",\n \"massage\": \"1F486-200D-2640-FE0F\",\n \"woman-getting-haircut\": \"1F487-200D-2640-FE0F\",\n \"man-getting-haircut\": \"1F487-200D-2642-FE0F\",\n \"haircut\": \"1F487-200D-2640-FE0F\",\n \"barber\": \"1F488\",\n \"syringe\": \"1F489\",\n \"pill\": \"1F48A\",\n \"kiss\": \"1F48B\",\n \"love_letter\": \"1F48C\",\n \"ring\": \"1F48D\",\n \"gem\": \"1F48E\",\n \"couplekiss\": \"1F469-200D-2764-FE0F-200D-1F48B-200D-1F468\",\n \"bouquet\": \"1F490\",\n \"couple_with_heart\": \"1F469-200D-2764-FE0F-200D-1F468\",\n \"wedding\": \"1F492\",\n \"heartbeat\": \"1F493\",\n \"broken_heart\": \"1F494\",\n \"two_hearts\": \"1F495\",\n \"sparkling_heart\": \"1F496\",\n \"heartpulse\": \"1F497\",\n \"cupid\": \"1F498\",\n \"blue_heart\": \"1F499\",\n \"green_heart\": \"1F49A\",\n \"yellow_heart\": \"1F49B\",\n \"purple_heart\": \"1F49C\",\n \"gift_heart\": \"1F49D\",\n \"revolving_hearts\": \"1F49E\",\n \"heart_decoration\": \"1F49F\",\n \"diamond_shape_with_a_dot_inside\": \"1F4A0\",\n \"bulb\": \"1F4A1\",\n \"anger\": \"1F4A2\",\n \"bomb\": \"1F4A3\",\n \"zzz\": \"1F4A4\",\n \"boom\": \"1F4A5\",\n \"sweat_drops\": \"1F4A6\",\n \"droplet\": \"1F4A7\",\n \"dash\": \"1F4A8\",\n \"hankey\": \"1F4A9\",\n \"muscle\": \"1F4AA\",\n \"dizzy\": \"1F4AB\",\n \"speech_balloon\": \"1F4AC\",\n \"thought_balloon\": \"1F4AD\",\n \"white_flower\": \"1F4AE\",\n \"100\": \"1F4AF\",\n \"moneybag\": \"1F4B0\",\n \"currency_exchange\": \"1F4B1\",\n \"heavy_dollar_sign\": \"1F4B2\",\n \"credit_card\": \"1F4B3\",\n \"yen\": \"1F4B4\",\n \"dollar\": \"1F4B5\",\n \"euro\": \"1F4B6\",\n \"pound\": \"1F4B7\",\n \"money_with_wings\": \"1F4B8\",\n \"chart\": \"1F4B9\",\n \"seat\": \"1F4BA\",\n \"computer\": \"1F4BB\",\n \"briefcase\": \"1F4BC\",\n \"minidisc\": \"1F4BD\",\n \"floppy_disk\": \"1F4BE\",\n \"cd\": \"1F4BF\",\n \"dvd\": \"1F4C0\",\n \"file_folder\": \"1F4C1\",\n \"open_file_folder\": \"1F4C2\",\n \"page_with_curl\": \"1F4C3\",\n \"page_facing_up\": \"1F4C4\",\n \"date\": \"1F4C5\",\n \"calendar\": \"1F4C6\",\n \"card_index\": \"1F4C7\",\n \"chart_with_upwards_trend\": \"1F4C8\",\n \"chart_with_downwards_trend\": \"1F4C9\",\n \"bar_chart\": \"1F4CA\",\n \"clipboard\": \"1F4CB\",\n \"pushpin\": \"1F4CC\",\n \"round_pushpin\": \"1F4CD\",\n \"paperclip\": \"1F4CE\",\n \"straight_ruler\": \"1F4CF\",\n \"triangular_ruler\": \"1F4D0\",\n \"bookmark_tabs\": \"1F4D1\",\n \"ledger\": \"1F4D2\",\n \"notebook\": \"1F4D3\",\n \"notebook_with_decorative_cover\": \"1F4D4\",\n \"closed_book\": \"1F4D5\",\n \"book\": \"1F4D6\",\n \"green_book\": \"1F4D7\",\n \"blue_book\": \"1F4D8\",\n \"orange_book\": \"1F4D9\",\n \"books\": \"1F4DA\",\n \"name_badge\": \"1F4DB\",\n \"scroll\": \"1F4DC\",\n \"memo\": \"1F4DD\",\n \"telephone_receiver\": \"1F4DE\",\n \"pager\": \"1F4DF\",\n \"fax\": \"1F4E0\",\n \"satellite_antenna\": \"1F4E1\",\n \"loudspeaker\": \"1F4E2\",\n \"mega\": \"1F4E3\",\n \"outbox_tray\": \"1F4E4\",\n \"inbox_tray\": \"1F4E5\",\n \"package\": \"1F4E6\",\n \"e-mail\": \"1F4E7\",\n \"incoming_envelope\": \"1F4E8\",\n \"envelope_with_arrow\": \"1F4E9\",\n \"mailbox_closed\": \"1F4EA\",\n \"mailbox\": \"1F4EB\",\n \"mailbox_with_mail\": \"1F4EC\",\n \"mailbox_with_no_mail\": \"1F4ED\",\n \"postbox\": \"1F4EE\",\n \"postal_horn\": \"1F4EF\",\n \"newspaper\": \"1F4F0\",\n \"iphone\": \"1F4F1\",\n \"calling\": \"1F4F2\",\n \"vibration_mode\": \"1F4F3\",\n \"mobile_phone_off\": \"1F4F4\",\n \"no_mobile_phones\": \"1F4F5\",\n \"signal_strength\": \"1F4F6\",\n \"camera\": \"1F4F7\",\n \"camera_with_flash\": \"1F4F8\",\n \"video_camera\": \"1F4F9\",\n \"tv\": \"1F4FA\",\n \"radio\": \"1F4FB\",\n \"vhs\": \"1F4FC\",\n \"film_projector\": \"1F4FD-FE0F\",\n \"prayer_beads\": \"1F4FF\",\n \"twisted_rightwards_arrows\": \"1F500\",\n \"repeat\": \"1F501\",\n \"repeat_one\": \"1F502\",\n \"arrows_clockwise\": \"1F503\",\n \"arrows_counterclockwise\": \"1F504\",\n \"low_brightness\": \"1F505\",\n \"high_brightness\": \"1F506\",\n \"mute\": \"1F507\",\n \"speaker\": \"1F508\",\n \"sound\": \"1F509\",\n \"loud_sound\": \"1F50A\",\n \"battery\": \"1F50B\",\n \"electric_plug\": \"1F50C\",\n \"mag\": \"1F50D\",\n \"mag_right\": \"1F50E\",\n \"lock_with_ink_pen\": \"1F50F\",\n \"closed_lock_with_key\": \"1F510\",\n \"key\": \"1F511\",\n \"lock\": \"1F512\",\n \"unlock\": \"1F513\",\n \"bell\": \"1F514\",\n \"no_bell\": \"1F515\",\n \"bookmark\": \"1F516\",\n \"link\": \"1F517\",\n \"radio_button\": \"1F518\",\n \"back\": \"1F519\",\n \"end\": \"1F51A\",\n \"on\": \"1F51B\",\n \"soon\": \"1F51C\",\n \"top\": \"1F51D\",\n \"underage\": \"1F51E\",\n \"keycap_ten\": \"1F51F\",\n \"capital_abcd\": \"1F520\",\n \"abcd\": \"1F521\",\n \"1234\": \"1F522\",\n \"symbols\": \"1F523\",\n \"abc\": \"1F524\",\n \"fire\": \"1F525\",\n \"flashlight\": \"1F526\",\n \"wrench\": \"1F527\",\n \"hammer\": \"1F528\",\n \"nut_and_bolt\": \"1F529\",\n \"hocho\": \"1F52A\",\n \"gun\": \"1F52B\",\n \"microscope\": \"1F52C\",\n \"telescope\": \"1F52D\",\n \"crystal_ball\": \"1F52E\",\n \"six_pointed_star\": \"1F52F\",\n \"beginner\": \"1F530\",\n \"trident\": \"1F531\",\n \"black_square_button\": \"1F532\",\n \"white_square_button\": \"1F533\",\n \"red_circle\": \"1F534\",\n \"large_blue_circle\": \"1F535\",\n \"large_orange_diamond\": \"1F536\",\n \"large_blue_diamond\": \"1F537\",\n \"small_orange_diamond\": \"1F538\",\n \"small_blue_diamond\": \"1F539\",\n \"small_red_triangle\": \"1F53A\",\n \"small_red_triangle_down\": \"1F53B\",\n \"arrow_up_small\": \"1F53C\",\n \"arrow_down_small\": \"1F53D\",\n \"om_symbol\": \"1F549-FE0F\",\n \"dove_of_peace\": \"1F54A-FE0F\",\n \"kaaba\": \"1F54B\",\n \"mosque\": \"1F54C\",\n \"synagogue\": \"1F54D\",\n \"menorah_with_nine_branches\": \"1F54E\",\n \"clock1\": \"1F550\",\n \"clock2\": \"1F551\",\n \"clock3\": \"1F552\",\n \"clock4\": \"1F553\",\n \"clock5\": \"1F554\",\n \"clock6\": \"1F555\",\n \"clock7\": \"1F556\",\n \"clock8\": \"1F557\",\n \"clock9\": \"1F558\",\n \"clock10\": \"1F559\",\n \"clock11\": \"1F55A\",\n \"clock12\": \"1F55B\",\n \"clock130\": \"1F55C\",\n \"clock230\": \"1F55D\",\n \"clock330\": \"1F55E\",\n \"clock430\": \"1F55F\",\n \"clock530\": \"1F560\",\n \"clock630\": \"1F561\",\n \"clock730\": \"1F562\",\n \"clock830\": \"1F563\",\n \"clock930\": \"1F564\",\n \"clock1030\": \"1F565\",\n \"clock1130\": \"1F566\",\n \"clock1230\": \"1F567\",\n \"candle\": \"1F56F-FE0F\",\n \"mantelpiece_clock\": \"1F570-FE0F\",\n \"hole\": \"1F573-FE0F\",\n \"man_in_business_suit_levitating\": \"1F574-FE0F\",\n \"female-detective\": \"1F575-FE0F-200D-2640-FE0F\",\n \"male-detective\": \"1F575-FE0F-200D-2642-FE0F\",\n \"sleuth_or_spy\": \"1F575-FE0F-200D-2642-FE0F\",\n \"dark_sunglasses\": \"1F576-FE0F\",\n \"spider\": \"1F577-FE0F\",\n \"spider_web\": \"1F578-FE0F\",\n \"joystick\": \"1F579-FE0F\",\n \"man_dancing\": \"1F57A\",\n \"linked_paperclips\": \"1F587-FE0F\",\n \"lower_left_ballpoint_pen\": \"1F58A-FE0F\",\n \"lower_left_fountain_pen\": \"1F58B-FE0F\",\n \"lower_left_paintbrush\": \"1F58C-FE0F\",\n \"lower_left_crayon\": \"1F58D-FE0F\",\n \"raised_hand_with_fingers_splayed\": \"1F590-FE0F\",\n \"middle_finger\": \"1F595\",\n \"spock-hand\": \"1F596\",\n \"black_heart\": \"1F5A4\",\n \"desktop_computer\": \"1F5A5-FE0F\",\n \"printer\": \"1F5A8-FE0F\",\n \"three_button_mouse\": \"1F5B1-FE0F\",\n \"trackball\": \"1F5B2-FE0F\",\n \"frame_with_picture\": \"1F5BC-FE0F\",\n \"card_index_dividers\": \"1F5C2-FE0F\",\n \"card_file_box\": \"1F5C3-FE0F\",\n \"file_cabinet\": \"1F5C4-FE0F\",\n \"wastebasket\": \"1F5D1-FE0F\",\n \"spiral_note_pad\": \"1F5D2-FE0F\",\n \"spiral_calendar_pad\": \"1F5D3-FE0F\",\n \"compression\": \"1F5DC-FE0F\",\n \"old_key\": \"1F5DD-FE0F\",\n \"rolled_up_newspaper\": \"1F5DE-FE0F\",\n \"dagger_knife\": \"1F5E1-FE0F\",\n \"speaking_head_in_silhouette\": \"1F5E3-FE0F\",\n \"left_speech_bubble\": \"1F5E8-FE0F\",\n \"right_anger_bubble\": \"1F5EF-FE0F\",\n \"ballot_box_with_ballot\": \"1F5F3-FE0F\",\n \"world_map\": \"1F5FA-FE0F\",\n \"mount_fuji\": \"1F5FB\",\n \"tokyo_tower\": \"1F5FC\",\n \"statue_of_liberty\": \"1F5FD\",\n \"japan\": \"1F5FE\",\n \"moyai\": \"1F5FF\",\n \"grinning\": \"1F600\",\n \"grin\": \"1F601\",\n \"joy\": \"1F602\",\n \"smiley\": \"1F603\",\n \"smile\": \"1F604\",\n \"sweat_smile\": \"1F605\",\n \"laughing\": \"1F606\",\n \"innocent\": \"1F607\",\n \"smiling_imp\": \"1F608\",\n \"wink\": \"1F609\",\n \"blush\": \"1F60A\",\n \"yum\": \"1F60B\",\n \"relieved\": \"1F60C\",\n \"heart_eyes\": \"1F60D\",\n \"sunglasses\": \"1F60E\",\n \"smirk\": \"1F60F\",\n \"neutral_face\": \"1F610\",\n \"expressionless\": \"1F611\",\n \"unamused\": \"1F612\",\n \"sweat\": \"1F613\",\n \"pensive\": \"1F614\",\n \"confused\": \"1F615\",\n \"confounded\": \"1F616\",\n \"kissing\": \"1F617\",\n \"kissing_heart\": \"1F618\",\n \"kissing_smiling_eyes\": \"1F619\",\n \"kissing_closed_eyes\": \"1F61A\",\n \"stuck_out_tongue\": \"1F61B\",\n \"stuck_out_tongue_winking_eye\": \"1F61C\",\n \"stuck_out_tongue_closed_eyes\": \"1F61D\",\n \"disappointed\": \"1F61E\",\n \"worried\": \"1F61F\",\n \"angry\": \"1F620\",\n \"rage\": \"1F621\",\n \"cry\": \"1F622\",\n \"persevere\": \"1F623\",\n \"triumph\": \"1F624\",\n \"disappointed_relieved\": \"1F625\",\n \"frowning\": \"1F626\",\n \"anguished\": \"1F627\",\n \"fearful\": \"1F628\",\n \"weary\": \"1F629\",\n \"sleepy\": \"1F62A\",\n \"tired_face\": \"1F62B\",\n \"grimacing\": \"1F62C\",\n \"sob\": \"1F62D\",\n \"open_mouth\": \"1F62E\",\n \"hushed\": \"1F62F\",\n \"cold_sweat\": \"1F630\",\n \"scream\": \"1F631\",\n \"astonished\": \"1F632\",\n \"flushed\": \"1F633\",\n \"sleeping\": \"1F634\",\n \"dizzy_face\": \"1F635\",\n \"no_mouth\": \"1F636\",\n \"mask\": \"1F637\",\n \"smile_cat\": \"1F638\",\n \"joy_cat\": \"1F639\",\n \"smiley_cat\": \"1F63A\",\n \"heart_eyes_cat\": \"1F63B\",\n \"smirk_cat\": \"1F63C\",\n \"kissing_cat\": \"1F63D\",\n \"pouting_cat\": \"1F63E\",\n \"crying_cat_face\": \"1F63F\",\n \"scream_cat\": \"1F640\",\n \"slightly_frowning_face\": \"1F641\",\n \"slightly_smiling_face\": \"1F642\",\n \"upside_down_face\": \"1F643\",\n \"face_with_rolling_eyes\": \"1F644\",\n \"woman-gesturing-no\": \"1F645-200D-2640-FE0F\",\n \"man-gesturing-no\": \"1F645-200D-2642-FE0F\",\n \"no_good\": \"1F645-200D-2640-FE0F\",\n \"woman-gesturing-ok\": \"1F646-200D-2640-FE0F\",\n \"man-gesturing-ok\": \"1F646-200D-2642-FE0F\",\n \"ok_woman\": \"1F646-200D-2640-FE0F\",\n \"woman-bowing\": \"1F647-200D-2640-FE0F\",\n \"man-bowing\": \"1F647-200D-2642-FE0F\",\n \"bow\": \"1F647-200D-2642-FE0F\",\n \"see_no_evil\": \"1F648\",\n \"hear_no_evil\": \"1F649\",\n \"speak_no_evil\": \"1F64A\",\n \"woman-raising-hand\": \"1F64B-200D-2640-FE0F\",\n \"man-raising-hand\": \"1F64B-200D-2642-FE0F\",\n \"raising_hand\": \"1F64B-200D-2640-FE0F\",\n \"raised_hands\": \"1F64C\",\n \"woman-frowning\": \"1F64D-200D-2640-FE0F\",\n \"man-frowning\": \"1F64D-200D-2642-FE0F\",\n \"person_frowning\": \"1F64D-200D-2640-FE0F\",\n \"woman-pouting\": \"1F64E-200D-2640-FE0F\",\n \"man-pouting\": \"1F64E-200D-2642-FE0F\",\n \"person_with_pouting_face\": \"1F64E-200D-2640-FE0F\",\n \"pray\": \"1F64F\",\n \"rocket\": \"1F680\",\n \"helicopter\": \"1F681\",\n \"steam_locomotive\": \"1F682\",\n \"railway_car\": \"1F683\",\n \"bullettrain_side\": \"1F684\",\n \"bullettrain_front\": \"1F685\",\n \"train2\": \"1F686\",\n \"metro\": \"1F687\",\n \"light_rail\": \"1F688\",\n \"station\": \"1F689\",\n \"tram\": \"1F68A\",\n \"train\": \"1F68B\",\n \"bus\": \"1F68C\",\n \"oncoming_bus\": \"1F68D\",\n \"trolleybus\": \"1F68E\",\n \"busstop\": \"1F68F\",\n \"minibus\": \"1F690\",\n \"ambulance\": \"1F691\",\n \"fire_engine\": \"1F692\",\n \"police_car\": \"1F693\",\n \"oncoming_police_car\": \"1F694\",\n \"taxi\": \"1F695\",\n \"oncoming_taxi\": \"1F696\",\n \"car\": \"1F697\",\n \"oncoming_automobile\": \"1F698\",\n \"blue_car\": \"1F699\",\n \"truck\": \"1F69A\",\n \"articulated_lorry\": \"1F69B\",\n \"tractor\": \"1F69C\",\n \"monorail\": \"1F69D\",\n \"mountain_railway\": \"1F69E\",\n \"suspension_railway\": \"1F69F\",\n \"mountain_cableway\": \"1F6A0\",\n \"aerial_tramway\": \"1F6A1\",\n \"ship\": \"1F6A2\",\n \"woman-rowing-boat\": \"1F6A3-200D-2640-FE0F\",\n \"man-rowing-boat\": \"1F6A3-200D-2642-FE0F\",\n \"rowboat\": \"1F6A3-200D-2642-FE0F\",\n \"speedboat\": \"1F6A4\",\n \"traffic_light\": \"1F6A5\",\n \"vertical_traffic_light\": \"1F6A6\",\n \"construction\": \"1F6A7\",\n \"rotating_light\": \"1F6A8\",\n \"triangular_flag_on_post\": \"1F6A9\",\n \"door\": \"1F6AA\",\n \"no_entry_sign\": \"1F6AB\",\n \"smoking\": \"1F6AC\",\n \"no_smoking\": \"1F6AD\",\n \"put_litter_in_its_place\": \"1F6AE\",\n \"do_not_litter\": \"1F6AF\",\n \"potable_water\": \"1F6B0\",\n \"non-potable_water\": \"1F6B1\",\n \"bike\": \"1F6B2\",\n \"no_bicycles\": \"1F6B3\",\n \"woman-biking\": \"1F6B4-200D-2640-FE0F\",\n \"man-biking\": \"1F6B4-200D-2642-FE0F\",\n \"bicyclist\": \"1F6B4-200D-2642-FE0F\",\n \"woman-mountain-biking\": \"1F6B5-200D-2640-FE0F\",\n \"man-mountain-biking\": \"1F6B5-200D-2642-FE0F\",\n \"mountain_bicyclist\": \"1F6B5-200D-2642-FE0F\",\n \"woman-walking\": \"1F6B6-200D-2640-FE0F\",\n \"man-walking\": \"1F6B6-200D-2642-FE0F\",\n \"walking\": \"1F6B6-200D-2642-FE0F\",\n \"no_pedestrians\": \"1F6B7\",\n \"children_crossing\": \"1F6B8\",\n \"mens\": \"1F6B9\",\n \"womens\": \"1F6BA\",\n \"restroom\": \"1F6BB\",\n \"baby_symbol\": \"1F6BC\",\n \"toilet\": \"1F6BD\",\n \"wc\": \"1F6BE\",\n \"shower\": \"1F6BF\",\n \"bath\": \"1F6C0\",\n \"bathtub\": \"1F6C1\",\n \"passport_control\": \"1F6C2\",\n \"customs\": \"1F6C3\",\n \"baggage_claim\": \"1F6C4\",\n \"left_luggage\": \"1F6C5\",\n \"couch_and_lamp\": \"1F6CB-FE0F\",\n \"sleeping_accommodation\": \"1F6CC\",\n \"shopping_bags\": \"1F6CD-FE0F\",\n \"bellhop_bell\": \"1F6CE-FE0F\",\n \"bed\": \"1F6CF-FE0F\",\n \"place_of_worship\": \"1F6D0\",\n \"octagonal_sign\": \"1F6D1\",\n \"shopping_trolley\": \"1F6D2\",\n \"hindu_temple\": \"1F6D5\",\n \"hut\": \"1F6D6\",\n \"elevator\": \"1F6D7\",\n \"hammer_and_wrench\": \"1F6E0-FE0F\",\n \"shield\": \"1F6E1-FE0F\",\n \"oil_drum\": \"1F6E2-FE0F\",\n \"motorway\": \"1F6E3-FE0F\",\n \"railway_track\": \"1F6E4-FE0F\",\n \"motor_boat\": \"1F6E5-FE0F\",\n \"small_airplane\": \"1F6E9-FE0F\",\n \"airplane_departure\": \"1F6EB\",\n \"airplane_arriving\": \"1F6EC\",\n \"satellite\": \"1F6F0-FE0F\",\n \"passenger_ship\": \"1F6F3-FE0F\",\n \"scooter\": \"1F6F4\",\n \"motor_scooter\": \"1F6F5\",\n \"canoe\": \"1F6F6\",\n \"sled\": \"1F6F7\",\n \"flying_saucer\": \"1F6F8\",\n \"skateboard\": \"1F6F9\",\n \"auto_rickshaw\": \"1F6FA\",\n \"pickup_truck\": \"1F6FB\",\n \"roller_skate\": \"1F6FC\",\n \"large_orange_circle\": \"1F7E0\",\n \"large_yellow_circle\": \"1F7E1\",\n \"large_green_circle\": \"1F7E2\",\n \"large_purple_circle\": \"1F7E3\",\n \"large_brown_circle\": \"1F7E4\",\n \"large_red_square\": \"1F7E5\",\n \"large_blue_square\": \"1F7E6\",\n \"large_orange_square\": \"1F7E7\",\n \"large_yellow_square\": \"1F7E8\",\n \"large_green_square\": \"1F7E9\",\n \"large_purple_square\": \"1F7EA\",\n \"large_brown_square\": \"1F7EB\",\n \"pinched_fingers\": \"1F90C\",\n \"white_heart\": \"1F90D\",\n \"brown_heart\": \"1F90E\",\n \"pinching_hand\": \"1F90F\",\n \"zipper_mouth_face\": \"1F910\",\n \"money_mouth_face\": \"1F911\",\n \"face_with_thermometer\": \"1F912\",\n \"nerd_face\": \"1F913\",\n \"thinking_face\": \"1F914\",\n \"face_with_head_bandage\": \"1F915\",\n \"robot_face\": \"1F916\",\n \"hugging_face\": \"1F917\",\n \"the_horns\": \"1F918\",\n \"call_me_hand\": \"1F919\",\n \"raised_back_of_hand\": \"1F91A\",\n \"left-facing_fist\": \"1F91B\",\n \"right-facing_fist\": \"1F91C\",\n \"handshake\": \"1F91D\",\n \"crossed_fingers\": \"1F91E\",\n \"i_love_you_hand_sign\": \"1F91F\",\n \"face_with_cowboy_hat\": \"1F920\",\n \"clown_face\": \"1F921\",\n \"nauseated_face\": \"1F922\",\n \"rolling_on_the_floor_laughing\": \"1F923\",\n \"drooling_face\": \"1F924\",\n \"lying_face\": \"1F925\",\n \"woman-facepalming\": \"1F926-200D-2640-FE0F\",\n \"man-facepalming\": \"1F926-200D-2642-FE0F\",\n \"face_palm\": \"1F926\",\n \"sneezing_face\": \"1F927\",\n \"face_with_raised_eyebrow\": \"1F928\",\n \"star-struck\": \"1F929\",\n \"zany_face\": \"1F92A\",\n \"shushing_face\": \"1F92B\",\n \"face_with_symbols_on_mouth\": \"1F92C\",\n \"face_with_hand_over_mouth\": \"1F92D\",\n \"face_vomiting\": \"1F92E\",\n \"exploding_head\": \"1F92F\",\n \"pregnant_woman\": \"1F930\",\n \"breast-feeding\": \"1F931\",\n \"palms_up_together\": \"1F932\",\n \"selfie\": \"1F933\",\n \"prince\": \"1F934\",\n \"woman_in_tuxedo\": \"1F935-200D-2640-FE0F\",\n \"man_in_tuxedo\": \"1F935\",\n \"mrs_claus\": \"1F936\",\n \"woman-shrugging\": \"1F937-200D-2640-FE0F\",\n \"man-shrugging\": \"1F937-200D-2642-FE0F\",\n \"shrug\": \"1F937\",\n \"woman-cartwheeling\": \"1F938-200D-2640-FE0F\",\n \"man-cartwheeling\": \"1F938-200D-2642-FE0F\",\n \"person_doing_cartwheel\": \"1F938\",\n \"woman-juggling\": \"1F939-200D-2640-FE0F\",\n \"man-juggling\": \"1F939-200D-2642-FE0F\",\n \"juggling\": \"1F939\",\n \"fencer\": \"1F93A\",\n \"woman-wrestling\": \"1F93C-200D-2640-FE0F\",\n \"man-wrestling\": \"1F93C-200D-2642-FE0F\",\n \"wrestlers\": \"1F93C\",\n \"woman-playing-water-polo\": \"1F93D-200D-2640-FE0F\",\n \"man-playing-water-polo\": \"1F93D-200D-2642-FE0F\",\n \"water_polo\": \"1F93D\",\n \"woman-playing-handball\": \"1F93E-200D-2640-FE0F\",\n \"man-playing-handball\": \"1F93E-200D-2642-FE0F\",\n \"handball\": \"1F93E\",\n \"diving_mask\": \"1F93F\",\n \"wilted_flower\": \"1F940\",\n \"drum_with_drumsticks\": \"1F941\",\n \"clinking_glasses\": \"1F942\",\n \"tumbler_glass\": \"1F943\",\n \"spoon\": \"1F944\",\n \"goal_net\": \"1F945\",\n \"first_place_medal\": \"1F947\",\n \"second_place_medal\": \"1F948\",\n \"third_place_medal\": \"1F949\",\n \"boxing_glove\": \"1F94A\",\n \"martial_arts_uniform\": \"1F94B\",\n \"curling_stone\": \"1F94C\",\n \"lacrosse\": \"1F94D\",\n \"softball\": \"1F94E\",\n \"flying_disc\": \"1F94F\",\n \"croissant\": \"1F950\",\n \"avocado\": \"1F951\",\n \"cucumber\": \"1F952\",\n \"bacon\": \"1F953\",\n \"potato\": \"1F954\",\n \"carrot\": \"1F955\",\n \"baguette_bread\": \"1F956\",\n \"green_salad\": \"1F957\",\n \"shallow_pan_of_food\": \"1F958\",\n \"stuffed_flatbread\": \"1F959\",\n \"egg\": \"1F95A\",\n \"glass_of_milk\": \"1F95B\",\n \"peanuts\": \"1F95C\",\n \"kiwifruit\": \"1F95D\",\n \"pancakes\": \"1F95E\",\n \"dumpling\": \"1F95F\",\n \"fortune_cookie\": \"1F960\",\n \"takeout_box\": \"1F961\",\n \"chopsticks\": \"1F962\",\n \"bowl_with_spoon\": \"1F963\",\n \"cup_with_straw\": \"1F964\",\n \"coconut\": \"1F965\",\n \"broccoli\": \"1F966\",\n \"pie\": \"1F967\",\n \"pretzel\": \"1F968\",\n \"cut_of_meat\": \"1F969\",\n \"sandwich\": \"1F96A\",\n \"canned_food\": \"1F96B\",\n \"leafy_green\": \"1F96C\",\n \"mango\": \"1F96D\",\n \"moon_cake\": \"1F96E\",\n \"bagel\": \"1F96F\",\n \"smiling_face_with_3_hearts\": \"1F970\",\n \"yawning_face\": \"1F971\",\n \"smiling_face_with_tear\": \"1F972\",\n \"partying_face\": \"1F973\",\n \"woozy_face\": \"1F974\",\n \"hot_face\": \"1F975\",\n \"cold_face\": \"1F976\",\n \"ninja\": \"1F977\",\n \"disguised_face\": \"1F978\",\n \"pleading_face\": \"1F97A\",\n \"sari\": \"1F97B\",\n \"lab_coat\": \"1F97C\",\n \"goggles\": \"1F97D\",\n \"hiking_boot\": \"1F97E\",\n \"womans_flat_shoe\": \"1F97F\",\n \"crab\": \"1F980\",\n \"lion_face\": \"1F981\",\n \"scorpion\": \"1F982\",\n \"turkey\": \"1F983\",\n \"unicorn_face\": \"1F984\",\n \"eagle\": \"1F985\",\n \"duck\": \"1F986\",\n \"bat\": \"1F987\",\n \"shark\": \"1F988\",\n \"owl\": \"1F989\",\n \"fox_face\": \"1F98A\",\n \"butterfly\": \"1F98B\",\n \"deer\": \"1F98C\",\n \"gorilla\": \"1F98D\",\n \"lizard\": \"1F98E\",\n \"rhinoceros\": \"1F98F\",\n \"shrimp\": \"1F990\",\n \"squid\": \"1F991\",\n \"giraffe_face\": \"1F992\",\n \"zebra_face\": \"1F993\",\n \"hedgehog\": \"1F994\",\n \"sauropod\": \"1F995\",\n \"t-rex\": \"1F996\",\n \"cricket\": \"1F997\",\n \"kangaroo\": \"1F998\",\n \"llama\": \"1F999\",\n \"peacock\": \"1F99A\",\n \"hippopotamus\": \"1F99B\",\n \"parrot\": \"1F99C\",\n \"raccoon\": \"1F99D\",\n \"lobster\": \"1F99E\",\n \"mosquito\": \"1F99F\",\n \"microbe\": \"1F9A0\",\n \"badger\": \"1F9A1\",\n \"swan\": \"1F9A2\",\n \"mammoth\": \"1F9A3\",\n \"dodo\": \"1F9A4\",\n \"sloth\": \"1F9A5\",\n \"otter\": \"1F9A6\",\n \"orangutan\": \"1F9A7\",\n \"skunk\": \"1F9A8\",\n \"flamingo\": \"1F9A9\",\n \"oyster\": \"1F9AA\",\n \"beaver\": \"1F9AB\",\n \"bison\": \"1F9AC\",\n \"seal\": \"1F9AD\",\n \"guide_dog\": \"1F9AE\",\n \"probing_cane\": \"1F9AF\",\n \"bone\": \"1F9B4\",\n \"leg\": \"1F9B5\",\n \"foot\": \"1F9B6\",\n \"tooth\": \"1F9B7\",\n \"female_superhero\": \"1F9B8-200D-2640-FE0F\",\n \"male_superhero\": \"1F9B8-200D-2642-FE0F\",\n \"superhero\": \"1F9B8\",\n \"female_supervillain\": \"1F9B9-200D-2640-FE0F\",\n \"male_supervillain\": \"1F9B9-200D-2642-FE0F\",\n \"supervillain\": \"1F9B9\",\n \"safety_vest\": \"1F9BA\",\n \"ear_with_hearing_aid\": \"1F9BB\",\n \"motorized_wheelchair\": \"1F9BC\",\n \"manual_wheelchair\": \"1F9BD\",\n \"mechanical_arm\": \"1F9BE\",\n \"mechanical_leg\": \"1F9BF\",\n \"cheese_wedge\": \"1F9C0\",\n \"cupcake\": \"1F9C1\",\n \"salt\": \"1F9C2\",\n \"beverage_box\": \"1F9C3\",\n \"garlic\": \"1F9C4\",\n \"onion\": \"1F9C5\",\n \"falafel\": \"1F9C6\",\n \"waffle\": \"1F9C7\",\n \"butter\": \"1F9C8\",\n \"mate_drink\": \"1F9C9\",\n \"ice_cube\": \"1F9CA\",\n \"bubble_tea\": \"1F9CB\",\n \"woman_standing\": \"1F9CD-200D-2640-FE0F\",\n \"man_standing\": \"1F9CD-200D-2642-FE0F\",\n \"standing_person\": \"1F9CD\",\n \"woman_kneeling\": \"1F9CE-200D-2640-FE0F\",\n \"man_kneeling\": \"1F9CE-200D-2642-FE0F\",\n \"kneeling_person\": \"1F9CE\",\n \"deaf_woman\": \"1F9CF-200D-2640-FE0F\",\n \"deaf_man\": \"1F9CF-200D-2642-FE0F\",\n \"deaf_person\": \"1F9CF\",\n \"face_with_monocle\": \"1F9D0\",\n \"farmer\": \"1F9D1-200D-1F33E\",\n \"cook\": \"1F9D1-200D-1F373\",\n \"person_feeding_baby\": \"1F9D1-200D-1F37C\",\n \"mx_claus\": \"1F9D1-200D-1F384\",\n \"student\": \"1F9D1-200D-1F393\",\n \"singer\": \"1F9D1-200D-1F3A4\",\n \"artist\": \"1F9D1-200D-1F3A8\",\n \"teacher\": \"1F9D1-200D-1F3EB\",\n \"factory_worker\": \"1F9D1-200D-1F3ED\",\n \"technologist\": \"1F9D1-200D-1F4BB\",\n \"office_worker\": \"1F9D1-200D-1F4BC\",\n \"mechanic\": \"1F9D1-200D-1F527\",\n \"scientist\": \"1F9D1-200D-1F52C\",\n \"astronaut\": \"1F9D1-200D-1F680\",\n \"firefighter\": \"1F9D1-200D-1F692\",\n \"people_holding_hands\": \"1F9D1-200D-1F91D-200D-1F9D1\",\n \"person_with_probing_cane\": \"1F9D1-200D-1F9AF\",\n \"red_haired_person\": \"1F9D1-200D-1F9B0\",\n \"curly_haired_person\": \"1F9D1-200D-1F9B1\",\n \"bald_person\": \"1F9D1-200D-1F9B2\",\n \"white_haired_person\": \"1F9D1-200D-1F9B3\",\n \"person_in_motorized_wheelchair\": \"1F9D1-200D-1F9BC\",\n \"person_in_manual_wheelchair\": \"1F9D1-200D-1F9BD\",\n \"health_worker\": \"1F9D1-200D-2695-FE0F\",\n \"judge\": \"1F9D1-200D-2696-FE0F\",\n \"pilot\": \"1F9D1-200D-2708-FE0F\",\n \"adult\": \"1F9D1\",\n \"child\": \"1F9D2\",\n \"older_adult\": \"1F9D3\",\n \"bearded_person\": \"1F9D4\",\n \"person_with_headscarf\": \"1F9D5\",\n \"woman_in_steamy_room\": \"1F9D6-200D-2640-FE0F\",\n \"man_in_steamy_room\": \"1F9D6-200D-2642-FE0F\",\n \"person_in_steamy_room\": \"1F9D6-200D-2642-FE0F\",\n \"woman_climbing\": \"1F9D7-200D-2640-FE0F\",\n \"man_climbing\": \"1F9D7-200D-2642-FE0F\",\n \"person_climbing\": \"1F9D7-200D-2640-FE0F\",\n \"woman_in_lotus_position\": \"1F9D8-200D-2640-FE0F\",\n \"man_in_lotus_position\": \"1F9D8-200D-2642-FE0F\",\n \"person_in_lotus_position\": \"1F9D8-200D-2640-FE0F\",\n \"female_mage\": \"1F9D9-200D-2640-FE0F\",\n \"male_mage\": \"1F9D9-200D-2642-FE0F\",\n \"mage\": \"1F9D9-200D-2640-FE0F\",\n \"female_fairy\": \"1F9DA-200D-2640-FE0F\",\n \"male_fairy\": \"1F9DA-200D-2642-FE0F\",\n \"fairy\": \"1F9DA-200D-2640-FE0F\",\n \"female_vampire\": \"1F9DB-200D-2640-FE0F\",\n \"male_vampire\": \"1F9DB-200D-2642-FE0F\",\n \"vampire\": \"1F9DB-200D-2640-FE0F\",\n \"mermaid\": \"1F9DC-200D-2640-FE0F\",\n \"merman\": \"1F9DC-200D-2642-FE0F\",\n \"merperson\": \"1F9DC-200D-2642-FE0F\",\n \"female_elf\": \"1F9DD-200D-2640-FE0F\",\n \"male_elf\": \"1F9DD-200D-2642-FE0F\",\n \"elf\": \"1F9DD-200D-2642-FE0F\",\n \"female_genie\": \"1F9DE-200D-2640-FE0F\",\n \"male_genie\": \"1F9DE-200D-2642-FE0F\",\n \"genie\": \"1F9DE-200D-2642-FE0F\",\n \"female_zombie\": \"1F9DF-200D-2640-FE0F\",\n \"male_zombie\": \"1F9DF-200D-2642-FE0F\",\n \"zombie\": \"1F9DF-200D-2642-FE0F\",\n \"brain\": \"1F9E0\",\n \"orange_heart\": \"1F9E1\",\n \"billed_cap\": \"1F9E2\",\n \"scarf\": \"1F9E3\",\n \"gloves\": \"1F9E4\",\n \"coat\": \"1F9E5\",\n \"socks\": \"1F9E6\",\n \"red_envelope\": \"1F9E7\",\n \"firecracker\": \"1F9E8\",\n \"jigsaw\": \"1F9E9\",\n \"test_tube\": \"1F9EA\",\n \"petri_dish\": \"1F9EB\",\n \"dna\": \"1F9EC\",\n \"compass\": \"1F9ED\",\n \"abacus\": \"1F9EE\",\n \"fire_extinguisher\": \"1F9EF\",\n \"toolbox\": \"1F9F0\",\n \"bricks\": \"1F9F1\",\n \"magnet\": \"1F9F2\",\n \"luggage\": \"1F9F3\",\n \"lotion_bottle\": \"1F9F4\",\n \"thread\": \"1F9F5\",\n \"yarn\": \"1F9F6\",\n \"safety_pin\": \"1F9F7\",\n \"teddy_bear\": \"1F9F8\",\n \"broom\": \"1F9F9\",\n \"basket\": \"1F9FA\",\n \"roll_of_paper\": \"1F9FB\",\n \"soap\": \"1F9FC\",\n \"sponge\": \"1F9FD\",\n \"receipt\": \"1F9FE\",\n \"nazar_amulet\": \"1F9FF\",\n \"ballet_shoes\": \"1FA70\",\n \"one-piece_swimsuit\": \"1FA71\",\n \"briefs\": \"1FA72\",\n \"shorts\": \"1FA73\",\n \"thong_sandal\": \"1FA74\",\n \"drop_of_blood\": \"1FA78\",\n \"adhesive_bandage\": \"1FA79\",\n \"stethoscope\": \"1FA7A\",\n \"yo-yo\": \"1FA80\",\n \"kite\": \"1FA81\",\n \"parachute\": \"1FA82\",\n \"boomerang\": \"1FA83\",\n \"magic_wand\": \"1FA84\",\n \"pinata\": \"1FA85\",\n \"nesting_dolls\": \"1FA86\",\n \"ringed_planet\": \"1FA90\",\n \"chair\": \"1FA91\",\n \"razor\": \"1FA92\",\n \"axe\": \"1FA93\",\n \"diya_lamp\": \"1FA94\",\n \"banjo\": \"1FA95\",\n \"military_helmet\": \"1FA96\",\n \"accordion\": \"1FA97\",\n \"long_drum\": \"1FA98\",\n \"coin\": \"1FA99\",\n \"carpentry_saw\": \"1FA9A\",\n \"screwdriver\": \"1FA9B\",\n \"ladder\": \"1FA9C\",\n \"hook\": \"1FA9D\",\n \"mirror\": \"1FA9E\",\n \"window\": \"1FA9F\",\n \"plunger\": \"1FAA0\",\n \"sewing_needle\": \"1FAA1\",\n \"knot\": \"1FAA2\",\n \"bucket\": \"1FAA3\",\n \"mouse_trap\": \"1FAA4\",\n \"toothbrush\": \"1FAA5\",\n \"headstone\": \"1FAA6\",\n \"placard\": \"1FAA7\",\n \"rock\": \"1FAA8\",\n \"fly\": \"1FAB0\",\n \"worm\": \"1FAB1\",\n \"cockroach\": \"1FAB3\",\n \"potted_plant\": \"1FAB4\",\n \"wood\": \"1FAB5\",\n \"feather\": \"1FAB6\",\n \"anatomical_heart\": \"1FAC0\",\n \"lungs\": \"1FAC1\",\n \"people_hugging\": \"1FAC2\",\n \"blueberries\": \"1FAD0\",\n \"bell_pepper\": \"1FAD1\",\n \"olive\": \"1FAD2\",\n \"flatbread\": \"1FAD3\",\n \"tamale\": \"1FAD4\",\n \"fondue\": \"1FAD5\",\n \"teapot\": \"1FAD6\",\n \"bangbang\": \"203C-FE0F\",\n \"interrobang\": \"2049-FE0F\",\n \"tm\": \"2122-FE0F\",\n \"information_source\": \"2139-FE0F\",\n \"left_right_arrow\": \"2194-FE0F\",\n \"arrow_up_down\": \"2195-FE0F\",\n \"arrow_upper_left\": \"2196-FE0F\",\n \"arrow_upper_right\": \"2197-FE0F\",\n \"arrow_lower_right\": \"2198-FE0F\",\n \"arrow_lower_left\": \"2199-FE0F\",\n \"leftwards_arrow_with_hook\": \"21A9-FE0F\",\n \"arrow_right_hook\": \"21AA-FE0F\",\n \"watch\": \"231A\",\n \"hourglass\": \"231B\",\n \"keyboard\": \"2328-FE0F\",\n \"eject\": \"23CF-FE0F\",\n \"fast_forward\": \"23E9\",\n \"rewind\": \"23EA\",\n \"arrow_double_up\": \"23EB\",\n \"arrow_double_down\": \"23EC\",\n \"black_right_pointing_double_triangle_with_vertical_bar\": \"23ED-FE0F\",\n \"black_left_pointing_double_triangle_with_vertical_bar\": \"23EE-FE0F\",\n \"black_right_pointing_triangle_with_double_vertical_bar\": \"23EF-FE0F\",\n \"alarm_clock\": \"23F0\",\n \"stopwatch\": \"23F1-FE0F\",\n \"timer_clock\": \"23F2-FE0F\",\n \"hourglass_flowing_sand\": \"23F3\",\n \"double_vertical_bar\": \"23F8-FE0F\",\n \"black_square_for_stop\": \"23F9-FE0F\",\n \"black_circle_for_record\": \"23FA-FE0F\",\n \"m\": \"24C2-FE0F\",\n \"black_small_square\": \"25AA-FE0F\",\n \"white_small_square\": \"25AB-FE0F\",\n \"arrow_forward\": \"25B6-FE0F\",\n \"arrow_backward\": \"25C0-FE0F\",\n \"white_medium_square\": \"25FB-FE0F\",\n \"black_medium_square\": \"25FC-FE0F\",\n \"white_medium_small_square\": \"25FD\",\n \"black_medium_small_square\": \"25FE\",\n \"sunny\": \"2600-FE0F\",\n \"cloud\": \"2601-FE0F\",\n \"umbrella\": \"2602-FE0F\",\n \"snowman\": \"2603-FE0F\",\n \"comet\": \"2604-FE0F\",\n \"phone\": \"260E-FE0F\",\n \"ballot_box_with_check\": \"2611-FE0F\",\n \"umbrella_with_rain_drops\": \"2614\",\n \"coffee\": \"2615\",\n \"shamrock\": \"2618-FE0F\",\n \"point_up\": \"261D-FE0F\",\n \"skull_and_crossbones\": \"2620-FE0F\",\n \"radioactive_sign\": \"2622-FE0F\",\n \"biohazard_sign\": \"2623-FE0F\",\n \"orthodox_cross\": \"2626-FE0F\",\n \"star_and_crescent\": \"262A-FE0F\",\n \"peace_symbol\": \"262E-FE0F\",\n \"yin_yang\": \"262F-FE0F\",\n \"wheel_of_dharma\": \"2638-FE0F\",\n \"white_frowning_face\": \"2639-FE0F\",\n \"relaxed\": \"263A-FE0F\",\n \"female_sign\": \"2640-FE0F\",\n \"male_sign\": \"2642-FE0F\",\n \"aries\": \"2648\",\n \"taurus\": \"2649\",\n \"gemini\": \"264A\",\n \"cancer\": \"264B\",\n \"leo\": \"264C\",\n \"virgo\": \"264D\",\n \"libra\": \"264E\",\n \"scorpius\": \"264F\",\n \"sagittarius\": \"2650\",\n \"capricorn\": \"2651\",\n \"aquarius\": \"2652\",\n \"pisces\": \"2653\",\n \"chess_pawn\": \"265F-FE0F\",\n \"spades\": \"2660-FE0F\",\n \"clubs\": \"2663-FE0F\",\n \"hearts\": \"2665-FE0F\",\n \"diamonds\": \"2666-FE0F\",\n \"hotsprings\": \"2668-FE0F\",\n \"recycle\": \"267B-FE0F\",\n \"infinity\": \"267E-FE0F\",\n \"wheelchair\": \"267F\",\n \"hammer_and_pick\": \"2692-FE0F\",\n \"anchor\": \"2693\",\n \"crossed_swords\": \"2694-FE0F\",\n \"medical_symbol\": \"2695-FE0F\",\n \"scales\": \"2696-FE0F\",\n \"alembic\": \"2697-FE0F\",\n \"gear\": \"2699-FE0F\",\n \"atom_symbol\": \"269B-FE0F\",\n \"fleur_de_lis\": \"269C-FE0F\",\n \"warning\": \"26A0-FE0F\",\n \"zap\": \"26A1\",\n \"transgender_symbol\": \"26A7-FE0F\",\n \"white_circle\": \"26AA\",\n \"black_circle\": \"26AB\",\n \"coffin\": \"26B0-FE0F\",\n \"funeral_urn\": \"26B1-FE0F\",\n \"soccer\": \"26BD\",\n \"baseball\": \"26BE\",\n \"snowman_without_snow\": \"26C4\",\n \"partly_sunny\": \"26C5\",\n \"thunder_cloud_and_rain\": \"26C8-FE0F\",\n \"ophiuchus\": \"26CE\",\n \"pick\": \"26CF-FE0F\",\n \"helmet_with_white_cross\": \"26D1-FE0F\",\n \"chains\": \"26D3-FE0F\",\n \"no_entry\": \"26D4\",\n \"shinto_shrine\": \"26E9-FE0F\",\n \"church\": \"26EA\",\n \"mountain\": \"26F0-FE0F\",\n \"umbrella_on_ground\": \"26F1-FE0F\",\n \"fountain\": \"26F2\",\n \"golf\": \"26F3\",\n \"ferry\": \"26F4-FE0F\",\n \"boat\": \"26F5\",\n \"skier\": \"26F7-FE0F\",\n \"ice_skate\": \"26F8-FE0F\",\n \"woman-bouncing-ball\": \"26F9-FE0F-200D-2640-FE0F\",\n \"man-bouncing-ball\": \"26F9-FE0F-200D-2642-FE0F\",\n \"person_with_ball\": \"26F9-FE0F-200D-2642-FE0F\",\n \"tent\": \"26FA\",\n \"fuelpump\": \"26FD\",\n \"scissors\": \"2702-FE0F\",\n \"white_check_mark\": \"2705\",\n \"airplane\": \"2708-FE0F\",\n \"email\": \"2709-FE0F\",\n \"fist\": \"270A\",\n \"hand\": \"270B\",\n \"v\": \"270C-FE0F\",\n \"writing_hand\": \"270D-FE0F\",\n \"pencil2\": \"270F-FE0F\",\n \"black_nib\": \"2712-FE0F\",\n \"heavy_check_mark\": \"2714-FE0F\",\n \"heavy_multiplication_x\": \"2716-FE0F\",\n \"latin_cross\": \"271D-FE0F\",\n \"star_of_david\": \"2721-FE0F\",\n \"sparkles\": \"2728\",\n \"eight_spoked_asterisk\": \"2733-FE0F\",\n \"eight_pointed_black_star\": \"2734-FE0F\",\n \"snowflake\": \"2744-FE0F\",\n \"sparkle\": \"2747-FE0F\",\n \"x\": \"274C\",\n \"negative_squared_cross_mark\": \"274E\",\n \"question\": \"2753\",\n \"grey_question\": \"2754\",\n \"grey_exclamation\": \"2755\",\n \"exclamation\": \"2757\",\n \"heavy_heart_exclamation_mark_ornament\": \"2763-FE0F\",\n \"heart\": \"2764-FE0F\",\n \"heavy_plus_sign\": \"2795\",\n \"heavy_minus_sign\": \"2796\",\n \"heavy_division_sign\": \"2797\",\n \"arrow_right\": \"27A1-FE0F\",\n \"curly_loop\": \"27B0\",\n \"loop\": \"27BF\",\n \"arrow_heading_up\": \"2934-FE0F\",\n \"arrow_heading_down\": \"2935-FE0F\",\n \"arrow_left\": \"2B05-FE0F\",\n \"arrow_up\": \"2B06-FE0F\",\n \"arrow_down\": \"2B07-FE0F\",\n \"black_large_square\": \"2B1B\",\n \"white_large_square\": \"2B1C\",\n \"star\": \"2B50\",\n \"o\": \"2B55\",\n \"wavy_dash\": \"3030-FE0F\",\n \"part_alternation_mark\": \"303D-FE0F\",\n \"congratulations\": \"3297-FE0F\",\n \"secret\": \"3299-FE0F\"\n};\n"],"file":"data.min.js"} \ No newline at end of file +{"version":3,"sources":["../../src/emoji/data.js"],"names":[],"mappings":"+JAuB0B,CACtB,CACI,KAAQ,mBADZ,CAEI,OAAU,CACN,CACI,QAAW,OADf,CAEI,WAAc,CACV,UADU,CAFlB,CADM,CAON,CACI,QAAW,OADf,CAEI,WAAc,CACV,QADU,CAFlB,CAPM,CAaN,CACI,QAAW,OADf,CAEI,WAAc,CACV,OADU,CAFlB,CAbM,CAmBN,CACI,QAAW,OADf,CAEI,WAAc,CACV,MADU,CAFlB,CAnBM,CAyBN,CACI,QAAW,OADf,CAEI,WAAc,CACV,UADU,CAFlB,CAzBM,CA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,MAnwDe,CAowDvB,iBAAoB,WApwDG,CAqwDvB,mBAAsB,WArwDC,CAswDvB,WAAc,WAtwDS,CAuwDvB,SAAY,WAvwDW,CAwwDvB,WAAc,WAxwDS,CAywDvB,mBAAsB,MAzwDC,CA0wDvB,mBAAsB,MA1wDC,CA2wDvB,KAAQ,MA3wDe,CA4wDvB,EAAK,MA5wDkB,CA6wDvB,UAAa,WA7wDU,CA8wDvB,sBAAyB,WA9wDF,CA+wDvB,gBAAmB,WA/wDI,CAgxDvB,OAAU,WAhxDa,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Emoji data based on the data available from https://github.com/iamcal/emoji-data.\n *\n * @module core/emoji/data\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nexport const byCategory = [\n {\n \"name\": \"Smileys & Emotion\",\n \"emojis\": [\n {\n \"unified\": \"1F600\",\n \"shortnames\": [\n \"grinning\"\n ]\n },\n {\n \"unified\": \"1F603\",\n \"shortnames\": [\n \"smiley\"\n ]\n },\n {\n \"unified\": \"1F604\",\n \"shortnames\": [\n \"smile\"\n ]\n },\n {\n \"unified\": \"1F601\",\n \"shortnames\": [\n \"grin\"\n ]\n },\n {\n \"unified\": \"1F606\",\n \"shortnames\": [\n \"laughing\"\n ]\n },\n {\n \"unified\": \"1F605\",\n \"shortnames\": [\n \"sweat_smile\"\n ]\n },\n {\n \"unified\": \"1F923\",\n \"shortnames\": [\n \"rolling_on_the_floor_laughing\"\n ]\n },\n {\n \"unified\": \"1F602\",\n \"shortnames\": [\n \"joy\"\n ]\n },\n {\n \"unified\": \"1F642\",\n \"shortnames\": [\n \"slightly_smiling_face\"\n ]\n },\n {\n \"unified\": \"1F643\",\n \"shortnames\": [\n \"upside_down_face\"\n ]\n },\n {\n \"unified\": \"1F609\",\n \"shortnames\": [\n \"wink\"\n ]\n },\n {\n \"unified\": \"1F60A\",\n \"shortnames\": [\n \"blush\"\n ]\n },\n {\n \"unified\": \"1F607\",\n \"shortnames\": [\n \"innocent\"\n ]\n },\n {\n \"unified\": \"1F970\",\n \"shortnames\": [\n \"smiling_face_with_3_hearts\"\n ]\n },\n {\n \"unified\": \"1F60D\",\n \"shortnames\": [\n \"heart_eyes\"\n ]\n },\n {\n \"unified\": \"1F929\",\n \"shortnames\": [\n \"star-struck\"\n ]\n },\n {\n \"unified\": \"1F618\",\n \"shortnames\": [\n \"kissing_heart\"\n ]\n },\n {\n \"unified\": \"1F617\",\n \"shortnames\": [\n \"kissing\"\n ]\n },\n {\n \"unified\": \"263A-FE0F\",\n \"shortnames\": [\n \"relaxed\"\n ]\n },\n {\n \"unified\": \"1F61A\",\n \"shortnames\": [\n \"kissing_closed_eyes\"\n ]\n },\n {\n \"unified\": \"1F619\",\n \"shortnames\": [\n \"kissing_smiling_eyes\"\n ]\n },\n {\n \"unified\": \"1F972\",\n \"shortnames\": [\n \"smiling_face_with_tear\"\n ]\n },\n {\n \"unified\": \"1F60B\",\n \"shortnames\": [\n \"yum\"\n ]\n },\n {\n \"unified\": \"1F61B\",\n \"shortnames\": [\n \"stuck_out_tongue\"\n ]\n },\n {\n \"unified\": \"1F61C\",\n \"shortnames\": [\n \"stuck_out_tongue_winking_eye\"\n ]\n },\n {\n \"unified\": \"1F92A\",\n \"shortnames\": [\n \"zany_face\"\n ]\n },\n {\n \"unified\": \"1F61D\",\n \"shortnames\": [\n \"stuck_out_tongue_closed_eyes\"\n ]\n },\n {\n \"unified\": \"1F911\",\n \"shortnames\": [\n \"money_mouth_face\"\n ]\n },\n {\n \"unified\": \"1F917\",\n \"shortnames\": [\n \"hugging_face\"\n ]\n },\n {\n \"unified\": \"1F92D\",\n \"shortnames\": [\n \"face_with_hand_over_mouth\"\n ]\n },\n {\n \"unified\": \"1F92B\",\n \"shortnames\": [\n \"shushing_face\"\n ]\n },\n {\n \"unified\": \"1F914\",\n \"shortnames\": [\n \"thinking_face\"\n ]\n },\n {\n \"unified\": \"1F910\",\n \"shortnames\": [\n \"zipper_mouth_face\"\n ]\n },\n {\n \"unified\": \"1F928\",\n \"shortnames\": [\n \"face_with_raised_eyebrow\"\n ]\n },\n {\n \"unified\": \"1F610\",\n \"shortnames\": [\n \"neutral_face\"\n ]\n },\n {\n \"unified\": \"1F611\",\n \"shortnames\": [\n \"expressionless\"\n ]\n },\n {\n \"unified\": \"1F636\",\n \"shortnames\": [\n \"no_mouth\"\n ]\n },\n {\n \"unified\": \"1F60F\",\n \"shortnames\": [\n \"smirk\"\n ]\n },\n {\n \"unified\": \"1F612\",\n \"shortnames\": [\n \"unamused\"\n ]\n },\n {\n \"unified\": \"1F644\",\n \"shortnames\": [\n \"face_with_rolling_eyes\"\n ]\n },\n {\n \"unified\": \"1F62C\",\n \"shortnames\": [\n \"grimacing\"\n ]\n },\n {\n \"unified\": \"1F925\",\n \"shortnames\": [\n \"lying_face\"\n ]\n },\n {\n \"unified\": \"1F60C\",\n \"shortnames\": [\n \"relieved\"\n ]\n },\n {\n \"unified\": \"1F614\",\n \"shortnames\": [\n \"pensive\"\n ]\n },\n {\n \"unified\": \"1F62A\",\n \"shortnames\": [\n \"sleepy\"\n ]\n },\n {\n \"unified\": \"1F924\",\n \"shortnames\": [\n \"drooling_face\"\n ]\n },\n {\n \"unified\": \"1F634\",\n \"shortnames\": [\n \"sleeping\"\n ]\n },\n {\n \"unified\": \"1F637\",\n \"shortnames\": [\n \"mask\"\n ]\n },\n {\n \"unified\": \"1F912\",\n \"shortnames\": [\n \"face_with_thermometer\"\n ]\n },\n {\n \"unified\": \"1F915\",\n \"shortnames\": [\n \"face_with_head_bandage\"\n ]\n },\n {\n \"unified\": \"1F922\",\n \"shortnames\": [\n \"nauseated_face\"\n ]\n },\n {\n \"unified\": \"1F92E\",\n \"shortnames\": [\n \"face_vomiting\"\n ]\n },\n {\n \"unified\": \"1F927\",\n \"shortnames\": [\n \"sneezing_face\"\n ]\n },\n {\n \"unified\": \"1F975\",\n \"shortnames\": [\n \"hot_face\"\n ]\n },\n {\n \"unified\": \"1F976\",\n \"shortnames\": [\n \"cold_face\"\n ]\n },\n {\n \"unified\": \"1F974\",\n \"shortnames\": [\n \"woozy_face\"\n ]\n },\n {\n \"unified\": \"1F635\",\n \"shortnames\": [\n \"dizzy_face\"\n ]\n },\n {\n \"unified\": \"1F92F\",\n \"shortnames\": [\n \"exploding_head\"\n ]\n },\n {\n \"unified\": \"1F920\",\n \"shortnames\": [\n \"face_with_cowboy_hat\"\n ]\n },\n {\n \"unified\": \"1F973\",\n \"shortnames\": [\n \"partying_face\"\n ]\n },\n {\n \"unified\": \"1F978\",\n \"shortnames\": [\n \"disguised_face\"\n ]\n },\n {\n \"unified\": \"1F60E\",\n \"shortnames\": [\n \"sunglasses\"\n ]\n },\n {\n \"unified\": \"1F913\",\n \"shortnames\": [\n \"nerd_face\"\n ]\n },\n {\n \"unified\": \"1F9D0\",\n \"shortnames\": [\n \"face_with_monocle\"\n ]\n },\n {\n \"unified\": \"1F615\",\n \"shortnames\": [\n \"confused\"\n ]\n },\n {\n \"unified\": \"1F61F\",\n \"shortnames\": [\n \"worried\"\n ]\n },\n {\n \"unified\": \"1F641\",\n \"shortnames\": [\n \"slightly_frowning_face\"\n ]\n },\n {\n \"unified\": \"2639-FE0F\",\n \"shortnames\": [\n \"white_frowning_face\"\n ]\n },\n {\n \"unified\": \"1F62E\",\n \"shortnames\": [\n \"open_mouth\"\n ]\n },\n {\n \"unified\": \"1F62F\",\n \"shortnames\": [\n \"hushed\"\n ]\n },\n {\n \"unified\": \"1F632\",\n \"shortnames\": [\n \"astonished\"\n ]\n },\n {\n \"unified\": \"1F633\",\n \"shortnames\": [\n \"flushed\"\n ]\n },\n {\n \"unified\": \"1F97A\",\n \"shortnames\": [\n \"pleading_face\"\n ]\n },\n {\n \"unified\": \"1F626\",\n \"shortnames\": [\n \"frowning\"\n ]\n },\n {\n \"unified\": \"1F627\",\n \"shortnames\": [\n \"anguished\"\n ]\n },\n {\n \"unified\": \"1F628\",\n \"shortnames\": [\n \"fearful\"\n ]\n },\n {\n \"unified\": \"1F630\",\n \"shortnames\": [\n \"cold_sweat\"\n ]\n },\n {\n \"unified\": \"1F625\",\n \"shortnames\": [\n \"disappointed_relieved\"\n ]\n },\n {\n \"unified\": \"1F622\",\n \"shortnames\": [\n \"cry\"\n ]\n },\n {\n \"unified\": \"1F62D\",\n \"shortnames\": [\n \"sob\"\n ]\n },\n {\n \"unified\": \"1F631\",\n \"shortnames\": [\n \"scream\"\n ]\n },\n {\n \"unified\": \"1F616\",\n \"shortnames\": [\n \"confounded\"\n ]\n },\n {\n \"unified\": \"1F623\",\n \"shortnames\": [\n \"persevere\"\n ]\n },\n {\n \"unified\": \"1F61E\",\n \"shortnames\": [\n \"disappointed\"\n ]\n },\n {\n \"unified\": \"1F613\",\n \"shortnames\": [\n \"sweat\"\n ]\n },\n {\n \"unified\": \"1F629\",\n \"shortnames\": [\n \"weary\"\n ]\n },\n {\n \"unified\": \"1F62B\",\n \"shortnames\": [\n \"tired_face\"\n ]\n },\n {\n \"unified\": \"1F971\",\n \"shortnames\": [\n \"yawning_face\"\n ]\n },\n {\n \"unified\": \"1F624\",\n \"shortnames\": [\n \"triumph\"\n ]\n },\n {\n \"unified\": \"1F621\",\n \"shortnames\": [\n \"rage\"\n ]\n },\n {\n \"unified\": \"1F620\",\n \"shortnames\": [\n \"angry\"\n ]\n },\n {\n \"unified\": \"1F92C\",\n \"shortnames\": [\n \"face_with_symbols_on_mouth\"\n ]\n },\n {\n \"unified\": \"1F608\",\n \"shortnames\": [\n \"smiling_imp\"\n ]\n },\n {\n \"unified\": \"1F47F\",\n \"shortnames\": [\n \"imp\"\n ]\n },\n {\n \"unified\": \"1F480\",\n \"shortnames\": [\n \"skull\"\n ]\n },\n {\n \"unified\": \"2620-FE0F\",\n \"shortnames\": [\n \"skull_and_crossbones\"\n ]\n },\n {\n \"unified\": \"1F4A9\",\n \"shortnames\": [\n \"hankey\"\n ]\n },\n {\n \"unified\": \"1F921\",\n \"shortnames\": [\n \"clown_face\"\n ]\n },\n {\n \"unified\": \"1F479\",\n \"shortnames\": [\n \"japanese_ogre\"\n ]\n },\n {\n \"unified\": \"1F47A\",\n \"shortnames\": [\n \"japanese_goblin\"\n ]\n },\n {\n \"unified\": \"1F47B\",\n \"shortnames\": [\n \"ghost\"\n ]\n },\n {\n \"unified\": \"1F47D\",\n \"shortnames\": [\n \"alien\"\n ]\n },\n {\n \"unified\": \"1F47E\",\n \"shortnames\": [\n \"space_invader\"\n ]\n },\n {\n \"unified\": \"1F916\",\n \"shortnames\": [\n \"robot_face\"\n ]\n },\n {\n \"unified\": \"1F63A\",\n \"shortnames\": [\n \"smiley_cat\"\n ]\n },\n {\n \"unified\": \"1F638\",\n \"shortnames\": [\n \"smile_cat\"\n ]\n },\n {\n \"unified\": \"1F639\",\n \"shortnames\": [\n \"joy_cat\"\n ]\n },\n {\n \"unified\": \"1F63B\",\n \"shortnames\": [\n \"heart_eyes_cat\"\n ]\n },\n {\n \"unified\": \"1F63C\",\n \"shortnames\": [\n \"smirk_cat\"\n ]\n },\n {\n \"unified\": \"1F63D\",\n \"shortnames\": [\n \"kissing_cat\"\n ]\n },\n {\n \"unified\": \"1F640\",\n \"shortnames\": [\n \"scream_cat\"\n ]\n },\n {\n \"unified\": \"1F63F\",\n \"shortnames\": [\n \"crying_cat_face\"\n ]\n },\n {\n \"unified\": \"1F63E\",\n \"shortnames\": [\n \"pouting_cat\"\n ]\n },\n {\n \"unified\": \"1F648\",\n \"shortnames\": [\n \"see_no_evil\"\n ]\n },\n {\n \"unified\": \"1F649\",\n \"shortnames\": [\n \"hear_no_evil\"\n ]\n },\n {\n \"unified\": \"1F64A\",\n \"shortnames\": [\n \"speak_no_evil\"\n ]\n },\n {\n \"unified\": \"1F48B\",\n \"shortnames\": [\n \"kiss\"\n ]\n },\n {\n \"unified\": \"1F48C\",\n \"shortnames\": [\n \"love_letter\"\n ]\n },\n {\n \"unified\": \"1F498\",\n \"shortnames\": [\n \"cupid\"\n ]\n },\n {\n \"unified\": \"1F49D\",\n \"shortnames\": [\n \"gift_heart\"\n ]\n },\n {\n \"unified\": \"1F496\",\n \"shortnames\": [\n \"sparkling_heart\"\n ]\n },\n {\n \"unified\": \"1F497\",\n \"shortnames\": [\n \"heartpulse\"\n ]\n },\n {\n \"unified\": \"1F493\",\n \"shortnames\": [\n \"heartbeat\"\n ]\n },\n {\n \"unified\": \"1F49E\",\n \"shortnames\": [\n \"revolving_hearts\"\n ]\n },\n {\n \"unified\": \"1F495\",\n \"shortnames\": [\n \"two_hearts\"\n ]\n },\n {\n \"unified\": \"1F49F\",\n \"shortnames\": [\n \"heart_decoration\"\n ]\n },\n {\n \"unified\": \"2763-FE0F\",\n \"shortnames\": [\n \"heavy_heart_exclamation_mark_ornament\"\n ]\n },\n {\n \"unified\": \"1F494\",\n \"shortnames\": [\n \"broken_heart\"\n ]\n },\n {\n \"unified\": \"2764-FE0F\",\n \"shortnames\": [\n \"heart\"\n ]\n },\n {\n \"unified\": \"1F9E1\",\n \"shortnames\": [\n \"orange_heart\"\n ]\n },\n {\n \"unified\": \"1F49B\",\n \"shortnames\": [\n \"yellow_heart\"\n ]\n },\n {\n \"unified\": \"1F49A\",\n \"shortnames\": [\n \"green_heart\"\n ]\n },\n {\n \"unified\": \"1F499\",\n \"shortnames\": [\n \"blue_heart\"\n ]\n },\n {\n \"unified\": \"1F49C\",\n \"shortnames\": [\n \"purple_heart\"\n ]\n },\n {\n \"unified\": \"1F90E\",\n \"shortnames\": [\n \"brown_heart\"\n ]\n },\n {\n \"unified\": \"1F5A4\",\n \"shortnames\": [\n \"black_heart\"\n ]\n },\n {\n \"unified\": \"1F90D\",\n \"shortnames\": [\n \"white_heart\"\n ]\n },\n {\n \"unified\": \"1F4AF\",\n \"shortnames\": [\n \"100\"\n ]\n },\n {\n \"unified\": \"1F4A2\",\n \"shortnames\": [\n \"anger\"\n ]\n },\n {\n \"unified\": \"1F4A5\",\n \"shortnames\": [\n \"boom\"\n ]\n },\n {\n \"unified\": \"1F4AB\",\n \"shortnames\": [\n \"dizzy\"\n ]\n },\n {\n \"unified\": \"1F4A6\",\n \"shortnames\": [\n \"sweat_drops\"\n ]\n },\n {\n \"unified\": \"1F4A8\",\n \"shortnames\": [\n \"dash\"\n ]\n },\n {\n \"unified\": \"1F573-FE0F\",\n \"shortnames\": [\n \"hole\"\n ]\n },\n {\n \"unified\": \"1F4A3\",\n \"shortnames\": [\n \"bomb\"\n ]\n },\n {\n \"unified\": \"1F4AC\",\n \"shortnames\": [\n \"speech_balloon\"\n ]\n },\n {\n \"unified\": \"1F441-FE0F-200D-1F5E8-FE0F\",\n \"shortnames\": [\n \"eye-in-speech-bubble\"\n ]\n },\n {\n \"unified\": \"1F5E8-FE0F\",\n \"shortnames\": [\n \"left_speech_bubble\"\n ]\n },\n {\n \"unified\": \"1F5EF-FE0F\",\n \"shortnames\": [\n \"right_anger_bubble\"\n ]\n },\n {\n \"unified\": \"1F4AD\",\n \"shortnames\": [\n \"thought_balloon\"\n ]\n },\n {\n \"unified\": \"1F4A4\",\n \"shortnames\": [\n \"zzz\"\n ]\n }\n ]\n },\n {\n \"name\": \"People & Body\",\n \"emojis\": [\n {\n \"unified\": \"1F44B\",\n \"shortnames\": [\n \"wave\"\n ]\n },\n {\n \"unified\": \"1F91A\",\n \"shortnames\": [\n \"raised_back_of_hand\"\n ]\n },\n {\n \"unified\": \"1F590-FE0F\",\n \"shortnames\": [\n \"raised_hand_with_fingers_splayed\"\n ]\n },\n {\n \"unified\": \"270B\",\n \"shortnames\": [\n \"hand\"\n ]\n },\n {\n \"unified\": \"1F596\",\n \"shortnames\": [\n \"spock-hand\"\n ]\n },\n {\n \"unified\": \"1F44C\",\n \"shortnames\": [\n \"ok_hand\"\n ]\n },\n {\n \"unified\": \"1F90C\",\n \"shortnames\": [\n \"pinched_fingers\"\n ]\n },\n {\n \"unified\": \"1F90F\",\n \"shortnames\": [\n \"pinching_hand\"\n ]\n },\n {\n \"unified\": \"270C-FE0F\",\n \"shortnames\": [\n \"v\"\n ]\n },\n {\n \"unified\": \"1F91E\",\n \"shortnames\": [\n \"crossed_fingers\"\n ]\n },\n {\n \"unified\": \"1F91F\",\n \"shortnames\": [\n \"i_love_you_hand_sign\"\n ]\n },\n {\n \"unified\": \"1F918\",\n \"shortnames\": [\n \"the_horns\"\n ]\n },\n {\n \"unified\": \"1F919\",\n \"shortnames\": [\n \"call_me_hand\"\n ]\n },\n {\n \"unified\": \"1F448\",\n \"shortnames\": [\n \"point_left\"\n ]\n },\n {\n \"unified\": \"1F449\",\n \"shortnames\": [\n \"point_right\"\n ]\n },\n {\n \"unified\": \"1F446\",\n \"shortnames\": [\n \"point_up_2\"\n ]\n },\n {\n \"unified\": \"1F595\",\n \"shortnames\": [\n \"middle_finger\"\n ]\n },\n {\n \"unified\": \"1F447\",\n \"shortnames\": [\n \"point_down\"\n ]\n },\n {\n \"unified\": \"261D-FE0F\",\n \"shortnames\": [\n \"point_up\"\n ]\n },\n {\n \"unified\": \"1F44D\",\n \"shortnames\": [\n \"+1\"\n ]\n },\n {\n \"unified\": \"1F44E\",\n \"shortnames\": [\n \"-1\"\n ]\n },\n {\n \"unified\": \"270A\",\n \"shortnames\": [\n \"fist\"\n ]\n },\n {\n \"unified\": \"1F44A\",\n \"shortnames\": [\n \"facepunch\"\n ]\n },\n {\n \"unified\": \"1F91B\",\n \"shortnames\": [\n \"left-facing_fist\"\n ]\n },\n {\n \"unified\": \"1F91C\",\n \"shortnames\": [\n \"right-facing_fist\"\n ]\n },\n {\n \"unified\": \"1F44F\",\n \"shortnames\": [\n \"clap\"\n ]\n },\n {\n \"unified\": \"1F64C\",\n \"shortnames\": [\n \"raised_hands\"\n ]\n },\n {\n \"unified\": \"1F450\",\n \"shortnames\": [\n \"open_hands\"\n ]\n },\n {\n \"unified\": \"1F932\",\n \"shortnames\": [\n \"palms_up_together\"\n ]\n },\n {\n \"unified\": \"1F91D\",\n \"shortnames\": [\n \"handshake\"\n ]\n },\n {\n \"unified\": \"1F64F\",\n \"shortnames\": [\n \"pray\"\n ]\n },\n {\n \"unified\": \"270D-FE0F\",\n \"shortnames\": [\n \"writing_hand\"\n ]\n },\n {\n \"unified\": \"1F485\",\n \"shortnames\": [\n \"nail_care\"\n ]\n },\n {\n \"unified\": \"1F933\",\n \"shortnames\": [\n \"selfie\"\n ]\n },\n {\n \"unified\": \"1F4AA\",\n \"shortnames\": [\n \"muscle\"\n ]\n },\n {\n \"unified\": \"1F9BE\",\n \"shortnames\": [\n \"mechanical_arm\"\n ]\n },\n {\n \"unified\": \"1F9BF\",\n \"shortnames\": [\n \"mechanical_leg\"\n ]\n },\n {\n \"unified\": \"1F9B5\",\n \"shortnames\": [\n \"leg\"\n ]\n },\n {\n \"unified\": \"1F9B6\",\n \"shortnames\": [\n \"foot\"\n ]\n },\n {\n \"unified\": \"1F442\",\n \"shortnames\": [\n \"ear\"\n ]\n },\n {\n \"unified\": \"1F9BB\",\n \"shortnames\": [\n \"ear_with_hearing_aid\"\n ]\n },\n {\n \"unified\": \"1F443\",\n \"shortnames\": [\n \"nose\"\n ]\n },\n {\n \"unified\": \"1F9E0\",\n \"shortnames\": [\n \"brain\"\n ]\n },\n {\n \"unified\": \"1FAC0\",\n \"shortnames\": [\n \"anatomical_heart\"\n ]\n },\n {\n \"unified\": \"1FAC1\",\n \"shortnames\": [\n \"lungs\"\n ]\n },\n {\n \"unified\": \"1F9B7\",\n \"shortnames\": [\n \"tooth\"\n ]\n },\n {\n \"unified\": \"1F9B4\",\n \"shortnames\": [\n \"bone\"\n ]\n },\n {\n \"unified\": \"1F440\",\n \"shortnames\": [\n \"eyes\"\n ]\n },\n {\n \"unified\": \"1F441-FE0F\",\n \"shortnames\": [\n \"eye\"\n ]\n },\n {\n \"unified\": \"1F445\",\n \"shortnames\": [\n \"tongue\"\n ]\n },\n {\n \"unified\": \"1F444\",\n \"shortnames\": [\n \"lips\"\n ]\n },\n {\n \"unified\": \"1F476\",\n \"shortnames\": [\n \"baby\"\n ]\n },\n {\n \"unified\": \"1F9D2\",\n \"shortnames\": [\n \"child\"\n ]\n },\n {\n \"unified\": \"1F466\",\n \"shortnames\": [\n \"boy\"\n ]\n },\n {\n \"unified\": \"1F467\",\n \"shortnames\": [\n \"girl\"\n ]\n },\n {\n \"unified\": \"1F9D1\",\n \"shortnames\": [\n \"adult\"\n ]\n },\n {\n \"unified\": \"1F468\",\n \"shortnames\": [\n \"man\"\n ]\n },\n {\n \"unified\": \"1F9D4\",\n \"shortnames\": [\n \"bearded_person\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9B0\",\n \"shortnames\": [\n \"red_haired_man\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9B1\",\n \"shortnames\": [\n \"curly_haired_man\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9B3\",\n \"shortnames\": [\n \"white_haired_man\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9B2\",\n \"shortnames\": [\n \"bald_man\"\n ]\n },\n {\n \"unified\": \"1F469\",\n \"shortnames\": [\n \"woman\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9B0\",\n \"shortnames\": [\n \"red_haired_woman\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9B0\",\n \"shortnames\": [\n \"red_haired_person\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9B1\",\n \"shortnames\": [\n \"curly_haired_woman\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9B1\",\n \"shortnames\": [\n \"curly_haired_person\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9B3\",\n \"shortnames\": [\n \"white_haired_woman\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9B3\",\n \"shortnames\": [\n \"white_haired_person\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9B2\",\n \"shortnames\": [\n \"bald_woman\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9B2\",\n \"shortnames\": [\n \"bald_person\"\n ]\n },\n {\n \"unified\": \"1F471-200D-2640-FE0F\",\n \"shortnames\": [\n \"blond-haired-woman\"\n ]\n },\n {\n \"unified\": \"1F471-200D-2642-FE0F\",\n \"shortnames\": [\n \"blond-haired-man\",\n \"person_with_blond_hair\"\n ]\n },\n {\n \"unified\": \"1F9D3\",\n \"shortnames\": [\n \"older_adult\"\n ]\n },\n {\n \"unified\": \"1F474\",\n \"shortnames\": [\n \"older_man\"\n ]\n },\n {\n \"unified\": \"1F475\",\n \"shortnames\": [\n \"older_woman\"\n ]\n },\n {\n \"unified\": \"1F64D-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-frowning\"\n ]\n },\n {\n \"unified\": \"1F64D-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-frowning\",\n \"person_frowning\"\n ]\n },\n {\n \"unified\": \"1F64E-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-pouting\"\n ]\n },\n {\n \"unified\": \"1F64E-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-pouting\",\n \"person_with_pouting_face\"\n ]\n },\n {\n \"unified\": \"1F645-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-gesturing-no\"\n ]\n },\n {\n \"unified\": \"1F645-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-gesturing-no\",\n \"no_good\"\n ]\n },\n {\n \"unified\": \"1F646-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-gesturing-ok\"\n ]\n },\n {\n \"unified\": \"1F646-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-gesturing-ok\",\n \"ok_woman\"\n ]\n },\n {\n \"unified\": \"1F481-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-tipping-hand\"\n ]\n },\n {\n \"unified\": \"1F481-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-tipping-hand\",\n \"information_desk_person\"\n ]\n },\n {\n \"unified\": \"1F64B-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-raising-hand\"\n ]\n },\n {\n \"unified\": \"1F64B-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-raising-hand\",\n \"raising_hand\"\n ]\n },\n {\n \"unified\": \"1F9CF\",\n \"shortnames\": [\n \"deaf_person\"\n ]\n },\n {\n \"unified\": \"1F9CF-200D-2642-FE0F\",\n \"shortnames\": [\n \"deaf_man\"\n ]\n },\n {\n \"unified\": \"1F9CF-200D-2640-FE0F\",\n \"shortnames\": [\n \"deaf_woman\"\n ]\n },\n {\n \"unified\": \"1F647-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-bowing\",\n \"bow\"\n ]\n },\n {\n \"unified\": \"1F647-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-bowing\"\n ]\n },\n {\n \"unified\": \"1F926\",\n \"shortnames\": [\n \"face_palm\"\n ]\n },\n {\n \"unified\": \"1F926-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-facepalming\"\n ]\n },\n {\n \"unified\": \"1F926-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-facepalming\"\n ]\n },\n {\n \"unified\": \"1F937\",\n \"shortnames\": [\n \"shrug\"\n ]\n },\n {\n \"unified\": \"1F937-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-shrugging\"\n ]\n },\n {\n \"unified\": \"1F937-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-shrugging\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-2695-FE0F\",\n \"shortnames\": [\n \"health_worker\"\n ]\n },\n {\n \"unified\": \"1F468-200D-2695-FE0F\",\n \"shortnames\": [\n \"male-doctor\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2695-FE0F\",\n \"shortnames\": [\n \"female-doctor\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F393\",\n \"shortnames\": [\n \"student\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F393\",\n \"shortnames\": [\n \"male-student\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F393\",\n \"shortnames\": [\n \"female-student\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F3EB\",\n \"shortnames\": [\n \"teacher\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F3EB\",\n \"shortnames\": [\n \"male-teacher\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F3EB\",\n \"shortnames\": [\n \"female-teacher\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-2696-FE0F\",\n \"shortnames\": [\n \"judge\"\n ]\n },\n {\n \"unified\": \"1F468-200D-2696-FE0F\",\n \"shortnames\": [\n \"male-judge\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2696-FE0F\",\n \"shortnames\": [\n \"female-judge\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F33E\",\n \"shortnames\": [\n \"farmer\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F33E\",\n \"shortnames\": [\n \"male-farmer\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F33E\",\n \"shortnames\": [\n \"female-farmer\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F373\",\n \"shortnames\": [\n \"cook\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F373\",\n \"shortnames\": [\n \"male-cook\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F373\",\n \"shortnames\": [\n \"female-cook\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F527\",\n \"shortnames\": [\n \"mechanic\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F527\",\n \"shortnames\": [\n \"male-mechanic\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F527\",\n \"shortnames\": [\n \"female-mechanic\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F3ED\",\n \"shortnames\": [\n \"factory_worker\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F3ED\",\n \"shortnames\": [\n \"male-factory-worker\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F3ED\",\n \"shortnames\": [\n \"female-factory-worker\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F4BC\",\n \"shortnames\": [\n \"office_worker\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F4BC\",\n \"shortnames\": [\n \"male-office-worker\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F4BC\",\n \"shortnames\": [\n \"female-office-worker\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F52C\",\n \"shortnames\": [\n \"scientist\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F52C\",\n \"shortnames\": [\n \"male-scientist\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F52C\",\n \"shortnames\": [\n \"female-scientist\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F4BB\",\n \"shortnames\": [\n \"technologist\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F4BB\",\n \"shortnames\": [\n \"male-technologist\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F4BB\",\n \"shortnames\": [\n \"female-technologist\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F3A4\",\n \"shortnames\": [\n \"singer\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F3A4\",\n \"shortnames\": [\n \"male-singer\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F3A4\",\n \"shortnames\": [\n \"female-singer\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F3A8\",\n \"shortnames\": [\n \"artist\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F3A8\",\n \"shortnames\": [\n \"male-artist\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F3A8\",\n \"shortnames\": [\n \"female-artist\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-2708-FE0F\",\n \"shortnames\": [\n \"pilot\"\n ]\n },\n {\n \"unified\": \"1F468-200D-2708-FE0F\",\n \"shortnames\": [\n \"male-pilot\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2708-FE0F\",\n \"shortnames\": [\n \"female-pilot\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F680\",\n \"shortnames\": [\n \"astronaut\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F680\",\n \"shortnames\": [\n \"male-astronaut\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F680\",\n \"shortnames\": [\n \"female-astronaut\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F692\",\n \"shortnames\": [\n \"firefighter\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F692\",\n \"shortnames\": [\n \"male-firefighter\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F692\",\n \"shortnames\": [\n \"female-firefighter\"\n ]\n },\n {\n \"unified\": \"1F46E-200D-2642-FE0F\",\n \"shortnames\": [\n \"male-police-officer\",\n \"cop\"\n ]\n },\n {\n \"unified\": \"1F46E-200D-2640-FE0F\",\n \"shortnames\": [\n \"female-police-officer\"\n ]\n },\n {\n \"unified\": \"1F575-FE0F-200D-2642-FE0F\",\n \"shortnames\": [\n \"male-detective\",\n \"sleuth_or_spy\"\n ]\n },\n {\n \"unified\": \"1F575-FE0F-200D-2640-FE0F\",\n \"shortnames\": [\n \"female-detective\"\n ]\n },\n {\n \"unified\": \"1F482-200D-2642-FE0F\",\n \"shortnames\": [\n \"male-guard\",\n \"guardsman\"\n ]\n },\n {\n \"unified\": \"1F482-200D-2640-FE0F\",\n \"shortnames\": [\n \"female-guard\"\n ]\n },\n {\n \"unified\": \"1F977\",\n \"shortnames\": [\n \"ninja\"\n ]\n },\n {\n \"unified\": \"1F477-200D-2642-FE0F\",\n \"shortnames\": [\n \"male-construction-worker\",\n \"construction_worker\"\n ]\n },\n {\n \"unified\": \"1F477-200D-2640-FE0F\",\n \"shortnames\": [\n \"female-construction-worker\"\n ]\n },\n {\n \"unified\": \"1F934\",\n \"shortnames\": [\n \"prince\"\n ]\n },\n {\n \"unified\": \"1F478\",\n \"shortnames\": [\n \"princess\"\n ]\n },\n {\n \"unified\": \"1F473-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-wearing-turban\",\n \"man_with_turban\"\n ]\n },\n {\n \"unified\": \"1F473-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-wearing-turban\"\n ]\n },\n {\n \"unified\": \"1F472\",\n \"shortnames\": [\n \"man_with_gua_pi_mao\"\n ]\n },\n {\n \"unified\": \"1F9D5\",\n \"shortnames\": [\n \"person_with_headscarf\"\n ]\n },\n {\n \"unified\": \"1F935-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_in_tuxedo\"\n ]\n },\n {\n \"unified\": \"1F935-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_in_tuxedo\"\n ]\n },\n {\n \"unified\": \"1F470\",\n \"shortnames\": [\n \"bride_with_veil\"\n ]\n },\n {\n \"unified\": \"1F470-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_with_veil\"\n ]\n },\n {\n \"unified\": \"1F470-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_with_veil\"\n ]\n },\n {\n \"unified\": \"1F930\",\n \"shortnames\": [\n \"pregnant_woman\"\n ]\n },\n {\n \"unified\": \"1F931\",\n \"shortnames\": [\n \"breast-feeding\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F37C\",\n \"shortnames\": [\n \"woman_feeding_baby\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F37C\",\n \"shortnames\": [\n \"man_feeding_baby\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F37C\",\n \"shortnames\": [\n \"person_feeding_baby\"\n ]\n },\n {\n \"unified\": \"1F47C\",\n \"shortnames\": [\n \"angel\"\n ]\n },\n {\n \"unified\": \"1F385\",\n \"shortnames\": [\n \"santa\"\n ]\n },\n {\n \"unified\": \"1F936\",\n \"shortnames\": [\n \"mrs_claus\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F384\",\n \"shortnames\": [\n \"mx_claus\"\n ]\n },\n {\n \"unified\": \"1F9B8\",\n \"shortnames\": [\n \"superhero\"\n ]\n },\n {\n \"unified\": \"1F9B8-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_superhero\"\n ]\n },\n {\n \"unified\": \"1F9B8-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_superhero\"\n ]\n },\n {\n \"unified\": \"1F9B9\",\n \"shortnames\": [\n \"supervillain\"\n ]\n },\n {\n \"unified\": \"1F9B9-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_supervillain\"\n ]\n },\n {\n \"unified\": \"1F9B9-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_supervillain\"\n ]\n },\n {\n \"unified\": \"1F9D9-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_mage\"\n ]\n },\n {\n \"unified\": \"1F9D9-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_mage\",\n \"mage\"\n ]\n },\n {\n \"unified\": \"1F9DA-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_fairy\"\n ]\n },\n {\n \"unified\": \"1F9DA-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_fairy\",\n \"fairy\"\n ]\n },\n {\n \"unified\": \"1F9DB-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_vampire\"\n ]\n },\n {\n \"unified\": \"1F9DB-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_vampire\",\n \"vampire\"\n ]\n },\n {\n \"unified\": \"1F9DC-200D-2642-FE0F\",\n \"shortnames\": [\n \"merman\",\n \"merperson\"\n ]\n },\n {\n \"unified\": \"1F9DC-200D-2640-FE0F\",\n \"shortnames\": [\n \"mermaid\"\n ]\n },\n {\n \"unified\": \"1F9DD-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_elf\",\n \"elf\"\n ]\n },\n {\n \"unified\": \"1F9DD-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_elf\"\n ]\n },\n {\n \"unified\": \"1F9DE-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_genie\",\n \"genie\"\n ]\n },\n {\n \"unified\": \"1F9DE-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_genie\"\n ]\n },\n {\n \"unified\": \"1F9DF-200D-2642-FE0F\",\n \"shortnames\": [\n \"male_zombie\",\n \"zombie\"\n ]\n },\n {\n \"unified\": \"1F9DF-200D-2640-FE0F\",\n \"shortnames\": [\n \"female_zombie\"\n ]\n },\n {\n \"unified\": \"1F486-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-getting-massage\"\n ]\n },\n {\n \"unified\": \"1F486-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-getting-massage\",\n \"massage\"\n ]\n },\n {\n \"unified\": \"1F487-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-getting-haircut\"\n ]\n },\n {\n \"unified\": \"1F487-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-getting-haircut\",\n \"haircut\"\n ]\n },\n {\n \"unified\": \"1F6B6-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-walking\",\n \"walking\"\n ]\n },\n {\n \"unified\": \"1F6B6-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-walking\"\n ]\n },\n {\n \"unified\": \"1F9CD\",\n \"shortnames\": [\n \"standing_person\"\n ]\n },\n {\n \"unified\": \"1F9CD-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_standing\"\n ]\n },\n {\n \"unified\": \"1F9CD-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_standing\"\n ]\n },\n {\n \"unified\": \"1F9CE\",\n \"shortnames\": [\n \"kneeling_person\"\n ]\n },\n {\n \"unified\": \"1F9CE-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_kneeling\"\n ]\n },\n {\n \"unified\": \"1F9CE-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_kneeling\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9AF\",\n \"shortnames\": [\n \"person_with_probing_cane\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9AF\",\n \"shortnames\": [\n \"man_with_probing_cane\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9AF\",\n \"shortnames\": [\n \"woman_with_probing_cane\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9BC\",\n \"shortnames\": [\n \"person_in_motorized_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9BC\",\n \"shortnames\": [\n \"man_in_motorized_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9BC\",\n \"shortnames\": [\n \"woman_in_motorized_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F9BD\",\n \"shortnames\": [\n \"person_in_manual_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F9BD\",\n \"shortnames\": [\n \"man_in_manual_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F9BD\",\n \"shortnames\": [\n \"woman_in_manual_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F3C3-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-running\",\n \"runner\"\n ]\n },\n {\n \"unified\": \"1F3C3-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-running\"\n ]\n },\n {\n \"unified\": \"1F483\",\n \"shortnames\": [\n \"dancer\"\n ]\n },\n {\n \"unified\": \"1F57A\",\n \"shortnames\": [\n \"man_dancing\"\n ]\n },\n {\n \"unified\": \"1F574-FE0F\",\n \"shortnames\": [\n \"man_in_business_suit_levitating\"\n ]\n },\n {\n \"unified\": \"1F46F-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-with-bunny-ears-partying\"\n ]\n },\n {\n \"unified\": \"1F46F-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-with-bunny-ears-partying\",\n \"dancers\"\n ]\n },\n {\n \"unified\": \"1F9D6-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_in_steamy_room\",\n \"person_in_steamy_room\"\n ]\n },\n {\n \"unified\": \"1F9D6-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_in_steamy_room\"\n ]\n },\n {\n \"unified\": \"1F9D7-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_climbing\"\n ]\n },\n {\n \"unified\": \"1F9D7-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_climbing\",\n \"person_climbing\"\n ]\n },\n {\n \"unified\": \"1F93A\",\n \"shortnames\": [\n \"fencer\"\n ]\n },\n {\n \"unified\": \"1F3C7\",\n \"shortnames\": [\n \"horse_racing\"\n ]\n },\n {\n \"unified\": \"26F7-FE0F\",\n \"shortnames\": [\n \"skier\"\n ]\n },\n {\n \"unified\": \"1F3C2\",\n \"shortnames\": [\n \"snowboarder\"\n ]\n },\n {\n \"unified\": \"1F3CC-FE0F-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-golfing\",\n \"golfer\"\n ]\n },\n {\n \"unified\": \"1F3CC-FE0F-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-golfing\"\n ]\n },\n {\n \"unified\": \"1F3C4-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-surfing\",\n \"surfer\"\n ]\n },\n {\n \"unified\": \"1F3C4-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-surfing\"\n ]\n },\n {\n \"unified\": \"1F6A3-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-rowing-boat\",\n \"rowboat\"\n ]\n },\n {\n \"unified\": \"1F6A3-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-rowing-boat\"\n ]\n },\n {\n \"unified\": \"1F3CA-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-swimming\",\n \"swimmer\"\n ]\n },\n {\n \"unified\": \"1F3CA-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-swimming\"\n ]\n },\n {\n \"unified\": \"26F9-FE0F-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-bouncing-ball\",\n \"person_with_ball\"\n ]\n },\n {\n \"unified\": \"26F9-FE0F-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-bouncing-ball\"\n ]\n },\n {\n \"unified\": \"1F3CB-FE0F-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-lifting-weights\",\n \"weight_lifter\"\n ]\n },\n {\n \"unified\": \"1F3CB-FE0F-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-lifting-weights\"\n ]\n },\n {\n \"unified\": \"1F6B4-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-biking\",\n \"bicyclist\"\n ]\n },\n {\n \"unified\": \"1F6B4-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-biking\"\n ]\n },\n {\n \"unified\": \"1F6B5-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-mountain-biking\",\n \"mountain_bicyclist\"\n ]\n },\n {\n \"unified\": \"1F6B5-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-mountain-biking\"\n ]\n },\n {\n \"unified\": \"1F938\",\n \"shortnames\": [\n \"person_doing_cartwheel\"\n ]\n },\n {\n \"unified\": \"1F938-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-cartwheeling\"\n ]\n },\n {\n \"unified\": \"1F938-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-cartwheeling\"\n ]\n },\n {\n \"unified\": \"1F93C\",\n \"shortnames\": [\n \"wrestlers\"\n ]\n },\n {\n \"unified\": \"1F93C-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-wrestling\"\n ]\n },\n {\n \"unified\": \"1F93C-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-wrestling\"\n ]\n },\n {\n \"unified\": \"1F93D\",\n \"shortnames\": [\n \"water_polo\"\n ]\n },\n {\n \"unified\": \"1F93D-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-playing-water-polo\"\n ]\n },\n {\n \"unified\": \"1F93D-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-playing-water-polo\"\n ]\n },\n {\n \"unified\": \"1F93E\",\n \"shortnames\": [\n \"handball\"\n ]\n },\n {\n \"unified\": \"1F93E-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-playing-handball\"\n ]\n },\n {\n \"unified\": \"1F93E-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-playing-handball\"\n ]\n },\n {\n \"unified\": \"1F939\",\n \"shortnames\": [\n \"juggling\"\n ]\n },\n {\n \"unified\": \"1F939-200D-2642-FE0F\",\n \"shortnames\": [\n \"man-juggling\"\n ]\n },\n {\n \"unified\": \"1F939-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman-juggling\"\n ]\n },\n {\n \"unified\": \"1F9D8-200D-2642-FE0F\",\n \"shortnames\": [\n \"man_in_lotus_position\"\n ]\n },\n {\n \"unified\": \"1F9D8-200D-2640-FE0F\",\n \"shortnames\": [\n \"woman_in_lotus_position\",\n \"person_in_lotus_position\"\n ]\n },\n {\n \"unified\": \"1F6C0\",\n \"shortnames\": [\n \"bath\"\n ]\n },\n {\n \"unified\": \"1F6CC\",\n \"shortnames\": [\n \"sleeping_accommodation\"\n ]\n },\n {\n \"unified\": \"1F9D1-200D-1F91D-200D-1F9D1\",\n \"shortnames\": [\n \"people_holding_hands\"\n ]\n },\n {\n \"unified\": \"1F46D\",\n \"shortnames\": [\n \"two_women_holding_hands\"\n ]\n },\n {\n \"unified\": \"1F46B\",\n \"shortnames\": [\n \"couple\"\n ]\n },\n {\n \"unified\": \"1F46C\",\n \"shortnames\": [\n \"two_men_holding_hands\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2764-FE0F-200D-1F48B-200D-1F468\",\n \"shortnames\": [\n \"woman-kiss-man\",\n \"couplekiss\"\n ]\n },\n {\n \"unified\": \"1F468-200D-2764-FE0F-200D-1F48B-200D-1F468\",\n \"shortnames\": [\n \"man-kiss-man\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2764-FE0F-200D-1F48B-200D-1F469\",\n \"shortnames\": [\n \"woman-kiss-woman\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2764-FE0F-200D-1F468\",\n \"shortnames\": [\n \"woman-heart-man\",\n \"couple_with_heart\"\n ]\n },\n {\n \"unified\": \"1F468-200D-2764-FE0F-200D-1F468\",\n \"shortnames\": [\n \"man-heart-man\"\n ]\n },\n {\n \"unified\": \"1F469-200D-2764-FE0F-200D-1F469\",\n \"shortnames\": [\n \"woman-heart-woman\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F469-200D-1F466\",\n \"shortnames\": [\n \"man-woman-boy\",\n \"family\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F469-200D-1F467\",\n \"shortnames\": [\n \"man-woman-girl\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F469-200D-1F467-200D-1F466\",\n \"shortnames\": [\n \"man-woman-girl-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F469-200D-1F466-200D-1F466\",\n \"shortnames\": [\n \"man-woman-boy-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F469-200D-1F467-200D-1F467\",\n \"shortnames\": [\n \"man-woman-girl-girl\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F468-200D-1F466\",\n \"shortnames\": [\n \"man-man-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F468-200D-1F467\",\n \"shortnames\": [\n \"man-man-girl\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F468-200D-1F467-200D-1F466\",\n \"shortnames\": [\n \"man-man-girl-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F468-200D-1F466-200D-1F466\",\n \"shortnames\": [\n \"man-man-boy-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F468-200D-1F467-200D-1F467\",\n \"shortnames\": [\n \"man-man-girl-girl\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F469-200D-1F466\",\n \"shortnames\": [\n \"woman-woman-boy\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F469-200D-1F467\",\n \"shortnames\": [\n \"woman-woman-girl\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F469-200D-1F467-200D-1F466\",\n \"shortnames\": [\n \"woman-woman-girl-boy\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F469-200D-1F466-200D-1F466\",\n \"shortnames\": [\n \"woman-woman-boy-boy\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F469-200D-1F467-200D-1F467\",\n \"shortnames\": [\n \"woman-woman-girl-girl\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F466\",\n \"shortnames\": [\n \"man-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F466-200D-1F466\",\n \"shortnames\": [\n \"man-boy-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F467\",\n \"shortnames\": [\n \"man-girl\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F467-200D-1F466\",\n \"shortnames\": [\n \"man-girl-boy\"\n ]\n },\n {\n \"unified\": \"1F468-200D-1F467-200D-1F467\",\n \"shortnames\": [\n \"man-girl-girl\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F466\",\n \"shortnames\": [\n \"woman-boy\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F466-200D-1F466\",\n \"shortnames\": [\n \"woman-boy-boy\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F467\",\n \"shortnames\": [\n \"woman-girl\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F467-200D-1F466\",\n \"shortnames\": [\n \"woman-girl-boy\"\n ]\n },\n {\n \"unified\": \"1F469-200D-1F467-200D-1F467\",\n \"shortnames\": [\n \"woman-girl-girl\"\n ]\n },\n {\n \"unified\": \"1F5E3-FE0F\",\n \"shortnames\": [\n \"speaking_head_in_silhouette\"\n ]\n },\n {\n \"unified\": \"1F464\",\n \"shortnames\": [\n \"bust_in_silhouette\"\n ]\n },\n {\n \"unified\": \"1F465\",\n \"shortnames\": [\n \"busts_in_silhouette\"\n ]\n },\n {\n \"unified\": \"1FAC2\",\n \"shortnames\": [\n \"people_hugging\"\n ]\n },\n {\n \"unified\": \"1F463\",\n \"shortnames\": [\n \"footprints\"\n ]\n },\n {\n \"unified\": \"1F935\",\n \"shortnames\": [\n \"man_in_tuxedo\"\n ]\n }\n ]\n },\n {\n \"name\": \"Animals & Nature\",\n \"emojis\": [\n {\n \"unified\": \"1F435\",\n \"shortnames\": [\n \"monkey_face\"\n ]\n },\n {\n \"unified\": \"1F412\",\n \"shortnames\": [\n \"monkey\"\n ]\n },\n {\n \"unified\": \"1F98D\",\n \"shortnames\": [\n \"gorilla\"\n ]\n },\n {\n \"unified\": \"1F9A7\",\n \"shortnames\": [\n \"orangutan\"\n ]\n },\n {\n \"unified\": \"1F436\",\n \"shortnames\": [\n \"dog\"\n ]\n },\n {\n \"unified\": \"1F415\",\n \"shortnames\": [\n \"dog2\"\n ]\n },\n {\n \"unified\": \"1F9AE\",\n \"shortnames\": [\n \"guide_dog\"\n ]\n },\n {\n \"unified\": \"1F415-200D-1F9BA\",\n \"shortnames\": [\n \"service_dog\"\n ]\n },\n {\n \"unified\": \"1F429\",\n \"shortnames\": [\n \"poodle\"\n ]\n },\n {\n \"unified\": \"1F43A\",\n \"shortnames\": [\n \"wolf\"\n ]\n },\n {\n \"unified\": \"1F98A\",\n \"shortnames\": [\n \"fox_face\"\n ]\n },\n {\n \"unified\": \"1F99D\",\n \"shortnames\": [\n \"raccoon\"\n ]\n },\n {\n \"unified\": \"1F431\",\n \"shortnames\": [\n \"cat\"\n ]\n },\n {\n \"unified\": \"1F408\",\n \"shortnames\": [\n \"cat2\"\n ]\n },\n {\n \"unified\": \"1F408-200D-2B1B\",\n \"shortnames\": [\n \"black_cat\"\n ]\n },\n {\n \"unified\": \"1F981\",\n \"shortnames\": [\n \"lion_face\"\n ]\n },\n {\n \"unified\": \"1F42F\",\n \"shortnames\": [\n \"tiger\"\n ]\n },\n {\n \"unified\": \"1F405\",\n \"shortnames\": [\n \"tiger2\"\n ]\n },\n {\n \"unified\": \"1F406\",\n \"shortnames\": [\n \"leopard\"\n ]\n },\n {\n \"unified\": \"1F434\",\n \"shortnames\": [\n \"horse\"\n ]\n },\n {\n \"unified\": \"1F40E\",\n \"shortnames\": [\n \"racehorse\"\n ]\n },\n {\n \"unified\": \"1F984\",\n \"shortnames\": [\n \"unicorn_face\"\n ]\n },\n {\n \"unified\": \"1F993\",\n \"shortnames\": [\n \"zebra_face\"\n ]\n },\n {\n \"unified\": \"1F98C\",\n \"shortnames\": [\n \"deer\"\n ]\n },\n {\n \"unified\": \"1F9AC\",\n \"shortnames\": [\n \"bison\"\n ]\n },\n {\n \"unified\": \"1F42E\",\n \"shortnames\": [\n \"cow\"\n ]\n },\n {\n \"unified\": \"1F402\",\n \"shortnames\": [\n \"ox\"\n ]\n },\n {\n \"unified\": \"1F403\",\n \"shortnames\": [\n \"water_buffalo\"\n ]\n },\n {\n \"unified\": \"1F404\",\n \"shortnames\": [\n \"cow2\"\n ]\n },\n {\n \"unified\": \"1F437\",\n \"shortnames\": [\n \"pig\"\n ]\n },\n {\n \"unified\": \"1F416\",\n \"shortnames\": [\n \"pig2\"\n ]\n },\n {\n \"unified\": \"1F417\",\n \"shortnames\": [\n \"boar\"\n ]\n },\n {\n \"unified\": \"1F43D\",\n \"shortnames\": [\n \"pig_nose\"\n ]\n },\n {\n \"unified\": \"1F40F\",\n \"shortnames\": [\n \"ram\"\n ]\n },\n {\n \"unified\": \"1F411\",\n \"shortnames\": [\n \"sheep\"\n ]\n },\n {\n \"unified\": \"1F410\",\n \"shortnames\": [\n \"goat\"\n ]\n },\n {\n \"unified\": \"1F42A\",\n \"shortnames\": [\n \"dromedary_camel\"\n ]\n },\n {\n \"unified\": \"1F42B\",\n \"shortnames\": [\n \"camel\"\n ]\n },\n {\n \"unified\": \"1F999\",\n \"shortnames\": [\n \"llama\"\n ]\n },\n {\n \"unified\": \"1F992\",\n \"shortnames\": [\n \"giraffe_face\"\n ]\n },\n {\n \"unified\": \"1F418\",\n \"shortnames\": [\n \"elephant\"\n ]\n },\n {\n \"unified\": \"1F9A3\",\n \"shortnames\": [\n \"mammoth\"\n ]\n },\n {\n \"unified\": \"1F98F\",\n \"shortnames\": [\n \"rhinoceros\"\n ]\n },\n {\n \"unified\": \"1F99B\",\n \"shortnames\": [\n \"hippopotamus\"\n ]\n },\n {\n \"unified\": \"1F42D\",\n \"shortnames\": [\n \"mouse\"\n ]\n },\n {\n \"unified\": \"1F401\",\n \"shortnames\": [\n \"mouse2\"\n ]\n },\n {\n \"unified\": \"1F400\",\n \"shortnames\": [\n \"rat\"\n ]\n },\n {\n \"unified\": \"1F439\",\n \"shortnames\": [\n \"hamster\"\n ]\n },\n {\n \"unified\": \"1F430\",\n \"shortnames\": [\n \"rabbit\"\n ]\n },\n {\n \"unified\": \"1F407\",\n \"shortnames\": [\n \"rabbit2\"\n ]\n },\n {\n \"unified\": \"1F43F-FE0F\",\n \"shortnames\": [\n \"chipmunk\"\n ]\n },\n {\n \"unified\": \"1F9AB\",\n \"shortnames\": [\n \"beaver\"\n ]\n },\n {\n \"unified\": \"1F994\",\n \"shortnames\": [\n \"hedgehog\"\n ]\n },\n {\n \"unified\": \"1F987\",\n \"shortnames\": [\n \"bat\"\n ]\n },\n {\n \"unified\": \"1F43B\",\n \"shortnames\": [\n \"bear\"\n ]\n },\n {\n \"unified\": \"1F43B-200D-2744-FE0F\",\n \"shortnames\": [\n \"polar_bear\"\n ]\n },\n {\n \"unified\": \"1F428\",\n \"shortnames\": [\n \"koala\"\n ]\n },\n {\n \"unified\": \"1F43C\",\n \"shortnames\": [\n \"panda_face\"\n ]\n },\n {\n \"unified\": \"1F9A5\",\n \"shortnames\": [\n \"sloth\"\n ]\n },\n {\n \"unified\": \"1F9A6\",\n \"shortnames\": [\n \"otter\"\n ]\n },\n {\n \"unified\": \"1F9A8\",\n \"shortnames\": [\n \"skunk\"\n ]\n },\n {\n \"unified\": \"1F998\",\n \"shortnames\": [\n \"kangaroo\"\n ]\n },\n {\n \"unified\": \"1F9A1\",\n \"shortnames\": [\n \"badger\"\n ]\n },\n {\n \"unified\": \"1F43E\",\n \"shortnames\": [\n \"feet\"\n ]\n },\n {\n \"unified\": \"1F983\",\n \"shortnames\": [\n \"turkey\"\n ]\n },\n {\n \"unified\": \"1F414\",\n \"shortnames\": [\n \"chicken\"\n ]\n },\n {\n \"unified\": \"1F413\",\n \"shortnames\": [\n \"rooster\"\n ]\n },\n {\n \"unified\": \"1F423\",\n \"shortnames\": [\n \"hatching_chick\"\n ]\n },\n {\n \"unified\": \"1F424\",\n \"shortnames\": [\n \"baby_chick\"\n ]\n },\n {\n \"unified\": \"1F425\",\n \"shortnames\": [\n \"hatched_chick\"\n ]\n },\n {\n \"unified\": \"1F426\",\n \"shortnames\": [\n \"bird\"\n ]\n },\n {\n \"unified\": \"1F427\",\n \"shortnames\": [\n \"penguin\"\n ]\n },\n {\n \"unified\": \"1F54A-FE0F\",\n \"shortnames\": [\n \"dove_of_peace\"\n ]\n },\n {\n \"unified\": \"1F985\",\n \"shortnames\": [\n \"eagle\"\n ]\n },\n {\n \"unified\": \"1F986\",\n \"shortnames\": [\n \"duck\"\n ]\n },\n {\n \"unified\": \"1F9A2\",\n \"shortnames\": [\n \"swan\"\n ]\n },\n {\n \"unified\": \"1F989\",\n \"shortnames\": [\n \"owl\"\n ]\n },\n {\n \"unified\": \"1F9A4\",\n \"shortnames\": [\n \"dodo\"\n ]\n },\n {\n \"unified\": \"1FAB6\",\n \"shortnames\": [\n \"feather\"\n ]\n },\n {\n \"unified\": \"1F9A9\",\n \"shortnames\": [\n \"flamingo\"\n ]\n },\n {\n \"unified\": \"1F99A\",\n \"shortnames\": [\n \"peacock\"\n ]\n },\n {\n \"unified\": \"1F99C\",\n \"shortnames\": [\n \"parrot\"\n ]\n },\n {\n \"unified\": \"1F438\",\n \"shortnames\": [\n \"frog\"\n ]\n },\n {\n \"unified\": \"1F40A\",\n \"shortnames\": [\n \"crocodile\"\n ]\n },\n {\n \"unified\": \"1F422\",\n \"shortnames\": [\n \"turtle\"\n ]\n },\n {\n \"unified\": \"1F98E\",\n \"shortnames\": [\n \"lizard\"\n ]\n },\n {\n \"unified\": \"1F40D\",\n \"shortnames\": [\n \"snake\"\n ]\n },\n {\n \"unified\": \"1F432\",\n \"shortnames\": [\n \"dragon_face\"\n ]\n },\n {\n \"unified\": \"1F409\",\n \"shortnames\": [\n \"dragon\"\n ]\n },\n {\n \"unified\": \"1F995\",\n \"shortnames\": [\n \"sauropod\"\n ]\n },\n {\n \"unified\": \"1F996\",\n \"shortnames\": [\n \"t-rex\"\n ]\n },\n {\n \"unified\": \"1F433\",\n \"shortnames\": [\n \"whale\"\n ]\n },\n {\n \"unified\": \"1F40B\",\n \"shortnames\": [\n \"whale2\"\n ]\n },\n {\n \"unified\": \"1F42C\",\n \"shortnames\": [\n \"dolphin\"\n ]\n },\n {\n \"unified\": \"1F9AD\",\n \"shortnames\": [\n \"seal\"\n ]\n },\n {\n \"unified\": \"1F41F\",\n \"shortnames\": [\n \"fish\"\n ]\n },\n {\n \"unified\": \"1F420\",\n \"shortnames\": [\n \"tropical_fish\"\n ]\n },\n {\n \"unified\": \"1F421\",\n \"shortnames\": [\n \"blowfish\"\n ]\n },\n {\n \"unified\": \"1F988\",\n \"shortnames\": [\n \"shark\"\n ]\n },\n {\n \"unified\": \"1F419\",\n \"shortnames\": [\n \"octopus\"\n ]\n },\n {\n \"unified\": \"1F41A\",\n \"shortnames\": [\n \"shell\"\n ]\n },\n {\n \"unified\": \"1F40C\",\n \"shortnames\": [\n \"snail\"\n ]\n },\n {\n \"unified\": \"1F98B\",\n \"shortnames\": [\n \"butterfly\"\n ]\n },\n {\n \"unified\": \"1F41B\",\n \"shortnames\": [\n \"bug\"\n ]\n },\n {\n \"unified\": \"1F41C\",\n \"shortnames\": [\n \"ant\"\n ]\n },\n {\n \"unified\": \"1F41D\",\n \"shortnames\": [\n \"bee\"\n ]\n },\n {\n \"unified\": \"1FAB2\",\n \"shortnames\": [\n \"beetle\"\n ]\n },\n {\n \"unified\": \"1F997\",\n \"shortnames\": [\n \"cricket\"\n ]\n },\n {\n \"unified\": \"1FAB3\",\n \"shortnames\": [\n \"cockroach\"\n ]\n },\n {\n \"unified\": \"1F577-FE0F\",\n \"shortnames\": [\n \"spider\"\n ]\n },\n {\n \"unified\": \"1F578-FE0F\",\n \"shortnames\": [\n \"spider_web\"\n ]\n },\n {\n \"unified\": \"1F982\",\n \"shortnames\": [\n \"scorpion\"\n ]\n },\n {\n \"unified\": \"1F99F\",\n \"shortnames\": [\n \"mosquito\"\n ]\n },\n {\n \"unified\": \"1FAB0\",\n \"shortnames\": [\n \"fly\"\n ]\n },\n {\n \"unified\": \"1FAB1\",\n \"shortnames\": [\n \"worm\"\n ]\n },\n {\n \"unified\": \"1F9A0\",\n \"shortnames\": [\n \"microbe\"\n ]\n },\n {\n \"unified\": \"1F490\",\n \"shortnames\": [\n \"bouquet\"\n ]\n },\n {\n \"unified\": \"1F338\",\n \"shortnames\": [\n \"cherry_blossom\"\n ]\n },\n {\n \"unified\": \"1F4AE\",\n \"shortnames\": [\n \"white_flower\"\n ]\n },\n {\n \"unified\": \"1F3F5-FE0F\",\n \"shortnames\": [\n \"rosette\"\n ]\n },\n {\n \"unified\": \"1F339\",\n \"shortnames\": [\n \"rose\"\n ]\n },\n {\n \"unified\": \"1F940\",\n \"shortnames\": [\n \"wilted_flower\"\n ]\n },\n {\n \"unified\": \"1F33A\",\n \"shortnames\": [\n \"hibiscus\"\n ]\n },\n {\n \"unified\": \"1F33B\",\n \"shortnames\": [\n \"sunflower\"\n ]\n },\n {\n \"unified\": \"1F33C\",\n \"shortnames\": [\n \"blossom\"\n ]\n },\n {\n \"unified\": \"1F337\",\n \"shortnames\": [\n \"tulip\"\n ]\n },\n {\n \"unified\": \"1F331\",\n \"shortnames\": [\n \"seedling\"\n ]\n },\n {\n \"unified\": \"1FAB4\",\n \"shortnames\": [\n \"potted_plant\"\n ]\n },\n {\n \"unified\": \"1F332\",\n \"shortnames\": [\n \"evergreen_tree\"\n ]\n },\n {\n \"unified\": \"1F333\",\n \"shortnames\": [\n \"deciduous_tree\"\n ]\n },\n {\n \"unified\": \"1F334\",\n \"shortnames\": [\n \"palm_tree\"\n ]\n },\n {\n \"unified\": \"1F335\",\n \"shortnames\": [\n \"cactus\"\n ]\n },\n {\n \"unified\": \"1F33E\",\n \"shortnames\": [\n \"ear_of_rice\"\n ]\n },\n {\n \"unified\": \"1F33F\",\n \"shortnames\": [\n \"herb\"\n ]\n },\n {\n \"unified\": \"2618-FE0F\",\n \"shortnames\": [\n \"shamrock\"\n ]\n },\n {\n \"unified\": \"1F340\",\n \"shortnames\": [\n \"four_leaf_clover\"\n ]\n },\n {\n \"unified\": \"1F341\",\n \"shortnames\": [\n \"maple_leaf\"\n ]\n },\n {\n \"unified\": \"1F342\",\n \"shortnames\": [\n \"fallen_leaf\"\n ]\n },\n {\n \"unified\": \"1F343\",\n \"shortnames\": [\n \"leaves\"\n ]\n },\n {\n \"unified\": \"1F41E\",\n \"shortnames\": [\n \"beetle\"\n ]\n }\n ]\n },\n {\n \"name\": \"Food & Drink\",\n \"emojis\": [\n {\n \"unified\": \"1F347\",\n \"shortnames\": [\n \"grapes\"\n ]\n },\n {\n \"unified\": \"1F348\",\n \"shortnames\": [\n \"melon\"\n ]\n },\n {\n \"unified\": \"1F349\",\n \"shortnames\": [\n \"watermelon\"\n ]\n },\n {\n \"unified\": \"1F34A\",\n \"shortnames\": [\n \"tangerine\"\n ]\n },\n {\n \"unified\": \"1F34B\",\n \"shortnames\": [\n \"lemon\"\n ]\n },\n {\n \"unified\": \"1F34C\",\n \"shortnames\": [\n \"banana\"\n ]\n },\n {\n \"unified\": \"1F34D\",\n \"shortnames\": [\n \"pineapple\"\n ]\n },\n {\n \"unified\": \"1F96D\",\n \"shortnames\": [\n \"mango\"\n ]\n },\n {\n \"unified\": \"1F34E\",\n \"shortnames\": [\n \"apple\"\n ]\n },\n {\n \"unified\": \"1F34F\",\n \"shortnames\": [\n \"green_apple\"\n ]\n },\n {\n \"unified\": \"1F350\",\n \"shortnames\": [\n \"pear\"\n ]\n },\n {\n \"unified\": \"1F351\",\n \"shortnames\": [\n \"peach\"\n ]\n },\n {\n \"unified\": \"1F352\",\n \"shortnames\": [\n \"cherries\"\n ]\n },\n {\n \"unified\": \"1F353\",\n \"shortnames\": [\n \"strawberry\"\n ]\n },\n {\n \"unified\": \"1FAD0\",\n \"shortnames\": [\n \"blueberries\"\n ]\n },\n {\n \"unified\": \"1F95D\",\n \"shortnames\": [\n \"kiwifruit\"\n ]\n },\n {\n \"unified\": \"1F345\",\n \"shortnames\": [\n \"tomato\"\n ]\n },\n {\n \"unified\": \"1FAD2\",\n \"shortnames\": [\n \"olive\"\n ]\n },\n {\n \"unified\": \"1F965\",\n \"shortnames\": [\n \"coconut\"\n ]\n },\n {\n \"unified\": \"1F951\",\n \"shortnames\": [\n \"avocado\"\n ]\n },\n {\n \"unified\": \"1F346\",\n \"shortnames\": [\n \"eggplant\"\n ]\n },\n {\n \"unified\": \"1F954\",\n \"shortnames\": [\n \"potato\"\n ]\n },\n {\n \"unified\": \"1F955\",\n \"shortnames\": [\n \"carrot\"\n ]\n },\n {\n \"unified\": \"1F33D\",\n \"shortnames\": [\n \"corn\"\n ]\n },\n {\n \"unified\": \"1F336-FE0F\",\n \"shortnames\": [\n \"hot_pepper\"\n ]\n },\n {\n \"unified\": \"1FAD1\",\n \"shortnames\": [\n \"bell_pepper\"\n ]\n },\n {\n \"unified\": \"1F952\",\n \"shortnames\": [\n \"cucumber\"\n ]\n },\n {\n \"unified\": \"1F96C\",\n \"shortnames\": [\n \"leafy_green\"\n ]\n },\n {\n \"unified\": \"1F966\",\n \"shortnames\": [\n \"broccoli\"\n ]\n },\n {\n \"unified\": \"1F9C4\",\n \"shortnames\": [\n \"garlic\"\n ]\n },\n {\n \"unified\": \"1F9C5\",\n \"shortnames\": [\n \"onion\"\n ]\n },\n {\n \"unified\": \"1F344\",\n \"shortnames\": [\n \"mushroom\"\n ]\n },\n {\n \"unified\": \"1F95C\",\n \"shortnames\": [\n \"peanuts\"\n ]\n },\n {\n \"unified\": \"1F330\",\n \"shortnames\": [\n \"chestnut\"\n ]\n },\n {\n \"unified\": \"1F35E\",\n \"shortnames\": [\n \"bread\"\n ]\n },\n {\n \"unified\": \"1F950\",\n \"shortnames\": [\n \"croissant\"\n ]\n },\n {\n \"unified\": \"1F956\",\n \"shortnames\": [\n \"baguette_bread\"\n ]\n },\n {\n \"unified\": \"1FAD3\",\n \"shortnames\": [\n \"flatbread\"\n ]\n },\n {\n \"unified\": \"1F968\",\n \"shortnames\": [\n \"pretzel\"\n ]\n },\n {\n \"unified\": \"1F96F\",\n \"shortnames\": [\n \"bagel\"\n ]\n },\n {\n \"unified\": \"1F95E\",\n \"shortnames\": [\n \"pancakes\"\n ]\n },\n {\n \"unified\": \"1F9C7\",\n \"shortnames\": [\n \"waffle\"\n ]\n },\n {\n \"unified\": \"1F9C0\",\n \"shortnames\": [\n \"cheese_wedge\"\n ]\n },\n {\n \"unified\": \"1F356\",\n \"shortnames\": [\n \"meat_on_bone\"\n ]\n },\n {\n \"unified\": \"1F357\",\n \"shortnames\": [\n \"poultry_leg\"\n ]\n },\n {\n \"unified\": \"1F969\",\n \"shortnames\": [\n \"cut_of_meat\"\n ]\n },\n {\n \"unified\": \"1F953\",\n \"shortnames\": [\n \"bacon\"\n ]\n },\n {\n \"unified\": \"1F354\",\n \"shortnames\": [\n \"hamburger\"\n ]\n },\n {\n \"unified\": \"1F35F\",\n \"shortnames\": [\n \"fries\"\n ]\n },\n {\n \"unified\": \"1F355\",\n \"shortnames\": [\n \"pizza\"\n ]\n },\n {\n \"unified\": \"1F32D\",\n \"shortnames\": [\n \"hotdog\"\n ]\n },\n {\n \"unified\": \"1F96A\",\n \"shortnames\": [\n \"sandwich\"\n ]\n },\n {\n \"unified\": \"1F32E\",\n \"shortnames\": [\n \"taco\"\n ]\n },\n {\n \"unified\": \"1F32F\",\n \"shortnames\": [\n \"burrito\"\n ]\n },\n {\n \"unified\": \"1FAD4\",\n \"shortnames\": [\n \"tamale\"\n ]\n },\n {\n \"unified\": \"1F959\",\n \"shortnames\": [\n \"stuffed_flatbread\"\n ]\n },\n {\n \"unified\": \"1F9C6\",\n \"shortnames\": [\n \"falafel\"\n ]\n },\n {\n \"unified\": \"1F95A\",\n \"shortnames\": [\n \"egg\"\n ]\n },\n {\n \"unified\": \"1F373\",\n \"shortnames\": [\n \"fried_egg\"\n ]\n },\n {\n \"unified\": \"1F958\",\n \"shortnames\": [\n \"shallow_pan_of_food\"\n ]\n },\n {\n \"unified\": \"1F372\",\n \"shortnames\": [\n \"stew\"\n ]\n },\n {\n \"unified\": \"1FAD5\",\n \"shortnames\": [\n \"fondue\"\n ]\n },\n {\n \"unified\": \"1F963\",\n \"shortnames\": [\n \"bowl_with_spoon\"\n ]\n },\n {\n \"unified\": \"1F957\",\n \"shortnames\": [\n \"green_salad\"\n ]\n },\n {\n \"unified\": \"1F37F\",\n \"shortnames\": [\n \"popcorn\"\n ]\n },\n {\n \"unified\": \"1F9C8\",\n \"shortnames\": [\n \"butter\"\n ]\n },\n {\n \"unified\": \"1F9C2\",\n \"shortnames\": [\n \"salt\"\n ]\n },\n {\n \"unified\": \"1F96B\",\n \"shortnames\": [\n \"canned_food\"\n ]\n },\n {\n \"unified\": \"1F371\",\n \"shortnames\": [\n \"bento\"\n ]\n },\n {\n \"unified\": \"1F358\",\n \"shortnames\": [\n \"rice_cracker\"\n ]\n },\n {\n \"unified\": \"1F359\",\n \"shortnames\": [\n \"rice_ball\"\n ]\n },\n {\n \"unified\": \"1F35A\",\n \"shortnames\": [\n \"rice\"\n ]\n },\n {\n \"unified\": \"1F35B\",\n \"shortnames\": [\n \"curry\"\n ]\n },\n {\n \"unified\": \"1F35C\",\n \"shortnames\": [\n \"ramen\"\n ]\n },\n {\n \"unified\": \"1F35D\",\n \"shortnames\": [\n \"spaghetti\"\n ]\n },\n {\n \"unified\": \"1F360\",\n \"shortnames\": [\n \"sweet_potato\"\n ]\n },\n {\n \"unified\": \"1F362\",\n \"shortnames\": [\n \"oden\"\n ]\n },\n {\n \"unified\": \"1F363\",\n \"shortnames\": [\n \"sushi\"\n ]\n },\n {\n \"unified\": \"1F364\",\n \"shortnames\": [\n \"fried_shrimp\"\n ]\n },\n {\n \"unified\": \"1F365\",\n \"shortnames\": [\n \"fish_cake\"\n ]\n },\n {\n \"unified\": \"1F96E\",\n \"shortnames\": [\n \"moon_cake\"\n ]\n },\n {\n \"unified\": \"1F361\",\n \"shortnames\": [\n \"dango\"\n ]\n },\n {\n \"unified\": \"1F95F\",\n \"shortnames\": [\n \"dumpling\"\n ]\n },\n {\n \"unified\": \"1F960\",\n \"shortnames\": [\n \"fortune_cookie\"\n ]\n },\n {\n \"unified\": \"1F961\",\n \"shortnames\": [\n \"takeout_box\"\n ]\n },\n {\n \"unified\": \"1F980\",\n \"shortnames\": [\n \"crab\"\n ]\n },\n {\n \"unified\": \"1F99E\",\n \"shortnames\": [\n \"lobster\"\n ]\n },\n {\n \"unified\": \"1F990\",\n \"shortnames\": [\n \"shrimp\"\n ]\n },\n {\n \"unified\": \"1F991\",\n \"shortnames\": [\n \"squid\"\n ]\n },\n {\n \"unified\": \"1F9AA\",\n \"shortnames\": [\n \"oyster\"\n ]\n },\n {\n \"unified\": \"1F366\",\n \"shortnames\": [\n \"icecream\"\n ]\n },\n {\n \"unified\": \"1F367\",\n \"shortnames\": [\n \"shaved_ice\"\n ]\n },\n {\n \"unified\": \"1F368\",\n \"shortnames\": [\n \"ice_cream\"\n ]\n },\n {\n \"unified\": \"1F369\",\n \"shortnames\": [\n \"doughnut\"\n ]\n },\n {\n \"unified\": \"1F36A\",\n \"shortnames\": [\n \"cookie\"\n ]\n },\n {\n \"unified\": \"1F382\",\n \"shortnames\": [\n \"birthday\"\n ]\n },\n {\n \"unified\": \"1F370\",\n \"shortnames\": [\n \"cake\"\n ]\n },\n {\n \"unified\": \"1F9C1\",\n \"shortnames\": [\n \"cupcake\"\n ]\n },\n {\n \"unified\": \"1F967\",\n \"shortnames\": [\n \"pie\"\n ]\n },\n {\n \"unified\": \"1F36B\",\n \"shortnames\": [\n \"chocolate_bar\"\n ]\n },\n {\n \"unified\": \"1F36C\",\n \"shortnames\": [\n \"candy\"\n ]\n },\n {\n \"unified\": \"1F36D\",\n \"shortnames\": [\n \"lollipop\"\n ]\n },\n {\n \"unified\": \"1F36E\",\n \"shortnames\": [\n \"custard\"\n ]\n },\n {\n \"unified\": \"1F36F\",\n \"shortnames\": [\n \"honey_pot\"\n ]\n },\n {\n \"unified\": \"1F37C\",\n \"shortnames\": [\n \"baby_bottle\"\n ]\n },\n {\n \"unified\": \"1F95B\",\n \"shortnames\": [\n \"glass_of_milk\"\n ]\n },\n {\n \"unified\": \"2615\",\n \"shortnames\": [\n \"coffee\"\n ]\n },\n {\n \"unified\": \"1FAD6\",\n \"shortnames\": [\n \"teapot\"\n ]\n },\n {\n \"unified\": \"1F375\",\n \"shortnames\": [\n \"tea\"\n ]\n },\n {\n \"unified\": \"1F376\",\n \"shortnames\": [\n \"sake\"\n ]\n },\n {\n \"unified\": \"1F37E\",\n \"shortnames\": [\n \"champagne\"\n ]\n },\n {\n \"unified\": \"1F377\",\n \"shortnames\": [\n \"wine_glass\"\n ]\n },\n {\n \"unified\": \"1F378\",\n \"shortnames\": [\n \"cocktail\"\n ]\n },\n {\n \"unified\": \"1F379\",\n \"shortnames\": [\n \"tropical_drink\"\n ]\n },\n {\n \"unified\": \"1F37A\",\n \"shortnames\": [\n \"beer\"\n ]\n },\n {\n \"unified\": \"1F37B\",\n \"shortnames\": [\n \"beers\"\n ]\n },\n {\n \"unified\": \"1F942\",\n \"shortnames\": [\n \"clinking_glasses\"\n ]\n },\n {\n \"unified\": \"1F943\",\n \"shortnames\": [\n \"tumbler_glass\"\n ]\n },\n {\n \"unified\": \"1F964\",\n \"shortnames\": [\n \"cup_with_straw\"\n ]\n },\n {\n \"unified\": \"1F9CB\",\n \"shortnames\": [\n \"bubble_tea\"\n ]\n },\n {\n \"unified\": \"1F9C3\",\n \"shortnames\": [\n \"beverage_box\"\n ]\n },\n {\n \"unified\": \"1F9C9\",\n \"shortnames\": [\n \"mate_drink\"\n ]\n },\n {\n \"unified\": \"1F9CA\",\n \"shortnames\": [\n \"ice_cube\"\n ]\n },\n {\n \"unified\": \"1F962\",\n \"shortnames\": [\n \"chopsticks\"\n ]\n },\n {\n \"unified\": \"1F37D-FE0F\",\n \"shortnames\": [\n \"knife_fork_plate\"\n ]\n },\n {\n \"unified\": \"1F374\",\n \"shortnames\": [\n \"fork_and_knife\"\n ]\n },\n {\n \"unified\": \"1F944\",\n \"shortnames\": [\n \"spoon\"\n ]\n },\n {\n \"unified\": \"1F52A\",\n \"shortnames\": [\n \"hocho\"\n ]\n },\n {\n \"unified\": \"1F3FA\",\n \"shortnames\": [\n \"amphora\"\n ]\n }\n ]\n },\n {\n \"name\": \"Travel & Places\",\n \"emojis\": [\n {\n \"unified\": \"1F30D\",\n \"shortnames\": [\n \"earth_africa\"\n ]\n },\n {\n \"unified\": \"1F30E\",\n \"shortnames\": [\n \"earth_americas\"\n ]\n },\n {\n \"unified\": \"1F30F\",\n \"shortnames\": [\n \"earth_asia\"\n ]\n },\n {\n \"unified\": \"1F310\",\n \"shortnames\": [\n \"globe_with_meridians\"\n ]\n },\n {\n \"unified\": \"1F5FA-FE0F\",\n \"shortnames\": [\n \"world_map\"\n ]\n },\n {\n \"unified\": \"1F5FE\",\n \"shortnames\": [\n \"japan\"\n ]\n },\n {\n \"unified\": \"1F9ED\",\n \"shortnames\": [\n \"compass\"\n ]\n },\n {\n \"unified\": \"1F3D4-FE0F\",\n \"shortnames\": [\n \"snow_capped_mountain\"\n ]\n },\n {\n \"unified\": \"26F0-FE0F\",\n \"shortnames\": [\n \"mountain\"\n ]\n },\n {\n \"unified\": \"1F30B\",\n \"shortnames\": [\n \"volcano\"\n ]\n },\n {\n \"unified\": \"1F5FB\",\n \"shortnames\": [\n \"mount_fuji\"\n ]\n },\n {\n \"unified\": \"1F3D5-FE0F\",\n \"shortnames\": [\n \"camping\"\n ]\n },\n {\n \"unified\": \"1F3D6-FE0F\",\n \"shortnames\": [\n \"beach_with_umbrella\"\n ]\n },\n {\n \"unified\": \"1F3DC-FE0F\",\n \"shortnames\": [\n \"desert\"\n ]\n },\n {\n \"unified\": \"1F3DD-FE0F\",\n \"shortnames\": [\n \"desert_island\"\n ]\n },\n {\n \"unified\": \"1F3DE-FE0F\",\n \"shortnames\": [\n \"national_park\"\n ]\n },\n {\n \"unified\": \"1F3DF-FE0F\",\n \"shortnames\": [\n \"stadium\"\n ]\n },\n {\n \"unified\": \"1F3DB-FE0F\",\n \"shortnames\": [\n \"classical_building\"\n ]\n },\n {\n \"unified\": \"1F3D7-FE0F\",\n \"shortnames\": [\n \"building_construction\"\n ]\n },\n {\n \"unified\": \"1F9F1\",\n \"shortnames\": [\n \"bricks\"\n ]\n },\n {\n \"unified\": \"1FAA8\",\n \"shortnames\": [\n \"rock\"\n ]\n },\n {\n \"unified\": \"1FAB5\",\n \"shortnames\": [\n \"wood\"\n ]\n },\n {\n \"unified\": \"1F6D6\",\n \"shortnames\": [\n \"hut\"\n ]\n },\n {\n \"unified\": \"1F3D8-FE0F\",\n \"shortnames\": [\n \"house_buildings\"\n ]\n },\n {\n \"unified\": \"1F3DA-FE0F\",\n \"shortnames\": [\n \"derelict_house_building\"\n ]\n },\n {\n \"unified\": \"1F3E0\",\n \"shortnames\": [\n \"house\"\n ]\n },\n {\n \"unified\": \"1F3E1\",\n \"shortnames\": [\n \"house_with_garden\"\n ]\n },\n {\n \"unified\": \"1F3E2\",\n \"shortnames\": [\n \"office\"\n ]\n },\n {\n \"unified\": \"1F3E3\",\n \"shortnames\": [\n \"post_office\"\n ]\n },\n {\n \"unified\": \"1F3E4\",\n \"shortnames\": [\n \"european_post_office\"\n ]\n },\n {\n \"unified\": \"1F3E5\",\n \"shortnames\": [\n \"hospital\"\n ]\n },\n {\n \"unified\": \"1F3E6\",\n \"shortnames\": [\n \"bank\"\n ]\n },\n {\n \"unified\": \"1F3E8\",\n \"shortnames\": [\n \"hotel\"\n ]\n },\n {\n \"unified\": \"1F3E9\",\n \"shortnames\": [\n \"love_hotel\"\n ]\n },\n {\n \"unified\": \"1F3EA\",\n \"shortnames\": [\n \"convenience_store\"\n ]\n },\n {\n \"unified\": \"1F3EB\",\n \"shortnames\": [\n \"school\"\n ]\n },\n {\n \"unified\": \"1F3EC\",\n \"shortnames\": [\n \"department_store\"\n ]\n },\n {\n \"unified\": \"1F3ED\",\n \"shortnames\": [\n \"factory\"\n ]\n },\n {\n \"unified\": \"1F3EF\",\n \"shortnames\": [\n \"japanese_castle\"\n ]\n },\n {\n \"unified\": \"1F3F0\",\n \"shortnames\": [\n \"european_castle\"\n ]\n },\n {\n \"unified\": \"1F492\",\n \"shortnames\": [\n \"wedding\"\n ]\n },\n {\n \"unified\": \"1F5FC\",\n \"shortnames\": [\n \"tokyo_tower\"\n ]\n },\n {\n \"unified\": \"1F5FD\",\n \"shortnames\": [\n \"statue_of_liberty\"\n ]\n },\n {\n \"unified\": \"26EA\",\n \"shortnames\": [\n \"church\"\n ]\n },\n {\n \"unified\": \"1F54C\",\n \"shortnames\": [\n \"mosque\"\n ]\n },\n {\n \"unified\": \"1F6D5\",\n \"shortnames\": [\n \"hindu_temple\"\n ]\n },\n {\n \"unified\": \"1F54D\",\n \"shortnames\": [\n \"synagogue\"\n ]\n },\n {\n \"unified\": \"26E9-FE0F\",\n \"shortnames\": [\n \"shinto_shrine\"\n ]\n },\n {\n \"unified\": \"1F54B\",\n \"shortnames\": [\n \"kaaba\"\n ]\n },\n {\n \"unified\": \"26F2\",\n \"shortnames\": [\n \"fountain\"\n ]\n },\n {\n \"unified\": \"26FA\",\n \"shortnames\": [\n \"tent\"\n ]\n },\n {\n \"unified\": \"1F301\",\n \"shortnames\": [\n \"foggy\"\n ]\n },\n {\n \"unified\": \"1F303\",\n \"shortnames\": [\n \"night_with_stars\"\n ]\n },\n {\n \"unified\": \"1F3D9-FE0F\",\n \"shortnames\": [\n \"cityscape\"\n ]\n },\n {\n \"unified\": \"1F304\",\n \"shortnames\": [\n \"sunrise_over_mountains\"\n ]\n },\n {\n \"unified\": \"1F305\",\n \"shortnames\": [\n \"sunrise\"\n ]\n },\n {\n \"unified\": \"1F306\",\n \"shortnames\": [\n \"city_sunset\"\n ]\n },\n {\n \"unified\": \"1F307\",\n \"shortnames\": [\n \"city_sunrise\"\n ]\n },\n {\n \"unified\": \"1F309\",\n \"shortnames\": [\n \"bridge_at_night\"\n ]\n },\n {\n \"unified\": \"2668-FE0F\",\n \"shortnames\": [\n \"hotsprings\"\n ]\n },\n {\n \"unified\": \"1F3A0\",\n \"shortnames\": [\n \"carousel_horse\"\n ]\n },\n {\n \"unified\": \"1F3A1\",\n \"shortnames\": [\n \"ferris_wheel\"\n ]\n },\n {\n \"unified\": \"1F3A2\",\n \"shortnames\": [\n \"roller_coaster\"\n ]\n },\n {\n \"unified\": \"1F488\",\n \"shortnames\": [\n \"barber\"\n ]\n },\n {\n \"unified\": \"1F3AA\",\n \"shortnames\": [\n \"circus_tent\"\n ]\n },\n {\n \"unified\": \"1F682\",\n \"shortnames\": [\n \"steam_locomotive\"\n ]\n },\n {\n \"unified\": \"1F683\",\n \"shortnames\": [\n \"railway_car\"\n ]\n },\n {\n \"unified\": \"1F684\",\n \"shortnames\": [\n \"bullettrain_side\"\n ]\n },\n {\n \"unified\": \"1F685\",\n \"shortnames\": [\n \"bullettrain_front\"\n ]\n },\n {\n \"unified\": \"1F686\",\n \"shortnames\": [\n \"train2\"\n ]\n },\n {\n \"unified\": \"1F687\",\n \"shortnames\": [\n \"metro\"\n ]\n },\n {\n \"unified\": \"1F688\",\n \"shortnames\": [\n \"light_rail\"\n ]\n },\n {\n \"unified\": \"1F689\",\n \"shortnames\": [\n \"station\"\n ]\n },\n {\n \"unified\": \"1F68A\",\n \"shortnames\": [\n \"tram\"\n ]\n },\n {\n \"unified\": \"1F69D\",\n \"shortnames\": [\n \"monorail\"\n ]\n },\n {\n \"unified\": \"1F69E\",\n \"shortnames\": [\n \"mountain_railway\"\n ]\n },\n {\n \"unified\": \"1F68B\",\n \"shortnames\": [\n \"train\"\n ]\n },\n {\n \"unified\": \"1F68C\",\n \"shortnames\": [\n \"bus\"\n ]\n },\n {\n \"unified\": \"1F68D\",\n \"shortnames\": [\n \"oncoming_bus\"\n ]\n },\n {\n \"unified\": \"1F68E\",\n \"shortnames\": [\n \"trolleybus\"\n ]\n },\n {\n \"unified\": \"1F690\",\n \"shortnames\": [\n \"minibus\"\n ]\n },\n {\n \"unified\": \"1F691\",\n \"shortnames\": [\n \"ambulance\"\n ]\n },\n {\n \"unified\": \"1F692\",\n \"shortnames\": [\n \"fire_engine\"\n ]\n },\n {\n \"unified\": \"1F693\",\n \"shortnames\": [\n \"police_car\"\n ]\n },\n {\n \"unified\": \"1F694\",\n \"shortnames\": [\n \"oncoming_police_car\"\n ]\n },\n {\n \"unified\": \"1F695\",\n \"shortnames\": [\n \"taxi\"\n ]\n },\n {\n \"unified\": \"1F696\",\n \"shortnames\": [\n \"oncoming_taxi\"\n ]\n },\n {\n \"unified\": \"1F697\",\n \"shortnames\": [\n \"car\"\n ]\n },\n {\n \"unified\": \"1F698\",\n \"shortnames\": [\n \"oncoming_automobile\"\n ]\n },\n {\n \"unified\": \"1F699\",\n \"shortnames\": [\n \"blue_car\"\n ]\n },\n {\n \"unified\": \"1F6FB\",\n \"shortnames\": [\n \"pickup_truck\"\n ]\n },\n {\n \"unified\": \"1F69A\",\n \"shortnames\": [\n \"truck\"\n ]\n },\n {\n \"unified\": \"1F69B\",\n \"shortnames\": [\n \"articulated_lorry\"\n ]\n },\n {\n \"unified\": \"1F69C\",\n \"shortnames\": [\n \"tractor\"\n ]\n },\n {\n \"unified\": \"1F3CE-FE0F\",\n \"shortnames\": [\n \"racing_car\"\n ]\n },\n {\n \"unified\": \"1F3CD-FE0F\",\n \"shortnames\": [\n \"racing_motorcycle\"\n ]\n },\n {\n \"unified\": \"1F6F5\",\n \"shortnames\": [\n \"motor_scooter\"\n ]\n },\n {\n \"unified\": \"1F9BD\",\n \"shortnames\": [\n \"manual_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F9BC\",\n \"shortnames\": [\n \"motorized_wheelchair\"\n ]\n },\n {\n \"unified\": \"1F6FA\",\n \"shortnames\": [\n \"auto_rickshaw\"\n ]\n },\n {\n \"unified\": \"1F6B2\",\n \"shortnames\": [\n \"bike\"\n ]\n },\n {\n \"unified\": \"1F6F4\",\n \"shortnames\": [\n \"scooter\"\n ]\n },\n {\n \"unified\": \"1F6F9\",\n \"shortnames\": [\n \"skateboard\"\n ]\n },\n {\n \"unified\": \"1F6FC\",\n \"shortnames\": [\n \"roller_skate\"\n ]\n },\n {\n \"unified\": \"1F68F\",\n \"shortnames\": [\n \"busstop\"\n ]\n },\n {\n \"unified\": \"1F6E3-FE0F\",\n \"shortnames\": [\n \"motorway\"\n ]\n },\n {\n \"unified\": \"1F6E4-FE0F\",\n \"shortnames\": [\n \"railway_track\"\n ]\n },\n {\n \"unified\": \"1F6E2-FE0F\",\n \"shortnames\": [\n \"oil_drum\"\n ]\n },\n {\n \"unified\": \"26FD\",\n \"shortnames\": [\n \"fuelpump\"\n ]\n },\n {\n \"unified\": \"1F6A8\",\n \"shortnames\": [\n \"rotating_light\"\n ]\n },\n {\n \"unified\": \"1F6A5\",\n \"shortnames\": [\n \"traffic_light\"\n ]\n },\n {\n \"unified\": \"1F6A6\",\n \"shortnames\": [\n \"vertical_traffic_light\"\n ]\n },\n {\n \"unified\": \"1F6D1\",\n \"shortnames\": [\n \"octagonal_sign\"\n ]\n },\n {\n \"unified\": \"1F6A7\",\n \"shortnames\": [\n \"construction\"\n ]\n },\n {\n \"unified\": \"2693\",\n \"shortnames\": [\n \"anchor\"\n ]\n },\n {\n \"unified\": \"26F5\",\n \"shortnames\": [\n \"boat\"\n ]\n },\n {\n \"unified\": \"1F6F6\",\n \"shortnames\": [\n \"canoe\"\n ]\n },\n {\n \"unified\": \"1F6A4\",\n \"shortnames\": [\n \"speedboat\"\n ]\n },\n {\n \"unified\": \"1F6F3-FE0F\",\n \"shortnames\": [\n \"passenger_ship\"\n ]\n },\n {\n \"unified\": \"26F4-FE0F\",\n \"shortnames\": [\n \"ferry\"\n ]\n },\n {\n \"unified\": \"1F6E5-FE0F\",\n \"shortnames\": [\n \"motor_boat\"\n ]\n },\n {\n \"unified\": \"1F6A2\",\n \"shortnames\": [\n \"ship\"\n ]\n },\n {\n \"unified\": \"2708-FE0F\",\n \"shortnames\": [\n \"airplane\"\n ]\n },\n {\n \"unified\": \"1F6E9-FE0F\",\n \"shortnames\": [\n \"small_airplane\"\n ]\n },\n {\n \"unified\": \"1F6EB\",\n \"shortnames\": [\n \"airplane_departure\"\n ]\n },\n {\n \"unified\": \"1F6EC\",\n \"shortnames\": [\n \"airplane_arriving\"\n ]\n },\n {\n \"unified\": \"1FA82\",\n \"shortnames\": [\n \"parachute\"\n ]\n },\n {\n \"unified\": \"1F4BA\",\n \"shortnames\": [\n \"seat\"\n ]\n },\n {\n \"unified\": \"1F681\",\n \"shortnames\": [\n \"helicopter\"\n ]\n },\n {\n \"unified\": \"1F69F\",\n \"shortnames\": [\n \"suspension_railway\"\n ]\n },\n {\n \"unified\": \"1F6A0\",\n \"shortnames\": [\n \"mountain_cableway\"\n ]\n },\n {\n \"unified\": \"1F6A1\",\n \"shortnames\": [\n \"aerial_tramway\"\n ]\n },\n {\n \"unified\": \"1F6F0-FE0F\",\n \"shortnames\": [\n \"satellite\"\n ]\n },\n {\n \"unified\": \"1F680\",\n \"shortnames\": [\n \"rocket\"\n ]\n },\n {\n \"unified\": \"1F6F8\",\n \"shortnames\": [\n \"flying_saucer\"\n ]\n },\n {\n \"unified\": \"1F6CE-FE0F\",\n \"shortnames\": [\n \"bellhop_bell\"\n ]\n },\n {\n \"unified\": \"1F9F3\",\n \"shortnames\": [\n \"luggage\"\n ]\n },\n {\n \"unified\": \"231B\",\n \"shortnames\": [\n \"hourglass\"\n ]\n },\n {\n \"unified\": \"23F3\",\n \"shortnames\": [\n \"hourglass_flowing_sand\"\n ]\n },\n {\n \"unified\": \"231A\",\n \"shortnames\": [\n \"watch\"\n ]\n },\n {\n \"unified\": \"23F0\",\n \"shortnames\": [\n \"alarm_clock\"\n ]\n },\n {\n \"unified\": \"23F1-FE0F\",\n \"shortnames\": [\n \"stopwatch\"\n ]\n },\n {\n \"unified\": \"23F2-FE0F\",\n \"shortnames\": [\n \"timer_clock\"\n ]\n },\n {\n \"unified\": \"1F570-FE0F\",\n \"shortnames\": [\n \"mantelpiece_clock\"\n ]\n },\n {\n \"unified\": \"1F55B\",\n \"shortnames\": [\n \"clock12\"\n ]\n },\n {\n \"unified\": \"1F567\",\n \"shortnames\": [\n \"clock1230\"\n ]\n },\n {\n \"unified\": \"1F550\",\n \"shortnames\": [\n \"clock1\"\n ]\n },\n {\n \"unified\": \"1F55C\",\n \"shortnames\": [\n \"clock130\"\n ]\n },\n {\n \"unified\": \"1F551\",\n \"shortnames\": [\n \"clock2\"\n ]\n },\n {\n \"unified\": \"1F55D\",\n \"shortnames\": [\n \"clock230\"\n ]\n },\n {\n \"unified\": \"1F552\",\n \"shortnames\": [\n \"clock3\"\n ]\n },\n {\n \"unified\": \"1F55E\",\n \"shortnames\": [\n \"clock330\"\n ]\n },\n {\n \"unified\": \"1F553\",\n \"shortnames\": [\n \"clock4\"\n ]\n },\n {\n \"unified\": \"1F55F\",\n \"shortnames\": [\n \"clock430\"\n ]\n },\n {\n \"unified\": \"1F554\",\n \"shortnames\": [\n \"clock5\"\n ]\n },\n {\n \"unified\": \"1F560\",\n \"shortnames\": [\n \"clock530\"\n ]\n },\n {\n \"unified\": \"1F555\",\n \"shortnames\": [\n \"clock6\"\n ]\n },\n {\n \"unified\": \"1F561\",\n \"shortnames\": [\n \"clock630\"\n ]\n },\n {\n \"unified\": \"1F556\",\n \"shortnames\": [\n \"clock7\"\n ]\n },\n {\n \"unified\": \"1F562\",\n \"shortnames\": [\n \"clock730\"\n ]\n },\n {\n \"unified\": \"1F557\",\n \"shortnames\": [\n \"clock8\"\n ]\n },\n {\n \"unified\": \"1F563\",\n \"shortnames\": [\n \"clock830\"\n ]\n },\n {\n \"unified\": \"1F558\",\n \"shortnames\": [\n \"clock9\"\n ]\n },\n {\n \"unified\": \"1F564\",\n \"shortnames\": [\n \"clock930\"\n ]\n },\n {\n \"unified\": \"1F559\",\n \"shortnames\": [\n \"clock10\"\n ]\n },\n {\n \"unified\": \"1F565\",\n \"shortnames\": [\n \"clock1030\"\n ]\n },\n {\n \"unified\": \"1F55A\",\n \"shortnames\": [\n \"clock11\"\n ]\n },\n {\n \"unified\": \"1F566\",\n \"shortnames\": [\n \"clock1130\"\n ]\n },\n {\n \"unified\": \"1F311\",\n \"shortnames\": [\n \"new_moon\"\n ]\n },\n {\n \"unified\": \"1F312\",\n \"shortnames\": [\n \"waxing_crescent_moon\"\n ]\n },\n {\n \"unified\": \"1F313\",\n \"shortnames\": [\n \"first_quarter_moon\"\n ]\n },\n {\n \"unified\": \"1F314\",\n \"shortnames\": [\n \"moon\"\n ]\n },\n {\n \"unified\": \"1F315\",\n \"shortnames\": [\n \"full_moon\"\n ]\n },\n {\n \"unified\": \"1F316\",\n \"shortnames\": [\n \"waning_gibbous_moon\"\n ]\n },\n {\n \"unified\": \"1F317\",\n \"shortnames\": [\n \"last_quarter_moon\"\n ]\n },\n {\n \"unified\": \"1F318\",\n \"shortnames\": [\n \"waning_crescent_moon\"\n ]\n },\n {\n \"unified\": \"1F319\",\n \"shortnames\": [\n \"crescent_moon\"\n ]\n },\n {\n \"unified\": \"1F31A\",\n \"shortnames\": [\n \"new_moon_with_face\"\n ]\n },\n {\n \"unified\": \"1F31B\",\n \"shortnames\": [\n \"first_quarter_moon_with_face\"\n ]\n },\n {\n \"unified\": \"1F31C\",\n \"shortnames\": [\n \"last_quarter_moon_with_face\"\n ]\n },\n {\n \"unified\": \"1F321-FE0F\",\n \"shortnames\": [\n \"thermometer\"\n ]\n },\n {\n \"unified\": \"2600-FE0F\",\n \"shortnames\": [\n \"sunny\"\n ]\n },\n {\n \"unified\": \"1F31D\",\n \"shortnames\": [\n \"full_moon_with_face\"\n ]\n },\n {\n \"unified\": \"1F31E\",\n \"shortnames\": [\n \"sun_with_face\"\n ]\n },\n {\n \"unified\": \"1FA90\",\n \"shortnames\": [\n \"ringed_planet\"\n ]\n },\n {\n \"unified\": \"2B50\",\n \"shortnames\": [\n \"star\"\n ]\n },\n {\n \"unified\": \"1F31F\",\n \"shortnames\": [\n \"star2\"\n ]\n },\n {\n \"unified\": \"1F320\",\n \"shortnames\": [\n \"stars\"\n ]\n },\n {\n \"unified\": \"1F30C\",\n \"shortnames\": [\n \"milky_way\"\n ]\n },\n {\n \"unified\": \"2601-FE0F\",\n \"shortnames\": [\n \"cloud\"\n ]\n },\n {\n \"unified\": \"26C5\",\n \"shortnames\": [\n \"partly_sunny\"\n ]\n },\n {\n \"unified\": \"26C8-FE0F\",\n \"shortnames\": [\n \"thunder_cloud_and_rain\"\n ]\n },\n {\n \"unified\": \"1F324-FE0F\",\n \"shortnames\": [\n \"mostly_sunny\"\n ]\n },\n {\n \"unified\": \"1F325-FE0F\",\n \"shortnames\": [\n \"barely_sunny\"\n ]\n },\n {\n \"unified\": \"1F326-FE0F\",\n \"shortnames\": [\n \"partly_sunny_rain\"\n ]\n },\n {\n \"unified\": \"1F327-FE0F\",\n \"shortnames\": [\n \"rain_cloud\"\n ]\n },\n {\n \"unified\": \"1F328-FE0F\",\n \"shortnames\": [\n \"snow_cloud\"\n ]\n },\n {\n \"unified\": \"1F329-FE0F\",\n \"shortnames\": [\n \"lightning\"\n ]\n },\n {\n \"unified\": \"1F32A-FE0F\",\n \"shortnames\": [\n \"tornado\"\n ]\n },\n {\n \"unified\": \"1F32B-FE0F\",\n \"shortnames\": [\n \"fog\"\n ]\n },\n {\n \"unified\": \"1F32C-FE0F\",\n \"shortnames\": [\n \"wind_blowing_face\"\n ]\n },\n {\n \"unified\": \"1F300\",\n \"shortnames\": [\n \"cyclone\"\n ]\n },\n {\n \"unified\": \"1F308\",\n \"shortnames\": [\n \"rainbow\"\n ]\n },\n {\n \"unified\": \"1F302\",\n \"shortnames\": [\n \"closed_umbrella\"\n ]\n },\n {\n \"unified\": \"2602-FE0F\",\n \"shortnames\": [\n \"umbrella\"\n ]\n },\n {\n \"unified\": \"2614\",\n \"shortnames\": [\n \"umbrella_with_rain_drops\"\n ]\n },\n {\n \"unified\": \"26F1-FE0F\",\n \"shortnames\": [\n \"umbrella_on_ground\"\n ]\n },\n {\n \"unified\": \"26A1\",\n \"shortnames\": [\n \"zap\"\n ]\n },\n {\n \"unified\": \"2744-FE0F\",\n \"shortnames\": [\n \"snowflake\"\n ]\n },\n {\n \"unified\": \"2603-FE0F\",\n \"shortnames\": [\n \"snowman\"\n ]\n },\n {\n \"unified\": \"26C4\",\n \"shortnames\": [\n \"snowman_without_snow\"\n ]\n },\n {\n \"unified\": \"2604-FE0F\",\n \"shortnames\": [\n \"comet\"\n ]\n },\n {\n \"unified\": \"1F525\",\n \"shortnames\": [\n \"fire\"\n ]\n },\n {\n \"unified\": \"1F4A7\",\n \"shortnames\": [\n \"droplet\"\n ]\n },\n {\n \"unified\": \"1F30A\",\n \"shortnames\": [\n \"ocean\"\n ]\n }\n ]\n },\n {\n \"name\": \"Activities\",\n \"emojis\": [\n {\n \"unified\": \"1F383\",\n \"shortnames\": [\n \"jack_o_lantern\"\n ]\n },\n {\n \"unified\": \"1F384\",\n \"shortnames\": [\n \"christmas_tree\"\n ]\n },\n {\n \"unified\": \"1F386\",\n \"shortnames\": [\n \"fireworks\"\n ]\n },\n {\n \"unified\": \"1F387\",\n \"shortnames\": [\n \"sparkler\"\n ]\n },\n {\n \"unified\": \"1F9E8\",\n \"shortnames\": [\n \"firecracker\"\n ]\n },\n {\n \"unified\": \"2728\",\n \"shortnames\": [\n \"sparkles\"\n ]\n },\n {\n \"unified\": \"1F388\",\n \"shortnames\": [\n \"balloon\"\n ]\n },\n {\n \"unified\": \"1F389\",\n \"shortnames\": [\n \"tada\"\n ]\n },\n {\n \"unified\": \"1F38A\",\n \"shortnames\": [\n \"confetti_ball\"\n ]\n },\n {\n \"unified\": \"1F38B\",\n \"shortnames\": [\n \"tanabata_tree\"\n ]\n },\n {\n \"unified\": \"1F38D\",\n \"shortnames\": [\n \"bamboo\"\n ]\n },\n {\n \"unified\": \"1F38E\",\n \"shortnames\": [\n \"dolls\"\n ]\n },\n {\n \"unified\": \"1F38F\",\n \"shortnames\": [\n \"flags\"\n ]\n },\n {\n \"unified\": \"1F390\",\n \"shortnames\": [\n \"wind_chime\"\n ]\n },\n {\n \"unified\": \"1F391\",\n \"shortnames\": [\n \"rice_scene\"\n ]\n },\n {\n \"unified\": \"1F9E7\",\n \"shortnames\": [\n \"red_envelope\"\n ]\n },\n {\n \"unified\": \"1F380\",\n \"shortnames\": [\n \"ribbon\"\n ]\n },\n {\n \"unified\": \"1F381\",\n \"shortnames\": [\n \"gift\"\n ]\n },\n {\n \"unified\": \"1F397-FE0F\",\n \"shortnames\": [\n \"reminder_ribbon\"\n ]\n },\n {\n \"unified\": \"1F39F-FE0F\",\n \"shortnames\": [\n \"admission_tickets\"\n ]\n },\n {\n \"unified\": \"1F3AB\",\n \"shortnames\": [\n \"ticket\"\n ]\n },\n {\n \"unified\": \"1F396-FE0F\",\n \"shortnames\": [\n \"medal\"\n ]\n },\n {\n \"unified\": \"1F3C6\",\n \"shortnames\": [\n \"trophy\"\n ]\n },\n {\n \"unified\": \"1F3C5\",\n \"shortnames\": [\n \"sports_medal\"\n ]\n },\n {\n \"unified\": \"1F947\",\n \"shortnames\": [\n \"first_place_medal\"\n ]\n },\n {\n \"unified\": \"1F948\",\n \"shortnames\": [\n \"second_place_medal\"\n ]\n },\n {\n \"unified\": \"1F949\",\n \"shortnames\": [\n \"third_place_medal\"\n ]\n },\n {\n \"unified\": \"26BD\",\n \"shortnames\": [\n \"soccer\"\n ]\n },\n {\n \"unified\": \"26BE\",\n \"shortnames\": [\n \"baseball\"\n ]\n },\n {\n \"unified\": \"1F94E\",\n \"shortnames\": [\n \"softball\"\n ]\n },\n {\n \"unified\": \"1F3C0\",\n \"shortnames\": [\n \"basketball\"\n ]\n },\n {\n \"unified\": \"1F3D0\",\n \"shortnames\": [\n \"volleyball\"\n ]\n },\n {\n \"unified\": \"1F3C8\",\n \"shortnames\": [\n \"football\"\n ]\n },\n {\n \"unified\": \"1F3C9\",\n \"shortnames\": [\n \"rugby_football\"\n ]\n },\n {\n \"unified\": \"1F3BE\",\n \"shortnames\": [\n \"tennis\"\n ]\n },\n {\n \"unified\": \"1F94F\",\n \"shortnames\": [\n \"flying_disc\"\n ]\n },\n {\n \"unified\": \"1F3B3\",\n \"shortnames\": [\n \"bowling\"\n ]\n },\n {\n \"unified\": \"1F3CF\",\n \"shortnames\": [\n \"cricket_bat_and_ball\"\n ]\n },\n {\n \"unified\": \"1F3D1\",\n \"shortnames\": [\n \"field_hockey_stick_and_ball\"\n ]\n },\n {\n \"unified\": \"1F3D2\",\n \"shortnames\": [\n \"ice_hockey_stick_and_puck\"\n ]\n },\n {\n \"unified\": \"1F94D\",\n \"shortnames\": [\n \"lacrosse\"\n ]\n },\n {\n \"unified\": \"1F3D3\",\n \"shortnames\": [\n \"table_tennis_paddle_and_ball\"\n ]\n },\n {\n \"unified\": \"1F3F8\",\n \"shortnames\": [\n \"badminton_racquet_and_shuttlecock\"\n ]\n },\n {\n \"unified\": \"1F94A\",\n \"shortnames\": [\n \"boxing_glove\"\n ]\n },\n {\n \"unified\": \"1F94B\",\n \"shortnames\": [\n \"martial_arts_uniform\"\n ]\n },\n {\n \"unified\": \"1F945\",\n \"shortnames\": [\n \"goal_net\"\n ]\n },\n {\n \"unified\": \"26F3\",\n \"shortnames\": [\n \"golf\"\n ]\n },\n {\n \"unified\": \"26F8-FE0F\",\n \"shortnames\": [\n \"ice_skate\"\n ]\n },\n {\n \"unified\": \"1F3A3\",\n \"shortnames\": [\n \"fishing_pole_and_fish\"\n ]\n },\n {\n \"unified\": \"1F93F\",\n \"shortnames\": [\n \"diving_mask\"\n ]\n },\n {\n \"unified\": \"1F3BD\",\n \"shortnames\": [\n \"running_shirt_with_sash\"\n ]\n },\n {\n \"unified\": \"1F3BF\",\n \"shortnames\": [\n \"ski\"\n ]\n },\n {\n \"unified\": \"1F6F7\",\n \"shortnames\": [\n \"sled\"\n ]\n },\n {\n \"unified\": \"1F94C\",\n \"shortnames\": [\n \"curling_stone\"\n ]\n },\n {\n \"unified\": \"1F3AF\",\n \"shortnames\": [\n \"dart\"\n ]\n },\n {\n \"unified\": \"1FA80\",\n \"shortnames\": [\n \"yo-yo\"\n ]\n },\n {\n \"unified\": \"1FA81\",\n \"shortnames\": [\n \"kite\"\n ]\n },\n {\n \"unified\": \"1F3B1\",\n \"shortnames\": [\n \"8ball\"\n ]\n },\n {\n \"unified\": \"1F52E\",\n \"shortnames\": [\n \"crystal_ball\"\n ]\n },\n {\n \"unified\": \"1FA84\",\n \"shortnames\": [\n \"magic_wand\"\n ]\n },\n {\n \"unified\": \"1F9FF\",\n \"shortnames\": [\n \"nazar_amulet\"\n ]\n },\n {\n \"unified\": \"1F3AE\",\n \"shortnames\": [\n \"video_game\"\n ]\n },\n {\n \"unified\": \"1F579-FE0F\",\n \"shortnames\": [\n \"joystick\"\n ]\n },\n {\n \"unified\": \"1F3B0\",\n \"shortnames\": [\n \"slot_machine\"\n ]\n },\n {\n \"unified\": \"1F3B2\",\n \"shortnames\": [\n \"game_die\"\n ]\n },\n {\n \"unified\": \"1F9E9\",\n \"shortnames\": [\n \"jigsaw\"\n ]\n },\n {\n \"unified\": \"1F9F8\",\n \"shortnames\": [\n \"teddy_bear\"\n ]\n },\n {\n \"unified\": \"1FA85\",\n \"shortnames\": [\n \"pinata\"\n ]\n },\n {\n \"unified\": \"1FA86\",\n \"shortnames\": [\n \"nesting_dolls\"\n ]\n },\n {\n \"unified\": \"2660-FE0F\",\n \"shortnames\": [\n \"spades\"\n ]\n },\n {\n \"unified\": \"2665-FE0F\",\n \"shortnames\": [\n \"hearts\"\n ]\n },\n {\n \"unified\": \"2666-FE0F\",\n \"shortnames\": [\n \"diamonds\"\n ]\n },\n {\n \"unified\": \"2663-FE0F\",\n \"shortnames\": [\n \"clubs\"\n ]\n },\n {\n \"unified\": \"265F-FE0F\",\n \"shortnames\": [\n \"chess_pawn\"\n ]\n },\n {\n \"unified\": \"1F0CF\",\n \"shortnames\": [\n \"black_joker\"\n ]\n },\n {\n \"unified\": \"1F004\",\n \"shortnames\": [\n \"mahjong\"\n ]\n },\n {\n \"unified\": \"1F3B4\",\n \"shortnames\": [\n \"flower_playing_cards\"\n ]\n },\n {\n \"unified\": \"1F3AD\",\n \"shortnames\": [\n \"performing_arts\"\n ]\n },\n {\n \"unified\": \"1F5BC-FE0F\",\n \"shortnames\": [\n \"frame_with_picture\"\n ]\n },\n {\n \"unified\": \"1F3A8\",\n \"shortnames\": [\n \"art\"\n ]\n },\n {\n \"unified\": \"1F9F5\",\n \"shortnames\": [\n \"thread\"\n ]\n },\n {\n \"unified\": \"1FAA1\",\n \"shortnames\": [\n \"sewing_needle\"\n ]\n },\n {\n \"unified\": \"1F9F6\",\n \"shortnames\": [\n \"yarn\"\n ]\n },\n {\n \"unified\": \"1FAA2\",\n \"shortnames\": [\n \"knot\"\n ]\n }\n ]\n },\n {\n \"name\": \"Objects\",\n \"emojis\": [\n {\n \"unified\": \"1F453\",\n \"shortnames\": [\n \"eyeglasses\"\n ]\n },\n {\n \"unified\": \"1F576-FE0F\",\n \"shortnames\": [\n \"dark_sunglasses\"\n ]\n },\n {\n \"unified\": \"1F97D\",\n \"shortnames\": [\n \"goggles\"\n ]\n },\n {\n \"unified\": \"1F97C\",\n \"shortnames\": [\n \"lab_coat\"\n ]\n },\n {\n \"unified\": \"1F9BA\",\n \"shortnames\": [\n \"safety_vest\"\n ]\n },\n {\n \"unified\": \"1F454\",\n \"shortnames\": [\n \"necktie\"\n ]\n },\n {\n \"unified\": \"1F455\",\n \"shortnames\": [\n \"shirt\"\n ]\n },\n {\n \"unified\": \"1F456\",\n \"shortnames\": [\n \"jeans\"\n ]\n },\n {\n \"unified\": \"1F9E3\",\n \"shortnames\": [\n \"scarf\"\n ]\n },\n {\n \"unified\": \"1F9E4\",\n \"shortnames\": [\n \"gloves\"\n ]\n },\n {\n \"unified\": \"1F9E5\",\n \"shortnames\": [\n \"coat\"\n ]\n },\n {\n \"unified\": \"1F9E6\",\n \"shortnames\": [\n \"socks\"\n ]\n },\n {\n \"unified\": \"1F457\",\n \"shortnames\": [\n \"dress\"\n ]\n },\n {\n \"unified\": \"1F458\",\n \"shortnames\": [\n \"kimono\"\n ]\n },\n {\n \"unified\": \"1F97B\",\n \"shortnames\": [\n \"sari\"\n ]\n },\n {\n \"unified\": \"1FA71\",\n \"shortnames\": [\n \"one-piece_swimsuit\"\n ]\n },\n {\n \"unified\": \"1FA72\",\n \"shortnames\": [\n \"briefs\"\n ]\n },\n {\n \"unified\": \"1FA73\",\n \"shortnames\": [\n \"shorts\"\n ]\n },\n {\n \"unified\": \"1F459\",\n \"shortnames\": [\n \"bikini\"\n ]\n },\n {\n \"unified\": \"1F45A\",\n \"shortnames\": [\n \"womans_clothes\"\n ]\n },\n {\n \"unified\": \"1F45B\",\n \"shortnames\": [\n \"purse\"\n ]\n },\n {\n \"unified\": \"1F45C\",\n \"shortnames\": [\n \"handbag\"\n ]\n },\n {\n \"unified\": \"1F45D\",\n \"shortnames\": [\n \"pouch\"\n ]\n },\n {\n \"unified\": \"1F6CD-FE0F\",\n \"shortnames\": [\n \"shopping_bags\"\n ]\n },\n {\n \"unified\": \"1F392\",\n \"shortnames\": [\n \"school_satchel\"\n ]\n },\n {\n \"unified\": \"1FA74\",\n \"shortnames\": [\n \"thong_sandal\"\n ]\n },\n {\n \"unified\": \"1F45E\",\n \"shortnames\": [\n \"mans_shoe\"\n ]\n },\n {\n \"unified\": \"1F45F\",\n \"shortnames\": [\n \"athletic_shoe\"\n ]\n },\n {\n \"unified\": \"1F97E\",\n \"shortnames\": [\n \"hiking_boot\"\n ]\n },\n {\n \"unified\": \"1F97F\",\n \"shortnames\": [\n \"womans_flat_shoe\"\n ]\n },\n {\n \"unified\": \"1F460\",\n \"shortnames\": [\n \"high_heel\"\n ]\n },\n {\n \"unified\": \"1F461\",\n \"shortnames\": [\n \"sandal\"\n ]\n },\n {\n \"unified\": \"1FA70\",\n \"shortnames\": [\n \"ballet_shoes\"\n ]\n },\n {\n \"unified\": \"1F462\",\n \"shortnames\": [\n \"boot\"\n ]\n },\n {\n \"unified\": \"1F451\",\n \"shortnames\": [\n \"crown\"\n ]\n },\n {\n \"unified\": \"1F452\",\n \"shortnames\": [\n \"womans_hat\"\n ]\n },\n {\n \"unified\": \"1F3A9\",\n \"shortnames\": [\n \"tophat\"\n ]\n },\n {\n \"unified\": \"1F393\",\n \"shortnames\": [\n \"mortar_board\"\n ]\n },\n {\n \"unified\": \"1F9E2\",\n \"shortnames\": [\n \"billed_cap\"\n ]\n },\n {\n \"unified\": \"1FA96\",\n \"shortnames\": [\n \"military_helmet\"\n ]\n },\n {\n \"unified\": \"26D1-FE0F\",\n \"shortnames\": [\n \"helmet_with_white_cross\"\n ]\n },\n {\n \"unified\": \"1F4FF\",\n \"shortnames\": [\n \"prayer_beads\"\n ]\n },\n {\n \"unified\": \"1F484\",\n \"shortnames\": [\n \"lipstick\"\n ]\n },\n {\n \"unified\": \"1F48D\",\n \"shortnames\": [\n \"ring\"\n ]\n },\n {\n \"unified\": \"1F48E\",\n \"shortnames\": [\n \"gem\"\n ]\n },\n {\n \"unified\": \"1F507\",\n \"shortnames\": [\n \"mute\"\n ]\n },\n {\n \"unified\": \"1F508\",\n \"shortnames\": [\n \"speaker\"\n ]\n },\n {\n \"unified\": \"1F509\",\n \"shortnames\": [\n \"sound\"\n ]\n },\n {\n \"unified\": \"1F50A\",\n \"shortnames\": [\n \"loud_sound\"\n ]\n },\n {\n \"unified\": \"1F4E2\",\n \"shortnames\": [\n \"loudspeaker\"\n ]\n },\n {\n \"unified\": \"1F4E3\",\n \"shortnames\": [\n \"mega\"\n ]\n },\n {\n \"unified\": \"1F4EF\",\n \"shortnames\": [\n \"postal_horn\"\n ]\n },\n {\n \"unified\": \"1F514\",\n \"shortnames\": [\n \"bell\"\n ]\n },\n {\n \"unified\": \"1F515\",\n \"shortnames\": [\n \"no_bell\"\n ]\n },\n {\n \"unified\": \"1F3BC\",\n \"shortnames\": [\n \"musical_score\"\n ]\n },\n {\n \"unified\": \"1F3B5\",\n \"shortnames\": [\n \"musical_note\"\n ]\n },\n {\n \"unified\": \"1F3B6\",\n \"shortnames\": [\n \"notes\"\n ]\n },\n {\n \"unified\": \"1F399-FE0F\",\n \"shortnames\": [\n \"studio_microphone\"\n ]\n },\n {\n \"unified\": \"1F39A-FE0F\",\n \"shortnames\": [\n \"level_slider\"\n ]\n },\n {\n \"unified\": \"1F39B-FE0F\",\n \"shortnames\": [\n \"control_knobs\"\n ]\n },\n {\n \"unified\": \"1F3A4\",\n \"shortnames\": [\n \"microphone\"\n ]\n },\n {\n \"unified\": \"1F3A7\",\n \"shortnames\": [\n \"headphones\"\n ]\n },\n {\n \"unified\": \"1F4FB\",\n \"shortnames\": [\n \"radio\"\n ]\n },\n {\n \"unified\": \"1F3B7\",\n \"shortnames\": [\n \"saxophone\"\n ]\n },\n {\n \"unified\": \"1FA97\",\n \"shortnames\": [\n \"accordion\"\n ]\n },\n {\n \"unified\": \"1F3B8\",\n \"shortnames\": [\n \"guitar\"\n ]\n },\n {\n \"unified\": \"1F3B9\",\n \"shortnames\": [\n \"musical_keyboard\"\n ]\n },\n {\n \"unified\": \"1F3BA\",\n \"shortnames\": [\n \"trumpet\"\n ]\n },\n {\n \"unified\": \"1F3BB\",\n \"shortnames\": [\n \"violin\"\n ]\n },\n {\n \"unified\": \"1FA95\",\n \"shortnames\": [\n \"banjo\"\n ]\n },\n {\n \"unified\": \"1F941\",\n \"shortnames\": [\n \"drum_with_drumsticks\"\n ]\n },\n {\n \"unified\": \"1FA98\",\n \"shortnames\": [\n \"long_drum\"\n ]\n },\n {\n \"unified\": \"1F4F1\",\n \"shortnames\": [\n \"iphone\"\n ]\n },\n {\n \"unified\": \"1F4F2\",\n \"shortnames\": [\n \"calling\"\n ]\n },\n {\n \"unified\": \"260E-FE0F\",\n \"shortnames\": [\n \"phone\"\n ]\n },\n {\n \"unified\": \"1F4DE\",\n \"shortnames\": [\n \"telephone_receiver\"\n ]\n },\n {\n \"unified\": \"1F4DF\",\n \"shortnames\": [\n \"pager\"\n ]\n },\n {\n \"unified\": \"1F4E0\",\n \"shortnames\": [\n \"fax\"\n ]\n },\n {\n \"unified\": \"1F50B\",\n \"shortnames\": [\n \"battery\"\n ]\n },\n {\n \"unified\": \"1F50C\",\n \"shortnames\": [\n \"electric_plug\"\n ]\n },\n {\n \"unified\": \"1F4BB\",\n \"shortnames\": [\n \"computer\"\n ]\n },\n {\n \"unified\": \"1F5A5-FE0F\",\n \"shortnames\": [\n \"desktop_computer\"\n ]\n },\n {\n \"unified\": \"1F5A8-FE0F\",\n \"shortnames\": [\n \"printer\"\n ]\n },\n {\n \"unified\": \"2328-FE0F\",\n \"shortnames\": [\n \"keyboard\"\n ]\n },\n {\n \"unified\": \"1F5B1-FE0F\",\n \"shortnames\": [\n \"three_button_mouse\"\n ]\n },\n {\n \"unified\": \"1F5B2-FE0F\",\n \"shortnames\": [\n \"trackball\"\n ]\n },\n {\n \"unified\": \"1F4BD\",\n \"shortnames\": [\n \"minidisc\"\n ]\n },\n {\n \"unified\": \"1F4BE\",\n \"shortnames\": [\n \"floppy_disk\"\n ]\n },\n {\n \"unified\": \"1F4BF\",\n \"shortnames\": [\n \"cd\"\n ]\n },\n {\n \"unified\": \"1F4C0\",\n \"shortnames\": [\n \"dvd\"\n ]\n },\n {\n \"unified\": \"1F9EE\",\n \"shortnames\": [\n \"abacus\"\n ]\n },\n {\n \"unified\": \"1F3A5\",\n \"shortnames\": [\n \"movie_camera\"\n ]\n },\n {\n \"unified\": \"1F39E-FE0F\",\n \"shortnames\": [\n \"film_frames\"\n ]\n },\n {\n \"unified\": \"1F4FD-FE0F\",\n \"shortnames\": [\n \"film_projector\"\n ]\n },\n {\n \"unified\": \"1F3AC\",\n \"shortnames\": [\n \"clapper\"\n ]\n },\n {\n \"unified\": \"1F4FA\",\n \"shortnames\": [\n \"tv\"\n ]\n },\n {\n \"unified\": \"1F4F7\",\n \"shortnames\": [\n \"camera\"\n ]\n },\n {\n \"unified\": \"1F4F8\",\n \"shortnames\": [\n \"camera_with_flash\"\n ]\n },\n {\n \"unified\": \"1F4F9\",\n \"shortnames\": [\n \"video_camera\"\n ]\n },\n {\n \"unified\": \"1F4FC\",\n \"shortnames\": [\n \"vhs\"\n ]\n },\n {\n \"unified\": \"1F50D\",\n \"shortnames\": [\n \"mag\"\n ]\n },\n {\n \"unified\": \"1F50E\",\n \"shortnames\": [\n \"mag_right\"\n ]\n },\n {\n \"unified\": \"1F56F-FE0F\",\n \"shortnames\": [\n \"candle\"\n ]\n },\n {\n \"unified\": \"1F4A1\",\n \"shortnames\": [\n \"bulb\"\n ]\n },\n {\n \"unified\": \"1F526\",\n \"shortnames\": [\n \"flashlight\"\n ]\n },\n {\n \"unified\": \"1F3EE\",\n \"shortnames\": [\n \"izakaya_lantern\"\n ]\n },\n {\n \"unified\": \"1FA94\",\n \"shortnames\": [\n \"diya_lamp\"\n ]\n },\n {\n \"unified\": \"1F4D4\",\n \"shortnames\": [\n \"notebook_with_decorative_cover\"\n ]\n },\n {\n \"unified\": \"1F4D5\",\n \"shortnames\": [\n \"closed_book\"\n ]\n },\n {\n \"unified\": \"1F4D6\",\n \"shortnames\": [\n \"book\"\n ]\n },\n {\n \"unified\": \"1F4D7\",\n \"shortnames\": [\n \"green_book\"\n ]\n },\n {\n \"unified\": \"1F4D8\",\n \"shortnames\": [\n \"blue_book\"\n ]\n },\n {\n \"unified\": \"1F4D9\",\n \"shortnames\": [\n \"orange_book\"\n ]\n },\n {\n \"unified\": \"1F4DA\",\n \"shortnames\": [\n \"books\"\n ]\n },\n {\n \"unified\": \"1F4D3\",\n \"shortnames\": [\n \"notebook\"\n ]\n },\n {\n \"unified\": \"1F4D2\",\n \"shortnames\": [\n \"ledger\"\n ]\n },\n {\n \"unified\": \"1F4C3\",\n \"shortnames\": [\n \"page_with_curl\"\n ]\n },\n {\n \"unified\": \"1F4DC\",\n \"shortnames\": [\n \"scroll\"\n ]\n },\n {\n \"unified\": \"1F4C4\",\n \"shortnames\": [\n \"page_facing_up\"\n ]\n },\n {\n \"unified\": \"1F4F0\",\n \"shortnames\": [\n \"newspaper\"\n ]\n },\n {\n \"unified\": \"1F5DE-FE0F\",\n \"shortnames\": [\n \"rolled_up_newspaper\"\n ]\n },\n {\n \"unified\": \"1F4D1\",\n \"shortnames\": [\n \"bookmark_tabs\"\n ]\n },\n {\n \"unified\": \"1F516\",\n \"shortnames\": [\n \"bookmark\"\n ]\n },\n {\n \"unified\": \"1F3F7-FE0F\",\n \"shortnames\": [\n \"label\"\n ]\n },\n {\n \"unified\": \"1F4B0\",\n \"shortnames\": [\n \"moneybag\"\n ]\n },\n {\n \"unified\": \"1FA99\",\n \"shortnames\": [\n \"coin\"\n ]\n },\n {\n \"unified\": \"1F4B4\",\n \"shortnames\": [\n \"yen\"\n ]\n },\n {\n \"unified\": \"1F4B5\",\n \"shortnames\": [\n \"dollar\"\n ]\n },\n {\n \"unified\": \"1F4B6\",\n \"shortnames\": [\n \"euro\"\n ]\n },\n {\n \"unified\": \"1F4B7\",\n \"shortnames\": [\n \"pound\"\n ]\n },\n {\n \"unified\": \"1F4B8\",\n \"shortnames\": [\n \"money_with_wings\"\n ]\n },\n {\n \"unified\": \"1F4B3\",\n \"shortnames\": [\n \"credit_card\"\n ]\n },\n {\n \"unified\": \"1F9FE\",\n \"shortnames\": [\n \"receipt\"\n ]\n },\n {\n \"unified\": \"1F4B9\",\n \"shortnames\": [\n \"chart\"\n ]\n },\n {\n \"unified\": \"2709-FE0F\",\n \"shortnames\": [\n \"email\"\n ]\n },\n {\n \"unified\": \"1F4E7\",\n \"shortnames\": [\n \"e-mail\"\n ]\n },\n {\n \"unified\": \"1F4E8\",\n \"shortnames\": [\n \"incoming_envelope\"\n ]\n },\n {\n \"unified\": \"1F4E9\",\n \"shortnames\": [\n \"envelope_with_arrow\"\n ]\n },\n {\n \"unified\": \"1F4E4\",\n \"shortnames\": [\n \"outbox_tray\"\n ]\n },\n {\n \"unified\": \"1F4E5\",\n \"shortnames\": [\n \"inbox_tray\"\n ]\n },\n {\n \"unified\": \"1F4E6\",\n \"shortnames\": [\n \"package\"\n ]\n },\n {\n \"unified\": \"1F4EB\",\n \"shortnames\": [\n \"mailbox\"\n ]\n },\n {\n \"unified\": \"1F4EA\",\n \"shortnames\": [\n \"mailbox_closed\"\n ]\n },\n {\n \"unified\": \"1F4EC\",\n \"shortnames\": [\n \"mailbox_with_mail\"\n ]\n },\n {\n \"unified\": \"1F4ED\",\n \"shortnames\": [\n \"mailbox_with_no_mail\"\n ]\n },\n {\n \"unified\": \"1F4EE\",\n \"shortnames\": [\n \"postbox\"\n ]\n },\n {\n \"unified\": \"1F5F3-FE0F\",\n \"shortnames\": [\n \"ballot_box_with_ballot\"\n ]\n },\n {\n \"unified\": \"270F-FE0F\",\n \"shortnames\": [\n \"pencil2\"\n ]\n },\n {\n \"unified\": \"2712-FE0F\",\n \"shortnames\": [\n \"black_nib\"\n ]\n },\n {\n \"unified\": \"1F58B-FE0F\",\n \"shortnames\": [\n \"lower_left_fountain_pen\"\n ]\n },\n {\n \"unified\": \"1F58A-FE0F\",\n \"shortnames\": [\n \"lower_left_ballpoint_pen\"\n ]\n },\n {\n \"unified\": \"1F58C-FE0F\",\n \"shortnames\": [\n \"lower_left_paintbrush\"\n ]\n },\n {\n \"unified\": \"1F58D-FE0F\",\n \"shortnames\": [\n \"lower_left_crayon\"\n ]\n },\n {\n \"unified\": \"1F4DD\",\n \"shortnames\": [\n \"memo\"\n ]\n },\n {\n \"unified\": \"1F4BC\",\n \"shortnames\": [\n \"briefcase\"\n ]\n },\n {\n \"unified\": \"1F4C1\",\n \"shortnames\": [\n \"file_folder\"\n ]\n },\n {\n \"unified\": \"1F4C2\",\n \"shortnames\": [\n \"open_file_folder\"\n ]\n },\n {\n \"unified\": \"1F5C2-FE0F\",\n \"shortnames\": [\n \"card_index_dividers\"\n ]\n },\n {\n \"unified\": \"1F4C5\",\n \"shortnames\": [\n \"date\"\n ]\n },\n {\n \"unified\": \"1F4C6\",\n \"shortnames\": [\n \"calendar\"\n ]\n },\n {\n \"unified\": \"1F5D2-FE0F\",\n \"shortnames\": [\n \"spiral_note_pad\"\n ]\n },\n {\n \"unified\": \"1F5D3-FE0F\",\n \"shortnames\": [\n \"spiral_calendar_pad\"\n ]\n },\n {\n \"unified\": \"1F4C7\",\n \"shortnames\": [\n \"card_index\"\n ]\n },\n {\n \"unified\": \"1F4C8\",\n \"shortnames\": [\n \"chart_with_upwards_trend\"\n ]\n },\n {\n \"unified\": \"1F4C9\",\n \"shortnames\": [\n \"chart_with_downwards_trend\"\n ]\n },\n {\n \"unified\": \"1F4CA\",\n \"shortnames\": [\n \"bar_chart\"\n ]\n },\n {\n \"unified\": \"1F4CB\",\n \"shortnames\": [\n \"clipboard\"\n ]\n },\n {\n \"unified\": \"1F4CC\",\n \"shortnames\": [\n \"pushpin\"\n ]\n },\n {\n \"unified\": \"1F4CD\",\n \"shortnames\": [\n \"round_pushpin\"\n ]\n },\n {\n \"unified\": \"1F4CE\",\n \"shortnames\": [\n \"paperclip\"\n ]\n },\n {\n \"unified\": \"1F587-FE0F\",\n \"shortnames\": [\n \"linked_paperclips\"\n ]\n },\n {\n \"unified\": \"1F4CF\",\n \"shortnames\": [\n \"straight_ruler\"\n ]\n },\n {\n \"unified\": \"1F4D0\",\n \"shortnames\": [\n \"triangular_ruler\"\n ]\n },\n {\n \"unified\": \"2702-FE0F\",\n \"shortnames\": [\n \"scissors\"\n ]\n },\n {\n \"unified\": \"1F5C3-FE0F\",\n \"shortnames\": [\n \"card_file_box\"\n ]\n },\n {\n \"unified\": \"1F5C4-FE0F\",\n \"shortnames\": [\n \"file_cabinet\"\n ]\n },\n {\n \"unified\": \"1F5D1-FE0F\",\n \"shortnames\": [\n \"wastebasket\"\n ]\n },\n {\n \"unified\": \"1F512\",\n \"shortnames\": [\n \"lock\"\n ]\n },\n {\n \"unified\": \"1F513\",\n \"shortnames\": [\n \"unlock\"\n ]\n },\n {\n \"unified\": \"1F50F\",\n \"shortnames\": [\n \"lock_with_ink_pen\"\n ]\n },\n {\n \"unified\": \"1F510\",\n \"shortnames\": [\n \"closed_lock_with_key\"\n ]\n },\n {\n \"unified\": \"1F511\",\n \"shortnames\": [\n \"key\"\n ]\n },\n {\n \"unified\": \"1F5DD-FE0F\",\n \"shortnames\": [\n \"old_key\"\n ]\n },\n {\n \"unified\": \"1F528\",\n \"shortnames\": [\n \"hammer\"\n ]\n },\n {\n \"unified\": \"1FA93\",\n \"shortnames\": [\n \"axe\"\n ]\n },\n {\n \"unified\": \"26CF-FE0F\",\n \"shortnames\": [\n \"pick\"\n ]\n },\n {\n \"unified\": \"2692-FE0F\",\n \"shortnames\": [\n \"hammer_and_pick\"\n ]\n },\n {\n \"unified\": \"1F6E0-FE0F\",\n \"shortnames\": [\n \"hammer_and_wrench\"\n ]\n },\n {\n \"unified\": \"1F5E1-FE0F\",\n \"shortnames\": [\n \"dagger_knife\"\n ]\n },\n {\n \"unified\": \"2694-FE0F\",\n \"shortnames\": [\n \"crossed_swords\"\n ]\n },\n {\n \"unified\": \"1F52B\",\n \"shortnames\": [\n \"gun\"\n ]\n },\n {\n \"unified\": \"1FA83\",\n \"shortnames\": [\n \"boomerang\"\n ]\n },\n {\n \"unified\": \"1F3F9\",\n \"shortnames\": [\n \"bow_and_arrow\"\n ]\n },\n {\n \"unified\": \"1F6E1-FE0F\",\n \"shortnames\": [\n \"shield\"\n ]\n },\n {\n \"unified\": \"1FA9A\",\n \"shortnames\": [\n \"carpentry_saw\"\n ]\n },\n {\n \"unified\": \"1F527\",\n \"shortnames\": [\n \"wrench\"\n ]\n },\n {\n \"unified\": \"1FA9B\",\n \"shortnames\": [\n \"screwdriver\"\n ]\n },\n {\n \"unified\": \"1F529\",\n \"shortnames\": [\n \"nut_and_bolt\"\n ]\n },\n {\n \"unified\": \"2699-FE0F\",\n \"shortnames\": [\n \"gear\"\n ]\n },\n {\n \"unified\": \"1F5DC-FE0F\",\n \"shortnames\": [\n \"compression\"\n ]\n },\n {\n \"unified\": \"2696-FE0F\",\n \"shortnames\": [\n \"scales\"\n ]\n },\n {\n \"unified\": \"1F9AF\",\n \"shortnames\": [\n \"probing_cane\"\n ]\n },\n {\n \"unified\": \"1F517\",\n \"shortnames\": [\n \"link\"\n ]\n },\n {\n \"unified\": \"26D3-FE0F\",\n \"shortnames\": [\n \"chains\"\n ]\n },\n {\n \"unified\": \"1FA9D\",\n \"shortnames\": [\n \"hook\"\n ]\n },\n {\n \"unified\": \"1F9F0\",\n \"shortnames\": [\n \"toolbox\"\n ]\n },\n {\n \"unified\": \"1F9F2\",\n \"shortnames\": [\n \"magnet\"\n ]\n },\n {\n \"unified\": \"1FA9C\",\n \"shortnames\": [\n \"ladder\"\n ]\n },\n {\n \"unified\": \"2697-FE0F\",\n \"shortnames\": [\n \"alembic\"\n ]\n },\n {\n \"unified\": \"1F9EA\",\n \"shortnames\": [\n \"test_tube\"\n ]\n },\n {\n \"unified\": \"1F9EB\",\n \"shortnames\": [\n \"petri_dish\"\n ]\n },\n {\n \"unified\": \"1F9EC\",\n \"shortnames\": [\n \"dna\"\n ]\n },\n {\n \"unified\": \"1F52C\",\n \"shortnames\": [\n \"microscope\"\n ]\n },\n {\n \"unified\": \"1F52D\",\n \"shortnames\": [\n \"telescope\"\n ]\n },\n {\n \"unified\": \"1F4E1\",\n \"shortnames\": [\n \"satellite_antenna\"\n ]\n },\n {\n \"unified\": \"1F489\",\n \"shortnames\": [\n \"syringe\"\n ]\n },\n {\n \"unified\": \"1FA78\",\n \"shortnames\": [\n \"drop_of_blood\"\n ]\n },\n {\n \"unified\": \"1F48A\",\n \"shortnames\": [\n \"pill\"\n ]\n },\n {\n \"unified\": \"1FA79\",\n \"shortnames\": [\n \"adhesive_bandage\"\n ]\n },\n {\n \"unified\": \"1FA7A\",\n \"shortnames\": [\n \"stethoscope\"\n ]\n },\n {\n \"unified\": \"1F6AA\",\n \"shortnames\": [\n \"door\"\n ]\n },\n {\n \"unified\": \"1F6D7\",\n \"shortnames\": [\n \"elevator\"\n ]\n },\n {\n \"unified\": \"1FA9E\",\n \"shortnames\": [\n \"mirror\"\n ]\n },\n {\n \"unified\": \"1FA9F\",\n \"shortnames\": [\n \"window\"\n ]\n },\n {\n \"unified\": \"1F6CF-FE0F\",\n \"shortnames\": [\n \"bed\"\n ]\n },\n {\n \"unified\": \"1F6CB-FE0F\",\n \"shortnames\": [\n \"couch_and_lamp\"\n ]\n },\n {\n \"unified\": \"1FA91\",\n \"shortnames\": [\n \"chair\"\n ]\n },\n {\n \"unified\": \"1F6BD\",\n \"shortnames\": [\n \"toilet\"\n ]\n },\n {\n \"unified\": \"1FAA0\",\n \"shortnames\": [\n \"plunger\"\n ]\n },\n {\n \"unified\": \"1F6BF\",\n \"shortnames\": [\n \"shower\"\n ]\n },\n {\n \"unified\": \"1F6C1\",\n \"shortnames\": [\n \"bathtub\"\n ]\n },\n {\n \"unified\": \"1FAA4\",\n \"shortnames\": [\n \"mouse_trap\"\n ]\n },\n {\n \"unified\": \"1FA92\",\n \"shortnames\": [\n \"razor\"\n ]\n },\n {\n \"unified\": \"1F9F4\",\n \"shortnames\": [\n \"lotion_bottle\"\n ]\n },\n {\n \"unified\": \"1F9F7\",\n \"shortnames\": [\n \"safety_pin\"\n ]\n },\n {\n \"unified\": \"1F9F9\",\n \"shortnames\": [\n \"broom\"\n ]\n },\n {\n \"unified\": \"1F9FA\",\n \"shortnames\": [\n \"basket\"\n ]\n },\n {\n \"unified\": \"1F9FB\",\n \"shortnames\": [\n \"roll_of_paper\"\n ]\n },\n {\n \"unified\": \"1FAA3\",\n \"shortnames\": [\n \"bucket\"\n ]\n },\n {\n \"unified\": \"1F9FC\",\n \"shortnames\": [\n \"soap\"\n ]\n },\n {\n \"unified\": \"1FAA5\",\n \"shortnames\": [\n \"toothbrush\"\n ]\n },\n {\n \"unified\": \"1F9FD\",\n \"shortnames\": [\n \"sponge\"\n ]\n },\n {\n \"unified\": \"1F9EF\",\n \"shortnames\": [\n \"fire_extinguisher\"\n ]\n },\n {\n \"unified\": \"1F6D2\",\n \"shortnames\": [\n \"shopping_trolley\"\n ]\n },\n {\n \"unified\": \"1F6AC\",\n \"shortnames\": [\n \"smoking\"\n ]\n },\n {\n \"unified\": \"26B0-FE0F\",\n \"shortnames\": [\n \"coffin\"\n ]\n },\n {\n \"unified\": \"1FAA6\",\n \"shortnames\": [\n \"headstone\"\n ]\n },\n {\n \"unified\": \"26B1-FE0F\",\n \"shortnames\": [\n \"funeral_urn\"\n ]\n },\n {\n \"unified\": \"1F5FF\",\n \"shortnames\": [\n \"moyai\"\n ]\n },\n {\n \"unified\": \"1FAA7\",\n \"shortnames\": [\n \"placard\"\n ]\n }\n ]\n },\n {\n \"name\": \"Symbols\",\n \"emojis\": [\n {\n \"unified\": \"1F3E7\",\n \"shortnames\": [\n \"atm\"\n ]\n },\n {\n \"unified\": \"1F6AE\",\n \"shortnames\": [\n \"put_litter_in_its_place\"\n ]\n },\n {\n \"unified\": \"1F6B0\",\n \"shortnames\": [\n \"potable_water\"\n ]\n },\n {\n \"unified\": \"267F\",\n \"shortnames\": [\n \"wheelchair\"\n ]\n },\n {\n \"unified\": \"1F6B9\",\n \"shortnames\": [\n \"mens\"\n ]\n },\n {\n \"unified\": \"1F6BA\",\n \"shortnames\": [\n \"womens\"\n ]\n },\n {\n \"unified\": \"1F6BB\",\n \"shortnames\": [\n \"restroom\"\n ]\n },\n {\n \"unified\": \"1F6BC\",\n \"shortnames\": [\n \"baby_symbol\"\n ]\n },\n {\n \"unified\": \"1F6BE\",\n \"shortnames\": [\n \"wc\"\n ]\n },\n {\n \"unified\": \"1F6C2\",\n \"shortnames\": [\n \"passport_control\"\n ]\n },\n {\n \"unified\": \"1F6C3\",\n \"shortnames\": [\n \"customs\"\n ]\n },\n {\n \"unified\": \"1F6C4\",\n \"shortnames\": [\n \"baggage_claim\"\n ]\n },\n {\n \"unified\": \"1F6C5\",\n \"shortnames\": [\n \"left_luggage\"\n ]\n },\n {\n \"unified\": \"26A0-FE0F\",\n \"shortnames\": [\n \"warning\"\n ]\n },\n {\n \"unified\": \"1F6B8\",\n \"shortnames\": [\n \"children_crossing\"\n ]\n },\n {\n \"unified\": \"26D4\",\n \"shortnames\": [\n \"no_entry\"\n ]\n },\n {\n \"unified\": \"1F6AB\",\n \"shortnames\": [\n \"no_entry_sign\"\n ]\n },\n {\n \"unified\": \"1F6B3\",\n \"shortnames\": [\n \"no_bicycles\"\n ]\n },\n {\n \"unified\": \"1F6AD\",\n \"shortnames\": [\n \"no_smoking\"\n ]\n },\n {\n \"unified\": \"1F6AF\",\n \"shortnames\": [\n \"do_not_litter\"\n ]\n },\n {\n \"unified\": \"1F6B1\",\n \"shortnames\": [\n \"non-potable_water\"\n ]\n },\n {\n \"unified\": \"1F6B7\",\n \"shortnames\": [\n \"no_pedestrians\"\n ]\n },\n {\n \"unified\": \"1F4F5\",\n \"shortnames\": [\n \"no_mobile_phones\"\n ]\n },\n {\n \"unified\": \"1F51E\",\n \"shortnames\": [\n \"underage\"\n ]\n },\n {\n \"unified\": \"2622-FE0F\",\n \"shortnames\": [\n \"radioactive_sign\"\n ]\n },\n {\n \"unified\": \"2623-FE0F\",\n \"shortnames\": [\n \"biohazard_sign\"\n ]\n },\n {\n \"unified\": \"2B06-FE0F\",\n \"shortnames\": [\n \"arrow_up\"\n ]\n },\n {\n \"unified\": \"2197-FE0F\",\n \"shortnames\": [\n \"arrow_upper_right\"\n ]\n },\n {\n \"unified\": \"27A1-FE0F\",\n \"shortnames\": [\n \"arrow_right\"\n ]\n },\n {\n \"unified\": \"2198-FE0F\",\n \"shortnames\": [\n \"arrow_lower_right\"\n ]\n },\n {\n \"unified\": \"2B07-FE0F\",\n \"shortnames\": [\n \"arrow_down\"\n ]\n },\n {\n \"unified\": \"2199-FE0F\",\n \"shortnames\": [\n \"arrow_lower_left\"\n ]\n },\n {\n \"unified\": \"2B05-FE0F\",\n \"shortnames\": [\n \"arrow_left\"\n ]\n },\n {\n \"unified\": \"2196-FE0F\",\n \"shortnames\": [\n \"arrow_upper_left\"\n ]\n },\n {\n \"unified\": \"2195-FE0F\",\n \"shortnames\": [\n \"arrow_up_down\"\n ]\n },\n {\n \"unified\": \"2194-FE0F\",\n \"shortnames\": [\n \"left_right_arrow\"\n ]\n },\n {\n \"unified\": \"21A9-FE0F\",\n \"shortnames\": [\n \"leftwards_arrow_with_hook\"\n ]\n },\n {\n \"unified\": \"21AA-FE0F\",\n \"shortnames\": [\n \"arrow_right_hook\"\n ]\n },\n {\n \"unified\": \"2934-FE0F\",\n \"shortnames\": [\n \"arrow_heading_up\"\n ]\n },\n {\n \"unified\": \"2935-FE0F\",\n \"shortnames\": [\n \"arrow_heading_down\"\n ]\n },\n {\n \"unified\": \"1F503\",\n \"shortnames\": [\n \"arrows_clockwise\"\n ]\n },\n {\n \"unified\": \"1F504\",\n \"shortnames\": [\n \"arrows_counterclockwise\"\n ]\n },\n {\n \"unified\": \"1F519\",\n \"shortnames\": [\n \"back\"\n ]\n },\n {\n \"unified\": \"1F51A\",\n \"shortnames\": [\n \"end\"\n ]\n },\n {\n \"unified\": \"1F51B\",\n \"shortnames\": [\n \"on\"\n ]\n },\n {\n \"unified\": \"1F51C\",\n \"shortnames\": [\n \"soon\"\n ]\n },\n {\n \"unified\": \"1F51D\",\n \"shortnames\": [\n \"top\"\n ]\n },\n {\n \"unified\": \"1F6D0\",\n \"shortnames\": [\n \"place_of_worship\"\n ]\n },\n {\n \"unified\": \"269B-FE0F\",\n \"shortnames\": [\n \"atom_symbol\"\n ]\n },\n {\n \"unified\": \"1F549-FE0F\",\n \"shortnames\": [\n \"om_symbol\"\n ]\n },\n {\n \"unified\": \"2721-FE0F\",\n \"shortnames\": [\n \"star_of_david\"\n ]\n },\n {\n \"unified\": \"2638-FE0F\",\n \"shortnames\": [\n \"wheel_of_dharma\"\n ]\n },\n {\n \"unified\": \"262F-FE0F\",\n \"shortnames\": [\n \"yin_yang\"\n ]\n },\n {\n \"unified\": \"271D-FE0F\",\n \"shortnames\": [\n \"latin_cross\"\n ]\n },\n {\n \"unified\": \"2626-FE0F\",\n \"shortnames\": [\n \"orthodox_cross\"\n ]\n },\n {\n \"unified\": \"262A-FE0F\",\n \"shortnames\": [\n \"star_and_crescent\"\n ]\n },\n {\n \"unified\": \"262E-FE0F\",\n \"shortnames\": [\n \"peace_symbol\"\n ]\n },\n {\n \"unified\": \"1F54E\",\n \"shortnames\": [\n \"menorah_with_nine_branches\"\n ]\n },\n {\n \"unified\": \"1F52F\",\n \"shortnames\": [\n \"six_pointed_star\"\n ]\n },\n {\n \"unified\": \"2648\",\n \"shortnames\": [\n \"aries\"\n ]\n },\n {\n \"unified\": \"2649\",\n \"shortnames\": [\n \"taurus\"\n ]\n },\n {\n \"unified\": \"264A\",\n \"shortnames\": [\n \"gemini\"\n ]\n },\n {\n \"unified\": \"264B\",\n \"shortnames\": [\n \"cancer\"\n ]\n },\n {\n \"unified\": \"264C\",\n \"shortnames\": [\n \"leo\"\n ]\n },\n {\n \"unified\": \"264D\",\n \"shortnames\": [\n \"virgo\"\n ]\n },\n {\n \"unified\": \"264E\",\n \"shortnames\": [\n \"libra\"\n ]\n },\n {\n \"unified\": \"264F\",\n \"shortnames\": [\n \"scorpius\"\n ]\n },\n {\n \"unified\": \"2650\",\n \"shortnames\": [\n \"sagittarius\"\n ]\n },\n {\n \"unified\": \"2651\",\n \"shortnames\": [\n \"capricorn\"\n ]\n },\n {\n \"unified\": \"2652\",\n \"shortnames\": [\n \"aquarius\"\n ]\n },\n {\n \"unified\": \"2653\",\n \"shortnames\": [\n \"pisces\"\n ]\n },\n {\n \"unified\": \"26CE\",\n \"shortnames\": [\n \"ophiuchus\"\n ]\n },\n {\n \"unified\": \"1F500\",\n \"shortnames\": [\n \"twisted_rightwards_arrows\"\n ]\n },\n {\n \"unified\": \"1F501\",\n \"shortnames\": [\n \"repeat\"\n ]\n },\n {\n \"unified\": \"1F502\",\n \"shortnames\": [\n \"repeat_one\"\n ]\n },\n {\n \"unified\": \"25B6-FE0F\",\n \"shortnames\": [\n \"arrow_forward\"\n ]\n },\n {\n \"unified\": \"23E9\",\n \"shortnames\": [\n \"fast_forward\"\n ]\n },\n {\n \"unified\": \"23ED-FE0F\",\n \"shortnames\": [\n \"black_right_pointing_double_triangle_with_vertical_bar\"\n ]\n },\n {\n \"unified\": \"23EF-FE0F\",\n \"shortnames\": [\n \"black_right_pointing_triangle_with_double_vertical_bar\"\n ]\n },\n {\n \"unified\": \"25C0-FE0F\",\n \"shortnames\": [\n \"arrow_backward\"\n ]\n },\n {\n \"unified\": \"23EA\",\n \"shortnames\": [\n \"rewind\"\n ]\n },\n {\n \"unified\": \"23EE-FE0F\",\n \"shortnames\": [\n \"black_left_pointing_double_triangle_with_vertical_bar\"\n ]\n },\n {\n \"unified\": \"1F53C\",\n \"shortnames\": [\n \"arrow_up_small\"\n ]\n },\n {\n \"unified\": \"23EB\",\n \"shortnames\": [\n \"arrow_double_up\"\n ]\n },\n {\n \"unified\": \"1F53D\",\n \"shortnames\": [\n \"arrow_down_small\"\n ]\n },\n {\n \"unified\": \"23EC\",\n \"shortnames\": [\n \"arrow_double_down\"\n ]\n },\n {\n \"unified\": \"23F8-FE0F\",\n \"shortnames\": [\n \"double_vertical_bar\"\n ]\n },\n {\n \"unified\": \"23F9-FE0F\",\n \"shortnames\": [\n \"black_square_for_stop\"\n ]\n },\n {\n \"unified\": \"23FA-FE0F\",\n \"shortnames\": [\n \"black_circle_for_record\"\n ]\n },\n {\n \"unified\": \"23CF-FE0F\",\n \"shortnames\": [\n \"eject\"\n ]\n },\n {\n \"unified\": \"1F3A6\",\n \"shortnames\": [\n \"cinema\"\n ]\n },\n {\n \"unified\": \"1F505\",\n \"shortnames\": [\n \"low_brightness\"\n ]\n },\n {\n \"unified\": \"1F506\",\n \"shortnames\": [\n \"high_brightness\"\n ]\n },\n {\n \"unified\": \"1F4F6\",\n \"shortnames\": [\n \"signal_strength\"\n ]\n },\n {\n \"unified\": \"1F4F3\",\n \"shortnames\": [\n \"vibration_mode\"\n ]\n },\n {\n \"unified\": \"1F4F4\",\n \"shortnames\": [\n \"mobile_phone_off\"\n ]\n },\n {\n \"unified\": \"2640-FE0F\",\n \"shortnames\": [\n \"female_sign\"\n ]\n },\n {\n \"unified\": \"2642-FE0F\",\n \"shortnames\": [\n \"male_sign\"\n ]\n },\n {\n \"unified\": \"26A7-FE0F\",\n \"shortnames\": [\n \"transgender_symbol\"\n ]\n },\n {\n \"unified\": \"2716-FE0F\",\n \"shortnames\": [\n \"heavy_multiplication_x\"\n ]\n },\n {\n \"unified\": \"2795\",\n \"shortnames\": [\n \"heavy_plus_sign\"\n ]\n },\n {\n \"unified\": \"2796\",\n \"shortnames\": [\n \"heavy_minus_sign\"\n ]\n },\n {\n \"unified\": \"2797\",\n \"shortnames\": [\n \"heavy_division_sign\"\n ]\n },\n {\n \"unified\": \"267E-FE0F\",\n \"shortnames\": [\n \"infinity\"\n ]\n },\n {\n \"unified\": \"203C-FE0F\",\n \"shortnames\": [\n \"bangbang\"\n ]\n },\n {\n \"unified\": \"2049-FE0F\",\n \"shortnames\": [\n \"interrobang\"\n ]\n },\n {\n \"unified\": \"2753\",\n \"shortnames\": [\n \"question\"\n ]\n },\n {\n \"unified\": \"2754\",\n \"shortnames\": [\n \"grey_question\"\n ]\n },\n {\n \"unified\": \"2755\",\n \"shortnames\": [\n \"grey_exclamation\"\n ]\n },\n {\n \"unified\": \"2757\",\n \"shortnames\": [\n \"exclamation\"\n ]\n },\n {\n \"unified\": \"3030-FE0F\",\n \"shortnames\": [\n \"wavy_dash\"\n ]\n },\n {\n \"unified\": \"1F4B1\",\n \"shortnames\": [\n \"currency_exchange\"\n ]\n },\n {\n \"unified\": \"1F4B2\",\n \"shortnames\": [\n \"heavy_dollar_sign\"\n ]\n },\n {\n \"unified\": \"2695-FE0F\",\n \"shortnames\": [\n \"medical_symbol\"\n ]\n },\n {\n \"unified\": \"267B-FE0F\",\n \"shortnames\": [\n \"recycle\"\n ]\n },\n {\n \"unified\": \"269C-FE0F\",\n \"shortnames\": [\n \"fleur_de_lis\"\n ]\n },\n {\n \"unified\": \"1F531\",\n \"shortnames\": [\n \"trident\"\n ]\n },\n {\n \"unified\": \"1F4DB\",\n \"shortnames\": [\n \"name_badge\"\n ]\n },\n {\n \"unified\": \"1F530\",\n \"shortnames\": [\n \"beginner\"\n ]\n },\n {\n \"unified\": \"2B55\",\n \"shortnames\": [\n \"o\"\n ]\n },\n {\n \"unified\": \"2705\",\n \"shortnames\": [\n \"white_check_mark\"\n ]\n },\n {\n \"unified\": \"2611-FE0F\",\n \"shortnames\": [\n \"ballot_box_with_check\"\n ]\n },\n {\n \"unified\": \"2714-FE0F\",\n \"shortnames\": [\n \"heavy_check_mark\"\n ]\n },\n {\n \"unified\": \"274C\",\n \"shortnames\": [\n \"x\"\n ]\n },\n {\n \"unified\": \"274E\",\n \"shortnames\": [\n \"negative_squared_cross_mark\"\n ]\n },\n {\n \"unified\": \"27B0\",\n \"shortnames\": [\n \"curly_loop\"\n ]\n },\n {\n \"unified\": \"27BF\",\n \"shortnames\": [\n \"loop\"\n ]\n },\n {\n \"unified\": \"303D-FE0F\",\n \"shortnames\": [\n \"part_alternation_mark\"\n ]\n },\n {\n \"unified\": \"2733-FE0F\",\n \"shortnames\": [\n \"eight_spoked_asterisk\"\n ]\n },\n {\n \"unified\": \"2734-FE0F\",\n \"shortnames\": [\n \"eight_pointed_black_star\"\n ]\n },\n {\n \"unified\": \"2747-FE0F\",\n \"shortnames\": [\n \"sparkle\"\n ]\n },\n {\n \"unified\": \"00A9-FE0F\",\n \"shortnames\": [\n \"copyright\"\n ]\n },\n {\n \"unified\": \"00AE-FE0F\",\n \"shortnames\": [\n \"registered\"\n ]\n },\n {\n \"unified\": \"2122-FE0F\",\n \"shortnames\": [\n \"tm\"\n ]\n },\n {\n \"unified\": \"0023-FE0F-20E3\",\n \"shortnames\": [\n \"hash\"\n ]\n },\n {\n \"unified\": \"002A-FE0F-20E3\",\n \"shortnames\": [\n \"keycap_star\"\n ]\n },\n {\n \"unified\": \"0030-FE0F-20E3\",\n \"shortnames\": [\n \"zero\"\n ]\n },\n {\n \"unified\": \"0031-FE0F-20E3\",\n \"shortnames\": [\n \"one\"\n ]\n },\n {\n \"unified\": \"0032-FE0F-20E3\",\n \"shortnames\": [\n \"two\"\n ]\n },\n {\n \"unified\": \"0033-FE0F-20E3\",\n \"shortnames\": [\n \"three\"\n ]\n },\n {\n \"unified\": \"0034-FE0F-20E3\",\n \"shortnames\": [\n \"four\"\n ]\n },\n {\n \"unified\": \"0035-FE0F-20E3\",\n \"shortnames\": [\n \"five\"\n ]\n },\n {\n \"unified\": \"0036-FE0F-20E3\",\n \"shortnames\": [\n \"six\"\n ]\n },\n {\n \"unified\": \"0037-FE0F-20E3\",\n \"shortnames\": [\n \"seven\"\n ]\n },\n {\n \"unified\": \"0038-FE0F-20E3\",\n \"shortnames\": [\n \"eight\"\n ]\n },\n {\n \"unified\": \"0039-FE0F-20E3\",\n \"shortnames\": [\n \"nine\"\n ]\n },\n {\n \"unified\": \"1F51F\",\n \"shortnames\": [\n \"keycap_ten\"\n ]\n },\n {\n \"unified\": \"1F520\",\n \"shortnames\": [\n \"capital_abcd\"\n ]\n },\n {\n \"unified\": \"1F521\",\n \"shortnames\": [\n \"abcd\"\n ]\n },\n {\n \"unified\": \"1F522\",\n \"shortnames\": [\n \"1234\"\n ]\n },\n {\n \"unified\": \"1F523\",\n \"shortnames\": [\n \"symbols\"\n ]\n },\n {\n \"unified\": \"1F524\",\n \"shortnames\": [\n \"abc\"\n ]\n },\n {\n \"unified\": \"1F170-FE0F\",\n \"shortnames\": [\n \"a\"\n ]\n },\n {\n \"unified\": \"1F18E\",\n \"shortnames\": [\n \"ab\"\n ]\n },\n {\n \"unified\": \"1F171-FE0F\",\n \"shortnames\": [\n \"b\"\n ]\n },\n {\n \"unified\": \"1F191\",\n \"shortnames\": [\n \"cl\"\n ]\n },\n {\n \"unified\": \"1F192\",\n \"shortnames\": [\n \"cool\"\n ]\n },\n {\n \"unified\": \"1F193\",\n \"shortnames\": [\n \"free\"\n ]\n },\n {\n \"unified\": \"2139-FE0F\",\n \"shortnames\": [\n \"information_source\"\n ]\n },\n {\n \"unified\": \"1F194\",\n \"shortnames\": [\n \"id\"\n ]\n },\n {\n \"unified\": \"24C2-FE0F\",\n \"shortnames\": [\n \"m\"\n ]\n },\n {\n \"unified\": \"1F195\",\n \"shortnames\": [\n \"new\"\n ]\n },\n {\n \"unified\": \"1F196\",\n \"shortnames\": [\n \"ng\"\n ]\n },\n {\n \"unified\": \"1F17E-FE0F\",\n \"shortnames\": [\n \"o2\"\n ]\n },\n {\n \"unified\": \"1F197\",\n \"shortnames\": [\n \"ok\"\n ]\n },\n {\n \"unified\": \"1F17F-FE0F\",\n \"shortnames\": [\n \"parking\"\n ]\n },\n {\n \"unified\": \"1F198\",\n \"shortnames\": [\n \"sos\"\n ]\n },\n {\n \"unified\": \"1F199\",\n \"shortnames\": [\n \"up\"\n ]\n },\n {\n \"unified\": \"1F19A\",\n \"shortnames\": [\n \"vs\"\n ]\n },\n {\n \"unified\": \"1F201\",\n \"shortnames\": [\n \"koko\"\n ]\n },\n {\n \"unified\": \"1F202-FE0F\",\n \"shortnames\": [\n \"sa\"\n ]\n },\n {\n \"unified\": \"1F237-FE0F\",\n \"shortnames\": [\n \"u6708\"\n ]\n },\n {\n \"unified\": \"1F236\",\n \"shortnames\": [\n \"u6709\"\n ]\n },\n {\n \"unified\": \"1F22F\",\n \"shortnames\": [\n \"u6307\"\n ]\n },\n {\n \"unified\": \"1F250\",\n \"shortnames\": [\n \"ideograph_advantage\"\n ]\n },\n {\n \"unified\": \"1F239\",\n \"shortnames\": [\n \"u5272\"\n ]\n },\n {\n \"unified\": \"1F21A\",\n \"shortnames\": [\n \"u7121\"\n ]\n },\n {\n \"unified\": \"1F232\",\n \"shortnames\": [\n \"u7981\"\n ]\n },\n {\n \"unified\": \"1F251\",\n \"shortnames\": [\n \"accept\"\n ]\n },\n {\n \"unified\": \"1F238\",\n \"shortnames\": [\n \"u7533\"\n ]\n },\n {\n \"unified\": \"1F234\",\n \"shortnames\": [\n \"u5408\"\n ]\n },\n {\n \"unified\": \"1F233\",\n \"shortnames\": [\n \"u7a7a\"\n ]\n },\n {\n \"unified\": \"3297-FE0F\",\n \"shortnames\": [\n \"congratulations\"\n ]\n },\n {\n \"unified\": \"3299-FE0F\",\n \"shortnames\": [\n \"secret\"\n ]\n },\n {\n \"unified\": \"1F23A\",\n \"shortnames\": [\n \"u55b6\"\n ]\n },\n {\n \"unified\": \"1F235\",\n \"shortnames\": [\n \"u6e80\"\n ]\n },\n {\n \"unified\": \"1F534\",\n \"shortnames\": [\n \"red_circle\"\n ]\n },\n {\n \"unified\": \"1F7E0\",\n \"shortnames\": [\n \"large_orange_circle\"\n ]\n },\n {\n \"unified\": \"1F7E1\",\n \"shortnames\": [\n \"large_yellow_circle\"\n ]\n },\n {\n \"unified\": \"1F7E2\",\n \"shortnames\": [\n \"large_green_circle\"\n ]\n },\n {\n \"unified\": \"1F535\",\n \"shortnames\": [\n \"large_blue_circle\"\n ]\n },\n {\n \"unified\": \"1F7E3\",\n \"shortnames\": [\n \"large_purple_circle\"\n ]\n },\n {\n \"unified\": \"1F7E4\",\n \"shortnames\": [\n \"large_brown_circle\"\n ]\n },\n {\n \"unified\": \"26AB\",\n \"shortnames\": [\n \"black_circle\"\n ]\n },\n {\n \"unified\": \"26AA\",\n \"shortnames\": [\n \"white_circle\"\n ]\n },\n {\n \"unified\": \"1F7E5\",\n \"shortnames\": [\n \"large_red_square\"\n ]\n },\n {\n \"unified\": \"1F7E7\",\n \"shortnames\": [\n \"large_orange_square\"\n ]\n },\n {\n \"unified\": \"1F7E8\",\n \"shortnames\": [\n \"large_yellow_square\"\n ]\n },\n {\n \"unified\": \"1F7E9\",\n \"shortnames\": [\n \"large_green_square\"\n ]\n },\n {\n \"unified\": \"1F7E6\",\n \"shortnames\": [\n \"large_blue_square\"\n ]\n },\n {\n \"unified\": \"1F7EA\",\n \"shortnames\": [\n \"large_purple_square\"\n ]\n },\n {\n \"unified\": \"1F7EB\",\n \"shortnames\": [\n \"large_brown_square\"\n ]\n },\n {\n \"unified\": \"2B1B\",\n \"shortnames\": [\n \"black_large_square\"\n ]\n },\n {\n \"unified\": \"2B1C\",\n \"shortnames\": [\n \"white_large_square\"\n ]\n },\n {\n \"unified\": \"25FC-FE0F\",\n \"shortnames\": [\n \"black_medium_square\"\n ]\n },\n {\n \"unified\": \"25FB-FE0F\",\n \"shortnames\": [\n \"white_medium_square\"\n ]\n },\n {\n \"unified\": \"25FE\",\n \"shortnames\": [\n \"black_medium_small_square\"\n ]\n },\n {\n \"unified\": \"25FD\",\n \"shortnames\": [\n \"white_medium_small_square\"\n ]\n },\n {\n \"unified\": \"25AA-FE0F\",\n \"shortnames\": [\n \"black_small_square\"\n ]\n },\n {\n \"unified\": \"25AB-FE0F\",\n \"shortnames\": [\n \"white_small_square\"\n ]\n },\n {\n \"unified\": \"1F536\",\n \"shortnames\": [\n \"large_orange_diamond\"\n ]\n },\n {\n \"unified\": \"1F537\",\n \"shortnames\": [\n \"large_blue_diamond\"\n ]\n },\n {\n \"unified\": \"1F538\",\n \"shortnames\": [\n \"small_orange_diamond\"\n ]\n },\n {\n \"unified\": \"1F539\",\n \"shortnames\": [\n \"small_blue_diamond\"\n ]\n },\n {\n \"unified\": \"1F53A\",\n \"shortnames\": [\n \"small_red_triangle\"\n ]\n },\n {\n \"unified\": \"1F53B\",\n \"shortnames\": [\n \"small_red_triangle_down\"\n ]\n },\n {\n \"unified\": \"1F4A0\",\n \"shortnames\": [\n \"diamond_shape_with_a_dot_inside\"\n ]\n },\n {\n \"unified\": \"1F518\",\n \"shortnames\": [\n \"radio_button\"\n ]\n },\n {\n \"unified\": \"1F533\",\n \"shortnames\": [\n \"white_square_button\"\n ]\n },\n {\n \"unified\": \"1F532\",\n \"shortnames\": [\n \"black_square_button\"\n ]\n }\n ]\n },\n {\n \"name\": \"Flags\",\n \"emojis\": [\n {\n \"unified\": \"1F3C1\",\n \"shortnames\": [\n \"checkered_flag\"\n ]\n },\n {\n \"unified\": \"1F6A9\",\n \"shortnames\": [\n \"triangular_flag_on_post\"\n ]\n },\n {\n \"unified\": \"1F38C\",\n \"shortnames\": [\n \"crossed_flags\"\n ]\n },\n {\n \"unified\": \"1F3F4\",\n \"shortnames\": [\n \"waving_black_flag\"\n ]\n },\n {\n \"unified\": \"1F3F3-FE0F\",\n \"shortnames\": [\n \"waving_white_flag\"\n ]\n },\n {\n \"unified\": \"1F3F3-FE0F-200D-1F308\",\n \"shortnames\": [\n \"rainbow-flag\"\n ]\n },\n {\n \"unified\": \"1F3F3-FE0F-200D-26A7-FE0F\",\n \"shortnames\": [\n \"transgender_flag\"\n ]\n },\n {\n \"unified\": \"1F3F4-200D-2620-FE0F\",\n \"shortnames\": [\n \"pirate_flag\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1E8\",\n \"shortnames\": [\n \"flag-ac\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1E9\",\n \"shortnames\": [\n \"flag-ad\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1EA\",\n \"shortnames\": [\n \"flag-ae\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1EB\",\n \"shortnames\": [\n \"flag-af\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1EC\",\n \"shortnames\": [\n \"flag-ag\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1EE\",\n \"shortnames\": [\n \"flag-ai\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F1\",\n \"shortnames\": [\n \"flag-al\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F2\",\n \"shortnames\": [\n \"flag-am\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F4\",\n \"shortnames\": [\n \"flag-ao\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F6\",\n \"shortnames\": [\n \"flag-aq\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F7\",\n \"shortnames\": [\n \"flag-ar\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F8\",\n \"shortnames\": [\n \"flag-as\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1F9\",\n \"shortnames\": [\n \"flag-at\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1FA\",\n \"shortnames\": [\n \"flag-au\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1FC\",\n \"shortnames\": [\n \"flag-aw\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1FD\",\n \"shortnames\": [\n \"flag-ax\"\n ]\n },\n {\n \"unified\": \"1F1E6-1F1FF\",\n \"shortnames\": [\n \"flag-az\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1E6\",\n \"shortnames\": [\n \"flag-ba\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1E7\",\n \"shortnames\": [\n \"flag-bb\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1E9\",\n \"shortnames\": [\n \"flag-bd\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1EA\",\n \"shortnames\": [\n \"flag-be\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1EB\",\n \"shortnames\": [\n \"flag-bf\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1EC\",\n \"shortnames\": [\n \"flag-bg\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1ED\",\n \"shortnames\": [\n \"flag-bh\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1EE\",\n \"shortnames\": [\n \"flag-bi\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1EF\",\n \"shortnames\": [\n \"flag-bj\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F1\",\n \"shortnames\": [\n \"flag-bl\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F2\",\n \"shortnames\": [\n \"flag-bm\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F3\",\n \"shortnames\": [\n \"flag-bn\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F4\",\n \"shortnames\": [\n \"flag-bo\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F6\",\n \"shortnames\": [\n \"flag-bq\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F7\",\n \"shortnames\": [\n \"flag-br\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F8\",\n \"shortnames\": [\n \"flag-bs\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1F9\",\n \"shortnames\": [\n \"flag-bt\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1FB\",\n \"shortnames\": [\n \"flag-bv\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1FC\",\n \"shortnames\": [\n \"flag-bw\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1FE\",\n \"shortnames\": [\n \"flag-by\"\n ]\n },\n {\n \"unified\": \"1F1E7-1F1FF\",\n \"shortnames\": [\n \"flag-bz\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1E6\",\n \"shortnames\": [\n \"flag-ca\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1E8\",\n \"shortnames\": [\n \"flag-cc\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1E9\",\n \"shortnames\": [\n \"flag-cd\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1EB\",\n \"shortnames\": [\n \"flag-cf\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1EC\",\n \"shortnames\": [\n \"flag-cg\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1ED\",\n \"shortnames\": [\n \"flag-ch\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1EE\",\n \"shortnames\": [\n \"flag-ci\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F0\",\n \"shortnames\": [\n \"flag-ck\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F1\",\n \"shortnames\": [\n \"flag-cl\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F2\",\n \"shortnames\": [\n \"flag-cm\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F3\",\n \"shortnames\": [\n \"cn\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F4\",\n \"shortnames\": [\n \"flag-co\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F5\",\n \"shortnames\": [\n \"flag-cp\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1F7\",\n \"shortnames\": [\n \"flag-cr\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1FA\",\n \"shortnames\": [\n \"flag-cu\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1FB\",\n \"shortnames\": [\n \"flag-cv\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1FC\",\n \"shortnames\": [\n \"flag-cw\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1FD\",\n \"shortnames\": [\n \"flag-cx\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1FE\",\n \"shortnames\": [\n \"flag-cy\"\n ]\n },\n {\n \"unified\": \"1F1E8-1F1FF\",\n \"shortnames\": [\n \"flag-cz\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1EA\",\n \"shortnames\": [\n \"de\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1EC\",\n \"shortnames\": [\n \"flag-dg\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1EF\",\n \"shortnames\": [\n \"flag-dj\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1F0\",\n \"shortnames\": [\n \"flag-dk\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1F2\",\n \"shortnames\": [\n \"flag-dm\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1F4\",\n \"shortnames\": [\n \"flag-do\"\n ]\n },\n {\n \"unified\": \"1F1E9-1F1FF\",\n \"shortnames\": [\n \"flag-dz\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1E6\",\n \"shortnames\": [\n \"flag-ea\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1E8\",\n \"shortnames\": [\n \"flag-ec\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1EA\",\n \"shortnames\": [\n \"flag-ee\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1EC\",\n \"shortnames\": [\n \"flag-eg\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1ED\",\n \"shortnames\": [\n \"flag-eh\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1F7\",\n \"shortnames\": [\n \"flag-er\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1F8\",\n \"shortnames\": [\n \"es\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1F9\",\n \"shortnames\": [\n \"flag-et\"\n ]\n },\n {\n \"unified\": \"1F1EA-1F1FA\",\n \"shortnames\": [\n \"flag-eu\"\n ]\n },\n {\n \"unified\": \"1F1EB-1F1EE\",\n \"shortnames\": [\n \"flag-fi\"\n ]\n },\n {\n \"unified\": \"1F1EB-1F1EF\",\n \"shortnames\": [\n \"flag-fj\"\n ]\n },\n {\n \"unified\": \"1F1EB-1F1F0\",\n \"shortnames\": [\n \"flag-fk\"\n ]\n },\n {\n \"unified\": \"1F1EB-1F1F2\",\n \"shortnames\": [\n \"flag-fm\"\n ]\n },\n {\n \"unified\": \"1F1EB-1F1F4\",\n \"shortnames\": [\n \"flag-fo\"\n ]\n },\n {\n \"unified\": \"1F1EB-1F1F7\",\n \"shortnames\": [\n \"fr\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1E6\",\n \"shortnames\": [\n \"flag-ga\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1E7\",\n \"shortnames\": [\n \"gb\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1E9\",\n \"shortnames\": [\n \"flag-gd\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1EA\",\n \"shortnames\": [\n \"flag-ge\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1EB\",\n \"shortnames\": [\n \"flag-gf\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1EC\",\n \"shortnames\": [\n \"flag-gg\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1ED\",\n \"shortnames\": [\n \"flag-gh\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1EE\",\n \"shortnames\": [\n \"flag-gi\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F1\",\n \"shortnames\": [\n \"flag-gl\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F2\",\n \"shortnames\": [\n \"flag-gm\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F3\",\n \"shortnames\": [\n \"flag-gn\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F5\",\n \"shortnames\": [\n \"flag-gp\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F6\",\n \"shortnames\": [\n \"flag-gq\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F7\",\n \"shortnames\": [\n \"flag-gr\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F8\",\n \"shortnames\": [\n \"flag-gs\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1F9\",\n \"shortnames\": [\n \"flag-gt\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1FA\",\n \"shortnames\": [\n \"flag-gu\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1FC\",\n \"shortnames\": [\n \"flag-gw\"\n ]\n },\n {\n \"unified\": \"1F1EC-1F1FE\",\n \"shortnames\": [\n \"flag-gy\"\n ]\n },\n {\n \"unified\": \"1F1ED-1F1F0\",\n \"shortnames\": [\n \"flag-hk\"\n ]\n },\n {\n \"unified\": \"1F1ED-1F1F2\",\n \"shortnames\": [\n \"flag-hm\"\n ]\n },\n {\n \"unified\": \"1F1ED-1F1F3\",\n \"shortnames\": [\n \"flag-hn\"\n ]\n },\n {\n \"unified\": \"1F1ED-1F1F7\",\n \"shortnames\": [\n \"flag-hr\"\n ]\n },\n {\n \"unified\": \"1F1ED-1F1F9\",\n \"shortnames\": [\n \"flag-ht\"\n ]\n },\n {\n \"unified\": \"1F1ED-1F1FA\",\n \"shortnames\": [\n \"flag-hu\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1E8\",\n \"shortnames\": [\n \"flag-ic\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1E9\",\n \"shortnames\": [\n \"flag-id\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1EA\",\n \"shortnames\": [\n \"flag-ie\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F1\",\n \"shortnames\": [\n \"flag-il\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F2\",\n \"shortnames\": [\n \"flag-im\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F3\",\n \"shortnames\": [\n \"flag-in\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F4\",\n \"shortnames\": [\n \"flag-io\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F6\",\n \"shortnames\": [\n \"flag-iq\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F7\",\n \"shortnames\": [\n \"flag-ir\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F8\",\n \"shortnames\": [\n \"flag-is\"\n ]\n },\n {\n \"unified\": \"1F1EE-1F1F9\",\n \"shortnames\": [\n \"it\"\n ]\n },\n {\n \"unified\": \"1F1EF-1F1EA\",\n \"shortnames\": [\n \"flag-je\"\n ]\n },\n {\n \"unified\": \"1F1EF-1F1F2\",\n \"shortnames\": [\n \"flag-jm\"\n ]\n },\n {\n \"unified\": \"1F1EF-1F1F4\",\n \"shortnames\": [\n \"flag-jo\"\n ]\n },\n {\n \"unified\": \"1F1EF-1F1F5\",\n \"shortnames\": [\n \"jp\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1EA\",\n \"shortnames\": [\n \"flag-ke\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1EC\",\n \"shortnames\": [\n \"flag-kg\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1ED\",\n \"shortnames\": [\n \"flag-kh\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1EE\",\n \"shortnames\": [\n \"flag-ki\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1F2\",\n \"shortnames\": [\n \"flag-km\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1F3\",\n \"shortnames\": [\n \"flag-kn\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1F5\",\n \"shortnames\": [\n \"flag-kp\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1F7\",\n \"shortnames\": [\n \"kr\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1FC\",\n \"shortnames\": [\n \"flag-kw\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1FE\",\n \"shortnames\": [\n \"flag-ky\"\n ]\n },\n {\n \"unified\": \"1F1F0-1F1FF\",\n \"shortnames\": [\n \"flag-kz\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1E6\",\n \"shortnames\": [\n \"flag-la\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1E7\",\n \"shortnames\": [\n \"flag-lb\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1E8\",\n \"shortnames\": [\n \"flag-lc\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1EE\",\n \"shortnames\": [\n \"flag-li\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1F0\",\n \"shortnames\": [\n \"flag-lk\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1F7\",\n \"shortnames\": [\n \"flag-lr\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1F8\",\n \"shortnames\": [\n \"flag-ls\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1F9\",\n \"shortnames\": [\n \"flag-lt\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1FA\",\n \"shortnames\": [\n \"flag-lu\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1FB\",\n \"shortnames\": [\n \"flag-lv\"\n ]\n },\n {\n \"unified\": \"1F1F1-1F1FE\",\n \"shortnames\": [\n \"flag-ly\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1E6\",\n \"shortnames\": [\n \"flag-ma\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1E8\",\n \"shortnames\": [\n \"flag-mc\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1E9\",\n \"shortnames\": [\n \"flag-md\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1EA\",\n \"shortnames\": [\n \"flag-me\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1EB\",\n \"shortnames\": [\n \"flag-mf\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1EC\",\n \"shortnames\": [\n \"flag-mg\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1ED\",\n \"shortnames\": [\n \"flag-mh\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F0\",\n \"shortnames\": [\n \"flag-mk\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F1\",\n \"shortnames\": [\n \"flag-ml\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F2\",\n \"shortnames\": [\n \"flag-mm\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F3\",\n \"shortnames\": [\n \"flag-mn\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F4\",\n \"shortnames\": [\n \"flag-mo\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F5\",\n \"shortnames\": [\n \"flag-mp\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F6\",\n \"shortnames\": [\n \"flag-mq\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F7\",\n \"shortnames\": [\n \"flag-mr\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F8\",\n \"shortnames\": [\n \"flag-ms\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1F9\",\n \"shortnames\": [\n \"flag-mt\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1FA\",\n \"shortnames\": [\n \"flag-mu\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1FB\",\n \"shortnames\": [\n \"flag-mv\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1FC\",\n \"shortnames\": [\n \"flag-mw\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1FD\",\n \"shortnames\": [\n \"flag-mx\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1FE\",\n \"shortnames\": [\n \"flag-my\"\n ]\n },\n {\n \"unified\": \"1F1F2-1F1FF\",\n \"shortnames\": [\n \"flag-mz\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1E6\",\n \"shortnames\": [\n \"flag-na\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1E8\",\n \"shortnames\": [\n \"flag-nc\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1EA\",\n \"shortnames\": [\n \"flag-ne\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1EB\",\n \"shortnames\": [\n \"flag-nf\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1EC\",\n \"shortnames\": [\n \"flag-ng\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1EE\",\n \"shortnames\": [\n \"flag-ni\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1F1\",\n \"shortnames\": [\n \"flag-nl\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1F4\",\n \"shortnames\": [\n \"flag-no\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1F5\",\n \"shortnames\": [\n \"flag-np\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1F7\",\n \"shortnames\": [\n \"flag-nr\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1FA\",\n \"shortnames\": [\n \"flag-nu\"\n ]\n },\n {\n \"unified\": \"1F1F3-1F1FF\",\n \"shortnames\": [\n \"flag-nz\"\n ]\n },\n {\n \"unified\": \"1F1F4-1F1F2\",\n \"shortnames\": [\n \"flag-om\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1E6\",\n \"shortnames\": [\n \"flag-pa\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1EA\",\n \"shortnames\": [\n \"flag-pe\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1EB\",\n \"shortnames\": [\n \"flag-pf\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1EC\",\n \"shortnames\": [\n \"flag-pg\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1ED\",\n \"shortnames\": [\n \"flag-ph\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F0\",\n \"shortnames\": [\n \"flag-pk\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F1\",\n \"shortnames\": [\n \"flag-pl\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F2\",\n \"shortnames\": [\n \"flag-pm\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F3\",\n \"shortnames\": [\n \"flag-pn\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F7\",\n \"shortnames\": [\n \"flag-pr\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F8\",\n \"shortnames\": [\n \"flag-ps\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1F9\",\n \"shortnames\": [\n \"flag-pt\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1FC\",\n \"shortnames\": [\n \"flag-pw\"\n ]\n },\n {\n \"unified\": \"1F1F5-1F1FE\",\n \"shortnames\": [\n \"flag-py\"\n ]\n },\n {\n \"unified\": \"1F1F6-1F1E6\",\n \"shortnames\": [\n \"flag-qa\"\n ]\n },\n {\n \"unified\": \"1F1F7-1F1EA\",\n \"shortnames\": [\n \"flag-re\"\n ]\n },\n {\n \"unified\": \"1F1F7-1F1F4\",\n \"shortnames\": [\n \"flag-ro\"\n ]\n },\n {\n \"unified\": \"1F1F7-1F1F8\",\n \"shortnames\": [\n \"flag-rs\"\n ]\n },\n {\n \"unified\": \"1F1F7-1F1FA\",\n \"shortnames\": [\n \"ru\"\n ]\n },\n {\n \"unified\": \"1F1F7-1F1FC\",\n \"shortnames\": [\n \"flag-rw\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1E6\",\n \"shortnames\": [\n \"flag-sa\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1E7\",\n \"shortnames\": [\n \"flag-sb\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1E8\",\n \"shortnames\": [\n \"flag-sc\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1E9\",\n \"shortnames\": [\n \"flag-sd\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1EA\",\n \"shortnames\": [\n \"flag-se\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1EC\",\n \"shortnames\": [\n \"flag-sg\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1ED\",\n \"shortnames\": [\n \"flag-sh\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1EE\",\n \"shortnames\": [\n \"flag-si\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1EF\",\n \"shortnames\": [\n \"flag-sj\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F0\",\n \"shortnames\": [\n \"flag-sk\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F1\",\n \"shortnames\": [\n \"flag-sl\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F2\",\n \"shortnames\": [\n \"flag-sm\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F3\",\n \"shortnames\": [\n \"flag-sn\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F4\",\n \"shortnames\": [\n \"flag-so\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F7\",\n \"shortnames\": [\n \"flag-sr\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F8\",\n \"shortnames\": [\n \"flag-ss\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1F9\",\n \"shortnames\": [\n \"flag-st\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1FB\",\n \"shortnames\": [\n \"flag-sv\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1FD\",\n \"shortnames\": [\n \"flag-sx\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1FE\",\n \"shortnames\": [\n \"flag-sy\"\n ]\n },\n {\n \"unified\": \"1F1F8-1F1FF\",\n \"shortnames\": [\n \"flag-sz\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1E6\",\n \"shortnames\": [\n \"flag-ta\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1E8\",\n \"shortnames\": [\n \"flag-tc\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1E9\",\n \"shortnames\": [\n \"flag-td\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1EB\",\n \"shortnames\": [\n \"flag-tf\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1EC\",\n \"shortnames\": [\n \"flag-tg\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1ED\",\n \"shortnames\": [\n \"flag-th\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1EF\",\n \"shortnames\": [\n \"flag-tj\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F0\",\n \"shortnames\": [\n \"flag-tk\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F1\",\n \"shortnames\": [\n \"flag-tl\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F2\",\n \"shortnames\": [\n \"flag-tm\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F3\",\n \"shortnames\": [\n \"flag-tn\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F4\",\n \"shortnames\": [\n \"flag-to\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F7\",\n \"shortnames\": [\n \"flag-tr\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1F9\",\n \"shortnames\": [\n \"flag-tt\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1FB\",\n \"shortnames\": [\n \"flag-tv\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1FC\",\n \"shortnames\": [\n \"flag-tw\"\n ]\n },\n {\n \"unified\": \"1F1F9-1F1FF\",\n \"shortnames\": [\n \"flag-tz\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1E6\",\n \"shortnames\": [\n \"flag-ua\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1EC\",\n \"shortnames\": [\n \"flag-ug\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1F2\",\n \"shortnames\": [\n \"flag-um\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1F3\",\n \"shortnames\": [\n \"flag-un\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1F8\",\n \"shortnames\": [\n \"us\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1FE\",\n \"shortnames\": [\n \"flag-uy\"\n ]\n },\n {\n \"unified\": \"1F1FA-1F1FF\",\n \"shortnames\": [\n \"flag-uz\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1E6\",\n \"shortnames\": [\n \"flag-va\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1E8\",\n \"shortnames\": [\n \"flag-vc\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1EA\",\n \"shortnames\": [\n \"flag-ve\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1EC\",\n \"shortnames\": [\n \"flag-vg\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1EE\",\n \"shortnames\": [\n \"flag-vi\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1F3\",\n \"shortnames\": [\n \"flag-vn\"\n ]\n },\n {\n \"unified\": \"1F1FB-1F1FA\",\n \"shortnames\": [\n \"flag-vu\"\n ]\n },\n {\n \"unified\": \"1F1FC-1F1EB\",\n \"shortnames\": [\n \"flag-wf\"\n ]\n },\n {\n \"unified\": \"1F1FC-1F1F8\",\n \"shortnames\": [\n \"flag-ws\"\n ]\n },\n {\n \"unified\": \"1F1FD-1F1F0\",\n \"shortnames\": [\n \"flag-xk\"\n ]\n },\n {\n \"unified\": \"1F1FE-1F1EA\",\n \"shortnames\": [\n \"flag-ye\"\n ]\n },\n {\n \"unified\": \"1F1FE-1F1F9\",\n \"shortnames\": [\n \"flag-yt\"\n ]\n },\n {\n \"unified\": \"1F1FF-1F1E6\",\n \"shortnames\": [\n \"flag-za\"\n ]\n },\n {\n \"unified\": \"1F1FF-1F1F2\",\n \"shortnames\": [\n \"flag-zm\"\n ]\n },\n {\n \"unified\": \"1F1FF-1F1FC\",\n \"shortnames\": [\n \"flag-zw\"\n ]\n },\n {\n \"unified\": \"1F3F4-E0067-E0062-E0065-E006E-E0067-E007F\",\n \"shortnames\": [\n \"flag-england\"\n ]\n },\n {\n \"unified\": \"1F3F4-E0067-E0062-E0073-E0063-E0074-E007F\",\n \"shortnames\": [\n \"flag-scotland\"\n ]\n },\n {\n \"unified\": \"1F3F4-E0067-E0062-E0077-E006C-E0073-E007F\",\n \"shortnames\": [\n \"flag-wales\"\n ]\n }\n ]\n }\n];\n\nexport const byShortName = {\n \"hash\": \"0023-FE0F-20E3\",\n \"keycap_star\": \"002A-FE0F-20E3\",\n \"zero\": \"0030-FE0F-20E3\",\n \"one\": \"0031-FE0F-20E3\",\n \"two\": \"0032-FE0F-20E3\",\n \"three\": \"0033-FE0F-20E3\",\n \"four\": \"0034-FE0F-20E3\",\n \"five\": \"0035-FE0F-20E3\",\n \"six\": \"0036-FE0F-20E3\",\n \"seven\": \"0037-FE0F-20E3\",\n \"eight\": \"0038-FE0F-20E3\",\n \"nine\": \"0039-FE0F-20E3\",\n \"copyright\": \"00A9-FE0F\",\n \"registered\": \"00AE-FE0F\",\n \"mahjong\": \"1F004\",\n \"black_joker\": \"1F0CF\",\n \"a\": \"1F170-FE0F\",\n \"b\": \"1F171-FE0F\",\n \"o2\": \"1F17E-FE0F\",\n \"parking\": \"1F17F-FE0F\",\n \"ab\": \"1F18E\",\n \"cl\": \"1F191\",\n \"cool\": \"1F192\",\n \"free\": \"1F193\",\n \"id\": \"1F194\",\n \"new\": \"1F195\",\n \"ng\": \"1F196\",\n \"ok\": \"1F197\",\n \"sos\": \"1F198\",\n \"up\": \"1F199\",\n \"vs\": \"1F19A\",\n \"flag-ac\": \"1F1E6-1F1E8\",\n \"flag-ad\": \"1F1E6-1F1E9\",\n \"flag-ae\": \"1F1E6-1F1EA\",\n \"flag-af\": \"1F1E6-1F1EB\",\n \"flag-ag\": \"1F1E6-1F1EC\",\n \"flag-ai\": \"1F1E6-1F1EE\",\n \"flag-al\": \"1F1E6-1F1F1\",\n \"flag-am\": \"1F1E6-1F1F2\",\n \"flag-ao\": \"1F1E6-1F1F4\",\n \"flag-aq\": \"1F1E6-1F1F6\",\n \"flag-ar\": \"1F1E6-1F1F7\",\n \"flag-as\": \"1F1E6-1F1F8\",\n \"flag-at\": \"1F1E6-1F1F9\",\n \"flag-au\": \"1F1E6-1F1FA\",\n \"flag-aw\": \"1F1E6-1F1FC\",\n \"flag-ax\": \"1F1E6-1F1FD\",\n \"flag-az\": \"1F1E6-1F1FF\",\n \"flag-ba\": \"1F1E7-1F1E6\",\n \"flag-bb\": \"1F1E7-1F1E7\",\n \"flag-bd\": \"1F1E7-1F1E9\",\n \"flag-be\": \"1F1E7-1F1EA\",\n \"flag-bf\": \"1F1E7-1F1EB\",\n \"flag-bg\": \"1F1E7-1F1EC\",\n \"flag-bh\": \"1F1E7-1F1ED\",\n \"flag-bi\": \"1F1E7-1F1EE\",\n \"flag-bj\": \"1F1E7-1F1EF\",\n \"flag-bl\": \"1F1E7-1F1F1\",\n \"flag-bm\": \"1F1E7-1F1F2\",\n \"flag-bn\": \"1F1E7-1F1F3\",\n \"flag-bo\": \"1F1E7-1F1F4\",\n \"flag-bq\": \"1F1E7-1F1F6\",\n \"flag-br\": \"1F1E7-1F1F7\",\n \"flag-bs\": \"1F1E7-1F1F8\",\n \"flag-bt\": \"1F1E7-1F1F9\",\n \"flag-bv\": \"1F1E7-1F1FB\",\n \"flag-bw\": \"1F1E7-1F1FC\",\n \"flag-by\": \"1F1E7-1F1FE\",\n \"flag-bz\": \"1F1E7-1F1FF\",\n \"flag-ca\": \"1F1E8-1F1E6\",\n \"flag-cc\": \"1F1E8-1F1E8\",\n \"flag-cd\": \"1F1E8-1F1E9\",\n \"flag-cf\": \"1F1E8-1F1EB\",\n \"flag-cg\": \"1F1E8-1F1EC\",\n \"flag-ch\": \"1F1E8-1F1ED\",\n \"flag-ci\": \"1F1E8-1F1EE\",\n \"flag-ck\": \"1F1E8-1F1F0\",\n \"flag-cl\": \"1F1E8-1F1F1\",\n \"flag-cm\": \"1F1E8-1F1F2\",\n \"cn\": \"1F1E8-1F1F3\",\n \"flag-co\": \"1F1E8-1F1F4\",\n \"flag-cp\": \"1F1E8-1F1F5\",\n \"flag-cr\": \"1F1E8-1F1F7\",\n \"flag-cu\": \"1F1E8-1F1FA\",\n \"flag-cv\": \"1F1E8-1F1FB\",\n \"flag-cw\": \"1F1E8-1F1FC\",\n \"flag-cx\": \"1F1E8-1F1FD\",\n \"flag-cy\": \"1F1E8-1F1FE\",\n \"flag-cz\": \"1F1E8-1F1FF\",\n \"de\": \"1F1E9-1F1EA\",\n \"flag-dg\": \"1F1E9-1F1EC\",\n \"flag-dj\": \"1F1E9-1F1EF\",\n \"flag-dk\": \"1F1E9-1F1F0\",\n \"flag-dm\": \"1F1E9-1F1F2\",\n \"flag-do\": \"1F1E9-1F1F4\",\n \"flag-dz\": \"1F1E9-1F1FF\",\n \"flag-ea\": \"1F1EA-1F1E6\",\n \"flag-ec\": \"1F1EA-1F1E8\",\n \"flag-ee\": \"1F1EA-1F1EA\",\n \"flag-eg\": \"1F1EA-1F1EC\",\n \"flag-eh\": \"1F1EA-1F1ED\",\n \"flag-er\": \"1F1EA-1F1F7\",\n \"es\": \"1F1EA-1F1F8\",\n \"flag-et\": \"1F1EA-1F1F9\",\n \"flag-eu\": \"1F1EA-1F1FA\",\n \"flag-fi\": \"1F1EB-1F1EE\",\n \"flag-fj\": \"1F1EB-1F1EF\",\n \"flag-fk\": \"1F1EB-1F1F0\",\n \"flag-fm\": \"1F1EB-1F1F2\",\n \"flag-fo\": \"1F1EB-1F1F4\",\n \"fr\": \"1F1EB-1F1F7\",\n \"flag-ga\": \"1F1EC-1F1E6\",\n \"gb\": \"1F1EC-1F1E7\",\n \"flag-gd\": \"1F1EC-1F1E9\",\n \"flag-ge\": \"1F1EC-1F1EA\",\n \"flag-gf\": \"1F1EC-1F1EB\",\n \"flag-gg\": \"1F1EC-1F1EC\",\n \"flag-gh\": \"1F1EC-1F1ED\",\n \"flag-gi\": \"1F1EC-1F1EE\",\n \"flag-gl\": \"1F1EC-1F1F1\",\n \"flag-gm\": \"1F1EC-1F1F2\",\n \"flag-gn\": \"1F1EC-1F1F3\",\n \"flag-gp\": \"1F1EC-1F1F5\",\n \"flag-gq\": \"1F1EC-1F1F6\",\n \"flag-gr\": \"1F1EC-1F1F7\",\n \"flag-gs\": \"1F1EC-1F1F8\",\n \"flag-gt\": \"1F1EC-1F1F9\",\n \"flag-gu\": \"1F1EC-1F1FA\",\n \"flag-gw\": \"1F1EC-1F1FC\",\n \"flag-gy\": \"1F1EC-1F1FE\",\n \"flag-hk\": \"1F1ED-1F1F0\",\n \"flag-hm\": \"1F1ED-1F1F2\",\n \"flag-hn\": \"1F1ED-1F1F3\",\n \"flag-hr\": \"1F1ED-1F1F7\",\n \"flag-ht\": \"1F1ED-1F1F9\",\n \"flag-hu\": \"1F1ED-1F1FA\",\n \"flag-ic\": \"1F1EE-1F1E8\",\n \"flag-id\": \"1F1EE-1F1E9\",\n \"flag-ie\": \"1F1EE-1F1EA\",\n \"flag-il\": \"1F1EE-1F1F1\",\n \"flag-im\": \"1F1EE-1F1F2\",\n \"flag-in\": \"1F1EE-1F1F3\",\n \"flag-io\": \"1F1EE-1F1F4\",\n \"flag-iq\": \"1F1EE-1F1F6\",\n \"flag-ir\": \"1F1EE-1F1F7\",\n \"flag-is\": \"1F1EE-1F1F8\",\n \"it\": \"1F1EE-1F1F9\",\n \"flag-je\": \"1F1EF-1F1EA\",\n \"flag-jm\": \"1F1EF-1F1F2\",\n \"flag-jo\": \"1F1EF-1F1F4\",\n \"jp\": \"1F1EF-1F1F5\",\n \"flag-ke\": \"1F1F0-1F1EA\",\n \"flag-kg\": \"1F1F0-1F1EC\",\n \"flag-kh\": \"1F1F0-1F1ED\",\n \"flag-ki\": \"1F1F0-1F1EE\",\n \"flag-km\": \"1F1F0-1F1F2\",\n \"flag-kn\": \"1F1F0-1F1F3\",\n \"flag-kp\": \"1F1F0-1F1F5\",\n \"kr\": \"1F1F0-1F1F7\",\n \"flag-kw\": \"1F1F0-1F1FC\",\n \"flag-ky\": \"1F1F0-1F1FE\",\n \"flag-kz\": \"1F1F0-1F1FF\",\n \"flag-la\": \"1F1F1-1F1E6\",\n \"flag-lb\": \"1F1F1-1F1E7\",\n \"flag-lc\": \"1F1F1-1F1E8\",\n \"flag-li\": \"1F1F1-1F1EE\",\n \"flag-lk\": \"1F1F1-1F1F0\",\n \"flag-lr\": \"1F1F1-1F1F7\",\n \"flag-ls\": \"1F1F1-1F1F8\",\n \"flag-lt\": \"1F1F1-1F1F9\",\n \"flag-lu\": \"1F1F1-1F1FA\",\n \"flag-lv\": \"1F1F1-1F1FB\",\n \"flag-ly\": \"1F1F1-1F1FE\",\n \"flag-ma\": \"1F1F2-1F1E6\",\n \"flag-mc\": \"1F1F2-1F1E8\",\n \"flag-md\": \"1F1F2-1F1E9\",\n \"flag-me\": \"1F1F2-1F1EA\",\n \"flag-mf\": \"1F1F2-1F1EB\",\n \"flag-mg\": \"1F1F2-1F1EC\",\n \"flag-mh\": \"1F1F2-1F1ED\",\n \"flag-mk\": \"1F1F2-1F1F0\",\n \"flag-ml\": \"1F1F2-1F1F1\",\n \"flag-mm\": \"1F1F2-1F1F2\",\n \"flag-mn\": \"1F1F2-1F1F3\",\n \"flag-mo\": \"1F1F2-1F1F4\",\n \"flag-mp\": \"1F1F2-1F1F5\",\n \"flag-mq\": \"1F1F2-1F1F6\",\n \"flag-mr\": \"1F1F2-1F1F7\",\n \"flag-ms\": \"1F1F2-1F1F8\",\n \"flag-mt\": \"1F1F2-1F1F9\",\n \"flag-mu\": \"1F1F2-1F1FA\",\n \"flag-mv\": \"1F1F2-1F1FB\",\n \"flag-mw\": \"1F1F2-1F1FC\",\n \"flag-mx\": \"1F1F2-1F1FD\",\n \"flag-my\": \"1F1F2-1F1FE\",\n \"flag-mz\": \"1F1F2-1F1FF\",\n \"flag-na\": \"1F1F3-1F1E6\",\n \"flag-nc\": \"1F1F3-1F1E8\",\n \"flag-ne\": \"1F1F3-1F1EA\",\n \"flag-nf\": \"1F1F3-1F1EB\",\n \"flag-ng\": \"1F1F3-1F1EC\",\n \"flag-ni\": \"1F1F3-1F1EE\",\n \"flag-nl\": \"1F1F3-1F1F1\",\n \"flag-no\": \"1F1F3-1F1F4\",\n \"flag-np\": \"1F1F3-1F1F5\",\n \"flag-nr\": \"1F1F3-1F1F7\",\n \"flag-nu\": \"1F1F3-1F1FA\",\n \"flag-nz\": \"1F1F3-1F1FF\",\n \"flag-om\": \"1F1F4-1F1F2\",\n \"flag-pa\": \"1F1F5-1F1E6\",\n \"flag-pe\": \"1F1F5-1F1EA\",\n \"flag-pf\": \"1F1F5-1F1EB\",\n \"flag-pg\": \"1F1F5-1F1EC\",\n \"flag-ph\": \"1F1F5-1F1ED\",\n \"flag-pk\": \"1F1F5-1F1F0\",\n \"flag-pl\": \"1F1F5-1F1F1\",\n \"flag-pm\": \"1F1F5-1F1F2\",\n \"flag-pn\": \"1F1F5-1F1F3\",\n \"flag-pr\": \"1F1F5-1F1F7\",\n \"flag-ps\": \"1F1F5-1F1F8\",\n \"flag-pt\": \"1F1F5-1F1F9\",\n \"flag-pw\": \"1F1F5-1F1FC\",\n \"flag-py\": \"1F1F5-1F1FE\",\n \"flag-qa\": \"1F1F6-1F1E6\",\n \"flag-re\": \"1F1F7-1F1EA\",\n \"flag-ro\": \"1F1F7-1F1F4\",\n \"flag-rs\": \"1F1F7-1F1F8\",\n \"ru\": \"1F1F7-1F1FA\",\n \"flag-rw\": \"1F1F7-1F1FC\",\n \"flag-sa\": \"1F1F8-1F1E6\",\n \"flag-sb\": \"1F1F8-1F1E7\",\n \"flag-sc\": \"1F1F8-1F1E8\",\n \"flag-sd\": \"1F1F8-1F1E9\",\n \"flag-se\": \"1F1F8-1F1EA\",\n \"flag-sg\": \"1F1F8-1F1EC\",\n \"flag-sh\": \"1F1F8-1F1ED\",\n \"flag-si\": \"1F1F8-1F1EE\",\n \"flag-sj\": \"1F1F8-1F1EF\",\n \"flag-sk\": \"1F1F8-1F1F0\",\n \"flag-sl\": \"1F1F8-1F1F1\",\n \"flag-sm\": \"1F1F8-1F1F2\",\n \"flag-sn\": \"1F1F8-1F1F3\",\n \"flag-so\": \"1F1F8-1F1F4\",\n \"flag-sr\": \"1F1F8-1F1F7\",\n \"flag-ss\": \"1F1F8-1F1F8\",\n \"flag-st\": \"1F1F8-1F1F9\",\n \"flag-sv\": \"1F1F8-1F1FB\",\n \"flag-sx\": \"1F1F8-1F1FD\",\n \"flag-sy\": \"1F1F8-1F1FE\",\n \"flag-sz\": \"1F1F8-1F1FF\",\n \"flag-ta\": \"1F1F9-1F1E6\",\n \"flag-tc\": \"1F1F9-1F1E8\",\n \"flag-td\": \"1F1F9-1F1E9\",\n \"flag-tf\": \"1F1F9-1F1EB\",\n \"flag-tg\": \"1F1F9-1F1EC\",\n \"flag-th\": \"1F1F9-1F1ED\",\n \"flag-tj\": \"1F1F9-1F1EF\",\n \"flag-tk\": \"1F1F9-1F1F0\",\n \"flag-tl\": \"1F1F9-1F1F1\",\n \"flag-tm\": \"1F1F9-1F1F2\",\n \"flag-tn\": \"1F1F9-1F1F3\",\n \"flag-to\": \"1F1F9-1F1F4\",\n \"flag-tr\": \"1F1F9-1F1F7\",\n \"flag-tt\": \"1F1F9-1F1F9\",\n \"flag-tv\": \"1F1F9-1F1FB\",\n \"flag-tw\": \"1F1F9-1F1FC\",\n \"flag-tz\": \"1F1F9-1F1FF\",\n \"flag-ua\": \"1F1FA-1F1E6\",\n \"flag-ug\": \"1F1FA-1F1EC\",\n \"flag-um\": \"1F1FA-1F1F2\",\n \"flag-un\": \"1F1FA-1F1F3\",\n \"us\": \"1F1FA-1F1F8\",\n \"flag-uy\": \"1F1FA-1F1FE\",\n \"flag-uz\": \"1F1FA-1F1FF\",\n \"flag-va\": \"1F1FB-1F1E6\",\n \"flag-vc\": \"1F1FB-1F1E8\",\n \"flag-ve\": \"1F1FB-1F1EA\",\n \"flag-vg\": \"1F1FB-1F1EC\",\n \"flag-vi\": \"1F1FB-1F1EE\",\n \"flag-vn\": \"1F1FB-1F1F3\",\n \"flag-vu\": \"1F1FB-1F1FA\",\n \"flag-wf\": \"1F1FC-1F1EB\",\n \"flag-ws\": \"1F1FC-1F1F8\",\n \"flag-xk\": \"1F1FD-1F1F0\",\n \"flag-ye\": \"1F1FE-1F1EA\",\n \"flag-yt\": \"1F1FE-1F1F9\",\n \"flag-za\": \"1F1FF-1F1E6\",\n \"flag-zm\": \"1F1FF-1F1F2\",\n \"flag-zw\": \"1F1FF-1F1FC\",\n \"koko\": \"1F201\",\n \"sa\": \"1F202-FE0F\",\n \"u7121\": \"1F21A\",\n \"u6307\": \"1F22F\",\n \"u7981\": \"1F232\",\n \"u7a7a\": \"1F233\",\n \"u5408\": \"1F234\",\n \"u6e80\": \"1F235\",\n \"u6709\": \"1F236\",\n \"u6708\": \"1F237-FE0F\",\n \"u7533\": \"1F238\",\n \"u5272\": \"1F239\",\n \"u55b6\": \"1F23A\",\n \"ideograph_advantage\": \"1F250\",\n \"accept\": \"1F251\",\n \"cyclone\": \"1F300\",\n \"foggy\": \"1F301\",\n \"closed_umbrella\": \"1F302\",\n \"night_with_stars\": \"1F303\",\n \"sunrise_over_mountains\": \"1F304\",\n \"sunrise\": \"1F305\",\n \"city_sunset\": \"1F306\",\n \"city_sunrise\": \"1F307\",\n \"rainbow\": \"1F308\",\n \"bridge_at_night\": \"1F309\",\n \"ocean\": \"1F30A\",\n \"volcano\": \"1F30B\",\n \"milky_way\": \"1F30C\",\n \"earth_africa\": \"1F30D\",\n \"earth_americas\": \"1F30E\",\n \"earth_asia\": \"1F30F\",\n \"globe_with_meridians\": \"1F310\",\n \"new_moon\": \"1F311\",\n \"waxing_crescent_moon\": \"1F312\",\n \"first_quarter_moon\": \"1F313\",\n \"moon\": \"1F314\",\n \"full_moon\": \"1F315\",\n \"waning_gibbous_moon\": \"1F316\",\n \"last_quarter_moon\": \"1F317\",\n \"waning_crescent_moon\": \"1F318\",\n \"crescent_moon\": \"1F319\",\n \"new_moon_with_face\": \"1F31A\",\n \"first_quarter_moon_with_face\": \"1F31B\",\n \"last_quarter_moon_with_face\": \"1F31C\",\n \"full_moon_with_face\": \"1F31D\",\n \"sun_with_face\": \"1F31E\",\n \"star2\": \"1F31F\",\n \"stars\": \"1F320\",\n \"thermometer\": \"1F321-FE0F\",\n \"mostly_sunny\": \"1F324-FE0F\",\n \"barely_sunny\": \"1F325-FE0F\",\n \"partly_sunny_rain\": \"1F326-FE0F\",\n \"rain_cloud\": \"1F327-FE0F\",\n \"snow_cloud\": \"1F328-FE0F\",\n \"lightning\": \"1F329-FE0F\",\n \"tornado\": \"1F32A-FE0F\",\n \"fog\": \"1F32B-FE0F\",\n \"wind_blowing_face\": \"1F32C-FE0F\",\n \"hotdog\": \"1F32D\",\n \"taco\": \"1F32E\",\n \"burrito\": \"1F32F\",\n \"chestnut\": \"1F330\",\n \"seedling\": \"1F331\",\n \"evergreen_tree\": \"1F332\",\n \"deciduous_tree\": \"1F333\",\n \"palm_tree\": \"1F334\",\n \"cactus\": \"1F335\",\n \"hot_pepper\": \"1F336-FE0F\",\n \"tulip\": \"1F337\",\n \"cherry_blossom\": \"1F338\",\n \"rose\": \"1F339\",\n \"hibiscus\": \"1F33A\",\n \"sunflower\": \"1F33B\",\n \"blossom\": \"1F33C\",\n \"corn\": \"1F33D\",\n \"ear_of_rice\": \"1F33E\",\n \"herb\": \"1F33F\",\n \"four_leaf_clover\": \"1F340\",\n \"maple_leaf\": \"1F341\",\n \"fallen_leaf\": \"1F342\",\n \"leaves\": \"1F343\",\n \"mushroom\": \"1F344\",\n \"tomato\": \"1F345\",\n \"eggplant\": \"1F346\",\n \"grapes\": \"1F347\",\n \"melon\": \"1F348\",\n \"watermelon\": \"1F349\",\n \"tangerine\": \"1F34A\",\n \"lemon\": \"1F34B\",\n \"banana\": \"1F34C\",\n \"pineapple\": \"1F34D\",\n \"apple\": \"1F34E\",\n \"green_apple\": \"1F34F\",\n \"pear\": \"1F350\",\n \"peach\": \"1F351\",\n \"cherries\": \"1F352\",\n \"strawberry\": \"1F353\",\n \"hamburger\": \"1F354\",\n \"pizza\": \"1F355\",\n \"meat_on_bone\": \"1F356\",\n \"poultry_leg\": \"1F357\",\n \"rice_cracker\": \"1F358\",\n \"rice_ball\": \"1F359\",\n \"rice\": \"1F35A\",\n \"curry\": \"1F35B\",\n \"ramen\": \"1F35C\",\n \"spaghetti\": \"1F35D\",\n \"bread\": \"1F35E\",\n \"fries\": \"1F35F\",\n \"sweet_potato\": \"1F360\",\n \"dango\": \"1F361\",\n \"oden\": \"1F362\",\n \"sushi\": \"1F363\",\n \"fried_shrimp\": \"1F364\",\n \"fish_cake\": \"1F365\",\n \"icecream\": \"1F366\",\n \"shaved_ice\": \"1F367\",\n \"ice_cream\": \"1F368\",\n \"doughnut\": \"1F369\",\n \"cookie\": \"1F36A\",\n \"chocolate_bar\": \"1F36B\",\n \"candy\": \"1F36C\",\n \"lollipop\": \"1F36D\",\n \"custard\": \"1F36E\",\n \"honey_pot\": \"1F36F\",\n \"cake\": \"1F370\",\n \"bento\": \"1F371\",\n \"stew\": \"1F372\",\n \"fried_egg\": \"1F373\",\n \"fork_and_knife\": \"1F374\",\n \"tea\": \"1F375\",\n \"sake\": \"1F376\",\n \"wine_glass\": \"1F377\",\n \"cocktail\": \"1F378\",\n \"tropical_drink\": \"1F379\",\n \"beer\": \"1F37A\",\n \"beers\": \"1F37B\",\n \"baby_bottle\": \"1F37C\",\n \"knife_fork_plate\": \"1F37D-FE0F\",\n \"champagne\": \"1F37E\",\n \"popcorn\": \"1F37F\",\n \"ribbon\": \"1F380\",\n \"gift\": \"1F381\",\n \"birthday\": \"1F382\",\n \"jack_o_lantern\": \"1F383\",\n \"christmas_tree\": \"1F384\",\n \"santa\": \"1F385\",\n \"fireworks\": \"1F386\",\n \"sparkler\": \"1F387\",\n \"balloon\": \"1F388\",\n \"tada\": \"1F389\",\n \"confetti_ball\": \"1F38A\",\n \"tanabata_tree\": \"1F38B\",\n \"crossed_flags\": \"1F38C\",\n \"bamboo\": \"1F38D\",\n \"dolls\": \"1F38E\",\n \"flags\": \"1F38F\",\n \"wind_chime\": \"1F390\",\n \"rice_scene\": \"1F391\",\n \"school_satchel\": \"1F392\",\n \"mortar_board\": \"1F393\",\n \"medal\": \"1F396-FE0F\",\n \"reminder_ribbon\": \"1F397-FE0F\",\n \"studio_microphone\": \"1F399-FE0F\",\n \"level_slider\": \"1F39A-FE0F\",\n \"control_knobs\": \"1F39B-FE0F\",\n \"film_frames\": \"1F39E-FE0F\",\n \"admission_tickets\": \"1F39F-FE0F\",\n \"carousel_horse\": \"1F3A0\",\n \"ferris_wheel\": \"1F3A1\",\n \"roller_coaster\": \"1F3A2\",\n \"fishing_pole_and_fish\": \"1F3A3\",\n \"microphone\": \"1F3A4\",\n \"movie_camera\": \"1F3A5\",\n \"cinema\": \"1F3A6\",\n \"headphones\": \"1F3A7\",\n \"art\": \"1F3A8\",\n \"tophat\": \"1F3A9\",\n \"circus_tent\": \"1F3AA\",\n \"ticket\": \"1F3AB\",\n \"clapper\": \"1F3AC\",\n \"performing_arts\": \"1F3AD\",\n \"video_game\": \"1F3AE\",\n \"dart\": \"1F3AF\",\n \"slot_machine\": \"1F3B0\",\n \"8ball\": \"1F3B1\",\n \"game_die\": \"1F3B2\",\n \"bowling\": \"1F3B3\",\n \"flower_playing_cards\": \"1F3B4\",\n \"musical_note\": \"1F3B5\",\n \"notes\": \"1F3B6\",\n \"saxophone\": \"1F3B7\",\n \"guitar\": \"1F3B8\",\n \"musical_keyboard\": \"1F3B9\",\n \"trumpet\": \"1F3BA\",\n \"violin\": \"1F3BB\",\n \"musical_score\": \"1F3BC\",\n \"running_shirt_with_sash\": \"1F3BD\",\n \"tennis\": \"1F3BE\",\n \"ski\": \"1F3BF\",\n \"basketball\": \"1F3C0\",\n \"checkered_flag\": \"1F3C1\",\n \"snowboarder\": \"1F3C2\",\n \"woman-running\": \"1F3C3-200D-2640-FE0F\",\n \"man-running\": \"1F3C3-200D-2642-FE0F\",\n \"runner\": \"1F3C3-200D-2642-FE0F\",\n \"woman-surfing\": \"1F3C4-200D-2640-FE0F\",\n \"man-surfing\": \"1F3C4-200D-2642-FE0F\",\n \"surfer\": \"1F3C4-200D-2642-FE0F\",\n \"sports_medal\": \"1F3C5\",\n \"trophy\": \"1F3C6\",\n \"horse_racing\": \"1F3C7\",\n \"football\": \"1F3C8\",\n \"rugby_football\": \"1F3C9\",\n \"woman-swimming\": \"1F3CA-200D-2640-FE0F\",\n \"man-swimming\": \"1F3CA-200D-2642-FE0F\",\n \"swimmer\": \"1F3CA-200D-2642-FE0F\",\n \"woman-lifting-weights\": \"1F3CB-FE0F-200D-2640-FE0F\",\n \"man-lifting-weights\": \"1F3CB-FE0F-200D-2642-FE0F\",\n \"weight_lifter\": \"1F3CB-FE0F-200D-2642-FE0F\",\n \"woman-golfing\": \"1F3CC-FE0F-200D-2640-FE0F\",\n \"man-golfing\": \"1F3CC-FE0F-200D-2642-FE0F\",\n \"golfer\": \"1F3CC-FE0F-200D-2642-FE0F\",\n \"racing_motorcycle\": \"1F3CD-FE0F\",\n \"racing_car\": \"1F3CE-FE0F\",\n \"cricket_bat_and_ball\": \"1F3CF\",\n \"volleyball\": \"1F3D0\",\n \"field_hockey_stick_and_ball\": \"1F3D1\",\n \"ice_hockey_stick_and_puck\": \"1F3D2\",\n \"table_tennis_paddle_and_ball\": \"1F3D3\",\n \"snow_capped_mountain\": \"1F3D4-FE0F\",\n \"camping\": \"1F3D5-FE0F\",\n \"beach_with_umbrella\": \"1F3D6-FE0F\",\n \"building_construction\": \"1F3D7-FE0F\",\n \"house_buildings\": \"1F3D8-FE0F\",\n \"cityscape\": \"1F3D9-FE0F\",\n \"derelict_house_building\": \"1F3DA-FE0F\",\n \"classical_building\": \"1F3DB-FE0F\",\n \"desert\": \"1F3DC-FE0F\",\n \"desert_island\": \"1F3DD-FE0F\",\n \"national_park\": \"1F3DE-FE0F\",\n \"stadium\": \"1F3DF-FE0F\",\n \"house\": \"1F3E0\",\n \"house_with_garden\": \"1F3E1\",\n \"office\": \"1F3E2\",\n \"post_office\": \"1F3E3\",\n \"european_post_office\": \"1F3E4\",\n \"hospital\": \"1F3E5\",\n \"bank\": \"1F3E6\",\n \"atm\": \"1F3E7\",\n \"hotel\": \"1F3E8\",\n \"love_hotel\": \"1F3E9\",\n \"convenience_store\": \"1F3EA\",\n \"school\": \"1F3EB\",\n \"department_store\": \"1F3EC\",\n \"factory\": \"1F3ED\",\n \"izakaya_lantern\": \"1F3EE\",\n \"japanese_castle\": \"1F3EF\",\n \"european_castle\": \"1F3F0\",\n \"rainbow-flag\": \"1F3F3-FE0F-200D-1F308\",\n \"transgender_flag\": \"1F3F3-FE0F-200D-26A7-FE0F\",\n \"waving_white_flag\": \"1F3F3-FE0F\",\n \"pirate_flag\": \"1F3F4-200D-2620-FE0F\",\n \"flag-england\": \"1F3F4-E0067-E0062-E0065-E006E-E0067-E007F\",\n \"flag-scotland\": \"1F3F4-E0067-E0062-E0073-E0063-E0074-E007F\",\n \"flag-wales\": \"1F3F4-E0067-E0062-E0077-E006C-E0073-E007F\",\n \"waving_black_flag\": \"1F3F4\",\n \"rosette\": \"1F3F5-FE0F\",\n \"label\": \"1F3F7-FE0F\",\n \"badminton_racquet_and_shuttlecock\": \"1F3F8\",\n \"bow_and_arrow\": \"1F3F9\",\n \"amphora\": \"1F3FA\",\n \"skin-tone-2\": \"1F3FB\",\n \"skin-tone-3\": \"1F3FC\",\n \"skin-tone-4\": \"1F3FD\",\n \"skin-tone-5\": \"1F3FE\",\n \"skin-tone-6\": \"1F3FF\",\n \"rat\": \"1F400\",\n \"mouse2\": \"1F401\",\n \"ox\": \"1F402\",\n \"water_buffalo\": \"1F403\",\n \"cow2\": \"1F404\",\n \"tiger2\": \"1F405\",\n \"leopard\": \"1F406\",\n \"rabbit2\": \"1F407\",\n \"black_cat\": \"1F408-200D-2B1B\",\n \"cat2\": \"1F408\",\n \"dragon\": \"1F409\",\n \"crocodile\": \"1F40A\",\n \"whale2\": \"1F40B\",\n \"snail\": \"1F40C\",\n \"snake\": \"1F40D\",\n \"racehorse\": \"1F40E\",\n \"ram\": \"1F40F\",\n \"goat\": \"1F410\",\n \"sheep\": \"1F411\",\n \"monkey\": \"1F412\",\n \"rooster\": \"1F413\",\n \"chicken\": \"1F414\",\n \"service_dog\": \"1F415-200D-1F9BA\",\n \"dog2\": \"1F415\",\n \"pig2\": \"1F416\",\n \"boar\": \"1F417\",\n \"elephant\": \"1F418\",\n \"octopus\": \"1F419\",\n \"shell\": \"1F41A\",\n \"bug\": \"1F41B\",\n \"ant\": \"1F41C\",\n \"bee\": \"1F41D\",\n \"beetle\": \"1FAB2\",\n \"fish\": \"1F41F\",\n \"tropical_fish\": \"1F420\",\n \"blowfish\": \"1F421\",\n \"turtle\": \"1F422\",\n \"hatching_chick\": \"1F423\",\n \"baby_chick\": \"1F424\",\n \"hatched_chick\": \"1F425\",\n \"bird\": \"1F426\",\n \"penguin\": \"1F427\",\n \"koala\": \"1F428\",\n \"poodle\": \"1F429\",\n \"dromedary_camel\": \"1F42A\",\n \"camel\": \"1F42B\",\n \"dolphin\": \"1F42C\",\n \"mouse\": \"1F42D\",\n \"cow\": \"1F42E\",\n \"tiger\": \"1F42F\",\n \"rabbit\": \"1F430\",\n \"cat\": \"1F431\",\n \"dragon_face\": \"1F432\",\n \"whale\": \"1F433\",\n \"horse\": \"1F434\",\n \"monkey_face\": \"1F435\",\n \"dog\": \"1F436\",\n \"pig\": \"1F437\",\n \"frog\": \"1F438\",\n \"hamster\": \"1F439\",\n \"wolf\": \"1F43A\",\n \"polar_bear\": \"1F43B-200D-2744-FE0F\",\n \"bear\": \"1F43B\",\n \"panda_face\": \"1F43C\",\n \"pig_nose\": \"1F43D\",\n \"feet\": \"1F43E\",\n \"chipmunk\": \"1F43F-FE0F\",\n \"eyes\": \"1F440\",\n \"eye-in-speech-bubble\": \"1F441-FE0F-200D-1F5E8-FE0F\",\n \"eye\": \"1F441-FE0F\",\n \"ear\": \"1F442\",\n \"nose\": \"1F443\",\n \"lips\": \"1F444\",\n \"tongue\": \"1F445\",\n \"point_up_2\": \"1F446\",\n \"point_down\": \"1F447\",\n \"point_left\": \"1F448\",\n \"point_right\": \"1F449\",\n \"facepunch\": \"1F44A\",\n \"wave\": \"1F44B\",\n \"ok_hand\": \"1F44C\",\n \"+1\": \"1F44D\",\n \"-1\": \"1F44E\",\n \"clap\": \"1F44F\",\n \"open_hands\": \"1F450\",\n \"crown\": \"1F451\",\n \"womans_hat\": \"1F452\",\n \"eyeglasses\": \"1F453\",\n \"necktie\": \"1F454\",\n \"shirt\": \"1F455\",\n \"jeans\": \"1F456\",\n \"dress\": \"1F457\",\n \"kimono\": \"1F458\",\n \"bikini\": \"1F459\",\n \"womans_clothes\": \"1F45A\",\n \"purse\": \"1F45B\",\n \"handbag\": \"1F45C\",\n \"pouch\": \"1F45D\",\n \"mans_shoe\": \"1F45E\",\n \"athletic_shoe\": \"1F45F\",\n \"high_heel\": \"1F460\",\n \"sandal\": \"1F461\",\n \"boot\": \"1F462\",\n \"footprints\": \"1F463\",\n \"bust_in_silhouette\": \"1F464\",\n \"busts_in_silhouette\": \"1F465\",\n \"boy\": \"1F466\",\n \"girl\": \"1F467\",\n \"male-farmer\": \"1F468-200D-1F33E\",\n \"male-cook\": \"1F468-200D-1F373\",\n \"man_feeding_baby\": \"1F468-200D-1F37C\",\n \"male-student\": \"1F468-200D-1F393\",\n \"male-singer\": \"1F468-200D-1F3A4\",\n \"male-artist\": \"1F468-200D-1F3A8\",\n \"male-teacher\": \"1F468-200D-1F3EB\",\n \"male-factory-worker\": \"1F468-200D-1F3ED\",\n \"man-boy-boy\": \"1F468-200D-1F466-200D-1F466\",\n \"man-boy\": \"1F468-200D-1F466\",\n \"man-girl-boy\": \"1F468-200D-1F467-200D-1F466\",\n \"man-girl-girl\": \"1F468-200D-1F467-200D-1F467\",\n \"man-girl\": \"1F468-200D-1F467\",\n \"man-man-boy\": \"1F468-200D-1F468-200D-1F466\",\n \"man-man-boy-boy\": \"1F468-200D-1F468-200D-1F466-200D-1F466\",\n \"man-man-girl\": \"1F468-200D-1F468-200D-1F467\",\n \"man-man-girl-boy\": \"1F468-200D-1F468-200D-1F467-200D-1F466\",\n \"man-man-girl-girl\": \"1F468-200D-1F468-200D-1F467-200D-1F467\",\n \"man-woman-boy\": \"1F468-200D-1F469-200D-1F466\",\n \"man-woman-boy-boy\": \"1F468-200D-1F469-200D-1F466-200D-1F466\",\n \"man-woman-girl\": \"1F468-200D-1F469-200D-1F467\",\n \"man-woman-girl-boy\": \"1F468-200D-1F469-200D-1F467-200D-1F466\",\n \"man-woman-girl-girl\": \"1F468-200D-1F469-200D-1F467-200D-1F467\",\n \"male-technologist\": \"1F468-200D-1F4BB\",\n \"male-office-worker\": \"1F468-200D-1F4BC\",\n \"male-mechanic\": \"1F468-200D-1F527\",\n \"male-scientist\": \"1F468-200D-1F52C\",\n \"male-astronaut\": \"1F468-200D-1F680\",\n \"male-firefighter\": \"1F468-200D-1F692\",\n \"man_with_probing_cane\": \"1F468-200D-1F9AF\",\n \"red_haired_man\": \"1F468-200D-1F9B0\",\n \"curly_haired_man\": \"1F468-200D-1F9B1\",\n \"bald_man\": \"1F468-200D-1F9B2\",\n \"white_haired_man\": \"1F468-200D-1F9B3\",\n \"man_in_motorized_wheelchair\": \"1F468-200D-1F9BC\",\n \"man_in_manual_wheelchair\": \"1F468-200D-1F9BD\",\n \"male-doctor\": \"1F468-200D-2695-FE0F\",\n \"male-judge\": \"1F468-200D-2696-FE0F\",\n \"male-pilot\": \"1F468-200D-2708-FE0F\",\n \"man-heart-man\": \"1F468-200D-2764-FE0F-200D-1F468\",\n \"man-kiss-man\": \"1F468-200D-2764-FE0F-200D-1F48B-200D-1F468\",\n \"man\": \"1F468\",\n \"female-farmer\": \"1F469-200D-1F33E\",\n \"female-cook\": \"1F469-200D-1F373\",\n \"woman_feeding_baby\": \"1F469-200D-1F37C\",\n \"female-student\": \"1F469-200D-1F393\",\n \"female-singer\": \"1F469-200D-1F3A4\",\n \"female-artist\": \"1F469-200D-1F3A8\",\n \"female-teacher\": \"1F469-200D-1F3EB\",\n \"female-factory-worker\": \"1F469-200D-1F3ED\",\n \"woman-boy-boy\": \"1F469-200D-1F466-200D-1F466\",\n \"woman-boy\": \"1F469-200D-1F466\",\n \"woman-girl-boy\": \"1F469-200D-1F467-200D-1F466\",\n \"woman-girl-girl\": \"1F469-200D-1F467-200D-1F467\",\n \"woman-girl\": \"1F469-200D-1F467\",\n \"woman-woman-boy\": \"1F469-200D-1F469-200D-1F466\",\n \"woman-woman-boy-boy\": \"1F469-200D-1F469-200D-1F466-200D-1F466\",\n \"woman-woman-girl\": \"1F469-200D-1F469-200D-1F467\",\n \"woman-woman-girl-boy\": \"1F469-200D-1F469-200D-1F467-200D-1F466\",\n \"woman-woman-girl-girl\": \"1F469-200D-1F469-200D-1F467-200D-1F467\",\n \"female-technologist\": \"1F469-200D-1F4BB\",\n \"female-office-worker\": \"1F469-200D-1F4BC\",\n \"female-mechanic\": \"1F469-200D-1F527\",\n \"female-scientist\": \"1F469-200D-1F52C\",\n \"female-astronaut\": \"1F469-200D-1F680\",\n \"female-firefighter\": \"1F469-200D-1F692\",\n \"woman_with_probing_cane\": \"1F469-200D-1F9AF\",\n \"red_haired_woman\": \"1F469-200D-1F9B0\",\n \"curly_haired_woman\": \"1F469-200D-1F9B1\",\n \"bald_woman\": \"1F469-200D-1F9B2\",\n \"white_haired_woman\": \"1F469-200D-1F9B3\",\n \"woman_in_motorized_wheelchair\": \"1F469-200D-1F9BC\",\n \"woman_in_manual_wheelchair\": \"1F469-200D-1F9BD\",\n \"female-doctor\": \"1F469-200D-2695-FE0F\",\n \"female-judge\": \"1F469-200D-2696-FE0F\",\n \"female-pilot\": \"1F469-200D-2708-FE0F\",\n \"woman-heart-man\": \"1F469-200D-2764-FE0F-200D-1F468\",\n \"woman-heart-woman\": \"1F469-200D-2764-FE0F-200D-1F469\",\n \"woman-kiss-man\": \"1F469-200D-2764-FE0F-200D-1F48B-200D-1F468\",\n \"woman-kiss-woman\": \"1F469-200D-2764-FE0F-200D-1F48B-200D-1F469\",\n \"woman\": \"1F469\",\n \"family\": \"1F468-200D-1F469-200D-1F466\",\n \"couple\": \"1F46B\",\n \"two_men_holding_hands\": \"1F46C\",\n \"two_women_holding_hands\": \"1F46D\",\n \"female-police-officer\": \"1F46E-200D-2640-FE0F\",\n \"male-police-officer\": \"1F46E-200D-2642-FE0F\",\n \"cop\": \"1F46E-200D-2642-FE0F\",\n \"woman-with-bunny-ears-partying\": \"1F46F-200D-2640-FE0F\",\n \"man-with-bunny-ears-partying\": \"1F46F-200D-2642-FE0F\",\n \"dancers\": \"1F46F-200D-2640-FE0F\",\n \"woman_with_veil\": \"1F470-200D-2640-FE0F\",\n \"man_with_veil\": \"1F470-200D-2642-FE0F\",\n \"bride_with_veil\": \"1F470\",\n \"blond-haired-woman\": \"1F471-200D-2640-FE0F\",\n \"blond-haired-man\": \"1F471-200D-2642-FE0F\",\n \"person_with_blond_hair\": \"1F471-200D-2642-FE0F\",\n \"man_with_gua_pi_mao\": \"1F472\",\n \"woman-wearing-turban\": \"1F473-200D-2640-FE0F\",\n \"man-wearing-turban\": \"1F473-200D-2642-FE0F\",\n \"man_with_turban\": \"1F473-200D-2642-FE0F\",\n \"older_man\": \"1F474\",\n \"older_woman\": \"1F475\",\n \"baby\": \"1F476\",\n \"female-construction-worker\": \"1F477-200D-2640-FE0F\",\n \"male-construction-worker\": \"1F477-200D-2642-FE0F\",\n \"construction_worker\": \"1F477-200D-2642-FE0F\",\n \"princess\": \"1F478\",\n \"japanese_ogre\": \"1F479\",\n \"japanese_goblin\": \"1F47A\",\n \"ghost\": \"1F47B\",\n \"angel\": \"1F47C\",\n \"alien\": \"1F47D\",\n \"space_invader\": \"1F47E\",\n \"imp\": \"1F47F\",\n \"skull\": \"1F480\",\n \"woman-tipping-hand\": \"1F481-200D-2640-FE0F\",\n \"man-tipping-hand\": \"1F481-200D-2642-FE0F\",\n \"information_desk_person\": \"1F481-200D-2640-FE0F\",\n \"female-guard\": \"1F482-200D-2640-FE0F\",\n \"male-guard\": \"1F482-200D-2642-FE0F\",\n \"guardsman\": \"1F482-200D-2642-FE0F\",\n \"dancer\": \"1F483\",\n \"lipstick\": \"1F484\",\n \"nail_care\": \"1F485\",\n \"woman-getting-massage\": \"1F486-200D-2640-FE0F\",\n \"man-getting-massage\": \"1F486-200D-2642-FE0F\",\n \"massage\": \"1F486-200D-2640-FE0F\",\n \"woman-getting-haircut\": \"1F487-200D-2640-FE0F\",\n \"man-getting-haircut\": \"1F487-200D-2642-FE0F\",\n \"haircut\": \"1F487-200D-2640-FE0F\",\n \"barber\": \"1F488\",\n \"syringe\": \"1F489\",\n \"pill\": \"1F48A\",\n \"kiss\": \"1F48B\",\n \"love_letter\": \"1F48C\",\n \"ring\": \"1F48D\",\n \"gem\": \"1F48E\",\n \"couplekiss\": \"1F469-200D-2764-FE0F-200D-1F48B-200D-1F468\",\n \"bouquet\": \"1F490\",\n \"couple_with_heart\": \"1F469-200D-2764-FE0F-200D-1F468\",\n \"wedding\": \"1F492\",\n \"heartbeat\": \"1F493\",\n \"broken_heart\": \"1F494\",\n \"two_hearts\": \"1F495\",\n \"sparkling_heart\": \"1F496\",\n \"heartpulse\": \"1F497\",\n \"cupid\": \"1F498\",\n \"blue_heart\": \"1F499\",\n \"green_heart\": \"1F49A\",\n \"yellow_heart\": \"1F49B\",\n \"purple_heart\": \"1F49C\",\n \"gift_heart\": \"1F49D\",\n \"revolving_hearts\": \"1F49E\",\n \"heart_decoration\": \"1F49F\",\n \"diamond_shape_with_a_dot_inside\": \"1F4A0\",\n \"bulb\": \"1F4A1\",\n \"anger\": \"1F4A2\",\n \"bomb\": \"1F4A3\",\n \"zzz\": \"1F4A4\",\n \"boom\": \"1F4A5\",\n \"sweat_drops\": \"1F4A6\",\n \"droplet\": \"1F4A7\",\n \"dash\": \"1F4A8\",\n \"hankey\": \"1F4A9\",\n \"muscle\": \"1F4AA\",\n \"dizzy\": \"1F4AB\",\n \"speech_balloon\": \"1F4AC\",\n \"thought_balloon\": \"1F4AD\",\n \"white_flower\": \"1F4AE\",\n \"100\": \"1F4AF\",\n \"moneybag\": \"1F4B0\",\n \"currency_exchange\": \"1F4B1\",\n \"heavy_dollar_sign\": \"1F4B2\",\n \"credit_card\": \"1F4B3\",\n \"yen\": \"1F4B4\",\n \"dollar\": \"1F4B5\",\n \"euro\": \"1F4B6\",\n \"pound\": \"1F4B7\",\n \"money_with_wings\": \"1F4B8\",\n \"chart\": \"1F4B9\",\n \"seat\": \"1F4BA\",\n \"computer\": \"1F4BB\",\n \"briefcase\": \"1F4BC\",\n \"minidisc\": \"1F4BD\",\n \"floppy_disk\": \"1F4BE\",\n \"cd\": \"1F4BF\",\n \"dvd\": \"1F4C0\",\n \"file_folder\": \"1F4C1\",\n \"open_file_folder\": \"1F4C2\",\n \"page_with_curl\": \"1F4C3\",\n \"page_facing_up\": \"1F4C4\",\n \"date\": \"1F4C5\",\n \"calendar\": \"1F4C6\",\n \"card_index\": \"1F4C7\",\n \"chart_with_upwards_trend\": \"1F4C8\",\n \"chart_with_downwards_trend\": \"1F4C9\",\n \"bar_chart\": \"1F4CA\",\n \"clipboard\": \"1F4CB\",\n \"pushpin\": \"1F4CC\",\n \"round_pushpin\": \"1F4CD\",\n \"paperclip\": \"1F4CE\",\n \"straight_ruler\": \"1F4CF\",\n \"triangular_ruler\": \"1F4D0\",\n \"bookmark_tabs\": \"1F4D1\",\n \"ledger\": \"1F4D2\",\n \"notebook\": \"1F4D3\",\n \"notebook_with_decorative_cover\": \"1F4D4\",\n \"closed_book\": \"1F4D5\",\n \"book\": \"1F4D6\",\n \"green_book\": \"1F4D7\",\n \"blue_book\": \"1F4D8\",\n \"orange_book\": \"1F4D9\",\n \"books\": \"1F4DA\",\n \"name_badge\": \"1F4DB\",\n \"scroll\": \"1F4DC\",\n \"memo\": \"1F4DD\",\n \"telephone_receiver\": \"1F4DE\",\n \"pager\": \"1F4DF\",\n \"fax\": \"1F4E0\",\n \"satellite_antenna\": \"1F4E1\",\n \"loudspeaker\": \"1F4E2\",\n \"mega\": \"1F4E3\",\n \"outbox_tray\": \"1F4E4\",\n \"inbox_tray\": \"1F4E5\",\n \"package\": \"1F4E6\",\n \"e-mail\": \"1F4E7\",\n \"incoming_envelope\": \"1F4E8\",\n \"envelope_with_arrow\": \"1F4E9\",\n \"mailbox_closed\": \"1F4EA\",\n \"mailbox\": \"1F4EB\",\n \"mailbox_with_mail\": \"1F4EC\",\n \"mailbox_with_no_mail\": \"1F4ED\",\n \"postbox\": \"1F4EE\",\n \"postal_horn\": \"1F4EF\",\n \"newspaper\": \"1F4F0\",\n \"iphone\": \"1F4F1\",\n \"calling\": \"1F4F2\",\n \"vibration_mode\": \"1F4F3\",\n \"mobile_phone_off\": \"1F4F4\",\n \"no_mobile_phones\": \"1F4F5\",\n \"signal_strength\": \"1F4F6\",\n \"camera\": \"1F4F7\",\n \"camera_with_flash\": \"1F4F8\",\n \"video_camera\": \"1F4F9\",\n \"tv\": \"1F4FA\",\n \"radio\": \"1F4FB\",\n \"vhs\": \"1F4FC\",\n \"film_projector\": \"1F4FD-FE0F\",\n \"prayer_beads\": \"1F4FF\",\n \"twisted_rightwards_arrows\": \"1F500\",\n \"repeat\": \"1F501\",\n \"repeat_one\": \"1F502\",\n \"arrows_clockwise\": \"1F503\",\n \"arrows_counterclockwise\": \"1F504\",\n \"low_brightness\": \"1F505\",\n \"high_brightness\": \"1F506\",\n \"mute\": \"1F507\",\n \"speaker\": \"1F508\",\n \"sound\": \"1F509\",\n \"loud_sound\": \"1F50A\",\n \"battery\": \"1F50B\",\n \"electric_plug\": \"1F50C\",\n \"mag\": \"1F50D\",\n \"mag_right\": \"1F50E\",\n \"lock_with_ink_pen\": \"1F50F\",\n \"closed_lock_with_key\": \"1F510\",\n \"key\": \"1F511\",\n \"lock\": \"1F512\",\n \"unlock\": \"1F513\",\n \"bell\": \"1F514\",\n \"no_bell\": \"1F515\",\n \"bookmark\": \"1F516\",\n \"link\": \"1F517\",\n \"radio_button\": \"1F518\",\n \"back\": \"1F519\",\n \"end\": \"1F51A\",\n \"on\": \"1F51B\",\n \"soon\": \"1F51C\",\n \"top\": \"1F51D\",\n \"underage\": \"1F51E\",\n \"keycap_ten\": \"1F51F\",\n \"capital_abcd\": \"1F520\",\n \"abcd\": \"1F521\",\n \"1234\": \"1F522\",\n \"symbols\": \"1F523\",\n \"abc\": \"1F524\",\n \"fire\": \"1F525\",\n \"flashlight\": \"1F526\",\n \"wrench\": \"1F527\",\n \"hammer\": \"1F528\",\n \"nut_and_bolt\": \"1F529\",\n \"hocho\": \"1F52A\",\n \"gun\": \"1F52B\",\n \"microscope\": \"1F52C\",\n \"telescope\": \"1F52D\",\n \"crystal_ball\": \"1F52E\",\n \"six_pointed_star\": \"1F52F\",\n \"beginner\": \"1F530\",\n \"trident\": \"1F531\",\n \"black_square_button\": \"1F532\",\n \"white_square_button\": \"1F533\",\n \"red_circle\": \"1F534\",\n \"large_blue_circle\": \"1F535\",\n \"large_orange_diamond\": \"1F536\",\n \"large_blue_diamond\": \"1F537\",\n \"small_orange_diamond\": \"1F538\",\n \"small_blue_diamond\": \"1F539\",\n \"small_red_triangle\": \"1F53A\",\n \"small_red_triangle_down\": \"1F53B\",\n \"arrow_up_small\": \"1F53C\",\n \"arrow_down_small\": \"1F53D\",\n \"om_symbol\": \"1F549-FE0F\",\n \"dove_of_peace\": \"1F54A-FE0F\",\n \"kaaba\": \"1F54B\",\n \"mosque\": \"1F54C\",\n \"synagogue\": \"1F54D\",\n \"menorah_with_nine_branches\": \"1F54E\",\n \"clock1\": \"1F550\",\n \"clock2\": \"1F551\",\n \"clock3\": \"1F552\",\n \"clock4\": \"1F553\",\n \"clock5\": \"1F554\",\n \"clock6\": \"1F555\",\n \"clock7\": \"1F556\",\n \"clock8\": \"1F557\",\n \"clock9\": \"1F558\",\n \"clock10\": \"1F559\",\n \"clock11\": \"1F55A\",\n \"clock12\": \"1F55B\",\n \"clock130\": \"1F55C\",\n \"clock230\": \"1F55D\",\n \"clock330\": \"1F55E\",\n \"clock430\": \"1F55F\",\n \"clock530\": \"1F560\",\n \"clock630\": \"1F561\",\n \"clock730\": \"1F562\",\n \"clock830\": \"1F563\",\n \"clock930\": \"1F564\",\n \"clock1030\": \"1F565\",\n \"clock1130\": \"1F566\",\n \"clock1230\": \"1F567\",\n \"candle\": \"1F56F-FE0F\",\n \"mantelpiece_clock\": \"1F570-FE0F\",\n \"hole\": \"1F573-FE0F\",\n \"man_in_business_suit_levitating\": \"1F574-FE0F\",\n \"female-detective\": \"1F575-FE0F-200D-2640-FE0F\",\n \"male-detective\": \"1F575-FE0F-200D-2642-FE0F\",\n \"sleuth_or_spy\": \"1F575-FE0F-200D-2642-FE0F\",\n \"dark_sunglasses\": \"1F576-FE0F\",\n \"spider\": \"1F577-FE0F\",\n \"spider_web\": \"1F578-FE0F\",\n \"joystick\": \"1F579-FE0F\",\n \"man_dancing\": \"1F57A\",\n \"linked_paperclips\": \"1F587-FE0F\",\n \"lower_left_ballpoint_pen\": \"1F58A-FE0F\",\n \"lower_left_fountain_pen\": \"1F58B-FE0F\",\n \"lower_left_paintbrush\": \"1F58C-FE0F\",\n \"lower_left_crayon\": \"1F58D-FE0F\",\n \"raised_hand_with_fingers_splayed\": \"1F590-FE0F\",\n \"middle_finger\": \"1F595\",\n \"spock-hand\": \"1F596\",\n \"black_heart\": \"1F5A4\",\n \"desktop_computer\": \"1F5A5-FE0F\",\n \"printer\": \"1F5A8-FE0F\",\n \"three_button_mouse\": \"1F5B1-FE0F\",\n \"trackball\": \"1F5B2-FE0F\",\n \"frame_with_picture\": \"1F5BC-FE0F\",\n \"card_index_dividers\": \"1F5C2-FE0F\",\n \"card_file_box\": \"1F5C3-FE0F\",\n \"file_cabinet\": \"1F5C4-FE0F\",\n \"wastebasket\": \"1F5D1-FE0F\",\n \"spiral_note_pad\": \"1F5D2-FE0F\",\n \"spiral_calendar_pad\": \"1F5D3-FE0F\",\n \"compression\": \"1F5DC-FE0F\",\n \"old_key\": \"1F5DD-FE0F\",\n \"rolled_up_newspaper\": \"1F5DE-FE0F\",\n \"dagger_knife\": \"1F5E1-FE0F\",\n \"speaking_head_in_silhouette\": \"1F5E3-FE0F\",\n \"left_speech_bubble\": \"1F5E8-FE0F\",\n \"right_anger_bubble\": \"1F5EF-FE0F\",\n \"ballot_box_with_ballot\": \"1F5F3-FE0F\",\n \"world_map\": \"1F5FA-FE0F\",\n \"mount_fuji\": \"1F5FB\",\n \"tokyo_tower\": \"1F5FC\",\n \"statue_of_liberty\": \"1F5FD\",\n \"japan\": \"1F5FE\",\n \"moyai\": \"1F5FF\",\n \"grinning\": \"1F600\",\n \"grin\": \"1F601\",\n \"joy\": \"1F602\",\n \"smiley\": \"1F603\",\n \"smile\": \"1F604\",\n \"sweat_smile\": \"1F605\",\n \"laughing\": \"1F606\",\n \"innocent\": \"1F607\",\n \"smiling_imp\": \"1F608\",\n \"wink\": \"1F609\",\n \"blush\": \"1F60A\",\n \"yum\": \"1F60B\",\n \"relieved\": \"1F60C\",\n \"heart_eyes\": \"1F60D\",\n \"sunglasses\": \"1F60E\",\n \"smirk\": \"1F60F\",\n \"neutral_face\": \"1F610\",\n \"expressionless\": \"1F611\",\n \"unamused\": \"1F612\",\n \"sweat\": \"1F613\",\n \"pensive\": \"1F614\",\n \"confused\": \"1F615\",\n \"confounded\": \"1F616\",\n \"kissing\": \"1F617\",\n \"kissing_heart\": \"1F618\",\n \"kissing_smiling_eyes\": \"1F619\",\n \"kissing_closed_eyes\": \"1F61A\",\n \"stuck_out_tongue\": \"1F61B\",\n \"stuck_out_tongue_winking_eye\": \"1F61C\",\n \"stuck_out_tongue_closed_eyes\": \"1F61D\",\n \"disappointed\": \"1F61E\",\n \"worried\": \"1F61F\",\n \"angry\": \"1F620\",\n \"rage\": \"1F621\",\n \"cry\": \"1F622\",\n \"persevere\": \"1F623\",\n \"triumph\": \"1F624\",\n \"disappointed_relieved\": \"1F625\",\n \"frowning\": \"1F626\",\n \"anguished\": \"1F627\",\n \"fearful\": \"1F628\",\n \"weary\": \"1F629\",\n \"sleepy\": \"1F62A\",\n \"tired_face\": \"1F62B\",\n \"grimacing\": \"1F62C\",\n \"sob\": \"1F62D\",\n \"open_mouth\": \"1F62E\",\n \"hushed\": \"1F62F\",\n \"cold_sweat\": \"1F630\",\n \"scream\": \"1F631\",\n \"astonished\": \"1F632\",\n \"flushed\": \"1F633\",\n \"sleeping\": \"1F634\",\n \"dizzy_face\": \"1F635\",\n \"no_mouth\": \"1F636\",\n \"mask\": \"1F637\",\n \"smile_cat\": \"1F638\",\n \"joy_cat\": \"1F639\",\n \"smiley_cat\": \"1F63A\",\n \"heart_eyes_cat\": \"1F63B\",\n \"smirk_cat\": \"1F63C\",\n \"kissing_cat\": \"1F63D\",\n \"pouting_cat\": \"1F63E\",\n \"crying_cat_face\": \"1F63F\",\n \"scream_cat\": \"1F640\",\n \"slightly_frowning_face\": \"1F641\",\n \"slightly_smiling_face\": \"1F642\",\n \"upside_down_face\": \"1F643\",\n \"face_with_rolling_eyes\": \"1F644\",\n \"woman-gesturing-no\": \"1F645-200D-2640-FE0F\",\n \"man-gesturing-no\": \"1F645-200D-2642-FE0F\",\n \"no_good\": \"1F645-200D-2640-FE0F\",\n \"woman-gesturing-ok\": \"1F646-200D-2640-FE0F\",\n \"man-gesturing-ok\": \"1F646-200D-2642-FE0F\",\n \"ok_woman\": \"1F646-200D-2640-FE0F\",\n \"woman-bowing\": \"1F647-200D-2640-FE0F\",\n \"man-bowing\": \"1F647-200D-2642-FE0F\",\n \"bow\": \"1F647-200D-2642-FE0F\",\n \"see_no_evil\": \"1F648\",\n \"hear_no_evil\": \"1F649\",\n \"speak_no_evil\": \"1F64A\",\n \"woman-raising-hand\": \"1F64B-200D-2640-FE0F\",\n \"man-raising-hand\": \"1F64B-200D-2642-FE0F\",\n \"raising_hand\": \"1F64B-200D-2640-FE0F\",\n \"raised_hands\": \"1F64C\",\n \"woman-frowning\": \"1F64D-200D-2640-FE0F\",\n \"man-frowning\": \"1F64D-200D-2642-FE0F\",\n \"person_frowning\": \"1F64D-200D-2640-FE0F\",\n \"woman-pouting\": \"1F64E-200D-2640-FE0F\",\n \"man-pouting\": \"1F64E-200D-2642-FE0F\",\n \"person_with_pouting_face\": \"1F64E-200D-2640-FE0F\",\n \"pray\": \"1F64F\",\n \"rocket\": \"1F680\",\n \"helicopter\": \"1F681\",\n \"steam_locomotive\": \"1F682\",\n \"railway_car\": \"1F683\",\n \"bullettrain_side\": \"1F684\",\n \"bullettrain_front\": \"1F685\",\n \"train2\": \"1F686\",\n \"metro\": \"1F687\",\n \"light_rail\": \"1F688\",\n \"station\": \"1F689\",\n \"tram\": \"1F68A\",\n \"train\": \"1F68B\",\n \"bus\": \"1F68C\",\n \"oncoming_bus\": \"1F68D\",\n \"trolleybus\": \"1F68E\",\n \"busstop\": \"1F68F\",\n \"minibus\": \"1F690\",\n \"ambulance\": \"1F691\",\n \"fire_engine\": \"1F692\",\n \"police_car\": \"1F693\",\n \"oncoming_police_car\": \"1F694\",\n \"taxi\": \"1F695\",\n \"oncoming_taxi\": \"1F696\",\n \"car\": \"1F697\",\n \"oncoming_automobile\": \"1F698\",\n \"blue_car\": \"1F699\",\n \"truck\": \"1F69A\",\n \"articulated_lorry\": \"1F69B\",\n \"tractor\": \"1F69C\",\n \"monorail\": \"1F69D\",\n \"mountain_railway\": \"1F69E\",\n \"suspension_railway\": \"1F69F\",\n \"mountain_cableway\": \"1F6A0\",\n \"aerial_tramway\": \"1F6A1\",\n \"ship\": \"1F6A2\",\n \"woman-rowing-boat\": \"1F6A3-200D-2640-FE0F\",\n \"man-rowing-boat\": \"1F6A3-200D-2642-FE0F\",\n \"rowboat\": \"1F6A3-200D-2642-FE0F\",\n \"speedboat\": \"1F6A4\",\n \"traffic_light\": \"1F6A5\",\n \"vertical_traffic_light\": \"1F6A6\",\n \"construction\": \"1F6A7\",\n \"rotating_light\": \"1F6A8\",\n \"triangular_flag_on_post\": \"1F6A9\",\n \"door\": \"1F6AA\",\n \"no_entry_sign\": \"1F6AB\",\n \"smoking\": \"1F6AC\",\n \"no_smoking\": \"1F6AD\",\n \"put_litter_in_its_place\": \"1F6AE\",\n \"do_not_litter\": \"1F6AF\",\n \"potable_water\": \"1F6B0\",\n \"non-potable_water\": \"1F6B1\",\n \"bike\": \"1F6B2\",\n \"no_bicycles\": \"1F6B3\",\n \"woman-biking\": \"1F6B4-200D-2640-FE0F\",\n \"man-biking\": \"1F6B4-200D-2642-FE0F\",\n \"bicyclist\": \"1F6B4-200D-2642-FE0F\",\n \"woman-mountain-biking\": \"1F6B5-200D-2640-FE0F\",\n \"man-mountain-biking\": \"1F6B5-200D-2642-FE0F\",\n \"mountain_bicyclist\": \"1F6B5-200D-2642-FE0F\",\n \"woman-walking\": \"1F6B6-200D-2640-FE0F\",\n \"man-walking\": \"1F6B6-200D-2642-FE0F\",\n \"walking\": \"1F6B6-200D-2642-FE0F\",\n \"no_pedestrians\": \"1F6B7\",\n \"children_crossing\": \"1F6B8\",\n \"mens\": \"1F6B9\",\n \"womens\": \"1F6BA\",\n \"restroom\": \"1F6BB\",\n \"baby_symbol\": \"1F6BC\",\n \"toilet\": \"1F6BD\",\n \"wc\": \"1F6BE\",\n \"shower\": \"1F6BF\",\n \"bath\": \"1F6C0\",\n \"bathtub\": \"1F6C1\",\n \"passport_control\": \"1F6C2\",\n \"customs\": \"1F6C3\",\n \"baggage_claim\": \"1F6C4\",\n \"left_luggage\": \"1F6C5\",\n \"couch_and_lamp\": \"1F6CB-FE0F\",\n \"sleeping_accommodation\": \"1F6CC\",\n \"shopping_bags\": \"1F6CD-FE0F\",\n \"bellhop_bell\": \"1F6CE-FE0F\",\n \"bed\": \"1F6CF-FE0F\",\n \"place_of_worship\": \"1F6D0\",\n \"octagonal_sign\": \"1F6D1\",\n \"shopping_trolley\": \"1F6D2\",\n \"hindu_temple\": \"1F6D5\",\n \"hut\": \"1F6D6\",\n \"elevator\": \"1F6D7\",\n \"hammer_and_wrench\": \"1F6E0-FE0F\",\n \"shield\": \"1F6E1-FE0F\",\n \"oil_drum\": \"1F6E2-FE0F\",\n \"motorway\": \"1F6E3-FE0F\",\n \"railway_track\": \"1F6E4-FE0F\",\n \"motor_boat\": \"1F6E5-FE0F\",\n \"small_airplane\": \"1F6E9-FE0F\",\n \"airplane_departure\": \"1F6EB\",\n \"airplane_arriving\": \"1F6EC\",\n \"satellite\": \"1F6F0-FE0F\",\n \"passenger_ship\": \"1F6F3-FE0F\",\n \"scooter\": \"1F6F4\",\n \"motor_scooter\": \"1F6F5\",\n \"canoe\": \"1F6F6\",\n \"sled\": \"1F6F7\",\n \"flying_saucer\": \"1F6F8\",\n \"skateboard\": \"1F6F9\",\n \"auto_rickshaw\": \"1F6FA\",\n \"pickup_truck\": \"1F6FB\",\n \"roller_skate\": \"1F6FC\",\n \"large_orange_circle\": \"1F7E0\",\n \"large_yellow_circle\": \"1F7E1\",\n \"large_green_circle\": \"1F7E2\",\n \"large_purple_circle\": \"1F7E3\",\n \"large_brown_circle\": \"1F7E4\",\n \"large_red_square\": \"1F7E5\",\n \"large_blue_square\": \"1F7E6\",\n \"large_orange_square\": \"1F7E7\",\n \"large_yellow_square\": \"1F7E8\",\n \"large_green_square\": \"1F7E9\",\n \"large_purple_square\": \"1F7EA\",\n \"large_brown_square\": \"1F7EB\",\n \"pinched_fingers\": \"1F90C\",\n \"white_heart\": \"1F90D\",\n \"brown_heart\": \"1F90E\",\n \"pinching_hand\": \"1F90F\",\n \"zipper_mouth_face\": \"1F910\",\n \"money_mouth_face\": \"1F911\",\n \"face_with_thermometer\": \"1F912\",\n \"nerd_face\": \"1F913\",\n \"thinking_face\": \"1F914\",\n \"face_with_head_bandage\": \"1F915\",\n \"robot_face\": \"1F916\",\n \"hugging_face\": \"1F917\",\n \"the_horns\": \"1F918\",\n \"call_me_hand\": \"1F919\",\n \"raised_back_of_hand\": \"1F91A\",\n \"left-facing_fist\": \"1F91B\",\n \"right-facing_fist\": \"1F91C\",\n \"handshake\": \"1F91D\",\n \"crossed_fingers\": \"1F91E\",\n \"i_love_you_hand_sign\": \"1F91F\",\n \"face_with_cowboy_hat\": \"1F920\",\n \"clown_face\": \"1F921\",\n \"nauseated_face\": \"1F922\",\n \"rolling_on_the_floor_laughing\": \"1F923\",\n \"drooling_face\": \"1F924\",\n \"lying_face\": \"1F925\",\n \"woman-facepalming\": \"1F926-200D-2640-FE0F\",\n \"man-facepalming\": \"1F926-200D-2642-FE0F\",\n \"face_palm\": \"1F926\",\n \"sneezing_face\": \"1F927\",\n \"face_with_raised_eyebrow\": \"1F928\",\n \"star-struck\": \"1F929\",\n \"zany_face\": \"1F92A\",\n \"shushing_face\": \"1F92B\",\n \"face_with_symbols_on_mouth\": \"1F92C\",\n \"face_with_hand_over_mouth\": \"1F92D\",\n \"face_vomiting\": \"1F92E\",\n \"exploding_head\": \"1F92F\",\n \"pregnant_woman\": \"1F930\",\n \"breast-feeding\": \"1F931\",\n \"palms_up_together\": \"1F932\",\n \"selfie\": \"1F933\",\n \"prince\": \"1F934\",\n \"woman_in_tuxedo\": \"1F935-200D-2640-FE0F\",\n \"man_in_tuxedo\": \"1F935\",\n \"mrs_claus\": \"1F936\",\n \"woman-shrugging\": \"1F937-200D-2640-FE0F\",\n \"man-shrugging\": \"1F937-200D-2642-FE0F\",\n \"shrug\": \"1F937\",\n \"woman-cartwheeling\": \"1F938-200D-2640-FE0F\",\n \"man-cartwheeling\": \"1F938-200D-2642-FE0F\",\n \"person_doing_cartwheel\": \"1F938\",\n \"woman-juggling\": \"1F939-200D-2640-FE0F\",\n \"man-juggling\": \"1F939-200D-2642-FE0F\",\n \"juggling\": \"1F939\",\n \"fencer\": \"1F93A\",\n \"woman-wrestling\": \"1F93C-200D-2640-FE0F\",\n \"man-wrestling\": \"1F93C-200D-2642-FE0F\",\n \"wrestlers\": \"1F93C\",\n \"woman-playing-water-polo\": \"1F93D-200D-2640-FE0F\",\n \"man-playing-water-polo\": \"1F93D-200D-2642-FE0F\",\n \"water_polo\": \"1F93D\",\n \"woman-playing-handball\": \"1F93E-200D-2640-FE0F\",\n \"man-playing-handball\": \"1F93E-200D-2642-FE0F\",\n \"handball\": \"1F93E\",\n \"diving_mask\": \"1F93F\",\n \"wilted_flower\": \"1F940\",\n \"drum_with_drumsticks\": \"1F941\",\n \"clinking_glasses\": \"1F942\",\n \"tumbler_glass\": \"1F943\",\n \"spoon\": \"1F944\",\n \"goal_net\": \"1F945\",\n \"first_place_medal\": \"1F947\",\n \"second_place_medal\": \"1F948\",\n \"third_place_medal\": \"1F949\",\n \"boxing_glove\": \"1F94A\",\n \"martial_arts_uniform\": \"1F94B\",\n \"curling_stone\": \"1F94C\",\n \"lacrosse\": \"1F94D\",\n \"softball\": \"1F94E\",\n \"flying_disc\": \"1F94F\",\n \"croissant\": \"1F950\",\n \"avocado\": \"1F951\",\n \"cucumber\": \"1F952\",\n \"bacon\": \"1F953\",\n \"potato\": \"1F954\",\n \"carrot\": \"1F955\",\n \"baguette_bread\": \"1F956\",\n \"green_salad\": \"1F957\",\n \"shallow_pan_of_food\": \"1F958\",\n \"stuffed_flatbread\": \"1F959\",\n \"egg\": \"1F95A\",\n \"glass_of_milk\": \"1F95B\",\n \"peanuts\": \"1F95C\",\n \"kiwifruit\": \"1F95D\",\n \"pancakes\": \"1F95E\",\n \"dumpling\": \"1F95F\",\n \"fortune_cookie\": \"1F960\",\n \"takeout_box\": \"1F961\",\n \"chopsticks\": \"1F962\",\n \"bowl_with_spoon\": \"1F963\",\n \"cup_with_straw\": \"1F964\",\n \"coconut\": \"1F965\",\n \"broccoli\": \"1F966\",\n \"pie\": \"1F967\",\n \"pretzel\": \"1F968\",\n \"cut_of_meat\": \"1F969\",\n \"sandwich\": \"1F96A\",\n \"canned_food\": \"1F96B\",\n \"leafy_green\": \"1F96C\",\n \"mango\": \"1F96D\",\n \"moon_cake\": \"1F96E\",\n \"bagel\": \"1F96F\",\n \"smiling_face_with_3_hearts\": \"1F970\",\n \"yawning_face\": \"1F971\",\n \"smiling_face_with_tear\": \"1F972\",\n \"partying_face\": \"1F973\",\n \"woozy_face\": \"1F974\",\n \"hot_face\": \"1F975\",\n \"cold_face\": \"1F976\",\n \"ninja\": \"1F977\",\n \"disguised_face\": \"1F978\",\n \"pleading_face\": \"1F97A\",\n \"sari\": \"1F97B\",\n \"lab_coat\": \"1F97C\",\n \"goggles\": \"1F97D\",\n \"hiking_boot\": \"1F97E\",\n \"womans_flat_shoe\": \"1F97F\",\n \"crab\": \"1F980\",\n \"lion_face\": \"1F981\",\n \"scorpion\": \"1F982\",\n \"turkey\": \"1F983\",\n \"unicorn_face\": \"1F984\",\n \"eagle\": \"1F985\",\n \"duck\": \"1F986\",\n \"bat\": \"1F987\",\n \"shark\": \"1F988\",\n \"owl\": \"1F989\",\n \"fox_face\": \"1F98A\",\n \"butterfly\": \"1F98B\",\n \"deer\": \"1F98C\",\n \"gorilla\": \"1F98D\",\n \"lizard\": \"1F98E\",\n \"rhinoceros\": \"1F98F\",\n \"shrimp\": \"1F990\",\n \"squid\": \"1F991\",\n \"giraffe_face\": \"1F992\",\n \"zebra_face\": \"1F993\",\n \"hedgehog\": \"1F994\",\n \"sauropod\": \"1F995\",\n \"t-rex\": \"1F996\",\n \"cricket\": \"1F997\",\n \"kangaroo\": \"1F998\",\n \"llama\": \"1F999\",\n \"peacock\": \"1F99A\",\n \"hippopotamus\": \"1F99B\",\n \"parrot\": \"1F99C\",\n \"raccoon\": \"1F99D\",\n \"lobster\": \"1F99E\",\n \"mosquito\": \"1F99F\",\n \"microbe\": \"1F9A0\",\n \"badger\": \"1F9A1\",\n \"swan\": \"1F9A2\",\n \"mammoth\": \"1F9A3\",\n \"dodo\": \"1F9A4\",\n \"sloth\": \"1F9A5\",\n \"otter\": \"1F9A6\",\n \"orangutan\": \"1F9A7\",\n \"skunk\": \"1F9A8\",\n \"flamingo\": \"1F9A9\",\n \"oyster\": \"1F9AA\",\n \"beaver\": \"1F9AB\",\n \"bison\": \"1F9AC\",\n \"seal\": \"1F9AD\",\n \"guide_dog\": \"1F9AE\",\n \"probing_cane\": \"1F9AF\",\n \"bone\": \"1F9B4\",\n \"leg\": \"1F9B5\",\n \"foot\": \"1F9B6\",\n \"tooth\": \"1F9B7\",\n \"female_superhero\": \"1F9B8-200D-2640-FE0F\",\n \"male_superhero\": \"1F9B8-200D-2642-FE0F\",\n \"superhero\": \"1F9B8\",\n \"female_supervillain\": \"1F9B9-200D-2640-FE0F\",\n \"male_supervillain\": \"1F9B9-200D-2642-FE0F\",\n \"supervillain\": \"1F9B9\",\n \"safety_vest\": \"1F9BA\",\n \"ear_with_hearing_aid\": \"1F9BB\",\n \"motorized_wheelchair\": \"1F9BC\",\n \"manual_wheelchair\": \"1F9BD\",\n \"mechanical_arm\": \"1F9BE\",\n \"mechanical_leg\": \"1F9BF\",\n \"cheese_wedge\": \"1F9C0\",\n \"cupcake\": \"1F9C1\",\n \"salt\": \"1F9C2\",\n \"beverage_box\": \"1F9C3\",\n \"garlic\": \"1F9C4\",\n \"onion\": \"1F9C5\",\n \"falafel\": \"1F9C6\",\n \"waffle\": \"1F9C7\",\n \"butter\": \"1F9C8\",\n \"mate_drink\": \"1F9C9\",\n \"ice_cube\": \"1F9CA\",\n \"bubble_tea\": \"1F9CB\",\n \"woman_standing\": \"1F9CD-200D-2640-FE0F\",\n \"man_standing\": \"1F9CD-200D-2642-FE0F\",\n \"standing_person\": \"1F9CD\",\n \"woman_kneeling\": \"1F9CE-200D-2640-FE0F\",\n \"man_kneeling\": \"1F9CE-200D-2642-FE0F\",\n \"kneeling_person\": \"1F9CE\",\n \"deaf_woman\": \"1F9CF-200D-2640-FE0F\",\n \"deaf_man\": \"1F9CF-200D-2642-FE0F\",\n \"deaf_person\": \"1F9CF\",\n \"face_with_monocle\": \"1F9D0\",\n \"farmer\": \"1F9D1-200D-1F33E\",\n \"cook\": \"1F9D1-200D-1F373\",\n \"person_feeding_baby\": \"1F9D1-200D-1F37C\",\n \"mx_claus\": \"1F9D1-200D-1F384\",\n \"student\": \"1F9D1-200D-1F393\",\n \"singer\": \"1F9D1-200D-1F3A4\",\n \"artist\": \"1F9D1-200D-1F3A8\",\n \"teacher\": \"1F9D1-200D-1F3EB\",\n \"factory_worker\": \"1F9D1-200D-1F3ED\",\n \"technologist\": \"1F9D1-200D-1F4BB\",\n \"office_worker\": \"1F9D1-200D-1F4BC\",\n \"mechanic\": \"1F9D1-200D-1F527\",\n \"scientist\": \"1F9D1-200D-1F52C\",\n \"astronaut\": \"1F9D1-200D-1F680\",\n \"firefighter\": \"1F9D1-200D-1F692\",\n \"people_holding_hands\": \"1F9D1-200D-1F91D-200D-1F9D1\",\n \"person_with_probing_cane\": \"1F9D1-200D-1F9AF\",\n \"red_haired_person\": \"1F9D1-200D-1F9B0\",\n \"curly_haired_person\": \"1F9D1-200D-1F9B1\",\n \"bald_person\": \"1F9D1-200D-1F9B2\",\n \"white_haired_person\": \"1F9D1-200D-1F9B3\",\n \"person_in_motorized_wheelchair\": \"1F9D1-200D-1F9BC\",\n \"person_in_manual_wheelchair\": \"1F9D1-200D-1F9BD\",\n \"health_worker\": \"1F9D1-200D-2695-FE0F\",\n \"judge\": \"1F9D1-200D-2696-FE0F\",\n \"pilot\": \"1F9D1-200D-2708-FE0F\",\n \"adult\": \"1F9D1\",\n \"child\": \"1F9D2\",\n \"older_adult\": \"1F9D3\",\n \"bearded_person\": \"1F9D4\",\n \"person_with_headscarf\": \"1F9D5\",\n \"woman_in_steamy_room\": \"1F9D6-200D-2640-FE0F\",\n \"man_in_steamy_room\": \"1F9D6-200D-2642-FE0F\",\n \"person_in_steamy_room\": \"1F9D6-200D-2642-FE0F\",\n \"woman_climbing\": \"1F9D7-200D-2640-FE0F\",\n \"man_climbing\": \"1F9D7-200D-2642-FE0F\",\n \"person_climbing\": \"1F9D7-200D-2640-FE0F\",\n \"woman_in_lotus_position\": \"1F9D8-200D-2640-FE0F\",\n \"man_in_lotus_position\": \"1F9D8-200D-2642-FE0F\",\n \"person_in_lotus_position\": \"1F9D8-200D-2640-FE0F\",\n \"female_mage\": \"1F9D9-200D-2640-FE0F\",\n \"male_mage\": \"1F9D9-200D-2642-FE0F\",\n \"mage\": \"1F9D9-200D-2640-FE0F\",\n \"female_fairy\": \"1F9DA-200D-2640-FE0F\",\n \"male_fairy\": \"1F9DA-200D-2642-FE0F\",\n \"fairy\": \"1F9DA-200D-2640-FE0F\",\n \"female_vampire\": \"1F9DB-200D-2640-FE0F\",\n \"male_vampire\": \"1F9DB-200D-2642-FE0F\",\n \"vampire\": \"1F9DB-200D-2640-FE0F\",\n \"mermaid\": \"1F9DC-200D-2640-FE0F\",\n \"merman\": \"1F9DC-200D-2642-FE0F\",\n \"merperson\": \"1F9DC-200D-2642-FE0F\",\n \"female_elf\": \"1F9DD-200D-2640-FE0F\",\n \"male_elf\": \"1F9DD-200D-2642-FE0F\",\n \"elf\": \"1F9DD-200D-2642-FE0F\",\n \"female_genie\": \"1F9DE-200D-2640-FE0F\",\n \"male_genie\": \"1F9DE-200D-2642-FE0F\",\n \"genie\": \"1F9DE-200D-2642-FE0F\",\n \"female_zombie\": \"1F9DF-200D-2640-FE0F\",\n \"male_zombie\": \"1F9DF-200D-2642-FE0F\",\n \"zombie\": \"1F9DF-200D-2642-FE0F\",\n \"brain\": \"1F9E0\",\n \"orange_heart\": \"1F9E1\",\n \"billed_cap\": \"1F9E2\",\n \"scarf\": \"1F9E3\",\n \"gloves\": \"1F9E4\",\n \"coat\": \"1F9E5\",\n \"socks\": \"1F9E6\",\n \"red_envelope\": \"1F9E7\",\n \"firecracker\": \"1F9E8\",\n \"jigsaw\": \"1F9E9\",\n \"test_tube\": \"1F9EA\",\n \"petri_dish\": \"1F9EB\",\n \"dna\": \"1F9EC\",\n \"compass\": \"1F9ED\",\n \"abacus\": \"1F9EE\",\n \"fire_extinguisher\": \"1F9EF\",\n \"toolbox\": \"1F9F0\",\n \"bricks\": \"1F9F1\",\n \"magnet\": \"1F9F2\",\n \"luggage\": \"1F9F3\",\n \"lotion_bottle\": \"1F9F4\",\n \"thread\": \"1F9F5\",\n \"yarn\": \"1F9F6\",\n \"safety_pin\": \"1F9F7\",\n \"teddy_bear\": \"1F9F8\",\n \"broom\": \"1F9F9\",\n \"basket\": \"1F9FA\",\n \"roll_of_paper\": \"1F9FB\",\n \"soap\": \"1F9FC\",\n \"sponge\": \"1F9FD\",\n \"receipt\": \"1F9FE\",\n \"nazar_amulet\": \"1F9FF\",\n \"ballet_shoes\": \"1FA70\",\n \"one-piece_swimsuit\": \"1FA71\",\n \"briefs\": \"1FA72\",\n \"shorts\": \"1FA73\",\n \"thong_sandal\": \"1FA74\",\n \"drop_of_blood\": \"1FA78\",\n \"adhesive_bandage\": \"1FA79\",\n \"stethoscope\": \"1FA7A\",\n \"yo-yo\": \"1FA80\",\n \"kite\": \"1FA81\",\n \"parachute\": \"1FA82\",\n \"boomerang\": \"1FA83\",\n \"magic_wand\": \"1FA84\",\n \"pinata\": \"1FA85\",\n \"nesting_dolls\": \"1FA86\",\n \"ringed_planet\": \"1FA90\",\n \"chair\": \"1FA91\",\n \"razor\": \"1FA92\",\n \"axe\": \"1FA93\",\n \"diya_lamp\": \"1FA94\",\n \"banjo\": \"1FA95\",\n \"military_helmet\": \"1FA96\",\n \"accordion\": \"1FA97\",\n \"long_drum\": \"1FA98\",\n \"coin\": \"1FA99\",\n \"carpentry_saw\": \"1FA9A\",\n \"screwdriver\": \"1FA9B\",\n \"ladder\": \"1FA9C\",\n \"hook\": \"1FA9D\",\n \"mirror\": \"1FA9E\",\n \"window\": \"1FA9F\",\n \"plunger\": \"1FAA0\",\n \"sewing_needle\": \"1FAA1\",\n \"knot\": \"1FAA2\",\n \"bucket\": \"1FAA3\",\n \"mouse_trap\": \"1FAA4\",\n \"toothbrush\": \"1FAA5\",\n \"headstone\": \"1FAA6\",\n \"placard\": \"1FAA7\",\n \"rock\": \"1FAA8\",\n \"fly\": \"1FAB0\",\n \"worm\": \"1FAB1\",\n \"cockroach\": \"1FAB3\",\n \"potted_plant\": \"1FAB4\",\n \"wood\": \"1FAB5\",\n \"feather\": \"1FAB6\",\n \"anatomical_heart\": \"1FAC0\",\n \"lungs\": \"1FAC1\",\n \"people_hugging\": \"1FAC2\",\n \"blueberries\": \"1FAD0\",\n \"bell_pepper\": \"1FAD1\",\n \"olive\": \"1FAD2\",\n \"flatbread\": \"1FAD3\",\n \"tamale\": \"1FAD4\",\n \"fondue\": \"1FAD5\",\n \"teapot\": \"1FAD6\",\n \"bangbang\": \"203C-FE0F\",\n \"interrobang\": \"2049-FE0F\",\n \"tm\": \"2122-FE0F\",\n \"information_source\": \"2139-FE0F\",\n \"left_right_arrow\": \"2194-FE0F\",\n \"arrow_up_down\": \"2195-FE0F\",\n \"arrow_upper_left\": \"2196-FE0F\",\n \"arrow_upper_right\": \"2197-FE0F\",\n \"arrow_lower_right\": \"2198-FE0F\",\n \"arrow_lower_left\": \"2199-FE0F\",\n \"leftwards_arrow_with_hook\": \"21A9-FE0F\",\n \"arrow_right_hook\": \"21AA-FE0F\",\n \"watch\": \"231A\",\n \"hourglass\": \"231B\",\n \"keyboard\": \"2328-FE0F\",\n \"eject\": \"23CF-FE0F\",\n \"fast_forward\": \"23E9\",\n \"rewind\": \"23EA\",\n \"arrow_double_up\": \"23EB\",\n \"arrow_double_down\": \"23EC\",\n \"black_right_pointing_double_triangle_with_vertical_bar\": \"23ED-FE0F\",\n \"black_left_pointing_double_triangle_with_vertical_bar\": \"23EE-FE0F\",\n \"black_right_pointing_triangle_with_double_vertical_bar\": \"23EF-FE0F\",\n \"alarm_clock\": \"23F0\",\n \"stopwatch\": \"23F1-FE0F\",\n \"timer_clock\": \"23F2-FE0F\",\n \"hourglass_flowing_sand\": \"23F3\",\n \"double_vertical_bar\": \"23F8-FE0F\",\n \"black_square_for_stop\": \"23F9-FE0F\",\n \"black_circle_for_record\": \"23FA-FE0F\",\n \"m\": \"24C2-FE0F\",\n \"black_small_square\": \"25AA-FE0F\",\n \"white_small_square\": \"25AB-FE0F\",\n \"arrow_forward\": \"25B6-FE0F\",\n \"arrow_backward\": \"25C0-FE0F\",\n \"white_medium_square\": \"25FB-FE0F\",\n \"black_medium_square\": \"25FC-FE0F\",\n \"white_medium_small_square\": \"25FD\",\n \"black_medium_small_square\": \"25FE\",\n \"sunny\": \"2600-FE0F\",\n \"cloud\": \"2601-FE0F\",\n \"umbrella\": \"2602-FE0F\",\n \"snowman\": \"2603-FE0F\",\n \"comet\": \"2604-FE0F\",\n \"phone\": \"260E-FE0F\",\n \"ballot_box_with_check\": \"2611-FE0F\",\n \"umbrella_with_rain_drops\": \"2614\",\n \"coffee\": \"2615\",\n \"shamrock\": \"2618-FE0F\",\n \"point_up\": \"261D-FE0F\",\n \"skull_and_crossbones\": \"2620-FE0F\",\n \"radioactive_sign\": \"2622-FE0F\",\n \"biohazard_sign\": \"2623-FE0F\",\n \"orthodox_cross\": \"2626-FE0F\",\n \"star_and_crescent\": \"262A-FE0F\",\n \"peace_symbol\": \"262E-FE0F\",\n \"yin_yang\": \"262F-FE0F\",\n \"wheel_of_dharma\": \"2638-FE0F\",\n \"white_frowning_face\": \"2639-FE0F\",\n \"relaxed\": \"263A-FE0F\",\n \"female_sign\": \"2640-FE0F\",\n \"male_sign\": \"2642-FE0F\",\n \"aries\": \"2648\",\n \"taurus\": \"2649\",\n \"gemini\": \"264A\",\n \"cancer\": \"264B\",\n \"leo\": \"264C\",\n \"virgo\": \"264D\",\n \"libra\": \"264E\",\n \"scorpius\": \"264F\",\n \"sagittarius\": \"2650\",\n \"capricorn\": \"2651\",\n \"aquarius\": \"2652\",\n \"pisces\": \"2653\",\n \"chess_pawn\": \"265F-FE0F\",\n \"spades\": \"2660-FE0F\",\n \"clubs\": \"2663-FE0F\",\n \"hearts\": \"2665-FE0F\",\n \"diamonds\": \"2666-FE0F\",\n \"hotsprings\": \"2668-FE0F\",\n \"recycle\": \"267B-FE0F\",\n \"infinity\": \"267E-FE0F\",\n \"wheelchair\": \"267F\",\n \"hammer_and_pick\": \"2692-FE0F\",\n \"anchor\": \"2693\",\n \"crossed_swords\": \"2694-FE0F\",\n \"medical_symbol\": \"2695-FE0F\",\n \"scales\": \"2696-FE0F\",\n \"alembic\": \"2697-FE0F\",\n \"gear\": \"2699-FE0F\",\n \"atom_symbol\": \"269B-FE0F\",\n \"fleur_de_lis\": \"269C-FE0F\",\n \"warning\": \"26A0-FE0F\",\n \"zap\": \"26A1\",\n \"transgender_symbol\": \"26A7-FE0F\",\n \"white_circle\": \"26AA\",\n \"black_circle\": \"26AB\",\n \"coffin\": \"26B0-FE0F\",\n \"funeral_urn\": \"26B1-FE0F\",\n \"soccer\": \"26BD\",\n \"baseball\": \"26BE\",\n \"snowman_without_snow\": \"26C4\",\n \"partly_sunny\": \"26C5\",\n \"thunder_cloud_and_rain\": \"26C8-FE0F\",\n \"ophiuchus\": \"26CE\",\n \"pick\": \"26CF-FE0F\",\n \"helmet_with_white_cross\": \"26D1-FE0F\",\n \"chains\": \"26D3-FE0F\",\n \"no_entry\": \"26D4\",\n \"shinto_shrine\": \"26E9-FE0F\",\n \"church\": \"26EA\",\n \"mountain\": \"26F0-FE0F\",\n \"umbrella_on_ground\": \"26F1-FE0F\",\n \"fountain\": \"26F2\",\n \"golf\": \"26F3\",\n \"ferry\": \"26F4-FE0F\",\n \"boat\": \"26F5\",\n \"skier\": \"26F7-FE0F\",\n \"ice_skate\": \"26F8-FE0F\",\n \"woman-bouncing-ball\": \"26F9-FE0F-200D-2640-FE0F\",\n \"man-bouncing-ball\": \"26F9-FE0F-200D-2642-FE0F\",\n \"person_with_ball\": \"26F9-FE0F-200D-2642-FE0F\",\n \"tent\": \"26FA\",\n \"fuelpump\": \"26FD\",\n \"scissors\": \"2702-FE0F\",\n \"white_check_mark\": \"2705\",\n \"airplane\": \"2708-FE0F\",\n \"email\": \"2709-FE0F\",\n \"fist\": \"270A\",\n \"hand\": \"270B\",\n \"v\": \"270C-FE0F\",\n \"writing_hand\": \"270D-FE0F\",\n \"pencil2\": \"270F-FE0F\",\n \"black_nib\": \"2712-FE0F\",\n \"heavy_check_mark\": \"2714-FE0F\",\n \"heavy_multiplication_x\": \"2716-FE0F\",\n \"latin_cross\": \"271D-FE0F\",\n \"star_of_david\": \"2721-FE0F\",\n \"sparkles\": \"2728\",\n \"eight_spoked_asterisk\": \"2733-FE0F\",\n \"eight_pointed_black_star\": \"2734-FE0F\",\n \"snowflake\": \"2744-FE0F\",\n \"sparkle\": \"2747-FE0F\",\n \"x\": \"274C\",\n \"negative_squared_cross_mark\": \"274E\",\n \"question\": \"2753\",\n \"grey_question\": \"2754\",\n \"grey_exclamation\": \"2755\",\n \"exclamation\": \"2757\",\n \"heavy_heart_exclamation_mark_ornament\": \"2763-FE0F\",\n \"heart\": \"2764-FE0F\",\n \"heavy_plus_sign\": \"2795\",\n \"heavy_minus_sign\": \"2796\",\n \"heavy_division_sign\": \"2797\",\n \"arrow_right\": \"27A1-FE0F\",\n \"curly_loop\": \"27B0\",\n \"loop\": \"27BF\",\n \"arrow_heading_up\": \"2934-FE0F\",\n \"arrow_heading_down\": \"2935-FE0F\",\n \"arrow_left\": \"2B05-FE0F\",\n \"arrow_up\": \"2B06-FE0F\",\n \"arrow_down\": \"2B07-FE0F\",\n \"black_large_square\": \"2B1B\",\n \"white_large_square\": \"2B1C\",\n \"star\": \"2B50\",\n \"o\": \"2B55\",\n \"wavy_dash\": \"3030-FE0F\",\n \"part_alternation_mark\": \"303D-FE0F\",\n \"congratulations\": \"3297-FE0F\",\n \"secret\": \"3299-FE0F\"\n};\n"],"file":"data.min.js"} \ No newline at end of file diff --git a/lib/amd/build/emoji/picker.min.js.map b/lib/amd/build/emoji/picker.min.js.map index f476507fdf98c..f150c1ed95922 100644 --- a/lib/amd/build/emoji/picker.min.js.map +++ b/lib/amd/build/emoji/picker.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../src/emoji/picker.js"],"names":["ROW_RENDER_BUFFER_COUNT","RECENT_EMOJIS_STORAGE_KEY","ROW_HEIGHT_RAW","EMOJIS_PER_ROW","ROW_TYPE","EMOJI","HEADER","SELECTORS","CATEGORY_SELECTOR","EMOJIS_CONTAINER","EMOJI_PREVIEW","EMOJI_SHORT_NAME","ROW_CONTAINER","SEARCH_INPUT","SEARCH_RESULTS_CONTAINER","createRowDataForCategory","categoryName","categoryDisplayName","emojis","totalRowCount","rowData","push","index","length","type","data","name","displayName","i","rowEmojis","slice","addIndexesToRowData","map","getCategoryScrollPositionsFromRowData","reduce","carry","row","createHeaderRow","rowIndex","context","text","html","temp","document","createElement","innerHTML","firstChild","createEmojiRow","emojiData","charCodes","unified","split","code","emojiText","String","fromCodePoint","apply","shortnames","join","spacer","spacers","Array","fill","isEmojiElement","element","getAttribute","findCategorySelectorFromElement","parentElement","getCategorySelectorByCategoryName","root","querySelector","setCategorySelectorActive","allCategorySelectors","querySelectorAll","selector","classList","remove","add","getCategoryByScrollPosition","position","categoryScrollPositions","positions","categoryPosition","sort","a","b","candidate","previousPosition","currentPosition","nextPosition","getRecentEmojis","storedData","LocalStorage","get","JSON","parse","saveRecentEmoji","recentEmojis","set","stringify","addRecentEmoji","recentEmojiRowCount","newEmoji","newRecentEmojis","filter","emoji","newRecentEmojiRowData","concat","getRowsToRender","scrollPosition","visibleRowCount","minVisibleRow","Math","floor","start","rows","createRowElement","style","left","right","top","doRowsMatch","renderRows","rowContainer","currentRows","nextRows","toAdd","nextRow","some","currentRow","toKeep","toRemove","toRemoveElements","Promise","all","forEach","nextRowIndex","nextRowData","nextRowNode","insertBefore","splice","appendChild","removeChild","generateRenderRowsAtPositionFunction","rowCount","isRendering","renderNextRows","nextRowsToRender","rowLimit","height","showSearchResults","emojiContainer","searchResultsContainer","clearSearch","searchInput","value","getHandleMouseEnter","emojiPreview","emojiShortName","e","target","textContent","getHandleMouseLeave","getHandleClick","selectCallback","renderAtPosition","newRowData","newCategoryScrollPositions","replace","currentScrollTop","scrollTop","isRecentEmojiRowVisible","categorySelector","selectedCategory","getHandleScroll","currentVisibleRowScrollPosition","initialCategoryScrollPositions","currentCategoryElement","previousCategoryPosition","nextCategoryPosition","newScrollPosition","upperScrollBound","lowerScrollBound","updateActiveCategory","requestAnimationFrame","getHandleSearch","renderSearchResultsAtPosition","searchTerm","toLowerCase","matchingEmojis","Object","keys","EmojiData","byShortName","shortName","includes","searchResultsString","registerEventListeners","clickHandler","scrollHandler","searchHandler","addEventListener","allData","byCategory","category","title","categoryRowData"],"mappings":"4NAqBA,uDACA,O,qnGAMMA,CAAAA,CAAuB,CAAG,C,CAC1BC,CAAyB,CAAG,sB,CAC5BC,CAAc,CAAG,E,CACjBC,CAAc,CAAG,C,CAEjBC,CAAQ,CAAG,CACbC,KAAK,CAAE,CADM,CAEbC,MAAM,CAAE,CAFK,C,CAIXC,CAAS,CAAG,CACdC,iBAAiB,CAAE,iCADL,CAEdC,gBAAgB,CAAE,oCAFJ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,CAEbR,MAAM,CAAE+E,CAFK,CAAJ,WAGP+F,CAAS,CAACW,UAHH,EALwB,CASjCvL,CAAO,CAAG,EATuB,CAUjCiF,CAAmB,CAAG,CAVW,CAgCrCqG,CAAO,CAACnE,OAAR,CAAgB,SAAAqE,CAAQ,CAAI,IAClBhC,CAAAA,CAAgB,CAAGxG,CAAiC,CAACC,CAAD,CAAOuI,CAAQ,CAAClL,IAAhB,CADlC,CAIlBT,CAAmB,CAAG2J,CAAgB,CAACiC,KAJrB,CAKlBC,CAAe,CAAG/L,CAAwB,CAAC6L,CAAQ,CAAClL,IAAV,CAAgBT,CAAhB,CAAqC2L,CAAQ,CAAC1L,MAA9C,CAAsDE,CAAO,CAACG,MAA9D,CALxB,CAOxB,GAAsB,QAAlB,GAAAqL,CAAQ,CAAClL,IAAb,CAAgC,CAG5B2E,CAAmB,CAAGyG,CAAe,CAACvL,MACzC,CAEDH,CAAO,CAAGA,CAAO,CAACuF,MAAR,CAAemG,CAAf,CACb,CAdD,EAiBA1L,CAAO,CAAGW,CAAmB,CAACX,CAAD,CAA7B,CAjDqC,GAoD/B4D,CAAAA,CAAuB,CAAG/C,CAAqC,CAACb,CAAD,CApDhC,CAqD/BiJ,CAAgB,CAAGtB,CAAoC,CAACpB,CAAD,CArDxB,CAuDrC0C,CAAgB,CAAC,CAAD,CAAIjJ,CAAJ,CAAhB,CAEAiL,EAAsB,CAClBhI,CADkB,CAElBkF,CAFkB,CAGlBc,CAHkB,CAIlB,CAJkB,CAKlBD,CALkB,CAMlBpF,CANkB,CAOlB5D,CAPkB,CAQlBiF,CARkB,CAUzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Emoji picker.\n *\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport LocalStorage from 'core/localstorage';\nimport * as EmojiData from 'core/emoji/data';\nimport {throttle, debounce} from 'core/utils';\nimport {get_string} from 'core/str';\nimport {render as renderTemplate} from 'core/templates';\n\nconst VISIBLE_ROW_COUNT = 10;\nconst ROW_RENDER_BUFFER_COUNT = 5;\nconst RECENT_EMOJIS_STORAGE_KEY = 'moodle-recent-emojis';\nconst ROW_HEIGHT_RAW = 40;\nconst EMOJIS_PER_ROW = 7;\nconst MAX_RECENT_COUNT = EMOJIS_PER_ROW * 3;\nconst ROW_TYPE = {\n EMOJI: 0,\n HEADER: 1\n};\nconst SELECTORS = {\n CATEGORY_SELECTOR: '[data-action=\"show-category\"]',\n EMOJIS_CONTAINER: '[data-region=\"emojis-container\"]',\n EMOJI_PREVIEW: '[data-region=\"emoji-preview\"]',\n EMOJI_SHORT_NAME: '[data-region=\"emoji-short-name\"]',\n ROW_CONTAINER: '[data-region=\"row-container\"]',\n SEARCH_INPUT: '[data-region=\"search-input\"]',\n SEARCH_RESULTS_CONTAINER: '[data-region=\"search-results-container\"]'\n};\n\n/**\n * Create the row data for a category.\n *\n * @param {String} categoryName The category name\n * @param {String} categoryDisplayName The category display name\n * @param {Array} emojis The emoji data\n * @param {Number} totalRowCount The total number of rows generated so far\n * @return {Array}\n */\nconst createRowDataForCategory = (categoryName, categoryDisplayName, emojis, totalRowCount) => {\n const rowData = [];\n rowData.push({\n index: totalRowCount + rowData.length,\n type: ROW_TYPE.HEADER,\n data: {\n name: categoryName,\n displayName: categoryDisplayName\n }\n });\n\n for (let i = 0; i < emojis.length; i += EMOJIS_PER_ROW) {\n const rowEmojis = emojis.slice(i, i + EMOJIS_PER_ROW);\n rowData.push({\n index: totalRowCount + rowData.length,\n type: ROW_TYPE.EMOJI,\n data: rowEmojis\n });\n }\n\n return rowData;\n};\n\n/**\n * Add each row's index to it's value in the row data.\n *\n * @param {Array} rowData List of emoji row data\n * @return {Array}\n */\nconst addIndexesToRowData = (rowData) => {\n return rowData.map((data, index) => {\n return {...data, index};\n });\n};\n\n/**\n * Calculate the scroll position for the beginning of each category from\n * the row data.\n *\n * @param {Array} rowData List of emoji row data\n * @return {Object}\n */\nconst getCategoryScrollPositionsFromRowData = (rowData) => {\n return rowData.reduce((carry, row, index) => {\n if (row.type === ROW_TYPE.HEADER) {\n carry[row.data.name] = index * ROW_HEIGHT_RAW;\n }\n return carry;\n }, {});\n};\n\n/**\n * Create a header row element for the category name.\n *\n * @param {Number} rowIndex Index of the row in the row data\n * @param {String} name The category display name\n * @return {Element}\n */\nconst createHeaderRow = async (rowIndex, name) => {\n const context = {\n index: rowIndex,\n text: name\n };\n const html = await renderTemplate('core/emoji/header_row', context);\n const temp = document.createElement('div');\n temp.innerHTML = html;\n return temp.firstChild;\n};\n\n/**\n * Create an emoji row element.\n *\n * @param {Number} rowIndex Index of the row in the row data\n * @param {Array} emojis The list of emoji data for the row\n * @return {Element}\n */\nconst createEmojiRow = async (rowIndex, emojis) => {\n const context = {\n index: rowIndex,\n emojis: emojis.map(emojiData => {\n const charCodes = emojiData.unified.split('-').map(code => `0x${code}`);\n const emojiText = String.fromCodePoint.apply(null, charCodes);\n return {\n shortnames: `:${emojiData.shortnames.join(': :')}:`,\n unified: emojiData.unified,\n text: emojiText,\n spacer: false\n };\n }),\n spacers: Array(EMOJIS_PER_ROW - emojis.length).fill(true)\n };\n const html = await renderTemplate('core/emoji/emoji_row', context);\n const temp = document.createElement('div');\n temp.innerHTML = html;\n return temp.firstChild;\n};\n\n/**\n * Check if the element is an emoji element.\n *\n * @param {Element} element Element to check\n * @return {Bool}\n */\nconst isEmojiElement = element => element.getAttribute('data-short-names') !== null;\n\n/**\n * Search from an element and up through it's ancestors to fine the category\n * selector element and return it.\n *\n * @param {Element} element Element to begin searching from\n * @return {Element|null}\n */\nconst findCategorySelectorFromElement = element => {\n if (!element) {\n return null;\n }\n\n if (element.getAttribute('data-action') === 'show-category') {\n return element;\n } else {\n return findCategorySelectorFromElement(element.parentElement);\n }\n};\n\nconst getCategorySelectorByCategoryName = (root, name) => {\n return root.querySelector(`[data-category=\"${name}\"]`);\n};\n\n/**\n * Sets the given category selector element as active.\n *\n * @param {Element} root The root picker element\n * @param {Element} element The category selector element to make active\n */\nconst setCategorySelectorActive = (root, element) => {\n const allCategorySelectors = root.querySelectorAll(SELECTORS.CATEGORY_SELECTOR);\n\n for (let i = 0; i < allCategorySelectors.length; i++) {\n const selector = allCategorySelectors[i];\n selector.classList.remove('selected');\n }\n\n element.classList.add('selected');\n};\n\n/**\n * Get the category selector element and the scroll positions for the previous and\n * next categories for the given scroll position.\n *\n * @param {Element} root The picker root element\n * @param {Number} position The position to get the category for\n * @param {Object} categoryScrollPositions Set of scroll positions for all categories\n * @return {Array}\n */\nconst getCategoryByScrollPosition = (root, position, categoryScrollPositions) => {\n let positions = [];\n\n if (position < 0) {\n position = 0;\n }\n\n // Get all of the category positions.\n for (const categoryName in categoryScrollPositions) {\n const categoryPosition = categoryScrollPositions[categoryName];\n positions.push([categoryPosition, categoryName]);\n }\n\n // Sort the positions in ascending order.\n positions.sort(([a], [b]) => {\n if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n } else {\n return 0;\n }\n });\n\n // Get the current category name as well as the previous and next category\n // positions from the sorted list of positions.\n const {categoryName, previousPosition, nextPosition} = positions.reduce(\n (carry, candidate) => {\n const [categoryPosition, categoryName] = candidate;\n\n if (categoryPosition <= position) {\n carry.categoryName = categoryName;\n carry.previousPosition = carry.currentPosition;\n carry.currentPosition = position;\n } else if (carry.nextPosition === null) {\n carry.nextPosition = categoryPosition;\n }\n\n return carry;\n },\n {\n categoryName: null,\n currentPosition: null,\n previousPosition: null,\n nextPosition: null\n }\n );\n\n return [getCategorySelectorByCategoryName(root, categoryName), previousPosition, nextPosition];\n};\n\n/**\n * Get the list of recent emojis data from local storage.\n *\n * @return {Array}\n */\nconst getRecentEmojis = () => {\n const storedData = LocalStorage.get(RECENT_EMOJIS_STORAGE_KEY);\n return storedData ? JSON.parse(storedData) : [];\n};\n\n/**\n * Save the list of recent emojis in local storage.\n *\n * @param {Array} recentEmojis List of emoji data to save\n */\nconst saveRecentEmoji = (recentEmojis) => {\n LocalStorage.set(RECENT_EMOJIS_STORAGE_KEY, JSON.stringify(recentEmojis));\n};\n\n/**\n * Add an emoji data to the set of recent emojis. This function will update the row\n * data to ensure that the recent emoji rows are correct and all of the rows are\n * re-indexed.\n *\n * The new set of recent emojis are saved in local storage and the full set of updated\n * row data and new emoji row count are returned.\n *\n * @param {Array} rowData The emoji rows data\n * @param {Number} recentEmojiRowCount Count of the recent emoji rows\n * @param {Object} newEmoji The emoji data for the emoji to add to the recent emoji list\n * @return {Array}\n */\nconst addRecentEmoji = (rowData, recentEmojiRowCount, newEmoji) => {\n // The first set of rows is always the recent emojis.\n const categoryName = rowData[0].data.name;\n const categoryDisplayName = rowData[0].data.displayName;\n const recentEmojis = getRecentEmojis();\n // Add the new emoji to the start of the list of recent emojis.\n let newRecentEmojis = [newEmoji, ...recentEmojis.filter(emoji => emoji.unified != newEmoji.unified)];\n // Limit the number of recent emojis.\n newRecentEmojis = newRecentEmojis.slice(0, MAX_RECENT_COUNT);\n const newRecentEmojiRowData = createRowDataForCategory(categoryName, categoryDisplayName, newRecentEmojis);\n\n // Save the new list in local storage.\n saveRecentEmoji(newRecentEmojis);\n\n return [\n // Return the new rowData and re-index it to make sure it's all correct.\n addIndexesToRowData(newRecentEmojiRowData.concat(rowData.slice(recentEmojiRowCount))),\n newRecentEmojiRowData.length\n ];\n};\n\n/**\n * Calculate which rows should be visible based on the given scroll position. Adds a\n * buffer to amount to either side of the total number of requested rows so that\n * scrolling the emoji rows container is smooth.\n *\n * @param {Number} scrollPosition Scroll position within the emoji container\n * @param {Number} visibleRowCount How many rows should be visible\n * @param {Array} rowData The emoji rows data\n * @return {Array}\n */\nconst getRowsToRender = (scrollPosition, visibleRowCount, rowData) => {\n const minVisibleRow = scrollPosition > ROW_HEIGHT_RAW ? Math.floor(scrollPosition / ROW_HEIGHT_RAW) : 0;\n const start = minVisibleRow >= ROW_RENDER_BUFFER_COUNT ? minVisibleRow - ROW_RENDER_BUFFER_COUNT : minVisibleRow;\n const end = minVisibleRow + visibleRowCount + ROW_RENDER_BUFFER_COUNT;\n const rows = rowData.slice(start, end);\n return rows;\n};\n\n/**\n * Create a row element from the row data.\n *\n * @param {Object} rowData The emoji row data\n * @return {Element}\n */\nconst createRowElement = async (rowData) => {\n let row = null;\n if (rowData.type === ROW_TYPE.HEADER) {\n row = await createHeaderRow(rowData.index, rowData.data.displayName);\n } else {\n row = await createEmojiRow(rowData.index, rowData.data);\n }\n\n row.style.position = 'absolute';\n row.style.left = 0;\n row.style.right = 0;\n row.style.top = `${rowData.index * ROW_HEIGHT_RAW}px`;\n\n return row;\n};\n\n/**\n * Check if the given rows match.\n *\n * @param {Object} a The first row\n * @param {Object} b The second row\n * @return {Bool}\n */\nconst doRowsMatch = (a, b) => {\n if (a.index !== b.index) {\n return false;\n }\n\n if (a.type !== b.type) {\n return false;\n }\n\n if (typeof a.data != typeof b.data) {\n return false;\n }\n\n if (a.type === ROW_TYPE.HEADER) {\n return a.data.name === b.data.name;\n } else {\n if (a.data.length !== b.data.length) {\n return false;\n }\n\n for (let i = 0; i < a.data.length; i++) {\n if (a.data[i].unified != b.data[i].unified) {\n return false;\n }\n }\n }\n\n return true;\n};\n\n/**\n * Update the visible rows. Deletes any row elements that should no longer\n * be visible and creates the newly visible row elements. Any rows that haven't\n * changed visibility will be left untouched.\n *\n * @param {Element} rowContainer The container element for the emoji rows\n * @param {Array} currentRows List of row data that matches the currently visible rows\n * @param {Array} nextRows List of row data containing the new list of rows to be made visible\n */\nconst renderRows = async (rowContainer, currentRows, nextRows) => {\n // We need to add any rows that are in nextRows but not in currentRows.\n const toAdd = nextRows.filter(nextRow => !currentRows.some(currentRow => doRowsMatch(currentRow, nextRow)));\n // Remember which rows will still be visible so that we can insert our element in the correct place in the DOM.\n let toKeep = currentRows.filter(currentRow => nextRows.some(nextRow => doRowsMatch(currentRow, nextRow)));\n // We need to remove any rows that are in currentRows but not in nextRows.\n const toRemove = currentRows.filter(currentRow => !nextRows.some(nextRow => doRowsMatch(currentRow, nextRow)));\n const toRemoveElements = toRemove.map(rowData => rowContainer.querySelectorAll(`[data-row=\"${rowData.index}\"]`));\n\n // Render all of the templates first.\n const rows = await Promise.all(toAdd.map(rowData => createRowElement(rowData)));\n\n rows.forEach((row, index) => {\n const rowData = toAdd[index];\n let nextRowIndex = null;\n\n for (let i = 0; i < toKeep.length; i++) {\n const candidate = toKeep[i];\n if (candidate.index > rowData.index) {\n nextRowIndex = i;\n break;\n }\n }\n\n // Make sure the elements get added to the DOM in the correct order (ascending by row data index)\n // so that they appear naturally in the tab order.\n if (nextRowIndex !== null) {\n const nextRowData = toKeep[nextRowIndex];\n const nextRowNode = rowContainer.querySelector(`[data-row=\"${nextRowData.index}\"]`);\n\n rowContainer.insertBefore(row, nextRowNode);\n toKeep.splice(nextRowIndex, 0, toKeep);\n } else {\n toKeep.push(rowData);\n rowContainer.appendChild(row);\n }\n });\n\n toRemoveElements.forEach(rows => {\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n rowContainer.removeChild(row);\n }\n });\n};\n\n/**\n * Build a function to render the visible emoji rows for a given scroll\n * position.\n *\n * @param {Element} rowContainer The container element for the emoji rows\n * @return {Function}\n */\nconst generateRenderRowsAtPositionFunction = (rowContainer) => {\n let currentRows = [];\n let nextRows = [];\n let rowCount = 0;\n let isRendering = false;\n const renderNextRows = async () => {\n if (!nextRows.length) {\n return;\n }\n\n if (isRendering) {\n return;\n }\n\n isRendering = true;\n const nextRowsToRender = nextRows.slice();\n nextRows = [];\n\n await renderRows(rowContainer, currentRows, nextRowsToRender);\n currentRows = nextRowsToRender;\n isRendering = false;\n renderNextRows();\n };\n\n return (scrollPosition, rowData, rowLimit = VISIBLE_ROW_COUNT) => {\n nextRows = getRowsToRender(scrollPosition, rowLimit, rowData);\n renderNextRows();\n\n if (rowCount !== rowData.length) {\n // Adjust the height of the container to match the number of rows.\n rowContainer.style.height = `${rowData.length * ROW_HEIGHT_RAW}px`;\n }\n\n rowCount = rowData.length;\n };\n};\n\n/**\n * Show the search results container and hide the emoji container.\n *\n * @param {Element} emojiContainer The emojis container\n * @param {Element} searchResultsContainer The search results container\n */\nconst showSearchResults = (emojiContainer, searchResultsContainer) => {\n searchResultsContainer.classList.remove('hidden');\n emojiContainer.classList.add('hidden');\n};\n\n/**\n * Hide the search result container and show the emojis container.\n *\n * @param {Element} emojiContainer The emojis container\n * @param {Element} searchResultsContainer The search results container\n * @param {Element} searchInput The search input\n */\nconst clearSearch = (emojiContainer, searchResultsContainer, searchInput) => {\n searchResultsContainer.classList.add('hidden');\n emojiContainer.classList.remove('hidden');\n searchInput.value = '';\n};\n\n/**\n * Build function to handle mouse hovering an emoji. Shows the preview.\n *\n * @param {Element} emojiPreview The emoji preview element\n * @param {Element} emojiShortName The emoji short name element\n * @return {Function}\n */\nconst getHandleMouseEnter = (emojiPreview, emojiShortName) => {\n return (e) => {\n const target = e.target;\n if (isEmojiElement(target)) {\n emojiShortName.textContent = target.getAttribute('data-short-names');\n emojiPreview.textContent = target.textContent;\n }\n };\n};\n\n/**\n * Build function to handle mouse leaving an emoji. Removes the preview.\n *\n * @param {Element} emojiPreview The emoji preview element\n * @param {Element} emojiShortName The emoji short name element\n * @return {Function}\n */\nconst getHandleMouseLeave = (emojiPreview, emojiShortName) => {\n return (e) => {\n const target = e.target;\n if (isEmojiElement(target)) {\n emojiShortName.textContent = '';\n emojiPreview.textContent = '';\n }\n };\n};\n\n/**\n * Build the function to handle a user clicking something in the picker.\n *\n * The function currently handles clicking on the category selector or selecting\n * a specific emoji.\n *\n * @param {Number} recentEmojiRowCount Number of rows of recent emojis\n * @param {Element} emojiContainer Container element for the visible of emojis\n * @param {Element} searchResultsContainer Contaienr element for the search results\n * @param {Element} searchInput Search input element\n * @param {Function} selectCallback Callback function to execute when a user selects an emoji\n * @param {Function} renderAtPosition Render function to display current visible emojis\n * @return {Function}\n */\nconst getHandleClick = (\n recentEmojiRowCount,\n emojiContainer,\n searchResultsContainer,\n searchInput,\n selectCallback,\n renderAtPosition\n) => {\n return (e, rowData, categoryScrollPositions) => {\n const target = e.target;\n let newRowData = rowData;\n let newCategoryScrollPositions = categoryScrollPositions;\n\n // Hide the search results if they are visible.\n clearSearch(emojiContainer, searchResultsContainer, searchInput);\n\n if (isEmojiElement(target)) {\n // Emoji selected.\n const unified = target.getAttribute('data-unified');\n const shortnames = target.getAttribute('data-short-names').replace(/:/g, '').split(' ');\n // Build the emoji data from the selected element.\n const emojiData = {unified, shortnames};\n const currentScrollTop = emojiContainer.scrollTop;\n const isRecentEmojiRowVisible = emojiContainer.querySelector(`[data-row=\"${recentEmojiRowCount - 1}\"]`) !== null;\n // Save the selected emoji in the recent emojis list.\n [newRowData, recentEmojiRowCount] = addRecentEmoji(rowData, recentEmojiRowCount, emojiData);\n // Re-index the category scroll positions because the additional recent emoji may have\n // changed their positions.\n newCategoryScrollPositions = getCategoryScrollPositionsFromRowData(newRowData);\n\n if (isRecentEmojiRowVisible) {\n // If the list of recent emojis is currently visible then we need to re-render the emojis\n // to update the display and show the newly selected recent emoji.\n renderAtPosition(currentScrollTop, newRowData);\n }\n\n // Call the client's callback function with the selected emoji.\n selectCallback(target.textContent);\n // Return the newly calculated row data and scroll positions.\n return [newRowData, newCategoryScrollPositions];\n }\n\n const categorySelector = findCategorySelectorFromElement(target);\n if (categorySelector) {\n // Category selector.\n const selectedCategory = categorySelector.getAttribute('data-category');\n const position = categoryScrollPositions[selectedCategory];\n // Scroll the container to the selected category. This will trigger the\n // on scroll handler to re-render the visibile emojis.\n emojiContainer.scrollTop = position;\n }\n\n return [newRowData, newCategoryScrollPositions];\n };\n};\n\n/**\n * Build the function that handles scrolling of the emoji container to display the\n * correct emojis.\n *\n * We render the emoji rows as they are needed rather than all up front so that we\n * can avoid adding tends of thousands of elements to the DOM unnecessarily which\n * would bog down performance.\n *\n * @param {Element} root The picker root element\n * @param {Number} currentVisibleRowScrollPosition The current scroll position of the container\n * @param {Element} emojiContainer The emojis container element\n * @param {Object} initialCategoryScrollPositions Scroll positions for each category\n * @param {Function} renderAtPosition Function to render the appropriate emojis for a scroll position\n * @return {Function}\n */\nconst getHandleScroll = (\n root,\n currentVisibleRowScrollPosition,\n emojiContainer,\n initialCategoryScrollPositions,\n renderAtPosition\n) => {\n // Scope some local variables to track the scroll positions of the categories. We need to\n // recalculate these because adding recent emojis can change those positions by adding\n // additional rows.\n let [\n currentCategoryElement,\n previousCategoryPosition,\n nextCategoryPosition\n ] = getCategoryByScrollPosition(root, emojiContainer.scrollTop, initialCategoryScrollPositions);\n\n return (categoryScrollPositions, rowData) => {\n const newScrollPosition = emojiContainer.scrollTop;\n const upperScrollBound = currentVisibleRowScrollPosition + ROW_HEIGHT_RAW;\n const lowerScrollBound = currentVisibleRowScrollPosition - ROW_HEIGHT_RAW;\n // We only need to update the active category indicator if the user has scrolled into a\n // new category scroll position.\n const updateActiveCategory = (newScrollPosition >= nextCategoryPosition) ||\n (newScrollPosition < previousCategoryPosition);\n // We only need to render new emoji rows if the user has scrolled far enough that a new row\n // would be visible (i.e. they've scrolled up or down more than 40px - the height of a row).\n const updateRenderRows = (newScrollPosition < lowerScrollBound) || (newScrollPosition > upperScrollBound);\n\n if (updateActiveCategory) {\n // New category is visible so update the active category selector and re-index the\n // positions incase anything has changed.\n [\n currentCategoryElement,\n previousCategoryPosition,\n nextCategoryPosition\n ] = getCategoryByScrollPosition(root, newScrollPosition, categoryScrollPositions);\n setCategorySelectorActive(root, currentCategoryElement);\n }\n\n if (updateRenderRows) {\n // A new row should be visible so re-render the visible emojis at this new position.\n // We request an animation frame from the browser so that we're not blocking anything.\n // The animation only needs to occur as soon as the browser is ready not immediately.\n requestAnimationFrame(() => {\n renderAtPosition(newScrollPosition, rowData);\n // Remember the updated position.\n currentVisibleRowScrollPosition = newScrollPosition;\n });\n }\n };\n};\n\n/**\n * Build the function that handles search input from the user.\n *\n * @param {Element} searchInput The search input element\n * @param {Element} searchResultsContainer Container element to display the search results\n * @param {Element} emojiContainer Container element for the emoji rows\n * @return {Function}\n */\nconst getHandleSearch = (searchInput, searchResultsContainer, emojiContainer) => {\n const rowContainer = searchResultsContainer.querySelector(SELECTORS.ROW_CONTAINER);\n // Build a render function for the search results.\n const renderSearchResultsAtPosition = generateRenderRowsAtPositionFunction(rowContainer);\n searchResultsContainer.appendChild(rowContainer);\n\n return async () => {\n const searchTerm = searchInput.value.toLowerCase();\n\n if (searchTerm) {\n // Display the search results container and hide the emojis container.\n showSearchResults(emojiContainer, searchResultsContainer);\n\n // Find which emojis match the user's search input.\n const matchingEmojis = Object.keys(EmojiData.byShortName).reduce((carry, shortName) => {\n if (shortName.includes(searchTerm)) {\n carry.push({\n shortnames: [shortName],\n unified: EmojiData.byShortName[shortName]\n });\n }\n return carry;\n }, []);\n\n const searchResultsString = await get_string('searchresults', 'core');\n const rowData = createRowDataForCategory(searchResultsString, searchResultsString, matchingEmojis, 0);\n // Show the emoji rows for the search results.\n renderSearchResultsAtPosition(0, rowData, rowData.length);\n } else {\n // Hide the search container and show the emojis container.\n clearSearch(emojiContainer, searchResultsContainer, searchInput);\n }\n };\n};\n\n/**\n * Register the emoji picker event listeners.\n *\n * @param {Element} root The picker root element\n * @param {Element} emojiContainer Root element containing the list of visible emojis\n * @param {Function} renderAtPosition Function to render the visible emojis at a given scroll position\n * @param {Number} currentVisibleRowScrollPosition What is the current scroll position\n * @param {Function} selectCallback Function to execute when the user picks an emoji\n * @param {Object} categoryScrollPositions Scroll positions for where each of the emoji categories begin\n * @param {Array} rowData Data representing each of the display rows for hte emoji container\n * @param {Number} recentEmojiRowCount Number of rows of recent emojis\n */\nconst registerEventListeners = (\n root,\n emojiContainer,\n renderAtPosition,\n currentVisibleRowScrollPosition,\n selectCallback,\n categoryScrollPositions,\n rowData,\n recentEmojiRowCount\n) => {\n const searchInput = root.querySelector(SELECTORS.SEARCH_INPUT);\n const searchResultsContainer = root.querySelector(SELECTORS.SEARCH_RESULTS_CONTAINER);\n const emojiPreview = root.querySelector(SELECTORS.EMOJI_PREVIEW);\n const emojiShortName = root.querySelector(SELECTORS.EMOJI_SHORT_NAME);\n // Build the click handler function.\n const clickHandler = getHandleClick(\n recentEmojiRowCount,\n emojiContainer,\n searchResultsContainer,\n searchInput,\n selectCallback,\n renderAtPosition\n );\n // Build the scroll handler function.\n const scrollHandler = getHandleScroll(\n root,\n currentVisibleRowScrollPosition,\n emojiContainer,\n categoryScrollPositions,\n renderAtPosition\n );\n const searchHandler = getHandleSearch(searchInput, searchResultsContainer, emojiContainer);\n\n // Mouse enter/leave events to show the emoji preview on hover or focus.\n root.addEventListener('focus', getHandleMouseEnter(emojiPreview, emojiShortName), true);\n root.addEventListener('blur', getHandleMouseLeave(emojiPreview, emojiShortName), true);\n root.addEventListener('mouseenter', getHandleMouseEnter(emojiPreview, emojiShortName), true);\n root.addEventListener('mouseleave', getHandleMouseLeave(emojiPreview, emojiShortName), true);\n // User selects an emoji or clicks on one of the emoji category selectors.\n root.addEventListener('click', e => {\n // Update the row data and category scroll positions because they may have changes if the\n // user selects an emoji which updates the recent emojis list.\n [rowData, categoryScrollPositions] = clickHandler(e, rowData, categoryScrollPositions);\n });\n // Throttle the scroll event to only execute once every 50 milliseconds to prevent performance issues\n // in the browser when re-rendering the picker emojis. The scroll event fires a lot otherwise.\n emojiContainer.addEventListener('scroll', throttle(() => scrollHandler(categoryScrollPositions, rowData), 50));\n // Debounce the search input so that it only executes 200 milliseconds after the user has finished typing.\n searchInput.addEventListener('input', debounce(searchHandler, 200));\n};\n\n/**\n * Initialise the emoji picker.\n *\n * @param {Element} root The root element for the picker\n * @param {Function} selectCallback Callback for when the user selects an emoji\n */\nexport default (root, selectCallback) => {\n const emojiContainer = root.querySelector(SELECTORS.EMOJIS_CONTAINER);\n const rowContainer = emojiContainer.querySelector(SELECTORS.ROW_CONTAINER);\n const recentEmojis = getRecentEmojis();\n // Add the recent emojis category to the list of standard categories.\n const allData = [{\n name: 'Recent',\n emojis: recentEmojis\n }, ...EmojiData.byCategory];\n let rowData = [];\n let recentEmojiRowCount = 0;\n\n /**\n * Split categories data into rows which represent how they will be displayed in the\n * picker. Each category will add a row containing the display name for the category\n * and a row for every 9 emojis in the category. The row data will be used to calculate\n * which emojis should be visible in the picker at any given time.\n *\n * E.g.\n * input = [\n * {name: 'example1', emojis: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]},\n * {name: 'example2', emojis: [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]},\n * ]\n * output = [\n * {type: 'categoryName': data: 'Example 1'},\n * {type: 'emojiRow': data: [1, 2, 3, 4, 5, 6, 7, 8, 9]},\n * {type: 'emojiRow': data: [10, 11, 12]},\n * {type: 'categoryName': data: 'Example 2'},\n * {type: 'emojiRow': data: [13, 14, 15, 16, 17, 18, 19, 20, 21]},\n * {type: 'emojiRow': data: [22, 23]},\n * ]\n */\n allData.forEach(category => {\n const categorySelector = getCategorySelectorByCategoryName(root, category.name);\n // Get the display name from the category selector button so that we don't need to\n // send an ajax request for the string.\n const categoryDisplayName = categorySelector.title;\n const categoryRowData = createRowDataForCategory(category.name, categoryDisplayName, category.emojis, rowData.length);\n\n if (category.name === 'Recent') {\n // Remember how many recent emoji rows there are because it needs to be used to\n // re-index the row data later when we're adding more recent emojis.\n recentEmojiRowCount = categoryRowData.length;\n }\n\n rowData = rowData.concat(categoryRowData);\n });\n\n // Index the row data so that we can calculate which rows should be visible.\n rowData = addIndexesToRowData(rowData);\n // Calculate the scroll positions for each of the categories within the emoji container.\n // These are used to know where to jump to when the user selects a specific category.\n const categoryScrollPositions = getCategoryScrollPositionsFromRowData(rowData);\n const renderAtPosition = generateRenderRowsAtPositionFunction(rowContainer);\n // Display the initial set of emojis.\n renderAtPosition(0, rowData);\n\n registerEventListeners(\n root,\n emojiContainer,\n renderAtPosition,\n 0,\n selectCallback,\n categoryScrollPositions,\n rowData,\n recentEmojiRowCount\n );\n};"],"file":"picker.min.js"} \ No newline at end of file +{"version":3,"sources":["../../src/emoji/picker.js"],"names":["ROW_RENDER_BUFFER_COUNT","RECENT_EMOJIS_STORAGE_KEY","ROW_HEIGHT_RAW","EMOJIS_PER_ROW","ROW_TYPE","EMOJI","HEADER","SELECTORS","CATEGORY_SELECTOR","EMOJIS_CONTAINER","EMOJI_PREVIEW","EMOJI_SHORT_NAME","ROW_CONTAINER","SEARCH_INPUT","SEARCH_RESULTS_CONTAINER","createRowDataForCategory","categoryName","categoryDisplayName","emojis","totalRowCount","rowData","push","index","length","type","data","name","displayName","i","rowEmojis","slice","addIndexesToRowData","map","getCategoryScrollPositionsFromRowData","reduce","carry","row","createHeaderRow","rowIndex","context","text","html","temp","document","createElement","innerHTML","firstChild","createEmojiRow","emojiData","charCodes","unified","split","code","emojiText","String","fromCodePoint","apply","shortnames","join","spacer","spacers","Array","fill","isEmojiElement","element","getAttribute","findCategorySelectorFromElement","parentElement","getCategorySelectorByCategoryName","root","querySelector","setCategorySelectorActive","allCategorySelectors","querySelectorAll","selector","classList","remove","add","getCategoryByScrollPosition","position","categoryScrollPositions","positions","categoryPosition","sort","a","b","candidate","previousPosition","currentPosition","nextPosition","getRecentEmojis","storedData","LocalStorage","get","JSON","parse","saveRecentEmoji","recentEmojis","set","stringify","addRecentEmoji","recentEmojiRowCount","newEmoji","newRecentEmojis","filter","emoji","newRecentEmojiRowData","concat","getRowsToRender","scrollPosition","visibleRowCount","minVisibleRow","Math","floor","start","rows","createRowElement","style","left","right","top","doRowsMatch","renderRows","rowContainer","currentRows","nextRows","toAdd","nextRow","some","currentRow","toKeep","toRemove","toRemoveElements","Promise","all","forEach","nextRowIndex","nextRowData","nextRowNode","insertBefore","splice","appendChild","removeChild","generateRenderRowsAtPositionFunction","rowCount","isRendering","renderNextRows","nextRowsToRender","rowLimit","height","showSearchResults","emojiContainer","searchResultsContainer","clearSearch","searchInput","value","getHandleMouseEnter","emojiPreview","emojiShortName","e","target","textContent","getHandleMouseLeave","getHandleClick","selectCallback","renderAtPosition","newRowData","newCategoryScrollPositions","replace","currentScrollTop","scrollTop","isRecentEmojiRowVisible","categorySelector","selectedCategory","getHandleScroll","currentVisibleRowScrollPosition","initialCategoryScrollPositions","currentCategoryElement","previousCategoryPosition","nextCategoryPosition","newScrollPosition","upperScrollBound","lowerScrollBound","updateActiveCategory","requestAnimationFrame","getHandleSearch","renderSearchResultsAtPosition","searchTerm","toLowerCase","matchingEmojis","Object","keys","EmojiData","byShortName","shortName","includes","searchResultsString","registerEventListeners","clickHandler","scrollHandler","searchHandler","addEventListener","allData","byCategory","category","title","categoryRowData"],"mappings":"4NAsBA,uDACA,O,qnGAMMA,CAAAA,CAAuB,CAAG,C,CAC1BC,CAAyB,CAAG,sB,CAC5BC,CAAc,CAAG,E,CACjBC,CAAc,CAAG,C,CAEjBC,CAAQ,CAAG,CACbC,KAAK,CAAE,CADM,CAEbC,MAAM,CAAE,CAFK,C,CAIXC,CAAS,CAAG,CACdC,iBAAiB,CAAE,iCADL,CAEdC,gBAAgB,CAAE,oCAFJ,CAGdC,aAAa,CAAE,iCAHD,CAIdC,gBAAgB,CAAE,oCAJJ,CAKdC,aAAa,CAAE,iCALD,CAMdC,YAAY,CAAE,gCANA,CAOdC,wBAAwB,CAAE,4CAPZ,C,CAoBZC,CAAwB,CAAG,SAACC,CAAD,CAAeC,CAAf,CAAoCC,CAApC,CAA4CC,CAA5C,CAA8D,CAC3F,GAAMC,CAAAA,CAAO,CAAG,EAAhB,CACAA,CAAO,CAACC,IAAR,CAAa,CACTC,KAAK,CAAEH,CAAa,CAAGC,CAAO,CAACG,MADtB,CAETC,IAAI,CAAEpB,CAAQ,CAACE,MAFN,CAGTmB,IAAI,CAAE,CACFC,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1L,MAA9C,CAAsDE,CAAO,CAACG,MAA9D,CALxB,CAOxB,GAAsB,QAAlB,GAAAqL,CAAQ,CAAClL,IAAb,CAAgC,CAG5B2E,CAAmB,CAAGyG,CAAe,CAACvL,MACzC,CAEDH,CAAO,CAAGA,CAAO,CAACuF,MAAR,CAAemG,CAAf,CACb,CAdD,EAiBA1L,CAAO,CAAGW,CAAmB,CAACX,CAAD,CAA7B,CAjDqC,GAoD/B4D,CAAAA,CAAuB,CAAG/C,CAAqC,CAACb,CAAD,CApDhC,CAqD/BiJ,CAAgB,CAAGtB,CAAoC,CAACpB,CAAD,CArDxB,CAuDrC0C,CAAgB,CAAC,CAAD,CAAIjJ,CAAJ,CAAhB,CAEAiL,EAAsB,CAClBhI,CADkB,CAElBkF,CAFkB,CAGlBc,CAHkB,CAIlB,CAJkB,CAKlBD,CALkB,CAMlBpF,CANkB,CAOlB5D,CAPkB,CAQlBiF,CARkB,CAUzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Emoji picker.\n *\n * @module core/emoji/picker\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport LocalStorage from 'core/localstorage';\nimport * as EmojiData from 'core/emoji/data';\nimport {throttle, debounce} from 'core/utils';\nimport {get_string as getString} from 'core/str';\nimport {render as renderTemplate} from 'core/templates';\n\nconst VISIBLE_ROW_COUNT = 10;\nconst ROW_RENDER_BUFFER_COUNT = 5;\nconst RECENT_EMOJIS_STORAGE_KEY = 'moodle-recent-emojis';\nconst ROW_HEIGHT_RAW = 40;\nconst EMOJIS_PER_ROW = 7;\nconst MAX_RECENT_COUNT = EMOJIS_PER_ROW * 3;\nconst ROW_TYPE = {\n EMOJI: 0,\n HEADER: 1\n};\nconst SELECTORS = {\n CATEGORY_SELECTOR: '[data-action=\"show-category\"]',\n EMOJIS_CONTAINER: '[data-region=\"emojis-container\"]',\n EMOJI_PREVIEW: '[data-region=\"emoji-preview\"]',\n EMOJI_SHORT_NAME: '[data-region=\"emoji-short-name\"]',\n ROW_CONTAINER: '[data-region=\"row-container\"]',\n SEARCH_INPUT: '[data-region=\"search-input\"]',\n SEARCH_RESULTS_CONTAINER: '[data-region=\"search-results-container\"]'\n};\n\n/**\n * Create the row data for a category.\n *\n * @method\n * @param {String} categoryName The category name\n * @param {String} categoryDisplayName The category display name\n * @param {Array} emojis The emoji data\n * @param {Number} totalRowCount The total number of rows generated so far\n * @return {Array}\n */\nconst createRowDataForCategory = (categoryName, categoryDisplayName, emojis, totalRowCount) => {\n const rowData = [];\n rowData.push({\n index: totalRowCount + rowData.length,\n type: ROW_TYPE.HEADER,\n data: {\n name: categoryName,\n displayName: categoryDisplayName\n }\n });\n\n for (let i = 0; i < emojis.length; i += EMOJIS_PER_ROW) {\n const rowEmojis = emojis.slice(i, i + EMOJIS_PER_ROW);\n rowData.push({\n index: totalRowCount + rowData.length,\n type: ROW_TYPE.EMOJI,\n data: rowEmojis\n });\n }\n\n return rowData;\n};\n\n/**\n * Add each row's index to it's value in the row data.\n *\n * @method\n * @param {Array} rowData List of emoji row data\n * @return {Array}\n */\nconst addIndexesToRowData = (rowData) => {\n return rowData.map((data, index) => {\n return {...data, index};\n });\n};\n\n/**\n * Calculate the scroll position for the beginning of each category from\n * the row data.\n *\n * @method\n * @param {Array} rowData List of emoji row data\n * @return {Object}\n */\nconst getCategoryScrollPositionsFromRowData = (rowData) => {\n return rowData.reduce((carry, row, index) => {\n if (row.type === ROW_TYPE.HEADER) {\n carry[row.data.name] = index * ROW_HEIGHT_RAW;\n }\n return carry;\n }, {});\n};\n\n/**\n * Create a header row element for the category name.\n *\n * @method\n * @param {Number} rowIndex Index of the row in the row data\n * @param {String} name The category display name\n * @return {Element}\n */\nconst createHeaderRow = async(rowIndex, name) => {\n const context = {\n index: rowIndex,\n text: name\n };\n const html = await renderTemplate('core/emoji/header_row', context);\n const temp = document.createElement('div');\n temp.innerHTML = html;\n return temp.firstChild;\n};\n\n/**\n * Create an emoji row element.\n *\n * @method\n * @param {Number} rowIndex Index of the row in the row data\n * @param {Array} emojis The list of emoji data for the row\n * @return {Element}\n */\nconst createEmojiRow = async(rowIndex, emojis) => {\n const context = {\n index: rowIndex,\n emojis: emojis.map(emojiData => {\n const charCodes = emojiData.unified.split('-').map(code => `0x${code}`);\n const emojiText = String.fromCodePoint.apply(null, charCodes);\n return {\n shortnames: `:${emojiData.shortnames.join(': :')}:`,\n unified: emojiData.unified,\n text: emojiText,\n spacer: false\n };\n }),\n spacers: Array(EMOJIS_PER_ROW - emojis.length).fill(true)\n };\n const html = await renderTemplate('core/emoji/emoji_row', context);\n const temp = document.createElement('div');\n temp.innerHTML = html;\n return temp.firstChild;\n};\n\n/**\n * Check if the element is an emoji element.\n *\n * @method\n * @param {Element} element Element to check\n * @return {Bool}\n */\nconst isEmojiElement = element => element.getAttribute('data-short-names') !== null;\n\n/**\n * Search from an element and up through it's ancestors to fine the category\n * selector element and return it.\n *\n * @method\n * @param {Element} element Element to begin searching from\n * @return {Element|null}\n */\nconst findCategorySelectorFromElement = element => {\n if (!element) {\n return null;\n }\n\n if (element.getAttribute('data-action') === 'show-category') {\n return element;\n } else {\n return findCategorySelectorFromElement(element.parentElement);\n }\n};\n\nconst getCategorySelectorByCategoryName = (root, name) => {\n return root.querySelector(`[data-category=\"${name}\"]`);\n};\n\n/**\n * Sets the given category selector element as active.\n *\n * @method\n * @param {Element} root The root picker element\n * @param {Element} element The category selector element to make active\n */\nconst setCategorySelectorActive = (root, element) => {\n const allCategorySelectors = root.querySelectorAll(SELECTORS.CATEGORY_SELECTOR);\n\n for (let i = 0; i < allCategorySelectors.length; i++) {\n const selector = allCategorySelectors[i];\n selector.classList.remove('selected');\n }\n\n element.classList.add('selected');\n};\n\n/**\n * Get the category selector element and the scroll positions for the previous and\n * next categories for the given scroll position.\n *\n * @method\n * @param {Element} root The picker root element\n * @param {Number} position The position to get the category for\n * @param {Object} categoryScrollPositions Set of scroll positions for all categories\n * @return {Array}\n */\nconst getCategoryByScrollPosition = (root, position, categoryScrollPositions) => {\n let positions = [];\n\n if (position < 0) {\n position = 0;\n }\n\n // Get all of the category positions.\n for (const categoryName in categoryScrollPositions) {\n const categoryPosition = categoryScrollPositions[categoryName];\n positions.push([categoryPosition, categoryName]);\n }\n\n // Sort the positions in ascending order.\n positions.sort(([a], [b]) => {\n if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n } else {\n return 0;\n }\n });\n\n // Get the current category name as well as the previous and next category\n // positions from the sorted list of positions.\n const {categoryName, previousPosition, nextPosition} = positions.reduce(\n (carry, candidate) => {\n const [categoryPosition, categoryName] = candidate;\n\n if (categoryPosition <= position) {\n carry.categoryName = categoryName;\n carry.previousPosition = carry.currentPosition;\n carry.currentPosition = position;\n } else if (carry.nextPosition === null) {\n carry.nextPosition = categoryPosition;\n }\n\n return carry;\n },\n {\n categoryName: null,\n currentPosition: null,\n previousPosition: null,\n nextPosition: null\n }\n );\n\n return [getCategorySelectorByCategoryName(root, categoryName), previousPosition, nextPosition];\n};\n\n/**\n * Get the list of recent emojis data from local storage.\n *\n * @method\n * @return {Array}\n */\nconst getRecentEmojis = () => {\n const storedData = LocalStorage.get(RECENT_EMOJIS_STORAGE_KEY);\n return storedData ? JSON.parse(storedData) : [];\n};\n\n/**\n * Save the list of recent emojis in local storage.\n *\n * @method\n * @param {Array} recentEmojis List of emoji data to save\n */\nconst saveRecentEmoji = (recentEmojis) => {\n LocalStorage.set(RECENT_EMOJIS_STORAGE_KEY, JSON.stringify(recentEmojis));\n};\n\n/**\n * Add an emoji data to the set of recent emojis. This function will update the row\n * data to ensure that the recent emoji rows are correct and all of the rows are\n * re-indexed.\n *\n * The new set of recent emojis are saved in local storage and the full set of updated\n * row data and new emoji row count are returned.\n *\n * @method\n * @param {Array} rowData The emoji rows data\n * @param {Number} recentEmojiRowCount Count of the recent emoji rows\n * @param {Object} newEmoji The emoji data for the emoji to add to the recent emoji list\n * @return {Array}\n */\nconst addRecentEmoji = (rowData, recentEmojiRowCount, newEmoji) => {\n // The first set of rows is always the recent emojis.\n const categoryName = rowData[0].data.name;\n const categoryDisplayName = rowData[0].data.displayName;\n const recentEmojis = getRecentEmojis();\n // Add the new emoji to the start of the list of recent emojis.\n let newRecentEmojis = [newEmoji, ...recentEmojis.filter(emoji => emoji.unified != newEmoji.unified)];\n // Limit the number of recent emojis.\n newRecentEmojis = newRecentEmojis.slice(0, MAX_RECENT_COUNT);\n const newRecentEmojiRowData = createRowDataForCategory(categoryName, categoryDisplayName, newRecentEmojis);\n\n // Save the new list in local storage.\n saveRecentEmoji(newRecentEmojis);\n\n return [\n // Return the new rowData and re-index it to make sure it's all correct.\n addIndexesToRowData(newRecentEmojiRowData.concat(rowData.slice(recentEmojiRowCount))),\n newRecentEmojiRowData.length\n ];\n};\n\n/**\n * Calculate which rows should be visible based on the given scroll position. Adds a\n * buffer to amount to either side of the total number of requested rows so that\n * scrolling the emoji rows container is smooth.\n *\n * @method\n * @param {Number} scrollPosition Scroll position within the emoji container\n * @param {Number} visibleRowCount How many rows should be visible\n * @param {Array} rowData The emoji rows data\n * @return {Array}\n */\nconst getRowsToRender = (scrollPosition, visibleRowCount, rowData) => {\n const minVisibleRow = scrollPosition > ROW_HEIGHT_RAW ? Math.floor(scrollPosition / ROW_HEIGHT_RAW) : 0;\n const start = minVisibleRow >= ROW_RENDER_BUFFER_COUNT ? minVisibleRow - ROW_RENDER_BUFFER_COUNT : minVisibleRow;\n const end = minVisibleRow + visibleRowCount + ROW_RENDER_BUFFER_COUNT;\n const rows = rowData.slice(start, end);\n return rows;\n};\n\n/**\n * Create a row element from the row data.\n *\n * @method\n * @param {Object} rowData The emoji row data\n * @return {Element}\n */\nconst createRowElement = async(rowData) => {\n let row = null;\n if (rowData.type === ROW_TYPE.HEADER) {\n row = await createHeaderRow(rowData.index, rowData.data.displayName);\n } else {\n row = await createEmojiRow(rowData.index, rowData.data);\n }\n\n row.style.position = 'absolute';\n row.style.left = 0;\n row.style.right = 0;\n row.style.top = `${rowData.index * ROW_HEIGHT_RAW}px`;\n\n return row;\n};\n\n/**\n * Check if the given rows match.\n *\n * @method\n * @param {Object} a The first row\n * @param {Object} b The second row\n * @return {Bool}\n */\nconst doRowsMatch = (a, b) => {\n if (a.index !== b.index) {\n return false;\n }\n\n if (a.type !== b.type) {\n return false;\n }\n\n if (typeof a.data != typeof b.data) {\n return false;\n }\n\n if (a.type === ROW_TYPE.HEADER) {\n return a.data.name === b.data.name;\n } else {\n if (a.data.length !== b.data.length) {\n return false;\n }\n\n for (let i = 0; i < a.data.length; i++) {\n if (a.data[i].unified != b.data[i].unified) {\n return false;\n }\n }\n }\n\n return true;\n};\n\n/**\n * Update the visible rows. Deletes any row elements that should no longer\n * be visible and creates the newly visible row elements. Any rows that haven't\n * changed visibility will be left untouched.\n *\n * @method\n * @param {Element} rowContainer The container element for the emoji rows\n * @param {Array} currentRows List of row data that matches the currently visible rows\n * @param {Array} nextRows List of row data containing the new list of rows to be made visible\n */\nconst renderRows = async(rowContainer, currentRows, nextRows) => {\n // We need to add any rows that are in nextRows but not in currentRows.\n const toAdd = nextRows.filter(nextRow => !currentRows.some(currentRow => doRowsMatch(currentRow, nextRow)));\n // Remember which rows will still be visible so that we can insert our element in the correct place in the DOM.\n let toKeep = currentRows.filter(currentRow => nextRows.some(nextRow => doRowsMatch(currentRow, nextRow)));\n // We need to remove any rows that are in currentRows but not in nextRows.\n const toRemove = currentRows.filter(currentRow => !nextRows.some(nextRow => doRowsMatch(currentRow, nextRow)));\n const toRemoveElements = toRemove.map(rowData => rowContainer.querySelectorAll(`[data-row=\"${rowData.index}\"]`));\n\n // Render all of the templates first.\n const rows = await Promise.all(toAdd.map(rowData => createRowElement(rowData)));\n\n rows.forEach((row, index) => {\n const rowData = toAdd[index];\n let nextRowIndex = null;\n\n for (let i = 0; i < toKeep.length; i++) {\n const candidate = toKeep[i];\n if (candidate.index > rowData.index) {\n nextRowIndex = i;\n break;\n }\n }\n\n // Make sure the elements get added to the DOM in the correct order (ascending by row data index)\n // so that they appear naturally in the tab order.\n if (nextRowIndex !== null) {\n const nextRowData = toKeep[nextRowIndex];\n const nextRowNode = rowContainer.querySelector(`[data-row=\"${nextRowData.index}\"]`);\n\n rowContainer.insertBefore(row, nextRowNode);\n toKeep.splice(nextRowIndex, 0, toKeep);\n } else {\n toKeep.push(rowData);\n rowContainer.appendChild(row);\n }\n });\n\n toRemoveElements.forEach(rows => {\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n rowContainer.removeChild(row);\n }\n });\n};\n\n/**\n * Build a function to render the visible emoji rows for a given scroll\n * position.\n *\n * @method\n * @param {Element} rowContainer The container element for the emoji rows\n * @return {Function}\n */\nconst generateRenderRowsAtPositionFunction = (rowContainer) => {\n let currentRows = [];\n let nextRows = [];\n let rowCount = 0;\n let isRendering = false;\n const renderNextRows = async() => {\n if (!nextRows.length) {\n return;\n }\n\n if (isRendering) {\n return;\n }\n\n isRendering = true;\n const nextRowsToRender = nextRows.slice();\n nextRows = [];\n\n await renderRows(rowContainer, currentRows, nextRowsToRender);\n currentRows = nextRowsToRender;\n isRendering = false;\n renderNextRows();\n };\n\n return (scrollPosition, rowData, rowLimit = VISIBLE_ROW_COUNT) => {\n nextRows = getRowsToRender(scrollPosition, rowLimit, rowData);\n renderNextRows();\n\n if (rowCount !== rowData.length) {\n // Adjust the height of the container to match the number of rows.\n rowContainer.style.height = `${rowData.length * ROW_HEIGHT_RAW}px`;\n }\n\n rowCount = rowData.length;\n };\n};\n\n/**\n * Show the search results container and hide the emoji container.\n *\n * @method\n * @param {Element} emojiContainer The emojis container\n * @param {Element} searchResultsContainer The search results container\n */\nconst showSearchResults = (emojiContainer, searchResultsContainer) => {\n searchResultsContainer.classList.remove('hidden');\n emojiContainer.classList.add('hidden');\n};\n\n/**\n * Hide the search result container and show the emojis container.\n *\n * @method\n * @param {Element} emojiContainer The emojis container\n * @param {Element} searchResultsContainer The search results container\n * @param {Element} searchInput The search input\n */\nconst clearSearch = (emojiContainer, searchResultsContainer, searchInput) => {\n searchResultsContainer.classList.add('hidden');\n emojiContainer.classList.remove('hidden');\n searchInput.value = '';\n};\n\n/**\n * Build function to handle mouse hovering an emoji. Shows the preview.\n *\n * @method\n * @param {Element} emojiPreview The emoji preview element\n * @param {Element} emojiShortName The emoji short name element\n * @return {Function}\n */\nconst getHandleMouseEnter = (emojiPreview, emojiShortName) => {\n return (e) => {\n const target = e.target;\n if (isEmojiElement(target)) {\n emojiShortName.textContent = target.getAttribute('data-short-names');\n emojiPreview.textContent = target.textContent;\n }\n };\n};\n\n/**\n * Build function to handle mouse leaving an emoji. Removes the preview.\n *\n * @method\n * @param {Element} emojiPreview The emoji preview element\n * @param {Element} emojiShortName The emoji short name element\n * @return {Function}\n */\nconst getHandleMouseLeave = (emojiPreview, emojiShortName) => {\n return (e) => {\n const target = e.target;\n if (isEmojiElement(target)) {\n emojiShortName.textContent = '';\n emojiPreview.textContent = '';\n }\n };\n};\n\n/**\n * Build the function to handle a user clicking something in the picker.\n *\n * The function currently handles clicking on the category selector or selecting\n * a specific emoji.\n *\n * @method\n * @param {Number} recentEmojiRowCount Number of rows of recent emojis\n * @param {Element} emojiContainer Container element for the visible of emojis\n * @param {Element} searchResultsContainer Contaienr element for the search results\n * @param {Element} searchInput Search input element\n * @param {Function} selectCallback Callback function to execute when a user selects an emoji\n * @param {Function} renderAtPosition Render function to display current visible emojis\n * @return {Function}\n */\nconst getHandleClick = (\n recentEmojiRowCount,\n emojiContainer,\n searchResultsContainer,\n searchInput,\n selectCallback,\n renderAtPosition\n) => {\n return (e, rowData, categoryScrollPositions) => {\n const target = e.target;\n let newRowData = rowData;\n let newCategoryScrollPositions = categoryScrollPositions;\n\n // Hide the search results if they are visible.\n clearSearch(emojiContainer, searchResultsContainer, searchInput);\n\n if (isEmojiElement(target)) {\n // Emoji selected.\n const unified = target.getAttribute('data-unified');\n const shortnames = target.getAttribute('data-short-names').replace(/:/g, '').split(' ');\n // Build the emoji data from the selected element.\n const emojiData = {unified, shortnames};\n const currentScrollTop = emojiContainer.scrollTop;\n const isRecentEmojiRowVisible = emojiContainer.querySelector(`[data-row=\"${recentEmojiRowCount - 1}\"]`) !== null;\n // Save the selected emoji in the recent emojis list.\n [newRowData, recentEmojiRowCount] = addRecentEmoji(rowData, recentEmojiRowCount, emojiData);\n // Re-index the category scroll positions because the additional recent emoji may have\n // changed their positions.\n newCategoryScrollPositions = getCategoryScrollPositionsFromRowData(newRowData);\n\n if (isRecentEmojiRowVisible) {\n // If the list of recent emojis is currently visible then we need to re-render the emojis\n // to update the display and show the newly selected recent emoji.\n renderAtPosition(currentScrollTop, newRowData);\n }\n\n // Call the client's callback function with the selected emoji.\n selectCallback(target.textContent);\n // Return the newly calculated row data and scroll positions.\n return [newRowData, newCategoryScrollPositions];\n }\n\n const categorySelector = findCategorySelectorFromElement(target);\n if (categorySelector) {\n // Category selector.\n const selectedCategory = categorySelector.getAttribute('data-category');\n const position = categoryScrollPositions[selectedCategory];\n // Scroll the container to the selected category. This will trigger the\n // on scroll handler to re-render the visibile emojis.\n emojiContainer.scrollTop = position;\n }\n\n return [newRowData, newCategoryScrollPositions];\n };\n};\n\n/**\n * Build the function that handles scrolling of the emoji container to display the\n * correct emojis.\n *\n * We render the emoji rows as they are needed rather than all up front so that we\n * can avoid adding tends of thousands of elements to the DOM unnecessarily which\n * would bog down performance.\n *\n * @method\n * @param {Element} root The picker root element\n * @param {Number} currentVisibleRowScrollPosition The current scroll position of the container\n * @param {Element} emojiContainer The emojis container element\n * @param {Object} initialCategoryScrollPositions Scroll positions for each category\n * @param {Function} renderAtPosition Function to render the appropriate emojis for a scroll position\n * @return {Function}\n */\nconst getHandleScroll = (\n root,\n currentVisibleRowScrollPosition,\n emojiContainer,\n initialCategoryScrollPositions,\n renderAtPosition\n) => {\n // Scope some local variables to track the scroll positions of the categories. We need to\n // recalculate these because adding recent emojis can change those positions by adding\n // additional rows.\n let [\n currentCategoryElement,\n previousCategoryPosition,\n nextCategoryPosition\n ] = getCategoryByScrollPosition(root, emojiContainer.scrollTop, initialCategoryScrollPositions);\n\n return (categoryScrollPositions, rowData) => {\n const newScrollPosition = emojiContainer.scrollTop;\n const upperScrollBound = currentVisibleRowScrollPosition + ROW_HEIGHT_RAW;\n const lowerScrollBound = currentVisibleRowScrollPosition - ROW_HEIGHT_RAW;\n // We only need to update the active category indicator if the user has scrolled into a\n // new category scroll position.\n const updateActiveCategory = (newScrollPosition >= nextCategoryPosition) ||\n (newScrollPosition < previousCategoryPosition);\n // We only need to render new emoji rows if the user has scrolled far enough that a new row\n // would be visible (i.e. they've scrolled up or down more than 40px - the height of a row).\n const updateRenderRows = (newScrollPosition < lowerScrollBound) || (newScrollPosition > upperScrollBound);\n\n if (updateActiveCategory) {\n // New category is visible so update the active category selector and re-index the\n // positions incase anything has changed.\n [\n currentCategoryElement,\n previousCategoryPosition,\n nextCategoryPosition\n ] = getCategoryByScrollPosition(root, newScrollPosition, categoryScrollPositions);\n setCategorySelectorActive(root, currentCategoryElement);\n }\n\n if (updateRenderRows) {\n // A new row should be visible so re-render the visible emojis at this new position.\n // We request an animation frame from the browser so that we're not blocking anything.\n // The animation only needs to occur as soon as the browser is ready not immediately.\n requestAnimationFrame(() => {\n renderAtPosition(newScrollPosition, rowData);\n // Remember the updated position.\n currentVisibleRowScrollPosition = newScrollPosition;\n });\n }\n };\n};\n\n/**\n * Build the function that handles search input from the user.\n *\n * @method\n * @param {Element} searchInput The search input element\n * @param {Element} searchResultsContainer Container element to display the search results\n * @param {Element} emojiContainer Container element for the emoji rows\n * @return {Function}\n */\nconst getHandleSearch = (searchInput, searchResultsContainer, emojiContainer) => {\n const rowContainer = searchResultsContainer.querySelector(SELECTORS.ROW_CONTAINER);\n // Build a render function for the search results.\n const renderSearchResultsAtPosition = generateRenderRowsAtPositionFunction(rowContainer);\n searchResultsContainer.appendChild(rowContainer);\n\n return async() => {\n const searchTerm = searchInput.value.toLowerCase();\n\n if (searchTerm) {\n // Display the search results container and hide the emojis container.\n showSearchResults(emojiContainer, searchResultsContainer);\n\n // Find which emojis match the user's search input.\n const matchingEmojis = Object.keys(EmojiData.byShortName).reduce((carry, shortName) => {\n if (shortName.includes(searchTerm)) {\n carry.push({\n shortnames: [shortName],\n unified: EmojiData.byShortName[shortName]\n });\n }\n return carry;\n }, []);\n\n const searchResultsString = await getString('searchresults', 'core');\n const rowData = createRowDataForCategory(searchResultsString, searchResultsString, matchingEmojis, 0);\n // Show the emoji rows for the search results.\n renderSearchResultsAtPosition(0, rowData, rowData.length);\n } else {\n // Hide the search container and show the emojis container.\n clearSearch(emojiContainer, searchResultsContainer, searchInput);\n }\n };\n};\n\n/**\n * Register the emoji picker event listeners.\n *\n * @method\n * @param {Element} root The picker root element\n * @param {Element} emojiContainer Root element containing the list of visible emojis\n * @param {Function} renderAtPosition Function to render the visible emojis at a given scroll position\n * @param {Number} currentVisibleRowScrollPosition What is the current scroll position\n * @param {Function} selectCallback Function to execute when the user picks an emoji\n * @param {Object} categoryScrollPositions Scroll positions for where each of the emoji categories begin\n * @param {Array} rowData Data representing each of the display rows for hte emoji container\n * @param {Number} recentEmojiRowCount Number of rows of recent emojis\n */\nconst registerEventListeners = (\n root,\n emojiContainer,\n renderAtPosition,\n currentVisibleRowScrollPosition,\n selectCallback,\n categoryScrollPositions,\n rowData,\n recentEmojiRowCount\n) => {\n const searchInput = root.querySelector(SELECTORS.SEARCH_INPUT);\n const searchResultsContainer = root.querySelector(SELECTORS.SEARCH_RESULTS_CONTAINER);\n const emojiPreview = root.querySelector(SELECTORS.EMOJI_PREVIEW);\n const emojiShortName = root.querySelector(SELECTORS.EMOJI_SHORT_NAME);\n // Build the click handler function.\n const clickHandler = getHandleClick(\n recentEmojiRowCount,\n emojiContainer,\n searchResultsContainer,\n searchInput,\n selectCallback,\n renderAtPosition\n );\n // Build the scroll handler function.\n const scrollHandler = getHandleScroll(\n root,\n currentVisibleRowScrollPosition,\n emojiContainer,\n categoryScrollPositions,\n renderAtPosition\n );\n const searchHandler = getHandleSearch(searchInput, searchResultsContainer, emojiContainer);\n\n // Mouse enter/leave events to show the emoji preview on hover or focus.\n root.addEventListener('focus', getHandleMouseEnter(emojiPreview, emojiShortName), true);\n root.addEventListener('blur', getHandleMouseLeave(emojiPreview, emojiShortName), true);\n root.addEventListener('mouseenter', getHandleMouseEnter(emojiPreview, emojiShortName), true);\n root.addEventListener('mouseleave', getHandleMouseLeave(emojiPreview, emojiShortName), true);\n // User selects an emoji or clicks on one of the emoji category selectors.\n root.addEventListener('click', e => {\n // Update the row data and category scroll positions because they may have changes if the\n // user selects an emoji which updates the recent emojis list.\n [rowData, categoryScrollPositions] = clickHandler(e, rowData, categoryScrollPositions);\n });\n // Throttle the scroll event to only execute once every 50 milliseconds to prevent performance issues\n // in the browser when re-rendering the picker emojis. The scroll event fires a lot otherwise.\n emojiContainer.addEventListener('scroll', throttle(() => scrollHandler(categoryScrollPositions, rowData), 50));\n // Debounce the search input so that it only executes 200 milliseconds after the user has finished typing.\n searchInput.addEventListener('input', debounce(searchHandler, 200));\n};\n\n/**\n * Initialise the emoji picker.\n *\n * @method\n * @param {Element} root The root element for the picker\n * @param {Function} selectCallback Callback for when the user selects an emoji\n */\nexport default (root, selectCallback) => {\n const emojiContainer = root.querySelector(SELECTORS.EMOJIS_CONTAINER);\n const rowContainer = emojiContainer.querySelector(SELECTORS.ROW_CONTAINER);\n const recentEmojis = getRecentEmojis();\n // Add the recent emojis category to the list of standard categories.\n const allData = [{\n name: 'Recent',\n emojis: recentEmojis\n }, ...EmojiData.byCategory];\n let rowData = [];\n let recentEmojiRowCount = 0;\n\n /**\n * Split categories data into rows which represent how they will be displayed in the\n * picker. Each category will add a row containing the display name for the category\n * and a row for every 9 emojis in the category. The row data will be used to calculate\n * which emojis should be visible in the picker at any given time.\n *\n * E.g.\n * input = [\n * {name: 'example1', emojis: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]},\n * {name: 'example2', emojis: [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]},\n * ]\n * output = [\n * {type: 'categoryName': data: 'Example 1'},\n * {type: 'emojiRow': data: [1, 2, 3, 4, 5, 6, 7, 8, 9]},\n * {type: 'emojiRow': data: [10, 11, 12]},\n * {type: 'categoryName': data: 'Example 2'},\n * {type: 'emojiRow': data: [13, 14, 15, 16, 17, 18, 19, 20, 21]},\n * {type: 'emojiRow': data: [22, 23]},\n * ]\n */\n allData.forEach(category => {\n const categorySelector = getCategorySelectorByCategoryName(root, category.name);\n // Get the display name from the category selector button so that we don't need to\n // send an ajax request for the string.\n const categoryDisplayName = categorySelector.title;\n const categoryRowData = createRowDataForCategory(category.name, categoryDisplayName, category.emojis, rowData.length);\n\n if (category.name === 'Recent') {\n // Remember how many recent emoji rows there are because it needs to be used to\n // re-index the row data later when we're adding more recent emojis.\n recentEmojiRowCount = categoryRowData.length;\n }\n\n rowData = rowData.concat(categoryRowData);\n });\n\n // Index the row data so that we can calculate which rows should be visible.\n rowData = addIndexesToRowData(rowData);\n // Calculate the scroll positions for each of the categories within the emoji container.\n // These are used to know where to jump to when the user selects a specific category.\n const categoryScrollPositions = getCategoryScrollPositionsFromRowData(rowData);\n const renderAtPosition = generateRenderRowsAtPositionFunction(rowContainer);\n // Display the initial set of emojis.\n renderAtPosition(0, rowData);\n\n registerEventListeners(\n root,\n emojiContainer,\n renderAtPosition,\n 0,\n selectCallback,\n categoryScrollPositions,\n rowData,\n recentEmojiRowCount\n );\n};\n"],"file":"picker.min.js"} \ No newline at end of file diff --git a/lib/amd/build/event_dispatcher.min.js.map b/lib/amd/build/event_dispatcher.min.js.map index 72137d748a30e..0a84c94a7315a 100644 --- a/lib/amd/build/event_dispatcher.min.js.map +++ b/lib/amd/build/event_dispatcher.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/event_dispatcher.js"],"names":["dispatchEvent","eventName","detail","container","document","bubbles","cancelable","composed","customEvent","CustomEvent"],"mappings":"6JAyD6B,QAAhBA,CAAAA,aAAgB,CACzBC,CADyB,CASxB,IAPDC,CAAAA,CAOC,wDAPQ,EAOR,CANDC,CAMC,wDANWC,QAMX,0DADG,EACH,KAJGC,OAIH,CAJGA,CAIH,qBAHGC,UAGH,CAHGA,CAGH,qBAFGC,QAEH,CAFGA,CAEH,iBACKC,CAAW,CAAG,GAAIC,CAAAA,WAAJ,CAChBR,CADgB,CAEhB,CACII,OAAO,CAAPA,CADJ,CAEIC,UAAU,CAAVA,CAFJ,CAGIC,QAAQ,CAARA,CAHJ,CAIIL,MAAM,CAANA,CAJJ,CAFgB,CADnB,CAWDC,CAAS,CAACH,aAAV,CAAwBQ,CAAxB,EAEA,MAAOA,CAAAA,CACV,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/ //\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Event dispatcher used to dispatch Native JS CustomEvent objects.\n *\n * @module core/event_dispatcher\n * @copyright 2021 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 4.0\n */\n\n/**\n * Dispatch an event as a CustomEvent on the specified container.\n * By default events are bubbled, and cancelable.\n *\n * The eventName should typically by sourced using a constant, for example:\n *\n * // mod/example/amd/src/events.js\n *\n * import {dispatchEvent} from 'core/event_dispatcher';\n *\n * export const eventTypes = {\n * exampleDataDisplayed: 'mod_example/exampleDataDisplayed',\n * };\n *\n * export const notifyExampleDisplayed = someArgument => dispatchEvent(eventTypes.exampleDataDisplayed, {\n * someArgument,\n * }, document, {\n * cancelable: false,\n * });\n *\n * Note: This function uses native events. Any additional details are passed to the function in event.detail.\n *\n * This function mimics the behaviour of EventTarget.dispatchEvent but bubbles by default.\n *\n * @method dispatchEvent\n * @param {String} eventName The name of the event\n * @param {Object} detail Any additional details to pass into the eveent\n * @param {HTMLElement} container The point at which to dispatch the event\n * @param {Object} options\n * @param {Boolean} options.bubbles Whether to bubble up the DOM\n * @param {Boolean} options.cancelable Whether preventDefault() can be called\n * @param {Boolean} options.composed Whether the event can bubble across the ShadowDOM bounadry\n * @returns {CustomEvent}\n */\nexport const dispatchEvent = (\n eventName,\n detail = {},\n container = document,\n {\n bubbles = true,\n cancelable = false,\n composed = false,\n } = {}\n) => {\n const customEvent = new CustomEvent(\n eventName,\n {\n bubbles,\n cancelable,\n composed,\n detail,\n }\n );\n\n container.dispatchEvent(customEvent);\n\n return customEvent;\n};\n"],"file":"event_dispatcher.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/event_dispatcher.js"],"names":["dispatchEvent","eventName","detail","container","document","bubbles","cancelable","composed","customEvent","CustomEvent"],"mappings":"6JA0D6B,QAAhBA,CAAAA,aAAgB,CACzBC,CADyB,CASxB,IAPDC,CAAAA,CAOC,wDAPQ,EAOR,CANDC,CAMC,wDANWC,QAMX,0DADG,EACH,KAJGC,OAIH,CAJGA,CAIH,qBAHGC,UAGH,CAHGA,CAGH,qBAFGC,QAEH,CAFGA,CAEH,iBACKC,CAAW,CAAG,GAAIC,CAAAA,WAAJ,CAChBR,CADgB,CAEhB,CACII,OAAO,CAAPA,CADJ,CAEIC,UAAU,CAAVA,CAFJ,CAGIC,QAAQ,CAARA,CAHJ,CAIIL,MAAM,CAANA,CAJJ,CAFgB,CADnB,CAWDC,CAAS,CAACH,aAAV,CAAwBQ,CAAxB,EAEA,MAAOA,CAAAA,CACV,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/ //\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * An Event dispatcher used to dispatch Native JS CustomEvent objects with custom default properties.\n *\n * @module core/event_dispatcher\n * @copyright 2021 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 4.0\n */\n\n/**\n * Dispatch an event as a CustomEvent on the specified container.\n * By default events are bubbled, and cancelable.\n *\n * The eventName should typically by sourced using a constant. See the supplied examples.\n *\n * Note: This function uses native events. Any additional details are passed to the function in event.detail.\n *\n * This function mimics the behaviour of EventTarget.dispatchEvent but bubbles by default.\n *\n * @method dispatchEvent\n * @param {String} eventName The name of the event\n * @param {Object} detail Any additional details to pass into the eveent\n * @param {HTMLElement} container The point at which to dispatch the event\n * @param {Object} options\n * @param {Boolean} options.bubbles Whether to bubble up the DOM\n * @param {Boolean} options.cancelable Whether preventDefault() can be called\n * @param {Boolean} options.composed Whether the event can bubble across the ShadowDOM bounadry\n * @returns {CustomEvent}\n *\n * @example
Using a native CustomEvent to indicate that some example data was displayed.Pre-fetching a set of strings to use laterFetching a stringFetching a set of stringsAn example of fetching a string using the cachekey parameterA simple example that you might find in a repository functionUsing a native CustomEvent to indicate that some example data was displayed.Pre-fetching a set of strings to use laterFetching a stringFetching a set of stringsExample of listening to a form event.Example of listening to a form event.