Skip to content

Commit fba73ec

Browse files
authored
Merge pull request #4291 from albertgasset/MOBILE-4595
MOBILE-4595: WCAG 2.1 AA accessibility accreditation for version 4.5
2 parents d05c11e + 6fa9d50 commit fba73ec

File tree

81 files changed

+823
-323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+823
-323
lines changed

config.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@
3030
<preference name="prerendered-icon" value="true" />
3131
<preference name="AppendUserAgent" value="MoodleMobile 5.0.0 (50000)" />
3232
<preference name="BackupWebStorage" value="none" />
33-
<preference name="ScrollEnabled" value="false" />
33+
<preference name="ScrollEnabled" value="true" />
3434
<preference name="KeyboardDisplayRequiresUserAction" value="false" />
3535
<preference name="HideKeyboardFormAccessoryBar" value="false" />
36+
<preference name="KeyboardResizeMode" value="ionic" />
3637
<preference name="AllowInlineMediaPlayback" value="true" />
3738
<preference name="LoadUrlTimeoutValue" value="60000" />
3839
<preference name="load-url-timeout" value="60000" />

cordova-plugin-moodleapp/plugin.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
<param name="android-package" value="com.moodle.moodlemobile.Diagnostic_Location"/>
2626
<param name="onload" value="true" />
2727
</feature>
28+
<feature name="PinchToZoom">
29+
<param name="android-package" value="com.moodle.moodlemobile.PinchToZoom"/>
30+
<param name="onload" value="true" />
31+
</feature>
2832
</config-file>
2933

3034
<source-file src="src/android/Diagnostic.java" target-dir="src/cordova/plugins" />
@@ -37,6 +41,7 @@
3741

3842
<source-file src="src/android/SecureStorage.java" target-dir="src/com/moodle/moodlemobile" />
3943
<source-file src="src/android/InstallReferrer.java" target-dir="src/com/moodle/moodlemobile" />
44+
<source-file src="src/android/PinchToZoom.java" target-dir="src/com/moodle/moodlemobile" />
4045
</platform>
4146

4247
<platform name="ios">
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// (C) Copyright 2025 Moodle Pty Ltd.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package com.moodle.moodlemobile;
16+
17+
import org.apache.cordova.CordovaInterface;
18+
import org.apache.cordova.CordovaPlugin;
19+
import org.apache.cordova.CordovaWebView;
20+
21+
import android.util.Log;
22+
import android.webkit.WebSettings;
23+
import android.webkit.WebSettings.ZoomDensity;
24+
import android.webkit.WebView;
25+
26+
public class PinchToZoom extends CordovaPlugin {
27+
28+
public static final String TAG = "PinchToZoom";
29+
30+
@Override
31+
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
32+
Log.d(TAG, "Initializing pinch-to-zoom");
33+
34+
super.initialize(cordova, webView);
35+
36+
WebSettings settings = ((WebView) webView.getView()).getSettings();
37+
settings.setBuiltInZoomControls(true);
38+
settings.setDefaultZoom(WebSettings.ZoomDensity.MEDIUM);
39+
settings.setDisplayZoomControls(false);
40+
settings.setSupportZoom(true);
41+
}
42+
}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@
228228
"cordova-plugin-local-notification": {
229229
"ANDROID_SUPPORT_V4_VERSION": "26.+"
230230
},
231-
"cordova-plugin-moodleapp": {},
231+
"cordova-plugin-moodleapp": {
232+
"ANDROIDX_VERSION": "1.0.0",
233+
"ANDROIDX_APPCOMPAT_VERSION": "1.3.1"
234+
},
232235
"cordova-plugin-network-information": {},
233236
"cordova-plugin-prevent-override": {},
234237
"cordova-plugin-screen-orientation": {},
@@ -238,4 +241,4 @@
238241
"nl.kingsquare.cordova.background-audio": {}
239242
}
240243
}
241-
}
244+
}

