|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
/** |
|
|
|
|
* Makes posible to load glossary items from the Glossary Tool |
|
|
|
|
* Makes possible to load glossary items from the Glossary Tool |
|
|
|
|
* This library will be loaded in: |
|
|
|
|
* |
|
|
|
|
* document/showinframes.php |
|
|
|
@ -8,18 +8,19 @@ |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
/*$(document).ready(function() { |
|
|
|
|
$(window).load(function() { |
|
|
|
|
*/ |
|
|
|
|
my_protocol = location.protocol; |
|
|
|
|
my_pathname=location.pathname; |
|
|
|
|
work_path = my_pathname.substr(0,my_pathname.indexOf('/courses/')); |
|
|
|
|
|
|
|
|
|
var ajaxRequestUrl = my_protocol+"//"+location.host+work_path+"/main/glossary/glossary_ajax_request.php"; |
|
|
|
|
var imageSource = my_protocol+"//"+location.host+work_path+"/main/inc/lib/javascript/indicator.gif"; |
|
|
|
|
var indicatorImage ='<img src="' + imageSource + '" />'; |
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
|
|
beforeSend: function(content_object) {}, |
|
|
|
|
type: "POST", |
|
|
|
|
url: my_protocol+"//"+location.host+work_path+"/main/glossary/glossary_ajax_request.php", |
|
|
|
|
url: ajaxRequestUrl, |
|
|
|
|
data: "glossary_data=true", |
|
|
|
|
success: function(datas) { |
|
|
|
|
if (datas.length==0) { |
|
|
|
@ -54,30 +55,18 @@ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//alert(n + ' ' + my_index);
|
|
|
|
|
$('body').removeHighlight().highlight(n, my_index) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var complex_array = new Array(); |
|
|
|
|
|
|
|
|
|
//mouse over event
|
|
|
|
|
//$("body .glossary-ajax").mouseover(function(){
|
|
|
|
|
//
|
|
|
|
|
//mouse on click
|
|
|
|
|
$("body").on("click", ".glossary-ajax", function(e) { |
|
|
|
|
random_id = Math.round(Math.random()*100); |
|
|
|
|
|
|
|
|
|
//div_show_id = "div_show_id"+random_id;
|
|
|
|
|
//div_content_id = "div_content_id"+random_id;
|
|
|
|
|
div_show_id = "div_show_id"; |
|
|
|
|
div_content_id = "div_content_id"; |
|
|
|
|
|
|
|
|
|
$(this).append("<div id="+div_show_id+"><div id="+div_content_id+"> </div></div>"); |
|
|
|
|
|
|
|
|
|
//$("div#"+div_show_id).attr("style","z-index:99;display:inline;float:left;position:absolute;background-color:#F2F2F2;border-bottom: 1px solid #2E2E2E;border-right: 1px solid #2E2E2E;border-left: 1px solid #2E2E2E;border-top: 1px solid #2E2E2E;color:#305582;margin-left:5px;margin-right:5px;");
|
|
|
|
|
//$("div#"+div_content_id).attr("style","z-index:99;background-color:#F2F2F2;color:#0B3861;margin-left:8px;margin-right:8px;margin-top:5px;margin-bottom:5px;");
|
|
|
|
|
|
|
|
|
|
var $target = $(this); |
|
|
|
|
|
|
|
|
|
$("#"+div_show_id).dialog("destroy"); |
|
|
|
@ -99,37 +88,16 @@ |
|
|
|
|
$.ajax({ |
|
|
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
|
|
beforeSend: function(content_object) { |
|
|
|
|
$("div#"+div_content_id).html("<img src='../../../../../../../main/inc/lib/javascript/indicator.gif' />"); |
|
|
|
|
$("div#"+div_content_id).html(indicatorImage); |
|
|
|
|
}, |
|
|
|
|
type: "POST", |
|
|
|
|
url: "../../../../../../../main/glossary/glossary_ajax_request.php", |
|
|
|
|
url: ajaxRequestUrl, |
|
|
|
|
data: "glossary_id="+my_glossary_id, |
|
|
|
|
success: function(datas) { |
|
|
|
|
$("div#"+div_content_id).html(datas); |
|
|
|
|
$("#"+div_show_id).dialog("open"); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
//mouse out event
|
|
|
|
|
/*$("body .glossary-ajax").mouseout(function(){ |
|
|
|
|
var current_element = $(this); |
|
|
|
|
div_show_id=current_element.find("div").attr("id"); |
|
|
|
|
$("div#"+div_show_id).remove(); |
|
|
|
|
});*/ |
|
|
|
|
|
|
|
|
|
//mouse click
|
|
|
|
|
|
|
|
|
|
/*$("body").on("click", ".glossary-ajax", function(){ |
|
|
|
|
var current_element = $(this); |
|
|
|
|
div_show_id=current_element.find("div").attr("id"); |
|
|
|
|
$("div#"+div_show_id).remove(); |
|
|
|
|
});*/ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
/* |
|
|
|
|
}); |
|
|
|
|
});*/ |
|
|
|
|