$(function () { var widget=$('.venn-pane'); var navid=widget.attr('data-navid'); $('#'+navid).on('shown.bs.tab', function (e) { redrawVENN('topics-venn'); }); function topicsVENN(data, info) { if (window.debugmode) console.log('got topics venn', {info: info, sets:data}); VENN(data, 'topics-venn'); $('.topics-venn-info').empty(); if (info && info.skipped && info.skipped.length>0) { var $info=$('').appendTo($('.topics-venn-info')); var text=''; switch (info.skiptype) { case 'SINGLEOR': text=''+info.skipped[0][2]+' has not been included in the diagram as this matches the entire selection'; break; case 'NOTENOUGH': text='Unable to show a VENN diagram when the selection only contains one article'; break; case 'AND': text='Any terms that are included in an AND search are not shown in the VENN as these match the entire selection'; break; } $info.html(text); } } function filter(active) { if (active) { widget.addClass('filtering'); } if (!active) { widget.removeClass('filtering'); } } if ($('#ftrindex').length) { var ftrindex = $('#ftrindex').data('handle'); ftrindex.attachHook('topics-venn', 'venn', topicsVENN, {field: 'keywords'}); ftrindex.attachHook('topics-venn-project', 'filter', filter); } else { console.log('#ftrindex has no length, abort mission.') } }); /*******************************************************************/ /* ftrtch dino */ /* [type: JS] [file:project-topics-venn] [38.1138] DESIGN*/ /*******************************************************************/ /* 0.7 D>D */ /* db 156 */