Skip to content

Commit

Permalink
Add deprecated recit editor classes
Browse files Browse the repository at this point in the history
  • Loading branch information
emilevirus committed Jun 3, 2022
1 parent 7d4bf23 commit b1e2291
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/classes/output/core_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ public function standard_head_html() {
// force le chargement du fichier js du thème de base RÉCIT
$PAGE->requires->js('/theme/recit2/js/theme-recit2-navsection.js');
$PAGE->requires->js('/theme/recit2/js/theme-recit2.js');
$PAGE->requires->js('/theme/recit2/js/theme-legacy.js');
$PAGE->requires->js('/theme/recit2/js/theme-recit2-init-vars.js');
$PAGE->requires->js_init_call('theme_recit2_init_vars', array($settings));

Expand Down
37 changes: 37 additions & 0 deletions src/js/theme-legacy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//RECIT Editor JS from before Moodle Approval



document.body.addEventListener('click',function(e){
if(e.target && e.target.classList.contains('videobtn')){
let url = e.target.getAttribute('data-videourl');
if (url){
let iframe = document.createElement('iframe');
iframe.src = url;
new M.recit.reciteditor.Popup(iframe);
}
e.preventDefault();
}else if(e.target && e.target.classList.contains('r_img-popup')){
let url = e.target.src;
if (url){
let img = document.createElement('img');
img.src = url;
new M.recit.reciteditor.Popup(img);
}
e.preventDefault();
}else if(e.target && e.target.matches('.flipcard2 *')){ //Check if user clicked on a flipcard or its children
let el = e.target;
while (el = el.parentElement){
if (el.classList.contains('flipcard2')){
break;
}
}
if (!el) return;
if(el.classList.contains("hover2")){
el.classList.remove('hover2');
}else{
el.classList.add('hover2');
}
e.preventDefault();
}
});
28 changes: 28 additions & 0 deletions src/scss/deprecated/_reciteditor.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* classes of before moodle approval */

/* Start RÉCIT Éditor */
.row-fluid { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; margin-right: -15px; margin-left: -15px; }

/* Popup */
.r_popup, .r_popup .modal-dialog { max-width: 100vw; max-height: 100vh; width: fit-content; width: -moz-fit-content; margin: auto;}
.r_popup .modal-body { padding: 0; overflow: hidden; }
.r_popup iframe { width: 90vw; height: 85vh; border: 0; }
.r_popup img { max-height: 85vh; max-width: 90vw; }

.img-popup { cursor: pointer; }

/* Image cliquable */
.imgclick { text-align: center; position: relative; overflow: hidden; width: fit-content; width: -moz-fit-content; }
.imgclick img { -webkit-transition: all 0.4s linear; transition: all 0.4s linear; }
.imgclick a, .imgclick a:hover { display: block; color: #fff; }
.imgclick .imgclickcontent { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.imgclick:hover img { transform: scale(1.1); filter: brightness(50%); }
.imgclick:hover .imgclickcontent { display: block; }

/* Flipcard */
.flipcard2 { cursor: pointer; perspective: 1000px;}
.flipcard2 .flipcard-inner { position: relative; width: 100%; height: 100%; text-align: center; transition: transform 0.6s; transform-style: preserve-3d; box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);}
.flipcard2.hover2 .flipcard-inner { transform: rotateY(180deg);}
.flipcard2 .back, .flipcard2 .front { width: 100%; height: 100%; -webkit-backface-visibility: hidden; /* Safari */ backface-visibility: hidden;}
.flipcard2 .back { position: absolute; top: 0px; transform: rotateY(180deg);}
/* End RÉCIT Éditor */
1 change: 0 additions & 1 deletion src/scss/recit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
//@import "../scss/recit/variables";
// the import file is useful to resolve all the other files dependencies and include all of them here
@import "./recit/import";

3 changes: 2 additions & 1 deletion src/scss/recit/_import.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@
@import "theme-vars";
@import "responsive-mobile";
@import "responsive-tablet";
@import "navsections";
@import "navsections";
@import "../deprecated/reciteditor"; //CSS classes before Moodle approval
2 changes: 1 addition & 1 deletion src/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$plugin->component = 'theme_recit2';

// This is the named version.
$plugin->release = 'v2.1.5';
$plugin->release = 'v2.1.6';

// This is a stable release.
$plugin->maturity = MATURITY_ALPHA;
Expand Down

0 comments on commit b1e2291

Please sign in to comment.