This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
pfwb_thesaurus/pfwb_thesaurus/templates/thesaurus/plone_popup.html

37 lines
1.2 KiB
HTML

{% extends "thesaurus/term_list.html" %}
{% block aftercontent %}
<script>
function thesaurus_popup_init() {
$('#term-content a, #thesaurus-terms a').unbind('click').click(function() {
$.ajax({
url: $(this).attr('href'),
success: function(data, status) {
$('#entry-points').hide();
$('#term-content').empty();
$(data).find('table').appendTo($('#term-content'));
$('#term-content').find('button').show().click(function() {
var orig_link = $('a[rel=#' + $(this).parents('.overlay-ajax').attr('id') + ']');
var orig_input = $(orig_link).parent().find('input')[0];
var orig_ac_input = $(orig_link).parent().find('input')[1];
$(orig_input).val($(orig_input).val() + ' ' + $(this).data('term-id'));
var labelbox = create_labelbox(
orig_ac_input,
$(this).data('term-id'),
$(this).parent().find('h2').text());
$(orig_link).before(labelbox);
$('.close').click();
});
thesaurus_popup_init();
$('#term-content').show();
}
});
return false;
});
}
thesaurus_popup_init();
</script>
{% endblock %}