From 85ee0956d9377227762b0b6ee39448b9978e406f Mon Sep 17 00:00:00 2001 From: Matheus Garcia Date: Fri, 11 May 2018 10:28:55 -0300 Subject: [PATCH] =?UTF-8?q?Vers=C3=A3o=20inicial=20do=20tema=20para=20Sabe?= =?UTF-8?q?res=203.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- amd/build/alert.min.js | 1 + amd/build/button.min.js | 1 + amd/build/carousel.min.js | 1 + amd/build/collapse.min.js | 1 + amd/build/drawer.min.js | 1 + amd/build/dropdown.min.js | 1 + amd/build/form-display-errors.min.js | 1 + amd/build/loader.min.js | 1 + amd/build/modal.min.js | 1 + amd/build/popover.min.js | 1 + amd/build/scrollspy.min.js | 1 + amd/build/tab.min.js | 1 + amd/build/tether.min.js | 1 + amd/build/tooltip.min.js | 1 + amd/build/util.min.js | 1 + amd/src/alert.js | 218 ++ amd/src/button.js | 195 ++ amd/src/carousel.js | 514 ++++ amd/src/collapse.js | 396 +++ amd/src/drawer.js | 165 ++ amd/src/dropdown.js | 323 +++ amd/src/form-display-errors.js | 65 + amd/src/loader.js | 62 + amd/src/modal.js | 559 +++++ amd/src/popover.js | 250 ++ amd/src/scrollspy.js | 353 +++ amd/src/tab.js | 289 +++ amd/src/tether.js | 1792 ++++++++++++++ amd/src/tooltip.js | 646 +++++ amd/src/util.js | 163 ++ classes/admin_settingspage_tabs.php | 100 + classes/autoprefixer.php | 250 ++ classes/output/block_settings_renderer.php | 50 + classes/output/core/admin_renderer.php | 52 + classes/output/core/course_renderer.php | 81 + classes/output/core/files_renderer.php | 140 ++ classes/output/core_renderer.php | 773 ++++++ classes/output/core_renderer_maintenance.php | 197 ++ .../output/gradereport_history_renderer.php | 44 + cli/import-bootswatch.php | 265 ++ cli/readme_moodle.txt | 5 + config.php | 261 +- lang/en/theme_ilb.php | 43 + lang/en/theme_ilb2014.php | 28 - layout/columns1.php | 39 + layout/columns2.php | 57 + layout/course.php | 165 -- layout/embedded.php | 32 + layout/frontpage.php | 152 -- layout/frontpage_ilb.php | 106 + layout/general.php | 162 -- layout/incourse.php | 167 -- layout/login.php | 39 + layout/login_nova_conta.php | 36 + layout/maintenance.php | 34 + layout/report.php | 118 - layout/secure.php | 40 + layout/topo.php | 59 - lib.php | 108 + pix/bg-menutopo.png | Bin 130 -> 0 bytes pix/btn0800.gif | Bin 955 -> 0 bytes pix/favicon.ico | Bin 3262 -> 1150 bytes pix/fp/add_file.png | Bin 0 -> 182 bytes pix/fp/add_file.svg | 3 + pix/fp/alias.png | Bin 0 -> 372 bytes pix/fp/alias_sm.png | Bin 0 -> 293 bytes pix/fp/check.png | Bin 0 -> 424 bytes pix/fp/create_folder.png | Bin 0 -> 150 bytes pix/fp/create_folder.svg | 3 + pix/fp/cross.png | Bin 0 -> 410 bytes pix/fp/dnd_arrow.gif | Bin 0 -> 83796 bytes pix/fp/download_all.png | Bin 0 -> 207 bytes pix/fp/download_all.svg | 3 + pix/fp/help.png | Bin 0 -> 263 bytes pix/fp/help.svg | 3 + pix/fp/link.png | Bin 0 -> 536 bytes pix/fp/link_sm.png | Bin 0 -> 397 bytes pix/fp/logout.png | Bin 0 -> 180 bytes pix/fp/logout.svg | 3 + pix/fp/path_folder.png | Bin 0 -> 509 bytes pix/fp/path_folder_rtl.png | Bin 0 -> 512 bytes pix/fp/refresh.png | Bin 0 -> 257 bytes pix/fp/refresh.svg | 3 + pix/fp/search.png | Bin 0 -> 250 bytes pix/fp/search.svg | 3 + pix/fp/setting.png | Bin 0 -> 207 bytes pix/fp/setting.svg | 3 + pix/fp/view_icon_active.png | Bin 0 -> 111 bytes pix/fp/view_icon_active.svg | 3 + pix/fp/view_list_active.png | Bin 0 -> 95 bytes pix/fp/view_list_active.svg | 3 + pix/fp/view_tree_active.png | Bin 0 -> 114 bytes pix/fp/view_tree_active.svg | 3 + pix/header.jpg | Bin 499 -> 0 bytes pix/icoSelPortais.png | Bin 6158 -> 0 bytes pix/logo-ilb.png | Bin 14740 -> 0 bytes pix/logo-interlegis.png | Bin 6879 -> 0 bytes pix/logo-moodle.png | Bin 7055 -> 0 bytes pix/logo-saberes.png | Bin 23617 -> 0 bytes pix/logo-senado-pb.gif | Bin 1226 -> 0 bytes pix/mod/quiz/checkmark.png | Bin 0 -> 292 bytes pix/mod/quiz/checkmark.svg | 9 + pix/mod/quiz/flag-on.png | Bin 0 -> 219 bytes pix/mod/quiz/flag-on.svg | 37 + pix/mod/quiz/warningtriangle.png | Bin 0 -> 230 bytes pix/mod/quiz/warningtriangle.svg | 60 + pix/mod/quiz/whitecircle.png | Bin 0 -> 218 bytes pix/mod/quiz/whitecircle.svg | 9 + pix/screenshot.jpg | Bin 44805 -> 138198 bytes pix/separador-topo.gif | Bin 98 -> 0 bytes pix/topo_bg.gif | Bin 56 -> 0 bytes pix/yui2-treeview-sprite-rtl.gif | Bin 0 -> 4344 bytes readme_moodle.txt | 32 + renderers.php | 60 - scss/bootstrap/LICENSE | 22 + scss/bootstrap/_alert.scss | 56 + scss/bootstrap/_animation.scss | 27 + scss/bootstrap/_breadcrumb.scss | 38 + scss/bootstrap/_button-group.scss | 234 ++ scss/bootstrap/_buttons.scss | 176 ++ scss/bootstrap/_card.scss | 320 +++ scss/bootstrap/_carousel.scss | 253 ++ scss/bootstrap/_close.scss | 31 + scss/bootstrap/_code.scss | 57 + scss/bootstrap/_custom-forms.scss | 265 ++ scss/bootstrap/_custom.scss | 4 + scss/bootstrap/_dropdown.scss | 179 ++ scss/bootstrap/_forms.scss | 364 +++ scss/bootstrap/_grid.scss | 39 + scss/bootstrap/_images.scss | 52 + scss/bootstrap/_input-group.scss | 188 ++ scss/bootstrap/_jumbotron.scss | 20 + scss/bootstrap/_list-group.scss | 123 + scss/bootstrap/_media.scss | 81 + scss/bootstrap/_mixins.scss | 54 + scss/bootstrap/_modal.scss | 132 + scss/bootstrap/_nav.scss | 157 ++ scss/bootstrap/_navbar.scss | 256 ++ scss/bootstrap/_normalize.scss | 424 ++++ scss/bootstrap/_pagination.scss | 73 + scss/bootstrap/_popover.scss | 149 ++ scss/bootstrap/_print.scss | 116 + scss/bootstrap/_progress.scss | 145 ++ scss/bootstrap/_reboot.scss | 393 +++ scss/bootstrap/_responsive-embed.scss | 39 + scss/bootstrap/_tables.scss | 196 ++ scss/bootstrap/_tags.scss | 77 + scss/bootstrap/_tooltip.scss | 87 + scss/bootstrap/_type.scss | 150 ++ scss/bootstrap/_utilities.scss | 9 + scss/bootstrap/_variables.scss | 829 +++++++ scss/bootstrap/bootstrap-flex.scss | 8 + scss/bootstrap/bootstrap-grid.scss | 23 + scss/bootstrap/bootstrap-reboot.scss | 11 + scss/bootstrap/bootstrap.scss | 54 + scss/bootstrap/mixins/_alert.scss | 14 + .../bootstrap/mixins/_background-variant.scss | 13 + scss/bootstrap/mixins/_border-radius.scss | 35 + scss/bootstrap/mixins/_breakpoints.scss | 86 + scss/bootstrap/mixins/_buttons.scss | 113 + scss/bootstrap/mixins/_cards.scss | 44 + scss/bootstrap/mixins/_clearfix.scss | 7 + scss/bootstrap/mixins/_forms.scss | 86 + scss/bootstrap/mixins/_gradients.scss | 43 + scss/bootstrap/mixins/_grid-framework.scss | 70 + scss/bootstrap/mixins/_grid.scss | 84 + scss/bootstrap/mixins/_hover.scss | 60 + scss/bootstrap/mixins/_image.scss | 34 + scss/bootstrap/mixins/_list-group.scss | 30 + scss/bootstrap/mixins/_lists.scss | 7 + scss/bootstrap/mixins/_nav-divider.scss | 10 + scss/bootstrap/mixins/_navbar-align.scss | 9 + scss/bootstrap/mixins/_pagination.scss | 21 + scss/bootstrap/mixins/_progress.scss | 23 + scss/bootstrap/mixins/_pulls.scss | 6 + scss/bootstrap/mixins/_reset-filter.scss | 8 + scss/bootstrap/mixins/_reset-text.scss | 17 + scss/bootstrap/mixins/_resize.scss | 6 + scss/bootstrap/mixins/_screen-reader.scss | 32 + scss/bootstrap/mixins/_size.scss | 6 + scss/bootstrap/mixins/_tab-focus.scss | 9 + scss/bootstrap/mixins/_table-row.scss | 30 + scss/bootstrap/mixins/_tag.scss | 11 + scss/bootstrap/mixins/_text-emphasis.scss | 12 + scss/bootstrap/mixins/_text-hide.scss | 8 + scss/bootstrap/mixins/_text-truncate.scss | 8 + scss/bootstrap/utilities/_background.scss | 19 + scss/bootstrap/utilities/_clearfix.scss | 3 + scss/bootstrap/utilities/_display.scss | 13 + scss/bootstrap/utilities/_flex.scss | 37 + scss/bootstrap/utilities/_pulls.scss | 13 + scss/bootstrap/utilities/_screenreaders.scss | 11 + scss/bootstrap/utilities/_spacing.scss | 43 + scss/bootstrap/utilities/_text.scss | 51 + scss/bootstrap/utilities/_visibility.scss | 55 + scss/moodle.scss | 44 + scss/moodle/admin.scss | 803 ++++++ scss/moodle/backup-restore.scss | 217 ++ scss/moodle/blocks.scss | 72 + scss/moodle/bootstrap-rtl.scss | 14 + scss/moodle/bootswatch.scss | 6 + scss/moodle/bs2-compat.scss | 74 + scss/moodle/buttons.scss | 48 + scss/moodle/calendar.scss | 381 +++ scss/moodle/chat.scss | 86 + scss/moodle/core.scss | 2159 +++++++++++++++++ scss/moodle/course.scss | 1188 +++++++++ scss/moodle/debug.scss | 59 + scss/moodle/drawer.scss | 67 + scss/moodle/editor.scss | 5 + scss/moodle/expendable.scss | 44 + scss/moodle/filemanager.scss | 955 ++++++++ scss/moodle/forms.scss | 355 +++ scss/moodle/grade.scss | 410 ++++ scss/moodle/icons.scss | 68 + scss/moodle/login.scss | 9 + scss/moodle/message.scss | 1219 ++++++++++ scss/moodle/modules.scss | 630 +++++ scss/moodle/popover-region.scss | 493 ++++ scss/moodle/print.scss | 14 + scss/moodle/question.scss | 614 +++++ scss/moodle/reports.scss | 14 + scss/moodle/responsive-tabs.scss | 11 + scss/moodle/search.scss | 69 + scss/moodle/sticky-footer.scss | 26 + scss/moodle/tables.scss | 6 + scss/moodle/templates.scss | 12 + scss/moodle/tool_usertours.scss | 112 + scss/moodle/undo.scss | 140 ++ scss/moodle/user.scss | 306 +++ scss/preset.scss | 1 + scss/preset/default.scss | 189 ++ scss/preset/plain.scss | 12 + settings.php | 88 + style/core.css | 663 ----- style/editor.css | 3 - templates/admin_setting_tabs.mustache | 53 + .../block_search_forums/search_form.mustache | 17 + templates/block_settings/search_form.mustache | 7 + templates/blocks-drawer.mustache | 3 + templates/columns1.mustache | 73 + templates/columns2.mustache | 131 + templates/columns2Old.mustache | 60 + templates/core/action_menu.mustache | 47 + templates/core/action_menu_item.mustache | 31 + templates/core/action_menu_link.mustache | 34 + templates/core/action_menu_trigger.mustache | 31 + templates/core/block.mustache | 63 + templates/core/chooser.mustache | 80 + templates/core/custom_menu_item.mustache | 22 + templates/core/dataformat_selector.mustache | 55 + .../core/filemanager_confirmdialog.mustache | 5 + .../filemanager_default_searchform.mustache | 4 + .../core/filemanager_fileselect.mustache | 65 + templates/core/filemanager_loginform.mustache | 43 + .../filemanager_modal_generallayout.mustache | 61 + .../filemanager_page_generallayout.mustache | 58 + .../filemanager_processexistingfile.mustache | 8 + ...nager_processexistingfilemultiple.mustache | 9 + .../core/filemanager_selectlayout.mustache | 60 + .../core/filemanager_uploadform.mustache | 29 + .../core/form_autocomplete_input.mustache | 43 + .../core/form_autocomplete_selection.mustache | 50 + templates/core/help_icon.mustache | 25 + templates/core/login.mustache | 235 ++ templates/core/modal.mustache | 66 + templates/core/modal_backdrop.mustache | 36 + templates/core/navbar.mustache | 72 + templates/core/notification_error.mustache | 44 + templates/core/notification_info.mustache | 45 + templates/core/notification_success.mustache | 44 + templates/core/notification_warning.mustache | 44 + templates/core/paging_bar.mustache | 48 + templates/core/pix_icon.mustache | 42 + templates/core/preferences_groups.mustache | 18 + templates/core/progress_bar.mustache | 64 + templates/core/select_time.mustache | 38 + templates/core/settings_link_page.mustache | 153 ++ .../core/settings_link_page_single.mustache | 46 + templates/core/signup_form_layout.mustache | 33 + templates/core/single_button.mustache | 61 + templates/core/single_select.mustache | 130 + templates/core/skip_links.mustache | 16 + templates/core/tabtree.mustache | 44 + templates/core/url_select.mustache | 49 + templates/core_admin/setting.mustache | 43 + .../setting_configcolourpicker.mustache | 30 + .../setting_configduration.mustache | 31 + .../core_admin/setting_configfile.mustache | 33 + .../setting_configmultiselect.mustache | 28 + .../core_admin/setting_configselect.mustache | 27 + .../core_admin/setting_configtext.mustache | 22 + .../setting_configtextarea.mustache | 22 + .../core_admin/setting_configtime.mustache | 36 + .../setting_courselist_frontpage.mustache | 29 + .../setting_devicedetectregex.mustache | 39 + .../core_admin/setting_emoticons.mustache | 51 + .../setting_gradecat_combo.mustache | 31 + templates/core_admin/settings.mustache | 39 + .../settings_search_results.mustache | 49 + templates/core_form/editor_textarea.mustache | 47 + .../element-advcheckbox-inline.mustache | 39 + .../core_form/element-advcheckbox.mustache | 55 + .../element-autocomplete-inline.mustache | 40 + .../core_form/element-autocomplete.mustache | 40 + .../core_form/element-button-inline.mustache | 17 + templates/core_form/element-button.mustache | 16 + .../element-checkbox-inline.mustache | 39 + templates/core_form/element-checkbox.mustache | 55 + .../element-date_selector-inline.mustache | 10 + .../core_form/element-date_selector.mustache | 10 + ...element-date_time_selector-inline.mustache | 10 + .../element-date_time_selector.mustache | 10 + .../element-duration-inline.mustache | 1 + templates/core_form/element-duration.mustache | 1 + templates/core_form/element-editor.mustache | 5 + .../core_form/element-filemanager.mustache | 5 + .../core_form/element-filepicker.mustache | 5 + templates/core_form/element-grading.mustache | 5 + .../core_form/element-group-inline.mustache | 8 + templates/core_form/element-group.mustache | 8 + templates/core_form/element-modgrade.mustache | 1 + .../core_form/element-modvisible.mustache | 1 + templates/core_form/element-password.mustache | 15 + .../core_form/element-passwordunmask.mustache | 88 + .../element-questioncategory-inline.mustache | 1 + .../element-questioncategory.mustache | 1 + .../core_form/element-radio-inline.mustache | 40 + templates/core_form/element-radio.mustache | 56 + .../core_form/element-recaptcha.mustache | 5 + .../core_form/element-select-inline.mustache | 30 + templates/core_form/element-select.mustache | 122 + .../element-selectgroups-inline.mustache | 32 + .../core_form/element-selectgroups.mustache | 32 + .../core_form/element-selectwithlink.mustache | 23 + .../element-selectyesno-inline.mustache | 1 + .../core_form/element-selectyesno.mustache | 1 + templates/core_form/element-static.mustache | 44 + .../core_form/element-submit-inline.mustache | 15 + templates/core_form/element-submit.mustache | 18 + .../core_form/element-tags-inline.mustache | 38 + templates/core_form/element-tags.mustache | 38 + .../element-template-inline.mustache | 20 + templates/core_form/element-template.mustache | 75 + .../core_form/element-text-inline.mustache | 17 + templates/core_form/element-text.mustache | 17 + templates/core_form/element-textarea.mustache | 17 + templates/core_form/element-url.mustache | 20 + templates/core_form/element-warning.mustache | 5 + .../core_form/element-wikieditor.mustache | 5 + templates/core_grades/edit_tree.mustache | 45 + templates/core_grades/weight_field.mustache | 23 + .../weight_override_field.mustache | 31 + templates/course_search_form.mustache | 29 + templates/custom_menu_footer.mustache | 15 + templates/embedded.mustache | 57 + templates/flat_navigation.mustache | 92 + templates/footer.mustache | 68 + templates/footerSimples.mustache | 5 + templates/frontpage_ilb.mustache | 944 +++++++ templates/frontpage_ilb.mustache.save | 226 ++ templates/frontpage_ilblogado.mustache | 241 ++ .../gradereport_history/user_button.mustache | 21 + .../bulk_insert.mustache | 34 + .../gradereport_singleview/button.mustache | 20 + .../dropdown_attribute.mustache | 25 + .../text_attribute.mustache | 22 + .../comment_chooser.mustache | 57 + templates/head.mustache | 152 ++ templates/head2.mustache | 32 + templates/header-secure.mustache | 43 + templates/header.mustache | 54 + templates/headerLogado.mustache | 61 + templates/login.mustache | 65 + templates/maintenance.mustache | 78 + templates/mod_assign/grading_actions.mustache | 54 + .../mod_assign/grading_navigation.mustache | 99 + .../grading_navigation_user_selector.mustache | 65 + templates/mod_forum/big_search_form.mustache | 161 ++ .../mod_forum/quick_search_form.mustache | 13 + templates/nav-drawer.mustache | 9 + templates/secure.mustache | 97 + templates/tool_lp/progress_bar.mustache | 47 + templates/tool_usertours/tourstep.mustache | 65 + .../behat_theme_boost_behat_action_menu.php | 57 + tests/behat/behat_theme_boost_behat_admin.php | 108 + .../behat/behat_theme_boost_behat_blocks.php | 94 + .../behat/behat_theme_boost_behat_course.php | 265 ++ .../behat_theme_boost_behat_filepicker.php | 305 +++ tests/behat/behat_theme_boost_behat_files.php | 65 + tests/behat/behat_theme_boost_behat_grade.php | 158 ++ .../behat_theme_boost_behat_mod_quiz.php | 89 + .../behat_theme_boost_behat_navigation.php | 353 +++ ...at_theme_boost_behat_repository_upload.php | 134 + tests/behat/blacklist.json | 8 + tests/behat/contextmenu.feature | 32 + tests/behat/regionmainsettingsmenu.feature | 43 + thirdpartylibs.xml | 101 + tmp/default-saberes.htm | 307 --- tmp/ilb-saberes.zip | Bin 9625 -> 0 bytes tmp/img/logo-ilb.png | Bin 4998 -> 0 bytes version.php | 17 +- 402 files changed, 35956 insertions(+), 2071 deletions(-) create mode 100644 amd/build/alert.min.js create mode 100644 amd/build/button.min.js create mode 100644 amd/build/carousel.min.js create mode 100644 amd/build/collapse.min.js create mode 100644 amd/build/drawer.min.js create mode 100644 amd/build/dropdown.min.js create mode 100644 amd/build/form-display-errors.min.js create mode 100644 amd/build/loader.min.js create mode 100644 amd/build/modal.min.js create mode 100644 amd/build/popover.min.js create mode 100644 amd/build/scrollspy.min.js create mode 100644 amd/build/tab.min.js create mode 100644 amd/build/tether.min.js create mode 100644 amd/build/tooltip.min.js create mode 100644 amd/build/util.min.js create mode 100644 amd/src/alert.js create mode 100644 amd/src/button.js create mode 100644 amd/src/carousel.js create mode 100644 amd/src/collapse.js create mode 100644 amd/src/drawer.js create mode 100644 amd/src/dropdown.js create mode 100644 amd/src/form-display-errors.js create mode 100644 amd/src/loader.js create mode 100644 amd/src/modal.js create mode 100644 amd/src/popover.js create mode 100644 amd/src/scrollspy.js create mode 100644 amd/src/tab.js create mode 100644 amd/src/tether.js create mode 100644 amd/src/tooltip.js create mode 100644 amd/src/util.js create mode 100644 classes/admin_settingspage_tabs.php create mode 100644 classes/autoprefixer.php create mode 100644 classes/output/block_settings_renderer.php create mode 100644 classes/output/core/admin_renderer.php create mode 100644 classes/output/core/course_renderer.php create mode 100644 classes/output/core/files_renderer.php create mode 100644 classes/output/core_renderer.php create mode 100644 classes/output/core_renderer_maintenance.php create mode 100644 classes/output/gradereport_history_renderer.php create mode 100644 cli/import-bootswatch.php create mode 100644 cli/readme_moodle.txt create mode 100644 lang/en/theme_ilb.php delete mode 100644 lang/en/theme_ilb2014.php create mode 100644 layout/columns1.php create mode 100644 layout/columns2.php delete mode 100644 layout/course.php create mode 100644 layout/embedded.php delete mode 100644 layout/frontpage.php create mode 100644 layout/frontpage_ilb.php delete mode 100644 layout/general.php delete mode 100644 layout/incourse.php create mode 100644 layout/login.php create mode 100644 layout/login_nova_conta.php create mode 100644 layout/maintenance.php delete mode 100644 layout/report.php create mode 100644 layout/secure.php delete mode 100644 layout/topo.php create mode 100644 lib.php delete mode 100644 pix/bg-menutopo.png delete mode 100644 pix/btn0800.gif create mode 100644 pix/fp/add_file.png create mode 100644 pix/fp/add_file.svg create mode 100644 pix/fp/alias.png create mode 100644 pix/fp/alias_sm.png create mode 100644 pix/fp/check.png create mode 100644 pix/fp/create_folder.png create mode 100644 pix/fp/create_folder.svg create mode 100644 pix/fp/cross.png create mode 100644 pix/fp/dnd_arrow.gif create mode 100644 pix/fp/download_all.png create mode 100644 pix/fp/download_all.svg create mode 100644 pix/fp/help.png create mode 100644 pix/fp/help.svg create mode 100644 pix/fp/link.png create mode 100644 pix/fp/link_sm.png create mode 100644 pix/fp/logout.png create mode 100644 pix/fp/logout.svg create mode 100644 pix/fp/path_folder.png create mode 100644 pix/fp/path_folder_rtl.png create mode 100644 pix/fp/refresh.png create mode 100644 pix/fp/refresh.svg create mode 100644 pix/fp/search.png create mode 100644 pix/fp/search.svg create mode 100644 pix/fp/setting.png create mode 100644 pix/fp/setting.svg create mode 100644 pix/fp/view_icon_active.png create mode 100644 pix/fp/view_icon_active.svg create mode 100644 pix/fp/view_list_active.png create mode 100644 pix/fp/view_list_active.svg create mode 100644 pix/fp/view_tree_active.png create mode 100644 pix/fp/view_tree_active.svg delete mode 100644 pix/header.jpg delete mode 100644 pix/icoSelPortais.png delete mode 100644 pix/logo-ilb.png delete mode 100644 pix/logo-interlegis.png delete mode 100644 pix/logo-moodle.png delete mode 100644 pix/logo-saberes.png delete mode 100644 pix/logo-senado-pb.gif create mode 100644 pix/mod/quiz/checkmark.png create mode 100644 pix/mod/quiz/checkmark.svg create mode 100644 pix/mod/quiz/flag-on.png create mode 100644 pix/mod/quiz/flag-on.svg create mode 100644 pix/mod/quiz/warningtriangle.png create mode 100644 pix/mod/quiz/warningtriangle.svg create mode 100644 pix/mod/quiz/whitecircle.png create mode 100644 pix/mod/quiz/whitecircle.svg delete mode 100644 pix/separador-topo.gif delete mode 100644 pix/topo_bg.gif create mode 100644 pix/yui2-treeview-sprite-rtl.gif create mode 100644 readme_moodle.txt delete mode 100644 renderers.php create mode 100644 scss/bootstrap/LICENSE create mode 100644 scss/bootstrap/_alert.scss create mode 100644 scss/bootstrap/_animation.scss create mode 100644 scss/bootstrap/_breadcrumb.scss create mode 100644 scss/bootstrap/_button-group.scss create mode 100644 scss/bootstrap/_buttons.scss create mode 100644 scss/bootstrap/_card.scss create mode 100644 scss/bootstrap/_carousel.scss create mode 100644 scss/bootstrap/_close.scss create mode 100644 scss/bootstrap/_code.scss create mode 100644 scss/bootstrap/_custom-forms.scss create mode 100644 scss/bootstrap/_custom.scss create mode 100644 scss/bootstrap/_dropdown.scss create mode 100644 scss/bootstrap/_forms.scss create mode 100644 scss/bootstrap/_grid.scss create mode 100644 scss/bootstrap/_images.scss create mode 100644 scss/bootstrap/_input-group.scss create mode 100644 scss/bootstrap/_jumbotron.scss create mode 100644 scss/bootstrap/_list-group.scss create mode 100644 scss/bootstrap/_media.scss create mode 100644 scss/bootstrap/_mixins.scss create mode 100644 scss/bootstrap/_modal.scss create mode 100644 scss/bootstrap/_nav.scss create mode 100644 scss/bootstrap/_navbar.scss create mode 100644 scss/bootstrap/_normalize.scss create mode 100644 scss/bootstrap/_pagination.scss create mode 100644 scss/bootstrap/_popover.scss create mode 100644 scss/bootstrap/_print.scss create mode 100644 scss/bootstrap/_progress.scss create mode 100644 scss/bootstrap/_reboot.scss create mode 100644 scss/bootstrap/_responsive-embed.scss create mode 100644 scss/bootstrap/_tables.scss create mode 100644 scss/bootstrap/_tags.scss create mode 100644 scss/bootstrap/_tooltip.scss create mode 100644 scss/bootstrap/_type.scss create mode 100644 scss/bootstrap/_utilities.scss create mode 100644 scss/bootstrap/_variables.scss create mode 100644 scss/bootstrap/bootstrap-flex.scss create mode 100644 scss/bootstrap/bootstrap-grid.scss create mode 100644 scss/bootstrap/bootstrap-reboot.scss create mode 100644 scss/bootstrap/bootstrap.scss create mode 100644 scss/bootstrap/mixins/_alert.scss create mode 100644 scss/bootstrap/mixins/_background-variant.scss create mode 100644 scss/bootstrap/mixins/_border-radius.scss create mode 100644 scss/bootstrap/mixins/_breakpoints.scss create mode 100644 scss/bootstrap/mixins/_buttons.scss create mode 100644 scss/bootstrap/mixins/_cards.scss create mode 100644 scss/bootstrap/mixins/_clearfix.scss create mode 100644 scss/bootstrap/mixins/_forms.scss create mode 100644 scss/bootstrap/mixins/_gradients.scss create mode 100644 scss/bootstrap/mixins/_grid-framework.scss create mode 100644 scss/bootstrap/mixins/_grid.scss create mode 100644 scss/bootstrap/mixins/_hover.scss create mode 100644 scss/bootstrap/mixins/_image.scss create mode 100644 scss/bootstrap/mixins/_list-group.scss create mode 100644 scss/bootstrap/mixins/_lists.scss create mode 100644 scss/bootstrap/mixins/_nav-divider.scss create mode 100644 scss/bootstrap/mixins/_navbar-align.scss create mode 100644 scss/bootstrap/mixins/_pagination.scss create mode 100644 scss/bootstrap/mixins/_progress.scss create mode 100644 scss/bootstrap/mixins/_pulls.scss create mode 100644 scss/bootstrap/mixins/_reset-filter.scss create mode 100644 scss/bootstrap/mixins/_reset-text.scss create mode 100644 scss/bootstrap/mixins/_resize.scss create mode 100644 scss/bootstrap/mixins/_screen-reader.scss create mode 100644 scss/bootstrap/mixins/_size.scss create mode 100644 scss/bootstrap/mixins/_tab-focus.scss create mode 100644 scss/bootstrap/mixins/_table-row.scss create mode 100644 scss/bootstrap/mixins/_tag.scss create mode 100644 scss/bootstrap/mixins/_text-emphasis.scss create mode 100644 scss/bootstrap/mixins/_text-hide.scss create mode 100644 scss/bootstrap/mixins/_text-truncate.scss create mode 100644 scss/bootstrap/utilities/_background.scss create mode 100644 scss/bootstrap/utilities/_clearfix.scss create mode 100644 scss/bootstrap/utilities/_display.scss create mode 100644 scss/bootstrap/utilities/_flex.scss create mode 100644 scss/bootstrap/utilities/_pulls.scss create mode 100644 scss/bootstrap/utilities/_screenreaders.scss create mode 100644 scss/bootstrap/utilities/_spacing.scss create mode 100644 scss/bootstrap/utilities/_text.scss create mode 100644 scss/bootstrap/utilities/_visibility.scss create mode 100644 scss/moodle.scss create mode 100644 scss/moodle/admin.scss create mode 100644 scss/moodle/backup-restore.scss create mode 100644 scss/moodle/blocks.scss create mode 100644 scss/moodle/bootstrap-rtl.scss create mode 100644 scss/moodle/bootswatch.scss create mode 100644 scss/moodle/bs2-compat.scss create mode 100644 scss/moodle/buttons.scss create mode 100644 scss/moodle/calendar.scss create mode 100644 scss/moodle/chat.scss create mode 100644 scss/moodle/core.scss create mode 100644 scss/moodle/course.scss create mode 100644 scss/moodle/debug.scss create mode 100644 scss/moodle/drawer.scss create mode 100644 scss/moodle/editor.scss create mode 100644 scss/moodle/expendable.scss create mode 100644 scss/moodle/filemanager.scss create mode 100644 scss/moodle/forms.scss create mode 100644 scss/moodle/grade.scss create mode 100644 scss/moodle/icons.scss create mode 100644 scss/moodle/login.scss create mode 100644 scss/moodle/message.scss create mode 100644 scss/moodle/modules.scss create mode 100644 scss/moodle/popover-region.scss create mode 100644 scss/moodle/print.scss create mode 100644 scss/moodle/question.scss create mode 100644 scss/moodle/reports.scss create mode 100644 scss/moodle/responsive-tabs.scss create mode 100644 scss/moodle/search.scss create mode 100644 scss/moodle/sticky-footer.scss create mode 100644 scss/moodle/tables.scss create mode 100644 scss/moodle/templates.scss create mode 100644 scss/moodle/tool_usertours.scss create mode 100644 scss/moodle/undo.scss create mode 100644 scss/moodle/user.scss create mode 100644 scss/preset.scss create mode 100644 scss/preset/default.scss create mode 100644 scss/preset/plain.scss create mode 100644 settings.php delete mode 100644 style/core.css delete mode 100644 style/editor.css create mode 100644 templates/admin_setting_tabs.mustache create mode 100644 templates/block_search_forums/search_form.mustache create mode 100644 templates/block_settings/search_form.mustache create mode 100644 templates/blocks-drawer.mustache create mode 100644 templates/columns1.mustache create mode 100644 templates/columns2.mustache create mode 100644 templates/columns2Old.mustache create mode 100644 templates/core/action_menu.mustache create mode 100644 templates/core/action_menu_item.mustache create mode 100644 templates/core/action_menu_link.mustache create mode 100644 templates/core/action_menu_trigger.mustache create mode 100644 templates/core/block.mustache create mode 100644 templates/core/chooser.mustache create mode 100644 templates/core/custom_menu_item.mustache create mode 100644 templates/core/dataformat_selector.mustache create mode 100644 templates/core/filemanager_confirmdialog.mustache create mode 100644 templates/core/filemanager_default_searchform.mustache create mode 100644 templates/core/filemanager_fileselect.mustache create mode 100644 templates/core/filemanager_loginform.mustache create mode 100644 templates/core/filemanager_modal_generallayout.mustache create mode 100644 templates/core/filemanager_page_generallayout.mustache create mode 100644 templates/core/filemanager_processexistingfile.mustache create mode 100644 templates/core/filemanager_processexistingfilemultiple.mustache create mode 100644 templates/core/filemanager_selectlayout.mustache create mode 100644 templates/core/filemanager_uploadform.mustache create mode 100644 templates/core/form_autocomplete_input.mustache create mode 100644 templates/core/form_autocomplete_selection.mustache create mode 100644 templates/core/help_icon.mustache create mode 100644 templates/core/login.mustache create mode 100644 templates/core/modal.mustache create mode 100644 templates/core/modal_backdrop.mustache create mode 100644 templates/core/navbar.mustache create mode 100644 templates/core/notification_error.mustache create mode 100644 templates/core/notification_info.mustache create mode 100644 templates/core/notification_success.mustache create mode 100644 templates/core/notification_warning.mustache create mode 100644 templates/core/paging_bar.mustache create mode 100644 templates/core/pix_icon.mustache create mode 100644 templates/core/preferences_groups.mustache create mode 100644 templates/core/progress_bar.mustache create mode 100644 templates/core/select_time.mustache create mode 100644 templates/core/settings_link_page.mustache create mode 100644 templates/core/settings_link_page_single.mustache create mode 100644 templates/core/signup_form_layout.mustache create mode 100644 templates/core/single_button.mustache create mode 100644 templates/core/single_select.mustache create mode 100644 templates/core/skip_links.mustache create mode 100644 templates/core/tabtree.mustache create mode 100644 templates/core/url_select.mustache create mode 100644 templates/core_admin/setting.mustache create mode 100644 templates/core_admin/setting_configcolourpicker.mustache create mode 100644 templates/core_admin/setting_configduration.mustache create mode 100644 templates/core_admin/setting_configfile.mustache create mode 100644 templates/core_admin/setting_configmultiselect.mustache create mode 100644 templates/core_admin/setting_configselect.mustache create mode 100644 templates/core_admin/setting_configtext.mustache create mode 100644 templates/core_admin/setting_configtextarea.mustache create mode 100644 templates/core_admin/setting_configtime.mustache create mode 100644 templates/core_admin/setting_courselist_frontpage.mustache create mode 100644 templates/core_admin/setting_devicedetectregex.mustache create mode 100644 templates/core_admin/setting_emoticons.mustache create mode 100644 templates/core_admin/setting_gradecat_combo.mustache create mode 100644 templates/core_admin/settings.mustache create mode 100644 templates/core_admin/settings_search_results.mustache create mode 100644 templates/core_form/editor_textarea.mustache create mode 100644 templates/core_form/element-advcheckbox-inline.mustache create mode 100644 templates/core_form/element-advcheckbox.mustache create mode 100644 templates/core_form/element-autocomplete-inline.mustache create mode 100644 templates/core_form/element-autocomplete.mustache create mode 100644 templates/core_form/element-button-inline.mustache create mode 100644 templates/core_form/element-button.mustache create mode 100644 templates/core_form/element-checkbox-inline.mustache create mode 100644 templates/core_form/element-checkbox.mustache create mode 100644 templates/core_form/element-date_selector-inline.mustache create mode 100644 templates/core_form/element-date_selector.mustache create mode 100644 templates/core_form/element-date_time_selector-inline.mustache create mode 100644 templates/core_form/element-date_time_selector.mustache create mode 100644 templates/core_form/element-duration-inline.mustache create mode 100644 templates/core_form/element-duration.mustache create mode 100644 templates/core_form/element-editor.mustache create mode 100644 templates/core_form/element-filemanager.mustache create mode 100644 templates/core_form/element-filepicker.mustache create mode 100644 templates/core_form/element-grading.mustache create mode 100644 templates/core_form/element-group-inline.mustache create mode 100644 templates/core_form/element-group.mustache create mode 100644 templates/core_form/element-modgrade.mustache create mode 100644 templates/core_form/element-modvisible.mustache create mode 100644 templates/core_form/element-password.mustache create mode 100644 templates/core_form/element-passwordunmask.mustache create mode 100644 templates/core_form/element-questioncategory-inline.mustache create mode 100644 templates/core_form/element-questioncategory.mustache create mode 100644 templates/core_form/element-radio-inline.mustache create mode 100644 templates/core_form/element-radio.mustache create mode 100644 templates/core_form/element-recaptcha.mustache create mode 100644 templates/core_form/element-select-inline.mustache create mode 100644 templates/core_form/element-select.mustache create mode 100644 templates/core_form/element-selectgroups-inline.mustache create mode 100644 templates/core_form/element-selectgroups.mustache create mode 100644 templates/core_form/element-selectwithlink.mustache create mode 100644 templates/core_form/element-selectyesno-inline.mustache create mode 100644 templates/core_form/element-selectyesno.mustache create mode 100644 templates/core_form/element-static.mustache create mode 100644 templates/core_form/element-submit-inline.mustache create mode 100644 templates/core_form/element-submit.mustache create mode 100644 templates/core_form/element-tags-inline.mustache create mode 100644 templates/core_form/element-tags.mustache create mode 100644 templates/core_form/element-template-inline.mustache create mode 100644 templates/core_form/element-template.mustache create mode 100644 templates/core_form/element-text-inline.mustache create mode 100644 templates/core_form/element-text.mustache create mode 100644 templates/core_form/element-textarea.mustache create mode 100644 templates/core_form/element-url.mustache create mode 100644 templates/core_form/element-warning.mustache create mode 100644 templates/core_form/element-wikieditor.mustache create mode 100644 templates/core_grades/edit_tree.mustache create mode 100644 templates/core_grades/weight_field.mustache create mode 100644 templates/core_grades/weight_override_field.mustache create mode 100644 templates/course_search_form.mustache create mode 100644 templates/custom_menu_footer.mustache create mode 100644 templates/embedded.mustache create mode 100644 templates/flat_navigation.mustache create mode 100644 templates/footer.mustache create mode 100644 templates/footerSimples.mustache create mode 100644 templates/frontpage_ilb.mustache create mode 100644 templates/frontpage_ilb.mustache.save create mode 100644 templates/frontpage_ilblogado.mustache create mode 100644 templates/gradereport_history/user_button.mustache create mode 100644 templates/gradereport_singleview/bulk_insert.mustache create mode 100644 templates/gradereport_singleview/button.mustache create mode 100644 templates/gradereport_singleview/dropdown_attribute.mustache create mode 100644 templates/gradereport_singleview/text_attribute.mustache create mode 100644 templates/gradingform_guide/comment_chooser.mustache create mode 100644 templates/head.mustache create mode 100644 templates/head2.mustache create mode 100644 templates/header-secure.mustache create mode 100644 templates/header.mustache create mode 100644 templates/headerLogado.mustache create mode 100644 templates/login.mustache create mode 100644 templates/maintenance.mustache create mode 100644 templates/mod_assign/grading_actions.mustache create mode 100644 templates/mod_assign/grading_navigation.mustache create mode 100644 templates/mod_assign/grading_navigation_user_selector.mustache create mode 100644 templates/mod_forum/big_search_form.mustache create mode 100644 templates/mod_forum/quick_search_form.mustache create mode 100644 templates/nav-drawer.mustache create mode 100644 templates/secure.mustache create mode 100644 templates/tool_lp/progress_bar.mustache create mode 100644 templates/tool_usertours/tourstep.mustache create mode 100644 tests/behat/behat_theme_boost_behat_action_menu.php create mode 100644 tests/behat/behat_theme_boost_behat_admin.php create mode 100644 tests/behat/behat_theme_boost_behat_blocks.php create mode 100644 tests/behat/behat_theme_boost_behat_course.php create mode 100644 tests/behat/behat_theme_boost_behat_filepicker.php create mode 100644 tests/behat/behat_theme_boost_behat_files.php create mode 100644 tests/behat/behat_theme_boost_behat_grade.php create mode 100644 tests/behat/behat_theme_boost_behat_mod_quiz.php create mode 100644 tests/behat/behat_theme_boost_behat_navigation.php create mode 100644 tests/behat/behat_theme_boost_behat_repository_upload.php create mode 100644 tests/behat/blacklist.json create mode 100644 tests/behat/contextmenu.feature create mode 100644 tests/behat/regionmainsettingsmenu.feature create mode 100644 thirdpartylibs.xml delete mode 100644 tmp/default-saberes.htm delete mode 100644 tmp/ilb-saberes.zip delete mode 100644 tmp/img/logo-ilb.png diff --git a/amd/build/alert.min.js b/amd/build/alert.min.js new file mode 100644 index 0000000..95495da --- /dev/null +++ b/amd/build/alert.min.js @@ -0,0 +1 @@ +define(["exports","./util"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var e=c(b),f=function(){function a(a,b){for(var c=0;cthis._items.length-1||b<0)){if(this._isSliding)return void a(this._element).one(r.SLID,function(){return c.to(b)});if(d===b)return this.pause(),void this.cycle();var e=b>d?q.NEXT:q.PREVIOUS;this._slide(e,this._items[b])}}},{key:"dispose",value:function(){a(this._element).off(i),a.removeData(this._element,h),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null}},{key:"_getConfig",value:function(c){return c=a.extend({},o,c),e["default"].typeCheckConfig(b,c,p),c}},{key:"_addEventListeners",value:function(){this._config.keyboard&&a(this._element).on(r.KEYDOWN,a.proxy(this._keydown,this)),"hover"!==this._config.pause||"ontouchstart"in document.documentElement||a(this._element).on(r.MOUSEENTER,a.proxy(this.pause,this)).on(r.MOUSELEAVE,a.proxy(this.cycle,this))}},{key:"_keydown",value:function(a){if(a.preventDefault(),!/input|textarea/i.test(a.target.tagName))switch(a.which){case m:this.prev();break;case n:this.next();break;default:return}}},{key:"_getItemIndex",value:function(b){return this._items=a.makeArray(a(b).parent().find(t.ITEM)),this._items.indexOf(b)}},{key:"_getItemByDirection",value:function(a,b){var c=a===q.NEXT,d=a===q.PREVIOUS,e=this._getItemIndex(b),f=this._items.length-1,g=d&&0===e||c&&e===f;if(g&&!this._config.wrap)return b;var h=a===q.PREVIOUS?-1:1,i=(e+h)%this._items.length;return i===-1?this._items[this._items.length-1]:this._items[i]}},{key:"_triggerSlideEvent",value:function(b,c){var d=a.Event(r.SLIDE,{relatedTarget:b,direction:c});return a(this._element).trigger(d),d}},{key:"_setActiveIndicatorElement",value:function(b){if(this._indicatorsElement){a(this._indicatorsElement).find(t.ACTIVE).removeClass(s.ACTIVE);var c=this._indicatorsElement.children[this._getItemIndex(b)];c&&a(c).addClass(s.ACTIVE)}}},{key:"_slide",value:function(b,c){var d=this,f=a(this._element).find(t.ACTIVE_ITEM)[0],g=c||f&&this._getItemByDirection(b,f),h=Boolean(this._interval),i=b===q.NEXT?s.LEFT:s.RIGHT;if(g&&a(g).hasClass(s.ACTIVE))return void(this._isSliding=!1);var j=this._triggerSlideEvent(g,i);if(!j.isDefaultPrevented()&&f&&g){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(g);var k=a.Event(r.SLID,{relatedTarget:g,direction:i});e["default"].supportsTransitionEnd()&&a(this._element).hasClass(s.SLIDE)?(a(g).addClass(b),e["default"].reflow(g),a(f).addClass(i),a(g).addClass(i),a(f).one(e["default"].TRANSITION_END,function(){a(g).removeClass(i).removeClass(b),a(g).addClass(s.ACTIVE),a(f).removeClass(s.ACTIVE).removeClass(b).removeClass(i),d._isSliding=!1,setTimeout(function(){return a(d._element).trigger(k)},0)}).emulateTransitionEnd(l)):(a(f).removeClass(s.ACTIVE),a(g).addClass(s.ACTIVE),this._isSliding=!1,a(this._element).trigger(k)),h&&this.cycle()}}}],[{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(h),d=a.extend({},o,a(this).data());"object"===("undefined"==typeof b?"undefined":f(b))&&a.extend(d,b);var e="string"==typeof b?b:d.slide;if(c||(c=new j(this,d),a(this).data(h,c)),"number"==typeof b)c.to(b);else if("string"==typeof e){if(void 0===c[e])throw new Error('No method named "'+e+'"');c[e]()}else d.interval&&(c.pause(),c.cycle())})}},{key:"_dataApiClickHandler",value:function(b){var c=e["default"].getSelectorFromElement(this);if(c){var d=a(c)[0];if(d&&a(d).hasClass(s.CAROUSEL)){var f=a.extend({},a(d).data(),a(this).data()),g=this.getAttribute("data-slide-to");g&&(f.interval=!1),j._jQueryInterface.call(a(d),f),g&&a(d).data(h).to(g),b.preventDefault()}}}},{key:"VERSION",get:function(){return c}},{key:"Default",get:function(){return o}}]),j}();return a(document).on(r.CLICK_DATA_API,t.DATA_SLIDE,u._dataApiClickHandler),a(window).on(r.LOAD_DATA_API,function(){a(t.DATA_RIDE).each(function(){var b=a(this);u._jQueryInterface.call(b,b.data())})}),a.fn[b]=u._jQueryInterface,a.fn[b].Constructor=u,a.fn[b].noConflict=function(){return a.fn[b]=k,u._jQueryInterface},u}(jQuery);a["default"]=h}); \ No newline at end of file diff --git a/amd/build/collapse.min.js b/amd/build/collapse.min.js new file mode 100644 index 0000000..23c9985 --- /dev/null +++ b/amd/build/collapse.min.js @@ -0,0 +1 @@ +define(["exports","./util"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var e=c(b),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},g=function(){function a(a,b){for(var c=0;c .in, .panel > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},s=function(){function i(b,c){d(this,i),this._isTransitioning=!1,this._element=b,this._config=this._getConfig(c),this._triggerArray=a.makeArray(a('[data-toggle="collapse"][href="#'+b.id+'"],'+('[data-toggle="collapse"][data-target="#'+b.id+'"]'))),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return g(i,[{key:"toggle",value:function(){a(this._element).hasClass(p.IN)?this.hide():this.show()}},{key:"show",value:function(){var b=this;if(!this._isTransitioning&&!a(this._element).hasClass(p.IN)){var c=void 0,d=void 0;if(this._parent&&(c=a.makeArray(a(r.ACTIVES)),c.length||(c=null)),!(c&&(d=a(c).data(h),d&&d._isTransitioning))){var f=a.Event(o.SHOW);if(a(this._element).trigger(f),!f.isDefaultPrevented()){c&&(i._jQueryInterface.call(a(c),"hide"),d||a(c).data(h,null));var g=this._getDimension();a(this._element).removeClass(p.COLLAPSE).addClass(p.COLLAPSING),this._element.style[g]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&a(this._triggerArray).removeClass(p.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var j=function(){a(b._element).removeClass(p.COLLAPSING).addClass(p.COLLAPSE).addClass(p.IN),b._element.style[g]="",b.setTransitioning(!1),a(b._element).trigger(o.SHOWN)};if(!e["default"].supportsTransitionEnd())return void j();var k=g[0].toUpperCase()+g.slice(1),m="scroll"+k;a(this._element).one(e["default"].TRANSITION_END,j).emulateTransitionEnd(l),this._element.style[g]=this._element[m]+"px"}}}}},{key:"hide",value:function(){var b=this;if(!this._isTransitioning&&a(this._element).hasClass(p.IN)){var c=a.Event(o.HIDE);if(a(this._element).trigger(c),!c.isDefaultPrevented()){var d=this._getDimension(),f=d===q.WIDTH?"offsetWidth":"offsetHeight";this._element.style[d]=this._element[f]+"px",e["default"].reflow(this._element),a(this._element).addClass(p.COLLAPSING).removeClass(p.COLLAPSE).removeClass(p.IN),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&a(this._triggerArray).addClass(p.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var g=function(){b.setTransitioning(!1),a(b._element).removeClass(p.COLLAPSING).addClass(p.COLLAPSE).trigger(o.HIDDEN)};return this._element.style[d]=0,e["default"].supportsTransitionEnd()?void a(this._element).one(e["default"].TRANSITION_END,g).emulateTransitionEnd(l):void g()}}}},{key:"setTransitioning",value:function(a){this._isTransitioning=a}},{key:"dispose",value:function(){a.removeData(this._element,h),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null}},{key:"_getConfig",value:function(c){return c=a.extend({},m,c),c.toggle=Boolean(c.toggle),e["default"].typeCheckConfig(b,c,n),c}},{key:"_getDimension",value:function(){var b=a(this._element).hasClass(q.WIDTH);return b?q.WIDTH:q.HEIGHT}},{key:"_getParent",value:function(){var b=this,c=a(this._config.parent)[0],d='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return a(c).find(d).each(function(a,c){b._addAriaAndCollapsedClass(i._getTargetFromElement(c),[c])}),c}},{key:"_addAriaAndCollapsedClass",value:function(b,c){if(b){var d=a(b).hasClass(p.IN);b.setAttribute("aria-expanded",d),c.length&&a(c).toggleClass(p.COLLAPSED,!d).attr("aria-expanded",d)}}}],[{key:"_getTargetFromElement",value:function(b){var c=e["default"].getSelectorFromElement(b);return c?a(c)[0]:null}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(h),e=a.extend({},m,c.data(),"object"===("undefined"==typeof b?"undefined":f(b))&&b);if(!d&&e.toggle&&/show|hide/.test(b)&&(e.toggle=!1),d||(d=new i(this,e),c.data(h,d)),"string"==typeof b){if(void 0===d[b])throw new Error('No method named "'+b+'"');d[b]()}})}},{key:"VERSION",get:function(){return c}},{key:"Default",get:function(){return m}}]),i}();return a(document).on(o.CLICK_DATA_API,r.DATA_TOGGLE,function(b){b.preventDefault();var c=s._getTargetFromElement(this),d=a(c).data(h),e=d?"toggle":a(this).data();s._jQueryInterface.call(a(c),e)}),a.fn[b]=s._jQueryInterface,a.fn[b].Constructor=s,a.fn[b].noConflict=function(){return a.fn[b]=k,s._jQueryInterface},s}(jQuery);a["default"]=h}); \ No newline at end of file diff --git a/amd/build/drawer.min.js b/amd/build/drawer.min.js new file mode 100644 index 0000000..854b6b9 --- /dev/null +++ b/amd/build/drawer.min.js @@ -0,0 +1 @@ +define(["jquery","core/custom_interaction_events","core/log"],function(a,b,c){var d={TOGGLE_REGION:'[data-region="drawer-toggle"]',TOGGLE_ACTION:'[data-action="toggle-drawer"]',TOGGLE_TARGET:"aria-controls",TOGGLE_SIDE:"left",BODY:"body"},e=function(){a(d.TOGGLE_REGION).length||c.debug("Page is missing a drawer region"),a(d.TOGGLE_ACTION).length||c.debug("Page is missing a drawer toggle link"),a(d.TOGGLE_REGION).each(function(b,c){var e=a(c).find(d.TOGGLE_ACTION),f=e.attr("aria-controls"),g=a(document.getElementById(f)),h="false"==e.attr("aria-expanded"),i=e.attr("data-side"),j=a(d.BODY);g.on("mousewheel DOMMouseScroll",this.preventPageScroll),h?e.attr("aria-expanded","false"):(j.addClass("drawer-open-"+i),e.attr("aria-expanded","true"))}.bind(this)),this.registerEventListeners();var b=a(document).width()<768;b&&this.closeAll()};return e.prototype.closeAll=function(){a(d.TOGGLE_REGION).each(function(b,c){var e=a(c).find(d.TOGGLE_ACTION),f=e.attr("data-side"),g=a(d.BODY),h=e.attr("aria-controls"),i=a(document.getElementById(h)),j=e.attr("data-preference");e.attr("aria-expanded","false"),g.removeClass("drawer-open-"+f),i.attr("aria-hidden","true"),i.addClass("closed"),M.util.set_user_preference(j,"false")})},e.prototype.toggleDrawer=function(b){var c=a(b.target).closest("[data-action=toggle-drawer]"),e=c.attr("aria-controls"),f=a(document.getElementById(e)),g=a(d.BODY),h=c.attr("data-side"),i=c.attr("data-preference");g.addClass("drawer-ease");var j="true"==c.attr("aria-expanded");if(j)g.removeClass("drawer-open-"+h),c.attr("aria-expanded","false"),f.attr("aria-hidden","true"),f.addClass("closed"),M.util.set_user_preference(i,"false");else{var k=a(document).width()<768;k&&this.closeAll(),c.attr("aria-expanded","true"),f.attr("aria-hidden","false"),f.focus(),g.addClass("drawer-open-"+h),f.removeClass("closed"),M.util.set_user_preference(i,"true")}},e.prototype.preventPageScroll=function(b){var c=b.wheelDelta||b.originalEvent&&b.originalEvent.wheelDelta||-b.originalEvent.detail,d=this.scrollTop+a(this).outerHeight()-this.scrollHeight>=0,e=this.scrollTop<=0;(c<0&&d||c>0&&e)&&b.preventDefault()},e.prototype.registerEventListeners=function(){a(d.TOGGLE_ACTION).each(function(c,d){b.define(a(d),[b.events.activate]),a(d).on(b.events.activate,function(a,b){this.toggleDrawer(b.originalEvent),b.originalEvent.preventDefault()}.bind(this))}.bind(this))},{init:function(){return new e}}}); \ No newline at end of file diff --git a/amd/build/dropdown.min.js b/amd/build/dropdown.min.js new file mode 100644 index 0000000..5a89366 --- /dev/null +++ b/amd/build/dropdown.min.js @@ -0,0 +1 @@ +define(["exports","./util"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var e=c(b),f=function(){function a(a,b){for(var c=0;c0&&h--,c.which===m&&hdocument.documentElement.clientHeight;!this._isBodyOverflowing&&a&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!a&&(this._element.style.paddingRight=this._scrollbarWidth+"px")}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}},{key:"_checkScrollbar",value:function(){this._isBodyOverflowing=document.body.clientWidth

'}),n=a.extend({},g["default"].DefaultType,{content:"(string|element|function)"}),o={FADE:"fade",IN:"in"},p={TITLE:".popover-title",CONTENT:".popover-content",ARROW:".popover-arrow"},q={HIDE:"hide"+k,HIDDEN:"hidden"+k,SHOW:"show"+k,SHOWN:"shown"+k,INSERTED:"inserted"+k,CLICK:"click"+k,FOCUSIN:"focusin"+k,FOCUSOUT:"focusout"+k,MOUSEENTER:"mouseenter"+k,MOUSELEAVE:"mouseleave"+k},r=function(g){function l(){return d(this,l),e(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return f(l,g),i(l,[{key:"isWithContent",value:function(){return this.getTitle()||this._getContent()}},{key:"getTipElement",value:function(){return this.tip=this.tip||a(this.config.template)[0]}},{key:"setContent",value:function(){var b=a(this.getTipElement());this.setElementContent(b.find(p.TITLE),this.getTitle()),this.setElementContent(b.find(p.CONTENT),this._getContent()),b.removeClass(o.FADE).removeClass(o.IN),this.cleanupTether()}},{key:"_getContent",value:function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)}}],[{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(j),d="object"===("undefined"==typeof b?"undefined":h(b))?b:null;if((c||!/destroy|hide/.test(b))&&(c||(c=new l(this,d),a(this).data(j,c)),"string"==typeof b)){if(void 0===c[b])throw new Error('No method named "'+b+'"');c[b]()}})}},{key:"VERSION",get:function(){return c}},{key:"Default",get:function(){return m}},{key:"NAME",get:function(){return b}},{key:"DATA_KEY",get:function(){return j}},{key:"Event",get:function(){return q}},{key:"EVENT_KEY",get:function(){return k}},{key:"DefaultType",get:function(){return n}}]),l}(g["default"]);return a.fn[b]=r._jQueryInterface,a.fn[b].Constructor=r,a.fn[b].noConflict=function(){return a.fn[b]=l,r._jQueryInterface},r}(jQuery);a["default"]=j}); \ No newline at end of file diff --git a/amd/build/scrollspy.min.js b/amd/build/scrollspy.min.js new file mode 100644 index 0000000..884c59f --- /dev/null +++ b/amd/build/scrollspy.min.js @@ -0,0 +1 @@ +define(["exports","./util"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var e=c(b),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},g=function(){function a(a,b){for(var c=0;c=c){var d=this._targets[this._targets.length-1];this._activeTarget!==d&&this._activate(d)}if(this._activeTarget&&a=this._offsets[e]&&(void 0===this._offsets[e+1]||a .nav-item .fade, > .fade",ACTIVE:".active",ACTIVE_CHILD:"> .nav-item > .active, > .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_TOGGLE:".dropdown-toggle",DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu .active"},o=function(){function b(a){d(this,b),this._element=a}return f(b,[{key:"show",value:function(){var b=this;if(!this._element.parentNode||this._element.parentNode.nodeType!==Node.ELEMENT_NODE||!a(this._element).hasClass(m.ACTIVE)){var c=void 0,d=void 0,f=a(this._element).closest(n.UL)[0],g=e["default"].getSelectorFromElement(this._element);f&&(d=a.makeArray(a(f).find(n.ACTIVE)),d=d[d.length-1]);var h=a.Event(l.HIDE,{relatedTarget:this._element}),i=a.Event(l.SHOW,{relatedTarget:d});if(d&&a(d).trigger(h),a(this._element).trigger(i),!i.isDefaultPrevented()&&!h.isDefaultPrevented()){g&&(c=a(g)[0]),this._activate(this._element,f);var j=function(){var c=a.Event(l.HIDDEN,{relatedTarget:b._element}),e=a.Event(l.SHOWN,{relatedTarget:d});a(d).trigger(c),a(b._element).trigger(e)};c?this._activate(c,c.parentNode,j):j()}}}},{key:"dispose",value:function(){a.removeClass(this._element,g),this._element=null}},{key:"_activate",value:function(b,c,d){var f=a(c).find(n.ACTIVE_CHILD)[0],g=d&&e["default"].supportsTransitionEnd()&&(f&&a(f).hasClass(m.FADE)||Boolean(a(c).find(n.FADE_CHILD)[0])),h=a.proxy(this._transitionComplete,this,b,f,g,d);f&&g?a(f).one(e["default"].TRANSITION_END,h).emulateTransitionEnd(k):h(),f&&a(f).removeClass(m.IN)}},{key:"_transitionComplete",value:function(b,c,d,f){if(c){a(c).removeClass(m.ACTIVE);var g=a(c).find(n.DROPDOWN_ACTIVE_CHILD)[0];g&&a(g).removeClass(m.ACTIVE),c.setAttribute("aria-expanded",!1)}if(a(b).addClass(m.ACTIVE),b.setAttribute("aria-expanded",!0),d?(e["default"].reflow(b),a(b).addClass(m.IN)):a(b).removeClass(m.FADE),b.parentNode&&a(b.parentNode).hasClass(m.DROPDOWN_MENU)){var h=a(b).closest(n.DROPDOWN)[0];h&&a(h).find(n.DROPDOWN_TOGGLE).addClass(m.ACTIVE),b.setAttribute("aria-expanded",!0)}f&&f()}}],[{key:"_jQueryInterface",value:function(c){return this.each(function(){var d=a(this),e=d.data(g);if(e||(e=e=new b(this),d.data(g,e)),"string"==typeof c){if(void 0===e[c])throw new Error('No method named "'+c+'"');e[c]()}})}},{key:"VERSION",get:function(){return c}}]),b}();return a(document).on(l.CLICK_DATA_API,n.DATA_TOGGLE,function(b){b.preventDefault(),o._jQueryInterface.call(a(this),"show")}),a.fn[b]=o._jQueryInterface,a.fn[b].Constructor=o,a.fn[b].noConflict=function(){return a.fn[b]=j,o._jQueryInterface},o}(jQuery);a["default"]=g}); \ No newline at end of file diff --git a/amd/build/tether.min.js b/amd/build/tether.min.js new file mode 100644 index 0000000..261e672 --- /dev/null +++ b/amd/build/tether.min.js @@ -0,0 +1 @@ +!function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b(require,exports,module):a.Tether=b()}(this,function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a){var b=a.getBoundingClientRect(),c={};for(var d in b)c[d]=b[d];if(a.ownerDocument!==document){var f=a.ownerDocument.defaultView.frameElement;if(f){var g=e(f);c.top+=g.top,c.bottom+=g.top,c.left+=g.left,c.right+=g.left}}return c}function f(a){var b=getComputedStyle(a)||{},c=b.position,d=[];if("fixed"===c)return[a];for(var e=a;(e=e.parentNode)&&e&&1===e.nodeType;){var f=void 0;try{f=getComputedStyle(e)}catch(g){}if("undefined"==typeof f||null===f)return d.push(e),d;var h=f,i=h.overflow,j=h.overflowX,k=h.overflowY;/(auto|scroll)/.test(i+k+j)&&("absolute"!==c||["relative","absolute","fixed"].indexOf(f.position)>=0)&&d.push(e)}return d.push(a.ownerDocument.body),a.ownerDocument!==document&&d.push(a.ownerDocument.defaultView),d}function g(){z&&document.body.removeChild(z),z=null}function h(a){var b=void 0;a===document?(b=document,a=document.documentElement):b=a.ownerDocument;var c=b.documentElement,d=e(a),f=C();return d.top-=f.top,d.left-=f.left,"undefined"==typeof d.width&&(d.width=document.body.scrollWidth-d.left-d.right),"undefined"==typeof d.height&&(d.height=document.body.scrollHeight-d.top-d.bottom),d.top=d.top-c.clientTop,d.left=d.left-c.clientLeft,d.right=b.body.clientWidth-d.width-d.left,d.bottom=b.body.clientHeight-d.height-d.top,d}function i(a){return a.offsetParent||document.documentElement}function j(){var a=document.createElement("div");a.style.width="100%",a.style.height="200px";var b=document.createElement("div");k(b.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),b.appendChild(a),document.body.appendChild(b);var c=a.offsetWidth;b.style.overflow="scroll";var d=a.offsetWidth;c===d&&(d=b.clientWidth),document.body.removeChild(b);var e=c-d;return{width:e,height:e}}function k(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],b=[];return Array.prototype.push.apply(b,arguments),b.slice(1).forEach(function(b){if(b)for(var c in b)({}).hasOwnProperty.call(b,c)&&(a[c]=b[c])}),a}function l(a,b){if("undefined"!=typeof a.classList)b.split(" ").forEach(function(b){b.trim()&&a.classList.remove(b)});else{var c=new RegExp("(^| )"+b.split(" ").join("|")+"( |$)","gi"),d=o(a).replace(c," ");p(a,d)}}function m(a,b){if("undefined"!=typeof a.classList)b.split(" ").forEach(function(b){b.trim()&&a.classList.add(b)});else{l(a,b);var c=o(a)+(" "+b);p(a,c)}}function n(a,b){if("undefined"!=typeof a.classList)return a.classList.contains(b);var c=o(a);return new RegExp("(^| )"+b+"( |$)","gi").test(c)}function o(a){return a.className instanceof a.ownerDocument.defaultView.SVGAnimatedString?a.className.baseVal:a.className}function p(a,b){a.setAttribute("class",b)}function q(a,b,c){c.forEach(function(c){b.indexOf(c)===-1&&n(a,c)&&l(a,c)}),b.forEach(function(b){n(a,b)||m(a,b)})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function r(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function s(a,b){var c=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return a+c>=b&&b>=a-c}function t(){return"undefined"!=typeof performance&&"undefined"!=typeof performance.now?performance.now():+new Date}function u(){for(var a={top:0,left:0},b=arguments.length,c=Array(b),d=0;d1?c-1:0),e=1;e16?(b=Math.min(b-16,250),void(c=setTimeout(e,250))):void("undefined"!=typeof a&&t()-a<10||(null!=c&&(clearTimeout(c),c=null),a=t(),M(),b=t()-a))};"undefined"!=typeof window&&"undefined"!=typeof window.addEventListener&&["resize","scroll","touchmove"].forEach(function(a){window.addEventListener(a,d)})}();var N={center:"center",left:"right",right:"left"},O={middle:"middle",top:"bottom",bottom:"top"},P={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},Q=function(a,b){var c=a.left,d=a.top;return"auto"===c&&(c=N[b.left]),"auto"===d&&(d=O[b.top]),{left:c,top:d}},R=function(a){var b=a.left,c=a.top;return"undefined"!=typeof P[a.left]&&(b=P[a.left]),"undefined"!=typeof P[a.top]&&(c=P[a.top]),{left:b,top:c}},S=function(a){var b=a.split(" "),c=H(b,2),d=c[0],e=c[1];return{top:d,left:e}},T=S,U=function(a){function b(a){var c=this;d(this,b),I(Object.getPrototypeOf(b.prototype),"constructor",this).call(this),this.position=this.position.bind(this),L.push(this),this.history=[],this.setOptions(a,!1),y.modules.forEach(function(a){"undefined"!=typeof a.initialize&&a.initialize.call(c)}),this.position()}return r(b,a),x(b,[{key:"getClass",value:function(){var a=arguments.length<=0||void 0===arguments[0]?"":arguments[0],b=this.options.classes;return"undefined"!=typeof b&&b[a]?this.options.classes[a]:this.options.classPrefix?this.options.classPrefix+"-"+a:a}},{key:"setOptions",value:function(a){var b=this,c=arguments.length<=1||void 0===arguments[1]||arguments[1],d={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"};this.options=k(d,a);var e=this.options,g=e.element,h=e.target,i=e.targetModifier;if(this.element=g,this.target=h,this.targetModifier=i,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach(function(a){if("undefined"==typeof b[a])throw new Error("Tether Error: Both element and target must be defined");"undefined"!=typeof b[a].jquery?b[a]=b[a][0]:"string"==typeof b[a]&&(b[a]=document.querySelector(b[a]))}),m(this.element,this.getClass("element")),this.options.addTargetClasses!==!1&&m(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=T(this.options.targetAttachment),this.attachment=T(this.options.attachment),this.offset=S(this.options.offset),this.targetOffset=S(this.options.targetOffset),"undefined"!=typeof this.scrollParents&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=f(this.target),this.options.enabled!==!1&&this.enable(c)}},{key:"getTargetBounds",value:function(){if("undefined"==typeof this.targetModifier)return h(this.target);if("visible"===this.targetModifier){if(this.target===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var a=h(this.target),b={height:a.height,width:a.width,top:a.top,left:a.left};return b.height=Math.min(b.height,a.height-(pageYOffset-a.top)),b.height=Math.min(b.height,a.height-(a.top+a.height-(pageYOffset+innerHeight))),b.height=Math.min(innerHeight,b.height),b.height-=2,b.width=Math.min(b.width,a.width-(pageXOffset-a.left)),b.width=Math.min(b.width,a.width-(a.left+a.width-(pageXOffset+innerWidth))),b.width=Math.min(innerWidth,b.width),b.width-=2,b.topc.clientWidth||[d.overflow,d.overflowX].indexOf("scroll")>=0||this.target!==document.body,f=0;e&&(f=15);var g=a.height-parseFloat(d.borderTopWidth)-parseFloat(d.borderBottomWidth)-f,b={width:15,height:.975*g*(g/c.scrollHeight),left:a.left+a.width-parseFloat(d.borderLeftWidth)-15},i=0;g<408&&this.target===document.body&&(i=-11e-5*Math.pow(g,2)-.00727*g+22.58),this.target!==document.body&&(b.height=Math.max(b.height,24));var j=this.target.scrollTop/(c.scrollHeight-g);return b.top=j*(g-b.height-i)+a.top+parseFloat(d.borderTopWidth),this.target===document.body&&(b.height=Math.max(b.height,24)),b}}},{key:"clearCache",value:function(){this._cache={}}},{key:"cache",value:function(a,b){return"undefined"==typeof this._cache&&(this._cache={}),"undefined"==typeof this._cache[a]&&(this._cache[a]=b.call(this)),this._cache[a]}},{key:"enable",value:function(){var a=this,b=arguments.length<=0||void 0===arguments[0]||arguments[0];this.options.addTargetClasses!==!1&&m(this.target,this.getClass("enabled")),m(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParents.forEach(function(b){b!==a.target.ownerDocument&&b.addEventListener("scroll",a.position)}),b&&this.position()}},{key:"disable",value:function(){var a=this;l(this.target,this.getClass("enabled")),l(this.element,this.getClass("enabled")),this.enabled=!1,"undefined"!=typeof this.scrollParents&&this.scrollParents.forEach(function(b){b.removeEventListener("scroll",a.position)})}},{key:"destroy",value:function(){var a=this;this.disable(),L.forEach(function(b,c){b===a&&L.splice(c,1)}),0===L.length&&g()}},{key:"updateAttachClasses",value:function(a,b){var c=this;a=a||this.attachment,b=b||this.targetAttachment;var d=["left","top","bottom","right","middle","center"];"undefined"!=typeof this._addAttachClasses&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),"undefined"==typeof this._addAttachClasses&&(this._addAttachClasses=[]);var e=this._addAttachClasses;a.top&&e.push(this.getClass("element-attached")+"-"+a.top),a.left&&e.push(this.getClass("element-attached")+"-"+a.left),b.top&&e.push(this.getClass("target-attached")+"-"+b.top),b.left&&e.push(this.getClass("target-attached")+"-"+b.left);var f=[];d.forEach(function(a){f.push(c.getClass("element-attached")+"-"+a),f.push(c.getClass("target-attached")+"-"+a)}),E(function(){"undefined"!=typeof c._addAttachClasses&&(q(c.element,c._addAttachClasses,f),c.options.addTargetClasses!==!1&&q(c.target,c._addAttachClasses,f),delete c._addAttachClasses)})}},{key:"position",value:function(){var a=this,b=arguments.length<=0||void 0===arguments[0]||arguments[0];if(this.enabled){this.clearCache();var c=Q(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,c);var d=this.cache("element-bounds",function(){return h(a.element)}),e=d.width,f=d.height;if(0===e&&0===f&&"undefined"!=typeof this.lastSize){var g=this.lastSize;e=g.width,f=g.height}else this.lastSize={width:e,height:f};var k=this.cache("target-bounds",function(){return a.getTargetBounds()}),l=k,m=v(R(this.attachment),{width:e,height:f}),n=v(R(c),l),o=v(this.offset,{width:e,height:f}),p=v(this.targetOffset,l);m=u(m,o),n=u(n,p);for(var q=k.left+n.left-m.left,r=k.top+n.top-m.top,s=0;sA.innerWidth&&(B=this.cache("scrollbar-size",j),x.viewport.bottom-=B.height),z.body.scrollHeight>A.innerHeight&&(B=this.cache("scrollbar-size",j),x.viewport.right-=B.width),["","static"].indexOf(z.body.style.position)!==-1&&["","static"].indexOf(z.body.parentElement.style.position)!==-1||(x.page.bottom=z.body.scrollHeight-r-f,x.page.right=z.body.scrollWidth-q-e),"undefined"!=typeof this.options.optimizations&&this.options.optimizations.moveElement!==!1&&"undefined"==typeof this.targetModifier&&!function(){var b=a.cache("target-offsetparent",function(){return i(a.target)}),c=a.cache("target-offsetparent-bounds",function(){return h(b)}),d=getComputedStyle(b),e=c,f={};if(["Top","Left","Bottom","Right"].forEach(function(a){f[a.toLowerCase()]=parseFloat(d["border"+a+"Width"])}),c.right=z.body.scrollWidth-c.left-e.width+f.right,c.bottom=z.body.scrollHeight-c.top-e.height+f.bottom,x.page.top>=c.top+f.top&&x.page.bottom>=c.bottom&&x.page.left>=c.left+f.left&&x.page.right>=c.right){var g=b.scrollTop,j=b.scrollLeft;x.offset={top:x.page.top-c.top+g-f.top,left:x.page.left-c.left+j-f.left}}}(),this.move(x),this.history.unshift(x),this.history.length>3&&this.history.pop(),b&&F(),!0}}},{key:"move",value:function(a){var b=this;if("undefined"!=typeof this.element.parentNode){var c={};for(var d in a){c[d]={};for(var e in a[d]){for(var f=!1,g=0;g=0){var o=h.split(" "),q=H(o,2);l=q[0],k=q[1]}else k=l=h;var t=w(b,f);"target"!==l&&"both"!==l||(ct[3]&&"bottom"===r.top&&(c-=m,r.top="top")),"together"===l&&("top"===r.top&&("bottom"===s.top&&ct[3]&&c-(g-m)>=t[1]&&(c-=g-m,r.top="bottom",s.top="bottom")),"bottom"===r.top&&("top"===s.top&&c+g>t[3]?(c-=m,r.top="top",c-=g,s.top="bottom"):"bottom"===s.top&&ct[3]&&"top"===s.top?(c-=g,s.top="bottom"):ct[2]&&"right"===r.left&&(d-=n,r.left="left")),"together"===k&&(dt[2]&&"right"===r.left?"left"===s.left?(d-=n,r.left="left",d-=i,s.left="right"):"right"===s.left&&(d-=n,r.left="left",d+=i,s.left="left"):"center"===r.left&&(d+i>t[2]&&"left"===s.left?(d-=i,s.left="right"):dt[3]&&"top"===s.top&&(c-=g,s.top="bottom")),"element"!==k&&"both"!==k||(dt[2]&&("left"===s.left?(d-=i,s.left="right"):"center"===s.left&&(d-=i/2,s.left="right"))),"string"==typeof j?j=j.split(",").map(function(a){return a.trim()}):j===!0&&(j=["top","left","right","bottom"]),j=j||[];var u=[],v=[];c=0?(c=t[1],u.push("top")):v.push("top")),c+g>t[3]&&(j.indexOf("bottom")>=0?(c=t[3]-g,u.push("bottom")):v.push("bottom")),d=0?(d=t[0],u.push("left")):v.push("left")),d+i>t[2]&&(j.indexOf("right")>=0?(d=t[2]-i,u.push("right")):v.push("right")),u.length&&!function(){var a=void 0;a="undefined"!=typeof b.options.pinnedClass?b.options.pinnedClass:b.getClass("pinned"),p.push(a),u.forEach(function(b){p.push(a+"-"+b)})}(),v.length&&!function(){var a=void 0;a="undefined"!=typeof b.options.outOfBoundsClass?b.options.outOfBoundsClass:b.getClass("out-of-bounds"),p.push(a),v.forEach(function(b){p.push(a+"-"+b)})}(),(u.indexOf("left")>=0||u.indexOf("right")>=0)&&(s.left=r.left=!1),(u.indexOf("top")>=0||u.indexOf("bottom")>=0)&&(s.top=r.top=!1),r.top===e.top&&r.left===e.left&&s.top===b.attachment.top&&s.left===b.attachment.left||(b.updateAttachClasses(s,r),b.trigger("update",{attachment:s,targetAttachment:r}))}),E(function(){b.options.addTargetClasses!==!1&&q(b.target,p,o),q(b.element,p,o)}),{top:c,left:d}}});var J=y.Utils,h=J.getBounds,q=J.updateClasses,E=J.defer;y.modules.push({position:function(a){var b=this,c=a.top,d=a.left,e=this.cache("element-bounds",function(){return h(b.element)}),f=e.height,g=e.width,i=this.getTargetBounds(),j=c+f,k=d+g,l=[];c<=i.bottom&&j>=i.top&&["left","right"].forEach(function(a){var b=i[a];b!==d&&b!==k||l.push(a)}),d<=i.right&&k>=i.left&&["top","bottom"].forEach(function(a){var b=i[a];b!==c&&b!==j||l.push(a)});var m=[],n=[],o=["left","top","right","bottom"];return m.push(this.getClass("abutted")),o.forEach(function(a){m.push(b.getClass("abutted")+"-"+a)}),l.length&&n.push(this.getClass("abutted")),l.forEach(function(a){n.push(b.getClass("abutted")+"-"+a)}),E(function(){b.options.addTargetClasses!==!1&&q(b.target,n,m),q(b.element,n,m)}),!0}});var H=function(){function a(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{!d&&h["return"]&&h["return"]()}finally{if(e)throw f}}return c}return function(b,c){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return a(b,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();return y.modules.push({position:function(a){var b=a.top,c=a.left;if(this.options.shift){var d=this.options.shift;"function"==typeof this.options.shift&&(d=this.options.shift.call(this,{top:b,left:c}));var e=void 0,f=void 0;if("string"==typeof d){d=d.split(" "),d[1]=d[1]||d[0];var g=d,h=H(g,2);e=h[0],f=h[1],e=parseFloat(e,10),f=parseFloat(f,10)}else e=d.top,f=d.left;return b+=e,c+=f,{top:b,left:c}}}}),V}); \ No newline at end of file diff --git a/amd/build/tooltip.min.js b/amd/build/tooltip.min.js new file mode 100644 index 0000000..f0a9374 --- /dev/null +++ b/amd/build/tooltip.min.js @@ -0,0 +1 @@ +define(["exports","./util"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var e=c(b),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},g=function(){function a(a,b){for(var c=0;c
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:[]},n={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"string",constraints:"array"},o={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},p={IN:"in",OUT:"out"},q={HIDE:"hide"+i,HIDDEN:"hidden"+i,SHOW:"show"+i,SHOWN:"shown"+i,INSERTED:"inserted"+i,CLICK:"click"+i,FOCUSIN:"focusin"+i,FOCUSOUT:"focusout"+i,MOUSEENTER:"mouseenter"+i,MOUSELEAVE:"mouseleave"+i},r={FADE:"fade",IN:"in"},s={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},t={element:!1,enabled:!1},u={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},v=function(){function j(a,b){d(this,j),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._tether=null,this.element=a,this.config=this._getConfig(b),this.tip=null,this._setListeners()}return g(j,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(b){if(b){var c=this.constructor.DATA_KEY,d=a(b.currentTarget).data(c);d||(d=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(c,d)),d._activeTrigger.click=!d._activeTrigger.click,d._isWithActiveTrigger()?d._enter(null,d):d._leave(null,d)}else{if(a(this.getTipElement()).hasClass(r.IN))return void this._leave(null,this);this._enter(null,this)}}},{key:"dispose",value:function(){clearTimeout(this._timeout),this.cleanupTether(),a.removeData(this.element,this.constructor.DATA_KEY),a(this.element).off(this.constructor.EVENT_KEY),this.tip&&a(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._tether=null,this.element=null,this.config=null,this.tip=null}},{key:"show",value:function(){var b=this,c=a.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){a(this.element).trigger(c);var d=a.contains(this.element.ownerDocument.documentElement,this.element);if(c.isDefaultPrevented()||!d)return;var f=this.getTipElement(),g=e["default"].getUID(this.constructor.NAME);f.setAttribute("id",g),this.element.setAttribute("aria-describedby",g),this.setContent(),this.config.animation&&a(f).addClass(r.FADE);var h="function"==typeof this.config.placement?this.config.placement.call(this,f,this.element):this.config.placement,i=this._getAttachment(h);a(f).data(this.constructor.DATA_KEY,this).appendTo(document.body),a(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({attachment:i,element:f,target:this.element,classes:t,classPrefix:l,offset:this.config.offset,constraints:this.config.constraints,addTargetClasses:!1}),e["default"].reflow(f),this._tether.position(),a(f).addClass(r.IN);var k=function(){var c=b._hoverState;b._hoverState=null,a(b.element).trigger(b.constructor.Event.SHOWN),c===p.OUT&&b._leave(null,b)};if(e["default"].supportsTransitionEnd()&&a(this.tip).hasClass(r.FADE))return void a(this.tip).one(e["default"].TRANSITION_END,k).emulateTransitionEnd(j._TRANSITION_DURATION);k()}}},{key:"hide",value:function(b){var c=this,d=this.getTipElement(),f=a.Event(this.constructor.Event.HIDE),g=function(){c._hoverState!==p.IN&&d.parentNode&&d.parentNode.removeChild(d),c.element.removeAttribute("aria-describedby"),a(c.element).trigger(c.constructor.Event.HIDDEN),c.cleanupTether(),b&&b()};a(this.element).trigger(f),f.isDefaultPrevented()||(a(d).removeClass(r.IN),e["default"].supportsTransitionEnd()&&a(this.tip).hasClass(r.FADE)?a(d).one(e["default"].TRANSITION_END,g).emulateTransitionEnd(k):g(),this._hoverState="")}},{key:"isWithContent",value:function(){return Boolean(this.getTitle())}},{key:"getTipElement",value:function(){return this.tip=this.tip||a(this.config.template)[0]}},{key:"setContent",value:function(){var b=a(this.getTipElement());this.setElementContent(b.find(s.TOOLTIP_INNER),this.getTitle()),b.removeClass(r.FADE).removeClass(r.IN),this.cleanupTether()}},{key:"setElementContent",value:function(b,c){var d=this.config.html;"object"===("undefined"==typeof c?"undefined":f(c))&&(c.nodeType||c.jquery)?d?a(c).parent().is(b)||b.empty().append(c):b.text(a(c).text()):b[d?"html":"text"](c)}},{key:"getTitle",value:function(){var a=this.element.getAttribute("data-original-title");return a||(a="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),a}},{key:"cleanupTether",value:function(){this._tether&&this._tether.destroy()}},{key:"_getAttachment",value:function(a){return o[a.toUpperCase()]}},{key:"_setListeners",value:function(){var b=this,c=this.config.trigger.split(" ");c.forEach(function(c){if("click"===c)a(b.element).on(b.constructor.Event.CLICK,b.config.selector,a.proxy(b.toggle,b));else if(c!==u.MANUAL){var d=c===u.HOVER?b.constructor.Event.MOUSEENTER:b.constructor.Event.FOCUSIN,e=c===u.HOVER?b.constructor.Event.MOUSELEAVE:b.constructor.Event.FOCUSOUT;a(b.element).on(d,b.config.selector,a.proxy(b._enter,b)).on(e,b.config.selector,a.proxy(b._leave,b))}}),this.config.selector?this.config=a.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()}},{key:"_fixTitle",value:function(){var a=f(this.element.getAttribute("data-original-title"));(this.element.getAttribute("title")||"string"!==a)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))}},{key:"_enter",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusin"===b.type?u.FOCUS:u.HOVER]=!0),a(c.getTipElement()).hasClass(r.IN)||c._hoverState===p.IN?void(c._hoverState=p.IN):(clearTimeout(c._timeout),c._hoverState=p.IN,c.config.delay&&c.config.delay.show?void(c._timeout=setTimeout(function(){c._hoverState===p.IN&&c.show()},c.config.delay.show)):void c.show())}},{key:"_leave",value:function(b,c){var d=this.constructor.DATA_KEY;if(c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusout"===b.type?u.FOCUS:u.HOVER]=!1),!c._isWithActiveTrigger())return clearTimeout(c._timeout),c._hoverState=p.OUT,c.config.delay&&c.config.delay.hide?void(c._timeout=setTimeout(function(){c._hoverState===p.OUT&&c.hide()},c.config.delay.hide)):void c.hide()}},{key:"_isWithActiveTrigger",value:function(){for(var a in this._activeTrigger)if(this._activeTrigger[a])return!0;return!1}},{key:"_getConfig",value:function(c){return c=a.extend({},this.constructor.Default,a(this.element).data(),c),c.delay&&"number"==typeof c.delay&&(c.delay={show:c.delay,hide:c.delay}),e["default"].typeCheckConfig(b,c,this.constructor.DefaultType),c}},{key:"_getDelegateConfig",value:function(){var a={};if(this.config)for(var b in this.config)this.constructor.Default[b]!==this.config[b]&&(a[b]=this.config[b]);return a}}],[{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(h),d="object"===("undefined"==typeof b?"undefined":f(b))?b:null;if((c||!/destroy|hide/.test(b))&&(c||(c=new j(this,d),a(this).data(h,c)),"string"==typeof b)){if(void 0===c[b])throw new Error('No method named "'+b+'"');c[b]()}})}},{key:"VERSION",get:function(){return c}},{key:"Default",get:function(){return m}},{key:"NAME",get:function(){return b}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return q}},{key:"EVENT_KEY",get:function(){return i}},{key:"DefaultType",get:function(){return n}}]),j}();return a.fn[b]=v._jQueryInterface,a.fn[b].Constructor=v,a.fn[b].noConflict=function(){return a.fn[b]=j,v._jQueryInterface},v}(jQuery);a["default"]=h}); \ No newline at end of file diff --git a/amd/build/util.min.js b/amd/build/util.min.js new file mode 100644 index 0000000..df57c9d --- /dev/null +++ b/amd/build/util.min.js @@ -0,0 +1 @@ +define(["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var b=function(a){function b(a){return{}.toString.call(a).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function c(a){return(a[0]||a).nodeType}function d(){return{bindType:h.end,delegateType:h.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}}}function e(){if(window.QUnit)return!1;var a=document.createElement("bootstrap");for(var b in j)if(void 0!==a.style[b])return{end:j[b]};return!1}function f(b){var c=this,d=!1;return a(this).one(k.TRANSITION_END,function(){d=!0}),setTimeout(function(){d||k.triggerTransitionEnd(c)},b),this}function g(){h=e(),a.fn.emulateTransitionEnd=f,k.supportsTransitionEnd()&&(a.event.special[k.TRANSITION_END]=d())}var h=!1,i=1e6,j={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},k={TRANSITION_END:"bsTransitionEnd",getUID:function(a){do a+=~~(Math.random()*i);while(document.getElementById(a));return a},getSelectorFromElement:function(a){var b=a.getAttribute("data-target");return b||(b=a.getAttribute("href")||"",b=/^#[a-z]/i.test(b)?b:null),b},reflow:function(a){new Function("bs","return bs")(a.offsetHeight)},triggerTransitionEnd:function(b){a(b).trigger(h.end)},supportsTransitionEnd:function(){return Boolean(h)},typeCheckConfig:function(a,d,e){for(var f in e)if(e.hasOwnProperty(f)){var g=e[f],h=d[f],i=void 0;if(i=h&&c(h)?"element":b(h),!new RegExp(g).test(i))throw new Error(a.toUpperCase()+": "+('Option "'+f+'" provided type "'+i+'" ')+('but expected type "'+g+'".'))}}};return g(),k}(jQuery);a["default"]=b}); \ No newline at end of file diff --git a/amd/src/alert.js b/amd/src/alert.js new file mode 100644 index 0000000..fcd11d4 --- /dev/null +++ b/amd/src/alert.js @@ -0,0 +1,218 @@ +define(['exports', './util'], function (exports, _util) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _util2 = _interopRequireDefault(_util); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0-alpha.4): alert.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Alert = function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'alert'; + var VERSION = '4.0.0-alpha.4'; + var DATA_KEY = 'bs.alert'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 150; + + var Selector = { + DISMISS: '[data-dismiss="alert"]' + }; + + var Event = { + CLOSE: 'close' + EVENT_KEY, + CLOSED: 'closed' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY + }; + + var ClassName = { + ALERT: 'alert', + FADE: 'fade', + IN: 'in' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Alert = function () { + function Alert(element) { + _classCallCheck(this, Alert); + + this._element = element; + } + + // getters + + _createClass(Alert, [{ + key: 'close', + value: function close(element) { + element = element || this._element; + + var rootElement = this._getRootElement(element); + var customEvent = this._triggerCloseEvent(rootElement); + + if (customEvent.isDefaultPrevented()) { + return; + } + + this._removeElement(rootElement); + } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + this._element = null; + } + }, { + key: '_getRootElement', + value: function _getRootElement(element) { + var selector = _util2.default.getSelectorFromElement(element); + var parent = false; + + if (selector) { + parent = $(selector)[0]; + } + + if (!parent) { + parent = $(element).closest('.' + ClassName.ALERT)[0]; + } + + return parent; + } + }, { + key: '_triggerCloseEvent', + value: function _triggerCloseEvent(element) { + var closeEvent = $.Event(Event.CLOSE); + + $(element).trigger(closeEvent); + return closeEvent; + } + }, { + key: '_removeElement', + value: function _removeElement(element) { + $(element).removeClass(ClassName.IN); + + if (!_util2.default.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) { + this._destroyElement(element); + return; + } + + $(element).one(_util2.default.TRANSITION_END, $.proxy(this._destroyElement, this, element)).emulateTransitionEnd(TRANSITION_DURATION); + } + }, { + key: '_destroyElement', + value: function _destroyElement(element) { + $(element).detach().trigger(Event.CLOSED).remove(); + } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var $element = $(this); + var data = $element.data(DATA_KEY); + + if (!data) { + data = new Alert(this); + $element.data(DATA_KEY, data); + } + + if (config === 'close') { + data[config](this); + } + }); + } + }, { + key: '_handleDismiss', + value: function _handleDismiss(alertInstance) { + return function (event) { + if (event) { + event.preventDefault(); + } + + alertInstance.close(this); + }; + } + }, { + key: 'VERSION', + get: function get() { + return VERSION; + } + }]); + + return Alert; + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Alert._jQueryInterface; + $.fn[NAME].Constructor = Alert; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Alert._jQueryInterface; + }; + + return Alert; + }(jQuery); + + exports.default = Alert; +}); \ No newline at end of file diff --git a/amd/src/button.js b/amd/src/button.js new file mode 100644 index 0000000..20436a1 --- /dev/null +++ b/amd/src/button.js @@ -0,0 +1,195 @@ +define(['exports'], function (exports) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0-alpha.4): button.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Button = function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'button'; + var VERSION = '4.0.0-alpha.4'; + var DATA_KEY = 'bs.button'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + + var ClassName = { + ACTIVE: 'active', + BUTTON: 'btn', + FOCUS: 'focus' + }; + + var Selector = { + DATA_TOGGLE_CARROT: '[data-toggle^="button"]', + DATA_TOGGLE: '[data-toggle="buttons"]', + INPUT: 'input', + ACTIVE: '.active', + BUTTON: '.btn' + }; + + var Event = { + CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY, + FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + DATA_API_KEY) + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Button = function () { + function Button(element) { + _classCallCheck(this, Button); + + this._element = element; + } + + // getters + + _createClass(Button, [{ + key: 'toggle', + value: function toggle() { + var triggerChangeEvent = true; + var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0]; + + if (rootElement) { + var input = $(this._element).find(Selector.INPUT)[0]; + + if (input) { + if (input.type === 'radio') { + if (input.checked && $(this._element).hasClass(ClassName.ACTIVE)) { + triggerChangeEvent = false; + } else { + var activeElement = $(rootElement).find(Selector.ACTIVE)[0]; + + if (activeElement) { + $(activeElement).removeClass(ClassName.ACTIVE); + } + } + } + + if (triggerChangeEvent) { + input.checked = !$(this._element).hasClass(ClassName.ACTIVE); + $(this._element).trigger('change'); + } + + input.focus(); + } + } else { + this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE)); + } + + if (triggerChangeEvent) { + $(this._element).toggleClass(ClassName.ACTIVE); + } + } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + this._element = null; + } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + + if (!data) { + data = new Button(this); + $(this).data(DATA_KEY, data); + } + + if (config === 'toggle') { + data[config](); + } + }); + } + }, { + key: 'VERSION', + get: function get() { + return VERSION; + } + }]); + + return Button; + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { + event.preventDefault(); + + var button = event.target; + + if (!$(button).hasClass(ClassName.BUTTON)) { + button = $(button).closest(Selector.BUTTON); + } + + Button._jQueryInterface.call($(button), 'toggle'); + }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { + var button = $(event.target).closest(Selector.BUTTON)[0]; + $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type)); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Button._jQueryInterface; + $.fn[NAME].Constructor = Button; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Button._jQueryInterface; + }; + + return Button; + }(jQuery); + + exports.default = Button; +}); \ No newline at end of file diff --git a/amd/src/carousel.js b/amd/src/carousel.js new file mode 100644 index 0000000..f57e4d5 --- /dev/null +++ b/amd/src/carousel.js @@ -0,0 +1,514 @@ +define(['exports', './util'], function (exports, _util) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _util2 = _interopRequireDefault(_util); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; + }; + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0-alpha.4): carousel.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Carousel = function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'carousel'; + var VERSION = '4.0.0-alpha.4'; + var DATA_KEY = 'bs.carousel'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 600; + var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key + var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key + + var Default = { + interval: 5000, + keyboard: true, + slide: false, + pause: 'hover', + wrap: true + }; + + var DefaultType = { + interval: '(number|boolean)', + keyboard: 'boolean', + slide: '(boolean|string)', + pause: '(string|boolean)', + wrap: 'boolean' + }; + + var Direction = { + NEXT: 'next', + PREVIOUS: 'prev' + }; + + var Event = { + SLIDE: 'slide' + EVENT_KEY, + SLID: 'slid' + EVENT_KEY, + KEYDOWN: 'keydown' + EVENT_KEY, + MOUSEENTER: 'mouseenter' + EVENT_KEY, + MOUSELEAVE: 'mouseleave' + EVENT_KEY, + LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY + }; + + var ClassName = { + CAROUSEL: 'carousel', + ACTIVE: 'active', + SLIDE: 'slide', + RIGHT: 'right', + LEFT: 'left', + ITEM: 'carousel-item' + }; + + var Selector = { + ACTIVE: '.active', + ACTIVE_ITEM: '.active.carousel-item', + ITEM: '.carousel-item', + NEXT_PREV: '.next, .prev', + INDICATORS: '.carousel-indicators', + DATA_SLIDE: '[data-slide], [data-slide-to]', + DATA_RIDE: '[data-ride="carousel"]' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Carousel = function () { + function Carousel(element, config) { + _classCallCheck(this, Carousel); + + this._items = null; + this._interval = null; + this._activeElement = null; + + this._isPaused = false; + this._isSliding = false; + + this._config = this._getConfig(config); + this._element = $(element)[0]; + this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]; + + this._addEventListeners(); + } + + // getters + + _createClass(Carousel, [{ + key: 'next', + value: function next() { + if (!this._isSliding) { + this._slide(Direction.NEXT); + } + } + }, { + key: 'nextWhenVisible', + value: function nextWhenVisible() { + // Don't call next when the page isn't visible + if (!document.hidden) { + this.next(); + } + } + }, { + key: 'prev', + value: function prev() { + if (!this._isSliding) { + this._slide(Direction.PREVIOUS); + } + } + }, { + key: 'pause', + value: function pause(event) { + if (!event) { + this._isPaused = true; + } + + if ($(this._element).find(Selector.NEXT_PREV)[0] && _util2.default.supportsTransitionEnd()) { + _util2.default.triggerTransitionEnd(this._element); + this.cycle(true); + } + + clearInterval(this._interval); + this._interval = null; + } + }, { + key: 'cycle', + value: function cycle(event) { + if (!event) { + this._isPaused = false; + } + + if (this._interval) { + clearInterval(this._interval); + this._interval = null; + } + + if (this._config.interval && !this._isPaused) { + this._interval = setInterval($.proxy(document.visibilityState ? this.nextWhenVisible : this.next, this), this._config.interval); + } + } + }, { + key: 'to', + value: function to(index) { + var _this = this; + + this._activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; + + var activeIndex = this._getItemIndex(this._activeElement); + + if (index > this._items.length - 1 || index < 0) { + return; + } + + if (this._isSliding) { + $(this._element).one(Event.SLID, function () { + return _this.to(index); + }); + return; + } + + if (activeIndex === index) { + this.pause(); + this.cycle(); + return; + } + + var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS; + + this._slide(direction, this._items[index]); + } + }, { + key: 'dispose', + value: function dispose() { + $(this._element).off(EVENT_KEY); + $.removeData(this._element, DATA_KEY); + + this._items = null; + this._config = null; + this._element = null; + this._interval = null; + this._isPaused = null; + this._isSliding = null; + this._activeElement = null; + this._indicatorsElement = null; + } + }, { + key: '_getConfig', + value: function _getConfig(config) { + config = $.extend({}, Default, config); + _util2.default.typeCheckConfig(NAME, config, DefaultType); + return config; + } + }, { + key: '_addEventListeners', + value: function _addEventListeners() { + if (this._config.keyboard) { + $(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this)); + } + + if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) { + $(this._element).on(Event.MOUSEENTER, $.proxy(this.pause, this)).on(Event.MOUSELEAVE, $.proxy(this.cycle, this)); + } + } + }, { + key: '_keydown', + value: function _keydown(event) { + event.preventDefault(); + + if (/input|textarea/i.test(event.target.tagName)) { + return; + } + + switch (event.which) { + case ARROW_LEFT_KEYCODE: + this.prev(); + break; + case ARROW_RIGHT_KEYCODE: + this.next(); + break; + default: + return; + } + } + }, { + key: '_getItemIndex', + value: function _getItemIndex(element) { + this._items = $.makeArray($(element).parent().find(Selector.ITEM)); + return this._items.indexOf(element); + } + }, { + key: '_getItemByDirection', + value: function _getItemByDirection(direction, activeElement) { + var isNextDirection = direction === Direction.NEXT; + var isPrevDirection = direction === Direction.PREVIOUS; + var activeIndex = this._getItemIndex(activeElement); + var lastItemIndex = this._items.length - 1; + var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; + + if (isGoingToWrap && !this._config.wrap) { + return activeElement; + } + + var delta = direction === Direction.PREVIOUS ? -1 : 1; + var itemIndex = (activeIndex + delta) % this._items.length; + + return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; + } + }, { + key: '_triggerSlideEvent', + value: function _triggerSlideEvent(relatedTarget, directionalClassname) { + var slideEvent = $.Event(Event.SLIDE, { + relatedTarget: relatedTarget, + direction: directionalClassname + }); + + $(this._element).trigger(slideEvent); + + return slideEvent; + } + }, { + key: '_setActiveIndicatorElement', + value: function _setActiveIndicatorElement(element) { + if (this._indicatorsElement) { + $(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE); + + var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; + + if (nextIndicator) { + $(nextIndicator).addClass(ClassName.ACTIVE); + } + } + } + }, { + key: '_slide', + value: function _slide(direction, element) { + var _this2 = this; + + var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; + var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); + + var isCycling = Boolean(this._interval); + + var directionalClassName = direction === Direction.NEXT ? ClassName.LEFT : ClassName.RIGHT; + + if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) { + this._isSliding = false; + return; + } + + var slideEvent = this._triggerSlideEvent(nextElement, directionalClassName); + if (slideEvent.isDefaultPrevented()) { + return; + } + + if (!activeElement || !nextElement) { + // some weirdness is happening, so we bail + return; + } + + this._isSliding = true; + + if (isCycling) { + this.pause(); + } + + this._setActiveIndicatorElement(nextElement); + + var slidEvent = $.Event(Event.SLID, { + relatedTarget: nextElement, + direction: directionalClassName + }); + + if (_util2.default.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) { + + $(nextElement).addClass(direction); + + _util2.default.reflow(nextElement); + + $(activeElement).addClass(directionalClassName); + $(nextElement).addClass(directionalClassName); + + $(activeElement).one(_util2.default.TRANSITION_END, function () { + $(nextElement).removeClass(directionalClassName).removeClass(direction); + + $(nextElement).addClass(ClassName.ACTIVE); + + $(activeElement).removeClass(ClassName.ACTIVE).removeClass(direction).removeClass(directionalClassName); + + _this2._isSliding = false; + + setTimeout(function () { + return $(_this2._element).trigger(slidEvent); + }, 0); + }).emulateTransitionEnd(TRANSITION_DURATION); + } else { + $(activeElement).removeClass(ClassName.ACTIVE); + $(nextElement).addClass(ClassName.ACTIVE); + + this._isSliding = false; + $(this._element).trigger(slidEvent); + } + + if (isCycling) { + this.cycle(); + } + } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = $.extend({}, Default, $(this).data()); + + if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object') { + $.extend(_config, config); + } + + var action = typeof config === 'string' ? config : _config.slide; + + if (!data) { + data = new Carousel(this, _config); + $(this).data(DATA_KEY, data); + } + + if (typeof config === 'number') { + data.to(config); + } else if (typeof action === 'string') { + if (data[action] === undefined) { + throw new Error('No method named "' + action + '"'); + } + data[action](); + } else if (_config.interval) { + data.pause(); + data.cycle(); + } + }); + } + }, { + key: '_dataApiClickHandler', + value: function _dataApiClickHandler(event) { + var selector = _util2.default.getSelectorFromElement(this); + + if (!selector) { + return; + } + + var target = $(selector)[0]; + + if (!target || !$(target).hasClass(ClassName.CAROUSEL)) { + return; + } + + var config = $.extend({}, $(target).data(), $(this).data()); + var slideIndex = this.getAttribute('data-slide-to'); + + if (slideIndex) { + config.interval = false; + } + + Carousel._jQueryInterface.call($(target), config); + + if (slideIndex) { + $(target).data(DATA_KEY).to(slideIndex); + } + + event.preventDefault(); + } + }, { + key: 'VERSION', + get: function get() { + return VERSION; + } + }, { + key: 'Default', + get: function get() { + return Default; + } + }]); + + return Carousel; + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler); + + $(window).on(Event.LOAD_DATA_API, function () { + $(Selector.DATA_RIDE).each(function () { + var $carousel = $(this); + Carousel._jQueryInterface.call($carousel, $carousel.data()); + }); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Carousel._jQueryInterface; + $.fn[NAME].Constructor = Carousel; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Carousel._jQueryInterface; + }; + + return Carousel; + }(jQuery); + + exports.default = Carousel; +}); \ No newline at end of file diff --git a/amd/src/collapse.js b/amd/src/collapse.js new file mode 100644 index 0000000..25cf3cf --- /dev/null +++ b/amd/src/collapse.js @@ -0,0 +1,396 @@ +define(['exports', './util'], function (exports, _util) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _util2 = _interopRequireDefault(_util); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; + }; + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0-alpha.4): collapse.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Collapse = function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'collapse'; + var VERSION = '4.0.0-alpha.4'; + var DATA_KEY = 'bs.collapse'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 600; + + var Default = { + toggle: true, + parent: '' + }; + + var DefaultType = { + toggle: 'boolean', + parent: 'string' + }; + + var Event = { + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY + }; + + var ClassName = { + IN: 'in', + COLLAPSE: 'collapse', + COLLAPSING: 'collapsing', + COLLAPSED: 'collapsed' + }; + + var Dimension = { + WIDTH: 'width', + HEIGHT: 'height' + }; + + var Selector = { + ACTIVES: '.panel > .in, .panel > .collapsing', + DATA_TOGGLE: '[data-toggle="collapse"]' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Collapse = function () { + function Collapse(element, config) { + _classCallCheck(this, Collapse); + + this._isTransitioning = false; + this._element = element; + this._config = this._getConfig(config); + this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]'))); + + this._parent = this._config.parent ? this._getParent() : null; + + if (!this._config.parent) { + this._addAriaAndCollapsedClass(this._element, this._triggerArray); + } + + if (this._config.toggle) { + this.toggle(); + } + } + + // getters + + _createClass(Collapse, [{ + key: 'toggle', + value: function toggle() { + if ($(this._element).hasClass(ClassName.IN)) { + this.hide(); + } else { + this.show(); + } + } + }, { + key: 'show', + value: function show() { + var _this = this; + + if (this._isTransitioning || $(this._element).hasClass(ClassName.IN)) { + return; + } + + var actives = void 0; + var activesData = void 0; + + if (this._parent) { + actives = $.makeArray($(Selector.ACTIVES)); + if (!actives.length) { + actives = null; + } + } + + if (actives) { + activesData = $(actives).data(DATA_KEY); + if (activesData && activesData._isTransitioning) { + return; + } + } + + var startEvent = $.Event(Event.SHOW); + $(this._element).trigger(startEvent); + if (startEvent.isDefaultPrevented()) { + return; + } + + if (actives) { + Collapse._jQueryInterface.call($(actives), 'hide'); + if (!activesData) { + $(actives).data(DATA_KEY, null); + } + } + + var dimension = this._getDimension(); + + $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING); + + this._element.style[dimension] = 0; + this._element.setAttribute('aria-expanded', true); + + if (this._triggerArray.length) { + $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true); + } + + this.setTransitioning(true); + + var complete = function complete() { + $(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.IN); + + _this._element.style[dimension] = ''; + + _this.setTransitioning(false); + + $(_this._element).trigger(Event.SHOWN); + }; + + if (!_util2.default.supportsTransitionEnd()) { + complete(); + return; + } + + var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); + var scrollSize = 'scroll' + capitalizedDimension; + + $(this._element).one(_util2.default.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + + this._element.style[dimension] = this._element[scrollSize] + 'px'; + } + }, { + key: 'hide', + value: function hide() { + var _this2 = this; + + if (this._isTransitioning || !$(this._element).hasClass(ClassName.IN)) { + return; + } + + var startEvent = $.Event(Event.HIDE); + $(this._element).trigger(startEvent); + if (startEvent.isDefaultPrevented()) { + return; + } + + var dimension = this._getDimension(); + var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight'; + + this._element.style[dimension] = this._element[offsetDimension] + 'px'; + + _util2.default.reflow(this._element); + + $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.IN); + + this._element.setAttribute('aria-expanded', false); + + if (this._triggerArray.length) { + $(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false); + } + + this.setTransitioning(true); + + var complete = function complete() { + _this2.setTransitioning(false); + $(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN); + }; + + this._element.style[dimension] = 0; + + if (!_util2.default.supportsTransitionEnd()) { + complete(); + return; + } + + $(this._element).one(_util2.default.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } + }, { + key: 'setTransitioning', + value: function setTransitioning(isTransitioning) { + this._isTransitioning = isTransitioning; + } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + + this._config = null; + this._parent = null; + this._element = null; + this._triggerArray = null; + this._isTransitioning = null; + } + }, { + key: '_getConfig', + value: function _getConfig(config) { + config = $.extend({}, Default, config); + config.toggle = Boolean(config.toggle); // coerce string values + _util2.default.typeCheckConfig(NAME, config, DefaultType); + return config; + } + }, { + key: '_getDimension', + value: function _getDimension() { + var hasWidth = $(this._element).hasClass(Dimension.WIDTH); + return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; + } + }, { + key: '_getParent', + value: function _getParent() { + var _this3 = this; + + var parent = $(this._config.parent)[0]; + var selector = '[data-toggle="collapse"][data-parent="' + this._config.parent + '"]'; + + $(parent).find(selector).each(function (i, element) { + _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); + }); + + return parent; + } + }, { + key: '_addAriaAndCollapsedClass', + value: function _addAriaAndCollapsedClass(element, triggerArray) { + if (element) { + var isOpen = $(element).hasClass(ClassName.IN); + element.setAttribute('aria-expanded', isOpen); + + if (triggerArray.length) { + $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); + } + } + } + }], [{ + key: '_getTargetFromElement', + value: function _getTargetFromElement(element) { + var selector = _util2.default.getSelectorFromElement(element); + return selector ? $(selector)[0] : null; + } + }, { + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var $this = $(this); + var data = $this.data(DATA_KEY); + var _config = $.extend({}, Default, $this.data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config); + + if (!data && _config.toggle && /show|hide/.test(config)) { + _config.toggle = false; + } + + if (!data) { + data = new Collapse(this, _config); + $this.data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error('No method named "' + config + '"'); + } + data[config](); + } + }); + } + }, { + key: 'VERSION', + get: function get() { + return VERSION; + } + }, { + key: 'Default', + get: function get() { + return Default; + } + }]); + + return Collapse; + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + event.preventDefault(); + + var target = Collapse._getTargetFromElement(this); + var data = $(target).data(DATA_KEY); + var config = data ? 'toggle' : $(this).data(); + + Collapse._jQueryInterface.call($(target), config); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Collapse._jQueryInterface; + $.fn[NAME].Constructor = Collapse; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Collapse._jQueryInterface; + }; + + return Collapse; + }(jQuery); + + exports.default = Collapse; +}); \ No newline at end of file diff --git a/amd/src/drawer.js b/amd/src/drawer.js new file mode 100644 index 0000000..f29a7d0 --- /dev/null +++ b/amd/src/drawer.js @@ -0,0 +1,165 @@ +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * Contain the logic for a drawer. + * + * @package theme_ilb + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +define(['jquery', 'core/custom_interaction_events', 'core/log'], + function($, CustomEvents, Log) { + + var SELECTORS = { + TOGGLE_REGION: '[data-region="drawer-toggle"]', + TOGGLE_ACTION: '[data-action="toggle-drawer"]', + TOGGLE_TARGET: 'aria-controls', + TOGGLE_SIDE: 'left', + BODY: 'body' + }; + + /** + * Constructor for the Drawer. + * + * @param {object} root The root jQuery element for the modal + */ + var Drawer = function() { + + if (!$(SELECTORS.TOGGLE_REGION).length) { + Log.debug('Page is missing a drawer region'); + } + if (!$(SELECTORS.TOGGLE_ACTION).length) { + Log.debug('Page is missing a drawer toggle link'); + } + $(SELECTORS.TOGGLE_REGION).each(function(index, ele) { + var trigger = $(ele).find(SELECTORS.TOGGLE_ACTION); + var drawerid = trigger.attr('aria-controls'); + var drawer = $(document.getElementById(drawerid)); + var hidden = trigger.attr('aria-expanded') == 'false'; + var side = trigger.attr('data-side'); + var body = $(SELECTORS.BODY); + + drawer.on('mousewheel DOMMouseScroll', this.preventPageScroll); + + if (!hidden) { + body.addClass('drawer-open-' + side); + trigger.attr('aria-expanded', 'true'); + } else { + trigger.attr('aria-expanded', 'false'); + } + }.bind(this)); + + this.registerEventListeners(); + var small = $(document).width() < 768; + if (small) { + this.closeAll(); + } + }; + + Drawer.prototype.closeAll = function() { + $(SELECTORS.TOGGLE_REGION).each(function(index, ele) { + var trigger = $(ele).find(SELECTORS.TOGGLE_ACTION); + var side = trigger.attr('data-side'); + var body = $(SELECTORS.BODY); + var drawerid = trigger.attr('aria-controls'); + var drawer = $(document.getElementById(drawerid)); + var preference = trigger.attr('data-preference'); + + trigger.attr('aria-expanded', 'false'); + body.removeClass('drawer-open-' + side); + drawer.attr('aria-hidden', 'true'); + drawer.addClass('closed'); + M.util.set_user_preference(preference, 'false'); + }); + }; + + /** + * Open / close the blocks drawer. + * + * @method toggleDrawer + * @param {Event} e + */ + Drawer.prototype.toggleDrawer = function(e) { + var trigger = $(e.target).closest('[data-action=toggle-drawer]'); + var drawerid = trigger.attr('aria-controls'); + var drawer = $(document.getElementById(drawerid)); + var body = $(SELECTORS.BODY); + var side = trigger.attr('data-side'); + var preference = trigger.attr('data-preference'); + + body.addClass('drawer-ease'); + var open = trigger.attr('aria-expanded') == 'true'; + if (!open) { + var small = $(document).width() < 768; + if (small) { + this.closeAll(); + } + // Open. + trigger.attr('aria-expanded', 'true'); + drawer.attr('aria-hidden', 'false'); + drawer.focus(); + body.addClass('drawer-open-' + side); + drawer.removeClass('closed'); + M.util.set_user_preference(preference, 'true'); + } else { + // Close. + body.removeClass('drawer-open-' + side); + trigger.attr('aria-expanded', 'false'); + drawer.attr('aria-hidden', 'true'); + drawer.addClass('closed'); + M.util.set_user_preference(preference, 'false'); + } + }; + + /** + * Prevent the page from scrolling when the drawer is at max scroll. + * + * @method preventPageScroll + * @param {Event} e + */ + Drawer.prototype.preventPageScroll = function(e) { + var delta = e.wheelDelta || (e.originalEvent && e.originalEvent.wheelDelta) || -e.originalEvent.detail, + bottomOverflow = (this.scrollTop + $(this).outerHeight() - this.scrollHeight) >= 0, + topOverflow = this.scrollTop <= 0; + + if ((delta < 0 && bottomOverflow) || (delta > 0 && topOverflow)) { + e.preventDefault(); + } + }; + + /** + * Set up all of the event handling for the modal. + * + * @method registerEventListeners + */ + Drawer.prototype.registerEventListeners = function() { + + $(SELECTORS.TOGGLE_ACTION).each(function(index, element) { + CustomEvents.define($(element), [CustomEvents.events.activate]); + $(element).on(CustomEvents.events.activate, function(e, data) { + this.toggleDrawer(data.originalEvent); + data.originalEvent.preventDefault(); + }.bind(this)); + }.bind(this)); + + }; + + return { + 'init': function() { + return new Drawer(); + } + }; +}); diff --git a/amd/src/dropdown.js b/amd/src/dropdown.js new file mode 100644 index 0000000..6321761 --- /dev/null +++ b/amd/src/dropdown.js @@ -0,0 +1,323 @@ +define(['exports', './util'], function (exports, _util) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _util2 = _interopRequireDefault(_util); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0-alpha.4): dropdown.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Dropdown = function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'dropdown'; + var VERSION = '4.0.0-alpha.4'; + var DATA_KEY = 'bs.dropdown'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key + var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key + var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key + var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) + + var Event = { + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + CLICK: 'click' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY, + KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + DATA_API_KEY + }; + + var ClassName = { + BACKDROP: 'dropdown-backdrop', + DISABLED: 'disabled', + OPEN: 'open' + }; + + var Selector = { + BACKDROP: '.dropdown-backdrop', + DATA_TOGGLE: '[data-toggle="dropdown"]', + FORM_CHILD: '.dropdown form', + ROLE_MENU: '[role="menu"]', + ROLE_LISTBOX: '[role="listbox"]', + NAVBAR_NAV: '.navbar-nav', + VISIBLE_ITEMS: '[role="menu"] li:not(.disabled) a, ' + '[role="listbox"] li:not(.disabled) a' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Dropdown = function () { + function Dropdown(element) { + _classCallCheck(this, Dropdown); + + this._element = element; + + this._addEventListeners(); + } + + // getters + + _createClass(Dropdown, [{ + key: 'toggle', + value: function toggle() { + if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { + return false; + } + + var parent = Dropdown._getParentFromElement(this); + var isActive = $(parent).hasClass(ClassName.OPEN); + + Dropdown._clearMenus(); + + if (isActive) { + return false; + } + + if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) { + + // if mobile we use a backdrop because click events don't delegate + var dropdown = document.createElement('div'); + dropdown.className = ClassName.BACKDROP; + $(dropdown).insertBefore(this); + $(dropdown).on('click', Dropdown._clearMenus); + } + + var relatedTarget = { relatedTarget: this }; + var showEvent = $.Event(Event.SHOW, relatedTarget); + + $(parent).trigger(showEvent); + + if (showEvent.isDefaultPrevented()) { + return false; + } + + this.focus(); + this.setAttribute('aria-expanded', 'true'); + + $(parent).toggleClass(ClassName.OPEN); + $(parent).trigger($.Event(Event.SHOWN, relatedTarget)); + + return false; + } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + $(this._element).off(EVENT_KEY); + this._element = null; + } + }, { + key: '_addEventListeners', + value: function _addEventListeners() { + $(this._element).on(Event.CLICK, this.toggle); + } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + + if (!data) { + $(this).data(DATA_KEY, data = new Dropdown(this)); + } + + if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error('No method named "' + config + '"'); + } + data[config].call(this); + } + }); + } + }, { + key: '_clearMenus', + value: function _clearMenus(event) { + if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) { + return; + } + + var backdrop = $(Selector.BACKDROP)[0]; + if (backdrop) { + backdrop.parentNode.removeChild(backdrop); + } + + var toggles = $.makeArray($(Selector.DATA_TOGGLE)); + + for (var i = 0; i < toggles.length; i++) { + var parent = Dropdown._getParentFromElement(toggles[i]); + var relatedTarget = { relatedTarget: toggles[i] }; + + if (!$(parent).hasClass(ClassName.OPEN)) { + continue; + } + + if (event && event.type === 'click' && /input|textarea/i.test(event.target.tagName) && $.contains(parent, event.target)) { + continue; + } + + var hideEvent = $.Event(Event.HIDE, relatedTarget); + $(parent).trigger(hideEvent); + if (hideEvent.isDefaultPrevented()) { + continue; + } + + toggles[i].setAttribute('aria-expanded', 'false'); + + $(parent).removeClass(ClassName.OPEN).trigger($.Event(Event.HIDDEN, relatedTarget)); + } + } + }, { + key: '_getParentFromElement', + value: function _getParentFromElement(element) { + var parent = void 0; + var selector = _util2.default.getSelectorFromElement(element); + + if (selector) { + parent = $(selector)[0]; + } + + return parent || element.parentNode; + } + }, { + key: '_dataApiKeydownHandler', + value: function _dataApiKeydownHandler(event) { + if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) { + return; + } + + event.preventDefault(); + event.stopPropagation(); + + if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { + return; + } + + var parent = Dropdown._getParentFromElement(this); + var isActive = $(parent).hasClass(ClassName.OPEN); + + if (!isActive && event.which !== ESCAPE_KEYCODE || isActive && event.which === ESCAPE_KEYCODE) { + + if (event.which === ESCAPE_KEYCODE) { + var toggle = $(parent).find(Selector.DATA_TOGGLE)[0]; + $(toggle).trigger('focus'); + } + + $(this).trigger('click'); + return; + } + + var items = $.makeArray($(Selector.VISIBLE_ITEMS)); + + items = items.filter(function (item) { + return item.offsetWidth || item.offsetHeight; + }); + + if (!items.length) { + return; + } + + var index = items.indexOf(event.target); + + if (event.which === ARROW_UP_KEYCODE && index > 0) { + // up + index--; + } + + if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { + // down + index++; + } + + if (index < 0) { + index = 0; + } + + items[index].focus(); + } + }, { + key: 'VERSION', + get: function get() { + return VERSION; + } + }]); + + return Dropdown; + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) { + e.stopPropagation(); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Dropdown._jQueryInterface; + $.fn[NAME].Constructor = Dropdown; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Dropdown._jQueryInterface; + }; + + return Dropdown; + }(jQuery); + + exports.default = Dropdown; +}); \ No newline at end of file diff --git a/amd/src/form-display-errors.js b/amd/src/form-display-errors.js new file mode 100644 index 0000000..f9f8cf9 --- /dev/null +++ b/amd/src/form-display-errors.js @@ -0,0 +1,65 @@ +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * Custom form error event handler to manipulate the bootstrap markup and show + * nicely styled errors in an mform. + * + * @module theme_ilb/form-display-errors + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +define(['jquery', 'core/event'], function($, Event) { + return { + enhance: function(elementid) { + var element = document.getElementById(elementid); + $(element).on(Event.Events.FORM_FIELD_VALIDATION, function(event, msg) { + event.preventDefault(); + var parent = $(element).closest('.form-group'); + var feedback = parent.find('.form-control-feedback'); + + // Sometimes (atto) we have a hidden textarea backed by a real contenteditable div. + if (($(element).prop("tagName") == 'TEXTAREA') && parent.find('[contenteditable]')) { + element = parent.find('[contenteditable]'); + } + if (msg !== '') { + parent.addClass('has-danger'); + parent.data('client-validation-error', true); + $(element).addClass('form-control-danger'); + $(element).attr('aria-describedby', feedback.attr('id')); + $(element).attr('aria-invalid', true); + feedback.attr('tabindex', 0); + feedback.html(msg); + + // Only display and focus when the error was not already visible. + if (!feedback.is(':visible')) { + feedback.show(); + feedback.focus(); + } + + } else { + if (parent.data('client-validation-error') === true) { + parent.removeClass('has-danger'); + parent.data('client-validation-error', false); + $(element).removeClass('form-control-danger'); + $(element).removeAttr('aria-describedby'); + $(element).attr('aria-invalid', false); + feedback.hide(); + } + } + }); + } + }; +}); diff --git a/amd/src/loader.js b/amd/src/loader.js new file mode 100644 index 0000000..bcf8f14 --- /dev/null +++ b/amd/src/loader.js @@ -0,0 +1,62 @@ +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * Template renderer for Moodle. Load and render Moodle templates with Mustache. + * + * @module core/templates + * @package core + * @class templates + * @copyright 2015 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since 2.9 + */ +define(['jquery', './tether', 'core/event'], function(jQuery, Tether, Event) { + + window.jQuery = jQuery; + window.Tether = Tether; + + require(['theme_ilb/util', + 'theme_ilb/alert', + 'theme_ilb/button', + 'theme_ilb/carousel', + 'theme_ilb/collapse', + 'theme_ilb/dropdown', + 'theme_ilb/modal', + 'theme_ilb/scrollspy', + 'theme_ilb/tab', + 'theme_ilb/tooltip', + 'theme_ilb/popover'], + function() { + + jQuery('body').popover({ + selector: '[data-toggle="popover"]', + trigger: 'focus' + }); + + // We need to call popover automatically if nodes are added to the page later. + Event.getLegacyEvents().done(function(events) { + jQuery(document).on(events.FILTER_CONTENT_UPDATED, function() { + jQuery('body').popover({ + selector: '[data-toggle="popover"]', + trigger: 'focus' + }); + }); + }); + }); + + + return {}; +}); diff --git a/amd/src/modal.js b/amd/src/modal.js new file mode 100644 index 0000000..195e718 --- /dev/null +++ b/amd/src/modal.js @@ -0,0 +1,559 @@ +define(['exports', './util'], function (exports, _util) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _util2 = _interopRequireDefault(_util); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; + }; + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0-alpha.4): modal.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Modal = function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'modal'; + var VERSION = '4.0.0-alpha.4'; + var DATA_KEY = 'bs.modal'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 300; + var BACKDROP_TRANSITION_DURATION = 150; + var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key + + var Default = { + backdrop: true, + keyboard: true, + focus: true, + show: true + }; + + var DefaultType = { + backdrop: '(boolean|string)', + keyboard: 'boolean', + focus: 'boolean', + show: 'boolean' + }; + + var Event = { + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + FOCUSIN: 'focusin' + EVENT_KEY, + RESIZE: 'resize' + EVENT_KEY, + CLICK_DISMISS: 'click.dismiss' + EVENT_KEY, + KEYDOWN_DISMISS: 'keydown.dismiss' + EVENT_KEY, + MOUSEUP_DISMISS: 'mouseup.dismiss' + EVENT_KEY, + MOUSEDOWN_DISMISS: 'mousedown.dismiss' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY + }; + + var ClassName = { + SCROLLBAR_MEASURER: 'modal-scrollbar-measure', + BACKDROP: 'modal-backdrop', + OPEN: 'modal-open', + FADE: 'fade', + IN: 'in' + }; + + var Selector = { + DIALOG: '.modal-dialog', + DATA_TOGGLE: '[data-toggle="modal"]', + DATA_DISMISS: '[data-dismiss="modal"]', + FIXED_CONTENT: '.navbar-fixed-top, .navbar-fixed-bottom, .is-fixed' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Modal = function () { + function Modal(element, config) { + _classCallCheck(this, Modal); + + this._config = this._getConfig(config); + this._element = element; + this._dialog = $(element).find(Selector.DIALOG)[0]; + this._backdrop = null; + this._isShown = false; + this._isBodyOverflowing = false; + this._ignoreBackdropClick = false; + this._originalBodyPadding = 0; + this._scrollbarWidth = 0; + } + + // getters + + _createClass(Modal, [{ + key: 'toggle', + value: function toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget); + } + }, { + key: 'show', + value: function show(relatedTarget) { + var _this = this; + + var showEvent = $.Event(Event.SHOW, { + relatedTarget: relatedTarget + }); + + $(this._element).trigger(showEvent); + + if (this._isShown || showEvent.isDefaultPrevented()) { + return; + } + + this._isShown = true; + + this._checkScrollbar(); + this._setScrollbar(); + + $(document.body).addClass(ClassName.OPEN); + + this._setEscapeEvent(); + this._setResizeEvent(); + + $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this)); + + $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () { + $(_this._element).one(Event.MOUSEUP_DISMISS, function (event) { + if ($(event.target).is(_this._element)) { + _this._ignoreBackdropClick = true; + } + }); + }); + + this._showBackdrop($.proxy(this._showElement, this, relatedTarget)); + } + }, { + key: 'hide', + value: function hide(event) { + if (event) { + event.preventDefault(); + } + + var hideEvent = $.Event(Event.HIDE); + + $(this._element).trigger(hideEvent); + + if (!this._isShown || hideEvent.isDefaultPrevented()) { + return; + } + + this._isShown = false; + + this._setEscapeEvent(); + this._setResizeEvent(); + + $(document).off(Event.FOCUSIN); + + $(this._element).removeClass(ClassName.IN); + + $(this._element).off(Event.CLICK_DISMISS); + $(this._dialog).off(Event.MOUSEDOWN_DISMISS); + + if (_util2.default.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { + + $(this._element).one(_util2.default.TRANSITION_END, $.proxy(this._hideModal, this)).emulateTransitionEnd(TRANSITION_DURATION); + } else { + this._hideModal(); + } + } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + + $(window).off(EVENT_KEY); + $(document).off(EVENT_KEY); + $(this._element).off(EVENT_KEY); + $(this._backdrop).off(EVENT_KEY); + + this._config = null; + this._element = null; + this._dialog = null; + this._backdrop = null; + this._isShown = null; + this._isBodyOverflowing = null; + this._ignoreBackdropClick = null; + this._originalBodyPadding = null; + this._scrollbarWidth = null; + } + }, { + key: '_getConfig', + value: function _getConfig(config) { + config = $.extend({}, Default, config); + _util2.default.typeCheckConfig(NAME, config, DefaultType); + return config; + } + }, { + key: '_showElement', + value: function _showElement(relatedTarget) { + var _this2 = this; + + var transition = _util2.default.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE); + + if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { + // don't move modals dom position + document.body.appendChild(this._element); + } + + this._element.style.display = 'block'; + this._element.removeAttribute('aria-hidden'); + this._element.scrollTop = 0; + + if (transition) { + _util2.default.reflow(this._element); + } + + $(this._element).addClass(ClassName.IN); + + if (this._config.focus) { + this._enforceFocus(); + } + + var shownEvent = $.Event(Event.SHOWN, { + relatedTarget: relatedTarget + }); + + var transitionComplete = function transitionComplete() { + if (_this2._config.focus) { + _this2._element.focus(); + } + $(_this2._element).trigger(shownEvent); + }; + + if (transition) { + $(this._dialog).one(_util2.default.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + transitionComplete(); + } + } + }, { + key: '_enforceFocus', + value: function _enforceFocus() { + var _this3 = this; + + $(document).off(Event.FOCUSIN) // guard against infinite focus loop + .on(Event.FOCUSIN, function (event) { + if (document !== event.target && _this3._element !== event.target && !$(_this3._element).has(event.target).length) { + _this3._element.focus(); + } + }); + } + }, { + key: '_setEscapeEvent', + value: function _setEscapeEvent() { + var _this4 = this; + + if (this._isShown && this._config.keyboard) { + $(this._element).on(Event.KEYDOWN_DISMISS, function (event) { + if (event.which === ESCAPE_KEYCODE) { + _this4.hide(); + } + }); + } else if (!this._isShown) { + $(this._element).off(Event.KEYDOWN_DISMISS); + } + } + }, { + key: '_setResizeEvent', + value: function _setResizeEvent() { + if (this._isShown) { + $(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this)); + } else { + $(window).off(Event.RESIZE); + } + } + }, { + key: '_hideModal', + value: function _hideModal() { + var _this5 = this; + + this._element.style.display = 'none'; + this._element.setAttribute('aria-hidden', 'true'); + this._showBackdrop(function () { + $(document.body).removeClass(ClassName.OPEN); + _this5._resetAdjustments(); + _this5._resetScrollbar(); + $(_this5._element).trigger(Event.HIDDEN); + }); + } + }, { + key: '_removeBackdrop', + value: function _removeBackdrop() { + if (this._backdrop) { + $(this._backdrop).remove(); + this._backdrop = null; + } + } + }, { + key: '_showBackdrop', + value: function _showBackdrop(callback) { + var _this6 = this; + + var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : ''; + + if (this._isShown && this._config.backdrop) { + var doAnimate = _util2.default.supportsTransitionEnd() && animate; + + this._backdrop = document.createElement('div'); + this._backdrop.className = ClassName.BACKDROP; + + if (animate) { + $(this._backdrop).addClass(animate); + } + + $(this._backdrop).appendTo(document.body); + + $(this._element).on(Event.CLICK_DISMISS, function (event) { + if (_this6._ignoreBackdropClick) { + _this6._ignoreBackdropClick = false; + return; + } + if (event.target !== event.currentTarget) { + return; + } + if (_this6._config.backdrop === 'static') { + _this6._element.focus(); + } else { + _this6.hide(); + } + }); + + if (doAnimate) { + _util2.default.reflow(this._backdrop); + } + + $(this._backdrop).addClass(ClassName.IN); + + if (!callback) { + return; + } + + if (!doAnimate) { + callback(); + return; + } + + $(this._backdrop).one(_util2.default.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION); + } else if (!this._isShown && this._backdrop) { + $(this._backdrop).removeClass(ClassName.IN); + + var callbackRemove = function callbackRemove() { + _this6._removeBackdrop(); + if (callback) { + callback(); + } + }; + + if (_util2.default.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { + $(this._backdrop).one(_util2.default.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION); + } else { + callbackRemove(); + } + } else if (callback) { + callback(); + } + } + }, { + key: '_handleUpdate', + value: function _handleUpdate() { + this._adjustDialog(); + } + }, { + key: '_adjustDialog', + value: function _adjustDialog() { + var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + + if (!this._isBodyOverflowing && isModalOverflowing) { + this._element.style.paddingLeft = this._scrollbarWidth + 'px'; + } + + if (this._isBodyOverflowing && !isModalOverflowing) { + this._element.style.paddingRight = this._scrollbarWidth + 'px'; + } + } + }, { + key: '_resetAdjustments', + value: function _resetAdjustments() { + this._element.style.paddingLeft = ''; + this._element.style.paddingRight = ''; + } + }, { + key: '_checkScrollbar', + value: function _checkScrollbar() { + this._isBodyOverflowing = document.body.clientWidth < window.innerWidth; + this._scrollbarWidth = this._getScrollbarWidth(); + } + }, { + key: '_setScrollbar', + value: function _setScrollbar() { + var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10); + + this._originalBodyPadding = document.body.style.paddingRight || ''; + + if (this._isBodyOverflowing) { + document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px'; + } + } + }, { + key: '_resetScrollbar', + value: function _resetScrollbar() { + document.body.style.paddingRight = this._originalBodyPadding; + } + }, { + key: '_getScrollbarWidth', + value: function _getScrollbarWidth() { + // thx d.walsh + var scrollDiv = document.createElement('div'); + scrollDiv.className = ClassName.SCROLLBAR_MEASURER; + document.body.appendChild(scrollDiv); + var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; + document.body.removeChild(scrollDiv); + return scrollbarWidth; + } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config, relatedTarget) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = $.extend({}, Modal.Default, $(this).data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config); + + if (!data) { + data = new Modal(this, _config); + $(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error('No method named "' + config + '"'); + } + data[config](relatedTarget); + } else if (_config.show) { + data.show(relatedTarget); + } + }); + } + }, { + key: 'VERSION', + get: function get() { + return VERSION; + } + }, { + key: 'Default', + get: function get() { + return Default; + } + }]); + + return Modal; + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + var _this7 = this; + + var target = void 0; + var selector = _util2.default.getSelectorFromElement(this); + + if (selector) { + target = $(selector)[0]; + } + + var config = $(target).data(DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data()); + + if (this.tagName === 'A') { + event.preventDefault(); + } + + var $target = $(target).one(Event.SHOW, function (showEvent) { + if (showEvent.isDefaultPrevented()) { + // only register focus restorer if modal will actually get shown + return; + } + + $target.one(Event.HIDDEN, function () { + if ($(_this7).is(':visible')) { + _this7.focus(); + } + }); + }); + + Modal._jQueryInterface.call($(target), config, this); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Modal._jQueryInterface; + $.fn[NAME].Constructor = Modal; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Modal._jQueryInterface; + }; + + return Modal; + }(jQuery); + + exports.default = Modal; +}); \ No newline at end of file diff --git a/amd/src/popover.js b/amd/src/popover.js new file mode 100644 index 0000000..df8b147 --- /dev/null +++ b/amd/src/popover.js @@ -0,0 +1,250 @@ +define(['exports', './tooltip'], function (exports, _tooltip) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _tooltip2 = _interopRequireDefault(_tooltip); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; + }; + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0-alpha.4): popover.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Popover = function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'popover'; + var VERSION = '4.0.0-alpha.4'; + var DATA_KEY = 'bs.popover'; + var EVENT_KEY = '.' + DATA_KEY; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + + var Default = $.extend({}, _tooltip2.default.Default, { + placement: 'right', + trigger: 'click', + content: '', + template: '' + }); + + var DefaultType = $.extend({}, _tooltip2.default.DefaultType, { + content: '(string|element|function)' + }); + + var ClassName = { + FADE: 'fade', + IN: 'in' + }; + + var Selector = { + TITLE: '.popover-title', + CONTENT: '.popover-content', + ARROW: '.popover-arrow' + }; + + var Event = { + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + INSERTED: 'inserted' + EVENT_KEY, + CLICK: 'click' + EVENT_KEY, + FOCUSIN: 'focusin' + EVENT_KEY, + FOCUSOUT: 'focusout' + EVENT_KEY, + MOUSEENTER: 'mouseenter' + EVENT_KEY, + MOUSELEAVE: 'mouseleave' + EVENT_KEY + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Popover = function (_Tooltip) { + _inherits(Popover, _Tooltip); + + function Popover() { + _classCallCheck(this, Popover); + + return _possibleConstructorReturn(this, (Popover.__proto__ || Object.getPrototypeOf(Popover)).apply(this, arguments)); + } + + _createClass(Popover, [{ + key: 'isWithContent', + value: function isWithContent() { + return this.getTitle() || this._getContent(); + } + }, { + key: 'getTipElement', + value: function getTipElement() { + return this.tip = this.tip || $(this.config.template)[0]; + } + }, { + key: 'setContent', + value: function setContent() { + var $tip = $(this.getTipElement()); + + // we use append for html objects to maintain js events + this.setElementContent($tip.find(Selector.TITLE), this.getTitle()); + this.setElementContent($tip.find(Selector.CONTENT), this._getContent()); + + $tip.removeClass(ClassName.FADE).removeClass(ClassName.IN); + + this.cleanupTether(); + } + }, { + key: '_getContent', + value: function _getContent() { + return this.element.getAttribute('data-content') || (typeof this.config.content === 'function' ? this.config.content.call(this.element) : this.config.content); + } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null; + + if (!data && /destroy|hide/.test(config)) { + return; + } + + if (!data) { + data = new Popover(this, _config); + $(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error('No method named "' + config + '"'); + } + data[config](); + } + }); + } + }, { + key: 'VERSION', + get: function get() { + return VERSION; + } + }, { + key: 'Default', + get: function get() { + return Default; + } + }, { + key: 'NAME', + get: function get() { + return NAME; + } + }, { + key: 'DATA_KEY', + get: function get() { + return DATA_KEY; + } + }, { + key: 'Event', + get: function get() { + return Event; + } + }, { + key: 'EVENT_KEY', + get: function get() { + return EVENT_KEY; + } + }, { + key: 'DefaultType', + get: function get() { + return DefaultType; + } + }]); + + return Popover; + }(_tooltip2.default); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Popover._jQueryInterface; + $.fn[NAME].Constructor = Popover; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Popover._jQueryInterface; + }; + + return Popover; + }(jQuery); + + exports.default = Popover; +}); \ No newline at end of file diff --git a/amd/src/scrollspy.js b/amd/src/scrollspy.js new file mode 100644 index 0000000..ef92b2d --- /dev/null +++ b/amd/src/scrollspy.js @@ -0,0 +1,353 @@ +define(['exports', './util'], function (exports, _util) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _util2 = _interopRequireDefault(_util); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; + }; + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0-alpha.4): scrollspy.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var ScrollSpy = function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'scrollspy'; + var VERSION = '4.0.0-alpha.4'; + var DATA_KEY = 'bs.scrollspy'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + + var Default = { + offset: 10, + method: 'auto', + target: '' + }; + + var DefaultType = { + offset: 'number', + method: 'string', + target: '(string|element)' + }; + + var Event = { + ACTIVATE: 'activate' + EVENT_KEY, + SCROLL: 'scroll' + EVENT_KEY, + LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY + }; + + var ClassName = { + DROPDOWN_ITEM: 'dropdown-item', + DROPDOWN_MENU: 'dropdown-menu', + NAV_LINK: 'nav-link', + NAV: 'nav', + ACTIVE: 'active' + }; + + var Selector = { + DATA_SPY: '[data-spy="scroll"]', + ACTIVE: '.active', + LIST_ITEM: '.list-item', + LI: 'li', + LI_DROPDOWN: 'li.dropdown', + NAV_LINKS: '.nav-link', + DROPDOWN: '.dropdown', + DROPDOWN_ITEMS: '.dropdown-item', + DROPDOWN_TOGGLE: '.dropdown-toggle' + }; + + var OffsetMethod = { + OFFSET: 'offset', + POSITION: 'position' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var ScrollSpy = function () { + function ScrollSpy(element, config) { + _classCallCheck(this, ScrollSpy); + + this._element = element; + this._scrollElement = element.tagName === 'BODY' ? window : element; + this._config = this._getConfig(config); + this._selector = this._config.target + ' ' + Selector.NAV_LINKS + ',' + (this._config.target + ' ' + Selector.DROPDOWN_ITEMS); + this._offsets = []; + this._targets = []; + this._activeTarget = null; + this._scrollHeight = 0; + + $(this._scrollElement).on(Event.SCROLL, $.proxy(this._process, this)); + + this.refresh(); + this._process(); + } + + // getters + + _createClass(ScrollSpy, [{ + key: 'refresh', + value: function refresh() { + var _this = this; + + var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET; + + var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; + + var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; + + this._offsets = []; + this._targets = []; + + this._scrollHeight = this._getScrollHeight(); + + var targets = $.makeArray($(this._selector)); + + targets.map(function (element) { + var target = void 0; + var targetSelector = _util2.default.getSelectorFromElement(element); + + if (targetSelector) { + target = $(targetSelector)[0]; + } + + if (target && (target.offsetWidth || target.offsetHeight)) { + // todo (fat): remove sketch reliance on jQuery position/offset + return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; + } + return null; + }).filter(function (item) { + return item; + }).sort(function (a, b) { + return a[0] - b[0]; + }).forEach(function (item) { + _this._offsets.push(item[0]); + _this._targets.push(item[1]); + }); + } + }, { + key: 'dispose', + value: function dispose() { + $.removeData(this._element, DATA_KEY); + $(this._scrollElement).off(EVENT_KEY); + + this._element = null; + this._scrollElement = null; + this._config = null; + this._selector = null; + this._offsets = null; + this._targets = null; + this._activeTarget = null; + this._scrollHeight = null; + } + }, { + key: '_getConfig', + value: function _getConfig(config) { + config = $.extend({}, Default, config); + + if (typeof config.target !== 'string') { + var id = $(config.target).attr('id'); + if (!id) { + id = _util2.default.getUID(NAME); + $(config.target).attr('id', id); + } + config.target = '#' + id; + } + + _util2.default.typeCheckConfig(NAME, config, DefaultType); + + return config; + } + }, { + key: '_getScrollTop', + value: function _getScrollTop() { + return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop; + } + }, { + key: '_getScrollHeight', + value: function _getScrollHeight() { + return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); + } + }, { + key: '_process', + value: function _process() { + var scrollTop = this._getScrollTop() + this._config.offset; + var scrollHeight = this._getScrollHeight(); + var maxScroll = this._config.offset + scrollHeight - this._scrollElement.offsetHeight; + + if (this._scrollHeight !== scrollHeight) { + this.refresh(); + } + + if (scrollTop >= maxScroll) { + var target = this._targets[this._targets.length - 1]; + + if (this._activeTarget !== target) { + this._activate(target); + } + } + + if (this._activeTarget && scrollTop < this._offsets[0]) { + this._activeTarget = null; + this._clear(); + return; + } + + for (var i = this._offsets.length; i--;) { + var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (this._offsets[i + 1] === undefined || scrollTop < this._offsets[i + 1]); + + if (isActiveTarget) { + this._activate(this._targets[i]); + } + } + } + }, { + key: '_activate', + value: function _activate(target) { + this._activeTarget = target; + + this._clear(); + + var queries = this._selector.split(','); + queries = queries.map(function (selector) { + return selector + '[data-target="' + target + '"],' + (selector + '[href="' + target + '"]'); + }); + + var $link = $(queries.join(',')); + + if ($link.hasClass(ClassName.DROPDOWN_ITEM)) { + $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); + $link.addClass(ClassName.ACTIVE); + } else { + // todo (fat) this is kinda sus... + // recursively add actives to tested nav-links + $link.parents(Selector.LI).find(Selector.NAV_LINKS).addClass(ClassName.ACTIVE); + } + + $(this._scrollElement).trigger(Event.ACTIVATE, { + relatedTarget: target + }); + } + }, { + key: '_clear', + value: function _clear() { + $(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE); + } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var data = $(this).data(DATA_KEY); + var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config || null; + + if (!data) { + data = new ScrollSpy(this, _config); + $(this).data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error('No method named "' + config + '"'); + } + data[config](); + } + }); + } + }, { + key: 'VERSION', + get: function get() { + return VERSION; + } + }, { + key: 'Default', + get: function get() { + return Default; + } + }]); + + return ScrollSpy; + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(window).on(Event.LOAD_DATA_API, function () { + var scrollSpys = $.makeArray($(Selector.DATA_SPY)); + + for (var i = scrollSpys.length; i--;) { + var $spy = $(scrollSpys[i]); + ScrollSpy._jQueryInterface.call($spy, $spy.data()); + } + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = ScrollSpy._jQueryInterface; + $.fn[NAME].Constructor = ScrollSpy; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return ScrollSpy._jQueryInterface; + }; + + return ScrollSpy; + }(jQuery); + + exports.default = ScrollSpy; +}); \ No newline at end of file diff --git a/amd/src/tab.js b/amd/src/tab.js new file mode 100644 index 0000000..cb91677 --- /dev/null +++ b/amd/src/tab.js @@ -0,0 +1,289 @@ +define(['exports', './util'], function (exports, _util) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _util2 = _interopRequireDefault(_util); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + /** + * -------------------------------------------------------------------------- + * Bootstrap (v4.0.0-alpha.4): tab.js + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * -------------------------------------------------------------------------- + */ + + var Tab = function ($) { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + + var NAME = 'tab'; + var VERSION = '4.0.0-alpha.4'; + var DATA_KEY = 'bs.tab'; + var EVENT_KEY = '.' + DATA_KEY; + var DATA_API_KEY = '.data-api'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + var TRANSITION_DURATION = 150; + + var Event = { + HIDE: 'hide' + EVENT_KEY, + HIDDEN: 'hidden' + EVENT_KEY, + SHOW: 'show' + EVENT_KEY, + SHOWN: 'shown' + EVENT_KEY, + CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY + }; + + var ClassName = { + DROPDOWN_MENU: 'dropdown-menu', + ACTIVE: 'active', + FADE: 'fade', + IN: 'in' + }; + + var Selector = { + A: 'a', + LI: 'li', + DROPDOWN: '.dropdown', + UL: 'ul:not(.dropdown-menu)', + FADE_CHILD: '> .nav-item .fade, > .fade', + ACTIVE: '.active', + ACTIVE_CHILD: '> .nav-item > .active, > .active', + DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"]', + DROPDOWN_TOGGLE: '.dropdown-toggle', + DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active' + }; + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + var Tab = function () { + function Tab(element) { + _classCallCheck(this, Tab); + + this._element = element; + } + + // getters + + _createClass(Tab, [{ + key: 'show', + value: function show() { + var _this = this; + + if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName.ACTIVE)) { + return; + } + + var target = void 0; + var previous = void 0; + var ulElement = $(this._element).closest(Selector.UL)[0]; + var selector = _util2.default.getSelectorFromElement(this._element); + + if (ulElement) { + previous = $.makeArray($(ulElement).find(Selector.ACTIVE)); + previous = previous[previous.length - 1]; + } + + var hideEvent = $.Event(Event.HIDE, { + relatedTarget: this._element + }); + + var showEvent = $.Event(Event.SHOW, { + relatedTarget: previous + }); + + if (previous) { + $(previous).trigger(hideEvent); + } + + $(this._element).trigger(showEvent); + + if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { + return; + } + + if (selector) { + target = $(selector)[0]; + } + + this._activate(this._element, ulElement); + + var complete = function complete() { + var hiddenEvent = $.Event(Event.HIDDEN, { + relatedTarget: _this._element + }); + + var shownEvent = $.Event(Event.SHOWN, { + relatedTarget: previous + }); + + $(previous).trigger(hiddenEvent); + $(_this._element).trigger(shownEvent); + }; + + if (target) { + this._activate(target, target.parentNode, complete); + } else { + complete(); + } + } + }, { + key: 'dispose', + value: function dispose() { + $.removeClass(this._element, DATA_KEY); + this._element = null; + } + }, { + key: '_activate', + value: function _activate(element, container, callback) { + var active = $(container).find(Selector.ACTIVE_CHILD)[0]; + var isTransitioning = callback && _util2.default.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0])); + + var complete = $.proxy(this._transitionComplete, this, element, active, isTransitioning, callback); + + if (active && isTransitioning) { + $(active).one(_util2.default.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); + } else { + complete(); + } + + if (active) { + $(active).removeClass(ClassName.IN); + } + } + }, { + key: '_transitionComplete', + value: function _transitionComplete(element, active, isTransitioning, callback) { + if (active) { + $(active).removeClass(ClassName.ACTIVE); + + var dropdownChild = $(active).find(Selector.DROPDOWN_ACTIVE_CHILD)[0]; + + if (dropdownChild) { + $(dropdownChild).removeClass(ClassName.ACTIVE); + } + + active.setAttribute('aria-expanded', false); + } + + $(element).addClass(ClassName.ACTIVE); + element.setAttribute('aria-expanded', true); + + if (isTransitioning) { + _util2.default.reflow(element); + $(element).addClass(ClassName.IN); + } else { + $(element).removeClass(ClassName.FADE); + } + + if (element.parentNode && $(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) { + + var dropdownElement = $(element).closest(Selector.DROPDOWN)[0]; + if (dropdownElement) { + $(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); + } + + element.setAttribute('aria-expanded', true); + } + + if (callback) { + callback(); + } + } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + return this.each(function () { + var $this = $(this); + var data = $this.data(DATA_KEY); + + if (!data) { + data = data = new Tab(this); + $this.data(DATA_KEY, data); + } + + if (typeof config === 'string') { + if (data[config] === undefined) { + throw new Error('No method named "' + config + '"'); + } + data[config](); + } + }); + } + }, { + key: 'VERSION', + get: function get() { + return VERSION; + } + }]); + + return Tab; + }(); + + /** + * ------------------------------------------------------------------------ + * Data Api implementation + * ------------------------------------------------------------------------ + */ + + $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + event.preventDefault(); + Tab._jQueryInterface.call($(this), 'show'); + }); + + /** + * ------------------------------------------------------------------------ + * jQuery + * ------------------------------------------------------------------------ + */ + + $.fn[NAME] = Tab._jQueryInterface; + $.fn[NAME].Constructor = Tab; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Tab._jQueryInterface; + }; + + return Tab; + }(jQuery); + + exports.default = Tab; +}); \ No newline at end of file diff --git a/amd/src/tether.js b/amd/src/tether.js new file mode 100644 index 0000000..f61b90e --- /dev/null +++ b/amd/src/tether.js @@ -0,0 +1,1792 @@ +/*! tether 1.3.3 */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + define(factory); + } else if (typeof exports === 'object') { + module.exports = factory(require, exports, module); + } else { + root.Tether = factory(); + } +}(this, function(require, exports, module) { + +'use strict'; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +var TetherBase = undefined; +if (typeof TetherBase === 'undefined') { + TetherBase = { modules: [] }; +} + +var zeroElement = null; + +// Same as native getBoundingClientRect, except it takes into account parent offsets +// if the element lies within a nested document ( or + + + + {{^username}} +
+
+
+

ACESSO

+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+ + +
+
+
+ +
+ +
+
+
+
+ + {{/username}} + + {{#username}} + + {{#cpf2}} + {{! Inserir modal do aviso caso o CPF seja duplicado e válido e o login foi migrado }} + + {{/cpf2}} + + {{#cpf3}} + {{! Inserir modal do aviso caso o CPF seja duplicado e inválido, o usuário foi cancelado }} + + {{/cpf3}} + + + + {{#loginChangeNotification}} + + + + + + + + {{/loginChangeNotification}} + + +
+
+

Bem-vindo ao Saberes!

+
+

+ Nome +
+ {{{ firstname }}} {{{ lastname }}} +

+
+
+ Foto do Perfil +
+ + +
+ Sair +
+
+
+ +{{/username}} +
+
+
+
+ +
+
+
+
+
+

Categoria de cursos

+
+
+
+
+
+ +

Cursos on-line sem tutoria

+
+
+ +

Cursos on-line com tutoria

+
+
+ +

Formação interna

+
+
+ +

Pós-graduação

+
+
+ +

Oficinas Interlegis

+
+
+ +

Videoaulas

+
+
+ +

Projetos Especiais

+
+
+ +

Conheça o Senado

+
+
+
+
+
+ +{{>theme_ilb/footer}} + + +{{#js}} +require(['theme_ilb/loader']); +{{/js}} diff --git a/templates/frontpage_ilb.mustache.save b/templates/frontpage_ilb.mustache.save new file mode 100644 index 0000000..156da2f --- /dev/null +++ b/templates/frontpage_ilb.mustache.save @@ -0,0 +1,226 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template theme_ilb/frontpage_ilb + + Frontpage ILB layout template. + + Context variables required for this template: + * sitename - The name of the site + * output - The core renderer for the page + * bodyattributes - attributes for the body tag as a string of html attributes + + Example context (json): + { + "sitename": "Moodle", + "output": { + "doctype": "", + "page_title": "Test page", + "favicon": "favicon.ico", + "main_content": "

Headings make html validators happier

" + }, + "bodyattributes":"" + } +}} +{{{ output.doctype }}} + + + {{{ output.page_title }}} + + {{{ output.standard_head_html }}} + + + + + +
+ {{{ output.standard_top_of_body_html }}} + +
+
+
+
+
+

cabeça

{{{ output.course_content_header }}}

conteudo

{{{ output.main_content }}} + {{{ output.course_content_footer }}}

rodapé

+
+
+
+
+
+
+{{{ output.standard_end_of_body_html }}} +
+ + +
+ Senado Federal - + Praça dos Três Poderes - Brasília DF - CEP 70165-900 + | Telefone: 0800 61 22 11 +
+ +
+ + +{{#js}} +require(['theme_ilb/loader']); +{{/js}} diff --git a/templates/frontpage_ilblogado.mustache b/templates/frontpage_ilblogado.mustache new file mode 100644 index 0000000..1348ef2 --- /dev/null +++ b/templates/frontpage_ilblogado.mustache @@ -0,0 +1,241 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template theme_ilb/columns2 + + Admin time setting template. + + Ilb 2 column layout template. + + Context variables required for this template: + * sitename - The name of the site + * output - The core renderer for the page + * bodyattributes - attributes for the body tag as a string of html attributes + * sidepreblocks - HTML for the blocks + * hasblocks - true if there are blocks on this page + * navdraweropen - true if the nav drawer should be open on page load + * regionmainsettingsmenu - HTML for the region main settings menu + * hasregionmainsettingsmenu - There is a region main settings menu on this page. + + Example context (json): + { + "sitename": "Moodle", + "output": { + "doctype": "", + "page_title": "Test page", + "favicon": "favicon.ico", + "main_content": "

Headings make html validators happier

" + }, + "bodyattributes":"", + "sidepreblocks": "

Blocks html goes here

", + "hasblocks":true, + "navdraweropen":true, + "regionmainsettingsmenu": "", + "hasregionmainsettingsmenu": false + } +}} +{{{ output.doctype }}} + + + + + {{{ output.page_title }}} + + {{{ output.standard_head_html }}} + + + + + + + + + + + + + + + + {{>theme_ilb/head}} + + + + + + {{>theme_ilb/headerLogado}} + +
+ + + + + +
+ + +
+
+
+

Navegação

+
+ +
+

Cursos

+
+
+
+
+ + +
+
Lista de cursos
+
+
+
+ +
+
Conteudo educação cidadã
+
+
+
+ +
+

Lista de cursos

Lista de cursos

Lista de cursos

Lista de cursos

Lista de cursos

Lista de cursos

+
+
+
+
+
+
+
+

Ensino a Distância

+
Informações
+
Matriculas Abertas
+
Matriculas Encerradas
+
+
+ +
+


+ +
+ + + + +
+ {{{ output.full_header }}} + +
+
+ {{#hasregionmainsettingsmenu}} +
+
{{{ output.region_main_settings_menu }}}
+
+ {{/hasregionmainsettingsmenu}} +
+
+ {{#hasregionmainsettingsmenu}} +
+ {{/hasregionmainsettingsmenu}} + {{{ output.course_content_header }}} + {{{ output.main_content }}} + {{{ output.course_content_footer }}} +
+
+ {{#hasblocks}} +
+ {{{ sidepreblocks }}} +
+ {{/hasblocks}} +
+
+
+ {{> theme_ilb/nav-drawer }} +
+ +
+
+
+ +{{>theme_ilb/footerSimples}} + + + + + + + + + + + + +{{#js}} +require(['theme_ilb/loader']); +require(['theme_ilb/drawer'], function(mod) { + mod.init(); +}); +{{/js}} diff --git a/templates/gradereport_history/user_button.mustache b/templates/gradereport_history/user_button.mustache new file mode 100644 index 0000000..90e8b70 --- /dev/null +++ b/templates/gradereport_history/user_button.mustache @@ -0,0 +1,21 @@ +
+
+ {{#params}} + + {{/params}} + +
+
+{{#hasactions}} + {{#js}} + require(['core/yui'], function(Y) { + {{#actions}} + Y.on('{{event}}', {{{jsfunction}}}, '#{{id}}', null{{#jsfunctionargs}}, {{{jsfunctionargs}}}{{/jsfunctionargs}}); + {{/actions}} + }); + {{/js}} +{{/hasactions}} diff --git a/templates/gradereport_singleview/bulk_insert.mustache b/templates/gradereport_singleview/bulk_insert.mustache new file mode 100644 index 0000000..abe592a --- /dev/null +++ b/templates/gradereport_singleview/bulk_insert.mustache @@ -0,0 +1,34 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + Bulk insert attribute. +}} +
+ + +
+
+ {{label}} + + + + {{{valuefield}}} +
diff --git a/templates/gradereport_singleview/button.mustache b/templates/gradereport_singleview/button.mustache new file mode 100644 index 0000000..43fdbcf --- /dev/null +++ b/templates/gradereport_singleview/button.mustache @@ -0,0 +1,20 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + Button. +}} + diff --git a/templates/gradereport_singleview/dropdown_attribute.mustache b/templates/gradereport_singleview/dropdown_attribute.mustache new file mode 100644 index 0000000..9f3be1a --- /dev/null +++ b/templates/gradereport_singleview/dropdown_attribute.mustache @@ -0,0 +1,25 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + Dropdown attribute. +}} + + diff --git a/templates/gradereport_singleview/text_attribute.mustache b/templates/gradereport_singleview/text_attribute.mustache new file mode 100644 index 0000000..ffd06e9 --- /dev/null +++ b/templates/gradereport_singleview/text_attribute.mustache @@ -0,0 +1,22 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + Text attribute. +}} + + + diff --git a/templates/gradingform_guide/comment_chooser.mustache b/templates/gradingform_guide/comment_chooser.mustache new file mode 100644 index 0000000..1199a1e --- /dev/null +++ b/templates/gradingform_guide/comment_chooser.mustache @@ -0,0 +1,57 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template gradingform_guide/comment_chooser + + Moodle comment chooser template for marking guide. + + The purpose of this template is to render a list of frequently used comments that can be used by the comment chooser dialog. + + Classes required for JS: + * none + + Data attributes required for JS: + * none + + Context variables required for this template: + * criterionId The criterion ID this chooser template is being generated for. + * comments Array of id / description pairs. + + Example context (json): + { + "criterionId": "1", + "comments": [ + { + "id": "1", + "description": "Test comment description 1" + }, + { + "id": "2", + "description": "Test comment description 2" + } + ] + } +}} +
+
+ {{#comments}} + + {{/comments}} +
+
diff --git a/templates/head.mustache b/templates/head.mustache new file mode 100644 index 0000000..c22bfcb --- /dev/null +++ b/templates/head.mustache @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/head2.mustache b/templates/head2.mustache new file mode 100644 index 0000000..ef2211d --- /dev/null +++ b/templates/head2.mustache @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/header-secure.mustache b/templates/header-secure.mustache new file mode 100644 index 0000000..8a5dced --- /dev/null +++ b/templates/header-secure.mustache @@ -0,0 +1,43 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + Page header. +}} + + diff --git a/templates/header.mustache b/templates/header.mustache new file mode 100644 index 0000000..9a2ad58 --- /dev/null +++ b/templates/header.mustache @@ -0,0 +1,54 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + Page header. +}} + + + +
+ +
diff --git a/templates/headerLogado.mustache b/templates/headerLogado.mustache new file mode 100644 index 0000000..88c748c --- /dev/null +++ b/templates/headerLogado.mustache @@ -0,0 +1,61 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + Page header. +}} + diff --git a/templates/login.mustache b/templates/login.mustache new file mode 100644 index 0000000..e2aafa7 --- /dev/null +++ b/templates/login.mustache @@ -0,0 +1,65 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template theme_ilb/login + + Login page template + + Example context (json): + { + "output": { + "doctype": "", + "page_title": "Login page", + "favicon": "favicon.ico", + "main_content": "

Headers keep HTML validators happy

" + } + } +}} +{{{ output.doctype }}} + + + {{{ output.page_title }}} + + {{{ output.standard_head_html }}} + + + + + +
+ + {{{ output.standard_top_of_body_html }}} + +
+
+
+
+ {{{ output.course_content_header }}} + {{{ output.main_content }}} + {{{ output.course_content_footer }}} +
+
+
+
+
+{{{ output.standard_end_of_body_html }}} + + + +{{#js}} +require(['theme_ilb/loader']); +{{/js}} diff --git a/templates/maintenance.mustache b/templates/maintenance.mustache new file mode 100644 index 0000000..f92b0d4 --- /dev/null +++ b/templates/maintenance.mustache @@ -0,0 +1,78 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template theme_ilb/maintenance + + Ilb maintenance layout template. + + Context variables required for this template: + * output - The core renderer for the page + + Example context (json): + { + "output": { + "doctype": "", + "page_title": "Test page", + "favicon": "favicon.ico", + "main_content": "

Headings make html validators happier

" + } + } +}} +{{{ output.doctype }}} + + + {{{ output.page_title }}} + + {{{ output.standard_head_html }}} + + + + + +
+ + {{{ output.standard_top_of_body_html }}} + +
+ +
+
+ {{{ output.page_heading }}} +
+
+ +
+
+ {{{ output.main_content }}} +
+
+ +
+
+ +
+
+ {{{ output.standard_footer_html }}} + {{{ output.standard_end_of_body_html }}} +
+
+ + + +{{#js}} +require(['theme_ilb/loader']); +{{/js}} diff --git a/templates/mod_assign/grading_actions.mustache b/templates/mod_assign/grading_actions.mustache new file mode 100644 index 0000000..34889dc --- /dev/null +++ b/templates/mod_assign/grading_actions.mustache @@ -0,0 +1,54 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template mod_assign/grading_actions + + Actions panel at the bottom of the assignment grading UI. + + Classes required for JS: + * none + + Data attributes required for JS: + * data-region + + Context variables required for this template: + * see mod/assign/classes/output/grading_app.php + + This template is initially hidden, and is only displayed after the current user info has been loaded. +}} +{{#showreview}} +
+
+ + + +
+
+{{/showreview}} +
+ + + +
+{{#js}} +require(['mod_assign/grading_actions'], function(GradingActions) { + new GradingActions('[data-region="grade-actions"]'); +}); +{{/js}} diff --git a/templates/mod_assign/grading_navigation.mustache b/templates/mod_assign/grading_navigation.mustache new file mode 100644 index 0000000..c6809b3 --- /dev/null +++ b/templates/mod_assign/grading_navigation.mustache @@ -0,0 +1,99 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template mod_assign/grading_navigation + + Actions panel at the bottom of the assignment grading UI. + + Classes required for JS: + * none + + Data attributes required for JS: + * data-region, data-assignmentid, data-groupid + + Context variables required for this template: + * see mod/assign/classes/output/grading_app.php + + This template includes ajax functionality, so it cannot be shown in the template library. +}} +
+
+ +{{! + There are three chunks, which appear side-by-side at large screen sizes. + A) Assignment info, which has 3 rows: +}} + +
+ +{{! + Row 1) course name & link. +}} +{{{coursename}}}
+ +{{! + Row 2) Assignment name & link. +}} +{{name}} + +{{! + Row 3) Edit settings, due date, with tool-tip thing. +}} + + +
+{{#caneditsettings}} +{{#pix}}t/edit, core,{{#str}}editsettings{{/str}}{{/pix}} +{{/caneditsettings}} + +
+ +{{! + B) Current user name and info. +}} +
+ {{> mod_assign/grading_navigation_user_info }} +
+ +{{! + C) User selector widget. +}} +
+
+ {{> mod_assign/grading_navigation_user_selector }} +
+
+
+
+{{#js}} +require(['mod_assign/grading_navigation', 'core/tooltip'], function(GradingNavigation, ToolTip) { + var nav = new GradingNavigation('[data-region="user-selector"]'); + var tooltip = new ToolTip('[data-region="assignment-tooltip"]'); +}); +{{/js}} diff --git a/templates/mod_assign/grading_navigation_user_selector.mustache b/templates/mod_assign/grading_navigation_user_selector.mustache new file mode 100644 index 0000000..8906fa8 --- /dev/null +++ b/templates/mod_assign/grading_navigation_user_selector.mustache @@ -0,0 +1,65 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template mod_assign/grading_navigation_user_selector + + The template HTML for the user selector in the top right corner. + + Classes required for JS: + * none + + Data attributes required for JS: + * data-action, data-assignmentid, data-groupid, data-region + + Context variables required for this template: + * see mod/assign/classes/output/grading_app.php + + This template uses ajax functionality, so it cannot be shown in the template library. +}} +{{{larrow}}} + + + +{{{rarrow}}} + +
+ + + + {{#str}}xofy, mod_assign, { "x": "{{index}}", "y": "{{count}}" }{{/str}} + + + + +
+ + + +
+
+ + diff --git a/templates/mod_forum/big_search_form.mustache b/templates/mod_forum/big_search_form.mustache new file mode 100644 index 0000000..252e24e --- /dev/null +++ b/templates/mod_forum/big_search_form.mustache @@ -0,0 +1,161 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template mod_forum/big_search_form + + Big search form. + + Example context (json): + { + "scripturl": "https://example.com/mod/forum/forum.js", + "actionurl": "https://example.com/mod/forum/search.php", + "courseid": "2", + "words": "apples", + "phrase": "Lorem ipsum dolor", + "notwords": "Not these words", + "showfullwords": [ + { + "fullwords": "Exactly" + } + ], + "datefromchecked": 1, + "datetochecked": "", + "forumoptions": [ + { + "name": "Forum One", + "value": "23" + }, + { + "name": "Forum Two", + "value": "34" + } + ], + "subject": "Help me please", + "user": "Helpy McUser" + } +}} + +
+ +
+ + + + + + + + + + + + + + {{#showfullwords}} + + + + + {{/showfullwords}} + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {{#js}} + lockoptions_timetoitems(); + lockoptions_timefromitems(); + {{/js}} +
diff --git a/templates/mod_forum/quick_search_form.mustache b/templates/mod_forum/quick_search_form.mustache new file mode 100644 index 0000000..a5c8767 --- /dev/null +++ b/templates/mod_forum/quick_search_form.mustache @@ -0,0 +1,13 @@ +
+
+ +
+ {{#helpicon}} + {{>core/help_icon}} + {{/helpicon}} + + +
+ +
+
diff --git a/templates/nav-drawer.mustache b/templates/nav-drawer.mustache new file mode 100644 index 0000000..4c58f0b --- /dev/null +++ b/templates/nav-drawer.mustache @@ -0,0 +1,9 @@ +{{! + @template theme_ilb/nav-drawer + + + Example context (json): {} +}} + diff --git a/templates/secure.mustache b/templates/secure.mustache new file mode 100644 index 0000000..f6c40dd --- /dev/null +++ b/templates/secure.mustache @@ -0,0 +1,97 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template theme_ilb/secure + + Ilb secure layout template. + + Context variables required for this template: + * sitename - The name of the site + * output - The core renderer for the page + + Example context (json): + { + "sitename": "Moodle", + "output": { + "doctype": "", + "page_title": "Test page", + "favicon": "favicon.ico", + "main_content": "

Headings make html validators happier

" + } + } +}} +{{{ output.doctype }}} + + + {{{ output.page_title }}} + + {{{ output.standard_head_html }}} + + + + + +
+ + {{{ output.standard_top_of_body_html }}} + + {{>theme_ilb/header-secure}} + +
+ {{! Secured full header }} + + + +
+
+
+
+ {{{ output.course_content_header }}} + {{{ output.main_content }}} + {{{ output.course_content_footer }}} +
+
+ {{#hasblocks}} +
+ {{{ sidepreblocks }}} +
+ {{/hasblocks}} +
+
+
+
+
+
+ + + {{{ output.standard_end_of_body_html }}} +
+
+ + + +{{#js}} +require(['theme_ilb/loader']); +{{/js}} diff --git a/templates/tool_lp/progress_bar.mustache b/templates/tool_lp/progress_bar.mustache new file mode 100644 index 0000000..b7029db --- /dev/null +++ b/templates/tool_lp/progress_bar.mustache @@ -0,0 +1,47 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template tool_lp/progress_bar + + Moodle progress bar template for tool_lp. + + The purpose of this template is to render a progress bar with a brief description. + + Classes required for JS: + * none + + Data attributes required for JS: + * none + + Context variables required for this template: + * progresstextvalue A brief text that describes the progress bar. + * percentagevalue The numeric value for the progress bar's percentage. + * percentlabelvalue The progress bar's label that shows the percentage value. + + Example context (json): + { + "progresstextvalue": "Progress:", + "percentagevalue": "50", + "percentlabelvalue": "50.00 %" + } + +}} +
+ {{$progresstext}}{{progresstextvalue}}{{/progresstext}} +
+ diff --git a/templates/tool_usertours/tourstep.mustache b/templates/tool_usertours/tourstep.mustache new file mode 100644 index 0000000..7c9da82 --- /dev/null +++ b/templates/tool_usertours/tourstep.mustache @@ -0,0 +1,65 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template tool_usertours/tourstep + + Template used as a template to render step bubbles with their content + in a user tour. + + Classes required for JS: + * arrow + * popover-title + * popover-content + * popover-navigation + * popover-title + + Data attributes required for JS: + * data-role=prev + * data-role=next + * data-role=pause-resume + * data-pause-text + * data-resume-text + * data-role=end + * data-placeholder=body + * data-placeholder=title + + Context variables required for this template: + * None + + Example context (json): + { + } + +}} + diff --git a/tests/behat/behat_theme_boost_behat_action_menu.php b/tests/behat/behat_theme_boost_behat_action_menu.php new file mode 100644 index 0000000..4c47308 --- /dev/null +++ b/tests/behat/behat_theme_boost_behat_action_menu.php @@ -0,0 +1,57 @@ +. + +/** + * Steps definitions to open and close action menus (overrides). + * + * @package core + * @category test + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. + +require_once(__DIR__ . '/../../../../lib/tests/behat/behat_action_menu.php'); + +/** + * Steps definitions to open and close action menus (overrides). + * + * @package core + * @category test + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class behat_theme_ilb_behat_action_menu extends behat_action_menu { + + public function i_open_the_action_menu_in($element, $selectortype) { + // Gets the node based on the requested selector type and locator. + $node = $this->get_node_in_container("css_element", "[role=button][aria-haspopup=true]", $selectortype, $element); + $this->ensure_node_is_visible($node); + $node->click(); + } + + public function i_choose_in_the_open_action_menu($menuitemstring) { + if (!$this->running_javascript()) { + throw new DriverException('Action menu steps are not available with Javascript disabled'); + } + // Gets the node based on the requested selector type and locator. + $menuselector = ".moodle-actionmenu .dropdown.open .dropdown-menu"; + $node = $this->get_node_in_container("link", $menuitemstring, "css_element", $menuselector); + $this->ensure_node_is_visible($node); + $node->click(); + } +} diff --git a/tests/behat/behat_theme_boost_behat_admin.php b/tests/behat/behat_theme_boost_behat_admin.php new file mode 100644 index 0000000..db9fe8a --- /dev/null +++ b/tests/behat/behat_theme_boost_behat_admin.php @@ -0,0 +1,108 @@ +. + +/** + * Steps definitions related with administration overrides. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. +// For that reason, we can't even rely on $CFG->admin being available here. + +require_once(__DIR__ . '/../../../../admin/tests/behat/behat_admin.php'); + +use Behat\Gherkin\Node\TableNode as TableNode, + Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException; + +/** + * Site administration level steps definitions overrides. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class behat_theme_ilb_behat_admin extends behat_admin { + + public function i_set_the_following_administration_settings_values(TableNode $table) { + + if (!$data = $table->getRowsHash()) { + return; + } + + foreach ($data as $label => $value) { + + $this->execute('behat_navigation::i_select_from_flat_navigation_drawer', [get_string('administrationsite')]); + + // Search by label. + $searchbox = $this->find_field(get_string('query', 'admin')); + $searchbox->setValue($label); + $submitsearch = $this->find('css', 'form input[type=submit][name=search]'); + $submitsearch->press(); + + $this->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS); + + // Admin settings does not use the same DOM structure than other moodle forms + // but we also need to use lib/behat/form_field/* to deal with the different moodle form elements. + $exception = new ElementNotFoundException($this->getSession(), '"' . $label . '" administration setting '); + + // The argument should be converted to an xpath literal. + $label = behat_context_helper::escape($label); + + // Single element settings. + try { + $fieldxpath = "//*[self::input | self::textarea | self::select]" . + "[not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]" . + "[@id=//label[contains(normalize-space(.), $label)]/@for or " . + "@id=//span[contains(normalize-space(.), $label)]/preceding-sibling::label[1]/@for]"; + $fieldnode = $this->find('xpath', $fieldxpath, $exception); + + $formfieldtypenode = $this->find('xpath', $fieldxpath . + "/ancestor::div[contains(concat(' ', @class, ' '), ' form-setting ')]" . + "/child::div[contains(concat(' ', @class, ' '), ' form-')]/child::*/parent::div"); + + } catch (ElementNotFoundException $e) { + + // Multi element settings, interacting only the first one. + $fieldxpath = "//*[label[contains(., $label)]|span[contains(., $label)]]" . + "/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' form-item ')]" . + "/descendant::div[contains(concat(' ', @class, ' '), ' form-group ')]" . + "/descendant::*[self::input | self::textarea | self::select]" . + "[not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]"; + $fieldnode = $this->find('xpath', $fieldxpath); + + // It is the same one that contains the type. + $formfieldtypenode = $fieldnode; + } + + // Getting the class which contains the field type. + $classes = explode(' ', $formfieldtypenode->getAttribute('class')); + $type = false; + foreach ($classes as $class) { + if (substr($class, 0, 5) == 'form-') { + $type = substr($class, 5); + } + } + + // Instantiating the appropiate field type. + $field = behat_field_manager::get_field_instance($type, $fieldnode, $this->getSession()); + $field->set_value($value); + + $this->find_button(get_string('savechanges'))->press(); + } + } + +} diff --git a/tests/behat/behat_theme_boost_behat_blocks.php b/tests/behat/behat_theme_boost_behat_blocks.php new file mode 100644 index 0000000..4946fdd --- /dev/null +++ b/tests/behat/behat_theme_boost_behat_blocks.php @@ -0,0 +1,94 @@ +. + +/** + * Steps definitions related with blocks. + * + * @package core_block + * @category test + * @copyright 2012 David Monllaó + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. + +require_once(__DIR__ . '/../../../../blocks/tests/behat/behat_blocks.php'); + +/** + * Blocks management steps definitions. + * + * @package core_block + * @category test + * @copyright 2012 David Monllaó + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class behat_theme_ilb_behat_blocks extends behat_blocks { + + public function i_add_the_block($blockname) { + $this->execute('behat_navigation::i_select_from_flat_navigation_drawer', get_string('addblock')); + + if (!$this->running_javascript()) { + $this->execute('behat_general::i_click_on_in_the', [$blockname, 'link', '#region-main', 'css_element']); + } else { + $this->execute('behat_general::i_click_on_in_the', [$blockname, 'link', '.modal-body', 'css_element']); + } + } + + public function i_open_the_blocks_action_menu($blockname) { + + if (!$this->running_javascript()) { + // Action menu does not need to be open if Javascript is off. + return; + } + + // If it is already opened we do nothing. + $blocknode = $this->get_text_selector_node('block', $blockname); + if ($blocknode->hasClass('action-menu-shown')) { + return; + } + + $this->execute('behat_general::i_click_on_in_the', + array("a[data-toggle='dropdown']", "css_element", $this->escape($blockname), "block") + ); + } + + public function the_add_block_selector_should_contain_block($blockname) { + $this->execute('behat_navigation::i_select_from_flat_navigation_drawer', get_string('addblock')); + + $cancelstr = get_string('cancel'); + if (!$this->running_javascript()) { + $this->execute('behat_general::should_exist_in_the', [$blockname, 'link', '#region-main', 'css_element']); + $this->execute('behat_general::i_click_on_in_the', [$cancelstr, 'link', '#region-main', 'css_element']); + } else { + $this->execute('behat_general::should_exist_in_the', [$blockname, 'link', '.modal-body', 'css_element']); + $this->execute('behat_general::i_click_on_in_the', [$cancelstr, 'link', '.modal-body', 'css_element']); + } + } + + public function the_add_block_selector_should_not_contain_block($blockname) { + $this->execute('behat_navigation::i_select_from_flat_navigation_drawer', get_string('addblock')); + + $cancelstr = get_string('cancel'); + if (!$this->running_javascript()) { + $this->execute('behat_general::should_not_exist_in_the', [$blockname, 'link', '#region-main', 'css_element']); + $this->execute('behat_general::i_click_on_in_the', [$cancelstr, 'link', '#region-main', 'css_element']); + } else { + $this->execute('behat_general::should_not_exist_in_the', [$blockname, 'link', '.modal-body', 'css_element']); + $this->execute('behat_general::i_click_on_in_the', [$cancelstr, 'link', '.modal-body', 'css_element']); + } + } + +} diff --git a/tests/behat/behat_theme_boost_behat_course.php b/tests/behat/behat_theme_boost_behat_course.php new file mode 100644 index 0000000..ef9b338 --- /dev/null +++ b/tests/behat/behat_theme_boost_behat_course.php @@ -0,0 +1,265 @@ +. + +/** + * Behat course-related steps definitions overrides. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. + +require_once(__DIR__ . '/../../../../course/tests/behat/behat_course.php'); + +use Behat\Gherkin\Node\TableNode as TableNode, + Behat\Mink\Exception\ExpectationException as ExpectationException, + Behat\Mink\Exception\DriverException as DriverException, + Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException; + +/** + * Course-related steps definitions overrides. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class behat_theme_ilb_behat_course extends behat_course { + + public function i_open_actions_menu($activityname) { + + if (!$this->running_javascript()) { + throw new DriverException('Activities actions menu not available when Javascript is disabled'); + } + + // If it is already opened we do nothing. + $activitynode = $this->get_activity_node($activityname); + + // Find the menu. + $menunode = $activitynode->find('css', 'a[data-toggle=dropdown]'); + $expanded = $menunode->getAttribute('aria-expanded'); + if ($expanded == 'true') { + return; + } + + $this->execute('behat_course::i_click_on_in_the_activity', + array("a[data-toggle='dropdown']", "css_element", $this->escape($activityname)) + ); + + $this->actions_menu_should_be_open($activityname); + } + + public function i_close_actions_menu($activityname) { + + if (!$this->running_javascript()) { + throw new DriverException('Activities actions menu not available when Javascript is disabled'); + } + + // If it is already closed we do nothing. + $activitynode = $this->get_activity_node($activityname); + // Find the menu. + $menunode = $activitynode->find('css', 'a[data-toggle=dropdown]'); + $expanded = $menunode->getAttribute('aria-expanded'); + if ($expanded != 'true') { + return; + } + + $this->execute('behat_course::i_click_on_in_the_activity', + array("a[data-toggle='dropdown']", "css_element", $this->escape($activityname)) + ); + } + + public function actions_menu_should_be_open($activityname) { + + if (!$this->running_javascript()) { + throw new DriverException('Activities actions menu not available when Javascript is disabled'); + } + + $activitynode = $this->get_activity_node($activityname); + // Find the menu. + $menunode = $activitynode->find('css', 'a[data-toggle=dropdown]'); + $expanded = $menunode->getAttribute('aria-expanded'); + if ($expanded != 'true') { + throw new ExpectationException(sprintf("The action menu for '%s' is not open", $activityname), $this->getSession()); + } + } + + public function i_add_to_section($activity, $section) { + + if ($this->getSession()->getPage()->find('css', 'body#page-site-index') && (int)$section <= 1) { + // We are on the frontpage. + if ($section) { + // Section 1 represents the contents on the frontpage. + $sectionxpath = "//body[@id='page-site-index']" . + "/descendant::div[contains(concat(' ',normalize-space(@class),' '),' sitetopic ')]"; + } else { + // Section 0 represents "Site main menu" block. + $sectionxpath = "//*[contains(concat(' ',normalize-space(@class),' '),' block_site_main_menu ')]"; + } + } else { + // We are inside the course. + $sectionxpath = "//li[@id='section-" . $section . "']"; + } + + $activityliteral = behat_context_helper::escape(ucfirst($activity)); + + if ($this->running_javascript()) { + + // Clicks add activity or resource section link. + $sectionxpath = $sectionxpath . "/descendant::div" . + "[contains(concat(' ', normalize-space(@class) , ' '), ' section-modchooser ')]/span/a"; + $sectionnode = $this->find('xpath', $sectionxpath); + $sectionnode->click(); + + // Clicks the selected activity if it exists. + $activityxpath = "//div[@id='chooseform']/descendant::label" . + "/descendant::span[contains(concat(' ', normalize-space(@class), ' '), ' typename ')]" . + "[normalize-space(.)=$activityliteral]" . + "/parent::label/child::input"; + $activitynode = $this->find('xpath', $activityxpath); + $activitynode->doubleClick(); + + } else { + // Without Javascript. + + // Selecting the option from the select box which contains the option. + $selectxpath = $sectionxpath . "/descendant::div" . + "[contains(concat(' ', normalize-space(@class), ' '), ' section_add_menus ')]" . + "/descendant::select[option[normalize-space(.)=$activityliteral]]"; + $selectnode = $this->find('xpath', $selectxpath); + $selectnode->selectOption($activity); + + // Go button. + $gobuttonxpath = $selectxpath . "/ancestor::form/descendant::input[@type='submit']"; + $gobutton = $this->find('xpath', $gobuttonxpath); + $gobutton->click(); + } + + } + + public function i_duplicate_activity_editing_the_new_copy_with($activityname, TableNode $data) { + + $activity = $this->escape($activityname); + $activityliteral = behat_context_helper::escape($activityname); + + $this->execute("behat_course::i_duplicate_activity", $activity); + + // Determine the future new activity xpath from the former one. + $duplicatedxpath = "//li[contains(concat(' ', normalize-space(@class), ' '), ' activity ')]" . + "[contains(., $activityliteral)]/following-sibling::li"; + $duplicatedactionsmenuxpath = $duplicatedxpath . "/descendant::a[@data-toggle='dropdown']"; + + if ($this->running_javascript()) { + // We wait until the AJAX request finishes and the section is visible again. + $hiddenlightboxxpath = "//li[contains(concat(' ', normalize-space(@class), ' '), ' activity ')]" . + "[contains(., $activityliteral)]" . + "/ancestor::li[contains(concat(' ', normalize-space(@class), ' '), ' section ')]" . + "/descendant::div[contains(concat(' ', @class, ' '), ' lightbox ')][contains(@style, 'display: none')]"; + + $this->execute("behat_general::wait_until_exists", + array($this->escape($hiddenlightboxxpath), "xpath_element") + ); + + // Close the original activity actions menu. + $this->i_close_actions_menu($activity); + + // The next sibling of the former activity will be the duplicated one, so we click on it from it's xpath as, at + // this point, it don't even exists in the DOM (the steps are executed when we return them). + $this->execute('behat_general::i_click_on', + array($this->escape($duplicatedactionsmenuxpath), "xpath_element") + ); + } + + // We force the xpath as otherwise mink tries to interact with the former one. + $this->execute('behat_general::i_click_on_in_the', + array(get_string('editsettings'), "link", $this->escape($duplicatedxpath), "xpath_element") + ); + + $this->execute("behat_forms::i_set_the_following_fields_to_these_values", $data); + $this->execute("behat_forms::press_button", get_string('savechangesandreturntocourse')); + + } + + public function i_open_section_edit_menu($sectionnumber) { + if (!$this->running_javascript()) { + throw new DriverException('Section edit menu not available when Javascript is disabled'); + } + + // Wait for section to be available, before clicking on the menu. + $this->i_wait_until_section_is_available($sectionnumber); + + // If it is already opened we do nothing. + $xpath = $this->section_exists($sectionnumber); + $xpath .= "/descendant::div[contains(@class, 'section-actions')]/descendant::a[contains(@data-toggle, 'dropdown')]"; + + $exception = new ExpectationException('Section "' . $sectionnumber . '" was not found', $this->getSession()); + $menu = $this->find('xpath', $xpath, $exception); + $menu->click(); + $this->i_wait_until_section_is_available($sectionnumber); + } + + public function section_should_be_visible($sectionnumber) { + + $sectionxpath = $this->section_exists($sectionnumber); + + // Section should not be hidden. + $xpath = $sectionxpath . "[not(contains(concat(' ', normalize-space(@class), ' '), ' hidden '))]"; + if (!$this->getSession()->getPage()->find('xpath', $xpath)) { + throw new ExpectationException('The section is hidden', $this->getSession()); + } + + // Edit menu should be visible. + if ($this->is_course_editor()) { + $xpath = $sectionxpath . + "/descendant::div[contains(@class, 'section-actions')]" . + "/descendant::a[contains(@data-toggle, 'dropdown')]"; + if (!$this->getSession()->getPage()->find('xpath', $xpath)) { + throw new ExpectationException('The section edit menu is not available', $this->getSession()); + } + } + } + + protected function user_clicks_on_management_listing_action($listingtype, $listingnode, $action) { + $actionsnode = $listingnode->find('xpath', "//*" . + "[contains(concat(' ', normalize-space(@class), ' '), '{$listingtype}-item-actions')]"); + if (!$actionsnode) { + throw new ExpectationException("Could not find the actions for $listingtype", $this->getSession()); + } + $actionnode = $actionsnode->find('css', '.action-'.$action); + if (!$actionnode) { + throw new ExpectationException("Expected action was not available or not found ($action)", $this->getSession()); + } + if ($this->running_javascript() && !$actionnode->isVisible()) { + $actionsnode->find('css', 'a[data-toggle=dropdown]')->click(); + $actionnode = $actionsnode->find('css', '.action-'.$action); + } + $actionnode->click(); + } + + protected function is_course_editor() { + + // We don't need to behat_base::spin() here as all is already loaded. + if (!$this->getSession()->getPage()->findLink(get_string('turneditingoff')) && + !$this->getSession()->getPage()->findLink(get_string('turneditingon'))) { + return false; + } + + return true; + } + + public function i_navigate_to_course_participants() { + $this->execute('behat_navigation::i_select_from_flat_navigation_drawer', get_string('participants')); + } +} diff --git a/tests/behat/behat_theme_boost_behat_filepicker.php b/tests/behat/behat_theme_boost_behat_filepicker.php new file mode 100644 index 0000000..84cd768 --- /dev/null +++ b/tests/behat/behat_theme_boost_behat_filepicker.php @@ -0,0 +1,305 @@ +. + +/** + * Filemanager and filepicker manipulation steps definitions overrides. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. + +require_once(__DIR__ . '/behat_theme_ilb_behat_files.php'); + +use Behat\Mink\Exception\ExpectationException as ExpectationException, + Behat\Gherkin\Node\TableNode as TableNode; + +/** + * Steps definitions to deal with the filemanager and filepicker overrides. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class behat_theme_ilb_behat_filepicker extends behat_theme_ilb_behat_files { + /** + * Creates a folder with specified name in the current folder and in the specified filemanager field. + * + * @Given /^I create "(?P(?:[^"]|\\")*)" folder in "(?P(?:[^"]|\\")*)" filemanager$/ + * @throws ExpectationException Thrown by behat_base::find + * @param string $foldername + * @param string $filemanagerelement + */ + public function i_create_folder_in_filemanager($foldername, $filemanagerelement) { + + $fieldnode = $this->get_filepicker_node($filemanagerelement); + + // Looking for the create folder button inside the specified filemanager. + $exception = new ExpectationException('No folders can be created in "'.$filemanagerelement.'" filemanager', + $this->getSession()); + $newfolder = $this->find('css', 'div.fp-btn-mkdir a', $exception, $fieldnode); + $newfolder->click(); + + // Setting the folder name in the modal window. + $exception = new ExpectationException('The dialog to enter the folder name does not appear', $this->getSession()); + $dialoginput = $this->find('css', '.fp-mkdir-dlg-text input', $exception); + $dialoginput->setValue($foldername); + + $exception = new ExpectationException('The button for the create folder dialog can not be located', $this->getSession()); + $dialognode = $this->find('css', '.moodle-dialogue-focused'); + $buttonnode = $this->find('css', '.fp-dlg-butcreate', $exception, $dialognode); + $buttonnode->click(); + } + + /** + * Opens the contents of a filemanager folder. It looks for the folder in the current folder and in the path bar. + * + * @Given /^I open "(?P(?:[^"]|\\")*)" folder from "(?P(?:[^"]|\\")*)" filemanager$/ + * @throws ExpectationException Thrown by behat_base::find + * @param string $foldername + * @param string $filemanagerelement + */ + public function i_open_folder_from_filemanager($foldername, $filemanagerelement) { + + $fieldnode = $this->get_filepicker_node($filemanagerelement); + + $exception = new ExpectationException( + 'The "'.$foldername.'" folder can not be found in the "'.$filemanagerelement.'" filemanager', + $this->getSession() + ); + + $folderliteral = behat_context_helper::escape($foldername); + + // We look both in the pathbar and in the contents. + try { + + // In the current folder workspace. + $folder = $this->find( + 'xpath', + "//div[contains(concat(' ', normalize-space(@class), ' '), ' fp-folder ')]" . + "/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' fp-filename ')]" . + "[normalize-space(.)=$folderliteral]", + $exception, + $fieldnode + ); + } catch (ExpectationException $e) { + + // And in the pathbar. + $folder = $this->find( + 'xpath', + "//a[contains(concat(' ', normalize-space(@class), ' '), ' fp-path-folder-name ')]" . + "[normalize-space(.)=$folderliteral]", + $exception, + $fieldnode + ); + } + + // It should be a NodeElement, otherwise an exception would have been thrown. + $folder->click(); + } + + /** + * Unzips the specified file from the specified filemanager field. The zip file has to be visible in the current folder. + * + * @Given /^I unzip "(?P(?:[^"]|\\")*)" file from "(?P(?:[^"]|\\")*)" filemanager$/ + * @throws ExpectationException Thrown by behat_base::find + * @param string $filename + * @param string $filemanagerelement + */ + public function i_unzip_file_from_filemanager($filename, $filemanagerelement) { + + // Open the contextual menu of the filemanager element. + $this->open_element_contextual_menu($filename, $filemanagerelement); + + // Execute the action. + $exception = new ExpectationException($filename.' element can not be unzipped', $this->getSession()); + $this->perform_on_element('unzip', $exception); + } + + /** + * Zips the specified folder from the specified filemanager field. The folder has to be in the current folder. + * + * @Given /^I zip "(?P(?:[^"]|\\")*)" folder from "(?P(?:[^"]|\\")*)" filemanager$/ + * @throws ExpectationException Thrown by behat_base::find + * @param string $foldername + * @param string $filemanagerelement + */ + public function i_zip_folder_from_filemanager($foldername, $filemanagerelement) { + + // Open the contextual menu of the filemanager element. + $this->open_element_contextual_menu($foldername, $filemanagerelement); + + // Execute the action. + $exception = new ExpectationException($foldername.' element can not be zipped', $this->getSession()); + $this->perform_on_element('zip', $exception); + } + + /** + * Deletes the specified file or folder from the specified filemanager field. + * + * @Given /^I delete "(?P(?:[^"]|\\")*)" from "(?P(?:[^"]|\\")*)" filemanager$/ + * @throws ExpectationException Thrown by behat_base::find + * @param string $name + * @param string $filemanagerelement + */ + public function i_delete_file_from_filemanager($name, $filemanagerelement) { + + // Open the contextual menu of the filemanager element. + $this->open_element_contextual_menu($name, $filemanagerelement); + + // Execute the action. + $exception = new ExpectationException($name.' element can not be deleted', $this->getSession()); + $this->perform_on_element('delete', $exception); + + // Yes, we are sure. + // Using xpath + click instead of pressButton as 'Ok' it is a common string. + $okbutton = $this->find('css', 'div.fp-dlg button.fp-dlg-butconfirm'); + $okbutton->click(); + } + + + /** + * Makes sure user can see the exact number of elements (files in folders) in the filemanager. + * + * @Then /^I should see "(?P\d+)" elements in "(?P(?:[^"]|\\")*)" filemanager$/ + * @throws ExpectationException Thrown by behat_base::find + * @param int $elementscount + * @param string $filemanagerelement + */ + public function i_should_see_elements_in_filemanager($elementscount, $filemanagerelement) { + $filemanagernode = $this->get_filepicker_node($filemanagerelement); + + // We count .fp-file elements inside a filemanager not being updated. + $xpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' filemanager ')]" . + "[not(contains(concat(' ', normalize-space(@class), ' '), ' fm-updating '))]" . + "//div[contains(concat(' ', normalize-space(@class), ' '), ' fp-content ')]" . + "//div[contains(concat(' ', normalize-space(@class), ' '), ' fp-file ')]"; + + $elements = $this->find_all('xpath', $xpath, false, $filemanagernode); + if (count($elements) != $elementscount) { + throw new ExpectationException('Found '.count($elements).' elements in filemanager. Expected '.$elementscount, + $this->getSession()); + } + } + + /** + * Picks the file from repository leaving default values in select file dialogue. + * + * @When /^I add "(?P(?:[^"]|\\")*)" file from "(?P(?:[^"]|\\")*)" to "(?P(?:[^"]|\\")*)" filemanager$/ + * @throws ExpectationException Thrown by behat_base::find + * @param string $filepath + * @param string $repository + * @param string $filemanagerelement + */ + public function i_add_file_from_repository_to_filemanager($filepath, $repository, $filemanagerelement) { + $this->add_file_from_repository_to_filemanager($filepath, $repository, $filemanagerelement, new TableNode(array()), false); + } + + /** + * Picks the file from repository leaving default values in select file dialogue and confirming to overwrite an existing file. + * + * @When /^I add and overwrite "(?P(?:[^"]|\\")*)" file from "(?P(?:[^"]|\\")*)" to "(?P(?:[^"]|\\")*)" filemanager$/ + * @throws ExpectationException Thrown by behat_base::find + * @param string $filepath + * @param string $repository + * @param string $filemanagerelement + */ + public function i_add_and_overwrite_file_from_repository_to_filemanager($filepath, $repository, $filemanagerelement) { + $this->add_file_from_repository_to_filemanager($filepath, $repository, $filemanagerelement, new TableNode(array()), + get_string('overwrite', 'repository')); + } + + /** + * Picks the file from repository filling the form in Select file dialogue. + * + * @When /^I add "(?P(?:[^"]|\\")*)" file from "(?P(?:[^"]|\\")*)" to "(?P(?:[^"]|\\")*)" filemanager as:$/ + * @throws ExpectationException Thrown by behat_base::find + * @param string $filepath + * @param string $repository + * @param string $filemanagerelement + * @param TableNode $data Data to fill the form in Select file dialogue + */ + public function i_add_file_from_repository_to_filemanager_as($filepath, $repository, $filemanagerelement, TableNode $data) { + $this->add_file_from_repository_to_filemanager($filepath, $repository, $filemanagerelement, $data, false); + } + + /** + * Picks the file from repository confirming to overwrite an existing file + * + * @When /^I add and overwrite "(?P(?:[^"]|\\")*)" file from "(?P(?:[^"]|\\")*)" to "(?P(?:[^"]|\\")*)" filemanager as:$/ + * @throws ExpectationException Thrown by behat_base::find + * @param string $filepath + * @param string $repository + * @param string $filemanagerelement + * @param TableNode $data Data to fill the form in Select file dialogue + */ + public function i_add_and_overwrite_file_from_repository_to_filemanager_as($filepath, $repository, $filemanagerelement, + TableNode $data) { + $this->add_file_from_repository_to_filemanager($filepath, $repository, $filemanagerelement, $data, + get_string('overwrite', 'repository')); + } + + /** + * Picks the file from private files repository + * + * @throws ExpectationException Thrown by behat_base::find + * @param string $filepath + * @param string $repository + * @param string $filemanagerelement + * @param TableNode $data Data to fill the form in Select file dialogue + * @param false|string $overwriteaction false if we don't expect that file with the same name already exists, + * or button text in overwrite dialogue ("Overwrite", "Rename to ...", "Cancel") + */ + protected function add_file_from_repository_to_filemanager($filepath, $repository, $filemanagerelement, TableNode $data, + $overwriteaction = false) { + $filemanagernode = $this->get_filepicker_node($filemanagerelement); + + // Opening the select repository window and selecting the upload repository. + $this->open_add_file_window($filemanagernode, $repository); + + $this->open_element_contextual_menu($filepath); + + // Fill the form in Select window. + $datahash = $data->getRowsHash(); + + // The action depends on the field type. + foreach ($datahash as $locator => $value) { + + $field = behat_field_manager::get_form_field_from_label($locator, $this); + + // Delegates to the field class. + $field->set_value($value); + } + + $selectfilebutton = $this->find_button(get_string('getfile', 'repository')); + $this->ensure_node_is_visible($selectfilebutton); + $selectfilebutton->click(); + + // We wait for all the JS to finish as it is performing an action. + $this->getSession()->wait(self::TIMEOUT, self::PAGE_READY_JS); + + if ($overwriteaction !== false) { + $overwritebutton = $this->find_button($overwriteaction); + $this->ensure_node_is_visible($overwritebutton); + $overwritebutton->click(); + + // We wait for all the JS to finish. + $this->getSession()->wait(self::TIMEOUT, self::PAGE_READY_JS); + } + + } + +} diff --git a/tests/behat/behat_theme_boost_behat_files.php b/tests/behat/behat_theme_boost_behat_files.php new file mode 100644 index 0000000..9372fec --- /dev/null +++ b/tests/behat/behat_theme_boost_behat_files.php @@ -0,0 +1,65 @@ +. + +/** + * Files interactions with behat overrides. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. + +require_once(__DIR__ . '/../../../../lib/behat/behat_files.php'); + +use Behat\Mink\Exception\ExpectationException as ExpectationException, + Behat\Mink\Element\NodeElement as NodeElement; + +/** + * Files-related actions overrides. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class behat_theme_ilb_behat_files extends behat_files { + + protected function get_filepicker_node($filepickerelement) { + + // More info about the problem (in case there is a problem). + $exception = new ExpectationException('"' . $filepickerelement . '" filepicker can not be found', $this->getSession()); + + // If no file picker label is mentioned take the first file picker from the page. + if (empty($filepickerelement)) { + $filepickercontainer = $this->find( + 'xpath', + "//*[@data-fieldtype=\"filemanager\"]", + $exception + ); + } else { + // Gets the ffilemanager node specified by the locator which contains the filepicker container. + $filepickerelement = behat_context_helper::escape($filepickerelement); + $filepickercontainer = $this->find( + 'xpath', + "//input[./@id = //label[normalize-space(.)=$filepickerelement]/@for]" . + "//ancestor::*[@data-fieldtype = 'filemanager' or @data-fieldtype = 'filepicker']", + $exception + ); + } + + return $filepickercontainer; + } + +} diff --git a/tests/behat/behat_theme_boost_behat_grade.php b/tests/behat/behat_theme_boost_behat_grade.php new file mode 100644 index 0000000..6742bfb --- /dev/null +++ b/tests/behat/behat_theme_boost_behat_grade.php @@ -0,0 +1,158 @@ +. + +/** + * Behat grade related steps definitions overrides. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. + +require_once(__DIR__ . '/../../../../grade/tests/behat/behat_grade.php'); + +use Behat\Gherkin\Node\TableNode as TableNode; + +class behat_theme_ilb_behat_grade extends behat_grade { + + public function i_set_the_following_settings_for_grade_item($gradeitem, TableNode $data) { + + $gradeitem = behat_context_helper::escape($gradeitem); + + if ($this->running_javascript()) { + $xpath = "//tr[contains(.,$gradeitem)]//*[contains(@class,'moodle-actionmenu')]"; + if ($this->getSession()->getPage()->findAll('xpath', $xpath)) { + $this->execute("behat_action_menu::i_open_the_action_menu_in", + array("//tr[contains(.,$gradeitem)]", + "xpath_element")); + } + } + + $savechanges = get_string('savechanges', 'grades'); + $edit = behat_context_helper::escape(get_string('edit') . ' '); + $linkxpath = "//a[./img[starts-with(@title,$edit) and contains(@title,$gradeitem)]]"; + + $this->execute("behat_general::i_click_on", array($this->escape($linkxpath), "xpath_element")); + $this->execute("behat_forms::i_set_the_following_fields_to_these_values", $data); + $this->execute('behat_forms::press_button', $this->escape($savechanges)); + } + + public function i_set_calculation_for_grade_item_with_idnumbers($calculation, $gradeitem, TableNode $data) { + + $gradeitem = behat_context_helper::escape($gradeitem); + + if ($this->running_javascript()) { + $xpath = "//tr[contains(.,$gradeitem)]//*[contains(@class,'moodle-actionmenu')]"; + if ($this->getSession()->getPage()->findAll('xpath', $xpath)) { + $this->execute("behat_action_menu::i_open_the_action_menu_in", + array("//tr[contains(.,$gradeitem)]", + "xpath_element")); + } + } + + // Going to edit calculation. + $savechanges = get_string('savechanges', 'grades'); + $edit = behat_context_helper::escape(get_string('editcalculation', 'grades')); + $linkxpath = "//a[./img[starts-with(@title,$edit) and contains(@title,$gradeitem)]]"; + $this->execute("behat_general::i_click_on", array($this->escape($linkxpath), "xpath_element")); + + // Mapping names to idnumbers. + $datahash = $data->getRowsHash(); + foreach ($datahash as $gradeitem => $idnumber) { + // This xpath looks for course, categories and items with the provided name. + // Grrr, we can't equal in categoryitem and courseitem because there is a line jump... + $inputxpath = "//input[@class='idnumber'][" . + "parent::li[@class='item'][text()='" . $gradeitem . "']" . + " or " . + "parent::li[@class='categoryitem' or @class='courseitem']" . + "/parent::ul/parent::li[starts-with(text(),'" . $gradeitem . "')]" . + "]"; + $this->execute('behat_forms::i_set_the_field_with_xpath_to', array($inputxpath, $idnumber)); + } + + $this->execute('behat_forms::press_button', get_string('addidnumbers', 'grades')); + $this->execute('behat_forms::i_set_the_field_to', array(get_string('calculation', 'grades'), $calculation)); + $this->execute('behat_forms::press_button', $savechanges); + + } + + public function i_set_calculation_for_grade_category_with_idnumbers($calculation, $gradeitem, TableNode $data) { + + $gradecategorytotal = behat_context_helper::escape($gradeitem . ' total'); + $gradeitem = behat_context_helper::escape($gradeitem); + + if ($this->running_javascript()) { + $xpath = "//tr[contains(.,$gradecategorytotal)]//*[contains(@class,'moodle-actionmenu')]"; + if ($this->getSession()->getPage()->findAll('xpath', $xpath)) { + $xpath = "//tr[contains(.,$gradecategorytotal)]"; + $this->execute("behat_action_menu::i_open_the_action_menu_in", array($xpath, "xpath_element")); + } + } + + // Going to edit calculation. + $savechanges = get_string('savechanges', 'grades'); + $edit = behat_context_helper::escape(get_string('editcalculation', 'grades')); + $linkxpath = "//a[./img[starts-with(@title,$edit) and contains(@title,$gradeitem)]]"; + $this->execute("behat_general::i_click_on", array($this->escape($linkxpath), "xpath_element")); + + // Mapping names to idnumbers. + $datahash = $data->getRowsHash(); + foreach ($datahash as $gradeitem => $idnumber) { + // This xpath looks for course, categories and items with the provided name. + // Grrr, we can't equal in categoryitem and courseitem because there is a line jump... + $inputxpath = "//input[@class='idnumber'][" . + "parent::li[@class='item'][text()='" . $gradeitem . "']" . + " | " . + "parent::li[@class='categoryitem' | @class='courseitem']" . + "/parent::ul/parent::li[starts-with(text(),'" . $gradeitem . "')]" . + "]"; + $this->execute('behat_forms::i_set_the_field_with_xpath_to', array($inputxpath, $idnumber)); + } + + $this->execute('behat_forms::press_button', get_string('addidnumbers', 'grades')); + + $this->execute('behat_forms::i_set_the_field_to', array(get_string('calculation', 'grades'), $calculation)); + $this->execute('behat_forms::press_button', $savechanges); + } + + public function i_reset_weights_for_grade_category($gradeitem) { + + $steps = array(); + + if ($this->running_javascript()) { + $gradeitemliteral = behat_context_helper::escape($gradeitem); + $xpath = "//tr[contains(.,$gradeitemliteral)]//*[contains(@class,'moodle-actionmenu')]"; + if ($this->getSession()->getPage()->findAll('xpath', $xpath)) { + $xpath = "//tr[contains(.,$gradeitemliteral)]"; + $this->execute("behat_action_menu::i_open_the_action_menu_in", array($xpath, "xpath_element")); + } + } + + $linktext = get_string('resetweights', 'grades', (object)array('itemname' => $gradeitem)); + $this->execute("behat_general::i_click_on", array($this->escape($linktext), "link")); + } + + public function i_navigate_to_in_the_course_gradebook($gradepath) { + // If we are not on one of the gradebook pages already, follow "Grades" link in the navigation drawer. + $xpath = '//div[contains(@class,\'grade-navigation\')]'; + if (!$this->getSession()->getPage()->findAll('xpath', $xpath)) { + $this->execute('behat_navigation::i_select_from_flat_navigation_drawer', get_string('grades')); + } + + $this->select_in_gradebook_tabs($gradepath); + } +} diff --git a/tests/behat/behat_theme_boost_behat_mod_quiz.php b/tests/behat/behat_theme_boost_behat_mod_quiz.php new file mode 100644 index 0000000..25f10f2 --- /dev/null +++ b/tests/behat/behat_theme_boost_behat_mod_quiz.php @@ -0,0 +1,89 @@ +. + +/** + * Steps definitions related to mod_quiz overrides. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. + +require_once(__DIR__ . '/../../../../mod/quiz/tests/behat/behat_mod_quiz.php'); + +use Behat\Gherkin\Node\TableNode as TableNode; + +use Behat\Mink\Exception\ExpectationException as ExpectationException; + +/** + * Steps definitions related to mod_quiz overrides. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class behat_theme_ilb_behat_mod_quiz extends behat_mod_quiz { + + public function i_add_question_to_the_quiz_with($questiontype, $quizname, TableNode $questiondata) { + $quizname = $this->escape($quizname); + $editquiz = $this->escape(get_string('editquiz', 'quiz')); + $quizadmin = $this->escape(get_string('pluginadministration', 'quiz')); + $addaquestion = $this->escape(get_string('addaquestion', 'quiz')); + + $this->execute('behat_general::click_link', $quizname); + + $this->execute("behat_navigation::i_navigate_to_node_in", array($editquiz, $quizadmin)); + + if ($this->running_javascript()) { + $this->execute("behat_action_menu::i_open_the_action_menu_in", array('.slots', "css_element")); + $this->execute("behat_action_menu::i_choose_in_the_open_action_menu", array($addaquestion)); + } else { + $this->execute('behat_general::click_link', $addaquestion); + } + + $this->finish_adding_question($questiontype, $questiondata); + } + + public function i_should_see_question_in_section_in_the_quiz_navigation($questionnumber, $sectionheading) { + + // Using xpath literal to avoid quotes problems. + $questionnumberliteral = behat_context_helper::escape('Question ' . $questionnumber); + $headingliteral = behat_context_helper::escape($sectionheading); + + // Split in two checkings to give more feedback in case of exception. + $exception = new ExpectationException('Question "' . $questionnumber . '" is not in section "' . + $sectionheading . '" in the quiz navigation.', $this->getSession()); + $xpath = "//*[@id = 'mod_quiz_navblock']//*[contains(concat(' ', normalize-space(@class), ' '), ' qnbutton ') and " . + "contains(., {$questionnumberliteral}) and contains(preceding-sibling::h3[1], {$headingliteral})]"; + $this->find('xpath', $xpath); + } + + public function i_open_the_add_to_quiz_menu_for($pageorlast) { + + if (!$this->running_javascript()) { + throw new DriverException('Activities actions menu not available when Javascript is disabled'); + } + + if ($pageorlast == 'last') { + $xpath = "//div[@class = 'last-add-menu']//a[contains(@data-toggle, 'dropdown') and contains(., 'Add')]"; + } else if (preg_match('~Page (\d+)~', $pageorlast, $matches)) { + $xpath = "//li[@id = 'page-{$matches[1]}']//a[contains(@data-toggle, 'dropdown') and contains(., 'Add')]"; + } else { + throw new ExpectationException("The I open the add to quiz menu step must specify either 'Page N' or 'last'."); + } + $this->find('xpath', $xpath)->click(); + } +} diff --git a/tests/behat/behat_theme_boost_behat_navigation.php b/tests/behat/behat_theme_boost_behat_navigation.php new file mode 100644 index 0000000..46a4952 --- /dev/null +++ b/tests/behat/behat_theme_boost_behat_navigation.php @@ -0,0 +1,353 @@ +. + +/** + * Navigation steps overrides. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. + +require_once(__DIR__ . '/../../../../lib/tests/behat/behat_navigation.php'); + +use Behat\Mink\Exception\ExpectationException as ExpectationException; +use Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException; + +/** + * Steps definitions to navigate through the navigation tree nodes (overrides). + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class behat_theme_ilb_behat_navigation extends behat_navigation { + + public function i_follow_in_the_user_menu($nodetext) { + + if ($this->running_javascript()) { + // The user menu must be expanded when JS is enabled. + $xpath = "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' dropdown-toggle ')]"; + $this->execute("behat_general::i_click_on", array($this->escape($xpath), "xpath_element")); + } + + // Now select the link. + // The CSS path is always present, with or without JS. + $csspath = ".usermenu .dropdown-menu"; + + $this->execute('behat_general::i_click_on_in_the', + array($nodetext, "link", $csspath, "css_element") + ); + } + + protected function get_top_navigation_node($nodetext) { + + // Avoid problems with quotes. + $nodetextliteral = behat_context_helper::escape($nodetext); + $exception = new ExpectationException('Top navigation node "' . $nodetext . ' not found in "', $this->getSession()); + + // First find in navigation block. + $xpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' card-text ')]" . + "/ul[contains(concat(' ', normalize-space(@class), ' '), ' block_tree ')]" . + "/li[contains(concat(' ', normalize-space(@class), ' '), ' contains_branch ')]" . + "/ul/li[contains(concat(' ', normalize-space(@class), ' '), ' contains_branch ')]" . + "[p[contains(concat(' ', normalize-space(@class), ' '), ' branch ')]" . + "/*[normalize-space(.)=" . $nodetextliteral ."]]" . + "|" . + "//div[contains(concat(' ', normalize-space(@class), ' '), ' card-text ')]/div" . + "/ul[contains(concat(' ', normalize-space(@class), ' '), ' block_tree ')]" . + "/li[p[contains(concat(' ', normalize-space(@class), ' '), ' branch ')]" . + "/*[normalize-space(.)=" . $nodetextliteral ."]]"; + + $node = $this->find('xpath', $xpath, $exception); + + return $node; + } + + /** + * Opens the flat navigation drawer if it is not already open + * + * @When /^I open flat navigation drawer$/ + * @throws ElementNotFoundException Thrown by behat_base::find + */ + public function i_open_flat_navigation_drawer() { + if (!$this->running_javascript()) { + // Navigation drawer is always open without JS. + return; + } + $xpath = "//button[contains(@data-action,'toggle-drawer')]"; + $node = $this->find('xpath', $xpath); + $expanded = $node->getAttribute('aria-expanded'); + if ($expanded === 'false') { + $node->click(); + $this->ensure_node_attribute_is_set($node, 'aria-expanded', 'true'); + $this->wait_for_pending_js(); + } + } + + /** + * Closes the flat navigation drawer if it is open (does nothing if JS disabled) + * + * @When /^I close flat navigation drawer$/ + * @throws ElementNotFoundException Thrown by behat_base::find + */ + public function i_close_flat_navigation_drawer() { + if (!$this->running_javascript()) { + // Navigation drawer can not be closed without JS. + return; + } + $xpath = "//button[contains(@data-action,'toggle-drawer')]"; + $node = $this->find('xpath', $xpath); + $expanded = $node->getAttribute('aria-expanded'); + if ($expanded === 'true') { + $node->click(); + $this->wait_for_pending_js(); + } + } + + /** + * Clicks link with specified id|title|alt|text in the flat navigation drawer. + * + * @When /^I select "(?P(?:[^"]|\\")*)" from flat navigation drawer$/ + * @throws ElementNotFoundException Thrown by behat_base::find + * @param string $link + */ + public function i_select_from_flat_navigation_drawer($link) { + $this->i_open_flat_navigation_drawer(); + $this->execute('behat_general::i_click_on_in_the', [$link, 'link', '#nav-drawer', 'css_element']); + } + + /** + * If we are not on the course main page, click on the course link in the navbar + */ + protected function go_to_main_course_page() { + $url = $this->getSession()->getCurrentUrl(); + if (!preg_match('|/course/view.php\?id=[\d]+$|', $url)) { + $this->find('xpath', '//header//div[@id=\'page-navbar\']//a[contains(@href,\'/course/view.php?id=\')]')->click(); + $this->execute('behat_general::wait_until_the_page_is_ready'); + } + } + + /** + * Finds and clicks a link on the admin page (site administration or course administration) + * + * @param array $nodelist + */ + protected function select_on_administration_page($nodelist) { + $parentnodes = $nodelist; + $lastnode = array_pop($parentnodes); + $xpath = '//section[@id=\'region-main\']'; + + // Check if there is a separate tab for this submenu of the page. If found go to it. + if ($parentnodes) { + $tabname = behat_context_helper::escape($parentnodes[0]); + $tabxpath = '//ul[@role=\'tablist\']/li/a[normalize-space(.)=' . $tabname . ']'; + if ($node = $this->getSession()->getPage()->find('xpath', $tabxpath)) { + if ($this->running_javascript()) { + // Click on the tab and add 'active' tab to the xpath. + $node->click(); + $xpath .= '//div[contains(@class,\'active\')]'; + } else { + // Add the tab content selector to the xpath. + $tabid = behat_context_helper::escape(ltrim($node->getAttribute('href'), '#')); + $xpath .= '//div[@id = ' . $tabid . ']'; + } + array_shift($parentnodes); + } + } + + // Find a section with the parent name in it. + if ($parentnodes) { + // Find the section on the page (links may be repeating in different sections). + $section = behat_context_helper::escape($parentnodes[0]); + $xpath .= '//div[@class=\'row\' and contains(.,'.$section.')]'; + } + + // Find a link and click on it. + $linkname = behat_context_helper::escape($lastnode); + $xpath .= '//a[normalize-space(.)=' . $linkname . ']'; + if (!$node = $this->getSession()->getPage()->find('xpath', $xpath)) { + throw new ElementNotFoundException($this->getSession(), 'Link "' . join(' > ', $nodelist) . '"" not found on the page'); + } + $node->click(); + $this->wait_for_pending_js(); + } + + /** + * Locates the administration menu in the
element and returns its xpath + * + * @param bool $mustexist if specified throws an exception if menu is not found + * @return null|string + */ + protected function find_header_administration_menu($mustexist = false) { + $menuxpath = '//header[@id=\'page-header\']//div[contains(@class,\'moodle-actionmenu\')]'; + if ($mustexist) { + $exception = new ElementNotFoundException($this->getSession(), 'Page header administration menu is not found'); + $this->find('xpath', $menuxpath, $exception); + } else if (!$this->getSession()->getPage()->find('xpath', $menuxpath)) { + return null; + } + return $menuxpath; + } + + /** + * Locates the administration menu on the page (but not in the header) and returns its xpath + * + * @param bool $mustexist if specified throws an exception if menu is not found + * @return null|string + */ + protected function find_page_administration_menu($mustexist = false) { + $menuxpath = '//div[@id=\'region-main-settings-menu\']'; + if ($mustexist) { + $exception = new ElementNotFoundException($this->getSession(), 'Page administration menu is not found'); + $this->find('xpath', $menuxpath, $exception); + } else if (!$this->getSession()->getPage()->find('xpath', $menuxpath)) { + return null; + } + return $menuxpath; + } + + /** + * Toggles administration menu + * + * @param string $menuxpath (optional) xpath to the page administration menu if already known + */ + protected function toggle_page_administration_menu($menuxpath = null) { + if (!$menuxpath) { + $menuxpath = $this->find_header_administration_menu() ?: $this->find_page_administration_menu(); + } + if ($menuxpath && $this->running_javascript()) { + $this->find('xpath', $menuxpath . '//a[@data-toggle=\'dropdown\']')->click(); + $this->wait_for_pending_js(); + } + } + + /** + * Finds a page edit cog and select an item from it + * + * If the page edit cog is in the page header and the item is not found there, click "More..." link + * and find the item on the course/frontpage administration page + * + * @param array $nodelist + * @throws ElementNotFoundException + */ + protected function select_from_administration_menu($nodelist) { + // Find administration menu. + if ($menuxpath = $this->find_header_administration_menu()) { + $isheader = true; + } else { + $menuxpath = $this->find_page_administration_menu(true); + $isheader = false; + } + + $this->toggle_page_administration_menu($menuxpath); + + if (!$isheader || count($nodelist) == 1) { + $lastnode = end($nodelist); + $linkname = behat_context_helper::escape($lastnode); + $link = $this->getSession()->getPage()->find('xpath', $menuxpath . '//a[normalize-space(.)=' . $linkname . ']'); + if ($link) { + $link->click(); + $this->wait_for_pending_js(); + return; + } + } + + if ($isheader) { + // Course administration and Front page administration will have subnodes under "More...". + $linkname = behat_context_helper::escape(get_string('morenavigationlinks')); + $link = $this->getSession()->getPage()->find('xpath', $menuxpath . '//a[normalize-space(.)=' . $linkname . ']'); + if ($link) { + $link->click(); + $this->execute('behat_general::wait_until_the_page_is_ready'); + $this->select_on_administration_page($nodelist); + return; + } + } + + throw new ElementNotFoundException($this->getSession(), + 'Link "' . join(' > ', $nodelist) . '" not found in the current page edit menu"'); + } + + public function should_exist_in_current_page_administration($element, $selectortype) { + $nodes = array_map('trim', explode('>', $element)); + $nodetext = end($nodes); + + // Find administration menu. + $menuxpath = $this->find_header_administration_menu() ?: $this->find_page_administration_menu(true); + + $this->toggle_page_administration_menu($menuxpath); + $this->execute('behat_general::should_exist_in_the', [$nodetext, $selectortype, $menuxpath, 'xpath_element']); + $this->toggle_page_administration_menu($menuxpath); + } + + public function should_not_exist_in_current_page_administration($element, $selectortype) { + $nodes = array_map('trim', explode('>', $element)); + $nodetext = end($nodes); + + // Find administration menu. + $menuxpath = $this->find_header_administration_menu() ?: $this->find_page_administration_menu(); + if (!$menuxpath) { + // Menu not found, exit. + return; + } + + $this->toggle_page_administration_menu($menuxpath); + $this->execute('behat_general::should_not_exist_in_the', [$nodetext, $selectortype, $menuxpath, 'xpath_element']); + $this->toggle_page_administration_menu($menuxpath); + } + + public function i_navigate_to_node_in($nodetext, $parentnodes) { + $parentnodes = array_map('trim', explode('>', $parentnodes)); + $nodelist = array_merge($parentnodes, [$nodetext]); + $firstnode = array_shift($nodelist); + + if ($firstnode === get_string('administrationsite')) { + $this->i_select_from_flat_navigation_drawer(get_string('administrationsite')); + $this->select_on_administration_page($nodelist); + return; + } + + if ($firstnode === get_string('sitepages')) { + if ($nodetext === get_string('calendar', 'calendar')) { + $this->i_select_from_flat_navigation_drawer($nodetext); + } else { + // TODO MDL-57120 other links under "Site pages" are not accessible without navigation block. + $this->select_node_in_navigation($nodetext, $parentnodes); + } + return; + } + + if ($firstnode === get_string('courseadministration')) { + // Administration menu is available only on the main course page where settings in Administration + // block (original purpose of the step) are available on every course page. + $this->go_to_main_course_page(); + } + + $this->select_from_administration_menu($nodelist); + } + + public function i_navigate_to_in_current_page_administration($nodetext) { + $nodelist = array_map('trim', explode('>', $nodetext)); + $this->select_from_administration_menu($nodelist); + } + + public function i_navigate_to_in_site_administration($nodetext) { + $nodelist = array_map('trim', explode('>', $nodetext)); + $this->i_select_from_flat_navigation_drawer(get_string('administrationsite')); + $this->select_on_administration_page($nodelist); + } +} diff --git a/tests/behat/behat_theme_boost_behat_repository_upload.php b/tests/behat/behat_theme_boost_behat_repository_upload.php new file mode 100644 index 0000000..368e4e4 --- /dev/null +++ b/tests/behat/behat_theme_boost_behat_repository_upload.php @@ -0,0 +1,134 @@ +. + +/** + * Override definitions for the upload repository type. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. + +require_once(__DIR__ . '/../../../../repository/upload/tests/behat/behat_repository_upload.php'); + +use Behat\Mink\Exception\ExpectationException as ExpectationException, + Behat\Gherkin\Node\TableNode as TableNode; + +/** + * Override steps definitions to deal with the upload repository. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class behat_theme_ilb_behat_repository_upload extends behat_repository_upload { + + protected function get_filepicker_node($filepickerelement) { + + // More info about the problem (in case there is a problem). + $exception = new ExpectationException('"' . $filepickerelement . '" filepicker can not be found', $this->getSession()); + + // If no file picker label is mentioned take the first file picker from the page. + if (empty($filepickerelement)) { + $filepickercontainer = $this->find( + 'xpath', + "//*[@class=\"form-filemanager\"]", + $exception + ); + } else { + // Gets the ffilemanager node specified by the locator which contains the filepicker container. + $filepickerelement = behat_context_helper::escape($filepickerelement); + $filepickercontainer = $this->find( + 'xpath', + "//input[./@id = //label[normalize-space(.)=$filepickerelement]/@for]" . + "//ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' felement ')]", + $exception + ); + } + + return $filepickercontainer; + } + + protected function upload_file_to_filemanager($filepath, $filemanagerelement, TableNode $data, $overwriteaction = false) { + global $CFG; + + $filemanagernode = $this->get_filepicker_node($filemanagerelement); + + // Opening the select repository window and selecting the upload repository. + $this->open_add_file_window($filemanagernode, get_string('pluginname', 'repository_upload')); + + // Ensure all the form is ready. + $noformexception = new ExpectationException('The upload file form is not ready', $this->getSession()); + $this->find( + 'xpath', + "//div[contains(concat(' ', normalize-space(@class), ' '), ' file-picker ')]" . + "[contains(concat(' ', normalize-space(@class), ' '), ' repository_upload ')]" . + "/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' fp-content ')]" . + "/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' fp-upload-form ')]" . + "/descendant::form", + $noformexception + ); + // After this we have the elements we want to interact with. + + // Form elements to interact with. + $file = $this->find_file('repo_upload_file'); + + // Attaching specified file to the node. + // Replace 'admin/' if it is in start of path with $CFG->admin . + if (substr($filepath, 0, 6) === 'admin/') { + $filepath = $CFG->dirroot . DIRECTORY_SEPARATOR . $CFG->admin . + DIRECTORY_SEPARATOR . substr($filepath, 6); + } + $filepath = str_replace('/', DIRECTORY_SEPARATOR, $filepath); + if (!is_readable($filepath)) { + $filepath = $CFG->dirroot . DIRECTORY_SEPARATOR . $filepath; + if (!is_readable($filepath)) { + throw new ExpectationException('The file to be uploaded does not exist.', $this->getSession()); + } + } + $file->attachFile($filepath); + + // Fill the form in Upload window. + $datahash = $data->getRowsHash(); + + // The action depends on the field type. + foreach ($datahash as $locator => $value) { + + $field = behat_field_manager::get_form_field_from_label($locator, $this); + + // Delegates to the field class. + $field->set_value($value); + } + + // Submit the file. + $submit = $this->find_button(get_string('upload', 'repository')); + $submit->press(); + + // We wait for all the JS to finish as it is performing an action. + $this->getSession()->wait(self::TIMEOUT, self::PAGE_READY_JS); + + if ($overwriteaction !== false) { + $overwritebutton = $this->find_button($overwriteaction); + $this->ensure_node_is_visible($overwritebutton); + $overwritebutton->click(); + + // We wait for all the JS to finish. + $this->getSession()->wait(self::TIMEOUT, self::PAGE_READY_JS); + } + + } + +} diff --git a/tests/behat/blacklist.json b/tests/behat/blacklist.json new file mode 100644 index 0000000..1d0c8d8 --- /dev/null +++ b/tests/behat/blacklist.json @@ -0,0 +1,8 @@ +{ + "features": [ + "lib/tests/behat/action_menu.feature", + "course/tests/behat/activities_edit_with_block_dock.feature", + "blocks/tests/behat/hide_blocks.feature", + "blocks/tests/behat/move_blocks.feature" + ] +} diff --git a/tests/behat/contextmenu.feature b/tests/behat/contextmenu.feature new file mode 100644 index 0000000..85df6e2 --- /dev/null +++ b/tests/behat/contextmenu.feature @@ -0,0 +1,32 @@ +@javascript @theme_ilb +Feature: Context settings menu + To navigate in ilb theme I need to use the context settings menu + + Background: + Given the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@example.com | + | student1 | Student | 1 | student1@example.com | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + + Scenario: Teacher can use the context settings menu + And I log in as "teacher1" + And I am on site homepage + And I follow "Course 1" + And I click on ".context-header-settings-menu [role=button]" "css_element" + And I choose "Edit settings" in the open action menu + And I should see "Edit course settings" + And I log out + + Scenario: Student cannot use the context settings menu + And I log in as "student1" + And I am on site homepage + And I follow "Course 1" + And ".context-header-settings-menu [role=button]" "css_element" should not exist + And I log out diff --git a/tests/behat/regionmainsettingsmenu.feature b/tests/behat/regionmainsettingsmenu.feature new file mode 100644 index 0000000..b21359f --- /dev/null +++ b/tests/behat/regionmainsettingsmenu.feature @@ -0,0 +1,43 @@ +@javascript @theme_ilb +Feature: Region main settings menu + To navigate in ilb theme I need to use the region main settings menu + + Background: + Given the following "courses" exist: + | fullname | shortname | newsitems | + | Course 1 | C1 | 5 | + And the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@example.com | + | student1 | Student | 1 | student1@example.com | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | option | + | choice | Choice name | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | + + Scenario: Teacher can use the region main settings menu + And I log in as "teacher1" + And I am on site homepage + And I follow "Course 1" + And "#region-main-settings-menu [role=button]" "css_element" should not exist + And I follow "Choice name" + And I click on "#region-main-settings-menu [role=button]" "css_element" + And I choose "Edit settings" in the open action menu + And I should see "Updating: Choice" + And I navigate to course participants + And I click on "#region-main-settings-menu [role=button]" "css_element" + And I choose "Enrolment methods" in the open action menu + And I should see "Enrolment methods" + And I log out + + Scenario: Student cannot use all options in the region main settings menu + And I log in as "student1" + And I am on site homepage + And I follow "Course 1" + And "#region-main-settings-menu [role=button]" "css_element" should not exist + And I follow "Choice name" + And "#region-main-settings-menu [role=button]" "css_element" should not exist + And I log out diff --git a/thirdpartylibs.xml b/thirdpartylibs.xml new file mode 100644 index 0000000..4c53f53 --- /dev/null +++ b/thirdpartylibs.xml @@ -0,0 +1,101 @@ + + + + scss/bootstrap + Twitter Bootstrap + MIT + 4.0.0-alpha.4 + + + + amd/src/alert.js + bootstrap-alert + (MIT) + v4.0.0-alpha.3 + + + + amd/src/button.js + bootstrap-button + (MIT) + v4.0.0-alpha.3 + + + + amd/src/carousel.js + bootstrap-carousel + (MIT) + v4.0.0-alpha.3 + + + + amd/src/collapse.js + bootstrap-collapse + (MIT) + v4.0.0-alpha.3 + + + + amd/src/dropdown.js + bootstrap-dropdown + (MIT) + v4.0.0-alpha.3 + + + + amd/src/modal.js + bootstrap-modal + (MIT) + v4.0.0-alpha.3 + + + + amd/src/popover.js + bootstrap-popover + (MIT) + v4.0.0-alpha.3 + + + + amd/src/scrollspy.js + bootstrap-scrollspy + (MIT) + v4.0.0-alpha.3 + + + + amd/src/tab.js + bootstrap-alert + (MIT) + v4.0.0-alpha.3 + + + + amd/src/tab.js + bootstrap-alert + (MIT) + v4.0.0-alpha.3 + + + + amd/src/tooltip.js + bootstrap-tooltip + (MIT) + v4.0.0-alpha.3 + + + + amd/src/util.js + bootstrap-util + (MIT) + v4.0.0-alpha.3 + + + + amd/src/tether.js + tether + (MIT) + 1.3.3 + + + diff --git a/tmp/default-saberes.htm b/tmp/default-saberes.htm deleted file mode 100644 index 107a795..0000000 --- a/tmp/default-saberes.htm +++ /dev/null @@ -1,307 +0,0 @@ - - - - -Moodle - Saberes - - - - -
-
ILB - Instituto Legislativo Brasíleiro -
-
-

Coluna de conteúdo do sidebar 1.

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

-
-
-

Título H1

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. http://www.senado.gov.br/ilb.

-

Título H2

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. http://www.senado.gov.br/ilb.

-

Título H3

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. http://www.senado.gov.br/ilb.

-

Título H4

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. http://www.senado.gov.br/ilb.

-
-
-

Sidebar 2

-

Coluna de conteúdo do sidebar 1.

-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

-
- -
- - diff --git a/tmp/ilb-saberes.zip b/tmp/ilb-saberes.zip deleted file mode 100644 index 3be2089c71efd2e99cf70bd71c0ba9f36cf7a76b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9625 zcmZ{Kbxa-Jw)DX%?(SCH9g4dYI|uh-#a)X#6zAaXF2%jLyIXO0cldgL@7;VidGD>A z>{%;WnaTchPexfD3K{|Mue$P=llZ6k?+f}bez!4aQU1Gu^|yxy%>3P;@mq@efdK%7 zU;+SW|Gi;tXKu&z-P)Mh-qze((*+1zUm=Alq?Vwy3r7DGhnET=WoYJ? zOD!2|8=Hs%aTFg9JDh7&&_;w-u(R!DaPhX#wBVK9FtO|<{PN)S{OSbR(2zJBb`%Z) z0Hl^hKt5VFba?8cZR>Sx;5#nqF*#dELfvu{z^vdKqe2ad#Z?=Ql{KQt0iPVf$@?C znwTZw@u6DXptVz@$+ddt@%4)F{v5^`)iDg_Z4Fp!BMbPt$V%iM(KX5VJ(jj@jh78e zA)Ng#G7Br&BwskwoYHZ|nEFsQ#2ZMDF@G{LjeA7;wYHMt0b6LQ}oErK;yG44g)6v^~B)8>FL-B<4|OM)9wx~CgzKcxQO2Y zLif&QgowDVI~q!bFC*=5qOr3rT27*H!*}nHb}{}uYAwz80>jAX7_Fe*4bxV7ylh11 z{=rGa-4|gI#qkg1hK4uP6$s=ItyjDHz$ylW0k{x8GUBuGY6A1_=k%W#$xWf6Q!-w9 zR5SZZ*bSAj76pOW82yYN3MpEo(S8(}#P4EOmJ#I?L{n%%dNpT`hEJ(hVG&8AjM;hZfCjS^p5&%K&8O@Gldg{+g{Jfyc51*`!d+)b{?%}Jeg?DsZ z&QYP3%Df6JGMpK~Mn|{|JdhBlw~O~>;|D8B-oQTtWD!>C4bE(uWq7r=;05bJ4W~#SKbTA#D6h+xw;b$+ zQxM=K>NK&izJqVMha)Lp!-Z%t2uaF%TD0&2b4Q z=QV${>QdRlxw-oIIJ-7Bbu~HJ51HK7Ru@aJ6)thM`*?h3%QLaJa++nWY4kO-ayLmC zA-lW0ycD>9IX*tV?1{MoXL7BvR4ctz@okv#_%hp`F|=agK8zbAMAm;y^}r98lvj4o z(#}8uWZZz*CN6qKjY#XJ&e^l_Codwp`p+5(qnev9&VoyKF0)!g`oDVzH@k*^#NNDj z5Dc!8aU&#^REQLo%qnwDEUNMss*GhSU22Xyp@C#2Eid;p987D^-{_nNI4?{Qiwdc^ zJ-a^hZrYniHH*j0&$9MJ>Sxb6%X+wd1deVJiN6aOs1`YX@9DH(Fpliq%C5$sUgb6K zP|zwBEa0K1K~RTymMzB6ZCR9dAa0DfuyN?^Sxb8r%SG=LWEB@Kmk0yfZ168UE1%r@ zM6GwU>zz*60%Gd$*>ip${e3YdYns1w~B@0};2TdwY@C^uYbEDlRNd7rmy z4`HCgR4M(sNe|>Nxj;5~s%r&jhE|(&bR4|nl)7qYY+6a|3eG`R|JQlW`oVp8{3eXDK%vp|xF!!1;JWx0_0cpzRA^6z*0+aLzil&4~@xl)_d zSgCuTb&N_Df7W1o_wiptDhX-8$m5dL;h<>v@m{~hl|ICzj)3MKywY~)->MBmw-bch z+)3OVvYd~UKzEYP<4!eH#byD3H~U&Zsc@bnDY)+n8o2e!%Sp?6GXAMv}0E`tOdAxcGs!l7X`*J zns{aJ^LBl{0tzPNQN#KWd3XHzI>}!mA?g`B=8415!p13OqN~ANyGMzQAQ!$_3kd%->b;F1|BgVujgRVAQXm5V9FCvJc70QvkF8l3ztt zp*6>hFTUkVv@>uA-N}li=#c^imTcv*XR&6mZO|0B*~;*V=tiryn>4DZ)F$3H50{9~ zCvk~aBVlCQyQE7@g ztF$_I(cOw|+kuS)zTJFgUP?oh3@gYNpUQkEA%JQlTQgk;lXj(!Rm=RX_L?Pw#*7OY zD?$Ngb08U$DYsb8LrB=AZjU`7TmJAhfZCysWFugn25k6*8z3yC#bvUa+QAk-gg+X{ zzZZ-nC>O7GSXqeogHFp3ST@S_{LE{CaPLxzQTidVrNto& z`*57;Mb6$=Mxo22{~%(M_yz_KdPuzR&EbkI=ftwLRVHb#p@E-vRt3R87|O}n+HH>$ zTjZ~^(N2@%zI_NAHps}h7(F~ii5Ju*4b#oxU+|tp9?#D$0&$ee9B0YS%E<{JEzX~X#$XREDCPw2-4P{X9?yPq-q4W_3u(V)d}F<1Z#h-Na8!BbMvEd=ODXs zQ6X!2#``!831eL@AGR&4yBpX$?A?Ddq5b@83*Co|kQYV0RJ}6qtG;r~!z29G`@D*c z`W%0D+SX0!mE;7TlKJl|&nt^-L~qM-9=Y8ms#yDt5rH;vf(ml{O??gdo8qOM(H(Ma zT?@-uE&;_X6W=3LLlW0FF|fW5v34MN%%{8CWE>Lp=orCxGOgH_u4#c84^1przewZ&6jR4s*!Px zm!;MLo%3I#pD2kjzn~HuQn?^^-hp2|IXE~xGe_Qfz@K7ozj;)u)=o~>Bj)wcR>uXc zC{=Dj;fCJmcjn~pZCVNM(>v3@DEa7Vq|THdT3Xb|1K?_Y&{xY|9d!7BWfMt6E~t~viYRlc%&-*%@%$ihmG8Y z>klCY{N>**4Vi*L$JGjbUKTm|JeI!RRDSENdgGl26?^9A-=5*SghM*yYKzkx*!>~4udkABvFziTa@;-Uv9^|o&m#PC<;Y#_D8cn9RGrz1b zJ&I%7Z*{sy-q^omG*(T>bJA1YNRV%}OFg$TztC9ZbgN&|^7!mH7hXc2Fq^ltp2<;P z`~4v|i2i6+II^g)SD;G&~8`d))2qaThWTN;w|lmUi@sjB4&GNPV@4 z!j(Fi%)-JK!v>xTmxElUxQehl;=4*rn_FI`KA|lh+!YSFt{yEhO2vhPNPF^mU4l z*R^L@Qvuw+klr>>Nh(JayLa)#=d&8U{E}Dapwh|i5#k@st||9SS3d0(i= zeQS6ba{9S(hc|2byK z?D{#pxwfx3exlmm&9PGv7yfZ}tkD`PeNFfYO|Yx7dEpxg|m$ zHFZc8#uvziX3a1FXrXJd=y?#!q`Y9^kfl{XzzyerK>^-R@tRqf1Qu{wR%U*Y&C4Bl>Lm-hz`1k0Ra3ps{kgZW=1a7&P+~5 z#-@&@PRth0HhVfcc0_!xK8+9`a9D5!rM*TOG>PHn3+ zO%&q_)pb(dm>}+r`~fdX#e!14j0a*1lF9glQUPQf90cX=e1eM?8NKwRJ`Y-LYk zS7Uot4sW|x`Ft6TEJX>!c72=m6VA;3Nq5`Xl@q#EusY+H!oZmsztE>#4RBWEg|kX4 zy$m6W--3b}Zsf>3_XaNE%@ffef)-Q#Ixgl9TGK46wlJksj;a7~+l^jBx#4c{=a@m3 zK55c=2mRfz&>H-&Hws#xe2L0+K{H{vJD+2C?4t*(HTY3Sy%V=Y7{U6Cz3&qR?fhuO zA;%+vq)`K{nm-*5x+ZY)gR|@+1veU&I;gmm42p08#!O0iWT?fauOj8= zF@xpvmb>9i(>;38X7jxVBw;8I!jiwTm5cX>zp@5DJEO0SJYB^Yg#cr?4Lm0y=}1R&lQk5Q>C4c+aP zHsX@ZFXjSsd84Q#z8BY(D>u^US$tg5c&=sJCTn<$%?|5jxqfE46Y^H6>+I71R@aYq zl(Q{WsF$2C(QTf18!O zN(CczH+3>ee?-05$?4d^Vm4rk8@}YNQ`dT3wZf7Ki&v(d?d8#>7qqL#mc(}~+pKF^ z6)!5VN}GE@nh;8R&az%u=IPw!d$aX+btO(h3`H1@Bwqvxz&80cxX$r2ehaRYga{t_L8bC z(cYfy_w5~0Dxf1WAqGh!b7<+$$&&=kzx!NzdkK`%`bCf~y|SrqWu78I zot8L>td0d#bYKO6Du%Q9yL&bsn@VX&8w{z>P!Nh3OH-4Fz><}nWgU)saCu{dd9VN^ zld+NB&K9|cycR+lB~yPCE=Uo`gA4D++x%_L{<$UYa%e=pNM9%ahe>Wgeh^l0IdE6a zJc?hsU{t3?AdNot8{azQt6w(p<8p9z@?~8UwOkn+e-#`dNiH2ds9AoFnjHpHHX9Mf zG7f7a$1Jx4F1=EQNPkPKm<(9j*X{_TIt5Zih=+b448JMt5#OE~3*L-yhNm+-Qb3`{ zaim^UkXdO^K2^#B@w*K)gA5?pHp1wj2J-dsZfFsP@~QN7;}kYsP=xmOZ>KVvAX%oZ ze{7NxPX|yA3o`YIz7_)Nbm_bL)5gkvU2v zzqdmf;5LMs&L9#%PBmeyL6prEj%wY*F)>!*=kPQZ3sk#uFd7z2^#|-AQ(Z?9)((Ts zzt8C|(1>tD-c0DixMYS|04n@Q+8KbDV7*Y0G3n463jrzv4bD%iW>)0gO=mExk;B|A z#ZUz1v8gI>P8zu%;?@Bl!Z-Dck$LyztqX2 zeA>xOn>6xCw3j`{OkPw(Zm-S1*Y8@Ea%&ZK$>SD)kS~O(n-C1N!arb!wuYSmYxP>b zeXDGBhqW3R(aXck>7=jV5j+C4#-57lLaNGB8vcQW2Jj1~8l3mm|0OvGo_F=RuF1(Q z1++)|d6r%_wTxPBT*Z3RqS*ThugX0+qunoXdae!<3TN4C< zOCq$Kd+22}!p;5D3AYv-tQj{fV%2| zNi9LX-zA0N#|3=0Jt)TV1O2Nex7ygyO@M5N`SQhtlxs;21oEx{5m>`%a0Y(B3u2*M z5+HA6-d_~OkdhUTPnl+@POM@sD@hGr`qTgyC;rdy;1?O5 zO{oQ=F~f8CA2b$=GU|3f&uRfdA))g^^so1)C=n!Nij=&~_nLqXr1rj8?%wzT*&lcs zniap+wX`>*E+O#iZ`bVI7r7aiSYgL&z~Tg@oB|C;Z)DmIn)>VbwhgH z)rsTZ-`crp;$3d=%9+fstT&7a3=N7{=?Z_GCs&1FafuU7nP8>Mw15kzLPf172nHi` z^&jrO_&`)KV`T%wh+68DX=D@%Cj3ad@JJCHYdL=M~nI$m*;vj7GRK?Iov+BA&r7?c9C!IEdqpE(fIvZbIvi$x6=wM?s*tRQjr zZ`_fdr1(PAO-0vVq2D)K(io6&R0Q zecr>!g9$@U)@-2)W7kvx?a=k^*GcMRyWx(sv1EAyQrpTDz)V3Alo!ZW(_phRnmgC#K3t|MU6RG+uogwR_}R_M?)mXM_F7XOI^w7>AJmWW*nGtgVbwZkBMK^Mi=jSuIBk_k^yR0<=2fMvDa@- z(|cm7+LUmcq=pXRDH#~PX*~il``ugp($#Lou;34Aw_HVttj)41Wy}G&2ycpU37VQ7 zKj}#iQFTX^VaH($N^`?&m4rf#nT?StHYUm*_Ln2bkjNt%0kWV%zoq;7w+I~lO85m=OQCaKQ4Pd(TF|{oj zDAM7{XG!E`D8DoF!j!~iITUs~4KCN$9vp7P2qv*j6eqt#4w@Mx@UYFflFtb8oO z+5Td~Ct0~&W1}y~ulh^*I3X{5`%lTkEarZm!DJliy6=yT*4*lS8BUKQ1^gztr0_KM zw8VK9*)Ew&Eo3XEKGoD;#@WBtFpioUizVf-g3(htjydy!+m)TCbKpX(9t1uGAsR=PWYR=xhJFJ_vt-WHTL{d}LzR$gB44hnPTv$DQLHr=-Z5Xx(C{B6o) zw4~`bMojt=Xo*nqqnAQ!wM94j1t4iZzY;UnUiw@B=Shva>!;~_fef;7}LTAdyNTflllR@J47Ky}mgS)we?lf_a%EY{oNOgx}|J`gLkPVQ&S zUsqlde_<{C7lSAzqhc@B#!9igHW@Afgu~>`1n5O-Conx_^E<7SQ$nnhAiD^PUmpmL zG3rI2Z9=JYBV=n={q*Z-xj@`1u(X%lCzGvcW)r?^=8@9gBxi*0iB|uu^r>K{L}xOh z(=ycE@3C~6dSAXA2W#5l=u29|2^BDc$Hogcw4~;~6I(f(KU98x&B{%V=#zrCYhp!Q zf^&YTI1>Vua&9R~l^-4=@QcCnbc3s4lx-umNFZ#~8WS@wVHaK#LLaK$JA8BQfiGk~ zN%YPj59`nD&P~qs#$7wO$88^bFTbwezl|V1h~#R6q)yK^yHO!v1BBW=1RinC0}5L4 zB72Kf%^q=Zu~wY}6XG~y}9h)Frq53?wurE^p=g#?DaucLOd2yQw-(kfg15YRDd3%UxI-M$@Mne+K za+FVNuIVI75>TaD19Mp=^M>DuI^f*1h39@)(?{f%9sZqpdjq94yF}TWi}%@7=X%!N z{`Tc@3!VPLeoakM@F21jGy>IKcl*Ml(r3TWGKQ`EBiRSH*fRGEwcV5A9P;cil_eR5 zcN&Dch0`V0P`WPhk94UD#J_$+>_*Eau&#G|h$oKe1V6Ea-KpSM>2=QjJmsbu^yd7s zK&RYwX^yi=0?M19-01s~lMbWX+eXRc|8ev9iUpZBf?|K0e#r0|!jha6R=)Le>&!CU z>%datd6U^<%gS9d^EOi+$Y21AwALURhJEYrm{(*zJ>SvUUy7A3GG^11EjC2l#oe4ki*9fZ2Idq+r=#LfDU2D%I?qmu|o z$|odNFfiEkZqnMc-k5(zWpd{2*4detd3C-xmK7ma-T;@P_%- zlpL%6X|u5ir4R|(sS+VR43&W#ry>d^X*T~Ry(@Hu_iB|6%Y0USO&sJbDMZwJ87tsx5iyN8#$z5V2%~U5gm8^wvP1=bsEu z(gk0;8W@c-Ns(gv0DAm@^1Oi9I18Qc#U+sCYkFtySN>79JHBzLSBZNtKi=ha*zWk+ zMrE8blb5vJ%O=?Q@hID#rtqMTvY|lJ^t7pF>o7gm*hHNP6S^}O8MCty_hhFm4*^LE z_`h;Sf0H`@6dL@0;lENx2mrEw1_%Hiz$=;@_b1IH#J^ELWgPuq^MA4aU)iL8vy%N~ zrTEMBFV_D|D*dMda<}1KhB@`n{_h#hxh*hk3vk$ diff --git a/tmp/img/logo-ilb.png b/tmp/img/logo-ilb.png deleted file mode 100644 index 2bf50f9e9fb58e94efa62e2d95071d61b17b2ce2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4998 zcmaJ_Wmr^g*Bu2#Iz%KCkWfHksG+4}KoCYGBu8d|5hj44B}I^Kl$4SXkZwe2kQ_Rs zyBrXt!Eb!t$LIZie9w2T>zq5zT5GR;?|uH9U|k(`N-}0L002M<)=+^EMkL{WdX0$i zd}YkzKp2>?sz%tyXltx1)DaF)grT3o*}+Jt4IBc8!rUFY;IaS!5j#TP2y3MMP}&NO z6omf92)ZFL1U3L5EANJZTG_#|?9bpf2$UQLzWy@@I|3%hVJNN*)W#^oZ4nwCj_}7G zI{H=~c2-g_4*3V{vTo7@0VEs?Wp_i`qnxDO zr6DS6f5#%M~I8x$iXEC~Fa(jTC<_Wut> zBL6``lp6(#W!be(~9vK~QD=1h^Wo74J z;ro6=U9Ep^_wXQ&PWz1%Nc7X-($2wgWGQZPZP(nycxz*0ps%;1y|rp!F{O6&?Be`W zL*4N3kfNMS?Z9Hs*RHz$`8y_QccEEjCB-I21|K_TJ`XSV_x7kOD;}Jj`ulo!b+$vz zO|ec6WNNX8XXjGr4*>oEF`yuZkQ*FkWT^k8@zY~nov`A8;J{bTneE3%N2v{CAQ9ok zg@yFAR278>yF2*iFP~Ez$K@nJ-CdnTsxf)*vl?)V0QrdM$nejf8i4TkzFsc|2KpXI zOV(6XOpK3-+UBgTtW2$b*Y>R(8y&5!t$l85eN{8=*RNlI2a(g?rat85ew&)q(onmq z6#ce(xMghB!_6f&I%%klyA@kRHY_hKMwJX~ZEhL|*Y?e94Gj;`8KoT_9)6qp zwz|4HwD5gwWoHfl)8|8Jlm#l7>Fl%gHqHnT!A>uYO>9u^q@02Di5 z6-9lw$t`0~1^p+?@`ip;H`BmsY6WXzzxF%3{vLV@?-z)Oal|jO?&Q3Ft;zE;go}nF zCOcRy<}_TB_xS_8(irv*86r-r98^_uktSmKSwdO7XJ0Cl8N+MEf@yi#jh=6bPI&xT zBmU59^)%wzMUP)vhMclz;K8rZ9An{Le+ss8`D?wAoW<6MLqDD+$+hy%`dDz%dC6~7 zj2El|43ke~`EoCh;M z(bP}zXXU<69~Thz400`XEU&katgoB|YgNYQWE#h-tfk@877DM4I%tv^Z?57Mkdb3s8 zHa(v=WI?ISvo9__N|8(}upq&_&aH0^GRqx0ZVpDar1yTgV==f9f|NdzJ*?WawO0uj z)DN%9J~oN#3&E~DmG`Zeo94-mvT!@8HCfWc$_D^sl@P;N~tlI!l*SR9(b&wY3K zm<*IE#$GQ_TLLwwY{eMO)7MNWY@R&&^qfnAijxKeS)unWx}&98LBTri18HajuHp7* zBNWPd=Z)@(az7j}0)(@uyHiKq+gC}6!;S_cRy2j*-@kk zHLOfCKcLE#jOHQu8u+6f>f>26lgW-9ob@=!rR}qk3Wqho+XwMJjb%FY$Xc=IQI6|t za&OhM2aIIEcO%c&+n6~A)MzLUQaI1zC3yR_@00r7mE30vC3b6HVtyr<&Wm z@D?`nWhM!Z?i=Z}LvNSP4sz^+K%eQea1xiiGbvo+2K$!UEw5fVrioq?C_HDf(KD(; zocV*(y=j~ba`mfL9@xq<1_x{)0`B6+pfbYBVsqyj(VF%mVJnJ5<|?B>yk5ubbtETd zL)63^=h#t7a_4J}3cOlVPb#)Er^0M~nJzPKJ7`M3Iv3fNepa|s|E^qzi&CTTYWPZ8 z)?(P3v%Z!!`Uh()#?|!!$$f`rt1*|x{V5`f+1QLB1(i(&Sbk`!*oaEf3w<$2FPFdP zJJ~nxQ(>GkK@kqUFx^mxEimqLSZAzJDCPKwc4)LBw?@ETxtc;b_no6-Peh%? zloRq38d1=pQLSTVwaN?Du%?ck20>-UR|hYXmB7i&F06Eh4RtO+$s{&BSA_kvt=Fy& zA5*wOE*Obm#?kgeEQe?0q88vkGBUQHod8t2+ABMXOx1{`KmO=)ezSXOD{J_#1#mQp>1?CP;){Jo_`_w{e$hN%sk5%CbBuBc`%o}@Pd2E zN-90IGy|q`1tz8Xd?U|~Lq>o{OYj<7w+i>ieOii6fw`k!mMYPPGAfUo$TRs@Z`=w~ zAOlPAU3uOOvsVvPS059Q?Bmf|25fYA*vuP)R7Q8m1SqJQ$~&$u za-?nzNF2`SdIw zPt7iJMg=;8j@OGvQl1*p+rChvo=OIZ_pZEhSUDMaNPeCkF=)66St+c(B6T)b*B1Uz zV!AnpxWCq>W>l=wC!k$tAng7%1H+|-yOm?Z_hiWz6mDgoq}boL=lsfNFk{C)BL z8T}l?JSNQZ-p8qoIws#d=|2?b@`NZ}i+|qLbVXZ`K2VvLH#47ZH?IDX&w~lEx1FBe zVdZ)Bo40vOE-Kw(^)@0HuZd8dX%t7RJWAO>;8=rNhbw#gvNkRP-GTH{6wN{!o1m|? z6QhA>=Oph#CpdZiC;x^@VS|~O8G{b>KJm&#XvVR!PN~$#SjGiOag5J!V(o{P$o`AN zc^`k!(Q@de?{gJ;m3=2aFKbL1RCIo79)p=g{~YiIU~2VHsc{u+9ED6`$qzsB0BXu$ z$v-nMW7a>{1IQ8--i;M)&(}A$#xLK+bW0=3oj*@B2Ge4?iBkl(1<|2*<4o{-_QA0- z@TJ0->DQWvrqlAy#%}Lz#?yl*cAhnMsU+Gj82mbWLNzZ*t1d)j^oDIyez*POS;_DQ z-lO&8F3fOc{EgQ`Z0ttu&vztns_WI<`^7o|R(=-ui2LHWt5mzISr-#&-^@W$O0D%Q z-1HbO`PG(unV+7g$lWxgKN9kokJ-(_Z* zE5EM+`2K90G7NMz>&CtQ9$T;v(b;{HPYhEP0_u%ldEIHeA^OXiPc1srNWEY;sF&aT z*lx-6of0@jYc-bH*XH&}WHo~s-j}+R-0SE6&`5EC+kDVIUSNO#d7u~!o>E+7O=?ztzAsrOmDc)mZjhrP?B)w-{QP68U9Aj*XaV0K!(}ojbiiL2VJtYo|d~C0hqj)h)Kf z-x41SYUog|&9kyr5v!9>#E|I6;Xg#&-`qv$UyM$2)u=4&cHvM`acu_4_J!dIHgRmx z#zEUehd|?W^wGuyRXO0q^J;tGP5q9xyYvY~rR|D8<6ByC7Zb2H7SL#Wb1Yx=l&JJ< zhOF!9$z>% diff --git a/version.php b/version.php index e015066..01b8137 100644 --- a/version.php +++ b/version.php @@ -15,18 +15,15 @@ // along with Moodle. If not, see . /** - * Theme version info + * Tema desenvolvido para o Saberes (ILB) * - * @package theme_ilb2014 - * @copyright 2010 Patrick Malley + * @package theme_ilb + * @copyright 2016 Frédéric Massart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -defined('MOODLE_INTERNAL') || die; +defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2013050100; // The current module version (Date: YYYYMMDDXX) -$plugin->requires = 2013050100; // Requires this Moodle version -$plugin->component = 'theme_ilb2014'; // Full name of the plugin (used for diagnostics) -$plugin->dependencies = array( - 'theme_canvas' => 2013050100, -); +$plugin->version = 2018050900; +$plugin->requires = 2016112900; +$plugin->component = 'theme_ilb';