Skip to content

Commit b54c8c8

Browse files
committed
Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x
2 parents cd6e9dc + 39a0d45 commit b54c8c8

File tree

3 files changed

+37
-33
lines changed

3 files changed

+37
-33
lines changed

main/document/showinframes.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,8 @@
174174
}
175175

176176
$js_glossary_in_documents = '
177-
$.frameReady(function(){
178-
// $("<div>I am a div courses</div>").prependTo("body");
179-
}, "top.mainFrame",
180-
{
181-
load: [
182-
{ type:"script", id:"_fr1", src:"'.api_get_jquery_web_path().'"},
183-
{ type:"script", id:"_fr7", src:"'.api_get_path(WEB_PUBLIC_PATH).'assets/MathJax/MathJax.js?config=AM_HTMLorMML"},
184-
{ type:"script", id:"_fr4", src:"'.api_get_path(WEB_PUBLIC_PATH).'assets/jquery-ui/jquery-ui.min.js"},
185-
{ type:"stylesheet", id:"_fr5", src:"'.api_get_path(WEB_PUBLIC_PATH).'assets/jquery-ui/themes/smoothness/jquery-ui.min.css"},
186-
{ type:"stylesheet", id:"_fr6", src:"'.api_get_path(WEB_PUBLIC_PATH).'assets/jquery-ui/themes/smoothness/theme.css"},
187-
{ type:"script", id:"_fr2", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js"},
188-
{ type:"script", id:"_fr3", src:"'.api_get_path(WEB_CODE_PATH).'glossary/glossary.js.php?'.api_get_cidreq().'"}
189-
]
190-
});';
177+
setFrameReady("mainFrame");
178+
';
191179

192180
$web_odf_supported_files = DocumentManager::get_web_odf_extension_list();
193181
// PDF should be displayed with viewerJS

main/template/default/layout/main.js.tpl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,4 +601,34 @@ function copyTextToClipBoard(elementId)
601601
602602
/* Alert the copied text */
603603
//alert('Copied');
604+
}
605+
606+
function setFrameReady(iframeName) {
607+
$.frameReady(function () {
608+
$(document).ready(function () {
609+
$('video:not(.skip), audio:not(.skip)').mediaelementplayer({
610+
pluginPath: '{{ _p.web }}web/assets/mediaelement/build/',
611+
//renderers: ['html5', 'flash_video', 'native_flv'],
612+
features: ['{{ video_features }}'],
613+
success: function(mediaElement, originalNode, instance) {
614+
},
615+
vrPath: '{{ _p.web }}web/assets/vrview/build/vrview.js'
616+
});
617+
});
618+
}, 'top.' + iframeName, {
619+
load: [
620+
{type: 'script', id: '_fr1', src: '{{ _p.web }}web/assets/jquery/dist/jquery.min.js'},
621+
{type: 'script', id: '_fr7', src: '{{ _p.web }}web/assets/MathJax/MathJax.js?config=AM_HTMLorMML'},
622+
{type: 'script', id: '_fr4', src: '{{ _p.web }}web/assets/jquery-ui/jquery-ui.min.js'},
623+
{type: 'stylesheet', id: '_fr5', src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/jquery-ui.min.css'},
624+
{type: 'stylesheet', id: '_fr6', src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/theme.css'},
625+
{type: 'script', id: '_fr2', src: '{{ _p.web_lib }}javascript/jquery.highlight.js'},
626+
{type: 'script', id: '_fr3', src: '{{ _p.web_main }}glossary/glossary.js.php?{{ _p.web_cid_query }}'},
627+
{type: 'script', id: '_media1', src: '{{ _p.web }}web/assets/mediaelement/build/mediaelement-and-player.min.js'},
628+
{type: 'stylesheet', id: '_media2', src: '{{ _p.web }}web/assets/mediaelement/build/mediaelementplayer.min.css'},
629+
{#{type: 'script', id: '_media3', src: '{{ _p.web_lib }}javascript/iframe-js-loader.js'},#}
630+
{type: 'stylesheet', id: '_media4', src: '{{ _p.web }}web/assets/mediaelement/plugins/vrview/vrview.css'},
631+
{type: 'script', id: '_media4', src: '{{ _p.web }}web/assets/mediaelement/plugins/vrview/vrview.js'},
632+
]
633+
});
604634
}

main/template/default/learnpath/view.tpl

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -297,25 +297,11 @@
297297
{% endif %}
298298
299299
{% if disable_js_in_lp_view == 0 %}
300-
$('iframe#content_id').on('load', function () {
301-
if ('link' !== olms.lms_item_type) {
302-
$.frameReady(function () {
303-
}, 'top.content_name', {
304-
load: [
305-
{type: 'script', id: '_fr1', src: '{{ _p.web }}web/assets/jquery/dist/jquery.min.js'},
306-
{type: 'script', id: '_fr7', src: '{{ _p.web }}web/assets/MathJax/MathJax.js?config=AM_HTMLorMML'},
307-
{type: 'script', id: '_fr4', src: '{{ _p.web }}web/assets/jquery-ui/jquery-ui.min.js'},
308-
{type: 'stylesheet', id: '_fr5', src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/jquery-ui.min.css'},
309-
{type: 'stylesheet', id: '_fr6', src: '{{ _p.web }}web/assets/jquery-ui/themes/smoothness/theme.css'},
310-
{type: 'script', id: '_fr2', src: '{{ _p.web_lib }}javascript/jquery.highlight.js'},
311-
{type: 'script', id: '_fr3', src: '{{ _p.web_main }}glossary/glossary.js.php?{{ _p.web_cid_query }}'},
312-
{type: 'script', id: '_media1', src: '{{ _p.web }}web/assets/mediaelement/build/mediaelement-and-player.min.js'},
313-
{type: 'stylesheet', id: '_media2', src: '{{ _p.web }}web/assets/mediaelement/build/mediaelementplayer.min.css'},
314-
{type: 'script', id: '_media3', src: '{{ _p.web_lib }}javascript/iframe-js-loader.js'}
315-
]
316-
});
317-
}
318-
});
300+
$('iframe#content_id').on('load', function () {
301+
if ('link' !== olms.lms_item_type) {
302+
setFrameReady('content_name');
303+
}
304+
});
319305
{% endif %}
320306
});
321307

0 commit comments

Comments
 (0)