Skip to content

Commit

Permalink
Merge branch 'MDL-72737-master-2' of https://github.com/bmbrands/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Mar 1, 2022
2 parents d8cadf7 + 2faf5e8 commit 0f35a9b
Show file tree
Hide file tree
Showing 32 changed files with 467 additions and 535 deletions.
4 changes: 2 additions & 2 deletions admin/tests/behat/purge_caches.feature
Expand Up @@ -16,12 +16,12 @@ Feature: Purge caches
Scenario: Purge selected caches
Given I should not see "Selected caches were purged"
When I set the field "Themes" to "1"
And I press "Purge selected caches"
And I click on "Purge selected caches" "button" in the "#fitem_id_purgeselectedcaches" "css_element"
Then I should see "The selected caches were purged"

Scenario: Purge selected caches without selecting any caches
Given I should not see "Select one or more caches to purge"
When I press "Purge selected caches"
And I click on "Purge selected caches" "button" in the "#fitem_id_purgeselectedcaches" "css_element"
Then I should not see "The selected caches were purged"
And I should see "Select one or more caches to purge"

Expand Down
1 change: 1 addition & 0 deletions course/tests/behat/activities_edit_completion.feature
Expand Up @@ -30,6 +30,7 @@ Feature: Edit completion settings of an activity
When I am on the TestPage "Page Activity editing" page
And I expand all fieldsets
And I press "Unlock completion options"
And I expand all fieldsets
Then I should see "Completion options unlocked"
And I set the field "Completion tracking" to "Students can manually mark the activity as completed"
And I press "Save and display"
Expand Down
2 changes: 1 addition & 1 deletion course/tests/behat/course_collapse_sections.feature
Expand Up @@ -172,8 +172,8 @@ Feature: Collapse course sections
When I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Format | Weekly format |
| Course layout | Show one section per page |
| Format | Weekly format |
And I press "Save and display"
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
And I click on "8 May - 14 May" "link" in the "region-main" "region"
Expand Down
3 changes: 1 addition & 2 deletions lib/editor/atto/plugins/h5p/lib.php
Expand Up @@ -80,7 +80,6 @@ function atto_h5p_strings_for_js() {
);

$PAGE->requires->strings_for_js($strings, 'atto_h5p');
$PAGE->requires->strings_for_js(['expand', 'collapse'], 'moodle');
$PAGE->requires->js(autoloader::get_h5p_core_library_url('js/h5p-resizer.js'));
}


