mumuki-laboratory 9.0.3 → 9.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/mumuki_laboratory/application/codemirror.js +10 -2
- data/app/assets/javascripts/mumuki_laboratory/application/discussions.js +49 -8
- data/app/assets/javascripts/mumuki_laboratory/application/gamification.js +3 -3
- data/app/assets/javascripts/mumuki_laboratory/application/kids.js +11 -7
- data/app/assets/javascripts/mumuki_laboratory/application/kindergarten.js +3 -3
- data/app/assets/javascripts/mumuki_laboratory/application/messages.js +3 -3
- data/app/assets/javascripts/mumuki_laboratory/application/mu-modal-carrousel.js +4 -4
- data/app/assets/javascripts/mumuki_laboratory/application/multiple-files.js +18 -5
- data/app/assets/javascripts/mumuki_laboratory/application/multiple-scenarios.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/organization.js +32 -0
- data/app/assets/javascripts/mumuki_laboratory/application/primary.js +4 -4
- data/app/assets/javascripts/mumuki_laboratory/application/profile.js +0 -6
- data/app/assets/javascripts/mumuki_laboratory/application/progress.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/speech-bubble-renderer.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/submission.js +4 -3
- data/app/assets/javascripts/mumuki_laboratory/application/submissions-store.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/toast.js +3 -0
- data/app/assets/javascripts/mumuki_laboratory/application/tooltip.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/upload.js +2 -2
- data/app/assets/javascripts/mumuki_laboratory/application/user.js +34 -1
- data/app/assets/stylesheets/mumuki_laboratory/application.scss +0 -1
- data/app/assets/stylesheets/mumuki_laboratory/application/_errors.scss +1 -1
- data/app/assets/stylesheets/mumuki_laboratory/application/_layout.scss +1 -27
- data/app/assets/stylesheets/mumuki_laboratory/application/_modules.scss +1 -2
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_activity.scss +14 -0
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_avatar.scss +5 -0
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_breadcrumb.scss +2 -2
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_datepicker.scss +0 -4
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_discussion.scss +49 -59
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_editor.scss +16 -18
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_exercise_assignment.scss +2 -11
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_exercise_results.scss +1 -7
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_faqs.scss +3 -3
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_flash.scss +7 -46
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids.scss +19 -4
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids_results.scss +18 -23
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kindergarten.scss +1 -9
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_overlap.scss +1 -1
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_progress_bar.scss +5 -5
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_terms.scss +3 -2
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_timer.scss +1 -3
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_menu.scss +14 -7
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_profile.scss +1 -2
- data/app/controllers/application_controller.rb +4 -2
- data/app/controllers/discussions_messages_controller.rb +9 -3
- data/app/controllers/users_controller.rb +13 -0
- data/app/helpers/application_helper.rb +5 -5
- data/app/helpers/assignment_result_helper.rb +3 -2
- data/app/helpers/assistance_box_helper.rb +1 -1
- data/app/helpers/concerns/with_student_path_navigation.rb +8 -3
- data/app/helpers/concerns/with_student_path_navigation/continue_navigation.rb +1 -1
- data/app/helpers/concerns/with_student_path_navigation/finish_navigation.rb +1 -1
- data/app/helpers/concerns/with_student_path_navigation/next_parent_navigation.rb +7 -0
- data/app/helpers/concerns/with_student_path_navigation/revisit_navigation.rb +1 -1
- data/app/helpers/discussions_helper.rb +64 -23
- data/app/helpers/editor_tabs_helper.rb +10 -6
- data/app/helpers/email_helper.rb +2 -2
- data/app/helpers/exercise_input_helper.rb +2 -3
- data/app/helpers/links_helper.rb +12 -9
- data/app/helpers/menu_bar_helper.rb +1 -1
- data/app/helpers/messages_helper.rb +1 -1
- data/app/helpers/multiple_file_editor_helper.rb +2 -1
- data/app/helpers/overlapped_buttons_helper.rb +22 -12
- data/app/helpers/profile_helper.rb +3 -3
- data/app/helpers/toast_helper.rb +27 -0
- data/app/helpers/user_activity_helper.rb +48 -0
- data/app/helpers/user_menu_helper.rb +4 -0
- data/app/views/book/show.html.erb +2 -2
- data/app/views/certificates/verify.html.erb +1 -1
- data/app/views/chapters/show.html.erb +2 -2
- data/app/views/discussions/_description_message.html.erb +1 -1
- data/app/views/discussions/_message.html.erb +32 -7
- data/app/views/discussions/_new_message.html.erb +13 -2
- data/app/views/discussions/index.html.erb +8 -10
- data/app/views/discussions/new.html.erb +2 -2
- data/app/views/discussions/show.html.erb +20 -12
- data/app/views/exam_registrations/show.html.erb +10 -11
- data/app/views/exercise_solutions/_assistant_rules_box.html.erb +1 -1
- data/app/views/exercise_solutions/_contextualization_results_body.html.erb +1 -1
- data/app/views/exercise_solutions/_contextualization_results_container.html.erb +1 -1
- data/app/views/exercise_solutions/_kids_results_button.html.erb +2 -2
- data/app/views/exercise_solutions/_results.html.erb +1 -1
- data/app/views/exercises/_exercise_assignment.html.erb +2 -2
- data/app/views/exercises/_exercise_skipped.html.erb +1 -1
- data/app/views/exercises/_read_only.html.erb +108 -105
- data/app/views/exercises/show.html.erb +7 -7
- data/app/views/guides/_guide.html.erb +1 -1
- data/app/views/guides/_guide_container.html.erb +4 -4
- data/app/views/invitations/_invitation_form.html.erb +5 -4
- data/app/views/layouts/_authoring.html.erb +1 -1
- data/app/views/layouts/_discussions.html.erb +7 -7
- data/app/views/layouts/_kids.html.erb +5 -5
- data/app/views/layouts/_kindergarten.html.erb +10 -6
- data/app/views/layouts/_main.html.erb +10 -10
- data/app/views/layouts/_organizations_listing.html.erb +2 -2
- data/app/views/layouts/_progress_bar.html.erb +2 -0
- data/app/views/layouts/_submission_result_error.html.erb +1 -1
- data/app/views/layouts/_test_results.html.erb +1 -1
- data/app/views/layouts/_timer.html.erb +1 -1
- data/app/views/layouts/_user_menu.html.erb +4 -3
- data/app/views/layouts/application.html.erb +39 -42
- data/app/views/layouts/exercise_inputs/editors/_code.html.erb +4 -4
- data/app/views/layouts/exercise_inputs/editors/_free_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/editors/_multiple_choice.html.erb +7 -9
- data/app/views/layouts/exercise_inputs/editors/_multiple_files.html.erb +10 -10
- data/app/views/layouts/exercise_inputs/editors/_single_choice.html.erb +6 -8
- data/app/views/layouts/exercise_inputs/editors/_text.html.erb +2 -3
- data/app/views/layouts/exercise_inputs/editors/_upload.html.erb +5 -5
- data/app/views/layouts/exercise_inputs/forms/_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/forms/_interactive_form.html.erb +2 -2
- data/app/views/layouts/exercise_inputs/forms/_kids_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/forms/_playground_form.html.erb +2 -2
- data/app/views/layouts/exercise_inputs/forms/_problem_form.html.erb +13 -9
- data/app/views/layouts/exercise_inputs/layouts/_input_primary.html.erb +2 -2
- data/app/views/layouts/exercise_inputs/layouts/_input_right.html.erb +2 -2
- data/app/views/layouts/exercise_inputs/read_only_editors/_code.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/read_only_editors/_free_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/read_only_editors/_multiple_choice.html.erb +4 -4
- data/app/views/layouts/exercise_inputs/read_only_editors/_multiple_files.html.erb +2 -2
- data/app/views/layouts/exercise_inputs/read_only_editors/_single_choice.html.erb +4 -4
- data/app/views/layouts/exercise_inputs/read_only_editors/_text.erb +1 -1
- data/app/views/layouts/modals/_avatar_picker.html.erb +2 -5
- data/app/views/layouts/modals/_guide_corollary.html.erb +4 -8
- data/app/views/layouts/modals/_kids_context.html.erb +7 -5
- data/app/views/layouts/modals/_kids_results.html.erb +2 -2
- data/app/views/layouts/modals/_kids_results_aborted.html.erb +2 -2
- data/app/views/layouts/modals/_kindergarten_context.html.erb +3 -3
- data/app/views/layouts/modals/_kindergarten_results.html.erb +3 -3
- data/app/views/layouts/modals/_kindergarten_results_aborted.html.erb +2 -2
- data/app/views/layouts/modals/_level_up.html.erb +2 -5
- data/app/views/layouts/modals/_new_message.html.erb +5 -5
- data/app/views/notifications/_dropdown.html.erb +3 -3
- data/app/views/users/_activity_indicator.html.erb +17 -0
- data/app/views/users/_edit_user_form.html.erb +6 -6
- data/app/views/users/_profile_fields.html.erb +6 -6
- data/app/views/users/_user_form.html.erb +2 -2
- data/app/views/users/activity.html.erb +37 -0
- data/app/views/users/certificates.html.erb +26 -24
- data/app/views/users/discussions.html.erb +23 -21
- data/app/views/users/messages.html.erb +22 -20
- data/app/views/users/show.html.erb +5 -3
- data/app/views/users/terms.html.erb +4 -2
- data/config/initializers/inflections.rb +3 -0
- data/config/routes.rb +3 -0
- data/lib/mumuki/laboratory.rb +1 -1
- data/lib/mumuki/laboratory/extensions.rb +1 -0
- data/lib/mumuki/laboratory/extensions/date_and_time.rb +11 -0
- data/lib/mumuki/laboratory/locales/en.yml +28 -2
- data/lib/mumuki/laboratory/locales/es-CL.yml +33 -4
- data/lib/mumuki/laboratory/locales/es.yml +33 -4
- data/lib/mumuki/laboratory/locales/pt.yml +34 -3
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/spec/capybara_helper.rb +1 -0
- data/spec/controllers/discussions_messages_controller_spec.rb +84 -3
- data/spec/dummy/db/schema.rb +23 -3
- data/spec/features/discussion_flow_spec.rb +22 -2
- data/spec/features/exercise_flow_spec.rb +1 -1
- data/spec/features/guide_reset_spec.rb +1 -1
- data/spec/features/terms_flow_spec.rb +1 -2
- data/spec/features/user_activity_flow_spec.rb +65 -0
- data/spec/helpers/breadcrumbs_helper_spec.rb +2 -2
- data/spec/helpers/user_activity_helper_spec.rb +32 -0
- data/spec/helpers/with_navigation_spec.rb +36 -13
- data/spec/javascripts/editors-spec.js +3 -3
- data/spec/javascripts/kids-button-spec.js +2 -2
- data/spec/javascripts/upload-spec.js +8 -8
- metadata +133 -123
- data/app/assets/stylesheets/mumuki_laboratory/application/hovers.scss +0 -12
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_checkboxes.scss +0 -34
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_guide_corollary.scss +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22e07e5d159d6e1e49fd972414dc27da7a622885670bd3d4a60695682bd9cdc4
|
4
|
+
data.tar.gz: de76a5fe5a591b7aa2783f83ae0a50e15796ae5ba7cf1852a7bd5896c2f7950f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e00878630e1bb812eafc6ca76e67b71e09a246d379de4c3f8ceca39b3d9cdaf216bc322859a0c90ae313a554dbe54c706742296e9d6a04421534485bced4604
|
7
|
+
data.tar.gz: e529d54a82cba3b40e6642a7f3d4fd4f4bbf211fcceab823b6b255a793df5258389901966319fda2506b28787507d61c4904f556f4ec0f8316bc77bade066eee
|
@@ -20,12 +20,20 @@ mumuki.page.editors = [];
|
|
20
20
|
$("#exercise_language_id").change(updateCodeMirrorLanguage);
|
21
21
|
}
|
22
22
|
|
23
|
-
function
|
23
|
+
function resetSimpleEditor() {
|
24
24
|
mumuki.page.dynamicEditors.forEach(function (e) {
|
25
25
|
setDefaultContent(e, $('#default_content').val());
|
26
26
|
});
|
27
27
|
}
|
28
28
|
|
29
|
+
function resetEditor(isMultipleFiles) {
|
30
|
+
if (!isMultipleFiles) {
|
31
|
+
resetSimpleEditor();
|
32
|
+
} else {
|
33
|
+
mumuki.multipleFileEditor.resetEditor();
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
29
37
|
function formatContent() {
|
30
38
|
mumuki.page.editors.each(function (_, editor) {
|
31
39
|
editor.setSelection({line: 0, ch: 0}, {line: editor.lineCount()});
|
@@ -87,7 +95,7 @@ mumuki.page.editors = [];
|
|
87
95
|
$('.editor-reset').click(function (event) {
|
88
96
|
event.stopPropagation();
|
89
97
|
const selection = confirm(this.getAttribute('data-confirm'));
|
90
|
-
if(selection) resetEditor();
|
98
|
+
if (selection) resetEditor($(event.target).parent().data('multiple-files'));
|
91
99
|
});
|
92
100
|
|
93
101
|
$('.editor-resize').click(function () {
|
@@ -1,9 +1,13 @@
|
|
1
1
|
mumuki.load(() => {
|
2
|
-
var $
|
3
|
-
var $
|
2
|
+
var $subscriptionButtons = $('.discussion-subscription > button');
|
3
|
+
var $upvoteButtons = $('.discussion-upvote > button');
|
4
|
+
let $messagePreviewButton = $('.discussion-new-message-preview-button.preview');
|
5
|
+
let $messageEditButton = $('.discussion-new-message-preview-button.edit');
|
6
|
+
let $newMessageContent = $('.discussion-new-message-content');
|
7
|
+
let $newMessagePreview = $('#discussion-new-message-preview');
|
4
8
|
|
5
9
|
function createNewMessageEditor() {
|
6
|
-
var $textarea = $("#new-
|
10
|
+
var $textarea = $("#discussion-new-message");
|
7
11
|
var textarea = $textarea[0];
|
8
12
|
if (!textarea) return;
|
9
13
|
|
@@ -26,11 +30,11 @@ mumuki.load(() => {
|
|
26
30
|
}
|
27
31
|
|
28
32
|
createReadOnlyEditors();
|
29
|
-
createNewMessageEditor();
|
33
|
+
let editor = createNewMessageEditor();
|
30
34
|
|
31
35
|
var Forum = {
|
32
|
-
toggleButton: function (
|
33
|
-
|
36
|
+
toggleButton: function (elements) {
|
37
|
+
elements.toggleClass('d-none');
|
34
38
|
},
|
35
39
|
token: new mumuki.CsrfToken(),
|
36
40
|
tokenRequest: function (data) {
|
@@ -44,10 +48,10 @@ mumuki.load(() => {
|
|
44
48
|
});
|
45
49
|
},
|
46
50
|
discussionSubscription: function (url) {
|
47
|
-
Forum.discussionPostAndToggle(url, $
|
51
|
+
Forum.discussionPostAndToggle(url, $subscriptionButtons);
|
48
52
|
},
|
49
53
|
discussionUpvote: function (url) {
|
50
|
-
Forum.discussionPostAndToggle(url, $
|
54
|
+
Forum.discussionPostAndToggle(url, $upvoteButtons);
|
51
55
|
},
|
52
56
|
discussionPostAndToggle: function (url, elem) {
|
53
57
|
Forum.discussionPost(url).done(Forum.toggleButton(elem));
|
@@ -67,9 +71,46 @@ mumuki.load(() => {
|
|
67
71
|
const params = new URLSearchParams(location.search);
|
68
72
|
elem.is(':checked') ? params.set(key, elem.val()) : params.delete(key);
|
69
73
|
location.search = params.toString();
|
74
|
+
},
|
75
|
+
discussionMessagePreview: function (url) {
|
76
|
+
return Forum.tokenRequest({
|
77
|
+
url: url,
|
78
|
+
method: 'GET',
|
79
|
+
processData: false,
|
80
|
+
dataType: 'json',
|
81
|
+
data: new URLSearchParams({ content: editor.getValue() } ),
|
82
|
+
success: function (response) {
|
83
|
+
showPreview(response.preview);
|
84
|
+
},
|
85
|
+
error: function (e) {
|
86
|
+
error = $messagePreviewButton.attr('error-text');
|
87
|
+
showPreview(error);
|
88
|
+
},
|
89
|
+
xhrFields: {withCredentials: true}
|
90
|
+
});
|
91
|
+
},
|
92
|
+
hidePreviewAndShowEditor: function(elem) {
|
93
|
+
togglePreviewAndEditButtons();
|
94
|
+
togglePreviewAndContentMessage();
|
70
95
|
}
|
71
96
|
};
|
72
97
|
|
98
|
+
function showPreview(preview) {
|
99
|
+
$newMessagePreview.html($.parseHTML(preview));
|
100
|
+
togglePreviewAndEditButtons();
|
101
|
+
togglePreviewAndContentMessage();
|
102
|
+
}
|
103
|
+
|
104
|
+
function togglePreviewAndEditButtons() {
|
105
|
+
$messagePreviewButton.toggleClass('d-none');
|
106
|
+
$messageEditButton.toggleClass('d-none');
|
107
|
+
}
|
108
|
+
|
109
|
+
function togglePreviewAndContentMessage() {
|
110
|
+
$newMessagePreview.toggleClass('d-none');
|
111
|
+
$newMessageContent.toggleClass('d-none');
|
112
|
+
}
|
113
|
+
|
73
114
|
mumuki.Forum = Forum;
|
74
115
|
|
75
116
|
});
|
@@ -82,11 +82,11 @@ mumuki.gamification = (() => {
|
|
82
82
|
|
83
83
|
defaultGainedExperienceAction() {
|
84
84
|
$('#mu-exp-points').html(this.lastEarnedExp);
|
85
|
-
$('#mu-exp-earned-message').removeClass('
|
85
|
+
$('#mu-exp-earned-message').removeClass('d-none');
|
86
86
|
}
|
87
87
|
|
88
88
|
defaultLevelUpAction(_levelUpHtml) {
|
89
|
-
|
89
|
+
new bootstrap.Modal('#mu-level-up').show();
|
90
90
|
}
|
91
91
|
|
92
92
|
registerLevelUpAction(action) {
|
@@ -118,7 +118,7 @@ mumuki.gamification = (() => {
|
|
118
118
|
updateTooltip() {
|
119
119
|
const $muLevelTooltip = $('.mu-level-tooltip');
|
120
120
|
|
121
|
-
$muLevelTooltip.attr("data-original-title", `${$muLevelTooltip.attr("level")} ${this.currentLevel()}`);
|
121
|
+
$muLevelTooltip.attr("data-bs-original-title", `${$muLevelTooltip.attr("level")} ${this.currentLevel()}`);
|
122
122
|
$muLevelTooltip.attr("title", "");
|
123
123
|
}
|
124
124
|
|
@@ -51,10 +51,13 @@ mumuki.Kids = class {
|
|
51
51
|
}
|
52
52
|
|
53
53
|
showContext() {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
54
|
+
let context = document.getElementById('mu-kids-context');
|
55
|
+
if (context) {
|
56
|
+
new bootstrap.Modal(context, {
|
57
|
+
backdrop: 'static',
|
58
|
+
keyboard: false
|
59
|
+
}).show();
|
60
|
+
}
|
58
61
|
}
|
59
62
|
|
60
63
|
showNonAbortedPopup(data, animation_name, open_modal_delay_ms = 0) {
|
@@ -66,7 +69,7 @@ mumuki.Kids = class {
|
|
66
69
|
|
67
70
|
showAbortedPopup(_data) {
|
68
71
|
this.submitButton.disable();
|
69
|
-
|
72
|
+
new bootstrap.Modal(document.getElementById('kids-results-aborted')).show();
|
70
73
|
}
|
71
74
|
|
72
75
|
showOverlay() {
|
@@ -114,11 +117,12 @@ mumuki.Kids = class {
|
|
114
117
|
// =================
|
115
118
|
|
116
119
|
_openSubmissionResultModal(data) {
|
117
|
-
|
120
|
+
let modal = new bootstrap.Modal(document.getElementById('kids-results'), { backdrop: 'static', keyboard: false });
|
121
|
+
modal.show();
|
118
122
|
this.$resultsModal.find('.modal-header').first().html(data.title_html);
|
119
123
|
mumuki.gamification.currentLevelProgression.setExpMessage(data);
|
120
124
|
this.$resultsModal.find('.modal-footer').first().html(data.button_html);
|
121
|
-
$('.mu-close-modal').click(() =>
|
125
|
+
$('.mu-close-modal').click(() => modal.hide());
|
122
126
|
this.onSubmissionResultModalOpen(data);
|
123
127
|
}
|
124
128
|
|
@@ -116,8 +116,8 @@ mumuki.load(() => {
|
|
116
116
|
_action(add, remove, isPlaying, callback) {
|
117
117
|
callback(window.speechSynthesis);
|
118
118
|
const $button = $('.mu-kindergarten-play-description');
|
119
|
-
$button.find(`.mu-kindergarten-${add}`).addClass('
|
120
|
-
$button.find(`.mu-kindergarten-${remove}`).removeClass('
|
119
|
+
$button.find(`.mu-kindergarten-${add}`).addClass('d-none');
|
120
|
+
$button.find(`.mu-kindergarten-${remove}`).removeClass('d-none');
|
121
121
|
this._isPlaying = isPlaying;
|
122
122
|
},
|
123
123
|
verifyBrowserSupport() {
|
@@ -146,7 +146,7 @@ mumuki.load(() => {
|
|
146
146
|
showOrHideExpandHintButton() {
|
147
147
|
const $button = $('.expand-or-collapse-hint-media');
|
148
148
|
const $hintMedia = $('.mu-kindergarten-hint-media');
|
149
|
-
if (!$hintMedia.get(0)) $button.addClass('
|
149
|
+
if (!$hintMedia.get(0)) $button.addClass('d-none');
|
150
150
|
},
|
151
151
|
};
|
152
152
|
}
|
@@ -10,12 +10,12 @@ mumuki.load(() => {
|
|
10
10
|
return Chat.$newMessageModal().find('.modal-body, .modal-footer');
|
11
11
|
},
|
12
12
|
collapseNewMessageModal: function () {
|
13
|
-
Chat.$newMessageModalComponents().toggleClass('
|
13
|
+
Chat.$newMessageModalComponents().toggleClass('d-none');
|
14
14
|
},
|
15
15
|
token: new mumuki.CsrfToken(),
|
16
16
|
setMessages: function (data) {
|
17
17
|
$('.badge-notifications').html(data.messages_count);
|
18
|
-
$('.notifications-box').toggleClass('
|
18
|
+
$('.notifications-box').toggleClass('d-none', !data.has_messages);
|
19
19
|
$('.pending-messages-filter').removeClass('pending-messages-filter');
|
20
20
|
$('button.btn-submit').removeClass('disabled');
|
21
21
|
$('.pending-messages-text').remove();
|
@@ -53,7 +53,7 @@ mumuki.load(() => {
|
|
53
53
|
function renderHTML(data) {
|
54
54
|
$container.empty();
|
55
55
|
$container.html(data);
|
56
|
-
$("a[data-target='#messages']").click();
|
56
|
+
$("a[data-bs-target='#messages']").click();
|
57
57
|
}
|
58
58
|
|
59
59
|
function success(data) {
|
@@ -34,14 +34,14 @@ mumuki.ModalCarrousel = (() => {
|
|
34
34
|
const $close = $('.mu-kids-modal-button.mu-close');
|
35
35
|
const $footer = $('.modal-footer');
|
36
36
|
const isLastChild = this._activeSlide().is(':last-child');
|
37
|
-
this._addClassIf($next, '
|
38
|
-
this._addClassIf($close, '
|
39
|
-
this._addClassIf($footer, '
|
37
|
+
this._addClassIf($next, 'd-none', () => isLastChild);
|
38
|
+
this._addClassIf($close, 'd-none', () => !isLastChild);
|
39
|
+
this._addClassIf($footer, 'd-none', () => !isLastChild);
|
40
40
|
}
|
41
41
|
|
42
42
|
_hidePreviousButtonIfFirstSlide() {
|
43
43
|
const $prev = $('.mu-kids-modal-button.mu-previous');
|
44
|
-
this._addClassIf($prev, '
|
44
|
+
this._addClassIf($prev, 'd-none', () => this._activeSlide().is(':first-child'));
|
45
45
|
}
|
46
46
|
|
47
47
|
_showFirstSlide() {
|
@@ -28,7 +28,7 @@ mumuki.load(() => {
|
|
28
28
|
}
|
29
29
|
|
30
30
|
get isSelected() {
|
31
|
-
return this.tab.hasClass("active");
|
31
|
+
return this.tab.children().first().hasClass("active");
|
32
32
|
}
|
33
33
|
|
34
34
|
setUpOnRemove(handler) {
|
@@ -58,12 +58,12 @@ mumuki.load(() => {
|
|
58
58
|
|
59
59
|
_selectElement(element) {
|
60
60
|
element.addClass('active');
|
61
|
-
element.addClass('
|
61
|
+
element.addClass('show');
|
62
62
|
}
|
63
63
|
|
64
64
|
_unselectElement(element) {
|
65
65
|
element.removeClass('active');
|
66
|
-
element.removeClass('
|
66
|
+
element.removeClass('show');
|
67
67
|
}
|
68
68
|
}
|
69
69
|
|
@@ -135,6 +135,13 @@ mumuki.load(() => {
|
|
135
135
|
});
|
136
136
|
}
|
137
137
|
|
138
|
+
resetEditor() {
|
139
|
+
const defaultContents = this._getDataFromHiddenInput('#multifile-default-content');
|
140
|
+
mumuki.page.editors.each(function (i, editor) {
|
141
|
+
editor.getDoc().setValue(defaultContents[i] ? defaultContents[i].content : '');
|
142
|
+
});
|
143
|
+
}
|
144
|
+
|
138
145
|
_addFile() {
|
139
146
|
let name = prompt(this.locales.insert_file_name);
|
140
147
|
const alreadyExists = this.files.toArray().some(it => it.name === name);
|
@@ -157,14 +164,18 @@ mumuki.load(() => {
|
|
157
164
|
const previousIndex = Math.max(index - 1, 0);
|
158
165
|
|
159
166
|
const wasSelected = file.remove();
|
160
|
-
if (wasSelected)
|
167
|
+
if (wasSelected) {
|
168
|
+
this.tabs.children()[previousIndex].click();
|
169
|
+
}
|
161
170
|
|
162
171
|
this.updateButtonsVisibility();
|
163
172
|
}
|
164
173
|
|
165
174
|
_createTab(name, id) {
|
166
175
|
const tab = this.tabs.last().clone();
|
167
|
-
tab.
|
176
|
+
let link = tab.children().first();
|
177
|
+
link.attr('data-bs-target', `#${id}`);
|
178
|
+
link.removeClass('active');
|
168
179
|
|
169
180
|
return tab;
|
170
181
|
}
|
@@ -184,6 +195,8 @@ mumuki.load(() => {
|
|
184
195
|
.setupLanguage(highlightMode)
|
185
196
|
.build();
|
186
197
|
|
198
|
+
mumuki.page.editors.push(codeMirrorEditor);
|
199
|
+
|
187
200
|
codeMirrorEditor.on("change", (event) => {
|
188
201
|
textarea.val(event.getValue());
|
189
202
|
});
|
@@ -60,7 +60,7 @@ mumuki.MultipleScenarios = (() => {
|
|
60
60
|
this.createControls();
|
61
61
|
this.createIndicators();
|
62
62
|
this.setActiveIndex(0);
|
63
|
-
$('.mu-scenario-control').removeClass('
|
63
|
+
$('.mu-scenario-control').removeClass('d-none');
|
64
64
|
}
|
65
65
|
|
66
66
|
validScenarioIndex (index) {
|
@@ -0,0 +1,32 @@
|
|
1
|
+
mumuki.organization = {
|
2
|
+
|
3
|
+
/**
|
4
|
+
* The current organization's id
|
5
|
+
*
|
6
|
+
* @type {number?}
|
7
|
+
* */
|
8
|
+
_id: null,
|
9
|
+
|
10
|
+
/**
|
11
|
+
* The current organization's id
|
12
|
+
*
|
13
|
+
* @type {number?}
|
14
|
+
* */
|
15
|
+
get id() {
|
16
|
+
return this._id;
|
17
|
+
},
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Set global current organization information
|
21
|
+
*/
|
22
|
+
load() {
|
23
|
+
const $muOrganizationId = $('#mu-organization-id');
|
24
|
+
if ($muOrganizationId.length) {
|
25
|
+
this._id = $muOrganizationId.val();
|
26
|
+
} else {
|
27
|
+
this._id = null;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
};
|
31
|
+
|
32
|
+
mumuki.load(() => mumuki.organization.load());
|
@@ -79,12 +79,12 @@ mumuki.load(() => {
|
|
79
79
|
|
80
80
|
this._$speechTabs.each((i) => {
|
81
81
|
const $tab = $(this._$speechTabs[i]);
|
82
|
-
if ($tab.data('target')) {
|
82
|
+
if ($tab.data('bs-target')) {
|
83
83
|
$tab.click(() => {
|
84
84
|
this._$speechTabs.removeClass('active');
|
85
85
|
$tab.addClass('active');
|
86
86
|
this._$texts.hide();
|
87
|
-
this.$characterSpeechBubbleNormal.children('.' + $tab.data('target')).show();
|
87
|
+
this.$characterSpeechBubbleNormal.children('.' + $tab.data('bs-target')).show();
|
88
88
|
this._updateSpeechParagraphs();
|
89
89
|
});
|
90
90
|
}
|
@@ -151,7 +151,7 @@ mumuki.load(() => {
|
|
151
151
|
const $bubble = this.$characterSpeechBubble;
|
152
152
|
$bubble.find('.mu-kids-character-speech-bubble-tabs').show();
|
153
153
|
$bubble.find('.mu-kids-character-speech-bubble-normal').show();
|
154
|
-
$bubble.find('.mu-kids-character-speech-bubble-failed').
|
154
|
+
$bubble.find('.mu-kids-character-speech-bubble-failed').addClass('d-none').removeClass('d-block');
|
155
155
|
$bubble.find('.mu-kids-discussion-link').remove();
|
156
156
|
Object.keys(this.resultActions).forEach($bubble.removeClass.bind($bubble));
|
157
157
|
}
|
@@ -225,7 +225,7 @@ mumuki.load(() => {
|
|
225
225
|
}
|
226
226
|
|
227
227
|
_getSelectedTabName() {
|
228
|
-
return this._$speechTabs.filter('.active').data('target') || 'description';
|
228
|
+
return this._$speechTabs.filter('.active').data('bs-target') || 'description';
|
229
229
|
}
|
230
230
|
|
231
231
|
}
|
@@ -72,12 +72,6 @@ mumuki.load(function() {
|
|
72
72
|
form.append(`<input type="hidden" name="user[avatar_type]" value="${type}"/>`);
|
73
73
|
}
|
74
74
|
|
75
|
-
$("#mu-edit-avatar-icon").on('keypress click', function(e) {
|
76
|
-
onClickOrSpacebarOrEnter($(this), e, function() {
|
77
|
-
$avatarPicker.modal();
|
78
|
-
});
|
79
|
-
});
|
80
|
-
|
81
75
|
function onClickOrSpacebarOrEnter(element, e, func) {
|
82
76
|
if (e.which === 13 || e.which === 32 || e.type === 'click') {
|
83
77
|
func.apply(element);
|
@@ -6,7 +6,7 @@ mumuki.progress = (() => {
|
|
6
6
|
* */
|
7
7
|
function updateProgressBarAndShowModal(data) {
|
8
8
|
$('.progress-list-item.active').attr('class', data.class_for_progress_list_item);
|
9
|
-
if(data.guide_finished_by_solution)
|
9
|
+
if(data.guide_finished_by_solution) new bootstrap.Modal('#guide-done').show();
|
10
10
|
}
|
11
11
|
|
12
12
|
/**
|
@@ -87,7 +87,7 @@ mumuki.renderers.speechBubble = (()=> {
|
|
87
87
|
render() {
|
88
88
|
this.$bubble.find('.mu-kids-character-speech-bubble-tabs').hide();
|
89
89
|
this.$bubble.find('.mu-kids-character-speech-bubble-normal').hide();
|
90
|
-
this.$failedArea.
|
90
|
+
this.$failedArea.removeClass('d-none').addClass('d-block').html(this.responseData.title_html);
|
91
91
|
this._addClass(this._responseStatus());
|
92
92
|
this._chooseResultItem();
|
93
93
|
this._appendDiscussionsLinkHtml();
|
@@ -20,7 +20,7 @@ mumuki.submission = (() => {
|
|
20
20
|
}
|
21
21
|
waiting() {
|
22
22
|
this.submissionsResultsArea.html(this.processingTemplate.html());
|
23
|
-
this.submissionsErrorTemplate.
|
23
|
+
this.submissionsErrorTemplate.addClass('d-none');
|
24
24
|
}
|
25
25
|
success(data, submitButton) {
|
26
26
|
this.submissionsResultsArea.html(data.html);
|
@@ -30,7 +30,8 @@ mumuki.submission = (() => {
|
|
30
30
|
}
|
31
31
|
error(submitButton) {
|
32
32
|
this.submissionsResultsArea.html('');
|
33
|
-
this.submissionsErrorTemplate.
|
33
|
+
this.submissionsErrorTemplate.addClass('d-block');
|
34
|
+
this.submissionsErrorTemplate.removeClass('d-none');
|
34
35
|
animateTimeoutError(submitButton);
|
35
36
|
}
|
36
37
|
done(data, submitButton) {
|
@@ -69,7 +70,7 @@ mumuki.submission = (() => {
|
|
69
70
|
.done((data) => resultsBox.success(data, this))
|
70
71
|
.fail(() => resultsBox.error(this))
|
71
72
|
.always((data) => {
|
72
|
-
$(document).renderMuComponents();
|
73
|
+
$(document).renderMuComponents({ webBrowser: { allowScript: true } });
|
73
74
|
resultsBox.done(data, this);
|
74
75
|
});
|
75
76
|
}
|