// Configuration Dictionary = { container_id: 'paragrafen', nodes_per_batch: 1000, class_name: 'term', load_condition: function() { return document.body.className.indexOf('verhalen') != -1 } } // Executes the highlighter on a particular element with a dictionary Dictionary.execute = function(elem, dict) { // build a regexp for the words in the dictionary var words = new Array(); var definitions = {}; for(var i=0; i 0) { count ++; if (count >= Dictionary.nodes_per_batch) { var handler = function() { Dictionary.walkElements(node, depth, textproc); }; setTimeout(handler, 50); return; } if (node.nodeType == 1) { // ELEMENT_NODE if (!skipre.test(node.tagName) && node.childNodes.length > 0) { node = node.childNodes[0]; depth ++; continue; } } else if (node.nodeType == 3) { // TEXT_NODE node = textproc(node); } if (node.nextSibling) { node = node.nextSibling; } else { while (depth > 0) { node = node.parentNode; depth--; if (node.nextSibling) { node = node.nextSibling; break; } } } } }; Dictionary.load = function() { if(Dictionary.load_condition()) { var q42dictionary = []; function _d(s,s2) { q42dictionary[q42dictionary.length]={text:s,intro:s2}; } _d( "Vol d'oiseau", "Vogelvluchtperspectief " ); _d( "Boussole", "Hoekmeetinstrument " ); _d( "Morgentalen", "Voorloper van kadaster" ); _d( "Prekadastrale kaart", "Voorloper van de kadastrale kaart " ); _d( "Calque", "Vervaardigd op kalkpapier" ); _d( "Baggeren", "Het verwijderen van zand, slib en andere lagen van de waterbodem, om waterwegen bevaarbaar en havens bereikbaar te houden " ); _d( "Cirkel van Dou", "Hoekmeetinstrument" ); _d( "Griend", "Een griend is een bos of akker, op een moerasachtige ondergrond. Van oudsher worden er wilgen en riet aangeplant, die gebruikt werden voor het maken van meubilair, manden, bezems etc. " ); _d( "Nieuw woord", "Korte intro" ); _d( "Snaphaan", "Soort geweer" ); var el = document.getElementById(Dictionary.container_id); if(el) Dictionary.execute(el,q42dictionary); } } Dictionary.popup = function(event, win, doc, span, txt) { var w = 450; var h = 500; var t = (parseInt(self.screen.height)/2) - h/2; var l = (parseInt(self.screen.width)/2) - w/2; var popup = window.open("/woordenboek/showterm.asp?txt="+win.innerHTML, "_dictionaryTerm", "toolbar=no,status=no,resizable=no,top="+t+",left="+l+",width="+w+",height="+h); popup.focus(); } // Trigger the dictionary using the onload handler. if (window.attachEvent) { window.attachEvent('onload', Dictionary.load); } else if (window.addEventListener) { window.addEventListener('load', Dictionary.load, false); } else { var __onload = window.onload; window.onload = function() { Dictionary.load(); __onload(); }; }