Expand Up @@ -93,9 +93,29 @@ var CSS = {
'{{/if}}' +
'</div>' +
'{{#if canUpload}}' +
'<fieldset class="collapsible {{#if collapseOptions}}collapsed{{/if}}" id="{{elementid}}_h5poptions">' +
'<legend class="ftoggler">{{get_string "h5poptions" component}}</legend>' +
'<div class="fcontainer">' +
'<fieldset class="mt-2 collapsible" id="{{elementid}}_h5poptions">' +
'<legend class="d-flex align-items-center px-1">' +
'<div class="position-relative d-flex ftoggler align-items-center position-relative mr-1">' +
'<a role="button" data-toggle="collapse" href="#h5poptions"' +
'aria-expanded="{{#if showOptions}}true{{/if}}{{^if showOptions}}false{{/if}}"' +
'aria-controls="h5poptions"' +
'class="btn btn-icon mr-1 icons-collapse-expand stretched-link fheader collapsed">' +
'<span class="expanded-icon icon-no-margin p-2"' +
'title="{{get_string "collapse" "moodle"}}">' +
'<i class="icon fa fa-chevron-down fa-fw " aria-hidden="true"></i>' +
'</span>' +
'<span class="collapsed-icon icon-no-margin p-2"' +
'title="{{get_string "expand" "moodle"}}">' +
'<i class="icon fa fa-chevron-right fa-fw " aria-hidden="true"></i>' +
'</span>' +
'<span class="sr-only">{{get_string "h5poptions" component}}</span>' +
'</a>' +
'<h3 class="d-flex align-self-stretch align-items-center mb-0" aria-hidden="true">' +
'{{get_string "h5poptions" component}}' +
'</h3>' +
'</div>' +
'</legend>' +
'<div id="h5poptions" class="fcontainer collapseable collapse px-1 {{#if showOptions}}show{{/if}}">' +
'<div class="form-check">' +
'<input type="checkbox" {{optionDownloadButton}} ' +
'class="form-check-input {{CSS.OPTION_DOWNLOAD_BUTTON}}"' +
Expand Down Expand Up @@ -311,7 +331,7 @@ Y.namespace('M.atto_h5p').Button = Y.Base.create('button', Y.M.editor_atto.Edito
optionDownloadButton,
optionEmbedButton,
optionCopyrightButton,
collapseOptions = true;
showOptions = false;

if (this._H5PDiv) {
var H5PURL = this._H5PDiv.get('innerHTML');
Expand All @@ -323,17 +343,17 @@ Y.namespace('M.atto_h5p').Button = Y.Base.create('button', Y.M.editor_atto.Edito
if (parameters) {
if (parameters.match(/export=1/)) {
optionDownloadButton = 'checked';
collapseOptions = false;
showOptions = true;
}

if (parameters.match(/embed=1/)) {
optionEmbedButton = 'checked';
collapseOptions = false;
showOptions = true;
}

if (parameters.match(/copyright=1/)) {
optionCopyrightButton = 'checked';
collapseOptions = false;
showOptions = true;
}
}
} else {
Expand All @@ -349,7 +369,7 @@ Y.namespace('M.atto_h5p').Button = Y.Base.create('button', Y.M.editor_atto.Edito
canUpload: permissions.canUpload,
canEmbed: permissions.canEmbed,
canUploadAndEmbed: permissions.canUploadAndEmbed,
collapseOptions: collapseOptions,
showOptions: showOptions,
fileURL: fileURL,
optionDownloadButton: optionDownloadButton,
optionEmbedButton: optionEmbedButton,
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -93,9 +93,29 @@ var CSS = {
'{{/if}}' +
'</div>' +
'{{#if canUpload}}' +
'<fieldset class="collapsible {{#if collapseOptions}}collapsed{{/if}}" id="{{elementid}}_h5poptions">' +
'<legend class="ftoggler">{{get_string "h5poptions" component}}</legend>' +
'<div class="fcontainer">' +
'<fieldset class="mt-2 collapsible" id="{{elementid}}_h5poptions">' +
'<legend class="d-flex align-items-center px-1">' +
'<div class="position-relative d-flex ftoggler align-items-center position-relative mr-1">' +
'<a role="button" data-toggle="collapse" href="#h5poptions"' +
'aria-expanded="{{#if showOptions}}true{{/if}}{{^if showOptions}}false{{/if}}"' +
'aria-controls="h5poptions"' +
'class="btn btn-icon mr-1 icons-collapse-expand stretched-link fheader collapsed">' +
'<span class="expanded-icon icon-no-margin p-2"' +
'title="{{get_string "collapse" "moodle"}}">' +
'<i class="icon fa fa-chevron-down fa-fw " aria-hidden="true"></i>' +
'</span>' +
'<span class="collapsed-icon icon-no-margin p-2"' +
'title="{{get_string "expand" "moodle"}}">' +
'<i class="icon fa fa-chevron-right fa-fw " aria-hidden="true"></i>' +
'</span>' +
'<span class="sr-only">{{get_string "h5poptions" component}}</span>' +
'</a>' +
'<h3 class="d-flex align-self-stretch align-items-center mb-0" aria-hidden="true">' +
'{{get_string "h5poptions" component}}' +
'</h3>' +
'</div>' +
'</legend>' +
'<div id="h5poptions" class="fcontainer collapseable collapse px-1 {{#if showOptions}}show{{/if}}">' +
'<div class="form-check">' +
'<input type="checkbox" {{optionDownloadButton}} ' +
'class="form-check-input {{CSS.OPTION_DOWNLOAD_BUTTON}}"' +
Expand Down Expand Up @@ -311,7 +331,7 @@ Y.namespace('M.atto_h5p').Button = Y.Base.create('button', Y.M.editor_atto.Edito
optionDownloadButton,
optionEmbedButton,
optionCopyrightButton,
collapseOptions = true;
showOptions = false;

if (this._H5PDiv) {
var H5PURL = this._H5PDiv.get('innerHTML');
Expand All @@ -323,17 +343,17 @@ Y.namespace('M.atto_h5p').Button = Y.Base.create('button', Y.M.editor_atto.Edito
if (parameters) {
if (parameters.match(/export=1/)) {
optionDownloadButton = 'checked';
collapseOptions = false;
showOptions = true;
}

if (parameters.match(/embed=1/)) {
optionEmbedButton = 'checked';
collapseOptions = false;
showOptions = true;
}

if (parameters.match(/copyright=1/)) {
optionCopyrightButton = 'checked';
collapseOptions = false;
showOptions = true;
}
}
} else {
Expand All @@ -349,7 +369,7 @@ Y.namespace('M.atto_h5p').Button = Y.Base.create('button', Y.M.editor_atto.Edito
canUpload: permissions.canUpload,
canEmbed: permissions.canEmbed,
canUploadAndEmbed: permissions.canUploadAndEmbed,
collapseOptions: collapseOptions,
showOptions: showOptions,
fileURL: fileURL,
optionDownloadButton: optionDownloadButton,
optionEmbedButton: optionEmbedButton,
Expand Down
36 changes: 28 additions & 8 deletions lib/editor/atto/plugins/h5p/yui/src/button/js/button.js
Expand Up @@ -91,9 +91,29 @@ var CSS = {
'{{/if}}' +
'</div>' +
'{{#if canUpload}}' +
'<fieldset class="collapsible {{#if collapseOptions}}collapsed{{/if}}" id="{{elementid}}_h5poptions">' +
'<legend class="ftoggler">{{get_string "h5poptions" component}}</legend>' +
'<div class="fcontainer">' +
'<fieldset class="mt-2 collapsible" id="{{elementid}}_h5poptions">' +
'<legend class="d-flex align-items-center px-1">' +
'<div class="position-relative d-flex ftoggler align-items-center position-relative mr-1">' +
'<a role="button" data-toggle="collapse" href="#h5poptions"' +
'aria-expanded="{{#if showOptions}}true{{/if}}{{^if showOptions}}false{{/if}}"' +
'aria-controls="h5poptions"' +
'class="btn btn-icon mr-1 icons-collapse-expand stretched-link fheader collapsed">' +
'<span class="expanded-icon icon-no-margin p-2"' +
'title="{{get_string "collapse" "moodle"}}">' +
'<i class="icon fa fa-chevron-down fa-fw " aria-hidden="true"></i>' +
'</span>' +
'<span class="collapsed-icon icon-no-margin p-2"' +
'title="{{get_string "expand" "moodle"}}">' +
'<i class="icon fa fa-chevron-right fa-fw " aria-hidden="true"></i>' +
'</span>' +
'<span class="sr-only">{{get_string "h5poptions" component}}</span>' +
'</a>' +
'<h3 class="d-flex align-self-stretch align-items-center mb-0" aria-hidden="true">' +
'{{get_string "h5poptions" component}}' +
'</h3>' +
'</div>' +
'</legend>' +
'<div id="h5poptions" class="fcontainer collapseable collapse px-1 {{#if showOptions}}show{{/if}}">' +
'<div class="form-check">' +
'<input type="checkbox" {{optionDownloadButton}} ' +
'class="form-check-input {{CSS.OPTION_DOWNLOAD_BUTTON}}"' +
Expand Down Expand Up @@ -309,7 +329,7 @@ Y.namespace('M.atto_h5p').Button = Y.Base.create('button', Y.M.editor_atto.Edito
optionDownloadButton,
optionEmbedButton,
optionCopyrightButton,
collapseOptions = true;
showOptions = false;

if (this._H5PDiv) {
var H5PURL = this._H5PDiv.get('innerHTML');
Expand All @@ -321,17 +341,17 @@ Y.namespace('M.atto_h5p').Button = Y.Base.create('button', Y.M.editor_atto.Edito
if (parameters) {
if (parameters.match(/export=1/)) {
optionDownloadButton = 'checked';
collapseOptions = false;
showOptions = true;
}

if (parameters.match(/embed=1/)) {
optionEmbedButton = 'checked';
collapseOptions = false;
showOptions = true;
}

if (parameters.match(/copyright=1/)) {
optionCopyrightButton = 'checked';
collapseOptions = false;
showOptions = true;
}
}
} else {
Expand All @@ -347,7 +367,7 @@ Y.namespace('M.atto_h5p').Button = Y.Base.create('button', Y.M.editor_atto.Edito
canUpload: permissions.canUpload,
canEmbed: permissions.canEmbed,
canUploadAndEmbed: permissions.canUploadAndEmbed,
collapseOptions: collapseOptions,
showOptions: showOptions,
fileURL: fileURL,
optionDownloadButton: optionDownloadButton,
optionEmbedButton: optionEmbedButton,
Expand Down
1 change: 1 addition & 0 deletions lib/editor/atto/plugins/media/lib.php
Expand Up @@ -80,6 +80,7 @@ function atto_media_strings_for_js() {
'videowidth',
'width'),
'atto_media');
$PAGE->requires->strings_for_js(array('expand', 'collapse'), 'moodle');
}

/**
Expand Down

0 comments on commit 0f35a9b

Please sign in to comment.