Minor: Format code - refs BT#21588

pull/5464/head
Angel Fernando Quiroz Campos 7 months ago
parent 326565fb1f
commit e743d30496
  1. 3
      src/CoreBundle/Resources/views/LearnPath/menubar.html.twig
  2. 110
      src/CoreBundle/Resources/views/LearnPath/scorm_list.html.twig
  3. 680
      src/CoreBundle/Resources/views/LearnPath/view.html.twig

@ -4,7 +4,7 @@
.c-menu-left { .c-menu-left {
top: 50% !important; top: 50% !important;
} }
.menu-button a{ .menu-button a {
text-underline: none !important; text-underline: none !important;
} }
</style> </style>
@ -37,7 +37,6 @@
{{ navigation_bar }} {{ navigation_bar }}
</div> </div>
<a title="{{ 'Options'|trans }}" class="menu-button icons" href="#"> <a title="{{ 'Options'|trans }}" class="menu-button icons" href="#">
<i class="mdi-menu mdi" aria-hidden="true"></i> <i class="mdi-menu mdi" aria-hidden="true"></i>
</a> </a>
</nav> </nav>

@ -1,6 +1,6 @@
{% autoescape false %} {% autoescape false %}
{% macro processItem(item, lp_current_item_id, status_list) %} {% macro processItem(item, lp_current_item_id, status_list) %}
{% import _self as self %} {% import _self as self %}
{% set itemClass = '' %} {% set itemClass = '' %}
{% if 'dir' == item.itemType %} {% if 'dir' == item.itemType %}
{% set itemClass = 'scorm_item_section' %} {% set itemClass = 'scorm_item_section' %}
@ -16,29 +16,17 @@
{% if item.itemType == 'dir' %} {% if item.itemType == 'dir' %}
{% set accordionClass = 'accordion' %} {% set accordionClass = 'accordion' %}
{% endif %} {% endif %}
<div <div id="toc_{{ item.iid }}"
id="toc_{{ item.iid }}" class=" scorm_item_normal {{ itemStatusClass }} {{ itemClass }} item-{{ item.itemType }} {{ accordionClass }}">
class=" scorm_item_normal {{ itemStatusClass }} {{ itemClass }} item-{{ item.itemType }} {{ accordionClass }}"
>
{% if item.itemType == 'dir' %} {% if item.itemType == 'dir' %}
<div <div class="section {{ itemLevel }}" title="{{ item.description | striptags | e('html') }}">
class="section {{ itemLevel }}"
title="{{ item.description | striptags | e('html') }}"
>
{{ item.title | raw }} {{ item.title | raw }}
</div> </div>
{% else %} {% else %}
<div <div class="item {{ itemLevel }}" title="{{ item.description | striptags | e('html') }}">
class="item {{ itemLevel }}"
title="{{ item.description | striptags | e('html') }}"
>
<a name="atoc_{{ item.iid }}"></a> <a name="atoc_{{ item.iid }}"></a>
<a <a data-type="type-{{ item.itemType }}" class="items-list" href="#"
data-type="type-{{ item.itemType }}" onclick="switch_item('{{ lp_current_item_id }}','{{ item.iid }}'); return false;">
class="items-list"
href="#"
onclick="switch_item('{{ lp_current_item_id }}','{{ item.iid }}'); return false;"
>
{{ item.title | raw }} {{ item.title | raw }}
</a> </a>
</div> </div>
@ -48,9 +36,9 @@
{% if item.itemType == 'dir' %} {% if item.itemType == 'dir' %}
{% if item.__children|length %} {% if item.__children|length %}
<div class="item-children"> <div class="item-children">
{% for child in item.__children %} {% for child in item.__children %}
{{ self.processItem(child, lp_current_item_id, status_list) }} {{ self.processItem(child, lp_current_item_id, status_list) }}
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
{% endif %} {% endif %}
@ -72,9 +60,7 @@
{% if data_panel is not empty %} {% if data_panel is not empty %}
<div id="learning_path_toc"> <div id="learning_path_toc">
<div class="scorm-title"> <div class="scorm-title">
<h4> <h4>{{ lp_title_scorm }}</h4>
{{ lp_title_scorm }}
</h4>
</div> </div>
{% macro tree(item) %} {% macro tree(item) %}
@ -82,17 +68,16 @@
{% set isCurrentItem = item.id == lp_current_item_id %} {% set isCurrentItem = item.id == lp_current_item_id %}
<div id="toc_{{ item.id }}" <div id="toc_{{ item.id }}"
class="panel panel-default class="panel panel-default
{{ item.parent_id ? 'child_item':'root_item' }} {{ item.parent_id ? 'child_item':'root_item' }}
lp_item_type_{{ item.type|replace({' ': '_'}) }} lp_item_type_{{ item.type|replace({' ': '_'}) }}
{{ item.status_css_class_name }} {{ item.status_css_class_name }}
{{ item.is_current ? 'current_item scorm_highlight' : '' }} {{ item.is_current ? 'current_item scorm_highlight' : '' }}
{{ item.is_parent_of_current ? 'parent_of_current_item' : '' }} {{ item.is_parent_of_current ? 'parent_of_current_item' : '' }}
{{ item.is_chapter ? 'chapter' : '' }} {{ item.is_chapter ? 'chapter' : '' }}
" "
data-lp-id="{{ item.id }}" data-lp-id="{{ item.id }}">
>
<div class="status-heading"> <div class="status-heading">
<div id="heading_item_{{item.id}}" class="panel-heading" role="tab"> <div id="heading_item_{{ item.id }}" class="panel-heading" role="tab">
{% if item.children|length %} {% if item.children|length %}
<a class="item-header" role="button" <a class="item-header" role="button"
data-toggle="collapse" data-parent="#tocchildren_{{ item.parent_id }}" data-toggle="collapse" data-parent="#tocchildren_{{ item.parent_id }}"
@ -114,7 +99,7 @@
<div id="tocchildren_{{ item.id }}" <div id="tocchildren_{{ item.id }}"
class="panel-collapse collapse {{ isCurrentItem ? 'in' : '' }}" class="panel-collapse collapse {{ isCurrentItem ? 'in' : '' }}"
role="tabpanel" role="tabpanel"
aria-labelledby="heading_item_{{item.id}}"> aria-labelledby="heading_item_{{ item.id }}">
<div class="panel-body"> <div class="panel-body">
{% for child in item.children %} {% for child in item.children %}
{{ self.tree(child) }} {{ self.tree(child) }}
@ -135,28 +120,33 @@
{% endif %} {% endif %}
{% endautoescape %} {% endautoescape %}
<script> <script>
document.addEventListener('DOMContentLoaded', function() { document.addEventListener("DOMContentLoaded", function() {
setTimeout(function() { setTimeout(function() {
var lpCurrentItemId = '{{ lp_current_item_id }}'; var lpCurrentItemId = '{{ lp_current_item_id }}'
var currentElement = document.getElementById('toc_' + lpCurrentItemId); var currentElement = document.getElementById("toc_" + lpCurrentItemId)
if (currentElement) {
var parentContainer = currentElement.closest('.item-children'); if (currentElement) {
var previousSibling; var parentContainer = currentElement.closest(".item-children")
if (parentContainer) { var previousSibling
previousSibling = parentContainer.previousElementSibling;
} if (parentContainer) {
if (previousSibling) { previousSibling = parentContainer.previousElementSibling
previousSibling.click(); }
var parentContainer2 = previousSibling.closest('.item-children');
var previousSibling2; if (previousSibling) {
if (parentContainer2) { previousSibling.click()
previousSibling2 = parentContainer2.previousElementSibling; var parentContainer2 = previousSibling.closest(".item-children")
} var previousSibling2
if (previousSibling2) {
previousSibling2.click() if (parentContainer2) {
} previousSibling2 = parentContainer2.previousElementSibling
} }
}
}, 1000); if (previousSibling2) {
}); previousSibling2.click()
}
}
}
}, 1000)
})
</script> </script>

