Browse Source

Fixes after merge with 1.11.x

Julio Montoya 5 years ago
parent
commit
bafb03ca65

+ 1 - 1
main/template/rainbow/exercise/submit.js.tpl

@@ -222,7 +222,7 @@ jsPlumb.ready(function () {
     }
 });
 
-$(document).on('ready', function () {
+$(function () {
     DraggableAnswer.init(
         $(".exercise-draggable-answer"),
         $(".droppable")

+ 3 - 0
main/template/rainbow/javascript/editor/ckeditor/config_js.tpl

@@ -145,7 +145,10 @@ CKEDITOR.editorConfig = function (config) {
         '{{ font_awesome_css }}',
         '{{ css_editor }}',
     ];
+
     config.language_list = ['{{ language_list }}'];
+
+    config.qMarkersRollsUrl = '{{ _p.web_ajax }}exercise.ajax.php?a=get_quiz_embeddable';
 };
 
 // Sets default target to "_blank" in link plugin

+ 0 - 112
main/template/rainbow/layout/footer.js.tpl

@@ -1,112 +0,0 @@
-<script>
-    $("form").on("click", ' .advanced_parameters', function() {
-        /*var id = $(this).attr('id') + '_options';
-         console.log(id);
-         $("#"+id).toggleClass('active');
-         var button = $(this);
-         $("#"+id).toggle(function() {
-         $("#"+id).toggleClass('active');
-         });*/
-    });
-
-    /* Makes row highlighting possible */
-    $(document).ready( function() {
-        // Date time settings.
-        moment.locale('{{ locale }}');
-        $.datepicker.setDefaults($.datepicker.regional["{{ locale }}"]);
-        $.datepicker.regional["local"] = $.datepicker.regional["{{ locale }}"];
-
-        // Chosen select
-        $(".chzn-select").chosen({
-            disable_search_threshold: 10,
-            no_results_text: '{{ 'SearchNoResultsFound' | get_lang }}',
-            placeholder_text_multiple: '{{ 'SelectSomeOptions' | get_lang }}',
-            placeholder_text_single: '{{ 'SelectAnOption' | get_lang }}',
-            width: "100%"
-        });
-
-        // Bootstrap tabs.
-        $('.tab-wrapper a').click(function (e) {
-            e.preventDefault();
-            $(this).tab('show');
-
-            //$('#tabs a:first').tab('show') // Select first tab
-        });
-
-        // Fixes bug when loading links inside a tab.
-        $('.tab-wrapper .tab-pane a').unbind();
-
-        /**
-         * Advanced options
-         * Usage
-         * <a id="link" href="url">Advanced</a>
-         * <div id="link_options">
-         *     hidden content :)
-         * </div>
-         * */
-        $(".advanced_options").on("click", function (event) {
-            event.preventDefault();
-            var id = $(this).attr('id') + '_options';
-            var button = $(this);
-            $("#" + id).toggle();
-        });
-
-        /**
-         * <a class="advanced_options_open" href="http://" rel="div_id">Open</a>
-         * <a class="advanced_options_close" href="http://" rel="div_id">Close</a>
-         * <div id="div_id">Div content</div>
-         * */
-        $(".advanced_options_open").on("click", function (event) {
-            event.preventDefault();
-            var id = $(this).attr('rel');
-            $("#" + id).show();
-        });
-
-        $(".advanced_options_close").on("click", function (event) {
-            event.preventDefault();
-            var id = $(this).attr('rel');
-            $("#" + id).hide();
-        });
-
-        // Adv multi-select search input.
-        $('.select_class_filter').on('focus', function () {
-            var inputId = $(this).attr('id');
-            inputId = inputId.replace('-filter', '');
-            $("#" + inputId).filterByText($("#" + inputId + "-filter"));
-        });
-
-        $(".jp-jplayer audio").addClass('skip');
-
-        // Mediaelement
-        if ( {{ show_media_element }} == 1) {
-            jQuery('video:not(.skip), audio:not(.skip)').mediaelementplayer(/* Options */);
-        }
-
-        // Table highlight.
-        $("form .data_table input:checkbox").click(function () {
-            if ($(this).is(":checked")) {
-                $(this).parentsUntil("tr").parent().addClass("row_selected");
-
-            } else {
-                $(this).parentsUntil("tr").parent().removeClass("row_selected");
-            }
-        });
-
-        /* For non HTML5 browsers */
-        if ($("#formLogin".length > 1)) {
-            $("input[name=login]").focus();
-        }
-
-        /* For IOS users */
-        $('.autocapitalize_off').attr('autocapitalize', 'off');
-
-        // Tool tip (in exercises)
-        var tip_options = {
-            placement: 'right'
-        };
-        $('.boot-tooltip').tooltip(tip_options);
-    });
-
-
-
-</script>

+ 0 - 470
main/template/rainbow/layout/header.js.tpl

@@ -1,470 +0,0 @@
-<script src="{{ _p.web_css_theme }}js/jquery.checkradios.min.js"></script>
-<script>
-{% if constant('CHAMILO_LOAD_WYSIWYG') %}
-    // External plugins not part of the default Ckeditor package.
-    var plugins = [
-        'asciimath',
-        'asciisvg',
-        'audio',
-        'ckeditor_wiris',
-        'dialogui',
-        'glossary',
-        'leaflet',
-        'mapping',
-        'maximize',
-        'mathjax',
-        'oembed',
-        'toolbar',
-        'toolbarswitch',
-        'video',
-        'wikilink',
-        'wordcount',
-        'youtube',
-        'flash',
-        'inserthtml',
-        'image2_chamilo'
-    ];
-
-    plugins.forEach(function(plugin) {
-        CKEDITOR.plugins.addExternal(plugin, '{{ _p.web_main ~ 'inc/lib/javascript/ckeditor/plugins/' }}' + plugin + '/');
-    });
-
-    /**
-     * Function use to load templates in a div
-     **/
-    var showTemplates = function (ckeditorName) {
-        var editorName = 'content';
-        if (ckeditorName && ckeditorName.length > 0) {
-            editorName = ckeditorName;
-        }
-        CKEDITOR.editorConfig(CKEDITOR.config);
-        CKEDITOR.loadTemplates(CKEDITOR.config.templates_files, function (a) {
-            var templatesConfig = CKEDITOR.getTemplates("default");
-            var $templatesUL = $("<ul>");
-            if (templatesConfig) {
-                $.each(templatesConfig.templates, function () {
-                    var template = this;
-                    var $templateLi = $("<li>");
-                    var templateHTML = "<img src=\"" + templatesConfig.imagesPath + template.image + "\" ><div>";
-                    templateHTML += "<b>" + template.title + "</b>";
-
-                    if (template.description) {
-                        templateHTML += "<div class=description>" + template.description + "</div>";
-                    }
-                    templateHTML += "</div>";
-
-                    $("<a>", {
-                        href: "#",
-                        html: templateHTML,
-                        click: function (e) {
-                            e.preventDefault();
-                            if (CKEDITOR.instances[editorName]) {
-                                CKEDITOR.instances[editorName].setData(template.html, function () {
-                                    this.checkDirty();
-                                });
-                            }
-                        }
-                    }).appendTo($templateLi);
-                    $templatesUL.append($templateLi);
-                });
-            }
-            $templatesUL.appendTo("#frmModel");
-        });
-    };
-{% endif %}
-
-
-function doneResizing() {
-    var widhtWindow = $(window).width();
-    if ((widhtWindow>=1024) && (widhtWindow>=768)) {
-        $("#profileCollapse").addClass("in");
-        $("#courseCollapse").addClass("in");
-        $("#skillsCollapse").addClass("in");
-        $("#sn-sidebar-collapse").addClass("in");
-        $("#user_image_block").removeClass("text-muted");
-    } else {
-        $("#profileCollapse").removeClass("in");
-        $("#courseCollapse").removeClass("in");
-        $("#skillsCollapse").removeClass("in");
-        $("#sn-avatar-one").removeClass("in");
-        $("#user_image_block").addClass("text-muted");
-    }
-};
-
-$(document).ready(function() {
-    $('.checkradios').checkradios();
-    $("#open-view-list").click(function(){
-        $("#student-list-work").fadeIn(300);
-    });
-    $("#closed-view-list").click(function(){
-        $("#student-list-work").fadeOut(300);
-    });
-    check_brand();
-    var id;
-    $(window).resize(function() {
-        clearTimeout(id);
-        id = setTimeout(doneResizing, 200);
-    });
-
-    // Removes the yellow input in Chrome
-    if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) {
-        $(window).load(function(){
-            $('input:-webkit-autofill').each(function(){
-                var text = $(this).val();
-                var name = $(this).attr('name');
-                $(this).after(this.outerHTML).remove();
-                $('input[name=' + name + ']').val(text);
-            });
-        });
-    }
-
-    $(".accordion_jquery").accordion({
-        autoHeight: false,
-        active: false, // all items closed by default
-        collapsible: true,
-        header: ".accordion-heading"
-    });
-
-    // Global popup
-    $('body').on('click', 'a.ajax', function(e) {
-        e.preventDefault();
-
-        var contentUrl = this.href,
-                loadModalContent = $.get(contentUrl),
-                self = $(this);
-
-        $.when(loadModalContent).done(function(modalContent) {
-            var modalDialog = $('#global-modal').find('.modal-dialog'),
-                    modalSize = self.data('size') || get_url_params(contentUrl, 'modal_size'),
-                    modalWidth = self.data('width') || get_url_params(contentUrl, 'width'),
-                    modalTitle = self.data('title') || ' ';
-
-            modalDialog.removeClass('modal-lg modal-sm').css('width', '');
-
-            if (modalSize) {
-                switch (modalSize) {
-                    case 'lg':
-                        modalDialog.addClass('modal-lg');
-                        break;
-                    case 'sm':
-                        modalDialog.addClass('modal-sm');
-                        break;
-                }
-            } else if (modalWidth) {
-                modalDialog.css('width', modalWidth + 'px');
-            }
-
-            $('#global-modal').find('.modal-title').text(modalTitle);
-            $('#global-modal').find('.modal-body').html(modalContent);
-            $('#global-modal').modal('show');
-        });
-    });
-
-    $('a.expand-image').on('click', function(e) {
-        e.preventDefault();
-        var title = $(this).attr('title');
-        var image = new Image();
-        image.onload = function() {
-            if (title) {
-                $('#expand-image-modal').find('.modal-title').text(title);
-            } else {
-                $('#expand-image-modal').find('.modal-title').html('&nbsp;');
-            }
-
-            $('#expand-image-modal').find('.modal-body').html(image);
-            $('#expand-image-modal').modal({
-                show: true
-            });
-        };
-        image.src = this.href;
-    });
-
-    // Global confirmation
-    $('.popup-confirmation').on('click', function() {
-        showConfirmationPopup(this);
-        return false;
-    });
-
-    // old jquery.menu.js
-    $('#navigation a').stop().animate({
-        'marginLeft':'50px'
-    },1000);
-
-    $('#navigation div').hover(
-        function () {
-            $('a',$(this)).stop().animate({
-                'marginLeft':'1px'
-            },200);
-        },
-        function () {
-            $('a',$(this)).stop().animate({
-                'marginLeft':'50px'
-            },200);
-        }
-    );
-
-    /* Make responsive image maps */
-    $('map').imageMapResize();
-
-    jQuery.fn.filterByText = function(textbox) {
-        return this.each(function() {
-            var select = this;
-            var options = [];
-            $(select).find('option').each(function() {
-                options.push({value: $(this).val(), text: $(this).text()});
-            });
-            $(select).data('options', options);
-
-            $(textbox).bind('change keyup', function() {
-                var options = $(select).empty().data('options');
-                var search = $.trim($(this).val());
-                var regex = new RegExp(search,"gi");
-
-                $.each(options, function(i) {
-                    var option = options[i];
-                    if(option.text.match(regex) !== null) {
-                        $(select).append(
-                                $('<option>').text(option.text).val(option.value)
-                        );
-                    }
-                });
-            });
-        });
-    };
-    $(".black-shadow").mouseenter(function() {
-        $(this).addClass('hovered-course');
-    }).mouseleave(function() {
-         $(this).removeClass('hovered-course');
-    });
-});
-
-$(window).resize(function() {
-    check_brand();
-});
-
-$(document).scroll(function() {
-    var valor = $('body').outerHeight() - 700;
-    if ($(this).scrollTop() > 100) {
-        $('.bottom_actions').addClass('bottom_actions_fixed');
-    } else {
-        $('.bottom_actions').removeClass('bottom_actions_fixed');
-    }
-
-    if ($(this).scrollTop() > valor) {
-        $('.bottom_actions').removeClass('bottom_actions_fixed');
-    } else {
-        $('.bottom_actions').addClass('bottom_actions_fixed');
-    }
-
-    //Exercise warning fixed at the top
-    var fixed =  $("#exercise_clock_warning");
-    if (fixed.length) {
-        if (!fixed.attr('data-top')) {
-            // If already fixed, then do nothing
-            if (fixed.hasClass('subnav-fixed')) return;
-            // Remember top position
-            var offset = fixed.offset();
-            fixed.attr('data-top', offset.top);
-            fixed.css('width', '100%');
-        }
-
-        if (fixed.attr('data-top') - fixed.outerHeight() <= $(this).scrollTop()) {
-            fixed.addClass('navbar-fixed-top');
-            fixed.css('width', '100%');
-        } else {
-            fixed.removeClass('navbar-fixed-top');
-            fixed.css('width', '100%');
-        }
-    }
-
-    // Admin -> Settings toolbar.
-    if ($('body').width() > 959) {
-        if ($('.new_actions').length) {
-            if (!$('.new_actions').attr('data-top')) {
-                // If already fixed, then do nothing
-                if ($('.new_actions').hasClass('new_actions-fixed')) return;
-                // Remember top position
-                var offset = $('.new_actions').offset();
-
-                var more_top = 0;
-                if ($('.subnav').hasClass('new_actions-fixed')) {
-                    more_top = 50;
-                }
-                $('.new_actions').attr('data-top', offset.top + more_top);
-            }
-            // Check if the height is enough before fixing the icons menu (or otherwise removing it)
-            // Added a 30px offset otherwise sometimes the menu plays ping-pong when scrolling to
-            // the bottom of the page on short pages.
-            if ($('.new_actions').attr('data-top') - $('.new_actions').outerHeight() <= $(this).scrollTop() + 30) {
-                $('.new_actions').addClass('new_actions-fixed');
-            } else {
-                $('.new_actions').removeClass('new_actions-fixed');
-            }
-        }
-    }
-});
-
-function get_url_params(q, attribute) {
-    var vars;
-    var hash;
-    if (q != undefined) {
-        q = q.split('&');
-        for(var i = 0; i < q.length; i++){
-            hash = q[i].split('=');
-            if (hash[0] == attribute) {
-                return hash[1];
-            }
-        }
-    }
-}
-
-function check_brand() {
-    if ($('.subnav').length) {
-        if ($(window).width() >= 969) {
-            $('.subnav .brand').hide();
-        } else {
-            $('.subnav .brand').show();
-        }
-    }
-}
-
-function showConfirmationPopup(obj, urlParam) {
-    if (urlParam) {
-        url = urlParam
-    } else {
-        url = obj.href;
-    }
-
-    var dialog  = $("#dialog");
-    if ($("#dialog").length == 0) {
-        dialog  = $('<div id="dialog" style="display:none">{{ "ConfirmYourChoice" | get_lang }} </div>').appendTo('body');
-    }
-
-    var width_value = 350;
-    var height_value = 150;
-    var resizable_value = true;
-
-    var new_param = get_url_params(url, 'width');
-    if (new_param) {
-        width_value = new_param;
-    }
-
-    var new_param = get_url_params(url, 'height')
-    if (new_param) {
-        height_value = new_param;
-    }
-
-    var new_param = get_url_params(url, 'resizable');
-    if (new_param) {
-        resizable_value = new_param;
-    }
-
-    // Show dialog
-    dialog.dialog({
-        modal       : true,
-        width       : width_value,
-        height      : height_value,
-        resizable   : resizable_value,
-        buttons: [
-            {
-                text: '{{ 'Yes' | get_lang }}',
-                click: function() {
-                    window.location = url;
-                },
-                icons:{
-                    primary:'ui-icon-locked'
-                }
-            },
-            {
-                text: '{{ 'No' | get_lang }}',
-                click: function() { $(this).dialog("close"); },
-                icons:{
-                    primary:'ui-icon-locked'
-                }
-            }
-        ]
-    });
-    // prevent the browser to follow the link
-    return false;
-}
-
-function setCheckbox(value, table_id) {
-    checkboxes = $("#"+table_id+" input:checkbox");
-    $.each(checkboxes, function(index, checkbox) {
-        checkbox.checked = value;
-        if (value) {
-            $(checkbox).parentsUntil("tr").parent().addClass("row_selected");
-        } else {
-            $(checkbox).parentsUntil("tr").parent().removeClass("row_selected");
-        }
-    });
-    return false;
-}
-
-function action_click(element, table_id) {
-    d = $("#"+table_id);
-    if (!confirm('{{ "ConfirmYourChoice"|get_lang }}')) {
-        return false;
-    } else {
-        var action =$(element).attr("data-action");
-        $('#'+table_id+' input[name="action"] ').attr("value", action);
-        d.submit();
-        return false;
-    }
-}
-
-/**
- * Generic function to replace the deprecated jQuery toggle function
- * @param inId          : id of block to hide / unhide
- * @param inIdTxt       : id of the button
- * @param inTxtHide     : text one of the button
- * @param inTxtUnhide   : text two of the button
- * @todo : allow to detect if text is from a button or from a <a>
- */
-function hideUnhide(inId, inIdTxt, inTxtHide, inTxtUnhide)
-{
-    if ($('#'+inId).css("display") == "none") {
-        $('#'+inId).show(400);
-        $('#'+inIdTxt).attr("value", inTxtUnhide);
-    } else {
-        $('#'+inId).hide(400);
-        $('#'+inIdTxt).attr("value", inTxtHide);
-    }
-}
-
-function expandColumnToogle(buttonSelector, col1Info, col2Info)
-{
-    $(buttonSelector).on('click', function (e) {
-        e.preventDefault();
-
-        col1Info = $.extend({
-            selector: '',
-            width: 4
-        }, col1Info);
-        col2Info = $.extend({
-            selector: '',
-            width: 8
-        }, col2Info);
-
-        if (!col1Info.selector || !col2Info.selector) {
-            return;
-        }
-
-        var col1 = $(col1Info.selector),
-            col2 = $(col2Info.selector);
-
-        $('#expand').toggleClass('hide');
-        $('#contract').toggleClass('hide');
-
-        if (col2.is('.col-md-' + col2Info.width)) {
-            col2.removeClass('col-md-' + col2Info.width).addClass('col-md-12');
-            col1.removeClass('col-md-' + col1Info.width).addClass('hide');
-
-            return;
-        }
-
-        col2.removeClass('col-md-12').addClass('col-md-' + col2Info.width);
-        col1.removeClass('hide').addClass('col-md-' + col1Info.width);
-    });
-}
-</script>

+ 9 - 3
main/template/rainbow/layout/hot_course_item.tpl

@@ -16,9 +16,15 @@
                 <div class="description">
                     <div class="block-title">
                         <h5 class="title">
-                            <a alt="{{ item.title }}" title="{{ item.title }}" href="{{ _p.web }}course/{{ item.real_id  }}/about">
-                                {{ item.title_cut}}
-                            </a>
+                            {% if item.is_course_student or item.is_course_teacher %}
+                                <a alt="{{ item.title }}" title="{{ item.title }}" href="{{ _p.web }}courses/{{ item.code  }}/">
+                                    {{ item.title_cut}}
+                                </a>
+                            {% else %}
+                                <a alt="{{ item.title }}" title="{{ item.title }}" href="{{ _p.web }}course/{{ item.real_id  }}/about">
+                                    {{ item.title_cut}}
+                                </a>
+                            {% endif %}
                         </h5>
                     </div>
                     <div class="ranking">

+ 1 - 1
main/template/rainbow/layout/layout_2_col.tpl

@@ -1,5 +1,5 @@
 {% extends 'layout/page.tpl'|get_template %}
-{% import 'macro/macro.tpl'|get_template as display %}
+{% import 'default/macro/macro.tpl' as display %}
 
 {% block body %}
     {% if plugin_main_top %}

+ 46 - 48
main/template/rainbow/learnpath/scorm_list.tpl

@@ -14,7 +14,7 @@
                 {% else %}
                 <div class="item {{ item.css_level }}" title="{{ item.description }}">
                     <a name="atoc_{{ item.id }}"></a>
-                    <a class="items-list" href="#"
+                    <a data-type="type-{{ item.type }}" class="items-list"  href="#"
                        onclick="switch_item('{{ item.current_id }}','{{ item.id }}'); return false;">
                         {{ item.title }}
                     </a>
@@ -26,8 +26,8 @@
     </div>
 </div>
 {% endif %}
-{% if data_panel is not empty %}
 
+{% if data_panel is not empty %}
 <div id="learning_path_toc" class="scorm-collapse">
     <div class="scorm-title">
         <h4>
@@ -41,7 +41,7 @@
                 <li id="toc_{{ item.id }}" class="{{ item.class }} item-{{ item.type }}">
                     <div class="sub-item type-{{ item.type }}">
                         <a name="atoc_{{ item.id }}"></a>
-                        <a class="item-action" href="#"
+                        <a data-type="type-{{ item.type }}" class="item-action" href="#"
                            onclick="switch_item('{{ item.current_id }}','{{ item.id }}'); return false;">
                             <i class="fa fa-chevron-circle-right" aria-hidden="true"></i>
                             {{ item.title }}
@@ -53,54 +53,52 @@
         {% endif %}
 
         {% for item in data_panel.are_parents %}
-
-        <div class="panel panel-default {{ item.parent ? 'lower':'higher' }}" data-lp-id="{{ item.id }}"
-             {{ item.parent ? 'data-lp-parent="' ~ item.parent ~ '"' : '' }}>
-            <div class="status-heading">
-                <div class="panel-heading" role="tab" id="heading-{{ item.id }}">
-                    <h4>
-                        <a class="item-header" role="button" data-toggle="collapse"
-                            data-parent="#scorm-panel{{ item.parent ? '-' ~ item.parent : '' }}"
-                            href="#collapse-{{ item.id }}" aria-expanded="true"
-                            aria-controls="collapse-{{ item.id }}">
-                            {{ item.title }}
-                        </a>
-                    </h4>
+            <div class="panel panel-default {{ item.parent ? 'lower':'higher' }}" data-lp-id="{{ item.id }}"
+                 {{ item.parent ? 'data-lp-parent="' ~ item.parent ~ '"' : '' }}>
+                <div class="status-heading">
+                    <div class="panel-heading" role="tab" id="heading-{{ item.id }}">
+                        <h4>
+                            <a class="item-header" role="button" data-toggle="collapse"
+                                data-parent="#scorm-panel{{ item.parent ? '-' ~ item.parent : '' }}"
+                                href="#collapse-{{ item.id }}" aria-expanded="true"
+                                aria-controls="collapse-{{ item.id }}">
+                                {{ item.title }}
+                            </a>
+                        </h4>
+                    </div>
                 </div>
-            </div>
-            <div id="collapse-{{ item.id }}" class="panel-collapse collapse {{ item.parent_current }}"
-                 role="tabpanel" aria-labelledby="heading-{{ item.id }}">
-                <div class="panel-body">
-                    <ul class="list">
-                        {% set  counter = 0 %}
-                        {% set  final = item.children|length %}
-                        {% for subitem in item.children %}
-                        {% set  counter = counter + 1 %}
-                        <li id="toc_{{ subitem.id }}"
-                            class="{{ subitem.class }} {{ subitem.type }} {{ counter == final ? 'final':'' }}">
-                            <div class="sub-item item-{{ subitem.type }}">
-                                <a name="atoc_{{ subitem.id }}"></a>
-                                <a class="item-action" href="#"
-                                   onclick="switch_item('{{ subitem.current_id }}','{{ subitem.id }}'); return false;">
-                                    {{ subitem.title }}
-                                </a>
-                            </div>
-                        </li>
-
-                        {% endfor %}
-                    </ul>
+                <div id="collapse-{{ item.id }}" class="panel-collapse collapse {{ item.parent_current }}"
+                     role="tabpanel" aria-labelledby="heading-{{ item.id }}">
+                    <div class="panel-body">
+                        <ul class="list">
+                            {% set counter = 0 %}
+                            {% set final = item.children|length %}
+                            {% for subitem in item.children %}
+                            {% set counter = counter + 1 %}
+                            <li id="toc_{{ subitem.id }}"
+                                class="{{ subitem.class }} {{ subitem.type }} {{ counter == final ? 'final':'' }}">
+                                <div class="sub-item item-{{ subitem.type }}">
+                                    <a name="atoc_{{ subitem.id }}"></a>
+                                    <a data-type="type-{{ subitem.type }}" class="item-action" href="#"
+                                       onclick="switch_item('{{ subitem.current_id }}','{{ subitem.id }}'); return false;">
+                                        {# <i class="fa fa-chevron-circle-right" aria-hidden="true"></i> #}
+                                        {{ subitem.title }}
+                                    </a>
+                                </div>
+                            </li>
+                            {% endfor %}
+                        </ul>
+                    </div>
                 </div>
             </div>
-        </div>
         {% endfor %}
-
     </div>
 </div>
-    <script type="text/javascript">
-        $('.panel-heading a').click(function() {
-            $('.panel-heading').removeClass('active');
-            if(!$(this).closest('.panel').find('.panel-collapse').hasClass('in'))
-                $(this).parents('.panel-heading').addClass('active');
-        });
-    </script>
-{% endif %}
+<script type="text/javascript">
+    $('.panel-heading a').click(function() {
+        $('.panel-heading').removeClass('active');
+        if(!$(this).closest('.panel').find('.panel-collapse').hasClass('in'))
+            $(this).parents('.panel-heading').addClass('active');
+    });
+</script>
+{% endif %}

+ 54 - 95
main/template/rainbow/learnpath/view.tpl

@@ -69,9 +69,7 @@
                     {{ teacher_toc_buttons }}
                 </div>
             </div>
-
             {# TOC layout #}
-
             <div id="toc_id" class="scorm-body" name="toc_name">
                 {% include 'learnpath/scorm_list.tpl'|get_template %}
             </div>
@@ -143,7 +141,6 @@
                         </div>
                     </div>
                     <div role="tabpanel" class="tab-pane" id="lp-view-forum">
-
                     </div>
                 </div>
             </div>
@@ -153,8 +150,7 @@
 </div>
 {% if data_panel is not empty %}
     <script type="text/javascript">
-        $( document ).ready(function() {
-
+        $(function() {
             $('#scorm-panel .panel.higher .status-heading').on("click", function () {
                 $(this).siblings().find(".panel-heading").removeClass("on");
                 $(this).find(".panel-heading").toggleClass("on");
@@ -172,8 +168,7 @@
     </script>
 {% endif %}
 <script>
-    (function () {
-        var LPViewUtils = {
+    var LPViewUtils = {
             setHeightLPToc: function () {
                 var scormInfoHeight = $('#scorm-info').outerHeight(true);
 
@@ -210,8 +205,9 @@
                 });
             }
         };
+       
 
-        $(document).on('ready', function () {
+        $(function() {
             {% if data_panel %}
             LPViewUtils.groupToc();
             {% endif %}
@@ -228,18 +224,14 @@
             //$('#learning_path_main').addClass('lp-view-collapsed');
             $('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
                 e.preventDefault();
-
                 $('#learning_path_main').toggleClass('lp-view-collapsed');
-
                 $('#lp-view-expand-toggle span.fa').toggleClass('fa-compress');
                 $('#lp-view-expand-toggle span.fa').toggleClass('fa-expand');
             });
             {% else %}
             $('#lp-view-expand-button, #lp-view-expand-toggle').on('click', function (e) {
                 e.preventDefault();
-
                 $('#learning_path_main').toggleClass('lp-view-collapsed');
-
                 $('#lp-view-expand-toggle span.fa').toggleClass('fa-expand');
                 $('#lp-view-expand-toggle span.fa').toggleClass('fa-compress');
             });
@@ -274,105 +266,72 @@
 
                 $('.lp-view-tabs').fadeIn();
             });
-
-            loadForumThread({{ lp_id }}, {{ lp_current_item_id }});
+    
+          loadForumThread({{ lp_id }}, {{ lp_current_item_id }});
             checkCurrentItemPosition({{ lp_current_item_id }});
 
-            {% if glossary_extra_tools in glossary_tool_availables %}
+        {% if glossary_extra_tools in glossary_tool_available_list %}
             // Loads the glossary library.
             (function () {
                 {% if show_glossary_in_documents == 'ismanual' %}
-                $.frameReady(
-                    function () {
-                        //  $("<div>I am a div courses</div>").prependTo("body");
-                    },
-                    "top.content_name",
-                    {
-                        load: [
-                            {type: "script", id: "_fr1", src: "{{ jquery_web_path }}"},
-                            {type: "script", id: "_fr4", src: "{{ jquery_ui_js_web_path }}"},
-                            {type: "stylesheet", id: "_fr5", src: "{{ jquery_ui_css_web_path }}"},
-                            {type: "script", id: "_fr2", src: "{{ _p.web_lib }}javascript/jquery.highlight.js"},
-                            {{ fix_link }}
+                    $.frameReady(
+                        function(){
+                            //  $("<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 }}
+                            ]},
+                            { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
                         ]
-                    }
-                );
+                    );
                 {% elseif show_glossary_in_documents == 'isautomatic' %}
-                $.frameReady(
-                    function () {
-                        //  $("<div>I am a div courses</div>").prependTo("body");
-                    },
-                    "top.content_name",
-                    {
-                        load: [
-                            {type: "script", id: "_fr1", src: "{{ jquery_web_path }}"},
-                            {type: "script", id: "_fr4", src: "{{ jquery_ui_js_web_path }}"},
-                            {type: "stylesheet", id: "_fr5", src: "{{ jquery_ui_css_web_path }}"},
-                            {type: "script", id: "_fr2", src: "{{ _p.web_lib }}javascript/jquery.highlight.js"},
-                            {{ fix_link }}
+                    $.frameReady(
+                        function(){
+                            //  $("<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 }}
+                            ]},
+                            { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
                         ]
-                    }
-                );
+                    );
                 {% elseif fix_link != '' %}
-                $.frameReady(
-                    function () {
-                        //  $("<div>I am a div courses</div>").prependTo("body");
-                    },
-                    "top.content_name",
-                    {
-                        load: [
-                            {type: "script", id: "_fr1", src: "{{ jquery_web_path }}"},
-                            {type: "script", id: "_fr4", src: "{{ jquery_ui_js_web_path }}"},
-                            {type: "stylesheet", id: "_fr5", src: "{{ jquery_ui_css_web_path }}"},
-                            {{ fix_link }}
+                    $.frameReady(
+                        function(){
+                            //  $("<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 }}
+                            ]},
+                            { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
                         ]
-                    }
-                );
+                    );
                 {% endif %}
             })();
-            {% endif %}
+        {% endif %}
+        {% if disable_js_in_lp_view == 0 %}
+            $(function() {
+                var arr = ['link', 'sco'];
 
-            $('iframe#content_id').on('load', function () {
-                $.frameReady(
-                    function () {
-                        $(document).ready(function () {
-                            $('video:not(.skip)').attr('preload', 'metadata');
-                        })
-                    },
-                    'top.content_name',
-                    {
-                        load: [
-                            {type: 'script', id: '_fr1', src: '{{ _p.web }}web/assets/jquery/dist/jquery.min.js'},
-                            {
-                                type: 'script',
-                                id: '_fr7',
-                                src: '{{ _p.web }}web/assets/MathJax/MathJax.js?config=AM_HTMLorMML'
-                            },
-                            {type: 'script', id: '_fr4', src: '{{ _p.web }}web/assets/jquery-ui/jquery-ui.min.js'},
-                            {
-                                type: 'stylesheet',
-                                id: '_fr5',
-                                src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/jquery-ui.min.css'
-                            },
-                            {
-                                type: 'stylesheet',
-                                id: '_fr6',
-                                src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/theme.css'
-                            },
-                            {type: 'script', id: '_fr3', src: '{{ _p.web_main }}glossary/glossary.js.php'},
-                            {type: 'script', id: '_fr3', src: '{{ _p.web_main }}glossary/glossary.js.php?{{ _p.web_cid_query }}'},
-                            {type: "script", id:"_fr4", src: '{{ _p.web_main }}inc/ajax/lang.ajax.php?a=translate_html&'},
-                            {type: 'script', id: '_media1', src: '{{ _p.web }}web/assets/mediaelement/build/mediaelement-and-player.min.js'},
-                            {type: 'stylesheet', id: '_media2', src: '{{ _p.web }}web/assets/mediaelement/build/mediaelementplayer.min.css'},
-                            {type: 'stylesheet', id: '_media3', src: '{{ _p.web_css_theme }}mediaelement.css'}
-                        ]
-                    }
-                );
+                if ($.inArray(olms.lms_item_type, arr) == -1) {
+                    {{ frame_ready }}
+                }
             });
-        });
+        {% endif %}
 
         $(window).on('resize', function () {
             LPViewUtils.setHeightLPToc();
         });
-    })();
+    });
 </script>

+ 0 - 84
main/template/rainbow/skill/drh_report.tpl

@@ -1,84 +0,0 @@
-{% if allow_skill_tool %}
-    <div class="btn-group">
-        <a class="btn btn-default" href="{{ _p.web_main }}social/skills_wheel.php">
-            {{ 'SkillsWheel' | get_lang }}
-        </a>
-        {% if allow_drh_skills_management %}
-            <a class="btn btn-default" href="{{ _p.web_main }}admin/skills_wheel.php">
-                {{ 'ManageSkills' | get_lang }}
-            </a>
-        {% endif %}
-    </div>
-{% endif %}
-
-<h1 class="page-header">{{ 'Skills' | get_lang }}</h1>
-<div class="row">
-    <div class="col-md-6">
-        <form class="form-inline" method="post" action="{{ _p.web_self }}">
-            <label for="course">{{ 'Courses' | get_lang }}</label>
-            <select name="course" id="course">
-                <option value="0">{{ 'Select' | get_lang }}</option>
-                {% for course in courses %}
-                    <option value="{{ course.id }}" {{ (course.id == selected_course) ? 'selected' : '' }}>{{ course.title }}</option>
-                {% endfor %}
-            </select>
-            <button type="submit" class="btn btn-default">
-                {{ 'Filter' | get_lang }}
-            </button>
-        </form>
-    </div>
-    <div class="col-md-6">
-        <form class="form-inline" method="post" action="{{ _p.web_self }}">
-            <label for="skill">{{ 'Skills' | get_lang }}</label>
-            <select name="skill" id="skill">
-                <option value="0">{{ 'Select' | get_lang }}</option>
-                {% for skill in skills %}
-                    <option value="{{ skill.id }}" {{ (skill.id == selected_skill) ? 'selected' : '' }}>
-                        {{ skill.name }}
-                    </option>
-                {% endfor %}
-            </select>
-            <button type="submit" class="btn btn-default"><em class="fa fa-filter"></em>
-                {{ 'Filter' | get_lang }}
-            </button>
-        </form>
-    </div>
-</div>
-
-<h2 class="page-header">{{ report_title }}</h2>
-{% if rows %}
-    <table class="table">
-        <thead>
-        <tr>
-            {% if action == 'filterByCourse' %}
-                <th>{{ 'Course' | get_lang }}</th>
-                <th>{{ 'Skill' | get_lang }}</th>
-                <th>{{ 'Student' | get_lang }}</th>
-                <th>{{ 'Date' | get_lang }}</th>
-            {% elseif action == 'filterBySkill' %}
-                <th>{{ 'Skill' | get_lang }}</th>
-                <th>{{ 'Student' | get_lang }}</th>
-                <th>{{ 'Date' | get_lang }}</th>
-                <th>{{ 'Course' | get_lang }}</th>
-            {% endif %}
-        </tr>
-        </thead>
-        <tbody>
-        {% for row in rows %}
-            <tr>
-                {% if action == 'filterByCourse' %}
-                    <td><img src="{{ row.courseImage }}" alt="{{ row.c_name }}"> {{ row.c_name }}</td>
-                    <td>{{ row.skill_name }}</td>
-                    <td>{{ row.complete_name }}</td>
-                    <td>{{ row.achieved_at }}</td>
-                {% elseif action == 'filterBySkill' %}
-                    <td>{{ row.skill_name }}</td>
-                    <td>{{ row.complete_name }}</td>
-                    <td>{{ row.achieved_at }}</td>
-                    <td><img src="{{ row.course_image }}" alt="{{ row.c_name }}"> {{ row.c_name }}</td>
-                {% endif %}
-            </tr>
-        {% endfor %}
-        </tbody>
-    </table>
-{% endif %}