diff --git a/main/inc/lib/javascript/fixlinks.js b/main/inc/lib/javascript/fixlinks.js
index 6f247c0016..cd1b9e2697 100644
--- a/main/inc/lib/javascript/fixlinks.js
+++ b/main/inc/lib/javascript/fixlinks.js
@@ -13,7 +13,7 @@ $(document).ready(function() {
var width = embed.attr('width');
var src = embed.attr('src').replace('https', 'http');
- var completeUrl = url + 'width='+embed.attr('width')+
+ var completeUrl = url + 'width='+embed.attr('width')+
'&height='+height+
'&id='+this.id+
'&flashvars='+encodeURIComponent(embed.attr('flashvars'))+
@@ -23,7 +23,6 @@ $(document).ready(function() {
var result = $("#"+this.id).find('#'+openerId);
if (result.length == 0) {
$("#" + this.id).append('
' + link);
-
$('#' + openerId).click(function () {
var window = window.open(completeUrl, "Video", "width=" + width + ", " + "height=" + height + "");
window.document.title = 'Video';
@@ -50,9 +49,8 @@ $(document).ready(function() {
var result = $(this).find('#'+openerId);
if (result.length == 0) {
- $(this).parent().append('
' + link);
- if ($(this).next().attr('class') != 'generated') {
-
+ if (embed.next().attr('class') != 'generated') {
+ $(this).parent().append(link + '
');
$('#' + openerId).click(function () {
width = 1024;
height = 640;
@@ -65,11 +63,10 @@ $(document).ready(function() {
var anchors = $(document).find('a').not('.generated');
anchors.each(function (value, obj) {
-
if ($(this).next().attr('class') != 'generated') {
var src = $(this).attr('href');
src = src.replace('https', 'http');
- var myAnchor = $('(Alternative link)').attr("href", src).attr('target', '_blank').attr('class', 'generated');
+ var myAnchor = $('
').attr("href", src).attr('target', '_blank').attr('class', 'generated');
$(this).after(myAnchor);
$(this).after('-');
}
diff --git a/main/newscorm/blank.php b/main/newscorm/blank.php
index a66d27f57a..d89e3d9fe1 100755
--- a/main/newscorm/blank.php
+++ b/main/newscorm/blank.php
@@ -43,7 +43,7 @@ if (isset($_GET['error'])) {
$src = $_SESSION['x_frame_source'];
$icon = ' ';
echo Display::return_message(
- Display::url($src.$icon, $src, ['class' => 'btn', 'target' => '_blank']),
+ Display::url($src.$icon, $src, ['class' => 'btn generated', 'target' => '_blank']),
'normal',
false
);
diff --git a/main/newscorm/scorm_api.php b/main/newscorm/scorm_api.php
index 84da384ecb..5c8732df62 100755
--- a/main/newscorm/scorm_api.php
+++ b/main/newscorm/scorm_api.php
@@ -2037,7 +2037,6 @@ function attach_glossary_into_scorm(type) {
var complex_array = new Array();
- //$("iframe").contents().find("body .glossary-ajax").on("click", ".glossary-ajax", function() {
$("iframe").contents().find("body").on("click", ".glossary-ajax", function() {
div_show_id="div_show_id";
@@ -2166,17 +2165,16 @@ function attach_glossary_into_scorm(type) {
'">' +
'';
-
- $("iframe").contents().find("#"+this.id).append('
' + link);
+ $("iframe").contents().find("#"+this.id).append(link + '
');
$("iframe").contents().find('#' + openerId).click(function() {
var w = window.open(completeUrl, "Video", "width="+width+", "+"height="+height+"");
w = window.document.title = 'Video';
});
});
+ var iframes = $("iframe").contents().find('iframe');
- var iframes =$("iframe").contents().find('iframe');
- iframes.each(function (value, obj) {
+ iframes.each(function (value, obj) {
var randLetter = String.fromCharCode(65 + Math.floor(Math.random() * 26));
var uniqid = randLetter + Date.now();
var openerId = uniqid +'_opener';
@@ -2194,13 +2192,15 @@ function attach_glossary_into_scorm(type) {
var result = $("iframe").contents().find('#'+openerId);
if (result.length == 0) {
- $(this).parent().append(link + '
');
- $("iframe").contents().find('#' + openerId).click(function() {
- width = 1024;
- height = 640;
- var win = window.open(completeUrl, "Video", "width=" + width + ", " + "height=" + height + "");
- win.document.title = 'Video';
- });
+ if (embed.next().attr('class') != 'generated') {
+ $(this).parent().append(link + '
');
+ $("iframe").contents().find('#' + openerId).click(function() {
+ width = 1024;
+ height = 640;
+ var win = window.open(completeUrl, "Video", "width=" + width + ", " + "height=" + height + "");
+ win.document.title = 'Video';
+ });
+ }
}
});
@@ -2208,11 +2208,10 @@ function attach_glossary_into_scorm(type) {
anchors.each(function (value, obj) {
var src = $(this).attr('href');
src = src.replace('https', 'http');
- var myAnchor = $('(Alternative link)').attr("href", src).attr('target', '_blank').attr('class', 'generated');
+ var myAnchor = $('
').attr("href", src).attr('target', '_blank').attr('class', 'generated');
$(this).after(myAnchor);
$(this).after('-');
});
-
});
}
}