glossary popup improvements

skala
Julio Montoya 13 years ago
parent eaaec2244a
commit 01efe5b207
  1. 24
      main/document/showinframes.php
  2. 74
      main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_automatic.js

@ -165,6 +165,8 @@ if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
}, "top.mainFrame", }, "top.mainFrame",
{ load: [ { load: [
{type:"script", id:"_fr1", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.min.js"}, {type:"script", id:"_fr1", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.min.js"},
{type:"script", id:"_fr4", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-ui/smoothness/jquery-ui-1.8.21.custom.min.js"},
{type:"stylesheet", id:"_fr5", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-ui/smoothness/jquery-ui-1.8.21.custom.css"},
{type:"script", id:"_fr2", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js"}, {type:"script", id:"_fr2", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js"},
{type:"script", id:"_fr3", src:"'.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"} {type:"script", id:"_fr3", src:"'.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"}
] ]
@ -231,9 +233,6 @@ if ($show_web_odf) {
$execute_iframe = false; $execute_iframe = false;
} }
$is_freemind_available = $pathinfo['extension']=='mm' && api_get_setting('enable_freemind') == 'true'; $is_freemind_available = $pathinfo['extension']=='mm' && api_get_setting('enable_freemind') == 'true';
if ($is_freemind_available){ if ($is_freemind_available){
$execute_iframe = false; $execute_iframe = false;
@ -270,10 +269,8 @@ if (!$jplayer_supported && $execute_iframe) {
</script>'; </script>';
} }
Display::display_header(''); Display::display_header('');
echo '<div align="center">'; echo '<div align="center">';
$file_url_web = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$header_file.'?'.api_get_cidreq(); $file_url_web = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$header_file.'?'.api_get_cidreq();
@ -299,11 +296,8 @@ if ($jplayer_supported) {
echo '</div>'; echo '</div>';
} }
if ($is_freemind_available) { if ($is_freemind_available) {
?> ?>
<script type="text/javascript" src="<?php echo api_get_path(WEB_LIBRARY_PATH) ?>swfobject/swfobject.js"></script> <script type="text/javascript" src="<?php echo api_get_path(WEB_LIBRARY_PATH) ?>swfobject/swfobject.js"></script>
<style type="text/css"> <style type="text/css">
#flashcontent { #flashcontent {
@ -311,19 +305,15 @@ if ($is_freemind_available) {
padding-top:10px; padding-top:10px;
} }
</style> </style>
<script type="text/javascript">
function giveFocus()
{
document.visorFreeMind.focus();
}
</script>
<div id="flashcontent" onmouseover="giveFocus();"> <div id="flashcontent" onmouseover="giveFocus();">
Flash plugin or Javascript are turned off. Flash plugin or Javascript are turned off.
Activate both and reload to view the mindmap Activate both and reload to view the mindmap
</div> </div>
<script>
function giveFocus() {
document.visorFreeMind.focus();
}
<script type="text/javascript">
document.onload=giveFocus; document.onload=giveFocus;
// <![CDATA[ // <![CDATA[
// for allowing using http://.....?mindmap.mm mode // for allowing using http://.....?mindmap.mm mode
@ -368,9 +358,7 @@ if ($is_freemind_available) {
fo.write("flashcontent"); fo.write("flashcontent");
// ]]> // ]]>
</script> </script>
<?php <?php
} }

@ -1,13 +1,11 @@
/** /**
* Makes posible to load glossary items from the Glossary Tool
Makes posible to load glossary items from the Glossary Tool * This library will be loaded in:
This library will be loaded in: *
* document/showinframes.php
document/showinframes.php * newscorm/lp_view.php
newscorm/lp_view.php * newscorm/scorm_api.php
newscorm/scorm_api.php *
*/ */
/*$(document).ready(function() { /*$(document).ready(function() {
@ -64,21 +62,49 @@ newscorm/scorm_api.php
var complex_array = new Array(); var complex_array = new Array();
//mouse over event //mouse over event
$("body .glossary-ajax").mouseover(function(){ //$("body .glossary-ajax").mouseover(function(){
//
//mouse on click
$("body").on("click", ".glossary-ajax", function(e) {
random_id = Math.round(Math.random()*100); 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"+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+">&nbsp;</div></div>"); $(this).append("<div id="+div_show_id+"><div id="+div_content_id+">&nbsp;</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;"); //$("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;");
//my_position = $(this).position();
var $target = $(this);
//alert(my_position.left +' + '+ my_position.top +' +' + $(this).offset().left);
$("#"+div_show_id).dialog("destroy");
$("#"+div_show_id).dialog({
autoOpen: false,
width: 600,
height: 200,
position: { my: 'left top', at: 'right top', of: $target },
close: function(){
$("div#"+div_show_id).remove();
$("div#"+div_content_id).remove();
}
});
notebook_id = $(this).attr("name"); notebook_id = $(this).attr("name");
data_notebook = notebook_id.split("link"); data_notebook = notebook_id.split("link");
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(content_object) {
$("div#"+div_content_id).html("<img src='../../../../../../../main/inc/lib/javascript/indicator.gif' />"); }, $("div#"+div_content_id).html("<img src='../../../../../../../main/inc/lib/javascript/indicator.gif' />");
},
type: "POST", type: "POST",
url: "../../../../../../../main/glossary/glossary_ajax_request.php", url: "../../../../../../../main/glossary/glossary_ajax_request.php",
data: "glossary_id="+my_glossary_id, data: "glossary_id="+my_glossary_id,
@ -86,15 +112,23 @@ newscorm/scorm_api.php
$("div#"+div_content_id).html(datas); $("div#"+div_content_id).html(datas);
} }
}); });
$("#"+div_show_id).dialog("open");
}); });
//mouse out event //mouse out event
$("body .glossary-ajax").mouseout(function(){ /*$("body .glossary-ajax").mouseout(function(){
var current_element, var current_element = $(this);
current_element=$(this);
div_show_id=current_element.find("div").attr("id"); div_show_id=current_element.find("div").attr("id");
$("div#"+div_show_id).remove(); $("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();
});*/
} }

Loading…
Cancel
Save