|
|
|
@ -180,7 +180,6 @@ $(document).ready( function() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready( function() { |
|
|
|
$(document).ready( function() { |
|
|
|
$("iframe").contents().find('head').append('<script src="/main/inc/lib/javascript/jquery.highlight.js" type="text/javascript" language="javascript"></script>'); |
|
|
|
|
|
|
|
$("iframe#content_id").load( function(){ |
|
|
|
$("iframe#content_id").load( function(){ |
|
|
|
//alert("Document title: " + $("iframe#content_id").attr('src')); |
|
|
|
//alert("Document title: " + $("iframe#content_id").attr('src')); |
|
|
|
info_lms_item[0]=info_lms_item[1]; |
|
|
|
info_lms_item[0]=info_lms_item[1]; |
|
|
|
@ -188,7 +187,10 @@ $(document).ready( function() { |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
if (api_get_setting('show_glossary_in_extra_tools') == 'true') { |
|
|
|
if (api_get_setting('show_glossary_in_extra_tools') == 'true') { |
|
|
|
?> |
|
|
|
?> |
|
|
|
attach_glossary_into_scorm(); |
|
|
|
if (lms_lp_type == 2) { //Only scorm |
|
|
|
|
|
|
|
attach_glossary_into_scorm(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
<?php |
|
|
|
<?php |
|
|
|
} |
|
|
|
} |
|
|
|
?> |
|
|
|
?> |
|
|
|
@ -1593,6 +1595,7 @@ if(lms_lp_type==1 || lms_item_type=='asset'){ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function attach_glossary_into_scorm() { |
|
|
|
function attach_glossary_into_scorm() { |
|
|
|
var f = $('#content_id')[0]; |
|
|
|
var f = $('#content_id')[0]; |
|
|
|
|
|
|
|
|
|
|
|
var doc = f.contentWindow ? f.contentWindow.document : |
|
|
|
var doc = f.contentWindow ? f.contentWindow.document : |
|
|
|
f.contentDocument ? f.contentDocument : f.document; |
|
|
|
f.contentDocument ? f.contentDocument : f.document; |
|
|
|
|
|
|
|
|
|
|
|
@ -1605,49 +1608,24 @@ function attach_glossary_into_scorm() { |
|
|
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
|
beforeSend: function(content_object) { |
|
|
|
beforeSend: function(objeto) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
type: "POST", |
|
|
|
type: "POST", |
|
|
|
url: my_protocol+"//"+location.host+work_path+"/main/glossary/glossary_ajax_request.php", |
|
|
|
url: my_protocol+"//"+location.host+work_path+"/main/glossary/glossary_ajax_request.php", |
|
|
|
data: "glossary_data=true", |
|
|
|
data: "glossary_data=true", |
|
|
|
success: function(datas) { |
|
|
|
success: function(datos) { |
|
|
|
if (datas.length==0) { |
|
|
|
if (datos.length==0) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
data_terms=datos.split("[|.|_|.|-|.|]"); |
|
|
|
data_terms=datas.split("[|.|_|.|-|.|]"); |
|
|
|
|
|
|
|
var complex_array = new Array(); |
|
|
|
|
|
|
|
var cp_complex_array = new Array(); |
|
|
|
|
|
|
|
for(i=0;i<data_terms.length;i++) { |
|
|
|
for(i=0;i<data_terms.length;i++) { |
|
|
|
specific_terms=data_terms[i].split("__|__|"); |
|
|
|
specific_terms=data_terms[i].split("__|__|"); |
|
|
|
var real_term = specific_terms[1]; |
|
|
|
var real_term = specific_terms[1]; |
|
|
|
var real_code = specific_terms[0]; |
|
|
|
var my_specific_terms = new RegExp('(^|)'+specific_terms[1]+'[^ ]?',"gi"); |
|
|
|
complex_array[real_code] = real_term; |
|
|
|
new_html=my_text.replace(my_specific_terms,function(m){return replace_complete_char(m)}); |
|
|
|
cp_complex_array[real_code] = real_term; |
|
|
|
$frame_content.html(new_html); |
|
|
|
|
|
|
|
my_text=$frame_content.html(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
complex_array.reverse(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var my_index in complex_array) { |
|
|
|
|
|
|
|
n = complex_array[my_index]; |
|
|
|
|
|
|
|
if (n == null) { |
|
|
|
|
|
|
|
n = ''; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
for (var cp_my_index in cp_complex_array) { |
|
|
|
|
|
|
|
cp_data = cp_complex_array[cp_my_index]; |
|
|
|
|
|
|
|
if (cp_data == null) { |
|
|
|
|
|
|
|
cp_data = ''; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (cp_data == n) { |
|
|
|
|
|
|
|
my_index = cp_my_index; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$("iframe").contents().find('body').removeHighlight().highlight(n,my_index) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var complex_array = new Array(); |
|
|
|
|
|
|
|
//mouse over event |
|
|
|
//mouse over event |
|
|
|
$("iframe").contents().find('body').find('.glossary-ajax').mouseover(function(){ |
|
|
|
$("iframe").contents().find('body').find('.glossary-ajax').mouseover(function(){ |
|
|
|
random_id=Math.round(Math.random()*100); |
|
|
|
random_id=Math.round(Math.random()*100); |
|
|
|
@ -1661,13 +1639,13 @@ function attach_glossary_into_scorm() { |
|
|
|
my_glossary_id=data_notebook[1]; |
|
|
|
my_glossary_id=data_notebook[1]; |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
|
beforeSend: function(content_object) { |
|
|
|
beforeSend: function(objeto) { |
|
|
|
$("iframe").contents().find('body').find("div#"+div_content_id).html("<img src="+my_protocol+"//"+location.host+work_path+"/main/inc/lib/javascript/indicator.gif />"); }, |
|
|
|
$("iframe").contents().find('body').find("div#"+div_content_id).html("<img src="+my_protocol+"//"+location.host+work_path+"/main/inc/lib/javascript/indicator.gif />"); }, |
|
|
|
type: "POST", |
|
|
|
type: "POST", |
|
|
|
url: my_protocol+"//"+location.host+work_path+"/main/glossary/glossary_ajax_request.php", |
|
|
|
url: my_protocol+"//"+location.host+work_path+"/main/glossary/glossary_ajax_request.php", |
|
|
|
data: "glossary_id="+my_glossary_id, |
|
|
|
data: "glossary_id="+my_glossary_id, |
|
|
|
success: function(datas) { |
|
|
|
success: function(datos) { |
|
|
|
$("iframe").contents().find('body').find("div#"+div_content_id).html(datas); |
|
|
|
$("iframe").contents().find('body').find("div#"+div_content_id).html(datos); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -1679,6 +1657,13 @@ function attach_glossary_into_scorm() { |
|
|
|
$("iframe").contents().find('body').find("div#"+div_show_id).remove(); |
|
|
|
$("iframe").contents().find('body').find("div#"+div_show_id).remove(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Callback Helper |
|
|
|
|
|
|
|
function replace_complete_char(m) { |
|
|
|
|
|
|
|
var complete_term_pattern = new RegExp(real_term,"i"); |
|
|
|
|
|
|
|
var tag = m.replace(complete_term_pattern," <span class=\"glossary-ajax\" style='color:blue' name=\"link"+specific_terms[0]+"\">$&</span>"); |
|
|
|
|
|
|
|
return tag; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|