Merge branch 'MDL-70316-311' of git://github.com/mihailges/moodle into MOODLE_311_STABLE

This commit is contained in:
Sara Arjona
2021-02-03 15:29:33 +01:00
10 changed files with 3413 additions and 1667 deletions
+2 -1
View File
@@ -752,8 +752,9 @@ $string['emojicategoryanimalsnature'] = 'Animals & nature';
$string['emojicategoryflags'] = 'Flags';
$string['emojicategoryfooddrink'] = 'Food & drink';
$string['emojicategoryobjects'] = 'Objects';
$string['emojicategorypeoplebody'] = 'People & body';
$string['emojicategoryrecent'] = 'Recent';
$string['emojicategorysmileyspeople'] = 'Smileys & people';
$string['emojicategorysmileysemotion'] = 'Smileys & emotion';
$string['emojicategorysymbols'] = 'Symbols';
$string['emojicategorytravelplaces'] = 'Travel & places';
$string['emptydragdropregion'] = 'empty region';
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3355 -1658
View File
File diff suppressed because it is too large Load Diff
@@ -226,8 +226,9 @@ class icon_system_fontawesome extends icon_system_font {
'core:i/emojicategoryflags' => 'fa-flag',
'core:i/emojicategoryfooddrink' => 'fa-cutlery',
'core:i/emojicategoryobjects' => 'fa-lightbulb-o',
'core:i/emojicategorypeoplebody' => 'fa-male',
'core:i/emojicategoryrecent' => 'fa-clock-o',
'core:i/emojicategorysmileyspeople' => 'fa-smile-o',
'core:i/emojicategorysmileysemotion' => 'fa-smile-o',
'core:i/emojicategorysymbols' => 'fa-heart',
'core:i/emojicategorytravelplaces' => 'fa-plane',
'core:i/edit' => 'fa-pencil',
+19 -1
View File
@@ -24,7 +24,8 @@ define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
$categorysortorder = [
'Smileys & People',
'Smileys & Emotion',
'People & Body',
'Animals & Nature',
'Food & Drink',
'Travel & Places',
@@ -39,6 +40,8 @@ $rawdata = file_get_contents('./emoji_pretty.json');
$jsondata = json_decode($rawdata, true);
$emojibycategory = [];
$obsoletes = [];
// Emoji categories used in the emoji-data library.
$categories = [];
foreach ($jsondata as $data) {
$category = $data['category'];
@@ -48,6 +51,10 @@ foreach ($jsondata as $data) {
continue;
}
if (!in_array($category, $categories)) {
$categories[] = $category;
}
if (!empty($data['obsoleted_by'])) {
// Skip any obsolete emojis. We'll merge these short names into the
// newer emoji later on.
@@ -71,6 +78,17 @@ foreach ($jsondata as $data) {
'shortnames' => [$data['short_name']]
];
}
// Detect any category changes.
// Some emoji categories from the emoji-data library are missing.
if ($missingcategories = array_diff($categories, $categorysortorder)) {
die("The following categories are missing: " . implode(', ', $missingcategories) .
". For more details on how to properly fix this issue, please see /lib/emoji-data/readme_moodle.txt");
}
// Some emoji categories are not being used anymore in the emoji-data library.
if ($unusedcategories = array_diff($categorysortorder, $categories)) {
die("The following categories are no longer used: " . implode(', ', $unusedcategories) .
". For more details on how to properly fix this issue, please see /lib/emoji-data/readme_moodle.txt");
}
$emojibycategory = array_values($emojibycategory);
// Sort the emojis within each category into the order specified in the raw data.
+20
View File
@@ -7,6 +7,26 @@ Description of emoji data import into Moodle.
3. Run the generate_emoji_data.php script to create the new data.js file
E.g. php lib/emoji-data/generate_emoji_data.php > lib/amd/src/emoji/data.js
Once this command has been executed, open the newly created lib/amd/src/emoji/data.js file and make sure that the
emoji data has been successfully generated.
==================================================================================================================
NOTE: If the following error messages are displayed instead of the emoji data in data.js you should:
* 'The following categories are missing: xyz, xyz, ...'
1. add these categories in $categorysortorder in generate_emoji_data.php
2. include these categories in the emoji picker template (lib/templates/emoji/picker.mustache).
3. add appropriate icon mappings for these categories in get_core_icon_map() in
lib/classes/output/icon_system_fontawesome.php.
4. add language strings for these categories in lang/en/moodle.php.
* 'The following categories are no longer used: xyz, xyz, ...'
1. remove these categories from $categorysortorder in generate_emoji_data.php
2. remove these categories from the emoji picker template (lib/templates/emoji/picker.mustache).
3. remove the icon mappings for these categories in get_core_icon_map() in
lib/classes/output/icon_system_fontawesome.php.
4. remove (deprecate) the language strings for these categories in lang/en/moodle.php.
Rerun 'php lib/emoji-data/generate_emoji_data.php > lib/amd/src/emoji/data.js'
==================================================================================================================
4. Build the new emoji data.js file
E.g. grunt amd --files=lib/amd/src/emoji/data.js
+11 -3
View File
@@ -49,10 +49,18 @@
<button
class="btn btn-outline-secondary icon-no-margin category-button"
data-action="show-category"
data-category="Smileys & People"
title="{{#str}} emojicategorysmileyspeople, core {{/str}}"
data-category="Smileys & Emotion"
title="{{#str}} emojicategorysmileysemotion, core {{/str}}"
>
{{#pix}} i/emojicategorysmileyspeople, core {{/pix}}
{{#pix}} i/emojicategorysmileysemotion, core {{/pix}}
</button>
<button
class="btn btn-outline-secondary icon-no-margin category-button"
data-action="show-category"
data-category="People & Body"
title="{{#str}} emojicategorypeoplebody, core {{/str}}"
>
{{#pix}} i/emojicategorypeoplebody, core {{/pix}}
</button>
<button
class="btn btn-outline-secondary icon-no-margin category-button"
+1 -1
View File
@@ -325,7 +325,7 @@
<location>emoji-data</location>
<name>Emoji data</name>
<license>MIT</license>
<version>4.1.0</version>
<version>6.0.0</version>
</library>
<library>
<location>polyfills</location>
+1
View File
@@ -21,6 +21,7 @@ information provided here is intended especially for developers.
* A new optional parameter `$sort` has been added to all `$context->get_capabilities()` methods to be able to define order of
returned capability array.
* Spout has been upgraded to the latest version - 3.1.0
* emoji-data has been upgraded to 6.0.0.
=== 3.10 ===
* PHPUnit has been upgraded to 8.5. That comes with a few changes: