mumuki-laboratory 9.0.6 → 9.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/mumuki_laboratory/application/discussions.js +10 -10
  3. data/app/assets/javascripts/mumuki_laboratory/application/gamification.js +3 -3
  4. data/app/assets/javascripts/mumuki_laboratory/application/kids.js +11 -7
  5. data/app/assets/javascripts/mumuki_laboratory/application/kindergarten.js +3 -3
  6. data/app/assets/javascripts/mumuki_laboratory/application/messages.js +3 -3
  7. data/app/assets/javascripts/mumuki_laboratory/application/mu-modal-carrousel.js +4 -4
  8. data/app/assets/javascripts/mumuki_laboratory/application/multiple-files.js +12 -6
  9. data/app/assets/javascripts/mumuki_laboratory/application/multiple-scenarios.js +1 -1
  10. data/app/assets/javascripts/mumuki_laboratory/application/primary.js +4 -4
  11. data/app/assets/javascripts/mumuki_laboratory/application/profile.js +0 -6
  12. data/app/assets/javascripts/mumuki_laboratory/application/progress.js +1 -1
  13. data/app/assets/javascripts/mumuki_laboratory/application/speech-bubble-renderer.js +1 -1
  14. data/app/assets/javascripts/mumuki_laboratory/application/submission.js +4 -3
  15. data/app/assets/javascripts/mumuki_laboratory/application/toast.js +3 -0
  16. data/app/assets/javascripts/mumuki_laboratory/application/tooltip.js +1 -1
  17. data/app/assets/javascripts/mumuki_laboratory/application/upload.js +2 -2
  18. data/app/assets/stylesheets/mumuki_laboratory/application.scss +0 -1
  19. data/app/assets/stylesheets/mumuki_laboratory/application/_errors.scss +1 -1
  20. data/app/assets/stylesheets/mumuki_laboratory/application/_layout.scss +1 -27
  21. data/app/assets/stylesheets/mumuki_laboratory/application/_modules.scss +0 -2
  22. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_activity.scss +7 -5
  23. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_avatar.scss +5 -0
  24. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_breadcrumb.scss +2 -2
  25. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_datepicker.scss +0 -4
  26. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_discussion.scss +38 -60
  27. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_editor.scss +16 -18
  28. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_exercise_assignment.scss +2 -11
  29. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_exercise_results.scss +1 -7
  30. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_faqs.scss +3 -3
  31. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_flash.scss +7 -46
  32. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids.scss +19 -4
  33. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids_results.scss +18 -23
  34. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kindergarten.scss +1 -9
  35. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_overlap.scss +1 -1
  36. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_progress_bar.scss +5 -5
  37. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_timer.scss +1 -3
  38. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_menu.scss +13 -6
  39. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_profile.scss +0 -2
  40. data/app/controllers/application_controller.rb +4 -2
  41. data/app/controllers/discussions_messages_controller.rb +3 -1
  42. data/app/helpers/application_helper.rb +5 -5
  43. data/app/helpers/assignment_result_helper.rb +3 -2
  44. data/app/helpers/assistance_box_helper.rb +1 -1
  45. data/app/helpers/concerns/with_student_path_navigation.rb +8 -3
  46. data/app/helpers/concerns/with_student_path_navigation/continue_navigation.rb +1 -1
  47. data/app/helpers/concerns/with_student_path_navigation/finish_navigation.rb +1 -1
  48. data/app/helpers/concerns/with_student_path_navigation/next_parent_navigation.rb +7 -0
  49. data/app/helpers/concerns/with_student_path_navigation/revisit_navigation.rb +1 -1
  50. data/app/helpers/discussions_helper.rb +61 -24
  51. data/app/helpers/editor_tabs_helper.rb +10 -6
  52. data/app/helpers/email_helper.rb +2 -2
  53. data/app/helpers/exercise_input_helper.rb +2 -3
  54. data/app/helpers/links_helper.rb +12 -9
  55. data/app/helpers/menu_bar_helper.rb +1 -1
  56. data/app/helpers/messages_helper.rb +1 -1
  57. data/app/helpers/overlapped_buttons_helper.rb +22 -12
  58. data/app/helpers/profile_helper.rb +3 -3
  59. data/app/helpers/toast_helper.rb +27 -0
  60. data/app/helpers/user_activity_helper.rb +1 -1
  61. data/app/views/book/show.html.erb +2 -2
  62. data/app/views/certificates/verify.html.erb +1 -1
  63. data/app/views/chapters/show.html.erb +2 -2
  64. data/app/views/discussions/_message.html.erb +31 -6
  65. data/app/views/discussions/_new_message.html.erb +4 -4
  66. data/app/views/discussions/index.html.erb +8 -10
  67. data/app/views/discussions/new.html.erb +1 -1
  68. data/app/views/discussions/show.html.erb +20 -12
  69. data/app/views/exam_registrations/show.html.erb +10 -11
  70. data/app/views/exercise_solutions/_assistant_rules_box.html.erb +1 -1
  71. data/app/views/exercise_solutions/_contextualization_results_body.html.erb +1 -1
  72. data/app/views/exercise_solutions/_contextualization_results_container.html.erb +1 -1
  73. data/app/views/exercise_solutions/_kids_results_button.html.erb +2 -2
  74. data/app/views/exercise_solutions/_results.html.erb +1 -1
  75. data/app/views/exercises/_exercise_assignment.html.erb +2 -2
  76. data/app/views/exercises/_exercise_skipped.html.erb +1 -1
  77. data/app/views/exercises/_read_only.html.erb +108 -105
  78. data/app/views/exercises/show.html.erb +7 -7
  79. data/app/views/guides/_guide.html.erb +1 -1
  80. data/app/views/guides/_guide_container.html.erb +4 -4
  81. data/app/views/invitations/_invitation_form.html.erb +5 -4
  82. data/app/views/layouts/_authoring.html.erb +1 -1
  83. data/app/views/layouts/_discussions.html.erb +7 -7
  84. data/app/views/layouts/_kids.html.erb +5 -5
  85. data/app/views/layouts/_kindergarten.html.erb +10 -6
  86. data/app/views/layouts/_main.html.erb +6 -10
  87. data/app/views/layouts/_organizations_listing.html.erb +2 -2
  88. data/app/views/layouts/_progress_bar.html.erb +2 -0
  89. data/app/views/layouts/_submission_result_error.html.erb +1 -1
  90. data/app/views/layouts/_test_results.html.erb +1 -1
  91. data/app/views/layouts/_timer.html.erb +1 -1
  92. data/app/views/layouts/_user_menu.html.erb +3 -3
  93. data/app/views/layouts/application.html.erb +39 -42
  94. data/app/views/layouts/exercise_inputs/editors/_code.html.erb +4 -4
  95. data/app/views/layouts/exercise_inputs/editors/_free_form.html.erb +1 -1
  96. data/app/views/layouts/exercise_inputs/editors/_multiple_choice.html.erb +7 -9
  97. data/app/views/layouts/exercise_inputs/editors/_multiple_files.html.erb +10 -10
  98. data/app/views/layouts/exercise_inputs/editors/_single_choice.html.erb +6 -8
  99. data/app/views/layouts/exercise_inputs/editors/_text.html.erb +2 -3
  100. data/app/views/layouts/exercise_inputs/editors/_upload.html.erb +5 -5
  101. data/app/views/layouts/exercise_inputs/forms/_form.html.erb +1 -1
  102. data/app/views/layouts/exercise_inputs/forms/_interactive_form.html.erb +2 -2
  103. data/app/views/layouts/exercise_inputs/forms/_kids_form.html.erb +1 -1
  104. data/app/views/layouts/exercise_inputs/forms/_playground_form.html.erb +2 -2
  105. data/app/views/layouts/exercise_inputs/forms/_problem_form.html.erb +13 -9
  106. data/app/views/layouts/exercise_inputs/layouts/_input_primary.html.erb +2 -2
  107. data/app/views/layouts/exercise_inputs/layouts/_input_right.html.erb +2 -2
  108. data/app/views/layouts/exercise_inputs/read_only_editors/_code.html.erb +1 -1
  109. data/app/views/layouts/exercise_inputs/read_only_editors/_free_form.html.erb +1 -1
  110. data/app/views/layouts/exercise_inputs/read_only_editors/_multiple_choice.html.erb +4 -4
  111. data/app/views/layouts/exercise_inputs/read_only_editors/_multiple_files.html.erb +2 -2
  112. data/app/views/layouts/exercise_inputs/read_only_editors/_single_choice.html.erb +4 -4
  113. data/app/views/layouts/exercise_inputs/read_only_editors/_text.erb +1 -1
  114. data/app/views/layouts/modals/_avatar_picker.html.erb +2 -5
  115. data/app/views/layouts/modals/_guide_corollary.html.erb +4 -8
  116. data/app/views/layouts/modals/_kids_context.html.erb +7 -5
  117. data/app/views/layouts/modals/_kids_results.html.erb +2 -2
  118. data/app/views/layouts/modals/_kids_results_aborted.html.erb +2 -2
  119. data/app/views/layouts/modals/_kindergarten_context.html.erb +3 -3
  120. data/app/views/layouts/modals/_kindergarten_results.html.erb +3 -3
  121. data/app/views/layouts/modals/_kindergarten_results_aborted.html.erb +2 -2
  122. data/app/views/layouts/modals/_level_up.html.erb +2 -5
  123. data/app/views/layouts/modals/_new_message.html.erb +5 -5
  124. data/app/views/notifications/_dropdown.html.erb +3 -3
  125. data/app/views/users/_activity_indicator.html.erb +14 -14
  126. data/app/views/users/_edit_user_form.html.erb +6 -6
  127. data/app/views/users/_profile_fields.html.erb +6 -6
  128. data/app/views/users/_user_form.html.erb +2 -2
  129. data/app/views/users/activity.html.erb +29 -29
  130. data/app/views/users/certificates.html.erb +26 -24
  131. data/app/views/users/discussions.html.erb +23 -21
  132. data/app/views/users/messages.html.erb +22 -20
  133. data/app/views/users/show.html.erb +5 -3
  134. data/app/views/users/terms.html.erb +4 -2
  135. data/lib/mumuki/laboratory.rb +1 -1
  136. data/lib/mumuki/laboratory/locales/en.yml +15 -1
  137. data/lib/mumuki/laboratory/locales/es-CL.yml +15 -1
  138. data/lib/mumuki/laboratory/locales/es.yml +15 -1
  139. data/lib/mumuki/laboratory/locales/pt.yml +15 -2
  140. data/lib/mumuki/laboratory/version.rb +1 -1
  141. data/spec/capybara_helper.rb +1 -0
  142. data/spec/controllers/discussions_messages_controller_spec.rb +64 -2
  143. data/spec/dummy/db/schema.rb +4 -0
  144. data/spec/features/discussion_flow_spec.rb +20 -2
  145. data/spec/features/exercise_flow_spec.rb +1 -1
  146. data/spec/features/guide_reset_spec.rb +1 -1
  147. data/spec/features/terms_flow_spec.rb +1 -2
  148. data/spec/helpers/breadcrumbs_helper_spec.rb +2 -2
  149. data/spec/helpers/with_navigation_spec.rb +36 -13
  150. data/spec/javascripts/editors-spec.js +3 -3
  151. data/spec/javascripts/kids-button-spec.js +2 -2
  152. data/spec/javascripts/upload-spec.js +8 -8
  153. metadata +114 -114
  154. data/app/assets/stylesheets/mumuki_laboratory/application/hovers.scss +0 -12
  155. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_checkboxes.scss +0 -34
  156. 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: 1923025a623999bd5e8c2c802f024660f71d980865e5b436cfdf7ee27a361445
4
- data.tar.gz: 368eace9064bfe944f5abecce4f36c5b5f55e15f08f3d7ee949eca7033adb0c2
3
+ metadata.gz: 42ddcb38b3d3ff241bc81dd9b18c22afaf7a2078d3064e5e9e888155b3e16226
4
+ data.tar.gz: 0b244643dd954e25ca038c79d71fb79cf58a5bffd915d8824ac72ccaf49a920d
5
5
  SHA512:
6
- metadata.gz: 126c58ab5c3d42c0055c85886cfdb49ae6714b797c7b2fb206417f97cdfd3bf3edd14bd66f268acc1ad79fcb1f6fa659073522a8ed91726ceda9a84fbee7b4a2
7
- data.tar.gz: 43e8f6368254c0dff68d2194a68d7a4511c2732226463d1a77ba6e0cfe76b6b0ee0610a096480fc116ad8feec491a457657296316ab2b4e6039e72b5ec7883d3
6
+ metadata.gz: 52ec0f9e2703a88efe4949706020b6bb83516252ab389faecd8c838ce6094faa40149bdb7d5573d95b9ad9e6d7909bd0b3f03cd0f3787925f6e37eebfd5bed6b
7
+ data.tar.gz: 6b7412a1b79947d6426f43edb5f5c50163671658227281aa94676b77abf870f1695925310a64dfa5a9d37f13f797dd4f96587c19922c28f8d043dd6c7982d708
@@ -1,6 +1,6 @@
1
1
  mumuki.load(() => {
2
- var $subscriptionSpans = $('.discussion-subscription > span');
3
- var $upvoteSpans = $('.discussion-upvote > span');
2
+ var $subscriptionButtons = $('.discussion-subscription > button');
3
+ var $upvoteButtons = $('.discussion-upvote > button');
4
4
  let $messagePreviewButton = $('.discussion-new-message-preview-button.preview');
5
5
  let $messageEditButton = $('.discussion-new-message-preview-button.edit');
6
6
  let $newMessageContent = $('.discussion-new-message-content');
@@ -33,8 +33,8 @@ mumuki.load(() => {
33
33
  let editor = createNewMessageEditor();
34
34
 
35
35
  var Forum = {
36
- toggleButton: function (spans) {
37
- spans.toggleClass('hidden');
36
+ toggleButton: function (elements) {
37
+ elements.toggleClass('d-none');
38
38
  },
39
39
  token: new mumuki.CsrfToken(),
40
40
  tokenRequest: function (data) {
@@ -48,10 +48,10 @@ mumuki.load(() => {
48
48
  });
49
49
  },
50
50
  discussionSubscription: function (url) {
51
- Forum.discussionPostAndToggle(url, $subscriptionSpans);
51
+ Forum.discussionPostAndToggle(url, $subscriptionButtons);
52
52
  },
53
53
  discussionUpvote: function (url) {
54
- Forum.discussionPostAndToggle(url, $upvoteSpans);
54
+ Forum.discussionPostAndToggle(url, $upvoteButtons);
55
55
  },
56
56
  discussionPostAndToggle: function (url, elem) {
57
57
  Forum.discussionPost(url).done(Forum.toggleButton(elem));
@@ -102,13 +102,13 @@ mumuki.load(() => {
102
102
  }
103
103
 
104
104
  function togglePreviewAndEditButtons() {
105
- $messagePreviewButton.toggleClass('hidden');
106
- $messageEditButton.toggleClass('hidden');
105
+ $messagePreviewButton.toggleClass('d-none');
106
+ $messageEditButton.toggleClass('d-none');
107
107
  }
108
108
 
109
109
  function togglePreviewAndContentMessage() {
110
- $newMessagePreview.toggleClass('hidden');
111
- $newMessageContent.toggleClass('hidden');
110
+ $newMessagePreview.toggleClass('d-none');
111
+ $newMessageContent.toggleClass('d-none');
112
112
  }
113
113
 
114
114
  mumuki.Forum = Forum;
@@ -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('hidden');
85
+ $('#mu-exp-earned-message').removeClass('d-none');
86
86
  }
87
87
 
88
88
  defaultLevelUpAction(_levelUpHtml) {
89
- $('#mu-level-up').modal();
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
- this.$contextModal.modal({
55
- backdrop: 'static',
56
- keyboard: false
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
- this.$resultsAbortedModal.modal();
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
- this.$resultsModal.modal({ backdrop: 'static', keyboard: false });
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(() => this.$resultsModal.modal('hide'));
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('hidden');
120
- $button.find(`.mu-kindergarten-${remove}`).removeClass('hidden');
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('hidden');
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('hidden');
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('notifications-box-empty', !data.has_messages);
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, 'hidden', () => isLastChild);
38
- this._addClassIf($close, 'hidden', () => !isLastChild);
39
- this._addClassIf($footer, 'hidden', () => !isLastChild);
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, 'hidden', () => this._activeSlide().is(':first-child'));
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('in');
61
+ element.addClass('show');
62
62
  }
63
63
 
64
64
  _unselectElement(element) {
65
65
  element.removeClass('active');
66
- element.removeClass('in');
66
+ element.removeClass('show');
67
67
  }
68
68
  }
69
69
 
@@ -138,7 +138,7 @@ mumuki.load(() => {
138
138
  resetEditor() {
139
139
  const defaultContents = this._getDataFromHiddenInput('#multifile-default-content');
140
140
  mumuki.page.editors.each(function (i, editor) {
141
- editor.getDoc().setValue(defaultContents[i].content);
141
+ editor.getDoc().setValue(defaultContents[i] ? defaultContents[i].content : '');
142
142
  });
143
143
  }
144
144
 
@@ -164,14 +164,18 @@ mumuki.load(() => {
164
164
  const previousIndex = Math.max(index - 1, 0);
165
165
 
166
166
  const wasSelected = file.remove();
167
- if (wasSelected) this.files[previousIndex].select();
167
+ if (wasSelected) {
168
+ this.tabs.children()[previousIndex].click();
169
+ }
168
170
 
169
171
  this.updateButtonsVisibility();
170
172
  }
171
173
 
172
174
  _createTab(name, id) {
173
175
  const tab = this.tabs.last().clone();
174
- tab.attr('data-target', `#${id}`);
176
+ let link = tab.children().first();
177
+ link.attr('data-bs-target', `#${id}`);
178
+ link.removeClass('active');
175
179
 
176
180
  return tab;
177
181
  }
@@ -191,6 +195,8 @@ mumuki.load(() => {
191
195
  .setupLanguage(highlightMode)
192
196
  .build();
193
197
 
198
+ mumuki.page.editors.push(codeMirrorEditor);
199
+
194
200
  codeMirrorEditor.on("change", (event) => {
195
201
  textarea.val(event.getValue());
196
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('hidden');
63
+ $('.mu-scenario-control').removeClass('d-none');
64
64
  }
65
65
 
66
66
  validScenarioIndex (index) {
@@ -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').hide();
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) $('#guide-done').modal();
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.show().html(this.responseData.title_html);
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.hide();
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.show();
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
  }
@@ -0,0 +1,3 @@
1
+ mumuki.load(() => {
2
+ document.querySelectorAll('.toast').forEach((toast) => new bootstrap.Toast(toast).show());
3
+ });
@@ -1,3 +1,3 @@
1
1
  mumuki.load(() => {
2
- $('[title]').tooltip();
2
+ document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach((tooltip) => new bootstrap.Tooltip(tooltip));
3
3
  });
@@ -35,14 +35,14 @@ mumuki.upload = (() => {
35
35
  }
36
36
 
37
37
  showFileExceedsMaxSize() {
38
- this.$uploadFileLimitExceeded.removeClass('hidden');
38
+ this.$uploadFileLimitExceeded.removeClass('d-none');
39
39
  this.$uploadLabel.text(this.$uploadLabelText);
40
40
  this.$uploadIcon.addClass('fa-upload').removeClass('fa-file-alt');
41
41
  this.$btnSubmit.addClass('disabled');
42
42
  }
43
43
 
44
44
  allowSubmissionFor(filename) {
45
- this.$uploadFileLimitExceeded.addClass('hidden');
45
+ this.$uploadFileLimitExceeded.addClass('d-none');
46
46
  this.$uploadLabel.text(filename);
47
47
  this.$uploadIcon.removeClass('fa-upload').addClass('fa-file-alt');
48
48
  this.$btnSubmit.removeClass('disabled');
@@ -8,7 +8,6 @@ $da-font-path: asset-path('assets');
8
8
  @import "application/vendor";
9
9
  @import "application/locked";
10
10
  @import "application/tooltip";
11
- @import "application/hovers";
12
11
  @import "application/mixins";
13
12
  @import "application/layout";
14
13
  @import "application/invitations";
@@ -19,7 +19,7 @@
19
19
  width: calc(100%);
20
20
  object-position: 50% 50%;
21
21
  overflow: hidden;
22
- @media (max-width: $screen-lg) {
22
+ @include media-breakpoint-down(xl) {
23
23
  object-fit: none;
24
24
  }
25
25
  }
@@ -1,8 +1,3 @@
1
- html {
2
- position: relative;
3
- min-height: 100%;
4
- }
5
-
6
1
  .navbar-brand {
7
2
  padding-top: 0;
8
3
  padding-bottom: 0;
@@ -21,10 +16,6 @@ html {
21
16
  }
22
17
  }
23
18
 
24
- body {
25
- margin-bottom: 110px;
26
- }
27
-
28
19
  .mu-footer {
29
20
  &.container {
30
21
  margin-top: 45px;
@@ -76,17 +67,12 @@ body {
76
67
 
77
68
  .editor-tab {
78
69
  padding: 5px 10px 5px 10px !important;
79
- cursor: pointer;
80
70
  }
81
71
 
82
72
  .mu-input-panel {
83
73
  margin-top: 5px;
84
74
  }
85
75
 
86
- h1 {
87
- margin-top: 10px;
88
- }
89
-
90
76
  .text-box {
91
77
  text-align: justify;
92
78
 
@@ -123,16 +109,8 @@ hr {
123
109
  /* TODO: move to mumuki-styles */
124
110
  .mu-inline-block-left {
125
111
  display: flex;
112
+ flex-grow: 1;
126
113
  align-items: center;
127
-
128
- margin-left: 15px;
129
- }
130
-
131
- .mu-inline-block-right {
132
- float: right !important;
133
- display: inline-block;
134
- margin-right: 15px;
135
- margin-left: 10px;
136
114
  }
137
115
 
138
116
  .mu-org-link {
@@ -147,7 +125,3 @@ hr {
147
125
  padding: 0;
148
126
  }
149
127
  }
150
-
151
- h3 {
152
- margin-top: 20px;
153
- }