patches/@ionic+core+8.4.1.patch

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,48 @@ index c3d2d8e..bc40d4f 100644
152152
const root = getElementRoot(baseEl);
153153
const contentEl = root.querySelector('.popover-content');
154154
const referenceSizeEl = trigger || ((_a = ev === null || ev === void 0 ? void 0 : ev.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (ev === null || ev === void 0 ? void 0 : ev.target);
155+
diff --git a/node_modules/@ionic/core/dist/esm/input-shims-0314bbe5.js b/node_modules/@ionic/core/dist/esm/input-shims-0314bbe5.js
156+
index dd9d410..846146f 100644
157+
--- a/node_modules/@ionic/core/dist/esm/input-shims-0314bbe5.js
158+
+++ b/node_modules/@ionic/core/dist/esm/input-shims-0314bbe5.js
159+
@@ -338,7 +338,8 @@ const enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, keyboardH
160+
const focusOut = () => {
161+
hasKeyboardBeenPresentedForTextField = false;
162+
win === null || win === void 0 ? void 0 : win.removeEventListener('ionKeyboardDidShow', keyboardShow);
163+
- componentEl.removeEventListener('focusout', focusOut);
164+
+ // Patched: Attach focusin/focusout events to inputEl instead of componentEl to allow focusing buttons inside <ion-input>.
165+
+ inputEl.removeEventListener('focusout', focusOut);
166+
};
167+
/**
168+
* When the input is about to receive
169+
@@ -358,13 +358,15 @@ const enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, keyboardH
170+
}
171+
jsSetFocus(componentEl, inputEl, contentEl, footerEl, keyboardHeight, addScrollPadding, disableClonedInput, platformHeight);
172+
win === null || win === void 0 ? void 0 : win.addEventListener('ionKeyboardDidShow', keyboardShow);
173+
- componentEl.addEventListener('focusout', focusOut);
174+
+ // Patched: Attach focusin/focusout events to inputEl instead of componentEl to allow focusing buttons inside <ion-input>.
175+
+ inputEl.addEventListener('focusout', focusOut);
176+
};
177+
- componentEl.addEventListener('focusin', focusIn);
178+
+ // Patched: Attach focusin/focusout events to inputEl instead of componentEl to allow focusing buttons inside <ion-input>.
179+
+ inputEl.addEventListener('focusin', focusIn);
180+
return () => {
181+
- componentEl.removeEventListener('focusin', focusIn);
182+
+ inputEl.removeEventListener('focusin', focusIn);
183+
win === null || win === void 0 ? void 0 : win.removeEventListener('ionKeyboardDidShow', keyboardShow);
184+
- componentEl.removeEventListener('focusout', focusOut);
185+
+ inputEl.removeEventListener('focusout', focusOut);
186+
};
187+
};
188+
/**
189+
--- a/node_modules/@ionic/core/dist/esm/ion-item_8.entry.js
190+
+++ b/node_modules/@ionic/core/dist/esm/ion-item_8.entry.js
191+
@@ -109,7 +109,7 @@ const Item = class {
192+
// inputs, then those need to individually get each click
193+
hasCover() {
194+
const inputs = this.el.querySelectorAll('ion-checkbox, ion-datetime, ion-select, ion-radio');
195+
- return inputs.length === 1 && !this.multipleInputs;
196+
+ return inputs.length === 1;
197+
}
198+
// If the item has an href or button property it will render a native
199+
// anchor or button that is clickable

scripts/langindex.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,6 +1743,7 @@
17431743
"core.decsep": "langconfig",
17441744
"core.defaultvalue": "tool_usertours",
17451745
"core.delete": "moodle",
1746+
"core.deleted": "moodle",
17461747
"core.deletedoffline": "local_moodlemobileapp",
17471748
"core.deleteduser": "bulkusers",
17481749
"core.deleting": "local_moodlemobileapp",
@@ -2165,6 +2166,7 @@
21652166
"core.login.login": "moodle",
21662167
"core.login.loginbutton": "local_moodlemobileapp",
21672168
"core.login.loginsteps": "moodle",
2169+
"core.login.logoof": "moodle",
21682170
"core.login.missingemail": "moodle",
21692171
"core.login.missingfirstname": "moodle",
21702172
"core.login.missinglastname": "moodle",
@@ -2450,6 +2452,7 @@
24502452
"core.selectall": "moodle",
24512453
"core.send": "message",
24522454
"core.sending": "chat",
2455+
"core.sent": "moodle",
24532456
"core.serverconnection": "local_moodlemobileapp",
24542457
"core.settings.about": "local_moodlemobileapp",
24552458
"core.settings.accessstatement": "access",
@@ -2487,6 +2490,7 @@
24872490
"core.settings.enableanalytics": "local_moodlemobileapp",
24882491
"core.settings.enableanalyticsdescription": "local_moodlemobileapp",
24892492
"core.settings.enabledownloadsection": "local_moodlemobileapp",
2493+
"core.settings.enablepinchtozoom": "local_moodlemobileapp",
24902494
"core.settings.enablerichtexteditor": "local_moodlemobileapp",
24912495
"core.settings.enablerichtexteditordescription": "local_moodlemobileapp",
24922496
"core.settings.encryptedpushsupported": "local_moodlemobileapp",

src/addons/block/myoverview/components/myoverview/addon-block-myoverview.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ <h2>{{ 'addon.block_myoverview.pluginname' | translate }}</h2>
9696
</ion-row>
9797

9898
<core-empty-box *ngIf="filteredCourses.length === 0" image="assets/img/icons/courses.svg">
99-
<p *ngIf="hasCourses" class="item-heading">
99+
<h3 *ngIf="hasCourses" class="item-heading">
100100
{{'addon.block_myoverview.noresult' | translate}}
101-
</p>
102-
<p *ngIf="!hasCourses" class="item-heading">
101+
</h3>
102+
<h3 *ngIf="!hasCourses" class="item-heading">
103103
{{'addon.block_myoverview.nocoursesenrolled' | translate}}
104-
</p>
104+
</h3>
105105
<ng-container *ngIf="searchEnabled">
106106
<p *ngIf="hasCourses" class="subdued">
107107
{{'addon.block_myoverview.noresultdescription' | translate}}

src/addons/block/myoverview/components/myoverview/myoverview.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
core-empty-box {
3535
.item-heading {
36+
font-size: 1rem;
3637
font-weight: bold;
3738
margin-bottom: 0;
3839
}

src/addons/block/timeline/components/events/addon-block-timeline-events.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ <h3>
99
<ion-item-group *ngFor="let dayEvents of events">
1010
<ion-item>
1111
<ion-label>
12-
<h4>{{ dayEvents.dayTimestamp * 1000 | coreFormatDate:"strftimedaydate" }}</h4>
12+
@if (course) {
13+
<h3><ng-container *ngTemplateOutlet="date" /></h3>
14+
} @else {
15+
<h4><ng-container *ngTemplateOutlet="date" /></h4>
16+
}
17+
<ng-template #date>
18+
{{ dayEvents.dayTimestamp * 1000 | coreFormatDate:"strftimedaydate" }}
19+
</ng-template>
1320
</ion-label>
1421
</ion-item>
1522
<ng-container *ngFor="let event of dayEvents.events">
132 Bytes
Loading

0 commit comments

Comments
 (0)