-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5528 from AngelFQC/BT21588
LP: Refactoring viewer styles
- Loading branch information
Showing
13 changed files
with
719 additions
and
819 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { createPinia, setActivePinia } from 'pinia' | ||
import { createPinia, setActivePinia } from "pinia" | ||
import translateHtml from "./../translatehtml.js" | ||
|
||
const pinia = createPinia() | ||
setActivePinia(pinia) | ||
|
||
import translateHtml from './../translatehtml.js' | ||
document.addEventListener('DOMContentLoaded', function () { | ||
document.addEventListener("DOMContentLoaded", function () { | ||
translateHtml() | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
// Script to be added in the exercises tool. | ||
import 'jsplumb'; | ||
import 'jquery-ui-touch-punch'; | ||
import 'signature_pad'; | ||
import '../../../public/main/inc/lib/javascript/epiclock/javascript/jquery.dateformat.min.js'; | ||
import '../../../public/main/inc/lib/javascript/epiclock/javascript/jquery.epiclock.js'; | ||
import '../../../public/main/inc/lib/javascript/epiclock/renderers/minute/epiclock.minute.js'; | ||
import './annotation' | ||
import '../../../public/main/inc/lib/javascript/hotspot/js/hotspot.js'; | ||
import '../../../public/main/inc/lib/javascript/d3/jquery.xcolor.js'; | ||
import "jsplumb" | ||
import "jquery-ui-touch-punch" | ||
import "signature_pad" | ||
import "../../../public/main/inc/lib/javascript/epiclock/javascript/jquery.dateformat.min.js" | ||
import "../../../public/main/inc/lib/javascript/epiclock/javascript/jquery.epiclock.js" | ||
import "../../../public/main/inc/lib/javascript/epiclock/renderers/minute/epiclock.minute.js" | ||
import "./annotation" | ||
import "../../../public/main/inc/lib/javascript/hotspot/js/hotspot.js" | ||
import "../../../public/main/inc/lib/javascript/d3/jquery.xcolor.js" | ||
|
||
document.addEventListener("DOMContentLoaded", function() { | ||
document.addEventListener("DOMContentLoaded", function () { | ||
// Mapping French paths to their English equivalents | ||
var routeMapping = { | ||
"enregistrement-audio": "audio-recording-help" | ||
}; | ||
"enregistrement-audio": "audio-recording-help", | ||
} | ||
|
||
var currentUrlParams = new URLSearchParams(window.location.search); | ||
var cid = currentUrlParams.get('cid') || '0'; | ||
var sid = currentUrlParams.get('sid') || '0'; | ||
var gid = currentUrlParams.get('gid') || '0'; | ||
var currentUrlParams = new URLSearchParams(window.location.search) | ||
var cid = currentUrlParams.get("cid") || "0" | ||
var sid = currentUrlParams.get("sid") || "0" | ||
var gid = currentUrlParams.get("gid") || "0" | ||
|
||
var links = document.querySelectorAll('a[href*="web"]'); | ||
links.forEach(function(link) { | ||
var href = link.getAttribute("href"); | ||
var pathSegments = href.split("/"); | ||
var lastSegmentIndex = pathSegments.length - (pathSegments[pathSegments.length - 1] === '' ? 2 : 1); | ||
var lastPathSegment = pathSegments[lastSegmentIndex]; | ||
var links = document.querySelectorAll('a[href*="web"]') | ||
links.forEach(function (link) { | ||
var href = link.getAttribute("href") | ||
var pathSegments = href.split("/") | ||
var lastSegmentIndex = pathSegments.length - (pathSegments[pathSegments.length - 1] === "" ? 2 : 1) | ||
var lastPathSegment = pathSegments[lastSegmentIndex] | ||
|
||
if (lastPathSegment && routeMapping[lastPathSegment]) { | ||
var englishEquivalent = routeMapping[lastPathSegment]; | ||
var newHref = `/main/inc/ajax/exercise.ajax.php?a=${englishEquivalent}&cid=${cid}&sid=${sid}&gid=${gid}`; | ||
link.setAttribute("href", newHref); | ||
link.setAttribute("data-title", link.textContent.trim()); | ||
link.classList.add("ajax"); | ||
var englishEquivalent = routeMapping[lastPathSegment] | ||
var newHref = `/main/inc/ajax/exercise.ajax.php?a=${englishEquivalent}&cid=${cid}&sid=${sid}&gid=${gid}` | ||
link.setAttribute("href", newHref) | ||
link.setAttribute("data-title", link.textContent.trim()) | ||
link.classList.add("ajax") | ||
} | ||
}); | ||
}); | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,46 @@ | ||
|
||
/* For licensing terms, see /license.txt */ | ||
|
||
import $ from 'jquery'; | ||
|
||
window.jQuery = $; | ||
window.$ = $; | ||
global.jQuery = $; | ||
import $ from "jquery" | ||
import "jquery-ui-dist/jquery-ui.js" | ||
|
||
import 'jquery-ui-dist/jquery-ui.js'; | ||
window.jQuery = $ | ||
window.$ = $ | ||
global.jQuery = $ | ||
|
||
const frameReady = require('/public/main/inc/lib/javascript/jquery.frameready.js'); | ||
const frameReady = require("/public/main/inc/lib/javascript/jquery.frameready.js") | ||
|
||
global.frameReady = frameReady; | ||
window.frameReady = frameReady; | ||
global.frameReady = frameReady | ||
window.frameReady = frameReady | ||
|
||
var hljs = require('highlight.js'); | ||
global.hljs = hljs; | ||
var hljs = require("highlight.js") | ||
global.hljs = hljs | ||
|
||
document.addEventListener('DOMContentLoaded', (event) => { | ||
var tabLinks = document.querySelectorAll('.nav-item.nav-link'); | ||
document.addEventListener("DOMContentLoaded", (event) => { | ||
var tabLinks = document.querySelectorAll(".nav-item.nav-link") | ||
|
||
function removeActiveClasses() { | ||
tabLinks.forEach(function(link) { | ||
link.classList.remove('active'); | ||
var tabPanel = document.getElementById(link.getAttribute('aria-controls')); | ||
tabLinks.forEach(function (link) { | ||
link.classList.remove("active") | ||
var tabPanel = document.getElementById(link.getAttribute("aria-controls")) | ||
if (tabPanel) { | ||
tabPanel.classList.remove('active'); | ||
tabPanel.classList.remove("active") | ||
} | ||
}); | ||
}) | ||
} | ||
|
||
tabLinks.forEach(function(link) { | ||
link.addEventListener('click', function() { | ||
removeActiveClasses(); | ||
this.classList.add('active'); | ||
var tabContentId = this.getAttribute('aria-controls'); | ||
var tabContent = document.getElementById(tabContentId); | ||
tabLinks.forEach(function (link) { | ||
link.addEventListener("click", function () { | ||
removeActiveClasses() | ||
this.classList.add("active") | ||
var tabContentId = this.getAttribute("aria-controls") | ||
var tabContent = document.getElementById(tabContentId) | ||
if (tabContent) { | ||
tabContent.classList.add('active'); | ||
tabContent.classList.add("active") | ||
} | ||
}); | ||
}); | ||
}); | ||
}) | ||
}) | ||
|
||
document | ||
.querySelectorAll(".accordion") | ||
.forEach((accordion) => accordion.addEventListener("click", () => accordion.classList.toggle("active"))) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.