From 04975cd2b203802d29dc7a22df0f5849026910e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Mart=C3=ADn?= Date: Mon, 16 Dec 2024 16:44:08 +0100 Subject: [PATCH] MDL-75669 theme_boost: Refactor custom form elements to BS5 - .custom-check is now .form-check. - .custom-check.custom-switch is now .form-check.form-switch. - .custom-select is now .form-select. - .custom-file and .form-file have been replaced by custom styles on top of .form-control. - .custom-range is now .form-range. - Dropped .input-group-append and .input-group-prepend. You can now just add buttons and .input-group-text as direct children of the input groups. --- .../classes/define_role_table_advanced.php | 2 +- admin/templates/header_search_input.mustache | 16 ++--- .../local/settings/autocomplete.mustache | 4 +- admin/templates/setting.mustache | 2 +- .../templates/setting_configduration.mustache | 2 +- .../templates/setting_configfilesize.mustache | 2 +- .../setting_configmultiselect.mustache | 2 +- ...etting_configmultiselect_optgroup.mustache | 2 +- admin/templates/setting_configselect.mustache | 4 +- .../setting_configselect_optgroup.mustache | 4 +- admin/templates/setting_configtime.mustache | 4 +- .../setting_courselist_frontpage.mustache | 2 +- admin/templates/setting_description.mustache | 2 +- .../templates/setting_gradecat_combo.mustache | 2 +- .../templates/evaluation_options.mustache | 14 ++-- .../templates/export_options.mustache | 18 ++--- .../amd/build/selectedcourses.min.js | 2 +- .../amd/build/selectedcourses.min.js.map | 2 +- .../dataprivacy/amd/src/selectedcourses.js | 2 +- .../data_requests_bulk_actions.mustache | 2 +- .../lp/templates/competency_grader.mustache | 2 +- .../lp/templates/competency_picker.mustache | 2 +- .../competency_picker_user_plans.mustache | 2 +- .../competency_plan_navigation.mustache | 2 +- .../templates/competency_rule_config.mustache | 4 +- .../course_competencies_page.mustache | 2 +- .../manage_competencies_page.mustache | 6 +- ...user_competency_course_navigation.mustache | 4 +- .../templates/chooser_moodlenet.mustache | 12 ++-- ...odle-availability_completion-form-debug.js | 4 +- ...moodle-availability_completion-form-min.js | 2 +- .../moodle-availability_completion-form.js | 4 +- .../completion/yui/src/form/js/form.js | 4 +- .../condition/date/classes/frontend.php | 2 +- .../moodle-availability_date-form-debug.js | 2 +- .../moodle-availability_date-form-min.js | 2 +- .../moodle-availability_date-form.js | 2 +- .../condition/date/yui/src/form/js/form.js | 2 +- .../moodle-availability_grade-form-debug.js | 2 +- .../moodle-availability_grade-form-min.js | 2 +- .../moodle-availability_grade-form.js | 2 +- .../condition/grade/yui/src/form/js/form.js | 2 +- .../moodle-availability_group-form-debug.js | 2 +- .../moodle-availability_group-form-min.js | 2 +- .../moodle-availability_group-form.js | 2 +- .../condition/group/yui/src/form/js/form.js | 2 +- ...moodle-availability_grouping-form-debug.js | 2 +- .../moodle-availability_grouping-form-min.js | 2 +- .../moodle-availability_grouping-form.js | 2 +- .../grouping/yui/src/form/js/form.js | 2 +- .../moodle-availability_profile-form-debug.js | 4 +- .../moodle-availability_profile-form-min.js | 2 +- .../moodle-availability_profile-form.js | 4 +- .../condition/profile/yui/src/form/js/form.js | 4 +- .../moodle-core_availability-form-debug.js | 4 +- .../moodle-core_availability-form-min.js | 4 +- .../moodle-core_availability-form.js | 4 +- availability/yui/src/form/js/form.js | 4 +- backup/util/ui/classes/output/copy_form.php | 2 +- badges/amd/build/selectors.min.js | 2 +- badges/amd/build/selectors.min.js.map | 2 +- badges/amd/src/selectors.js | 2 +- .../templates/export_calendar_url.mustache | 20 +++--- course/classes/management_renderer.php | 18 ++--- course/templates/activity_list.mustache | 16 ++--- enrol/lti/styles.css | 4 +- .../local/ltiadvantage/tool_details.mustache | 40 +++++------ .../templates/collapse/collapsebody.mustache | 6 +- .../collapse/collapseresultitems.mustache | 4 +- .../report/grader/templates/perpage.mustache | 2 +- .../singleview/templates/bulk_insert.mustache | 2 +- .../templates/dropdown_attribute.mustache | 2 +- .../singleview/templates/perpage.mustache | 2 +- lib/amd/build/inplace_editable.min.js | 2 +- lib/amd/build/inplace_editable.min.js.map | 2 +- lib/amd/src/inplace_editable.js | 4 +- lib/classes/output/html_writer.php | 2 +- .../moodle-atto_h5p-button-debug.js | 6 +- .../moodle-atto_h5p-button-min.js | 4 +- .../moodle-atto_h5p-button.js | 6 +- .../plugins/h5p/yui/src/button/js/button.js | 6 +- .../moodle-atto_image-button-debug.js | 8 +-- .../moodle-atto_image-button-min.js | 4 +- .../moodle-atto_image-button.js | 8 +-- .../plugins/image/yui/src/button/js/button.js | 8 +-- .../moodle-atto_link-button-debug.js | 6 +- .../moodle-atto_link-button-min.js | 4 +- .../moodle-atto_link-button.js | 6 +- .../plugins/link/yui/src/button/js/button.js | 6 +- .../moodle-atto_media-button-debug.js | 8 +-- .../moodle-atto_media-button-min.js | 4 +- .../moodle-atto_media-button.js | 8 +-- .../plugins/media/yui/src/button/js/button.js | 8 +-- .../moodle-atto_table-button-debug.js | 8 +-- .../moodle-atto_table-button-min.js | 2 +- .../moodle-atto_table-button.js | 8 +-- .../plugins/table/yui/src/button/js/button.js | 8 +-- .../tiny/plugins/h5p/templates/modal.mustache | 6 +- .../plugins/link/templates/modal.mustache | 2 - .../embed_media_modal_audio.mustache | 68 ++++++------------ .../templates/embed_media_modal_link.mustache | 4 +- .../embed_media_modal_video.mustache | 72 ++++++------------- lib/form/templates/editor_textarea.mustache | 2 +- .../element-autocomplete-inline.mustache | 2 +- .../templates/element-autocomplete.mustache | 2 +- .../templates/element-choicedropdown.mustache | 2 +- .../templates/element-select-inline.mustache | 2 +- lib/form/templates/element-select.mustache | 2 +- .../element-selectgroups-inline.mustache | 2 +- .../templates/element-selectgroups.mustache | 2 +- .../templates/element-selectwithlink.mustache | 2 +- .../templates/element-tags-inline.mustache | 2 +- lib/form/templates/element-tags.mustache | 2 +- lib/portfoliolib.php | 2 +- lib/templates/checkbox.mustache | 6 +- .../datafilter/filter_match.mustache | 2 +- lib/templates/datafilter/filter_row.mustache | 4 +- .../filtertypes/binary_selector.mustache | 2 +- lib/templates/dataformat_selector.mustache | 2 +- lib/templates/editswitch.mustache | 8 +-- lib/templates/emoji/picker.mustache | 8 +-- lib/templates/filemanager_fileselect.mustache | 2 +- lib/templates/filemanager_loginform.mustache | 2 +- .../form_input_toggle_sensitive.mustache | 10 ++- lib/templates/search_input.mustache | 22 +++--- lib/templates/search_input_navbar.mustache | 46 ++++++------ lib/templates/select_time.mustache | 2 +- lib/templates/single_select.mustache | 2 +- lib/templates/toggle.mustache | 6 +- lib/templates/url_select.mustache | 2 +- .../default_notification_preferences.min.js | 2 +- ...efault_notification_preferences.min.js.map | 2 +- .../src/default_notification_preferences.js | 2 +- .../default_notification_preferences.mustache | 18 ++--- ...onversation_body_confirm_dialogue.mustache | 6 +- ...ssage_drawer_view_overview_header.mustache | 8 +-- ...message_drawer_view_search_header.mustache | 28 ++++---- ...drawer_view_settings_body_content.mustache | 12 ++-- ..._content_notification_preferences.mustache | 6 +- ...references_component_notification.mustache | 6 +- .../extra_filters_dropdown_body.mustache | 4 +- .../grading_navigation_user_selector.mustache | 6 +- .../grading_paging_selector.mustache | 2 +- .../templates/grading_sticky_footer.mustache | 2 +- .../templates/participant_form_add.mustache | 2 +- .../participant_single_select.mustache | 2 +- mod/data/field.php | 4 +- mod/data/field/file/templates/file.mustache | 2 +- mod/data/field/latlong/field.class.php | 4 +- .../field/latlong/templates/latlong.mustache | 2 +- mod/data/field/menu/field.class.php | 4 +- .../field/picture/templates/picture.mustache | 2 +- mod/data/field/radiobutton/field.class.php | 2 +- mod/data/lib.php | 8 +-- mod/data/renderer.php | 2 +- .../templates/bulk_action_menu.mustache | 2 +- mod/forum/templates/big_search_form.mustache | 4 +- mod/forum/templates/discussion_list.mustache | 6 +- mod/forum/templates/inpage_reply_v2.mustache | 6 +- mod/forum/templates/setting_switch.mustache | 6 +- mod/glossary/editcategories.html | 2 +- mod/lesson/pagetypes/matching.php | 4 +- mod/quiz/classes/output/edit_renderer.php | 2 +- .../add_random_question_form.mustache | 2 +- mod/wiki/editors/wikieditor.php | 2 +- payment/templates/gateway.mustache | 6 +- .../templates/gateways_placeholder.mustache | 6 +- .../bulkmove/templates/bulk_move.mustache | 4 +- .../question_status_dropdown.mustache | 2 +- .../classes/category_condition.php | 4 +- .../bank/managecategories/classes/helper.php | 2 +- question/bank/viewquestiontext/styles.css | 2 +- .../templates/question_text_format.mustache | 10 ++- .../question_version_selection.mustache | 2 +- question/templates/showtext_option.mustache | 2 +- .../templates/switch_question_bank.mustache | 2 +- question/type/calculated/questiontype.php | 4 +- question/type/gapselect/renderer.php | 2 +- question/type/match/renderer.php | 2 +- .../local/settings/conditions.mustache | 2 +- .../templates/local/settings/filters.mustache | 2 +- .../local/sidebar-menu/area.mustache | 20 +++--- theme/boost/scss/moodle/admin.scss | 2 +- theme/boost/scss/moodle/bootstrap-rtl.scss | 10 --- theme/boost/scss/moodle/contentbank.scss | 2 +- theme/boost/scss/moodle/core.scss | 7 +- theme/boost/scss/moodle/coursemanagement.scss | 8 --- theme/boost/scss/moodle/debug.scss | 16 ----- theme/boost/scss/moodle/forms.scss | 16 ++--- theme/boost/scss/moodle/modules.scss | 4 +- theme/boost/scss/moodle/prefixes.scss | 4 +- .../boost/scss/moodle/primarynavigation.scss | 5 -- theme/boost/scss/moodle/reportbuilder.scss | 2 +- theme/boost/scss/moodle/search.scss | 4 +- theme/boost/scss/moodle/undo.scss | 4 +- theme/boost/scss/preset/default.scss | 3 - theme/boost/style/moodle.css | 69 +++++------------- theme/classic/style/moodle.css | 69 +++++------------- user/templates/add_bulk_note.mustache | 2 +- 199 files changed, 510 insertions(+), 731 deletions(-) diff --git a/admin/roles/classes/define_role_table_advanced.php b/admin/roles/classes/define_role_table_advanced.php index 402e7e514fa..ecf3c378012 100644 --- a/admin/roles/classes/define_role_table_advanced.php +++ b/admin/roles/classes/define_role_table_advanced.php @@ -544,7 +544,7 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi $options[$type] = get_string('archetype'.$type, 'role'); } return html_writer::select($options, 'archetype', $this->role->archetype, false, - array('class' => 'custom-select')); + ['class' => 'form-select']); } protected function get_assignable_levels_control() { diff --git a/admin/templates/header_search_input.mustache b/admin/templates/header_search_input.mustache index 5a4372a73cf..b218a43459f 100644 --- a/admin/templates/header_search_input.mustache +++ b/admin/templates/header_search_input.mustache @@ -28,9 +28,6 @@
- -
- -
+ +
diff --git a/admin/templates/local/settings/autocomplete.mustache b/admin/templates/local/settings/autocomplete.mustache index d0a4cadefc9..28cb9c8fc6a 100644 --- a/admin/templates/local/settings/autocomplete.mustache +++ b/admin/templates/local/settings/autocomplete.mustache @@ -59,9 +59,9 @@ Setting autocomplete. }} -
+
- - {{#options}} {{/options}} diff --git a/admin/templates/setting_configfilesize.mustache b/admin/templates/setting_configfilesize.mustache index c0026e6d9bc..e0c08b4afc3 100644 --- a/admin/templates/setting_configfilesize.mustache +++ b/admin/templates/setting_configfilesize.mustache @@ -42,7 +42,7 @@
- {{#options}} {{/options}} diff --git a/admin/templates/setting_configmultiselect.mustache b/admin/templates/setting_configmultiselect.mustache index e105478035b..835bde1feb8 100644 --- a/admin/templates/setting_configmultiselect.mustache +++ b/admin/templates/setting_configmultiselect.mustache @@ -39,7 +39,7 @@ {{! Setting configmultiselect. }} -
+
{{^readonly}}{{/readonly}} {{/readonly}} +
+ +
+ + : - {{#minutes}} {{/minutes}} diff --git a/admin/templates/setting_courselist_frontpage.mustache b/admin/templates/setting_courselist_frontpage.mustache index 782e6cf88b2..9a8125f403b 100644 --- a/admin/templates/setting_courselist_frontpage.mustache +++ b/admin/templates/setting_courselist_frontpage.mustache @@ -42,7 +42,7 @@ }}
{{#selects}} - {{#options}} {{/options}} diff --git a/admin/templates/setting_description.mustache b/admin/templates/setting_description.mustache index 853fc7cab63..393675b4240 100644 --- a/admin/templates/setting_description.mustache +++ b/admin/templates/setting_description.mustache @@ -41,6 +41,6 @@
-
{{{description}}}
+
{{{description}}}
diff --git a/admin/templates/setting_gradecat_combo.mustache b/admin/templates/setting_gradecat_combo.mustache index 79129cbaa21..a4140385353 100644 --- a/admin/templates/setting_gradecat_combo.mustache +++ b/admin/templates/setting_gradecat_combo.mustache @@ -39,7 +39,7 @@ Setting configselect. }}
- {{#options}} {{/options}} diff --git a/admin/tool/analytics/templates/evaluation_options.mustache b/admin/tool/analytics/templates/evaluation_options.mustache index 7f4ce8e74b4..b75f9072013 100644 --- a/admin/tool/analytics/templates/evaluation_options.mustache +++ b/admin/tool/analytics/templates/evaluation_options.mustache @@ -45,14 +45,14 @@ {{#trainedexternally}}
{{#str}} evaluationmodeinfo, tool_analytics {{/str}}
-
- - +
+ +
-
- - +
+ +
{{/trainedexternally}} @@ -60,7 +60,7 @@
{{#str}} selecttimesplittingforevaluation, tool_analytics {{/str}}
- {{#timesplittingmethods}} {{/timesplittingmethods}} diff --git a/admin/tool/analytics/templates/export_options.mustache b/admin/tool/analytics/templates/export_options.mustache index 460ffb40b18..7fe41240b45 100644 --- a/admin/tool/analytics/templates/export_options.mustache +++ b/admin/tool/analytics/templates/export_options.mustache @@ -31,17 +31,17 @@ { } }} -
- - +
+ +
-
- - +
+ +
-
- - +
+ +
{{#js}} diff --git a/admin/tool/dataprivacy/amd/build/selectedcourses.min.js b/admin/tool/dataprivacy/amd/build/selectedcourses.min.js index 7d830948aaf..c714b814007 100644 --- a/admin/tool/dataprivacy/amd/build/selectedcourses.min.js +++ b/admin/tool/dataprivacy/amd/build/selectedcourses.min.js @@ -1,3 +1,3 @@ -define("tool_dataprivacy/selectedcourses",["exports","core/ajax","core/notification","core/modal_save_cancel","core/modal_events","core/fragment","core/prefetch","core/str"],(function(_exports,_ajax,_notification,_modal_save_cancel,_modal_events,_fragment,_prefetch,_str){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_ajax=_interopRequireDefault(_ajax),_notification=_interopRequireDefault(_notification),_modal_save_cancel=_interopRequireDefault(_modal_save_cancel),_modal_events=_interopRequireDefault(_modal_events),_fragment=_interopRequireDefault(_fragment),(0,_prefetch.prefetchStrings)("tool_dataprivacy",["selectcourses","approverequest","errornoselectedcourse"]);return _exports.default=class{constructor(contextId,requestId){_defineProperty(this,"contextId",0),_defineProperty(this,"requestId",0),this.contextId=contextId,this.requestId=requestId,_modal_save_cancel.default.create({title:(0,_str.getString)("selectcourses","tool_dataprivacy"),body:this.getBody({requestid:requestId}),large:!0,removeOnClose:!0,buttons:{save:(0,_str.getString)("approverequest","tool_dataprivacy")}}).then((modal=>(this.modal=modal,modal))).then((modal=>(modal.getRoot().on(_modal_events.default.save,this.submitForm.bind(this)),modal.getRoot().on("submit","form",this.submitFormAjax.bind(this)),modal.show(),modal))).catch(_notification.default.exception)}getBody(formdata){const params=formdata?{jsonformdata:JSON.stringify(formdata)}:null;return _fragment.default.loadFragment("tool_dataprivacy","selectcourses_form",this.contextId,params)}submitForm(e){e.preventDefault(),this.modal.getRoot().find("form").submit()}submitFormAjax(e){e.preventDefault();let formData=this.modal.getRoot().find("form").serialize();if(-1===formData.indexOf("coursecontextids")){const customSelect=this.modal.getRoot().find(".custom-select"),invalidText=this.modal.getRoot().find(".invalid-feedback");return customSelect.addClass("is-invalid"),invalidText.attr("style","display: block"),void(0,_str.getString)("errornoselectedcourse","tool_dataprivacy").then((value=>{invalidText.empty().append(value)})).catch(_notification.default.exception)}_ajax.default.call([{methodname:"tool_dataprivacy_submit_selected_courses_form",args:{requestid:this.requestId,jsonformdata:JSON.stringify(formData)}}])[0].then((data=>(data.warnings.length>0?this.modal.setBody(this.getBody(formData)):(this.modal.destroy(),document.location.reload()),data))).catch((error=>_notification.default.exception(error)))}},_exports.default})); +define("tool_dataprivacy/selectedcourses",["exports","core/ajax","core/notification","core/modal_save_cancel","core/modal_events","core/fragment","core/prefetch","core/str"],(function(_exports,_ajax,_notification,_modal_save_cancel,_modal_events,_fragment,_prefetch,_str){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_ajax=_interopRequireDefault(_ajax),_notification=_interopRequireDefault(_notification),_modal_save_cancel=_interopRequireDefault(_modal_save_cancel),_modal_events=_interopRequireDefault(_modal_events),_fragment=_interopRequireDefault(_fragment),(0,_prefetch.prefetchStrings)("tool_dataprivacy",["selectcourses","approverequest","errornoselectedcourse"]);return _exports.default=class{constructor(contextId,requestId){_defineProperty(this,"contextId",0),_defineProperty(this,"requestId",0),this.contextId=contextId,this.requestId=requestId,_modal_save_cancel.default.create({title:(0,_str.getString)("selectcourses","tool_dataprivacy"),body:this.getBody({requestid:requestId}),large:!0,removeOnClose:!0,buttons:{save:(0,_str.getString)("approverequest","tool_dataprivacy")}}).then((modal=>(this.modal=modal,modal))).then((modal=>(modal.getRoot().on(_modal_events.default.save,this.submitForm.bind(this)),modal.getRoot().on("submit","form",this.submitFormAjax.bind(this)),modal.show(),modal))).catch(_notification.default.exception)}getBody(formdata){const params=formdata?{jsonformdata:JSON.stringify(formdata)}:null;return _fragment.default.loadFragment("tool_dataprivacy","selectcourses_form",this.contextId,params)}submitForm(e){e.preventDefault(),this.modal.getRoot().find("form").submit()}submitFormAjax(e){e.preventDefault();let formData=this.modal.getRoot().find("form").serialize();if(-1===formData.indexOf("coursecontextids")){const customSelect=this.modal.getRoot().find(".form-select"),invalidText=this.modal.getRoot().find(".invalid-feedback");return customSelect.addClass("is-invalid"),invalidText.attr("style","display: block"),void(0,_str.getString)("errornoselectedcourse","tool_dataprivacy").then((value=>{invalidText.empty().append(value)})).catch(_notification.default.exception)}_ajax.default.call([{methodname:"tool_dataprivacy_submit_selected_courses_form",args:{requestid:this.requestId,jsonformdata:JSON.stringify(formData)}}])[0].then((data=>(data.warnings.length>0?this.modal.setBody(this.getBody(formData)):(this.modal.destroy(),document.location.reload()),data))).catch((error=>_notification.default.exception(error)))}},_exports.default})); //# sourceMappingURL=selectedcourses.min.js.map \ No newline at end of file diff --git a/admin/tool/dataprivacy/amd/build/selectedcourses.min.js.map b/admin/tool/dataprivacy/amd/build/selectedcourses.min.js.map index 2721c92edbc..232f6e61b7a 100644 --- a/admin/tool/dataprivacy/amd/build/selectedcourses.min.js.map +++ b/admin/tool/dataprivacy/amd/build/selectedcourses.min.js.map @@ -1 +1 @@ -{"version":3,"file":"selectedcourses.min.js","sources":["../src/selectedcourses.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Selected courses.\n *\n * @module tool_dataprivacy/selectedcourses\n * @copyright 2021 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since Moodle 4.3\n */\n\nimport Ajax from 'core/ajax';\nimport Notification from 'core/notification';\nimport ModalSaveCancel from 'core/modal_save_cancel';\nimport ModalEvents from 'core/modal_events';\nimport Fragment from 'core/fragment';\nimport {prefetchStrings} from 'core/prefetch';\nimport {getString} from 'core/str';\n\nprefetchStrings('tool_dataprivacy', [\n 'selectcourses',\n 'approverequest',\n 'errornoselectedcourse',\n]);\n\n/**\n * Selected Courses popup modal.\n *\n */\nexport default class SelectedCourses {\n /**\n * @var {String} contextId Context ID to load the fragment.\n * @private\n */\n contextId = 0;\n\n /**\n * @var {String} requestId ID of data export request.\n * @private\n */\n requestId = 0;\n\n /**\n * Constructor\n *\n * @param {String} contextId Context ID to load the fragment.\n * @param {String} requestId ID of data export request.\n */\n constructor(contextId, requestId) {\n this.contextId = contextId;\n this.requestId = requestId;\n // Now create the modal.\n ModalSaveCancel.create({\n title: getString('selectcourses', 'tool_dataprivacy'),\n body: this.getBody({requestid: requestId}),\n large: true,\n removeOnClose: true,\n buttons: {\n save: getString('approverequest', 'tool_dataprivacy'),\n },\n }).then((modal) => {\n this.modal = modal;\n\n return modal;\n }).then((modal) => {\n // We catch the modal save event, and use it to submit the form inside the modal.\n // Triggering a form submission will give JS validation scripts a chance to check for errors.\n modal.getRoot().on(ModalEvents.save, this.submitForm.bind(this));\n\n // We also catch the form submit event and use it to submit the form with ajax.\n modal.getRoot().on('submit', 'form', this.submitFormAjax.bind(this));\n modal.show();\n return modal;\n }).catch(Notification.exception);\n }\n\n /**\n * Get body of modal.\n *\n * @method getBody\n * @param {Object} formdata\n * @private\n * @return {Promise}\n */\n getBody(formdata) {\n const params = formdata ? {jsonformdata: JSON.stringify(formdata)} : null;\n\n // Get the content of the modal.\n return Fragment.loadFragment('tool_dataprivacy', 'selectcourses_form', this.contextId, params);\n }\n\n /**\n * This triggers a form submission, so that any mform elements can do final tricks before the form submission is processed.\n *\n * @method submitForm\n * @param {Event} e Form submission event.\n * @private\n */\n submitForm(e) {\n e.preventDefault();\n this.modal.getRoot().find('form').submit();\n }\n\n /**\n * Submit select courses form using ajax.\n *\n * @method submitFormAjax\n * @private\n * @param {Event} e Form submission event.\n */\n submitFormAjax(e) {\n e.preventDefault();\n\n // Convert all the form elements values to a serialised string.\n let formData = this.modal.getRoot().find('form').serialize();\n\n if (formData.indexOf('coursecontextids') === -1) {\n const customSelect = this.modal.getRoot().find('.custom-select');\n const invalidText = this.modal.getRoot().find('.invalid-feedback');\n customSelect.addClass('is-invalid');\n invalidText.attr('style', 'display: block');\n getString('errornoselectedcourse', 'tool_dataprivacy').then(value => {\n invalidText.empty().append(value);\n return;\n }).catch(Notification.exception);\n return;\n }\n\n Ajax.call([{\n methodname: 'tool_dataprivacy_submit_selected_courses_form',\n args: {requestid: this.requestId, jsonformdata: JSON.stringify(formData)},\n }])[0]\n .then((data) => {\n if (data.warnings.length > 0) {\n this.modal.setBody(this.getBody(formData));\n } else {\n this.modal.destroy();\n document.location.reload();\n }\n return data;\n })\n .catch((error) => Notification.exception(error));\n }\n}\n"],"names":["constructor","contextId","requestId","create","title","body","this","getBody","requestid","large","removeOnClose","buttons","save","then","modal","getRoot","on","ModalEvents","submitForm","bind","submitFormAjax","show","catch","Notification","exception","formdata","params","jsonformdata","JSON","stringify","Fragment","loadFragment","e","preventDefault","find","submit","formData","serialize","indexOf","customSelect","invalidText","addClass","attr","value","empty","append","call","methodname","args","data","warnings","length","setBody","destroy","document","location","reload","error"],"mappings":"02BAgCgB,mBAAoB,CAChC,gBACA,iBACA,wDA0BAA,YAAYC,UAAWC,4CAdX,oCAMA,QASHD,UAAYA,eACZC,UAAYA,qCAEDC,OAAO,CACnBC,OAAO,kBAAU,gBAAiB,oBAClCC,KAAMC,KAAKC,QAAQ,CAACC,UAAWN,YAC/BO,OAAO,EACPC,eAAe,EACfC,QAAS,CACLC,MAAM,kBAAU,iBAAkB,uBAEvCC,MAAMC,aACAA,MAAQA,MAENA,SACRD,MAAMC,QAGLA,MAAMC,UAAUC,GAAGC,sBAAYL,KAAMN,KAAKY,WAAWC,KAAKb,OAG1DQ,MAAMC,UAAUC,GAAG,SAAU,OAAQV,KAAKc,eAAeD,KAAKb,OAC9DQ,MAAMO,OACCP,SACRQ,MAAMC,sBAAaC,WAW1BjB,QAAQkB,gBACEC,OAASD,SAAW,CAACE,aAAcC,KAAKC,UAAUJ,WAAa,YAG9DK,kBAASC,aAAa,mBAAoB,qBAAsBzB,KAAKL,UAAWyB,QAU3FR,WAAWc,GACPA,EAAEC,sBACGnB,MAAMC,UAAUmB,KAAK,QAAQC,SAUtCf,eAAeY,GACXA,EAAEC,qBAGEG,SAAW9B,KAAKQ,MAAMC,UAAUmB,KAAK,QAAQG,gBAEH,IAA1CD,SAASE,QAAQ,oBAA4B,OACvCC,aAAejC,KAAKQ,MAAMC,UAAUmB,KAAK,kBACzCM,YAAclC,KAAKQ,MAAMC,UAAUmB,KAAK,4BAC9CK,aAAaE,SAAS,cACtBD,YAAYE,KAAK,QAAS,yCAChB,wBAAyB,oBAAoB7B,MAAK8B,QACxDH,YAAYI,QAAQC,OAAOF,UAE5BrB,MAAMC,sBAAaC,yBAIrBsB,KAAK,CAAC,CACPC,WAAY,gDACZC,KAAM,CAACxC,UAAWF,KAAKJ,UAAWyB,aAAcC,KAAKC,UAAUO,cAC/D,GACHvB,MAAMoC,OACCA,KAAKC,SAASC,OAAS,OAClBrC,MAAMsC,QAAQ9C,KAAKC,QAAQ6B,iBAE3BtB,MAAMuC,UACXC,SAASC,SAASC,UAEfP,QAEV3B,OAAOmC,OAAUlC,sBAAaC,UAAUiC"} \ No newline at end of file +{"version":3,"file":"selectedcourses.min.js","sources":["../src/selectedcourses.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Selected courses.\n *\n * @module tool_dataprivacy/selectedcourses\n * @copyright 2021 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since Moodle 4.3\n */\n\nimport Ajax from 'core/ajax';\nimport Notification from 'core/notification';\nimport ModalSaveCancel from 'core/modal_save_cancel';\nimport ModalEvents from 'core/modal_events';\nimport Fragment from 'core/fragment';\nimport {prefetchStrings} from 'core/prefetch';\nimport {getString} from 'core/str';\n\nprefetchStrings('tool_dataprivacy', [\n 'selectcourses',\n 'approverequest',\n 'errornoselectedcourse',\n]);\n\n/**\n * Selected Courses popup modal.\n *\n */\nexport default class SelectedCourses {\n /**\n * @var {String} contextId Context ID to load the fragment.\n * @private\n */\n contextId = 0;\n\n /**\n * @var {String} requestId ID of data export request.\n * @private\n */\n requestId = 0;\n\n /**\n * Constructor\n *\n * @param {String} contextId Context ID to load the fragment.\n * @param {String} requestId ID of data export request.\n */\n constructor(contextId, requestId) {\n this.contextId = contextId;\n this.requestId = requestId;\n // Now create the modal.\n ModalSaveCancel.create({\n title: getString('selectcourses', 'tool_dataprivacy'),\n body: this.getBody({requestid: requestId}),\n large: true,\n removeOnClose: true,\n buttons: {\n save: getString('approverequest', 'tool_dataprivacy'),\n },\n }).then((modal) => {\n this.modal = modal;\n\n return modal;\n }).then((modal) => {\n // We catch the modal save event, and use it to submit the form inside the modal.\n // Triggering a form submission will give JS validation scripts a chance to check for errors.\n modal.getRoot().on(ModalEvents.save, this.submitForm.bind(this));\n\n // We also catch the form submit event and use it to submit the form with ajax.\n modal.getRoot().on('submit', 'form', this.submitFormAjax.bind(this));\n modal.show();\n return modal;\n }).catch(Notification.exception);\n }\n\n /**\n * Get body of modal.\n *\n * @method getBody\n * @param {Object} formdata\n * @private\n * @return {Promise}\n */\n getBody(formdata) {\n const params = formdata ? {jsonformdata: JSON.stringify(formdata)} : null;\n\n // Get the content of the modal.\n return Fragment.loadFragment('tool_dataprivacy', 'selectcourses_form', this.contextId, params);\n }\n\n /**\n * This triggers a form submission, so that any mform elements can do final tricks before the form submission is processed.\n *\n * @method submitForm\n * @param {Event} e Form submission event.\n * @private\n */\n submitForm(e) {\n e.preventDefault();\n this.modal.getRoot().find('form').submit();\n }\n\n /**\n * Submit select courses form using ajax.\n *\n * @method submitFormAjax\n * @private\n * @param {Event} e Form submission event.\n */\n submitFormAjax(e) {\n e.preventDefault();\n\n // Convert all the form elements values to a serialised string.\n let formData = this.modal.getRoot().find('form').serialize();\n\n if (formData.indexOf('coursecontextids') === -1) {\n const customSelect = this.modal.getRoot().find('.form-select');\n const invalidText = this.modal.getRoot().find('.invalid-feedback');\n customSelect.addClass('is-invalid');\n invalidText.attr('style', 'display: block');\n getString('errornoselectedcourse', 'tool_dataprivacy').then(value => {\n invalidText.empty().append(value);\n return;\n }).catch(Notification.exception);\n return;\n }\n\n Ajax.call([{\n methodname: 'tool_dataprivacy_submit_selected_courses_form',\n args: {requestid: this.requestId, jsonformdata: JSON.stringify(formData)},\n }])[0]\n .then((data) => {\n if (data.warnings.length > 0) {\n this.modal.setBody(this.getBody(formData));\n } else {\n this.modal.destroy();\n document.location.reload();\n }\n return data;\n })\n .catch((error) => Notification.exception(error));\n }\n}\n"],"names":["constructor","contextId","requestId","create","title","body","this","getBody","requestid","large","removeOnClose","buttons","save","then","modal","getRoot","on","ModalEvents","submitForm","bind","submitFormAjax","show","catch","Notification","exception","formdata","params","jsonformdata","JSON","stringify","Fragment","loadFragment","e","preventDefault","find","submit","formData","serialize","indexOf","customSelect","invalidText","addClass","attr","value","empty","append","call","methodname","args","data","warnings","length","setBody","destroy","document","location","reload","error"],"mappings":"02BAgCgB,mBAAoB,CAChC,gBACA,iBACA,wDA0BAA,YAAYC,UAAWC,4CAdX,oCAMA,QASHD,UAAYA,eACZC,UAAYA,qCAEDC,OAAO,CACnBC,OAAO,kBAAU,gBAAiB,oBAClCC,KAAMC,KAAKC,QAAQ,CAACC,UAAWN,YAC/BO,OAAO,EACPC,eAAe,EACfC,QAAS,CACLC,MAAM,kBAAU,iBAAkB,uBAEvCC,MAAMC,aACAA,MAAQA,MAENA,SACRD,MAAMC,QAGLA,MAAMC,UAAUC,GAAGC,sBAAYL,KAAMN,KAAKY,WAAWC,KAAKb,OAG1DQ,MAAMC,UAAUC,GAAG,SAAU,OAAQV,KAAKc,eAAeD,KAAKb,OAC9DQ,MAAMO,OACCP,SACRQ,MAAMC,sBAAaC,WAW1BjB,QAAQkB,gBACEC,OAASD,SAAW,CAACE,aAAcC,KAAKC,UAAUJ,WAAa,YAG9DK,kBAASC,aAAa,mBAAoB,qBAAsBzB,KAAKL,UAAWyB,QAU3FR,WAAWc,GACPA,EAAEC,sBACGnB,MAAMC,UAAUmB,KAAK,QAAQC,SAUtCf,eAAeY,GACXA,EAAEC,qBAGEG,SAAW9B,KAAKQ,MAAMC,UAAUmB,KAAK,QAAQG,gBAEH,IAA1CD,SAASE,QAAQ,oBAA4B,OACvCC,aAAejC,KAAKQ,MAAMC,UAAUmB,KAAK,gBACzCM,YAAclC,KAAKQ,MAAMC,UAAUmB,KAAK,4BAC9CK,aAAaE,SAAS,cACtBD,YAAYE,KAAK,QAAS,yCAChB,wBAAyB,oBAAoB7B,MAAK8B,QACxDH,YAAYI,QAAQC,OAAOF,UAE5BrB,MAAMC,sBAAaC,yBAIrBsB,KAAK,CAAC,CACPC,WAAY,gDACZC,KAAM,CAACxC,UAAWF,KAAKJ,UAAWyB,aAAcC,KAAKC,UAAUO,cAC/D,GACHvB,MAAMoC,OACCA,KAAKC,SAASC,OAAS,OAClBrC,MAAMsC,QAAQ9C,KAAKC,QAAQ6B,iBAE3BtB,MAAMuC,UACXC,SAASC,SAASC,UAEfP,QAEV3B,OAAOmC,OAAUlC,sBAAaC,UAAUiC"} \ No newline at end of file diff --git a/admin/tool/dataprivacy/amd/src/selectedcourses.js b/admin/tool/dataprivacy/amd/src/selectedcourses.js index 16f406a9439..d979224775c 100644 --- a/admin/tool/dataprivacy/amd/src/selectedcourses.js +++ b/admin/tool/dataprivacy/amd/src/selectedcourses.js @@ -128,7 +128,7 @@ export default class SelectedCourses { let formData = this.modal.getRoot().find('form').serialize(); if (formData.indexOf('coursecontextids') === -1) { - const customSelect = this.modal.getRoot().find('.custom-select'); + const customSelect = this.modal.getRoot().find('.form-select'); const invalidText = this.modal.getRoot().find('.invalid-feedback'); customSelect.addClass('is-invalid'); invalidText.attr('style', 'display: block'); diff --git a/admin/tool/dataprivacy/templates/data_requests_bulk_actions.mustache b/admin/tool/dataprivacy/templates/data_requests_bulk_actions.mustache index 561e52abd7f..dbadf936ab0 100644 --- a/admin/tool/dataprivacy/templates/data_requests_bulk_actions.mustache +++ b/admin/tool/dataprivacy/templates/data_requests_bulk_actions.mustache @@ -46,7 +46,7 @@ }}
- {{#options}} {{/options}} diff --git a/admin/tool/lp/templates/competency_grader.mustache b/admin/tool/lp/templates/competency_grader.mustache index 9827b42ee3d..0c82c88da81 100644 --- a/admin/tool/lp/templates/competency_grader.mustache +++ b/admin/tool/lp/templates/competency_grader.mustache @@ -39,7 +39,7 @@
- {{#ratings}} {{/ratings}} diff --git a/admin/tool/lp/templates/competency_picker.mustache b/admin/tool/lp/templates/competency_picker.mustache index a7fc1616309..566679779f4 100644 --- a/admin/tool/lp/templates/competency_picker.mustache +++ b/admin/tool/lp/templates/competency_picker.mustache @@ -54,7 +54,7 @@
{{^singleFramework}}

{{#str}}competencyframeworks, tool_lp{{/str}}

- {{#frameworks}} {{/frameworks}} diff --git a/admin/tool/lp/templates/competency_picker_user_plans.mustache b/admin/tool/lp/templates/competency_picker_user_plans.mustache index b1861ffaff2..82303f16add 100644 --- a/admin/tool/lp/templates/competency_picker_user_plans.mustache +++ b/admin/tool/lp/templates/competency_picker_user_plans.mustache @@ -57,7 +57,7 @@
{{^singlePlan}}

{{#str}}learningplans, tool_lp{{/str}}

- {{#plans}} {{/plans}} diff --git a/admin/tool/lp/templates/competency_plan_navigation.mustache b/admin/tool/lp/templates/competency_plan_navigation.mustache index df6ed84e7fe..2a4907bcb73 100644 --- a/admin/tool/lp/templates/competency_plan_navigation.mustache +++ b/admin/tool/lp/templates/competency_plan_navigation.mustache @@ -36,7 +36,7 @@ {{#hascompetencies}} - {{#competencies}} {{/competencies}} diff --git a/admin/tool/lp/templates/competency_rule_config.mustache b/admin/tool/lp/templates/competency_rule_config.mustache index d4e60d3e2a8..3bea2b5027e 100644 --- a/admin/tool/lp/templates/competency_rule_config.mustache +++ b/admin/tool/lp/templates/competency_rule_config.mustache @@ -60,7 +60,7 @@
- {{#outcomes}} {{/outcomes}} @@ -68,7 +68,7 @@
- {{#rules}} diff --git a/admin/tool/lp/templates/course_competencies_page.mustache b/admin/tool/lp/templates/course_competencies_page.mustache index e6dbd2f2c4b..d467c8cb9f7 100644 --- a/admin/tool/lp/templates/course_competencies_page.mustache +++ b/admin/tool/lp/templates/course_competencies_page.mustache @@ -117,7 +117,7 @@

{{#str}} forminfo, tool_moodlenet {{/str}}

diff --git a/availability/condition/completion/yui/build/moodle-availability_completion-form/moodle-availability_completion-form-debug.js b/availability/condition/completion/yui/build/moodle-availability_completion-form/moodle-availability_completion-form-debug.js index 58ff4bd925f..5b33b93c176 100644 --- a/availability/condition/completion/yui/build/moodle-availability_completion-form/moodle-availability_completion-form-debug.js +++ b/availability/condition/completion/yui/build/moodle-availability_completion-form/moodle-availability_completion-form-debug.js @@ -28,7 +28,7 @@ M.availability_completion.form.getNode = function(json) { var html = ' ' + M.util.get_string('title', 'availability_completion') + '' + '
')),this.children.push(i),i.addTarget(this),this.inner.one(".availability-children").appendChild(i.node)},M.core_availability.List.prototype.focusAfterAdd=function(){this.inner.one("button").focus()},M.core_availability.List.prototype.isIndividualShowIcons=function(){var i,t;if(!this.root)throw"Can only call this on root list";return i="!"===this.node.one(".availability-neg").get("value"),t="|"===this.node.one(".availability-op").get("value"),!i&&!t||i&&t},M.core_availability.List.prototype.renumber=function(i){var t,e={count:this.children.length},a=i===undefined?e.number="":(e.number=i+":",i+"."),e=M.util.get_string("setheading","availability",e);for(this.node.one("> h3").set("innerHTML",e),this.node.one("> h3").getDOMNode().dataset.restrictionOrder=i||"root",t=0;t .availability-children").removeAttribute("aria-hidden"),this.inner.one("> .availability-none").setAttribute("aria-hidden","true"),this.inner.one("> .availability-header").removeAttribute("aria-hidden"),1 .availability-children").setAttribute("aria-hidden","true"),this.inner.one("> .availability-none").removeAttribute("aria-hidden"),this.inner.one("> .availability-header").setAttribute("aria-hidden","true")),this.root){for(i=this.isIndividualShowIcons(),t=0;t .availability-children > .availability-connector span.label").each(function(i){i.set("innerHTML",a)})},M.core_availability.List.prototype.deleteDescendant=function(i){for(var t,e,a=0;a .availability-children").removeChild(e),M.core_availability.form.update(),this.updateHtml(),this.inner.one("> .availability-button").one("button").focus(),!0;if(t instanceof M.core_availability.List&&t.deleteDescendant(i))return!0}return!1},M.core_availability.List.prototype.clickAdd=function(){var i,t,e,a,l,n=d.Node.create('
    "),o=n.one("button"),s={dialog:null},r=n.one("ul");for(l in M.core_availability.form.plugins)M.core_availability.form.plugins[l].allowAdd&&(i=d.Node.create('
  • '),(e=d.Node.create('
    ")).on("click",this.getAddHandler(l,s),this),i.appendChild(e),a=d.Node.create('
    "),i.appendChild(a),r.appendChild(i));i=d.Node.create('
  • '),(e=d.Node.create('
    ")).on("click",this.getAddHandler(null,s),this),i.appendChild(e),a=d.Node.create('
    "),i.appendChild(a),r.appendChild(i),n={headerContent:M.util.get_string("addrestriction","availability"),bodyContent:n,additionalBaseClass:"availability-dialogue",draggable:!0,modal:!0, +YUI.add("moodle-core_availability-form",function(d,i){M.core_availability=M.core_availability||{},M.core_availability.form={plugins:{},field:null,mainDiv:null,rootList:null,idCounter:0,restrictByGroup:null,init:function(i){var t,e,a,l,n;for(t in i)e=i[t],(a=M[e[0]].form).init.apply(a,e);if(this.field=d.one("#id_availabilityconditionsjson"),this.field.setAttribute("aria-hidden","true"),this.mainDiv=d.Node.create(''),this.field.insert(this.mainDiv,"after"),n=null,""!==(l=this.field.get("value")))try{n=d.JSON.parse(l)}catch(o){this.field.set("value","")}this.rootList=new M.core_availability.List(n,!0),this.mainDiv.appendChild(this.rootList.node),this.update(),this.rootList.renumber(),this.mainDiv.setAttribute("aria-live","polite"),this.field.ancestor("form").on("submit",function(){this.mainDiv.all("input,textarea,select").set("disabled",!0)},this),this.restrictByGroup=d.one("#restrictbygroup"),this.restrictByGroup&&(this.restrictByGroup.on("click",this.addRestrictByGroup,this),l=d.one("#id_groupmode"),n=d.one("#id_groupingid"),l&&l.on("change",this.updateRestrictByGroup,this),n&&n.on("change",this.updateRestrictByGroup,this),this.updateRestrictByGroup()),this.parent=d.one("#fitem_id_availabilityconditionsjson"),this.parent.removeClass("d-none"),document.getElementById("availabilityconditions-loading").remove()},update:function(){var i=this.rootList.getValue(),t=[];this.rootList.fillErrors(t),0!==t.length&&(i.errors=t),this.field.set("value",d.JSON.stringify(i)),this.updateRestrictByGroup()},updateRestrictByGroup:function(){var i,t,e,a;this.restrictByGroup&&("&"!==this.rootList.getValue().op||(this.rootList.hasItemOfType("group")||this.rootList.hasItemOfType("grouping"))?this.restrictByGroup.set("disabled",!0):(i=d.one("#id_groupmode"),t=d.one("#id_groupingid"),e=1===Number(this.restrictByGroup.getData("groupavailability")),a=1===Number(this.restrictByGroup.getData("groupingavailability")),i&&0!==Number(i.get("value"))&&e||t&&0!==Number(t.get("value"))&&a?this.restrictByGroup.set("disabled",!1):this.restrictByGroup.set("disabled",!0)))},addRestrictByGroup:function(i){var t,e,a,l;i.preventDefault(),i=d.one("#id_groupmode"),t=d.one("#id_groupingid"),e=1===Number(this.restrictByGroup.getData("groupavailability")),a=1===Number(this.restrictByGroup.getData("groupingavailability")),t&&0!==Number(t.get("value"))&&a?l=new M.core_availability.Item({type:"grouping",id:Number(t.get("value"))},!0):i&&e&&(l=new M.core_availability.Item({type:"group"},!0)),null!==l&&(this.rootList.addChild(l),this.update(),this.rootList.renumber(),this.rootList.updateHtml())}},M.core_availability.plugin={allowAdd:!1,init:function(i,t,e,a){i=i.replace(/^availability_/,"");this.allowAdd=t,(M.core_availability.form.plugins[i]=this).initInner.apply(this,e),this.displayMode=a},initInner:function(){},getNode:function(){throw"getNode not implemented"},fillValue:function(){throw"fillValue not implemented"},fillErrors:function(){},focusAfterAdd:function(i){i.one("input:not([disabled]),select:not([disabled])").focus()}},M.core_availability.List=function(i,t,e){var a,l,n;if(this.children=[],t!==undefined&&(this.root=t),this.node=d.Node.create('

    '+M.util.get_string("listheader_sign_before","availability")+' '+M.util.get_string("listheader_single","availability")+''+M.util.get_string("listheader_multi_before","availability")+' "+M.util.get_string("listheader_multi_after","availability")+'
    '+M.util.get_string("none","moodle")+'
    '),t||this.node.addClass("availability-childlist d-sm-flex align-items-center"),this.inner=this.node.one("> .availability-inner"),a=!0,t?(i&&i.show!==undefined&&(a=i.show),this.eyeIcon=new M.core_availability.EyeIcon(!1,a),this.node.one(".availability-header").get("firstChild").insert(this.eyeIcon.span,"before"),this.node.one(".availability-header").get("firstChild").insert(this.eyeIcon.disabledSpan,"before"),this.on("availability:privateRuleSet",function(i){i.target.getDOMNode().dataset["private"]=!0,this.updatePrivateStatus()}),this.on("availability:privateRuleUnset",function(i){delete i.target.getDOMNode().dataset["private"],this.updatePrivateStatus()})):e&&(i&&i.showc!==undefined&&(a=i.showc),this.eyeIcon=new M.core_availability.EyeIcon(!1,a),this.inner.insert(this.eyeIcon.span,"before"),this.inner.insert(this.eyeIcon.disabledSpan,"before")),t||(e=new M.core_availability.DeleteIcon(this),(a=this.node.one(".availability-none")).appendChild(document.createTextNode(" ")),a.appendChild(e.span),a.appendChild(d.Node.create(''+M.util.get_string("invalid","availability")+""))),(t=d.Node.create('")).on( +"click",function(){this.clickAdd()},this),this.node.one("div.availability-button").appendChild(t),i){switch(i.op){case"&":case"|":this.node.one(".availability-neg").set("value","");break;case"!&":case"!|":this.node.one(".availability-neg").set("value","!")}switch(i.op){case"&":case"!&":this.node.one(".availability-op").set("value","&");break;case"|":case"!|":this.node.one(".availability-op").set("value","|")}for(l=0;l
    ')),this.children.push(i),i.addTarget(this),this.inner.one(".availability-children").appendChild(i.node)},M.core_availability.List.prototype.focusAfterAdd=function(){this.inner.one("button").focus()},M.core_availability.List.prototype.isIndividualShowIcons=function(){var i,t;if(!this.root)throw"Can only call this on root list";return i="!"===this.node.one(".availability-neg").get("value"),t="|"===this.node.one(".availability-op").get("value"),!i&&!t||i&&t},M.core_availability.List.prototype.renumber=function(i){var t,e={count:this.children.length},a=i===undefined?e.number="":(e.number=i+":",i+"."),e=M.util.get_string("setheading","availability",e);for(this.node.one("> h3").set("innerHTML",e),this.node.one("> h3").getDOMNode().dataset.restrictionOrder=i||"root",t=0;t .availability-children").removeAttribute("aria-hidden"),this.inner.one("> .availability-none").setAttribute("aria-hidden","true"),this.inner.one("> .availability-header").removeAttribute("aria-hidden"),1 .availability-children").setAttribute("aria-hidden","true"),this.inner.one("> .availability-none").removeAttribute("aria-hidden"),this.inner.one("> .availability-header").setAttribute("aria-hidden","true")),this.root){for(i=this.isIndividualShowIcons(),t=0;t .availability-children > .availability-connector span.label").each(function(i){i.set("innerHTML",a)})},M.core_availability.List.prototype.deleteDescendant=function(i){for(var t,e,a=0;a .availability-children").removeChild(e),M.core_availability.form.update(),this.updateHtml(),this.inner.one("> .availability-button").one("button").focus(),!0;if(t instanceof M.core_availability.List&&t.deleteDescendant(i))return!0}return!1},M.core_availability.List.prototype.clickAdd=function(){var i,t,e,a,l,n=d.Node.create('
      "),o=n.one("button"),s={dialog:null},r=n.one("ul");for(l in M.core_availability.form.plugins)M.core_availability.form.plugins[l].allowAdd&&(i=d.Node.create('
    • '),(e=d.Node.create('
      ")).on("click",this.getAddHandler(l,s),this),i.appendChild(e),a=d.Node.create('
      "),i.appendChild(a),r.appendChild(i));i=d.Node.create('
    • '),(e=d.Node.create('
      ")).on("click",this.getAddHandler(null,s),this),i.appendChild(e),a=d.Node.create('
      "),i.appendChild(a),r.appendChild(i),n={headerContent:M.util.get_string("addrestriction","availability"),bodyContent:n,additionalBaseClass:"availability-dialogue",draggable:!0,modal:!0, closeButton:!1,width:"450px"},s.dialog=new M.core.dialogue(n),s.dialog.show(),o.on("click",function(){s.dialog.destroy(),this.inner.one("> .availability-button").one("button").focus()},this)},M.core_availability.List.prototype.getAddHandler=function(t,e){return function(){var i=!0;t&&M.core_availability.form.plugins[t].displayMode&&(i=!1),i=t?new M.core_availability.Item({type:t,creating:!0,showc:i},this.root):new M.core_availability.List({c:[],showc:i},!1,this.root),this.addChild(i),M.core_availability.form.update(),M.core_availability.form.rootList.renumber(),this.updateHtml(),e.dialog.destroy(),i.focusAfterAdd()}},M.core_availability.List.prototype.getValue=function(){var i,t,e={};for(e.op=this.node.one(".availability-neg").get("value")+this.node.one(".availability-op").get("value"),e.c=[],i=0;i'+M.util.get_string("missingplugin","availability")+"
      ")):(this.plugin=M.core_availability.form.plugins[i.type],this.pluginNode=this.plugin.getNode(i),this.pluginNode.addClass("availability_"+i.type)),d.augment(this.pluginNode,d.EventTarget,!0,null,{emitFacade:!0}),this.pluginNode.addTarget(this),this.node=d.Node.create('

      '),t&&(t=!0,i.showc!==undefined&&(t=i.showc),this.eyeIcon=new M.core_availability.EyeIcon(!0,t),this.node.appendChild(this.eyeIcon.span),this.node.appendChild(this.eyeIcon.disabledSpan)),this.pluginNode.addClass("availability-plugincontrols"),this.node.appendChild(this.pluginNode),i=new M.core_availability.DeleteIcon(this),this.node.appendChild(i.span),this.node.appendChild(document.createTextNode(" ")),this.node.appendChild(d.Node.create(''))},d.augment(M.core_availability.Item,d.EventTarget,!0,null,{emitFacade:!0}),M.core_availability.Item.prototype.getValue=function(){var i={type:this.pluginType};return this.plugin&&this.plugin.fillValue(i,this.pluginNode),i},M.core_availability.Item.prototype.fillErrors=function(i){var t,e,a,l=i.length;this.plugin?this.plugin.fillErrors(i,this.pluginNode):i.push("core_availability:item_unknowntype"),t=this.node.one("> .bg-warning"),i.length===l||t.get("firstChild")?i.length===l&&t.get("firstChild")&&t.get("firstChild").remove():(l="",e=(i=i[i.length-1].split(":"))[0],a="[["+(i=i[1])+","+e+"]]",(l=M.util.get_string(i,e))===a&&(l=M.util.get_string("invalid","availability")),t.appendChild(document.createTextNode(l)))},M.core_availability.Item.prototype.renumber=function(i){var t={number:i};this.plugin?t.type=M.util.get_string("title","availability_"+this.pluginType):t.type="["+this.pluginType+"]",t.number=i+":",t=M.util.get_string("itemheading","availability",t),this.node.one("> h3").set("innerHTML",t),this.node.one("> h3").getDOMNode().dataset.restrictionOrder=i||"root"},M.core_availability.Item.prototype.focusAfterAdd=function(){this.plugin.focusAfterAdd(this.pluginNode)},M.core_availability.Item.prototype.pluginType=null,M.core_availability.Item.prototype.plugin=null,M.core_availability.Item.prototype.eyeIcon=null,M.core_availability.Item.prototype.node=null,M.core_availability.Item.prototype.pluginNode=null,M.core_availability.EyeIcon=function(i,t){var e,a,l,n;this.individual=i,this.span=d.Node.create(''),e=d.Node.create(""),this.span.appendChild(e),a=i?"_individual":"_all",l=function(){var i=M.util.get_string("hidden"+a,"availability");e.set("src",M.util.image_url("i/show","core")),e.set("alt",i),this.span.set("title",i+" • "+M.util.get_string("show_verb","availability"))},n=function(){var i=M.util.get_string("shown"+a,"availability");e.set("src",M.util.image_url("i/hide","core")),e.set("alt",i),this.span.set("title",i+" • "+M.util.get_string("hide_verb","availability"))},(t?n:l).call(this),this.span.on("click",i=function(i){i.preventDefault(),(this.isHidden()?n:l).call(this),M.core_availability.form.update()},this),this.span.on("key",i,"up:32",this),this.span.on("key",function(i){i.preventDefault()},"down:32",this),this.disabledSpan=d.Node.create(''),t=d.Node.create(""),i=M.util.get_string("hidden"+a,"availability"),t.set("src",M.util.image_url("i/show","core")),t.set("alt",i), this.disabledSpan.set("title",i+" • "+M.util.get_string("disabled_verb","availability")),this.disabledSpan.appendChild(t),this.disabledSpan.hide()},M.core_availability.EyeIcon.prototype.individual=!1,M.core_availability.EyeIcon.prototype.span=null,M.core_availability.EyeIcon.prototype.disabledSpan=null,M.core_availability.EyeIcon.prototype.isHidden=function(){var i=this.individual?"_individual":"_all",i=M.util.get_string("hidden"+i,"availability");return this.span.one("img").get("alt")===i},M.core_availability.EyeIcon.prototype.isDisabled=function(){return this.span.hasAttribute("hidden")},M.core_availability.EyeIcon.prototype.setDisabled=function(){this.isDisabled()||(this.span.hide(),this.disabledSpan.show())},M.core_availability.EyeIcon.prototype.setEnabled=function(){this.isDisabled()&&(this.span.show(),this.disabledSpan.hide())},M.core_availability.DeleteIcon=function(t){var i;this.span=d.Node.create(''),i=d.Node.create(''+M.util.get_string('),this.span.appendChild(i),this.span.on("click",i=function(i){i.preventDefault(),M.core_availability.form.rootList.deleteDescendant(t),M.core_availability.form.rootList.renumber()},this),this.span.on("key",i,"up:32",this),this.span.on("key",function(i){i.preventDefault()},"down:32",this)},M.core_availability.DeleteIcon.prototype.span=null},"@VERSION@",{requires:["base","node","event","event-delegate","panel","moodle-core-notification-dialogue","json"]}); \ No newline at end of file diff --git a/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form.js b/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form.js index 57e2137f5ca..8e0afe757f3 100644 --- a/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form.js +++ b/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form.js @@ -379,14 +379,14 @@ M.core_availability.List = function(json, root, parentRoot) { '
      ' + M.util.get_string('listheader_sign_before', 'availability') + '' + ' ' + '' + M.util.get_string('listheader_single', 'availability') + '' + '' + M.util.get_string('listheader_multi_before', 'availability') + ' ' + diff --git a/availability/yui/src/form/js/form.js b/availability/yui/src/form/js/form.js index 59ab34bd951..85fa02c618f 100644 --- a/availability/yui/src/form/js/form.js +++ b/availability/yui/src/form/js/form.js @@ -377,14 +377,14 @@ M.core_availability.List = function(json, root, parentRoot) { '
      ' + M.util.get_string('listheader_sign_before', 'availability') + '' + ' ' + '' + M.util.get_string('listheader_single', 'availability') + '' + '' + M.util.get_string('listheader_multi_before', 'availability') + ' ' + diff --git a/backup/util/ui/classes/output/copy_form.php b/backup/util/ui/classes/output/copy_form.php index 9c86d210523..9f15e461d71 100644 --- a/backup/util/ui/classes/output/copy_form.php +++ b/backup/util/ui/classes/output/copy_form.php @@ -86,7 +86,7 @@ class copy_form extends \moodleform { $mform->setConstant('returnurl', $returnurl); // Form heading. - $mform->addElement('html', \html_writer::div(get_string('copycoursedesc', 'backup'), 'form-description mb-6')); + $mform->addElement('html', \html_writer::div(get_string('copycoursedesc', 'backup'), 'form-text mb-6')); // Course fullname. $mform->addElement('text', 'fullname', get_string('fullnamecourse'), diff --git a/badges/amd/build/selectors.min.js b/badges/amd/build/selectors.min.js index 6651a0bd745..1c52ecebb4d 100644 --- a/badges/amd/build/selectors.min.js +++ b/badges/amd/build/selectors.min.js @@ -6,6 +6,6 @@ define("core_badges/selectors",["exports"],(function(_exports){Object.defineProp * @copyright 2020 Sara Arjona * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -const getDataSelector=(name,value)=>"[data-".concat(name,'="').concat(value,'"]');var _default={actions:{deletebackpack:getDataSelector("action","deletebackpack"),enablebadge:getDataSelector("action","enablebadge"),disablebadge:getDataSelector("action","disablebadge")},elements:{clearsearch:".input-group-append .clear-icon",main:"#backpacklist",backpackurl:"[data-backpackurl]"}};return _exports.default=_default,_exports.default})); +const getDataSelector=(name,value)=>"[data-".concat(name,'="').concat(value,'"]');var _default={actions:{deletebackpack:getDataSelector("action","deletebackpack"),enablebadge:getDataSelector("action","enablebadge"),disablebadge:getDataSelector("action","disablebadge")},elements:{clearsearch:".input-group .clear-icon",main:"#backpacklist",backpackurl:"[data-backpackurl]"}};return _exports.default=_default,_exports.default})); //# sourceMappingURL=selectors.min.js.map \ No newline at end of file diff --git a/badges/amd/build/selectors.min.js.map b/badges/amd/build/selectors.min.js.map index 9b3f4c7903b..4936c5cb9e3 100644 --- a/badges/amd/build/selectors.min.js.map +++ b/badges/amd/build/selectors.min.js.map @@ -1 +1 @@ -{"version":3,"file":"selectors.min.js","sources":["../src/selectors.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Define all of the selectors we will be using on the backpack interface.\n *\n * @module core_badges/selectors\n * @copyright 2020 Sara Arjona \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * A small helper function to build queryable data selectors.\n *\n * @method getDataSelector\n * @param {String} name\n * @param {String} value\n * @return {string}\n */\nconst getDataSelector = (name, value) => {\n return `[data-${name}=\"${value}\"]`;\n};\n\nexport default {\n actions: {\n deletebackpack: getDataSelector('action', 'deletebackpack'),\n enablebadge: getDataSelector('action', 'enablebadge'),\n disablebadge: getDataSelector('action', 'disablebadge'),\n },\n elements: {\n clearsearch: '.input-group-append .clear-icon',\n main: '#backpacklist',\n backpackurl: '[data-backpackurl]',\n },\n};\n"],"names":["getDataSelector","name","value","actions","deletebackpack","enablebadge","disablebadge","elements","clearsearch","main","backpackurl"],"mappings":";;;;;;;;MA+BMA,gBAAkB,CAACC,KAAMC,wBACXD,kBAASC,yBAGd,CACXC,QAAS,CACLC,eAAgBJ,gBAAgB,SAAU,kBAC1CK,YAAaL,gBAAgB,SAAU,eACvCM,aAAcN,gBAAgB,SAAU,iBAE5CO,SAAU,CACNC,YAAa,kCACbC,KAAM,gBACNC,YAAa"} \ No newline at end of file +{"version":3,"file":"selectors.min.js","sources":["../src/selectors.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Define all of the selectors we will be using on the backpack interface.\n *\n * @module core_badges/selectors\n * @copyright 2020 Sara Arjona \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * A small helper function to build queryable data selectors.\n *\n * @method getDataSelector\n * @param {String} name\n * @param {String} value\n * @return {string}\n */\nconst getDataSelector = (name, value) => {\n return `[data-${name}=\"${value}\"]`;\n};\n\nexport default {\n actions: {\n deletebackpack: getDataSelector('action', 'deletebackpack'),\n enablebadge: getDataSelector('action', 'enablebadge'),\n disablebadge: getDataSelector('action', 'disablebadge'),\n },\n elements: {\n clearsearch: '.input-group .clear-icon',\n main: '#backpacklist',\n backpackurl: '[data-backpackurl]',\n },\n};\n"],"names":["getDataSelector","name","value","actions","deletebackpack","enablebadge","disablebadge","elements","clearsearch","main","backpackurl"],"mappings":";;;;;;;;MA+BMA,gBAAkB,CAACC,KAAMC,wBACXD,kBAASC,yBAGd,CACXC,QAAS,CACLC,eAAgBJ,gBAAgB,SAAU,kBAC1CK,YAAaL,gBAAgB,SAAU,eACvCM,aAAcN,gBAAgB,SAAU,iBAE5CO,SAAU,CACNC,YAAa,2BACbC,KAAM,gBACNC,YAAa"} \ No newline at end of file diff --git a/badges/amd/src/selectors.js b/badges/amd/src/selectors.js index b7a557a91cc..265e440343e 100644 --- a/badges/amd/src/selectors.js +++ b/badges/amd/src/selectors.js @@ -40,7 +40,7 @@ export default { disablebadge: getDataSelector('action', 'disablebadge'), }, elements: { - clearsearch: '.input-group-append .clear-icon', + clearsearch: '.input-group .clear-icon', main: '#backpacklist', backpackurl: '[data-backpackurl]', }, diff --git a/calendar/templates/export_calendar_url.mustache b/calendar/templates/export_calendar_url.mustache index 7bcd480dc38..323647ae7bf 100644 --- a/calendar/templates/export_calendar_url.mustache +++ b/calendar/templates/export_calendar_url.mustache @@ -30,17 +30,15 @@
      -
      - -
      +
      diff --git a/course/classes/management_renderer.php b/course/classes/management_renderer.php index ba94d9b7d89..e4fb804893a 100644 --- a/course/classes/management_renderer.php +++ b/course/classes/management_renderer.php @@ -193,7 +193,7 @@ class core_course_management_renderer extends plugin_renderer_base { 'type' => 'checkbox', 'name' => 'bcat[]', 'value' => $category->id, - 'class' => 'bulk-action-checkbox custom-control-input', + 'class' => 'bulk-action-checkbox form-check-input', 'data-action' => 'select' ); @@ -243,11 +243,11 @@ class core_course_management_renderer extends plugin_renderer_base { $html = html_writer::start_tag('li', $attributes); $html .= html_writer::start_div('clearfix'); $html .= html_writer::start_div('float-start ' . $checkboxclass); - $html .= html_writer::start_div('custom-control custom-checkbox me-1 '); + $html .= html_writer::start_div('form-check custom-checkbox me-1 '); $html .= html_writer::empty_tag('input', $bcatinput); $labeltext = html_writer::span(get_string('bulkactionselect', 'moodle', $text), 'visually-hidden'); $html .= html_writer::tag('label', $labeltext, array( - 'class' => 'custom-control-label', + 'class' => 'form-check-label', 'for' => 'categorylistitem' . $category->id)); $html .= html_writer::end_div(); $html .= html_writer::end_div(); @@ -603,7 +603,7 @@ class core_course_management_renderer extends plugin_renderer_base { 'type' => 'checkbox', 'name' => 'bc[]', 'value' => $course->id, - 'class' => 'bulk-action-checkbox custom-control-input', + 'class' => 'bulk-action-checkbox form-check-input', 'data-action' => 'select' ); @@ -624,11 +624,11 @@ class core_course_management_renderer extends plugin_renderer_base { } $html .= html_writer::start_div('float-start ' . $checkboxclass); - $html .= html_writer::start_div('custom-control custom-checkbox me-1 '); + $html .= html_writer::start_div('form-check custom-checkbox me-1 '); $html .= html_writer::empty_tag('input', $bulkcourseinput); $labeltext = html_writer::span(get_string('bulkactionselect', 'moodle', $text), 'visually-hidden'); $html .= html_writer::tag('label', $labeltext, array( - 'class' => 'custom-control-label', + 'class' => 'form-check-label', 'for' => 'courselistitem' . $course->id)); $html .= html_writer::end_div(); $html .= html_writer::end_div(); @@ -1192,7 +1192,7 @@ class core_course_management_renderer extends plugin_renderer_base { 'id' => 'coursesearchlistitem' . $course->id, 'name' => 'bc[]', 'value' => $course->id, - 'class' => 'bulk-action-checkbox custom-control-input', + 'class' => 'bulk-action-checkbox form-check-input', 'data-action' => 'select' ); } @@ -1203,11 +1203,11 @@ class core_course_management_renderer extends plugin_renderer_base { $html .= html_writer::start_div('clearfix'); $html .= html_writer::start_div('float-start'); if ($bulkcourseinput) { - $html .= html_writer::start_div('custom-control custom-checkbox me-1'); + $html .= html_writer::start_div('form-check custom-checkbox me-1'); $html .= html_writer::empty_tag('input', $bulkcourseinput); $labeltext = html_writer::span(get_string('bulkactionselect', 'moodle', $text), 'visually-hidden'); $html .= html_writer::tag('label', $labeltext, array( - 'class' => 'custom-control-label', + 'class' => 'form-check-label', 'for' => 'coursesearchlistitem' . $course->id)); $html .= html_writer::end_div(); } diff --git a/course/templates/activity_list.mustache b/course/templates/activity_list.mustache index 08add8a57f5..cca9b85c02d 100644 --- a/course/templates/activity_list.mustache +++ b/course/templates/activity_list.mustache @@ -24,18 +24,16 @@ {{#search}}
      - -
      - -
      + +
      {{#query}} diff --git a/enrol/lti/styles.css b/enrol/lti/styles.css index 0c39fb2ce9e..12f2ae7f0e1 100644 --- a/enrol/lti/styles.css +++ b/enrol/lti/styles.css @@ -1,11 +1,11 @@ /* enrol_lti styles */ -#registration-tab-content .input-group-append button.btn { +#registration-tab-content .input-group button.btn { border: solid 1px #8f959e; } form#auto_submit { display: none; } -#registration-tab-content .input-group-append button.btn span.pix { +#registration-tab-content .input-group button.btn span.pix { padding-left: 0.5rem; } diff --git a/enrol/lti/templates/local/ltiadvantage/tool_details.mustache b/enrol/lti/templates/local/ltiadvantage/tool_details.mustache index 54e3ccfb3ae..f11b73bdd7a 100644 --- a/enrol/lti/templates/local/ltiadvantage/tool_details.mustache +++ b/enrol/lti/templates/local/ltiadvantage/tool_details.mustache @@ -69,17 +69,15 @@
      -
      - -
      +
      @@ -107,17 +105,15 @@
      -
      - -
      +
      diff --git a/grade/report/grader/templates/collapse/collapsebody.mustache b/grade/report/grader/templates/collapse/collapsebody.mustache index 1f2742bd488..ac83923a2a7 100644 --- a/grade/report/grader/templates/collapse/collapsebody.mustache +++ b/grade/report/grader/templates/collapse/collapsebody.mustache @@ -49,9 +49,9 @@
      -
      -
    • -
      {{label}} - {{#menuoptions}} {{/menuoptions}} diff --git a/grade/report/singleview/templates/dropdown_attribute.mustache b/grade/report/singleview/templates/dropdown_attribute.mustache index d04a631708a..818e71ef09a 100644 --- a/grade/report/singleview/templates/dropdown_attribute.mustache +++ b/grade/report/singleview/templates/dropdown_attribute.mustache @@ -33,7 +33,7 @@ {{/readonly}} {{^readonly}} - {{#options}} {{/options}} diff --git a/grade/report/singleview/templates/perpage.mustache b/grade/report/singleview/templates/perpage.mustache index d74cf73a45a..55042915cbf 100644 --- a/grade/report/singleview/templates/perpage.mustache +++ b/grade/report/singleview/templates/perpage.mustache @@ -36,7 +36,7 @@
      '),cancelelement=$('');for(i in options)inputelement.append($("
      ' + '{{#if canUpload}}' + diff --git a/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button-min.js b/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button-min.js index 65ab5024668..eedfa3aef42 100644 --- a/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button-min.js +++ b/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button-min.js @@ -1,3 +1,3 @@ YUI.add("moodle-atto_h5p-button",function(c,t){var d={CONTENTWARNING:"att_h5p_contentwarning",H5PBROWSER:"openh5pbrowser",INPUTALT:"atto_h5p_altentry",INPUTH5PFILE:"atto_h5p_file",INPUTSUBMIT:"atto_h5p_urlentrysubmit",OPTION_DOWNLOAD_BUTTON:"atto_h5p_option_download_button",OPTION_COPYRIGHT_BUTTON:"atto_h5p_option_copyright_button",OPTION_EMBED_BUTTON:"atto_h5p_option_embed_button",URLWARNING:"atto_h5p_warning"},r={CONTENTWARNING:"."+d.CONTENTWARNING,H5PBROWSER:"."+d.H5PBROWSER,INPUTH5PFILE:"."+d.INPUTH5PFILE,INPUTSUBMIT:"."+d.INPUTSUBMIT,OPTION_DOWNLOAD_BUTTON:"."+d.OPTION_DOWNLOAD_BUTTON,OPTION_COPYRIGHT_BUTTON:"."+d.OPTION_COPYRIGHT_BUTTON,OPTION_EMBED_BUTTON:"."+d.OPTION_EMBED_BUTTON,URLWARNING:"."+d.URLWARNING},p="atto_h5p",h='{{#if addParagraphs}}


      {{/if}}
      {{{url}}}
      {{#if addParagraphs}}


      {{/if}}';c.namespace("M.atto_h5p").Button=c.Base.create("button",c.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_form:null,_H5PDiv:null,_allowedmethods:"none",initializer:function(){this._allowedmethods=this.get("allowedmethods"),"none"!==this._allowedmethods&&(this.addButton({icon:"icon",iconComponent:"atto_h5p",callback:this._displayDialogue,tags:".h5p-placeholder",tagMatchRequiresAll:!1}),this.editor.all(".h5p-placeholder").setAttribute("contenteditable","false"),this.editor.delegate("dblclick",this._handleDblClick,".h5p-placeholder",this),this.editor.delegate("click",this._handleClick,".h5p-placeholder",this))},_handleDblClick:function(){this._displayDialogue()},_handleClick:function(t){t=this.get("host").getSelectionFromNode(t.target);this.get("host").getSelection()!==t&&this.get("host").setSelection(t)},_displayDialogue:function(){this._currentSelection=this.get("host").getSelection(),!1!==this._currentSelection&&(this._getH5PDiv(),this.getDialogue({headerContent:M.util.get_string("pluginname",p),width:"auto",focusAfterHide:!0}).set("bodyContent",this._getDialogueContent()).show(),M.form.shortforms({formid:this.get("host").get("elementid")+"_atto_h5p_form"}))},_getH5PDiv:function(){var t=this.get("host").getSelectedNodes(),e=null;t.each(function(t){t.hasClass("h5p-placeholder")&&(e=t)}),this._H5PDiv=e},_getPermissions:function(){var t={canEmbed:!1,canUpload:!1,canUploadAndEmbed:!1};return this.get("host").canShowFilepicker("h5p")&&("both"===this._allowedmethods?(t.canUploadAndEmbed=!0,t.canUpload=!0):"upload"===this._allowedmethods&&(t.canUpload=!0)),"both"!==this._allowedmethods&&"embed"!==this._allowedmethods||(t.canEmbed=!0),t},_getDialogueContent:function(){var t,e,o,n,i,a,l=this._getPermissions(),s=!1;return this._H5PDiv&&(a=this._H5PDiv.get("innerHTML"),(i=M.cfg.wwwroot+"/draftfile.php")==a.substring(0,i.length)?(t=a.split("?")[0],(i=a.split("?")[1])&&(i.match(/export=1/)&&(e="checked",s=!0),i.match(/embed=1/)&&(o="checked",s=!0),i.match(/copyright=1/)&&(n="checked",s=!0))):t=a),i=c.Handlebars.compile( -'
      {{#if canUploadAndEmbed}}
      {{{get_string "instructions" component}}}
      {{/if}}
      {{#if canUpload}}{{/if}}
      {{#if canUpload}}
      {{/if}}
      '),a=c.Node.create(i({elementid:this.get("host").get("elementid"),CSS:d,component:p,canUpload:l.canUpload,canEmbed:l.canEmbed,canUploadAndEmbed:l.canUploadAndEmbed,showOptions:s,fileURL:t,optionDownloadButton:e,optionEmbedButton:o,optionCopyrightButton:n})),this._form=a,this._setEventListeners(),a},_filepickerCallback:function(t){""!==t.url&&(this._form.one(r.INPUTH5PFILE).set("value",t.url),this._removeWarnings())},_setEventListeners:function(){var t=this._form,e=this._getPermissions();t.one(r.INPUTSUBMIT).on("click",this._setH5P,this),e.canUpload&&t.one(r.H5PBROWSER).on("click",function(){this.get("host").showFilepicker("h5p",this._filepickerCallback,this)},this),e.canUploadAndEmbed&&t.one(r.INPUTH5PFILE).on("change",function(){this._removeWarnings()},this)},_removeWarnings:function(){var t=this._form;t.one(r.URLWARNING).setStyle("display","none"),t.one(r.CONTENTWARNING).setStyle("display","none")},_setH5P:function(t){var e,o,n,i,a=this._form,l=this.get("host"),s=a.one(r.INPUTH5PFILE).get("value"),d=this._getPermissions();if(t.preventDefault(),!this._updateWarning()){if(l.focus(),t=!0,this._H5PDiv&&(this._H5PDiv.remove(),t=!1),""!==s){if(l.setSelection(this._currentSelection),s.startsWith(M.cfg.wwwroot)){if(o="",d.canUpload)for(i in n={},a.one(r.OPTION_DOWNLOAD_BUTTON).get("checked")&&(n["export"]="1"),a.one(r.OPTION_EMBED_BUTTON).get("checked")&&(n.embed="1"),a.one(r.OPTION_COPYRIGHT_BUTTON).get("checked")&&(n.copyright="1"),n)""===o&&-1===s.indexOf("?")?o+="?":o+="&",o+=i+"="+n[i];e=c.Handlebars.compile(h)({url:s+o,addParagraphs:t})}else e=c.Handlebars.compile(h)({url:s});l.insertContentAtFocusPoint(e),this.markUpdated()}this.getDialogue({focusAfterHide:null}).hide()}},_validEmbed:function(t){return!!new RegExp("^()").test(t)},_validURL:function(t){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*").test(t)},_updateWarning:function(){var t=this._form,e=!0,o=this._getPermissions();return e=o.canUpload||o.canEmbed?""!==(o=t.one(r.INPUTH5PFILE).get("value"))?(t.one(r.CONTENTWARNING).setStyle("display","none"),o.startsWith(M.cfg.wwwroot)||this._validURL(o)?(t.one(r.URLWARNING).setStyle("display","none"),!1):(t.one(r.URLWARNING).setStyle("display","block"),!0)):(t.one(r.CONTENTWARNING).setStyle("display", -"block"),!0):e}},{ATTRS:{allowedmethods:{value:null}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file +'
      {{#if canUploadAndEmbed}}
      {{{get_string "instructions" component}}}
      {{/if}}
      {{#if canUpload}}{{/if}}
      {{#if canUpload}}
      {{/if}}
      '),a=c.Node.create(i({elementid:this.get("host").get("elementid"),CSS:d,component:p,canUpload:l.canUpload,canEmbed:l.canEmbed,canUploadAndEmbed:l.canUploadAndEmbed,showOptions:s,fileURL:t,optionDownloadButton:e,optionEmbedButton:o,optionCopyrightButton:n})),this._form=a,this._setEventListeners(),a},_filepickerCallback:function(t){""!==t.url&&(this._form.one(r.INPUTH5PFILE).set("value",t.url),this._removeWarnings())},_setEventListeners:function(){var t=this._form,e=this._getPermissions();t.one(r.INPUTSUBMIT).on("click",this._setH5P,this),e.canUpload&&t.one(r.H5PBROWSER).on("click",function(){this.get("host").showFilepicker("h5p",this._filepickerCallback,this)},this),e.canUploadAndEmbed&&t.one(r.INPUTH5PFILE).on("change",function(){this._removeWarnings()},this)},_removeWarnings:function(){var t=this._form;t.one(r.URLWARNING).setStyle("display","none"),t.one(r.CONTENTWARNING).setStyle("display","none")},_setH5P:function(t){var e,o,n,i,a=this._form,l=this.get("host"),s=a.one(r.INPUTH5PFILE).get("value"),d=this._getPermissions();if(t.preventDefault(),!this._updateWarning()){if(l.focus(),t=!0,this._H5PDiv&&(this._H5PDiv.remove(),t=!1),""!==s){if(l.setSelection(this._currentSelection),s.startsWith(M.cfg.wwwroot)){if(o="",d.canUpload)for(i in n={},a.one(r.OPTION_DOWNLOAD_BUTTON).get("checked")&&(n["export"]="1"),a.one(r.OPTION_EMBED_BUTTON).get("checked")&&(n.embed="1"),a.one(r.OPTION_COPYRIGHT_BUTTON).get("checked")&&(n.copyright="1"),n)""===o&&-1===s.indexOf("?")?o+="?":o+="&",o+=i+"="+n[i];e=c.Handlebars.compile(h)({url:s+o,addParagraphs:t})}else e=c.Handlebars.compile(h)({url:s});l.insertContentAtFocusPoint(e),this.markUpdated()}this.getDialogue({focusAfterHide:null}).hide()}},_validEmbed:function(t){return!!new RegExp("^()").test(t)},_validURL:function(t){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*").test(t)},_updateWarning:function(){var t=this._form,e=!0,o=this._getPermissions();return e=o.canUpload||o.canEmbed?""!==(o=t.one(r.INPUTH5PFILE).get("value"))?(t.one(r.CONTENTWARNING).setStyle("display","none"),o.startsWith(M.cfg.wwwroot)||this._validURL(o)?(t.one(r.URLWARNING).setStyle("display","none"),!1):(t.one(r.URLWARNING).setStyle("display","block"),!0)):(t.one(r.CONTENTWARNING).setStyle("display","block"),!0):e}},{ATTRS:{allowedmethods:{ +value:null}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button.js b/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button.js index a57808329ab..0355afa3f65 100644 --- a/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button.js +++ b/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button.js @@ -86,10 +86,8 @@ var CSS = { '' + '{{#if canUpload}}' + - '' + - '' + - '' + + '' + '{{/if}}' + '
    • ' + '{{#if canUpload}}' + diff --git a/lib/editor/atto/plugins/h5p/yui/src/button/js/button.js b/lib/editor/atto/plugins/h5p/yui/src/button/js/button.js index 6b0b98c933e..ea81bb87b47 100644 --- a/lib/editor/atto/plugins/h5p/yui/src/button/js/button.js +++ b/lib/editor/atto/plugins/h5p/yui/src/button/js/button.js @@ -84,10 +84,8 @@ var CSS = { '' + '{{#if canUpload}}' + - '' + - '' + - '' + + '' + '{{/if}}' + '
      ' + '{{#if canUpload}}' + diff --git a/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-debug.js b/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-debug.js index 8e899ee1509..bc43a272311 100644 --- a/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-debug.js +++ b/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-debug.js @@ -116,10 +116,8 @@ var CSS = { '
      ' + '' + - '' + - '' + - '' + + '' + '
      ' + '
      ' + '{{else}}' + @@ -183,7 +181,7 @@ var CSS = { // Add the alignment selector. '
      ' + '' + - '' + '{{#each alignments}}' + '' + '{{/each}}' + diff --git a/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-min.js b/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-min.js index 8d65855f0c1..e3985ea6d3d 100644 --- a/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-min.js +++ b/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-min.js @@ -1,3 +1,3 @@ YUI.add("moodle-atto_image-button",function(m,e){var c={RESPONSIVE:"img-fluid",INPUTALIGNMENT:"atto_image_alignment",INPUTALT:"atto_image_altentry",INPUTHEIGHT:"atto_image_heightentry",INPUTSUBMIT:"atto_image_urlentrysubmit",INPUTURL:"atto_image_urlentry",INPUTSIZE:"atto_image_size",INPUTWIDTH:"atto_image_widthentry",IMAGEALTWARNING:"atto_image_altwarning",IMAGEURLWARNING:"atto_image_urlwarning",IMAGEBROWSER:"openimagebrowser",IMAGEPRESENTATION:"atto_image_presentation",INPUTCONSTRAIN:"atto_image_constrain",INPUTCUSTOMSTYLE:"atto_image_customstyle",IMAGEPREVIEW:"atto_image_preview",IMAGEPREVIEWBOX:"atto_image_preview_box",ALIGNSETTINGS:"atto_image_button"},i={URL:"urlentry",ALT:"altentry"},t={INPUTURL:"."+c.INPUTURL},s=[{name:"verticalAlign",str:"alignment_top",value:"text-top",margin:"0 0.5em"},{name:"verticalAlign",str:"alignment_middle",value:"middle",margin:"0 0.5em"},{name:"verticalAlign",str:"alignment_bottom",value:"text-bottom",margin:"0 0.5em",isDefault:!0},{name:"float",str:"alignment_left",value:"left",margin:"0 0.5em 0 0"},{name:"float",str:"alignment_right",value:"right",margin:"0 0 0 0.5em"}],a=160,o=160,u=/\d+%/,d="atto_image",I='{{alt}}';m.namespace("M.atto_image").Button=m.Base.create("button",m.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_selectedImage:null,_form:null,_rawImageDimensions:null,initializer:function(){this.addButton({icon:"e/insert_edit_image",callback:this._displayDialogue,tags:"img",tagMatchRequiresAll:!1}),this.editor.delegate("dblclick",this._displayDialogue,"img",this),this.editor.delegate("click",this._handleClick,"img",this),this.editor.on("paste",this._handlePaste,this),this.editor.on("drop",this._handleDragDrop,this),this.editor.on("dragover",function(e){e.preventDefault()},this),this.editor.on("dragenter",function(e){e.preventDefault()},this)},_handleDragDrop:function(e){e._event&&e._event.dataTransfer&&this._handlePasteOrDropHelper(e,e._event.dataTransfer)},_handlePaste:function(e){return!e._event||!e._event.clipboardData||this._handlePasteOrDropHelper(e,e._event.clipboardData)},_handlePasteOrDropHelper:function(e,t){for(var i,n=t.items,a=!1,s=0;s{{#if showFilepicker}}
      {{else}}
      {{/if}}
      0 / 125
      x

      '),t=this.get("host").canShowFilepicker("image"),e=m.Node.create(e({elementid:this.get("host").get("elementid"),CSS:c,FORMNAMES:i,component:d,showFilepicker:t,alignments:s}));return this._form=e,this._applyImageProperties(this._form),this._form.one("."+c.INPUTURL).on("blur",this._urlChanged,this),this._form.one("."+c.INPUTURL).on("change",this._hasErrorUrlField,this),this._form.one("."+c.IMAGEPRESENTATION).on("change",this._hasErrorAltField,this),this._form.one("."+c.INPUTALT).on("blur",this._hasErrorAltField,this),this._form.one("."+c.INPUTWIDTH).on("blur",this._autoAdjustSize,this),this._form.one("."+c.INPUTHEIGHT).on("blur",this._autoAdjustSize,this,!0),this._form.one("."+c.INPUTCONSTRAIN).on("change",function(e){e.target.get("checked")&&this._autoAdjustSize(e)},this),this._form.one("."+c.INPUTSUBMIT).on("click",this._setImage,this),t&&this._form.one("."+c.IMAGEBROWSER).on("click",function(){this.get("host").showFilepicker("image",this._filepickerCallback,this)},this),this._form.one("."+c.INPUTALT).on("keyup",this._handleKeyup,this),e},_autoAdjustSize:function(g,e){var t,i,n,d,a,s,o,l,r,h;e=e||!1,t=this._form.one("."+c.INPUTWIDTH),i="width",n=this._form.one("."+c.INPUTHEIGHT),d="height",h=this._form.one("."+c.INPUTCONSTRAIN),a=t.get("value"),s=n.get("value"),o=this._form.one("."+c.IMAGEPREVIEW),this._rawImageDimensions&&(""===a&&(a=this._rawImageDimensions[i],t.set("value",a),a=t.get("value")),o.setStyles({width:null,height:null}),h.get("checked")?(e&&(h=t,t=n,n=h,h=i,i=d,d=h,h=a,a=s,s=h),a.match(u)?(s=a,l=parseInt(a,10),r=this._rawImageDimensions.width/100*l,o.setStyle("width",r),r=this._rawImageDimensions.height/100*l,o.setStyle("height",r)):(s=Math.round(a/this._rawImageDimensions[i]*this._rawImageDimensions[d]),e?o.setStyles({width:s,height:a}):o.setStyles({width:a,height:s})),n.set("value",s)):(a.match(u)?(l=parseInt(a,10),r=this._rawImageDimensions.width/100*l,o.setStyle("width",r+"px")):o.setStyle("width",a+"px"),s.match(u)?(l=parseInt(s,10),r=this._rawImageDimensions.height/100*l,o.setStyle("height",r+"px")):o.setStyle("height",s+"px")))},_filepickerCallback:function(e){""!==e.url&&(this._form.one("."+c.INPUTURL).set("value",e.url),this._form.one("."+c.INPUTWIDTH).set("value",""),this._form.one("."+c.INPUTHEIGHT).set("value",""),this._loadPreviewImage(e.url))},_applyImageProperties:function(t){var e=this._getSelectedImageProperties(),i=t.one("."+c.IMAGEPREVIEW);if(!1===e)return i.setStyle("display","none"),void s.some(function(e){return!!e.isDefault&&( -t.one("."+c.INPUTALIGNMENT).set("value",e.value),!0)},this);e.align&&t.one("."+c.INPUTALIGNMENT).set("value",e.align),e.customstyle&&t.one("."+c.INPUTCUSTOMSTYLE).set("value",e.customstyle),e.width&&t.one("."+c.INPUTWIDTH).set("value",e.width),e.height&&t.one("."+c.INPUTHEIGHT).set("value",e.height),e.alt&&t.one("."+c.INPUTALT).set("value",e.alt),e.src&&(t.one("."+c.INPUTURL).set("value",e.src),this._loadPreviewImage(e.src)),e.presentation&&t.one("."+c.IMAGEPRESENTATION).set("checked","checked"),this._autoAdjustSize()},_getSelectedImageProperties:function(){var e,t,i={src:null,alt:null,width:null,height:null,align:"",presentation:!1},n=this.get("host").getSelectedNodes();return(n=n&&n.filter("img"))&&n.size()?(n=this._removeLegacyAlignment(n.item(0)),t=(this._selectedImage=n).getAttribute("style"),i.customstyle=t,(t=n.getAttribute("width")).match(u)||(t=parseInt(t,10)),(e=n.getAttribute("height")).match(u)||(e=parseInt(e,10)),0!==t&&(i.width=t),0!==e&&(i.height=e),this._getAlignmentPropeties(n,i),i.src=n.getAttribute("src"),i.alt=n.getAttribute("alt")||"",i.presentation="presentation"===n.get("role"),i):(this._selectedImage=null,!1)},_getAlignmentPropeties:function(i,n){var a;!s.some(function(e){var t=this._getAlignmentClass(e.value);return i.hasClass(t)?(n.align=e.value,!0):(e.isDefault&&(a=e.value),!1)},this)&&a&&(n.align=a)},_urlChanged:function(){var e=this._form.one("."+c.INPUTURL);""!==e.get("value")&&this._loadPreviewImage(e.get("value"))},_setImage:function(e){var t=this._form,i=t.one("."+c.INPUTURL).get("value"),n=t.one("."+c.INPUTALT).get("value"),a=t.one("."+c.INPUTWIDTH).get("value"),s=t.one("."+c.INPUTHEIGHT).get("value"),o=this._getAlignmentClass(t.one("."+c.INPUTALIGNMENT).get("value")),l=t.one("."+c.IMAGEPRESENTATION).get("checked"),g=t.one("."+c.INPUTCONSTRAIN).get("checked"),d=t.one("."+c.INPUTCUSTOMSTYLE).get("value"),r=[],h=this.get("host");if(e.preventDefault(),!this._updateWarning()){if(h.focus(),""!==i){if(this._selectedImage?h.setSelection(h.getSelectionFromNode(this._selectedImage)):h.setSelection(this._currentSelection),g&&r.push(c.RESPONSIVE),r.push(o),!a.match(u)&&isNaN(parseInt(a,10)))return void t.one("."+c.INPUTWIDTH).focus();if(!s.match(u)&&isNaN(parseInt(s,10)))return void t.one("."+c.INPUTHEIGHT).focus();e=m.Handlebars.compile(I)({url:i,alt:n,width:a,height:s,presentation:l,customstyle:d,classlist:r.join(" ")}),this.get("host").insertContentAtFocusPoint(e),this.markUpdated()}this.getDialogue({focusAfterHide:null}).hide()}},_removeLegacyAlignment:function(i){return i.getStyle("margin")&&s.some(function(e){if(i.getStyle(e.name)!==e.value)return!1;var t=m.Node.create("
      ");return t.setStyle("margin",e.margin),i.getStyle("margin")===t.getStyle("margin")&&(i.addClass(this._getAlignmentClass(e.value)),i.setStyle(e.name,null),i.setStyle("margin",null),!0)},this),i},_getAlignmentClass:function(e){return c.ALIGNSETTINGS+"_"+e},_toggleVisibility:function(e,t){var i=this._form,e=i.all(e);e.setStyle("display",t?"block":"none")},_toggleAriaInvalid:function(e,t){var i=this._form;e.forEach(function(e){i.all(e).setAttribute("aria-invalid",t)})},_hasErrorUrlField:function(){var e=this._form,e=e.one("."+c.INPUTURL).get("value"),e=""===e;return this._toggleVisibility("."+c.IMAGEURLWARNING,e),this._toggleAriaInvalid(["."+c.INPUTURL],e),e},_hasErrorAltField:function(){var e=this._form,t=e.one("."+c.INPUTALT).get("value"),e=e.one("."+c.IMAGEPRESENTATION).get("checked"),t=""===t&&!e;return this._toggleVisibility("."+c.IMAGEALTWARNING,t),this._toggleAriaInvalid(["."+c.INPUTALT,"."+c.IMAGEPRESENTATION],t),t},_updateWarning:function(){var e=this._hasErrorUrlField(),t=this._hasErrorAltField(),e=e||t;return this.getDialogue().centerDialogue(),e},_handleKeyup:function(){var e=this._form,t=e.one("."+c.INPUTALT).get("value").length;e.one("#currentcount").setHTML(t)}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file +'
      {{#if showFilepicker}}
      {{else}}
      {{/if}}
      0 / 125
      x

      '),t=this.get("host").canShowFilepicker("image"),e=m.Node.create(e({elementid:this.get("host").get("elementid"),CSS:c,FORMNAMES:i,component:d,showFilepicker:t,alignments:s}));return this._form=e,this._applyImageProperties(this._form),this._form.one("."+c.INPUTURL).on("blur",this._urlChanged,this),this._form.one("."+c.INPUTURL).on("change",this._hasErrorUrlField,this),this._form.one("."+c.IMAGEPRESENTATION).on("change",this._hasErrorAltField,this),this._form.one("."+c.INPUTALT).on("blur",this._hasErrorAltField,this),this._form.one("."+c.INPUTWIDTH).on("blur",this._autoAdjustSize,this),this._form.one("."+c.INPUTHEIGHT).on("blur",this._autoAdjustSize,this,!0),this._form.one("."+c.INPUTCONSTRAIN).on("change",function(e){e.target.get("checked")&&this._autoAdjustSize(e)},this),this._form.one("."+c.INPUTSUBMIT).on("click",this._setImage,this),t&&this._form.one("."+c.IMAGEBROWSER).on("click",function(){this.get("host").showFilepicker("image",this._filepickerCallback,this)},this),this._form.one("."+c.INPUTALT).on("keyup",this._handleKeyup,this),e},_autoAdjustSize:function(g,e){var t,i,n,d,a,s,o,l,r,h;e=e||!1,t=this._form.one("."+c.INPUTWIDTH),i="width",n=this._form.one("."+c.INPUTHEIGHT),d="height",h=this._form.one("."+c.INPUTCONSTRAIN),a=t.get("value"),s=n.get("value"),o=this._form.one("."+c.IMAGEPREVIEW),this._rawImageDimensions&&(""===a&&(a=this._rawImageDimensions[i],t.set("value",a),a=t.get("value")),o.setStyles({width:null,height:null}),h.get("checked")?(e&&(h=t,t=n,n=h,h=i,i=d,d=h,h=a,a=s,s=h),a.match(u)?(s=a,l=parseInt(a,10),r=this._rawImageDimensions.width/100*l,o.setStyle("width",r),r=this._rawImageDimensions.height/100*l,o.setStyle("height",r)):(s=Math.round(a/this._rawImageDimensions[i]*this._rawImageDimensions[d]),e?o.setStyles({width:s,height:a}):o.setStyles({width:a,height:s})),n.set("value",s)):(a.match(u)?(l=parseInt(a,10),r=this._rawImageDimensions.width/100*l,o.setStyle("width",r+"px")):o.setStyle("width",a+"px"),s.match(u)?(l=parseInt(s,10),r=this._rawImageDimensions.height/100*l,o.setStyle("height",r+"px")):o.setStyle("height",s+"px")))},_filepickerCallback:function(e){""!==e.url&&(this._form.one("."+c.INPUTURL).set("value",e.url),this._form.one("."+c.INPUTWIDTH).set("value",""),this._form.one("."+c.INPUTHEIGHT).set("value",""),this._loadPreviewImage(e.url))},_applyImageProperties:function(t){var e=this._getSelectedImageProperties(),i=t.one("."+c.IMAGEPREVIEW);if(!1===e)return i.setStyle("display","none"),void s.some(function(e){return!!e.isDefault&&(t.one("."+c.INPUTALIGNMENT).set("value", +e.value),!0)},this);e.align&&t.one("."+c.INPUTALIGNMENT).set("value",e.align),e.customstyle&&t.one("."+c.INPUTCUSTOMSTYLE).set("value",e.customstyle),e.width&&t.one("."+c.INPUTWIDTH).set("value",e.width),e.height&&t.one("."+c.INPUTHEIGHT).set("value",e.height),e.alt&&t.one("."+c.INPUTALT).set("value",e.alt),e.src&&(t.one("."+c.INPUTURL).set("value",e.src),this._loadPreviewImage(e.src)),e.presentation&&t.one("."+c.IMAGEPRESENTATION).set("checked","checked"),this._autoAdjustSize()},_getSelectedImageProperties:function(){var e,t,i={src:null,alt:null,width:null,height:null,align:"",presentation:!1},n=this.get("host").getSelectedNodes();return(n=n&&n.filter("img"))&&n.size()?(n=this._removeLegacyAlignment(n.item(0)),t=(this._selectedImage=n).getAttribute("style"),i.customstyle=t,(t=n.getAttribute("width")).match(u)||(t=parseInt(t,10)),(e=n.getAttribute("height")).match(u)||(e=parseInt(e,10)),0!==t&&(i.width=t),0!==e&&(i.height=e),this._getAlignmentPropeties(n,i),i.src=n.getAttribute("src"),i.alt=n.getAttribute("alt")||"",i.presentation="presentation"===n.get("role"),i):(this._selectedImage=null,!1)},_getAlignmentPropeties:function(i,n){var a;!s.some(function(e){var t=this._getAlignmentClass(e.value);return i.hasClass(t)?(n.align=e.value,!0):(e.isDefault&&(a=e.value),!1)},this)&&a&&(n.align=a)},_urlChanged:function(){var e=this._form.one("."+c.INPUTURL);""!==e.get("value")&&this._loadPreviewImage(e.get("value"))},_setImage:function(e){var t=this._form,i=t.one("."+c.INPUTURL).get("value"),n=t.one("."+c.INPUTALT).get("value"),a=t.one("."+c.INPUTWIDTH).get("value"),s=t.one("."+c.INPUTHEIGHT).get("value"),o=this._getAlignmentClass(t.one("."+c.INPUTALIGNMENT).get("value")),l=t.one("."+c.IMAGEPRESENTATION).get("checked"),g=t.one("."+c.INPUTCONSTRAIN).get("checked"),d=t.one("."+c.INPUTCUSTOMSTYLE).get("value"),r=[],h=this.get("host");if(e.preventDefault(),!this._updateWarning()){if(h.focus(),""!==i){if(this._selectedImage?h.setSelection(h.getSelectionFromNode(this._selectedImage)):h.setSelection(this._currentSelection),g&&r.push(c.RESPONSIVE),r.push(o),!a.match(u)&&isNaN(parseInt(a,10)))return void t.one("."+c.INPUTWIDTH).focus();if(!s.match(u)&&isNaN(parseInt(s,10)))return void t.one("."+c.INPUTHEIGHT).focus();e=m.Handlebars.compile(I)({url:i,alt:n,width:a,height:s,presentation:l,customstyle:d,classlist:r.join(" ")}),this.get("host").insertContentAtFocusPoint(e),this.markUpdated()}this.getDialogue({focusAfterHide:null}).hide()}},_removeLegacyAlignment:function(i){return i.getStyle("margin")&&s.some(function(e){if(i.getStyle(e.name)!==e.value)return!1;var t=m.Node.create("
      ");return t.setStyle("margin",e.margin),i.getStyle("margin")===t.getStyle("margin")&&(i.addClass(this._getAlignmentClass(e.value)),i.setStyle(e.name,null),i.setStyle("margin",null),!0)},this),i},_getAlignmentClass:function(e){return c.ALIGNSETTINGS+"_"+e},_toggleVisibility:function(e,t){var i=this._form,e=i.all(e);e.setStyle("display",t?"block":"none")},_toggleAriaInvalid:function(e,t){var i=this._form;e.forEach(function(e){i.all(e).setAttribute("aria-invalid",t)})},_hasErrorUrlField:function(){var e=this._form,e=e.one("."+c.INPUTURL).get("value"),e=""===e;return this._toggleVisibility("."+c.IMAGEURLWARNING,e),this._toggleAriaInvalid(["."+c.INPUTURL],e),e},_hasErrorAltField:function(){var e=this._form,t=e.one("."+c.INPUTALT).get("value"),e=e.one("."+c.IMAGEPRESENTATION).get("checked"),t=""===t&&!e;return this._toggleVisibility("."+c.IMAGEALTWARNING,t),this._toggleAriaInvalid(["."+c.INPUTALT,"."+c.IMAGEPRESENTATION],t),t},_updateWarning:function(){var e=this._hasErrorUrlField(),t=this._hasErrorAltField(),e=e||t;return this.getDialogue().centerDialogue(),e},_handleKeyup:function(){var e=this._form,t=e.one("."+c.INPUTALT).get("value").length;e.one("#currentcount").setHTML(t)}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button.js b/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button.js index f263e0d19f8..3b744fe905b 100644 --- a/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button.js +++ b/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button.js @@ -116,10 +116,8 @@ var CSS = { '
      ' + '' + - '' + - '' + - '' + + '' + '
      ' + '
      ' + '{{else}}' + @@ -183,7 +181,7 @@ var CSS = { // Add the alignment selector. '
      ' + '' + - '' + '{{#each alignments}}' + '' + '{{/each}}' + diff --git a/lib/editor/atto/plugins/image/yui/src/button/js/button.js b/lib/editor/atto/plugins/image/yui/src/button/js/button.js index 74fc8867e79..e01836b7941 100644 --- a/lib/editor/atto/plugins/image/yui/src/button/js/button.js +++ b/lib/editor/atto/plugins/image/yui/src/button/js/button.js @@ -114,10 +114,8 @@ var CSS = { '
      ' + '' + - '' + - '' + - '' + + '' + '
      ' + '
      ' + '{{else}}' + @@ -181,7 +179,7 @@ var CSS = { // Add the alignment selector. '
      ' + '' + - '' + '{{#each alignments}}' + '' + '{{/each}}' + diff --git a/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button-debug.js b/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button-debug.js index 01f090d8274..585e1557620 100644 --- a/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button-debug.js +++ b/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button-debug.js @@ -58,10 +58,8 @@ var COMPONENTNAME = 'atto_link', '
      ' + '' + - '' + - '' + - '' + + '' + '
      ' + '{{else}}' + '
      ' + diff --git a/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button-min.js b/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button-min.js index de67dbcb6aa..489a735970b 100644 --- a/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button-min.js +++ b/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button-min.js @@ -1,2 +1,2 @@ -YUI.add("moodle-atto_link-button",function(u,t){var n="atto_link",i={NEWWINDOW:"atto_link_openinnewwindow",URLINPUT:"atto_link_urlentry",URLTEXT:"atto_link_urltext"},h=".atto_link_openinnewwindow",o=".atto_link_urlentry",d=".atto_link_urltext",l=".submit",s=".openlinkbrowser";u.namespace("M.atto_link").Button=u.Base.create("button",u.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_content:null,_hasTextToDisplay:!1,_hasPlainTextSelected:!1,initializer:function(){this.addButton({icon:"e/insert_edit_link",keys:"75",callback:this._displayDialogue,tags:"a",tagMatchRequiresAll:!1}),this.addButton({buttonName:"unlink",callback:this._unlink,icon:"e/remove_link",title:"unlink",tags:"a",tagMatchRequiresAll:!1})},_displayDialogue:function(){var t;this._currentSelection=this.get("host").getSelection(),!1!==this._currentSelection&&((t=this.getDialogue({headerContent:M.util.get_string("createlink",n),width:"auto",focusAfterHide:!0,focusOnShowSelector:o})).set("bodyContent",this._getDialogueContent()),this._resolveAnchors(),t.show())},_resolveAnchors:function(){var t,e,n,i=this.get("host").getSelectionParentNode();i&&(0<(i=this._findSelectedAnchors(u.one(i))).length?(i=i[0],this._currentSelection=this.get("host").getSelectionFromNode(i),t=i.getAttribute("href"),e=i.getAttribute("target"),n=i.get("innerText"),i=i.getAttribute("title"),""!==t&&this._content.one(o).setAttribute("value",t),""!==n?this._content.one(d).set("value",n):""!==i&&this._content.one(d).set("value",i),"_blank"===e?this._content.one(h).setAttribute("checked","checked"):this._content.one(h).removeAttribute("checked")):""!==(n=this._getTextSelection())?(this._hasTextToDisplay=!0,this._hasPlainTextSelected=!0,this._content.one(d).set("value",n)):(this._hasTextToDisplay=!1,this._hasPlainTextSelected=!1))},_filepickerCallback:function(t){this.getDialogue().set("focusAfterHide",null).hide(),""!==t.url&&(this._setLinkOnSelection(t.url),this.markUpdated())},_setLink:function(t){t.preventDefault(),this.getDialogue({focusAfterHide:null}).hide(),""!==(t=this._content.one(o).get("value"))&&(t=t.trim(),new RegExp(/^[a-zA-Z]*\.*\/|^#|^[a-zA-Z]*:/).test(t)||(t="http://"+t),this._setLinkOnSelection(t),this.markUpdated())},_setLinkOnSelection:function(t){var e,n,i,o,l,s,a,c,r=this.get("host");if(this.editor.focus(),r.setSelection(this._currentSelection),n=!this._currentSelection[0].collapsed,i=this._content.one(d),""===(o=i.get("value").replace(/(<([^>]+)>)/gi,"").trim())&&(o=t),n){if(0"+o+"")).setAttribute("href",t),e=r.insertContentAtFocusPoint(i.get("outerHTML")),r.setSelection(r.getSelectionFromNode(e));if(e)return t=this._findSelectedAnchors(u.one(e)),u.Array.each(t,function(t){this._content.one(h).get("checked")?t.setAttribute("target","_blank"):t.removeAttribute("target"),n&&o&&(this._hasPlainTextSelected?t.set("innerText",o):t.setAttribute("title",o))},this),e},_findSelectedAnchors:function(t){var e,n,i=t.get("tagName");return i&&"a"===i.toLowerCase()?[t]:(n=[],t.all("a").each(function(t){!e&&this.get("host").selectionContainsNode(t)&&n.push(t)},this),0
      {{#if showFilepicker}}
      {{else}}
      {{/if}}

      ');return this._content=u.Node.create(e({showFilepicker:t,component:n,CSS:i})),this._content.one(o).on("keyup",this._updateTextToDisplay,this),this._content.one(o).on("change",this._updateTextToDisplay,this),this._content.one(d).on("keyup",this._setTextToDisplayState,this),this._content.one(l).on("click",this._setLink,this),t&&this._content.one(s).on("click",function(t){t.preventDefault(),this.get("host").showFilepicker("link",this._filepickerCallback,this)},this),this._content},_unlink:function(){var e=this.get("host"),t=e.getSelection();t&&t.length&&(t[0].startOffset===t[0].endOffset?(t=e.getSelectedNodes())&&(t.each(function(t){t=t.ancestor("a",!0);t&&(e.setSelection(e.getSelectionFromNode(t)),document.execCommand("unlink",!1,null))},this),this.markUpdated()):(document.execCommand("unlink",!1,null),this.markUpdated()))},_setTextToDisplayState:function(){var t=this._content.one(d).get("value"); -this._hasTextToDisplay=""!==t},_updateTextToDisplay:function(){var t=this._content.one(o),e=this._content.one(d),t=t.get("value");this._hasTextToDisplay||e.set("value",t)},_getTextSelection:function(){var t,e,n="",i=window.getSelection(),o=i.rangeCount;if(o){for(t=[],e=0;e]+)>)/gi,"").trim())&&(o=t),n){if(0"+o+"")).setAttribute("href",t),e=r.insertContentAtFocusPoint(i.get("outerHTML")),r.setSelection(r.getSelectionFromNode(e));if(e)return t=this._findSelectedAnchors(u.one(e)),u.Array.each(t,function(t){this._content.one(h).get("checked")?t.setAttribute("target","_blank"):t.removeAttribute("target"),n&&o&&(this._hasPlainTextSelected?t.set("innerText",o):t.setAttribute("title",o))},this),e},_findSelectedAnchors:function(t){var e,n,i=t.get("tagName");return i&&"a"===i.toLowerCase()?[t]:(n=[],t.all("a").each(function(t){!e&&this.get("host").selectionContainsNode(t)&&n.push(t)},this),0
      {{#if showFilepicker}}
      {{else}}
      {{/if}}

      ');return this._content=u.Node.create(e({showFilepicker:t,component:n,CSS:i})),this._content.one(o).on("keyup",this._updateTextToDisplay,this),this._content.one(o).on("change",this._updateTextToDisplay,this),this._content.one(d).on("keyup",this._setTextToDisplayState,this),this._content.one(l).on("click",this._setLink,this),t&&this._content.one(s).on("click",function(t){t.preventDefault(),this.get("host").showFilepicker("link",this._filepickerCallback,this)},this),this._content},_unlink:function(){var e=this.get("host"),t=e.getSelection();t&&t.length&&(t[0].startOffset===t[0].endOffset?(t=e.getSelectedNodes())&&(t.each(function(t){t=t.ancestor("a",!0);t&&(e.setSelection(e.getSelectionFromNode(t)),document.execCommand("unlink",!1,null))},this),this.markUpdated()):(document.execCommand("unlink",!1,null),this.markUpdated()))},_setTextToDisplayState:function(){var t=this._content.one(d).get("value");this._hasTextToDisplay=""!==t}, +_updateTextToDisplay:function(){var t=this._content.one(o),e=this._content.one(d),t=t.get("value");this._hasTextToDisplay||e.set("value",t)},_getTextSelection:function(){var t,e,n="",i=window.getSelection(),o=i.rangeCount;if(o){for(t=[],e=0;e' + '' + - '' + - '' + - '' + + '' + '
      ' + '{{else}}' + '
      ' + diff --git a/lib/editor/atto/plugins/link/yui/src/button/js/button.js b/lib/editor/atto/plugins/link/yui/src/button/js/button.js index d44c7983745..4096c1bd728 100644 --- a/lib/editor/atto/plugins/link/yui/src/button/js/button.js +++ b/lib/editor/atto/plugins/link/yui/src/button/js/button.js @@ -56,10 +56,8 @@ var COMPONENTNAME = 'atto_link', '
      ' + '' + - '' + - '' + - '' + + '' + '
      ' + '{{else}}' + '
      ' + diff --git a/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-debug.js b/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-debug.js index 3d38e12f5e1..57af4cf3e72 100644 --- a/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-debug.js +++ b/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-debug.js @@ -216,10 +216,8 @@ var COMPONENTNAME = 'atto_media', '' + '
      ' + '' + - '' + - '' + - '' + + '' + '
      ' + '
      ' + '{{#multisource}}' + @@ -363,7 +361,7 @@ var COMPONENTNAME = 'atto_media', '{{renderPartial "form_components.source" context=this id=CSS.TRACK_SOURCE entersourcelabel=sourcelabel}}' + '
      ' + '' + - '' + '' + '{{#langsinstalled}}' + '' + diff --git a/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-min.js b/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-min.js index 95e37677b5d..5be2c934569 100644 --- a/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-min.js +++ b/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-min.js @@ -1,5 +1,5 @@ YUI.add("moodle-atto_media-button",function(l,e){var t="atto_media",i={LINK:"LINK",VIDEO:"VIDEO",AUDIO:"AUDIO"},a={SUBTITLES:"SUBTITLES",CAPTIONS:"CAPTIONS",DESCRIPTIONS:"DESCRIPTIONS",CHAPTERS:"CHAPTERS",METADATA:"METADATA"},o={SOURCE:"atto_media_source",TRACK:"atto_media_track",MEDIA_SOURCE:"atto_media_media_source",LINK_SOURCE:"atto_media_link_source",POSTER_SOURCE:"atto_media_poster_source",TRACK_SOURCE:"atto_media_track_source",DISPLAY_OPTIONS:"atto_media_display_options",NAME_INPUT:"atto_media_name_entry",TITLE_INPUT:"atto_media_title_entry",URL_INPUT:"atto_media_url_entry",POSTER_SIZE:"atto_media_poster_size",LINK_SIZE:"atto_media_link_size",WIDTH_INPUT:"atto_media_width_entry",HEIGHT_INPUT:"atto_media_height_entry",TRACK_KIND_INPUT:"atto_media_track_kind_entry",TRACK_LABEL_INPUT:"atto_media_track_label_entry",TRACK_LANG_INPUT:"atto_media_track_lang_entry",TRACK_DEFAULT_SELECT:"atto_media_track_default",MEDIA_CONTROLS_TOGGLE:"atto_media_controls",MEDIA_AUTOPLAY_TOGGLE:"atto_media_autoplay",MEDIA_MUTE_TOGGLE:"atto_media_mute",MEDIA_LOOP_TOGGLE:"atto_media_loop",ADVANCED_SETTINGS:"atto_media_advancedsettings",LINK:i.LINK.toLowerCase(),VIDEO:i.VIDEO.toLowerCase(),AUDIO:i.AUDIO.toLowerCase(),TRACK_SUBTITLES:a.SUBTITLES.toLowerCase(),TRACK_CAPTIONS:a.CAPTIONS.toLowerCase(),TRACK_DESCRIPTIONS:a.DESCRIPTIONS.toLowerCase(),TRACK_CHAPTERS:a.CHAPTERS.toLowerCase(),TRACK_METADATA:a.METADATA.toLowerCase()},s={SOURCE:"."+o.SOURCE,TRACK:"."+o.TRACK,MEDIA_SOURCE:"."+o.MEDIA_SOURCE,POSTER_SOURCE:"."+o.POSTER_SOURCE,TRACK_SOURCE:"."+o.TRACK_SOURCE,DISPLAY_OPTIONS:"."+o.DISPLAY_OPTIONS,NAME_INPUT:"."+o.NAME_INPUT,TITLE_INPUT:"."+o.TITLE_INPUT,URL_INPUT:"."+o.URL_INPUT,POSTER_SIZE:"."+o.POSTER_SIZE,LINK_SIZE:"."+o.LINK_SIZE,WIDTH_INPUT:"."+o.WIDTH_INPUT,HEIGHT_INPUT:"."+o.HEIGHT_INPUT,TRACK_KIND_INPUT:"."+o.TRACK_KIND_INPUT,TRACK_LABEL_INPUT:"."+o.TRACK_LABEL_INPUT,TRACK_LANG_INPUT:"."+o.TRACK_LANG_INPUT,TRACK_DEFAULT_SELECT:"."+o.TRACK_DEFAULT_SELECT,MEDIA_CONTROLS_TOGGLE:"."+o.MEDIA_CONTROLS_TOGGLE,MEDIA_AUTOPLAY_TOGGLE:"."+o.MEDIA_AUTOPLAY_TOGGLE,MEDIA_MUTE_TOGGLE:"."+o.MEDIA_MUTE_TOGGLE,MEDIA_LOOP_TOGGLE:"."+o.MEDIA_LOOP_TOGGLE,ADVANCED_SETTINGS:"."+o.ADVANCED_SETTINGS,LINK_TAB:'li[data-medium-type="'+o.LINK+'"]',LINK_PANE:'.tab-pane[data-medium-type="'+o.LINK+'"]',VIDEO_TAB:'li[data-medium-type="'+o.VIDEO+'"]',VIDEO_PANE:'.tab-pane[data-medium-type="'+o.VIDEO+'"]',AUDIO_TAB:'li[data-medium-type="'+o.AUDIO+'"]',AUDIO_PANE:'.tab-pane[data-medium-type="'+o.AUDIO+'"]',TRACK_SUBTITLES_TAB:'li[data-track-kind="'+o.TRACK_SUBTITLES+'"]',TRACK_SUBTITLES_PANE:'.tab-pane[data-track-kind="'+o.TRACK_SUBTITLES+'"]',TRACK_CAPTIONS_TAB:'li[data-track-kind="'+o.TRACK_CAPTIONS+'"]',TRACK_CAPTIONS_PANE:'.tab-pane[data-track-kind="'+o.TRACK_CAPTIONS+'"]',TRACK_DESCRIPTIONS_TAB:'li[data-track-kind="'+o.TRACK_DESCRIPTIONS+'"]',TRACK_DESCRIPTIONS_PANE:'.tab-pane[data-track-kind="'+o.TRACK_DESCRIPTIONS+'"]',TRACK_CHAPTERS_TAB:'li[data-track-kind="'+o.TRACK_CHAPTERS+'"]',TRACK_CHAPTERS_PANE:'.tab-pane[data-track-kind="'+o.TRACK_CHAPTERS+'"]',TRACK_METADATA_TAB:'li[data-track-kind="'+o.TRACK_METADATA+'"]',TRACK_METADATA_PANE:'.tab-pane[data-track-kind="'+o.TRACK_METADATA+'"]'},d={ROOT:'
      {{> tab_panes.link}}
      {{> tab_panes.video}}
      {{> tab_panes.audio}}

      ',TAB_PANES:{LINK:'{{renderPartial "form_components.source" context=this id=CSS.LINK_SOURCE}}', -VIDEO:'{{renderPartial "form_components.source" context=this id=CSS.MEDIA_SOURCE entersourcelabel="videosourcelabel" addcomponentlabel="addsource" multisource="true" addsourcehelp=helpStrings.addsource}}',AUDIO:'{{renderPartial "form_components.source" context=this id=CSS.MEDIA_SOURCE entersourcelabel="audiosourcelabel" addcomponentlabel="addsource" multisource="true" addsourcehelp=helpStrings.addsource}}'},FORM_COMPONENTS:{SOURCE:'
      {{#multisource}}{{renderPartial "form_components.add_component" context=../this label=../addcomponentlabel help=../addsourcehelp}}{{/multisource}}
      ',ADD_COMPONENT:'',REMOVE_COMPONENT:'',DISPLAY_OPTIONS:'
      {{#mediatype_video}}
      x
      {{renderPartial "form_components.source" context=this id=CSS.POSTER_SOURCE entersourcelabel="poster"}}{{/mediatype_video}}
      ', -ADVANCED_SETTINGS:'
      ',TRACK_TABS:'
      {{{helpStrings.subtitles}}}
      {{renderPartial "form_components.track" context=this sourcelabel="subtitlessourcelabel" addcomponentlabel="addsubtitlestrack"}}
      {{{helpStrings.captions}}}
      {{renderPartial "form_components.track" context=this sourcelabel="captionssourcelabel" addcomponentlabel="addcaptionstrack"}}
      {{{helpStrings.descriptions}}}
      {{renderPartial "form_components.track" context=this sourcelabel="descriptionssourcelabel" addcomponentlabel="adddescriptionstrack"}}
      {{{helpStrings.chapters}}}
      {{renderPartial "form_components.track" context=this sourcelabel="chapterssourcelabel" addcomponentlabel="addchapterstrack"}}
      {{{helpStrings.metadata}}}
      {{renderPartial "form_components.track" context=this sourcelabel="metadatasourcelabel" addcomponentlabel="addmetadatatrack"}}
      ',TRACK:'
      {{renderPartial "form_components.source" context=this id=CSS.TRACK_SOURCE entersourcelabel=sourcelabel}}
      {{renderPartial "form_components.add_component" context=this label=addcomponentlabel}}
      ',SECTION:'
      {{#help}}{{{../help}}}{{/help}}
      '},HTML_MEDIA:{ +VIDEO:'{{renderPartial "form_components.source" context=this id=CSS.MEDIA_SOURCE entersourcelabel="videosourcelabel" addcomponentlabel="addsource" multisource="true" addsourcehelp=helpStrings.addsource}}',AUDIO:'{{renderPartial "form_components.source" context=this id=CSS.MEDIA_SOURCE entersourcelabel="audiosourcelabel" addcomponentlabel="addsource" multisource="true" addsourcehelp=helpStrings.addsource}}'},FORM_COMPONENTS:{SOURCE:'
      {{#multisource}}{{renderPartial "form_components.add_component" context=../this label=../addcomponentlabel help=../addsourcehelp}}{{/multisource}}
      ',ADD_COMPONENT:'',REMOVE_COMPONENT:'',DISPLAY_OPTIONS:'
      {{#mediatype_video}}
      x
      {{renderPartial "form_components.source" context=this id=CSS.POSTER_SOURCE entersourcelabel="poster"}}{{/mediatype_video}}
      ', +ADVANCED_SETTINGS:'
      ',TRACK_TABS:'
      {{{helpStrings.subtitles}}}
      {{renderPartial "form_components.track" context=this sourcelabel="subtitlessourcelabel" addcomponentlabel="addsubtitlestrack"}}
      {{{helpStrings.captions}}}
      {{renderPartial "form_components.track" context=this sourcelabel="captionssourcelabel" addcomponentlabel="addcaptionstrack"}}
      {{{helpStrings.descriptions}}}
      {{renderPartial "form_components.track" context=this sourcelabel="descriptionssourcelabel" addcomponentlabel="adddescriptionstrack"}}
      {{{helpStrings.chapters}}}
      {{renderPartial "form_components.track" context=this sourcelabel="chapterssourcelabel" addcomponentlabel="addchapterstrack"}}
      {{{helpStrings.metadata}}}
      {{renderPartial "form_components.track" context=this sourcelabel="metadatasourcelabel" addcomponentlabel="addmetadatatrack"}}
      ',TRACK:'
      {{renderPartial "form_components.source" context=this id=CSS.TRACK_SOURCE entersourcelabel=sourcelabel}}
      {{renderPartial "form_components.add_component" context=this label=addcomponentlabel}}
      ',SECTION:'
      {{#help}}{{{../help}}}{{/help}}
      '},HTML_MEDIA:{ VIDEO:'  ',AUDIO:'  ',LINK:'{{#name}}{{../name}}{{/name}}{{^name}}{{../url}}{{/name}}'}};l.namespace("M.atto_media").Button=l.Base.create("button",l.M.editor_atto.EditorPlugin,[],{initializer:function(){var e;this.get("host").canShowFilepicker("media")&&(this.editor.delegate("dblclick",this._displayDialogue,"video",this),this.editor.delegate("click",this._handleClick,"video",this),this._attachPlayPauseEvents(),e=this._attachPlayPauseEvents.bind(this),this.get("host").on("change",e,null),this.addButton({icon:"e/insert_edit_video",callback:this._displayDialogue,tags:"video, audio",tagMatchRequiresAll:!1}))},_attachPlayPauseEvents:function(){this._handlePlayEndBound===undefined&&(this._handlePlayEndBound=this._handlePlayEnd.bind(this)),this.editor.getDOMNode().querySelectorAll("video").forEach(function(e){e.removeEventListener("play",this._handlePlayEndBound),e.removeEventListener("pause",this._handlePlayEndBound),e.addEventListener("play",this._handlePlayEndBound),e.addEventListener("pause",this._handlePlayEndBound)}.bind(this))},_getContext:function(e){return l.merge({elementid:this.get("host").get("elementid"),component:t,langsinstalled:this.get("langs").installed,langsavailable:this.get("langs").available,helpStrings:this.get("help"),CSS:o},e)},_handleClick:function(e){e=e.target,e=this.get("host").getSelectionFromNode(e);this.get("host").getSelection()!==e&&this.get("host").setSelection(e)},_handlePlayEnd:function(e){var t=l.one(e.target),t=this.get("host").getSelectionFromNode(t);this.get("host").getSelection()!==t&&(this.get("host").setSelection(t),this.get("host")._hasSelectionChanged(e))},_displayDialogue:function(){!1!==this.get("host").getSelection()&&("renderPartial"in l.Handlebars.helpers||(function i(a,e){l.each(e,function(e,t){a.push(t),"object"!=typeof e?l.Handlebars.registerPartial(a.join(".").toLowerCase(),e):i(a,e),a.pop()})}([],d),l.Handlebars.registerHelper("renderPartial",function(e,t){var a;return e?(e=l.Handlebars.partials[e],a=t.hash.context?l.clone(t.hash.context):{},delete(a=l.merge(a,t.hash)).context,e?new l.Handlebars.SafeString(l.Handlebars.compile(e)(a)):""):""})),this.getDialogue({headerContent:M.util.get_string("createmedia",t),focusAfterHide:!0,width:660,focusOnShowSelector:s.URL_INPUT}).set("bodyContent",this._getDialogueContent(this.get("host").getSelection())).show(),M.form.shortforms({formid:this.get("host").get("elementid")+"_atto_media_form"}))},_getDialogueContent:function(e){var t=l.Node.create(l.Handlebars.compile(d.ROOT)(this._getContext())),a=this.get("host").getSelectedNodes().filter("video,audio").shift(),a=!!a&&this._getMediumProperties(a);return this._attachEvents(this._applyMediumProperties(t,a),e)},_attachEvents:function(e,a){return e.delegate("click",function(e){e.preventDefault(),this._addMediaSourceComponent(e.currentTarget)},s.MEDIA_SOURCE+" .addcomponent",this),e.delegate("click",function(e){e.preventDefault(),this._addTrackComponent(e.currentTarget)},s.TRACK+" .addcomponent",this),e.delegate("click",function(e){var t,a=e.currentTarget;a.get("checked")&&(t=function(e){return this._getTrackTypeFromTabPane(e.ancestor(".tab-pane"))}.bind(this),a.ancestor(".root.tab-content").all(s.TRACK_DEFAULT_SELECT).each(function(e){e!==a&&t(a)===t(e)&&e.set("checked",!1)}))},s.TRACK_DEFAULT_SELECT,this),e.delegate("click",function(e){var t=e.currentTarget,a=(t.ancestor(s.POSTER_SOURCE)?"image":t.ancestor(s.TRACK_SOURCE)&&"subtitle")||"media";e.preventDefault(),this.get("host").showFilepicker(a,this._getFilepickerCallback(t,a),this)},".openmediabrowser",this),e.all(".nav-item").on("click",function(e){e.currentTarget.get("parentNode").all(".active").removeClass("active")}),e.one(".submit").on("click",function(e){e.preventDefault();var e=this._getMediaHTML(e.currentTarget.ancestor(".atto_form")),t=this.get("host");this.getDialogue({focusAfterHide:null}).hide(),e&&(t.setSelection(a),t.insertContentAtFocusPoint(e),this.markUpdated())},this),e},_applyMediumProperties:function(e,t){var i,n,a;return t&&(i=function(e,t){e.one(s.TRACK_SOURCE+" "+s.URL_INPUT).set("value",t.src),e.one(s.TRACK_LANG_INPUT).set("value",t.srclang),e.one(s.TRACK_LABEL_INPUT).set("value",t.label),e.one(s.TRACK_DEFAULT_SELECT).set("checked",t.defaultTrack)},(n=e.one(".root.tab-content > .tab-pane#"+this.get("host").get("elementid")+"_"+t.type.toLowerCase())).one(s.MEDIA_SOURCE+" "+s.URL_INPUT).set("value",t.sources[0]),l.Array.each(t.sources.slice(1),function(t){this._addMediaSourceComponent(n.one(s.MEDIA_SOURCE+" .addcomponent"),function(e){e.one(s.URL_INPUT).set("value",t)})},this),l.Object.each(t.tracks,function(e,t){var e=e.length?e:[{src:"",srclang:"",label:"",defaultTrack:!1}],a=s["TRACK_"+t.toUpperCase()+"_PANE"];i(n.one(a+" "+s.TRACK),e[0]),l.Array.each(e.slice(1),function(t){this._addTrackComponent(n.one( a+" "+s.TRACK+" .addcomponent"),function(e){i(e,t)})},this)},this),n.one(s.TITLE_INPUT).set("value",t.title),n.one(s.MEDIA_CONTROLS_TOGGLE).set("checked",t.controls),n.one(s.MEDIA_AUTOPLAY_TOGGLE).set("checked",t.autoplay),n.one(s.MEDIA_MUTE_TOGGLE).set("checked",t.muted),n.one(s.MEDIA_LOOP_TOGGLE).set("checked",t.loop),"video"===(a=this._getMediumTypeFromTabPane(n))&&(n.one(s.POSTER_SOURCE+" "+s.URL_INPUT).setAttribute("value",t.poster),n.one(s.WIDTH_INPUT).set("value",t.width),n.one(s.HEIGHT_INPUT).set("value",t.height)),n.siblings(".active").removeClass("active"),e.all(".root.nav-tabs .nav-item a").removeClass("active"),n.addClass("active"),e.one(s[a.toUpperCase()+"_TAB"]+" a").addClass("active")),e},_getMediumProperties:function(e){var t=function(e,t){return e.hasAttribute(t)&&(e.getAttribute(t)||""===e.getAttribute(t))},a={subtitles:[],captions:[],descriptions:[],chapters:[],metadata:[]};return e.all("track").each(function(e){a[e.getAttribute("kind")].push({src:e.getAttribute("src"),srclang:e.getAttribute("srclang"),label:e.getAttribute("label"),defaultTrack:t(e,"default")})}),{type:e.test("video")?i.VIDEO:i.AUDIO,sources:e.all("source").get("src"),poster:e.getAttribute("poster"),title:e.getAttribute("title"),width:e.getAttribute("width"),height:e.getAttribute("height"),autoplay:t(e,"autoplay"),loop:t(e,"loop"),muted:t(e,"muted"),controls:t(e,"controls"),tracks:a}},_addTrackComponent:function(e,t){var a=this._getTrackTypeFromTabPane(e.ancestor(".tab-pane")),a=this._getContext({sourcelabel:a+"sourcelabel",addcomponentlabel:"add"+a+"track"});this._addComponent(e,d.FORM_COMPONENTS.TRACK,s.TRACK,a,t)},_addMediaSourceComponent:function(e,t){var a=this._getMediumTypeFromTabPane(e.ancestor(".tab-pane")),a=this._getContext({multisource:!0,id:o.MEDIA_SOURCE,entersourcelabel:a+"sourcelabel",addcomponentlabel:"addsource",addsourcehelp:this.get("help").addsource});this._addComponent(e,d.FORM_COMPONENTS.SOURCE,s.MEDIA_SOURCE,a,t)},_addComponent:function(e,t,a,i,n){var o=e.ancestor(a),a=l.Node.create(l.Handlebars.compile(t)(i)),t=this._getContext(i);t.label="remove",(i=l.Node.create(l.Handlebars.compile(d.FORM_COMPONENTS.REMOVE_COMPONENT)(t))).one(".removecomponent").on("click",function(e){e.preventDefault(),o.remove(!0)}),o.insert(a,"after"),e.ancestor().insert(i,"after"),e.ancestor().remove(!0),n&&n.call(this,a)},_getFilepickerCallback:function(i,n){return function(e){var a,t;""!==e.url&&(t=i.ancestor(".tab-pane"),i.ancestor(s.SOURCE).one(s.URL_INPUT).set("value",e.url),t.get("id")===this.get("host").get("elementid")+"_"+o.LINK&&t.one(s.NAME_INPUT).set("value",e.file),"subtitle"===n&&(a=e.file.split(".vtt")[0].split("-").slice(-1)[0],(t=this.get("langs").available.reduce(function(e,t){return t.code===a?t:e},!1))&&(i.ancestor(s.TRACK).one(s.TRACK_LABEL_INPUT).set("value",t.lang.substr(0,t.lang.lastIndexOf(" "))),i.ancestor(s.TRACK).one(s.TRACK_LANG_INPUT).set("value",t.code))))}},_getMediumTypeFromTabPane:function(e){return e.getAttribute("data-medium-type")},_getTrackTypeFromTabPane:function(e){return e.getAttribute("data-track-kind")},_getMediaHTML:function(e){var t=this._getMediumTypeFromTabPane(e.one(".root.tab-content > .tab-pane.active")),e=e.one(s[t.toUpperCase()+"_PANE"]);return this["_getMediaHTML"+t[0].toUpperCase()+t.substr(1)](e)},_getMediaHTMLLink:function(e){e={url:e.one(s.URL_INPUT).get("value"),name:e.one(s.NAME_INPUT).get("value")||!1};return e.url?l.Handlebars.compile(d.HTML_MEDIA.LINK)(e):""},_getMediaHTMLVideo:function(e){var t=this._getContextForMediaHTML(e);return t.width=e.one(s.WIDTH_INPUT).get("value")||!1,t.height=e.one(s.HEIGHT_INPUT).get("value")||!1,t.poster=e.one(s.POSTER_SOURCE+" "+s.URL_INPUT).get("value")||!1,t.sources.length?l.Handlebars.compile(d.HTML_MEDIA.VIDEO)(t):""},_getMediaHTMLAudio:function(e){e=this._getContextForMediaHTML(e);return e.sources.length?l.Handlebars.compile(d.HTML_MEDIA.AUDIO)(e):""},_getContextForMediaHTML:function(e){var t=[];return e.all(s.TRACK).each(function(e){t.push({track:e.one(s.TRACK_SOURCE+" "+s.URL_INPUT).get("value"),kind:this._getTrackTypeFromTabPane(e.ancestor(".tab-pane")),label:e.one(s.TRACK_LABEL_INPUT).get("value")||e.one(s.TRACK_LANG_INPUT).get("value"),srclang:e.one(s.TRACK_LANG_INPUT).get("value"),defaultTrack:e.one(s.TRACK_DEFAULT_SELECT).get("checked")?"true":null})},this),{sources:e.all(s.MEDIA_SOURCE+" "+s.URL_INPUT).get("value").filter(function(e){return!!e}).map(function(e){return{source:e}}),description:e.one(s.MEDIA_SOURCE+" "+s.URL_INPUT).get("value")||!1,tracks:t.filter(function(e){return!!e.track}),showControls:e.one(s.MEDIA_CONTROLS_TOGGLE).get("checked"),autoplay:e.one(s.MEDIA_AUTOPLAY_TOGGLE).get("checked"),muted:e.one(s.MEDIA_MUTE_TOGGLE).get("checked"),loop:e.one(s.MEDIA_LOOP_TOGGLE).get("checked"),title:e.one(s.TITLE_INPUT).get("value")||!1}}},{ATTRS:{langs:{},help:{}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","moodle-form-shortforms"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button.js b/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button.js index 3d38e12f5e1..57af4cf3e72 100644 --- a/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button.js +++ b/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button.js @@ -216,10 +216,8 @@ var COMPONENTNAME = 'atto_media', '' + '
      ' + '' + - '' + - '' + - '' + + '' + '
      ' + '
      ' + '{{#multisource}}' + @@ -363,7 +361,7 @@ var COMPONENTNAME = 'atto_media', '{{renderPartial "form_components.source" context=this id=CSS.TRACK_SOURCE entersourcelabel=sourcelabel}}' + '
      ' + '' + - '' + '' + '{{#langsinstalled}}' + '' + diff --git a/lib/editor/atto/plugins/media/yui/src/button/js/button.js b/lib/editor/atto/plugins/media/yui/src/button/js/button.js index 4cdf36e3b13..1d7efa22e15 100644 --- a/lib/editor/atto/plugins/media/yui/src/button/js/button.js +++ b/lib/editor/atto/plugins/media/yui/src/button/js/button.js @@ -214,10 +214,8 @@ var COMPONENTNAME = 'atto_media', '' + '
      ' + '' + - '' + - '' + - '' + + '' + '
      ' + '
      ' + '{{#multisource}}' + @@ -361,7 +359,7 @@ var COMPONENTNAME = 'atto_media', '{{renderPartial "form_components.source" context=this id=CSS.TRACK_SOURCE entersourcelabel=sourcelabel}}' + '
      ' + '' + - '' + '' + '{{#langsinstalled}}' + '' + diff --git a/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-debug.js b/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-debug.js index 9e297c397cd..42217618ec9 100644 --- a/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-debug.js +++ b/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-debug.js @@ -55,7 +55,7 @@ var COMPONENT = 'atto_table', '' + '
      ' + - '' + '' + '' + '' + @@ -66,7 +66,7 @@ var COMPONENT = 'atto_table', '
      ' + '' + '
      ' + - '' + '' + '' + '' + @@ -101,7 +101,7 @@ var COMPONENT = 'atto_table', '
      ' + '' + '
      ' + - '' + '' + '' + '' + @@ -113,7 +113,7 @@ var COMPONENT = 'atto_table', '' + '
      ' + - '
      {{#if nonedit}}
      {{/if}}{{#if allowStyling}}
      {{get_string "appearance" component}}{{#if allowBorders}}
      {{#each availableColours}}
      {{/each}}
      {{/if}}{{#if allowBackgroundColour}}
      {{#each availableColours}}
      {{/each}}
      {{/if}}{{#if allowWidth}}
      {{/if}}
      {{/if}}

      {{#if edit}}{{/if}}{{#if nonedit}}{{/if}}
      ' +'
      {{#if nonedit}}
      {{/if}}{{#if allowStyling}}
      {{get_string "appearance" component}}{{#if allowBorders}}
      {{#each availableColours}}
      {{/each}}
      {{/if}}{{#if allowBackgroundColour}}
      {{#each availableColours}}
      {{/each}}
      {{/if}}{{#if allowWidth}}
      {{/if}}
      {{/if}}

      {{#if edit}}{{/if}}{{#if nonedit}}{{/if}}
      ' ),o=this.get("allowBorders");return this._content=v.Node.create(t({CSS:l,elementid:this.get("host").get("elementid"),component:m,edit:e,nonedit:!e,allowStyling:this.get("allowStyling"),allowBorders:o,borderStyles:this.get("borderStyles"),allowBackgroundColour:this.get("allowBackgroundColour"),availableColours:this.get("availableColors"),allowWidth:this.get("allowWidth")})),e?this._content.one(".submit").on("click",this._updateTable,this):this._content.one(".submit").on("click",this._setTable,this),o&&this._content.one('[name="borders"]').on("change",this._updateAvailableSettings,this),this._content},_updateAvailableSettings:function(){var e=this._content,t=e.one('[name="borders"]'),o=e.one('[name="borderstyles"]'),a=e.one('[name="bordersize"]'),e=e.all('[name="borderColour"]'),n="removeAttribute";t&&("default"===t.get("value")&&(n="setAttribute"),o&&o[n]("disabled"),a&&a[n]("disabled"),e&&e[n]("disabled"))},_getSuitableTableCell:function(){var e,o=null,t=this.get("host"),a=v.bind(this._stopAtContentEditableFilter,this);return t.getSelectedNodes().some(function(e){var t;if(e.ancestor("td, th, caption",!0,a))return(e=(o=e).ancestor("caption",!0,a))&&(t=e.get("parentNode"))&&(o=t.one("td, th")),!0}),o&&(e=t.getSelectionFromNode(o),t.setSelection(e)),o},_changeNodeType:function(e,t){var o=v.Node.create("<"+t+">");return o.setAttrs(e.getAttrs()),e.get("childNodes").each(function(e){o.append(e.remove())}),e.replace(o),o},_updateTable:function(e){var t,o,a,n,r,l,i,s,d;e.preventDefault(),this.getDialogue({focusAfterHide:null}).hide(),t=e.currentTarget.ancestor(O.FORM).one(O.CAPTION),o=e.currentTarget.ancestor(O.FORM).one(O.CAPTIONPOSITION),a=e.currentTarget.ancestor(O.FORM).one(O.HEADERS),d=e.currentTarget.ancestor(O.FORM).one(O.BORDERS),n=e.currentTarget.ancestor(O.FORM).one(O.BORDERSIZE),l=e.currentTarget.ancestor(O.FORM).one(O.SELECTEDBORDERCOLOUR),r=e.currentTarget.ancestor(O.FORM).one(O.BORDERSTYLE),i=e.currentTarget.ancestor(O.FORM).one(O.SELECTEDBACKGROUNDCOLOUR),e=e.currentTarget.ancestor(O.FORM).one(O.WIDTH),s=this._lastTarget.ancestor("table"),this._setAppearance(s,{width:e,borders:d,borderColour:l,borderSize:n,borderStyle:r,backgroundColour:i}),(e=s.one("caption"))||(e=v.Node.create(""),s.insert(e,0)),e.setHTML(t.get("value")),e.setStyle("caption-side",o.get("value")),e.getAttribute("style")||e.removeAttribute("style"),"rows"!==a.get("value")&&"both"!==a.get("value")||s.all("tr").each(function(e){var e=e.all("th, td"),t=e.shift();("TD"===t.get("tagName")?this._changeNodeType(t,"th"):t).setAttribute("scope","row"),e.each(function(e){"TH"===e.get("tagName")&&this._changeNodeType(e,"td").removeAttribute("scope")},this)},this),"columns"!==a.get("value")&&"both"!==a.get("value")||((d=s.all("tr")).shift().all("td, th").each(function(e){("TD"===e.get("tagName")?this._changeNodeType(e,"th"):e).setAttribute("scope","col")},this),d.each(function(e){e=e.all("th, td");"both"===a.get("value")&&e.shift(),e.each(function(e){"TH"===e.get("tagName")&&this._changeNodeType(e,"td").removeAttribute("scope")},this)},this)),this.markUpdated()},_setTable:function(e){var t,c,u,b,g,h,o,a,n,m,r,l,i,_,s,d;if(e.preventDefault(),this.getDialogue({focusAfterHide:null}).hide(),t=e.currentTarget.ancestor(O.FORM).one(O.CAPTION),d=e.currentTarget.ancestor(O.FORM).one(O.CAPTIONPOSITION),c=e.currentTarget.ancestor(O.FORM).one(O.BORDERS),u=e.currentTarget.ancestor(O.FORM).one(O.BORDERSIZE),g=e.currentTarget.ancestor(O.FORM).one(O.SELECTEDBORDERCOLOUR),b=e.currentTarget.ancestor(O.FORM).one(O.BORDERSTYLE),m=e.currentTarget.ancestor(O.FORM).one(O.SELECTEDBACKGROUNDCOLOUR),h=e.currentTarget.ancestor(O.FORM).one(O.ROWS),o=e.currentTarget.ancestor(O.FORM).one(O.COLUMNS),a=e.currentTarget.ancestor(O.FORM).one(O.HEADERS),e=e.currentTarget.ancestor(O.FORM).one(O.WIDTH),this.get("host").setSelection(this._currentSelection),i="\n",n='
      \n'+i,s="",n+=""+v.Escape.html(t.get("value"))+""+i,r=0,"columns"===a.get("value")||"both"===a.get("value")){for(r=1,n+="\n\n",l=0;l\n';n+="\n\n"}for(n+="\n";r\n",l=0;l\n":n+='\n';n+="\n"}n+="\n
      \n
      ",this.get("host").insertContentAtFocusPoint(n),d=v.one("#"+_),this._setAppearance(d,{width:e,borders:c,borderColour:g,borderSize:u,borderStyle:b,backgroundColour:m}),d.removeAttribute("id"),this.markUpdated()},_findColumnCells:function(){var a=this._getColumnIndex(this._lastTarget),e=this._lastTarget.ancestor("table").all("tr"),n=new v.NodeList,r=new v.NodeList,l=new v.NodeList;return e.each(function(e){var e=e.all("td, th"),t=e.item(a),o=e.item(a-1),e=e.item(a+1);n.push(t),o&&r.push(o),e&&l.push(e)}),{current:n,prev:r,next:l}},_hideInvalidEntries:function(e){var t=this._lastTarget.ancestor("table"),o=this._lastTarget.ancestor("tr"),t=t.all("tr"),a=t.indexOf(o),n=t.item(a-1),n=n?n.one("td"):null;o&&n?e.one('[data-change="moverowup"]').show():e.one('[data-change="moverowup"]').hide(),n=t.item(a+1),a=!!o&&o.one("td"),o&&n&&a?e.one('[data-change="moverowdown"]').show():e.one('[data-change="moverowdown"]').hide(),0<(t=this._findColumnCells()).prev.filter("td").size()?e.one('[data-change="movecolumnleft"]').show():e.one('[data-change="movecolumnleft"]').hide(),n=0
      '),"after"),this._contextMenu=new v.M.editor_atto.Menu({items:this._menuOptions,buttonId:t,attachmentPoint:"#"+t+"_menu"}),(o=this._contextMenu.get("boundingBox")).delegate("click",this._handleTableChange,"a",this)),o=this._contextMenu.get("boundingBox"),this._lastTarget=e.tableCell.ancestor(".editor_atto_content td, .editor_atto_content th",!0),this._hideInvalidEntries(o),v.Array.each(this.get("host").openMenus,function(e){e.set("focusAfterHide",null)}),this.get("host")._setTabFocus(a),this._contextMenu.show(),this._contextMenu.align(this.buttons.table,[v.WidgetPositionAlign.TL,v.WidgetPositionAlign.BL]),this._contextMenu.set("focusAfterHide",a),o.one("a")&&o.one("a").focus(),this.get("host").openMenus=[this._contextMenu]},_handleTableChange:function(e){switch(e.preventDefault(),this._contextMenu.set("focusAfterHide",this.get("host").editor),this._contextMenu.hide(e),e.target.getData("change")){case"addcolumnafter":this._addColumnAfter();break;case"addrowafter":this._addRowAfter();break;case"deleterow":this._deleteRow();break;case"deletecolumn":this._deleteColumn();break;case"edittable":this._editTable();break;case"moverowdown":this._moveRowDown();break;case"moverowup":this._moveRowUp();break;case"movecolumnleft":this._moveColumnLeft();break;case"movecolumnright":this._moveColumnRight()}},_getRowIndex:function(e){var t=e.ancestor("table"),e=e.ancestor("tr");if(t&&e)return t.all("tr").indexOf(e)},_getColumnIndex:function(e){var t=e.ancestor("tr");if(t)return t.all("td, th").indexOf(e)},_deleteRow:function(){var e=this._lastTarget.ancestor("tr");e&&e.one("td")&&e.remove(!0),this.markUpdated()},_moveRowUp:function(){var e=this._lastTarget.ancestor("tr"),t=e.previous("tr");e&&t&&(e.swap(t),this.markUpdated())},_moveColumnLeft:function(){var e,t,o,a=this._findColumnCells();if(0 "),1)},_removeCaption:function(){var e=this._lastTarget.ancestor("table").one("caption");e&&e.remove(!0)},_moveColumnRight:function(){var e,t,o,a=this._findColumnCells();if(0"),e.replace(t),e=t),e.setHTML(" ")}),t.ancestor("thead")?(t=a,o.insert(e,t)):t.insert(e,"after"),this.markUpdated())},_addColumnAfter:function(){var e=this._findColumnCells(),o=!0,t=e.next;e.next.size()<=0&&(o=!1,t=e.current),v.each(t,function(e){var t=e.cloneNode();t.setHTML(" "),o?e.get("parentNode").insert(t,e):(e.get("parentNode").insert(t,e),e.swap(t))},this),this.markUpdated()}},{ATTRS:{allowBorders:{value:!0},borderStyles:{value:["none","solid","dashed","dotted"]},allowBackgroundColour:{value:!0},allowWidth:{value:!0},allowStyling:{readOnly:!0,getter:function(){return this.get("allowBorders")||this.get("allowBackgroundColour")||this.get("allowWidth")}},availableColors:{value:["#FFFFFF","#EF4540","#FFCF35","#98CA3E","#7D9FD3","#333333"],readOnly:!0}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","moodle-editor_atto-menu","event","event-valuechange"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button.js b/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button.js index 9e297c397cd..42217618ec9 100644 --- a/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button.js +++ b/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button.js @@ -55,7 +55,7 @@ var COMPONENT = 'atto_table', '' + '
      ' + - '' + '' + '' + '' + @@ -66,7 +66,7 @@ var COMPONENT = 'atto_table', '
      ' + '' + '
      ' + - '' + '' + '' + '' + @@ -101,7 +101,7 @@ var COMPONENT = 'atto_table', '
      ' + '' + '
      ' + - '' + '' + '' + '' + @@ -113,7 +113,7 @@ var COMPONENT = 'atto_table', '' + '
      ' + - '' + + '' + + '' + + '' + '{{#each borderStyles}}' + '' + diff --git a/lib/editor/tiny/plugins/h5p/templates/modal.mustache b/lib/editor/tiny/plugins/h5p/templates/modal.mustache index 1245845493f..c51e131fb11 100644 --- a/lib/editor/tiny/plugins/h5p/templates/modal.mustache +++ b/lib/editor/tiny/plugins/h5p/templates/modal.mustache @@ -79,10 +79,8 @@ }} size="32"{{! }} /> {{#canUpload}} - - - + {{/canUpload}}
      diff --git a/lib/editor/tiny/plugins/link/templates/modal.mustache b/lib/editor/tiny/plugins/link/templates/modal.mustache index bd27117871d..f1880fd68ef 100644 --- a/lib/editor/tiny/plugins/link/templates/modal.mustache +++ b/lib/editor/tiny/plugins/link/templates/modal.mustache @@ -59,9 +59,7 @@ {{#showfilepicker}}
      - -
      {{/showfilepicker}} {{^showfilepicker}} diff --git a/lib/editor/tiny/plugins/media/templates/embed_media_modal_audio.mustache b/lib/editor/tiny/plugins/media/templates/embed_media_modal_audio.mustache index 227a9cc7846..844880df0f5 100644 --- a/lib/editor/tiny/plugins/media/templates/embed_media_modal_audio.mustache +++ b/lib/editor/tiny/plugins/media/templates/embed_media_modal_audio.mustache @@ -33,9 +33,7 @@
      {{#showfilepicker}} - - - + {{/showfilepicker}}
      @@ -63,9 +61,7 @@
      {{#showfilepicker}} - - - + {{/showfilepicker}}
      @@ -253,16 +249,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -305,16 +299,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -365,16 +357,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -417,16 +407,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -477,16 +465,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -529,16 +515,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -589,16 +573,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -641,16 +623,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -702,16 +682,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -754,16 +732,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} diff --git a/lib/editor/tiny/plugins/media/templates/embed_media_modal_link.mustache b/lib/editor/tiny/plugins/media/templates/embed_media_modal_link.mustache index 1aa2da611f1..4dc4d7ce8cd 100644 --- a/lib/editor/tiny/plugins/media/templates/embed_media_modal_link.mustache +++ b/lib/editor/tiny/plugins/media/templates/embed_media_modal_link.mustache @@ -32,9 +32,7 @@
      {{#showfilepicker}} - - - + {{/showfilepicker}}
      diff --git a/lib/editor/tiny/plugins/media/templates/embed_media_modal_video.mustache b/lib/editor/tiny/plugins/media/templates/embed_media_modal_video.mustache index b6ab470cc8c..fdfae281824 100644 --- a/lib/editor/tiny/plugins/media/templates/embed_media_modal_video.mustache +++ b/lib/editor/tiny/plugins/media/templates/embed_media_modal_video.mustache @@ -33,9 +33,7 @@
      {{#showfilepicker}} - - - + {{/showfilepicker}}
      @@ -63,9 +61,7 @@
      {{#showfilepicker}} - - - + {{/showfilepicker}}
      @@ -138,9 +134,7 @@
      {{#showfilepickerposter}} - - - + {{/showfilepickerposter}}
      @@ -283,16 +277,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -335,16 +327,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -395,16 +385,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -447,16 +435,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -507,16 +493,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -559,16 +543,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -619,16 +601,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -671,16 +651,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -732,16 +710,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} @@ -784,16 +760,14 @@
      {{#showfilepickertrack}} - - - + {{/showfilepickertrack}}
      - {{#langsinstalled}} diff --git a/lib/form/templates/editor_textarea.mustache b/lib/form/templates/editor_textarea.mustache index 5ff2c9b6675..1be771b7310 100644 --- a/lib/form/templates/editor_textarea.mustache +++ b/lib/form/templates/editor_textarea.mustache @@ -36,7 +36,7 @@
      {{#hasformats}} - {{#formats}} {{/formats}} diff --git a/lib/form/templates/element-autocomplete-inline.mustache b/lib/form/templates/element-autocomplete-inline.mustache index 555afe16a8b..acce4380a97 100644 --- a/lib/form/templates/element-autocomplete-inline.mustache +++ b/lib/form/templates/element-autocomplete-inline.mustache @@ -4,7 +4,7 @@ {{#element.multiple}} {{/element.multiple}} - {{/element.multiple}} - - ' . get_string('plugin', 'portfolio') . ''; - $selectoutput .= "\n" . '' . "\n"; $existingexports = portfolio_existing_exports_by_plugin($USER->id); foreach ($instances as $instance) { $formats = portfolio_supported_formats_intersect($callerformats, $instance->supported_formats()); diff --git a/lib/templates/checkbox.mustache b/lib/templates/checkbox.mustache index 518e662b2cf..aac50f2e4e5 100644 --- a/lib/templates/checkbox.mustache +++ b/lib/templates/checkbox.mustache @@ -28,7 +28,7 @@ "label": "Reset options" } }} -
      - - +
      + +
      \ No newline at end of file diff --git a/lib/templates/datafilter/filter_match.mustache b/lib/templates/datafilter/filter_match.mustache index 17b8b620de2..d7f374486fa 100644 --- a/lib/templates/datafilter/filter_match.mustache +++ b/lib/templates/datafilter/filter_match.mustache @@ -44,7 +44,7 @@ - + + - {{#options}} {{/options}} diff --git a/lib/templates/editswitch.mustache b/lib/templates/editswitch.mustache index 1e1ebf9e640..879619a03f7 100644 --- a/lib/templates/editswitch.mustache +++ b/lib/templates/editswitch.mustache @@ -34,21 +34,21 @@
      -
      -
      - - {{#pix}} i/search, core {{/pix}} - -
      + + {{#pix}} i/search, core {{/pix}} +
      - +
      diff --git a/lib/templates/filemanager_loginform.mustache b/lib/templates/filemanager_loginform.mustache index 6091dc4dcce..1d497c2e0af 100644 --- a/lib/templates/filemanager_loginform.mustache +++ b/lib/templates/filemanager_loginform.mustache @@ -22,7 +22,7 @@
      diff --git a/lib/templates/select_time.mustache b/lib/templates/select_time.mustache index 69bda9e4abd..a24fec2eac3 100644 --- a/lib/templates/select_time.mustache +++ b/lib/templates/select_time.mustache @@ -31,7 +31,7 @@ } }} - {{#options}} {{/options}} diff --git a/lib/templates/single_select.mustache b/lib/templates/single_select.mustache index 10b95d49990..4db5b842b51 100644 --- a/lib/templates/single_select.mustache +++ b/lib/templates/single_select.mustache @@ -95,7 +95,7 @@ {{#helpicon}} {{>core/help_icon}} {{/helpicon}} - + {{$labelmarkup}} -