Fix links see BT#10217

1.9.x
Julio 10 years ago
parent 85b8a04212
commit 17dee5bbec
  1. 11
      main/inc/lib/javascript/fixlinks.js
  2. 2
      main/newscorm/blank.php
  3. 27
      main/newscorm/scorm_api.php

@ -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('<br />' + 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('<br />' + link);
if ($(this).next().attr('class') != 'generated') {
if (embed.next().attr('class') != 'generated') {
$(this).parent().append(link + '<br />');
$('#' + 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 = $('<a>(Alternative link)</a>').attr("href", src).attr('target', '_blank').attr('class', 'generated');
var myAnchor = $('<a><img src="../../../img/link-external.png "/></a>').attr("href", src).attr('target', '_blank').attr('class', 'generated');
$(this).after(myAnchor);
$(this).after('-');
}

@ -43,7 +43,7 @@ if (isset($_GET['error'])) {
$src = $_SESSION['x_frame_source'];
$icon = '&nbsp;<i class="icon-external-link icon-2x"></i>';
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
);

@ -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>';
$("iframe").contents().find("#"+this.id).append('<br />' + link);
$("iframe").contents().find("#"+this.id).append(link + '<br />');
$("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 + '<br />');
$("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 + '<br />');
$("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 = $('<a>(Alternative link)</a>').attr("href", src).attr('target', '_blank').attr('class', 'generated');
var myAnchor = $('<a><img src="<?php echo api_get_path(WEB_CODE_PATH).'img/link-external.png'; ?>"/></a>').attr("href", src).attr('target', '_blank').attr('class', 'generated');
$(this).after(myAnchor);
$(this).after('-');
});
});
}
}

Loading…
Cancel
Save