Actualización
This commit is contained in:
10
main/template/default/glossary/export_pdf.tpl
Normal file
10
main/template/default/glossary/export_pdf.tpl
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<h2>{{ 'Glossary'|get_lang }}</h2>
|
||||
{% for item in items %}
|
||||
<h4>{{ item.0 }}</h4>
|
||||
{{ item.1 }}
|
||||
{% endfor %}
|
||||
</body>
|
||||
</html>
|
||||
121
main/template/default/glossary/glossary_auto.js.tpl
Normal file
121
main/template/default/glossary/glossary_auto.js.tpl
Normal file
@@ -0,0 +1,121 @@
|
||||
{% if add_ready %}
|
||||
$(document).ready(function() {
|
||||
$(window).on("load", function () {
|
||||
{% endif %}
|
||||
var my_text = $(".glossary-content").html();
|
||||
var ajaxRequestUrl = "{{ _p.web }}main/glossary/glossary_ajax_request.php?{{ _p.web_cid_query }}";
|
||||
var imageSource = "{{ _p.web }}main/inc/lib/javascript/indicator.gif";
|
||||
var indicatorImage ='<img src="' + imageSource + '" />';
|
||||
var termsArray = new Array(); // needed in this function for a wide scope
|
||||
var termsArrayCopy = new Array();
|
||||
|
||||
$.ajax({
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
beforeSend: function(content_object) {},
|
||||
type: "POST",
|
||||
url: ajaxRequestUrl,
|
||||
data: "glossary_data=true",
|
||||
success: function(datas) {
|
||||
if (datas.length==0) {
|
||||
return false;
|
||||
}
|
||||
// glossary terms
|
||||
data_terms=datas.split("[|.|_|.|-|.|]");
|
||||
var complex_array = new Array();
|
||||
var cp_complex_array = new Array();
|
||||
for(i=0;i<data_terms.length;i++) {
|
||||
specific_terms=data_terms[i].split("__|__|");
|
||||
var real_term = specific_terms[1]; // glossary term
|
||||
var real_code = specific_terms[0]; // glossary id
|
||||
termsArray[real_code] = real_term;
|
||||
termsArrayCopy[real_code] = real_term;
|
||||
}
|
||||
|
||||
termsArray.reverse();
|
||||
|
||||
for (var my_index in termsArray) {
|
||||
n = termsArray[my_index];
|
||||
if (n == null) {
|
||||
n = '';
|
||||
} else {
|
||||
for (var cp_my_index in termsArrayCopy) {
|
||||
cp_data = termsArrayCopy[cp_my_index];
|
||||
if (cp_data == null) {
|
||||
cp_data = '';
|
||||
} else {
|
||||
if (cp_data == n) {
|
||||
my_index = cp_my_index;
|
||||
}
|
||||
}
|
||||
}
|
||||
$('body').removeHighlight().highlight(n, my_index);
|
||||
}
|
||||
}
|
||||
|
||||
//mouse on click
|
||||
$("body").on("click", ".glossary-ajax", function(e) {
|
||||
random_id = Math.round(Math.random()*100);
|
||||
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>");
|
||||
var $target = $(this);
|
||||
|
||||
//$("#"+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");
|
||||
data_notebook = notebook_id.split("link");
|
||||
my_glossary_id = data_notebook[1];
|
||||
|
||||
$.ajax({
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
beforeSend: function(content_object) {
|
||||
$("div#"+div_content_id).html(indicatorImage);
|
||||
},
|
||||
type: "POST",
|
||||
url: ajaxRequestUrl,
|
||||
data: "glossary_id="+my_glossary_id,
|
||||
success: function(datas) {
|
||||
$("div#"+div_content_id).html(datas);
|
||||
|
||||
// Make sure the dialog opens also with links to other
|
||||
// glossary terms
|
||||
for (var my_index in termsArray) {
|
||||
n = termsArray[my_index];
|
||||
if (n == null) {
|
||||
n = '';
|
||||
} else {
|
||||
for (var cp_my_index in termsArrayCopy) {
|
||||
cp_data = termsArrayCopy[cp_my_index];
|
||||
if (cp_data == null) {
|
||||
cp_data = '';
|
||||
} else {
|
||||
if (cp_data == n) {
|
||||
my_index = cp_my_index;
|
||||
}
|
||||
}
|
||||
}
|
||||
$("div#"+div_content_id).highlight(n, my_index);
|
||||
}
|
||||
}
|
||||
$("#"+div_show_id).dialog("open");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
{% if add_ready %}
|
||||
});
|
||||
});
|
||||
|
||||
{% endif %}
|
||||
49
main/template/default/glossary/glossary_manual.js.tpl
Normal file
49
main/template/default/glossary/glossary_manual.js.tpl
Normal file
@@ -0,0 +1,49 @@
|
||||
var ajaxRequestUrl = "{{ _p.web }}main/glossary/glossary_ajax_request.php?{{ _p.web_cid_query }}";
|
||||
var imageSource = "{{ _p.web_main }}" + "inc/lib/javascript/indicator.gif";
|
||||
var indicatorImage ='<img src="' + imageSource + '" />';
|
||||
|
||||
{% if add_ready %}
|
||||
$(document).ready(function() {
|
||||
{% endif %}
|
||||
$("body").on("click", ".glossary", function() {
|
||||
is_glossary_name = $(this).html();
|
||||
random_id = Math.round(Math.random()*100);
|
||||
div_show_id = "div_show_id";
|
||||
div_content_id = "div_content_id";
|
||||
|
||||
var $target = $(this);
|
||||
var title = $target.text();
|
||||
|
||||
$(this).append("<div id="+div_show_id+" title="+title+" ><div id="+div_content_id+"> </div></div>");
|
||||
|
||||
|
||||
//$("#"+div_show_id).dialog("destroy");
|
||||
$("#"+div_show_id).dialog({
|
||||
autoOpen: false,
|
||||
width: 500,
|
||||
height: 'auto',
|
||||
position: { my: 'left top', at: 'right top', of: $target },
|
||||
close: function(){
|
||||
$("div#"+div_show_id).remove();
|
||||
$("div#"+div_content_id).remove();
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
beforeSend: function(result) {
|
||||
$("div#"+div_content_id).html(indicatorImage);
|
||||
},
|
||||
type: "POST",
|
||||
url: ajaxRequestUrl,
|
||||
data: "glossary_name="+is_glossary_name,
|
||||
success: function(data) {
|
||||
$("div#"+div_content_id).html(data);
|
||||
$("#"+div_show_id).dialog("open");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
{% if add_ready %}
|
||||
});
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user