From 373437ce953fcd7dcc617aaf9fb3861759729bc6 Mon Sep 17 00:00:00 2001 From: Isaac Flores Date: Thu, 16 Jul 2009 23:41:09 +0200 Subject: [PATCH] [svn r22171] minor-logic changes-added javascript - (partial FS#4337) --- .../plugins/glossary/fck_glossary.js.php | 1 - .../glossary/fck_glossary_automatic.js | 49 +++++++++++++++++++ .../plugins/glossary/fck_glossary_manual.js | 30 ++++++++++++ 3 files changed, 79 insertions(+), 1 deletion(-) delete mode 100755 main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary.js.php create mode 100755 main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_automatic.js create mode 100755 main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_manual.js diff --git a/main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary.js.php b/main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary.js.php deleted file mode 100755 index 8b13789179..0000000000 --- a/main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary.js.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_automatic.js b/main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_automatic.js new file mode 100755 index 0000000000..9ded999763 --- /dev/null +++ b/main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_automatic.js @@ -0,0 +1,49 @@ +$(document).ready(function() { + $(window).load(function () { + var my_text=$("body").html(); + $.ajax({ + contentType: "application/x-www-form-urlencoded", + beforeSend: function(objeto) { + }, + type: "POST", + url: "../../../main/glossary/glossary_ajax_request.php", + data: "glossary_data=true", + success: function(datos) { + data_terms=datos.split("[|.|_|.|-|.|]"); + for(i=0;i"+specific_terms[1]+""); + $("body").html(new_html); + my_text=$("body").html(); + } + $("body .glossary-ajax").toggle(function(){ + random_id=Math.round(Math.random()*100); + div_show_id="div_show_id"+random_id; + div_content_id="div_content_id"+random_id; + $(this).append("
 
"); + $("div#"+div_show_id).attr("style","display:inline;float:left;position:absolute;background-color:#F5F6CE;border-bottom: 1px dashed #dddddd;border-right: 1px dashed #dddddd;border-left: 1px dashed #dddddd;border-top: 1px dashed #dddddd;color:#305582;margin-left:5px;margin-right:5px;"); + $("div#"+div_content_id).attr("style","background-color:#F5F6CE;color:#305582;margin-left:8px;margin-right:8px;margin-top:5px;margin-bottom:5px;"); + notebook_id=$(this).attr("name"); + data_notebook=notebook_id.split("link"); + my_glossary_id=data_notebook[1]; + $.ajax({ + contentType: "application/x-www-form-urlencoded", + beforeSend: function(objeto) { + $("div#"+div_content_id).html(""); }, + type: "POST", + url: "../../../main/glossary/glossary_ajax_request.php", + data: "glossary_id="+my_glossary_id, + success: function(datos) { + $("div#"+div_content_id).html(datos); + } + }); + },function(){ + var current_element, + current_element=$(this); + div_show_id=current_element.find("div").attr("id"); + $("div#"+div_show_id).remove(); + }); } + + }); + }); +}); \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_manual.js b/main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_manual.js new file mode 100755 index 0000000000..ad4dccc13f --- /dev/null +++ b/main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary_manual.js @@ -0,0 +1,30 @@ +$(document).ready(function() { + $(window).load(function () { + $("body .glossary").mouseover(function(){ + is_glossary_name=$(this).html(); + random_id=Math.round(Math.random()*100); + div_show_id="div_show_id"+random_id; + div_content_id="div_content_id"+random_id; + $(this).append("
 
"); + $("div#"+div_show_id).attr("style","display:inline;float:left;position:absolute;background-color:#F5F6CE;border-bottom: 1px dashed #dddddd;border-right: 1px dashed #dddddd;border-left: 1px dashed #dddddd;border-top: 1px dashed #dddddd;color:#305582;margin-left:5px;margin-right:5px;"); + $("div#"+div_content_id).attr("style","background-color:#F5F6CE;color:#305582;margin-left:8px;margin-right:8px;margin-top:5px;margin-bottom:5px;"); + + $.ajax({ + contentType: "application/x-www-form-urlencoded", + beforeSend: function(objeto) { + $("div#"+div_content_id).html(""); }, + type: "POST", + url: "../../../main/glossary/glossary_ajax_request.php", + data: "glossary_name="+is_glossary_name, + success: function(datos) { + $("div#"+div_content_id).html(datos); + } + }); + }); + $("body .glossary").mouseout(function(){ + current_element=$(this); + div_show_id=current_element.find("div").attr("id"); + $("div#"+div_show_id).remove(); + }); + }); +}); \ No newline at end of file