@ -2130,48 +2130,91 @@ function attach_glossary_into_scorm(type) {
});
}
if (type == 'fix_links') {
$(document).ready(function() {
var objects = $("iframe").contents().find('object');
var pathname = location.pathname;
var coursePath = pathname.substr(0, pathname.indexOf('/main/'));
var url = "http://"+location.host + coursePath+"/courses/proxy.php?";
if (type == 'fix_links') {
$(document).ready(function() {
var objects = $("iframe").contents().find('object');
objects.each(function (value, obj) {
var pathname = location.pathname;
var coursePath = pathname.substr(0, pathname.indexOf('/main/'));
var url = "http://"+location.host + coursePath+"/courses/proxy.php?";
var dialogId = this.id +'_dialog';
var openerId = this.id +'_opener';
objects.each(function (value, obj) {
var link = '<aid="'+openerId+'"href="#"class="btn">'+
'<divstyle="text-align: center"><imgsrc="<?phpechoapi_get_path(WEB_CODE_PATH).'img/play-circle-8x.png';?>"/><br/>If video does not work, try clicking here.</div></a>';
var embed = $("iframe").contents().find("#"+this.id).find('embed').first();
var dialogId = this.id +'_dialog';
var openerId = this.id +'_opener';
var height = embed.attr('height');
var width = embed.attr('width');
var src = embed.attr('src').replace('https', 'http');
var link = '<aid="'+openerId+'"href="#"class="generated btn">'+
'<divstyle="text-align: center"><imgsrc="<?phpechoapi_get_path(WEB_CODE_PATH).'img/play-circle-8x.png';?>"/><br/>If video does not work, try clicking here.</div></a>';
var embed = $("iframe").contents().find("#"+this.id).find('embed').first();
var completeUrl = url + 'width='+embed.attr('width')+
var w = window.open(completeUrl, "Video", "width="+width+", "+"height="+height+"");
w = window.document.title = 'Video';
});
});
var iframes = $("iframe").contents().find('iframe');
iframes.each(function (value, obj) {
var randLetter = String.fromCharCode(65 + Math.floor(Math.random() * 26));
var uniqid = randLetter + Date.now();
var openerId = uniqid +'_opener';
var link = '<aid="'+openerId+'"class="generated"href="#">If iframe does not work, try clicking here. <imgsrc="<?phpechoapi_get_path(WEB_CODE_PATH).'img/link-external.png';?>"/></a>';
var embed = $(this);
var height = embed.attr('height');
var width = embed.attr('width');
var src = embed.attr('src');
var completeUrl = url + 'width='+embed.attr('width')+
'&height='+height+
'&type=iframe'+
'&id='+uniqid+
'&src='+src+
'&width='+width;
var result = $("iframe").contents().find('#'+openerId);