@ -1,170 +1,188 @@
{% extends '@ChamiloCore/Layout/no_layout.html.twig' %} {% extends '@ChamiloCore/Layout/no_layout.html.twig' %}
{% block content %} {% block content %}
{% autoescape false %} {% autoescape false %}
<link rel="stylesheet" href="{{ url('index') ~ 'build/css/scorm.css' }}"/> <link rel="stylesheet" href="{{ url('index') ~ 'build/css/scorm.css' }}"/>
<div id="learning_path_main" class="{{ is_allowed_to_edit ? 'lp-view-include-breadcrumb' }} {{ lp_mode == 'embedframe' ? 'lp-view-collapsed' : '' }}"> <div id="learning_path_main" class="{{ is_allowed_to_edit ? 'lp-view-include-breadcrumb' }} {{ lp_mode == 'embedframe' ? 'lp-view-collapsed' : '' }}">
{% if show_left_column == 1 %} {% if show_left_column == 1 %}
<div id="learning_path_left_zone" class="sidebar-scorm"> <div id="learning_path_left_zone" class="sidebar-scorm">
<div class="lp-view-zone-container"> <div class="lp-view-zone-container">
<div id="scorm-info"> <div id="scorm-info">
<div id="panel-scorm" class="bg-ch-primary panel-body"> <div id="panel-scorm" class="bg-ch-primary panel-body">
<div class="image-avatar"> <div class="image-avatar">
{% if lp_author == '' %} {% if lp_author == '' %}
<div class="text-center"> <div class="text-center">
{{ lp_preview_image }}
</div>
{% else %}
<div class="media-author">
<div class="media-author-avatar">
{{ lp_preview_image }} {{ lp_preview_image }}
</div> </div>
<div class="media-author-description"> {% else %}
{{ lp_author }} <div class="media-author">
<div class="media-author-avatar">
{{ lp_preview_image }}
</div>
<div class="media-author-description">
{{ lp_author }}
</div>
</div> </div>
{% endif %}
</div>
{% if show_audio_player %}
<div id="lp_media_file" class="audio-scorm">
{{ media_player }}
</div> </div>
{% endif %} {% endif %}
</div>
{% if show_audio_player %}
<div id="lp_media_file" class="audio-scorm">
{{ media_player }}
</div>
{% endif %}
{% if lp_accumulate_work_time != '' %} {% if lp_accumulate_work_time != '' %}
{% set lp_progress %} {% set lp_progress %}
<style> <style>
#timer .container{display:table;background:#777;color:#eee;font-weight:bold;width:100%;text-align:center;text-shadow:1px 1px 4px #999;} #timer .container {
#timer .container div{display:table-cell;font-size:24px;padding:0px;width:20px;} display: table;
#timer .container .divider{width:10px;color:#ddd;} background: #777;
</style> color: #eee;
<script> font-weight: bold;
$(function() { width: 100%;
text-align: center;
text-shadow: 1px 1px 4px #999;
}
#timer .container div {
display: table-cell;
font-size: 24px;
padding: 0px;
width: 20px;
}
#timer .container .divider {
width: 10px;
color: #ddd;
}
</style>
<script>
$(function() {
var timerData = { var timerData = {
hour: parseInt($("#hour").text()), hour: parseInt($("#hour").text()),
minute: parseInt($("#minute").text()), minute: parseInt($("#minute").text()),
second: parseInt($("#second").text()) second: parseInt($("#second").text())
}; }
clearInterval(window.timerInterval); clearInterval(window.timerInterval)
window.timerInterval = setInterval(function(){ window.timerInterval = setInterval(function() {
// Seconds // Seconds
timerData.second++; timerData.second++
if (timerData.second >= 60) { if (timerData.second >= 60) {
timerData.second = 0; timerData.second = 0
timerData.minute++; timerData.minute++
} }
// Minutes // Minutes
if (timerData.minute >= 60) { if (timerData.minute >= 60) {
timerData.minute = 0; timerData.minute = 0
timerData.hour++; timerData.hour++
} }
$("#hour").text(timerData.hour < 10 ? '0' + timerData.hour : timerData.hour); $("#hour").text(timerData.hour < 10 ? "0" + timerData.hour : timerData.hour)
$("#minute").text(timerData.minute < 10 ? '0' + timerData.minute : timerData.minute); $("#minute").text(timerData.minute < 10 ? "0" + timerData.minute : timerData.minute)
$("#second").text(timerData.second < 10 ? '0' + timerData.second : timerData.second); $("#second").text(timerData.second < 10 ? "0" + timerData.second : timerData.second)
}, 1000); }, 1000)
}) })
</script> </script>
<div class="row"> <div class="row">
<div class="col-xs-4"> <div class="col-xs-4">
<b> <b>
{{ "Progress"|trans|format(lp_accumulate_work_time) }} {{ "Progress"|trans|format(lp_accumulate_work_time) }}
</b> </b>
</div>
<div class="col-xs-8">
<div id="progress_bar">
{{ progress_bar }}
</div> </div>
</div> <div class="col-xs-8">
</div> <div id="progress_bar">
<div class="row"> {{ progress_bar }}
<div class="col-xs-4">
<b>
{{ "Time spent in the learning path"|trans|format(lp_accumulate_work_time) }}
</b>
</div>
<div class="col-xs-8">
<div id="timer">
<div class="container">
<div id="hour">{{ hour }}</div>
<div class="divider">:</div>
<div id="minute">{{ minute }}</div>
<div class="divider">:</div>
<div id="second">{{ second }}</div>
<div id="slash"> / </div>
<div>{{ hour_min }}</div>
</div> </div>
</div> </div>
</div> </div>
</div>
{% endset %}
{% else %}
{% set lp_progress %}
<div id="progress_bar">
{{ progress_bar }}
</div>
{% endset %}
{% endif %}
{% if gamification_mode == 1 %}
<!--- gamification -->
<div id="scorm-gamification">
<div class="row"> <div class="row">
<div class="col-xs-6"> <div class="col-xs-4">
{% if gamification_stars > 0 %} <b>
{% for i in 1..gamification_stars %} {{ "Time spent in the learning path"|trans|format(lp_accumulate_work_time) }}
<i class="level mdi-star-face mdi" aria-hidden="true"></i> </b>
{% endfor %}
{% endif %}
{% if gamification_stars < 4 %}
{% for i in 1..4 - gamification_stars %}
<i class="mdi-home-outline mdi" aria-hidden="true"></i>
{% endfor %}
{% endif %}
</div> </div>
<div class="col-xs-6 text-right"> <div class="col-xs-8">
{{ "%s points"|trans|format(gamification_points) }} <div id="timer">
<div class="container">
<div id="hour">{{ hour }}</div>
<div class="divider">:</div>
<div id="minute">{{ minute }}</div>
<div class="divider">:</div>
<div id="second">{{ second }}</div>
<div id="slash"> /</div>
<div>{{ hour_min }}</div>
</div>
</div>
</div> </div>
</div> </div>
<div class="row"> {% endset %}
<div class="col-xs-12 navegation-bar"> {% else %}
{{ lp_progress }} {% set lp_progress %}
<div id="progress_bar">
{{ progress_bar }}
</div>
{% endset %}
{% endif %}
{% if gamification_mode == 1 %}
<!--- gamification -->
<div id="scorm-gamification">
<div class="row">
<div class="col-xs-6">
{% if gamification_stars > 0 %}
{% for i in 1..gamification_stars %}
<i class="level mdi-star-face mdi" aria-hidden="true"></i>
{% endfor %}
{% endif %}
{% if gamification_stars < 4 %}
{% for i in 1..4 - gamification_stars %}
<i class="mdi-home-outline mdi" aria-hidden="true"></i>
{% endfor %}
{% endif %}
</div>
<div class="col-xs-6 text-right">
{{ "%s points"|trans|format(gamification_points) }}
</div>
</div>
<div class="row">
<div class="col-xs-12 navegation-bar">
{{ lp_progress }}
</div>
</div> </div>
</div> </div>
</div> <!--- end gamification -->
<!--- end gamification --> {% else %}
{% else %} {{ lp_progress }}
{{ lp_progress }} {% endif %}
{% endif %}
{{ teacher_toc_buttons }} {{ teacher_toc_buttons }}
</div>
</div>
{# TOC layout #}
<div id="toc_id" class="scorm-body" name="toc_name">
{# div#flab-mobile is to know when the user is on mobile view. Don't delete. #}
<div id="flag-mobile" class="visible-xs-block" aria-hidden="true"></div>
{% include '@ChamiloCore/LearnPath/scorm_list.html.twig' %}
</div> </div>
</div>
{# TOC layout #}
<div id="toc_id" class="scorm-body" name="toc_name">
{# div#flab-mobile is to know when the user is on mobile view. Don't delete. #}
<div id="flag-mobile" class="visible-xs-block" aria-hidden="true"></div>
{% include '@ChamiloCore/LearnPath/scorm_list.html.twig' %}
</div> </div>
</div> </div>
</div> {% endif %}
{% endif %}
{# Right zone #} {# Right zone #}
<div id="learning_path_right_zone" class="{{ show_left_column == 1 ? 'content-scorm' : 'no-right-col' }}"> <div id="learning_path_right_zone" class="{{ show_left_column == 1 ? 'content-scorm' : 'no-right-col' }}">
<div class="lp-view-zone-container"> <div class="lp-view-zone-container">
<div class="lp-view-tabs"> <div class="lp-view-tabs">
<div id="navTabBar" class="mt-2 mb-16 nav-tabs-bar"> <div id="navTabBar" class="mt-2 mb-16 nav-tabs-bar">
<div class="text-left"> <div class="text-left">
<h2 class="text-h3">{{ lp_title_scorm }}</h2> <h2 class="text-h3">{{ lp_title_scorm }}</h2>
<div id="item-parent-names"> <div id="item-parent-names">
{% for parent_title in lp_item_parents %} {% for parent_title in lp_item_parents %}
<h3 class="text-h5">{{ parent_title }}</h3> <h3 class="text-h5">{{ parent_title }}</h3>
{% endfor %} {% endfor %}
</div>
</div> </div>
</div> <!--ul id="navTabs" class="nav nav-tabs tabs-right" role="tablist">
<!--ul id="navTabs" class="nav nav-tabs tabs-right" role="tablist">
<li role="presentation" class="active"> <li role="presentation" class="active">
<a href="#lp-view-content" title="{{ 'Lesson'|trans }}" <a href="#lp-view-content" title="{{ 'Lesson'|trans }}"
aria-controls="lp-view-content" role="tab" data-toggle="tab"> aria-controls="lp-view-content" role="tab" data-toggle="tab">
@ -180,241 +198,235 @@
</a> </a>
</li> </li>
</ul--> </ul-->
</div> </div>
{% include '@ChamiloCore/LearnPath/menubar.html.twig' %} {% include '@ChamiloCore/LearnPath/menubar.html.twig' %}
<div id="tab-iframe" class="auto tab-content"> <div id="tab-iframe" class="auto tab-content">
<div role="tabpanel" class="tab-pane active" id="lp-view-content"> <div role="tabpanel" class="tab-pane active" id="lp-view-content">
<div id="wrapper-iframe"> <div id="wrapper-iframe">
{% if lp_mode == 'fullscreen' %} {% if lp_mode == 'fullscreen' %}
<iframe <iframe id="content_id_blank" name="content_name_blank" src="blank.php"
id="content_id_blank" style="width:100%; height:100%" border="0" frameborder="0"
name="content_name_blank" allowfullscreen="true" webkitallowfullscreen="true"
src="blank.php" mozallowfullscreen="true">
style="width:100%; height:100%" </iframe>
border="0" {% else %}
frameborder="0" <iframe id="content_id" name="content_name" src="{{ iframe_src }}"
allowfullscreen="true" style="width:100%; height:100%" border="0" frameborder="0"
webkitallowfullscreen="true" allowfullscreen="true" webkitallowfullscreen="true"
mozallowfullscreen="true"> mozallowfullscreen="true">
</iframe> </iframe>
{% else %} {% endif %}
<iframe </div>
id="content_id" </div>
name="content_name" <div role="tabpanel" class="tab-pane" id="lp-view-forum">
src="{{ iframe_src }}"
style="width:100%; height:100%"
border="0"
frameborder="0"
allowfullscreen="true"
webkitallowfullscreen="true"
mozallowfullscreen="true">
</iframe>
{% endif %}
</div> </div>
</div>
<div role="tabpanel" class="tab-pane" id="lp-view-forum">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{# end right Zone #}
</div> </div>
{# end right Zone #}
</div>
<script> <script>
var LPViewUtils = { var LPViewUtils = {
setHeightLPToc: function () { setHeightLPToc: function() {
var scormInfoHeight = $('#scorm-info').outerHeight(true); var scormInfoHeight = $("#scorm-info").outerHeight(true)
$('#learning_path_toc').css({ $("#learning_path_toc").css({
top: scormInfoHeight top: scormInfoHeight
}); })
} }
}; }
$(function() { $(function() {
$('.menu-button').on('click', function() { $(".menu-button").on("click", function() {
$('.circle').toggleClass('open'); $(".circle").toggleClass("open")
$('.menu-button').toggleClass('menu-button-selected'); $(".menu-button").toggleClass("menu-button-selected")
}); })
if (/iPhone|iPod|iPad|Safari/.test(navigator.userAgent)) { if (/iPhone|iPod|iPad|Safari/.test(navigator.userAgent)) {
if (!/Chrome/.test(navigator.userAgent)) { if (!/Chrome/.test(navigator.userAgent)) {
// Fix an issue where you cannot scroll below first screen in // Fix an issue where you cannot scroll below first screen in
// learning paths on Apple devices // learning paths on Apple devices
document.getElementById('wrapper-iframe').setAttribute( document.getElementById("wrapper-iframe").setAttribute(
'style', "style",
'width:100%; overflow:auto; position:auto; -webkit-overflow-scrolling:touch !important;' "width:100%; overflow:auto; position:auto; -webkit-overflow-scrolling:touch !important;"
); )
$('#wrapper-iframe').before('<a style="position:fixed;right:5px;top:5px;z-index:1001;" target="_blank" href="{{ iframe_src }}" >Open PDF on Safari</a>'); $("#wrapper-iframe").before('<a style="position:fixed;right:5px;top:5px;z-index:1001;" target="_blank" href="{{ iframe_src }}" >Open PDF on Safari</a>')
// Fix another issue whereby buttons do not react to click below // Fix another issue whereby buttons do not react to click below
// second screen in learning paths on Apple devices // second screen in learning paths on Apple devices
document.getElementById('content_id').setAttribute('style', 'overflow: auto;'); document.getElementById("content_id").setAttribute("style", "overflow: auto;")
} }
} }
{% if lp_mode == 'embedframe' %} {% if lp_mode == 'embedframe' %}
$('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) { $("#lp-view-expand-button, #lp-view-expand-toggle").on("click", function(e) {
e.preventDefault(); e.preventDefault()
$('#learning_path_main').toggleClass('lp-view-collapsed'); $("#learning_path_main").toggleClass("lp-view-collapsed")
$('#lp-view-expand-toggle i.mdi').toggleClass('mdi-arrow-expand-horizontal'); $("#lp-view-expand-toggle i.mdi").toggleClass("mdi-arrow-expand-horizontal")
$('#lp-view-expand-toggle i.mdi').toggleClass('mdi-arrow-collapse-horizontal'); $("#lp-view-expand-toggle i.mdi").toggleClass("mdi-arrow-collapse-horizontal")
var className = $('#lp-view-expand-toggle i.mdi').attr('class'); var className = $("#lp-view-expand-toggle i.mdi").attr("class")
if (className == 'mdi-arrow-collapse-horizontal') { if (className == "mdi-arrow-collapse-horizontal") {
$(this).attr('title', '{{ "Expand" | trans }}'); $(this).attr("title", '{{ "Expand" | trans }}')
} else { } else {
$(this).attr('title', '{{ "Collapse" | trans }}'); $(this).attr("title", '{{ "Collapse" | trans }}')
} }
if($('#navTabBar').is(':hidden')) { if ($("#navTabBar").is(":hidden")) {
$('#navTabBar').show(); $("#navTabBar").show()
} else { } else {
$('#navTabBar').hide(); $("#navTabBar").hide()
} }
}); })
{% else %} {% else %}
$('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) { $("#lp-view-expand-button, #lp-view-expand-toggle").on("click", function(e) {
e.preventDefault(); e.preventDefault()
$('#learning_path_main').toggleClass('lp-view-collapsed'); $("#learning_path_main").toggleClass("lp-view-collapsed")
$('#lp-view-expand-toggle i.mdi').toggleClass('mdi-arrow-collapse-horizontal'); $("#lp-view-expand-toggle i.mdi").toggleClass("mdi-arrow-collapse-horizontal")
$('#lp-view-expand-toggle i.mdi').toggleClass('mdi-arrow-expand-horizontal'); $("#lp-view-expand-toggle i.mdi").toggleClass("mdi-arrow-expand-horizontal")
var className = $('#lp-view-expand-toggle i.mdi').attr('class'); var className = $("#lp-view-expand-toggle i.mdi").attr("class")
if (className == 'mdi-arrow-expand-horizontal') { if (className == "mdi-arrow-expand-horizontal") {
$(this).attr('title', '{{ "Expand" | trans }}'); $(this).attr("title", '{{ "Expand" | trans }}')
} else { } else {
$(this).attr('title', '{{ "Collapse" | trans }}'); $(this).attr("title", '{{ "Collapse" | trans }}')
} }
}); })
{% endif %} {% endif %}
$('.lp-view-tabs').on('click', '.disabled', function (e) { $(".lp-view-tabs").on("click", ".disabled", function(e) {
e.preventDefault(); e.preventDefault()
}); })
$('a#ui-option').on('click', function (e) { $("a#ui-option").on("click", function(e) {
e.preventDefault(); e.preventDefault()
var icon = $(this).children('.mdi'); var icon = $(this).children(".mdi")
if (icon.is('.mdi-chevron-up')) { if (icon.is(".mdi-chevron-up")) {
icon.removeClass('mdi-chevron-up').addClass('mdi-chevron-down'); icon.removeClass("mdi-chevron-up").addClass("mdi-chevron-down")
return; return
} }
icon.removeClass('mdi-chevron-down').addClass('mdi-chevron-up'); icon.removeClass("mdi-chevron-down").addClass("mdi-chevron-up")
}); })
LPViewUtils.setHeightLPToc(); LPViewUtils.setHeightLPToc()
$('.image-avatar img').on('load', function () { $(".image-avatar img").on("load", function() {
LPViewUtils.setHeightLPToc(); LPViewUtils.setHeightLPToc()
}); })
$('.scorm_item_normal a, #scorm-previous, #scorm-next').on('click', function () { $(".scorm_item_normal a, #scorm-previous, #scorm-next").on("click", function() {
//$('.lp-view-tabs').animate({opacity: 0}, 500); //$('.lp-view-tabs').animate({opacity: 0}, 500);
}); })
$('#learning_path_right_zone #lp-view-content iframe').on('load', function () { $("#learning_path_right_zone #lp-view-content iframe").on("load", function() {
//$('.lp-view-tabs a[href="#lp-view-content"]').tab('show'); //$('.lp-view-tabs a[href="#lp-view-content"]').tab('show');
//$('.lp-view-tabs').animate({opacity: 1}, 500); //$('.lp-view-tabs').animate({opacity: 1}, 500);
}); })
{% if lp_mode == 'embedded' %} {% if lp_mode == 'embedded' %}
/*$('.scorm_item_normal a, #scorm-previous, #scorm-next').on('click', function () { /*$('.scorm_item_normal a, #scorm-previous, #scorm-next').on('click', function () {
$('.lp-view-tabs').animate({opacity: 0}, 500); $('.lp-view-tabs').animate({opacity: 0}, 500);
if ($('#flag-mobile').is(':visible') && !$('#learning_path_main').is('.lp-view-collapsed')) { if ($('#flag-mobile').is(':visible') && !$('#learning_path_main').is('.lp-view-collapsed')) {
$('#lp-view-expand-toggle').trigger('click'); $('#lp-view-expand-toggle').trigger('click');
} }
});*/ });*/
{% endif %} {% endif %}
//loadForumThread({{ lp_id }}, {{ lp_current_item_id }}); //loadForumThread({{ lp_id }}, {{ lp_current_item_id }});
checkCurrentItemPosition({{ lp_current_item_id }}); checkCurrentItemPosition({{ lp_current_item_id }})
{% if glossary_extra_tools in glossary_tool_available_list %} {% if glossary_extra_tools in glossary_tool_available_list %}
// Loads the glossary library. // Loads the glossary library.
(function () { (function() {
{% if show_glossary_in_documents == 'ismanual' %} {% if show_glossary_in_documents == 'ismanual' %}
$.frameReady( $.frameReady(
function(){ function() {
// $("<div>I am a div courses</div>").prependTo("body"); // $("<div>I am a div courses</div>").prependTo("body");
},
"#content_id",
[
{
type: "script", id: "_fr1", src: "{{ jquery_web_path }}", deps: [
{ type: "script", id: "_fr4", src: "{{ jquery_ui_js_web_path }}" },
{ type: "script", id: "_fr2", src: "{{ _p.web_lib }}javascript/jquery.highlight.js" },
{{ fix_link }}
]
}, },
"#content_id", { type: "stylesheet", id: "_fr5", src: "{{ jquery_ui_css_web_path }}" }
[ ]
{ type:"script", id:"_fr1", src:"{{ jquery_web_path }}", deps: [ )
{ type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"}, {% elseif show_glossary_in_documents == 'isautomatic' %}
{ type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"},
{{ fix_link }}
]},
{ type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
]
);
{% elseif show_glossary_in_documents == 'isautomatic' %}
$.frameReady( $.frameReady(
function(){ function() {
// $("<div>I am a div courses</div>").prependTo("body"); // $("<div>I am a div courses</div>").prependTo("body");
},
"#content_id",
[
{
type: "script", id: "_fr1", src: "{{ jquery_web_path }}", deps: [
{ type: "script", id: "_fr4", src: "{{ jquery_ui_js_web_path }}" },
{ type: "script", id: "_fr2", src: "{{ _p.web_lib }}javascript/jquery.highlight.js" },
{{ fix_link }}
]
}, },
"#content_id", { type: "stylesheet", id: "_fr5", src: "{{ jquery_ui_css_web_path }}" }
[ ]
{ type:"script", id:"_fr1", src:"{{ jquery_web_path }}", deps: [ )
{ type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"}, {% elseif fix_link != '' %}
{ type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"},
{{ fix_link }}
]},
{ type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
]
);
{% elseif fix_link != '' %}
$.frameReady( $.frameReady(
function(){ function() {
// $("<div>I am a div courses</div>").prependTo("body"); // $("<div>I am a div courses</div>").prependTo("body");
},
"#content_id",
[
{
type: "script", id: "_fr1", src: "{{ jquery_web_path }}", deps: [
{ type: "script", id: "_fr4", src: "{{ jquery_ui_js_web_path }}" },
{{ fix_link }}
]
}, },
"#content_id", { type: "stylesheet", id: "_fr5", src: "{{ jquery_ui_css_web_path }}" }
[ ]
{ type:"script", id:"_fr1", src:"{{ jquery_web_path }}", deps: [ )
{ type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"}, {% endif %}
{{ fix_link }} })()
]}, {% endif %}
{ type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"}, {% if disable_js_in_lp_view == 0 %}
]
);
{% endif %}
})();
{% endif %}
{% if disable_js_in_lp_view == 0 %}
$(function() { $(function() {
var arr = ['link', 'sco']; var arr = ["link", "sco"]
if ($.inArray(olms.lms_item_type, arr) == -1) { if ($.inArray(olms.lms_item_type, arr) == -1) {
{{ frame_ready }} {{ frame_ready }}
} }
}); })
{% endif %} {% endif %}
$(window).on('resize', function () { $(window).on("resize", function() {
LPViewUtils.setHeightLPToc(); LPViewUtils.setHeightLPToc()
}); })
}); })
</script> </script>
<script> <script>
document.addEventListener('DOMContentLoaded', function () { document.addEventListener("DOMContentLoaded", function() {
var acc = document.getElementsByClassName("accordion"); var acc = document.getElementsByClassName("accordion")
var i; var i
for (i = 0; i < acc.length; i++) { for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() { acc[i].addEventListener("click", function() {
this.classList.toggle("active"); this.classList.toggle("active")
var panel = this.nextElementSibling; var panel = this.nextElementSibling
if (panel.style.display == 'block') { if (panel.style.display == "block") {
panel.style.display = "none"; panel.style.display = "none"
} else { } else {
panel.style.display = "block"; panel.style.display = "block"
}
})
}
})
</script>
<style>
.item-children {
display: none;
} }
}); </style>
} {% endautoescape %}
});
</script>
<style>
.item-children {
display: none;
}
</style>
{% endautoescape %}
{% endblock %} {% endblock %}

Loading…
Cancel
Save