CINXE.COM
Words
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="icon" href="/img/favicon.ico"/> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <meta name="generator" content="Adobe GoLive" /> <meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1"> <title>Words</title> <!--Stylesheets and fonts--> <link href="css/layout.css" rel="stylesheet" type="text/css" media="all" /> <link href="/css/layout_head_foot.css" rel="stylesheet" type="text/css" media="all" /> <link href="/css/biscuit_notification.css" rel="stylesheet" type="text/css" media="all" /> <!-- Scripts--> <script src="../js/jquery-3.1.1.min.js"></script> <script src="../js/resp_header.js"></script> <script src="../js/deliciousmunchies_warning.js"></script> <!-- jquery slider --> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <!-- Script for automatic renewal page in select <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script> ASK MARK --> <!-- Script for Google Piecharts--> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load('current', {'packages':['corechart']}); google.charts.load('current', {'packages':['table']}); var JSLemma= "σορώιον"; // var JSType = "noun"; // var JSMinDate = -799; // var JSMaxDate = 799; // var JSDerived = ""; // var JSPartner = ""; // var JSNomeName = ""; var JSRegion = "";// var JSTypeDocPap = "";// var JSMaterial = "";// var JSPerson = "";// var JSTense = "";// var JSMood = "";// var JSDiathese = "";// var JSDegree = "";// var JSNumber = "";// var JSGender = "";// var JSCase = ""; // var JSDotted = "";// var JSCorrected = "";// var JSLacuna = "";// var JSAbbreviated = "";// var JSMorphType = "noun";// var JSChartType = 1; /////\\\\\ google.charts.setOnLoadCallback(drawFirstChart);// Chart 1: Case function drawFirstChart() { var call = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var url = "/words/ajaxEndpoints/case.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; call.open("GET", url, true); //url reference of ajax endpoint call.setRequestHeader("Content-type", "application/json"); call.send(); call.onload = function(e){ //process response from endpoint if (call.readyState ===4){ if (call.status === 200){ // if it's all good ==> do this var serverResponse = JSON.parse(call.responseText); var data1raw = [['Case', 'Frequency', 'Finetune_material']]; for(var i = 0; i <serverResponse.length; i++){ //dit heb je nodig voor de nieuwe check! De backend zegt als de user geregistreerd is. if('registered' in serverResponse[i]){ var filter = '../registration.php'; }else{ var filter = "/words/detail.php?lemma="+JSLemma+"&charttype="+JSChartType+"&case="+serverResponse[i]['morph_case']+"&material="+JSMaterial+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; } var rowdata = [serverResponse[i]['morph_case'], parseInt(serverResponse[i]['frequency']), filter]; //tot en met hier data1raw.push(rowdata); } var data1 = google.visualization.arrayToDataTable(data1raw); var charttype = " 1 "; if (charttype==1) { var chart1 = new google.visualization.PieChart(document.getElementById('googlechart')); google.visualization.events.addListener(chart1, 'select', myClickHandler); var options1 = { legend: 'none', pieSliceText: 'label', width: '85%', height: '85%', chartArea: {'width': '80%', 'height': '80%'}, legend: {'position': 'bottom', pagingTextStyle: {color: '#616161'}, scrollArrows:{activeColor: '#616161', inactiveColor:'#e0e0e0'}}, backgroundColor: {fill:'transparent'}, pieSliceBorderColor: 'transparent', colors: ['#41ac89', '#2b9b38', '#b3b300', '#D9C022', '#bab673'] }; } if (charttype==2) { var chart1 = new google.visualization.Table(document.getElementById('googlechart')); google.visualization.events.addListener(chart1, 'select', myClickHandler); var morphcase = " "; if (morphcase!=" ") { var options1 = { width: '85%', height: '50px', }; } else { var options1 = { width: '85%', height: '110px', }; } } var view1 = new google.visualization.DataView(data1); view1.setColumns([0,1]); chart1.draw(view1, options1); function myClickHandler(){ var link1 = data1.getValue(chart1.getSelection()[0]['row'],2); // Change the current site location.href = link1; } drawThirdChart(); } } } }//end of function 1 // Chart 2: Gender function drawSecondChart() { var call2 = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var url2 = "/words/ajaxEndpoints/gender.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; call2.open("GET", url2, true); //url reference of ajax endpoint call2.setRequestHeader("Content-type", "application/json"); call2.send(); call2.onload = function(e){ //process response from endpoint if (call2.readyState ===4){ if (call2.status === 200){ // if it's all good ==> do this var serverResponse2 = JSON.parse(call2.responseText); var data2raw = [['Gender', 'Frequency', 'Finetune_material']]; for(var i = 0; i <serverResponse2.length; i++){ //dit heb je nodig voor de nieuwe check! De backend zegt als de user geregistreerd is. if('registered' in serverResponse2[i]){ var filter = '../registration.php'; }else{ var filter = "/words/detail.php?lemma="+JSLemma+"&charttype="+JSChartType+"&case="+JSCase+"&material="+JSMaterial+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+serverResponse2[i]['gender']+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; } var rowdata = [serverResponse2[i]['gender'], parseInt(serverResponse2[i]['frequency']), filter]; data2raw.push(rowdata); } var data2 = google.visualization.arrayToDataTable(data2raw); var charttype = " 1 "; if (charttype==1){ var chart2 = new google.visualization.PieChart(document.getElementById('googlechart2')); google.visualization.events.addListener(chart2, 'select', myClickHandler); var options2 = { pieSliceText: 'label', width: '85%', height: '85%', chartArea: {'width': '80%', 'height': '80%'}, legend: {'position': 'bottom', pagingTextStyle: {color: '#41ac89'}, scrollArrows:{activeColor: '#41ac89', inactiveColor:'#cbf788'}}, backgroundColor: {fill:'transparent'}, pieSliceBorderColor: 'transparent', colors: ['#41ac89', '#2b9b38', '#b3b300', '#D9C022','#bab673'] }; } if (charttype==2){ var chart2 = new google.visualization.Table(document.getElementById('googlechart2')); google.visualization.events.addListener(chart2, 'select', myClickHandler); var gender = " "; if (gender!=" "){ var options2 = { width: '85%', height: '50px', }; }else{ var options2 = { width: '85%', height: '110px', }; } } var view2 = new google.visualization.DataView(data2); view2.setColumns([0,1]); chart2.draw(view2, options2); function myClickHandler(){ var link2 = data2.getValue(chart2.getSelection()[0]['row'],2); // Change the current site location.href = link2; } } }} }//end of function 2(GENDER) // Chart 3: Number function drawThirdChart() { var call3 = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var url3 = "/words/ajaxEndpoints/number.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; call3.open("GET", url3, true); //url reference of ajax endpoint call3.setRequestHeader("Content-type", "application/json"); call3.send(); call3.onload = function(e){ //process response from endpoint if (call3.readyState ===4){ if (call3.status === 200){ // if it's all good ==> do this var serverResponse3 = JSON.parse(call3.responseText); var data3raw = [['Number', 'Frequency', 'Finetune_material']]; for(var i = 0; i <serverResponse3.length; i++){ if('registered' in serverResponse3[i]){ var filter = '../registration.php'; }else{ var filter = "/words/detail.php?lemma="+JSLemma+"&charttype="+JSChartType+"&case="+JSCase+"&material="+JSMaterial+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+serverResponse3[i]['number']+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; } var rowdata = [serverResponse3[i]['number'], parseInt(serverResponse3[i]['frequency']), filter]; data3raw.push(rowdata); } var data3 = google.visualization.arrayToDataTable(data3raw); var charttype = " 1 "; if (charttype==1) { var chart3 = new google.visualization.PieChart(document.getElementById('googlechart3')); google.visualization.events.addListener(chart3, 'select', myClickHandler); var options3 = { pieSliceText: 'label', width: '85%', height: '85%', chartArea: {'width': '80%', 'height': '80%'}, legend: {'position': 'bottom', pagingTextStyle: {color: '#41ac89'}, scrollArrows:{activeColor: '#41ac89', inactiveColor:'#cbf788'}}, backgroundColor: {fill:'transparent'}, pieSliceBorderColor: 'transparent', colors: ['#41ac89', '#2b9b38', '#b3b300', '#D9C022','#bab673'] }; } if (charttype==2) { var chart3 = new google.visualization.Table(document.getElementById('googlechart3')); google.visualization.events.addListener(chart3, 'select', myClickHandler); var number = " "; if (number!=" ") { var options3 = { width: '85%', height: '50px', }; } else { var options3 = { width: '85%', height: '110px', }; } } var view3 = new google.visualization.DataView(data3); view3.setColumns([0,1]); chart3.draw(view3, options3); function myClickHandler(){ var link3 = data3.getValue(chart3.getSelection()[0]['row'],2); // Change the current site location.href = link3; } getMaterialFilter(); } } } } // Chart 4: Degree function drawFourthChart() { var call4 = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var url4 = "/words/ajaxEndpoints/degree.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; call4.open("GET", url4, true); //url reference of ajax endpoint call4.setRequestHeader("Content-type", "application/json"); call4.send(); call4.onload = function(e){ //process response from endpoint if (call4.readyState ===4){ if (call4.status === 200){ // if it's all good ==> do this var serverResponse4 = JSON.parse(call4.responseText); var data4raw = [['Degree', 'Frequency', 'Finetune_material']]; for(var i = 0; i <serverResponse4.length; i++){ if('registered' in serverResponse4[i]){ var filter = '../registration.php'; }else{ var filter = "/words/detail.php?lemma="+JSLemma+"&charttype="+JSChartType+"&case="+JSCase+"&material="+JSMaterial+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+serverResponse4[i]['degree']+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; } var rowdata = [serverResponse4[i]['degree'], parseInt(serverResponse4[i]['frequency']), filter]; data4raw.push(rowdata); } var data4 = google.visualization.arrayToDataTable(data4raw); var charttype = " 1 "; if (charttype==1) { var chart4 = new google.visualization.PieChart(document.getElementById('googlechart4')); google.visualization.events.addListener(chart4, 'select', myClickHandler); var options4 = { pieSliceText: 'label', width: '85%', height: '85%', chartArea: {'width': '80%', 'height': '80%'}, legend: {'position': 'bottom', pagingTextStyle: {color: '#41ac89'}, scrollArrows:{activeColor: '#41ac89', inactiveColor:'#cbf788'}}, backgroundColor: {fill:'transparent'}, pieSliceBorderColor: 'transparent', colors: ['#41ac89', '#2b9b38', '#b3b300', '#D9C022', '#bab673'] }; } if (charttype==2) { var chart4 = new google.visualization.Table(document.getElementById('googlechart4')); google.visualization.events.addListener(chart4, 'select', myClickHandler); var degree = " "; if (degree!=" ") { var options4 = { width: '85%', height: '50px', }; } else { var options4 = { width: '85%', height: '110px', }; } } var view4 = new google.visualization.DataView(data4); view4.setColumns([0,1]); chart4.draw(view4, options4); function myClickHandler(){ var link4 = data4.getValue(chart4.getSelection()[0]['row'],2); // Change the current site location.href = link4; } } } } } // Chart 5: Diathese function drawFifthChart() { var call5 = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var url5 = "/words/ajaxEndpoints/diathese.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; call5.open("GET", url5, true); //url reference of ajax endpoint call5.setRequestHeader("Content-type", "application/json"); call5.send(); call5.onload = function(e){ //process response from endpoint if (call5.readyState ===4){ if (call5.status === 200){ // if it's all good ==> do this var serverResponse5 = JSON.parse(call5.responseText); var data5raw = [['Diathese', 'Frequency', 'Finetune_material']]; for(var i = 0; i <serverResponse5.length; i++){ if('registered' in serverResponse5[i]){ var filter = '../registration.php'; }else{ var filter = "/words/detail.php?lemma="+JSLemma+"&charttype="+JSChartType+"&case="+JSCase+"&material="+JSMaterial+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+serverResponse5[i]['diathese']+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; } var rowdata = [serverResponse5[i]['diathese'], parseInt(serverResponse5[i]['frequency']), filter]; data5raw.push(rowdata); } var data5 = google.visualization.arrayToDataTable(data5raw); var charttype = " 1 "; if (charttype==1) { var chart5 = new google.visualization.PieChart(document.getElementById('googlechart5')); google.visualization.events.addListener(chart5, 'select', myClickHandler); var options5 = { pieSliceText: 'label', width: '85%', height: '85%', chartArea: {'width': '80%', 'height': '80%'}, legend: {'position': 'bottom', pagingTextStyle: {color: '#41ac89'}, scrollArrows:{activeColor: '#41ac89', inactiveColor:'#cbf788'}}, backgroundColor: {fill:'transparent'}, pieSliceBorderColor: 'transparent', colors: ['#41ac89', '#2b9b38', '#b3b300', '#D9C022', '#bab673'] }; } if (charttype==2) { var chart5 = new google.visualization.Table(document.getElementById('googlechart5')); google.visualization.events.addListener(chart5, 'select', myClickHandler); var diathese = " "; if (diathese!=" ") { var options5 = { width: '85%', height: '50px', }; } else { var options5 = { width: '85%', height: '110px', }; } } var view5 = new google.visualization.DataView(data5); view5.setColumns([0,1]); chart5.draw(view5, options5); function myClickHandler(){ var link5 = data5.getValue(chart5.getSelection()[0]['row'],2); // Change the current site location.href = link5; } } } } } // Chart 6: Mood function drawSixthChart() { var call6 = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var url6 = "/words/ajaxEndpoints/mood.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; call6.open("GET", url6, true); //url reference of ajax endpoint call6.setRequestHeader("Content-type", "application/json"); call6.send(); call6.onload = function(e){ //process response from endpoint if (call6.readyState ===4){ if (call6.status === 200){ // if it's all good ==> do this var serverResponse6 = JSON.parse(call6.responseText); var data6raw = [['Mood', 'Frequency', 'Finetune_material']]; for(var i = 0; i <serverResponse6.length; i++){ if('registered' in serverResponse6[i]){ var filter = '../registration.php'; }else{ var filter = "/words/detail.php?lemma="+JSLemma+"&charttype="+JSChartType+"&case="+JSCase+"&material="+JSMaterial+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+serverResponse6[i]['mood']+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; } var rowdata = [serverResponse6[i]['mood'], parseInt(serverResponse6[i]['frequency']), filter]; data6raw.push(rowdata); } var data6 = google.visualization.arrayToDataTable(data6raw); var charttype = " 1 "; if (charttype==1) { var chart6 = new google.visualization.PieChart(document.getElementById('googlechart6')); google.visualization.events.addListener(chart6, 'select', myClickHandler); var options6 = { pieSliceText: 'label', width: '85%', height: '85%', chartArea: {'width': '80%', 'height': '80%'}, legend: {'position': 'bottom', pagingTextStyle: {color: '#41ac89'}, scrollArrows:{activeColor: '#41ac89', inactiveColor:'#cbf788'}}, backgroundColor: {fill:'transparent'}, pieSliceBorderColor: 'transparent', colors: ['#41ac89', '#2b9b38', '#b3b300', '#D9C022', '#bab673'] }; } if (charttype==2) { var chart6 = new google.visualization.Table(document.getElementById('googlechart6')); google.visualization.events.addListener(chart6, 'select', myClickHandler); var mood = " "; if (mood!=" ") { var options6 = { width: '85%', height: '50px', }; } else { var options6 = { width: '85%', height: '110px', }; } } var view6 = new google.visualization.DataView(data6); view6.setColumns([0,1]); chart6.draw(view6, options6); function myClickHandler(){ var link6 = data6.getValue(chart6.getSelection()[0]['row'],2); // Change the current site location.href = link6; } } } } } // Chart 7: Tense function drawSeventhChart() { var call7 = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var url7 = "/words/ajaxEndpoints/tense.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; call7.open("GET", url7, true); //url reference of ajax endpoint call7.setRequestHeader("Content-type", "application/json"); call7.send(); call7.onload = function(e){ //process response from endpoint if (call7.readyState ===4){ if (call7.status === 200){ // if it's all good ==> do this var serverResponse7 = JSON.parse(call7.responseText); var data7raw = [['Tense', 'Frequency', 'Finetune_material']]; for(var i = 0; i <serverResponse7.length; i++){ if('registered' in serverResponse7[i]){ var filter = '../registration.php'; }else{ var filter = "/words/detail.php?lemma="+JSLemma+"&charttype="+JSChartType+"&case="+JSCase+"&material="+JSMaterial+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+serverResponse7[i]['tense']+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; } var rowdata = [serverResponse7[i]['tense'], parseInt(serverResponse7[i]['frequency']), filter]; data7raw.push(rowdata); } var data7 = google.visualization.arrayToDataTable(data7raw); var charttype = " 1 "; if (charttype==1) { var chart7 = new google.visualization.PieChart(document.getElementById('googlechart7')); google.visualization.events.addListener(chart7, 'select', myClickHandler); var options7 = { pieSliceText: 'label', width: '85%', height: '85%', chartArea: {'width': '80%', 'height': '80%'}, legend: {'position': 'bottom', pagingTextStyle: {color: '#41ac89'}, scrollArrows:{activeColor: '#41ac89', inactiveColor:'#cbf788'}}, backgroundColor: {fill:'transparent'}, pieSliceBorderColor: 'transparent', colors: ['#41ac89', '#2b9b38', '#b3b300', '#D9C022', '#bab673'] }; } if (charttype==2) { var chart7 = new google.visualization.Table(document.getElementById('googlechart7')); google.visualization.events.addListener(chart7, 'select', myClickHandler); var tense = " "; if (tense!=" ") { var options7 = { width: '85%', height: '50px', }; } else { var options7 = { width: '85%', height: '110px', }; } } var view7 = new google.visualization.DataView(data7); view7.setColumns([0,1]); chart7.draw(view7, options7); function myClickHandler(){ var link7 = data7.getValue(chart7.getSelection()[0]['row'],2); // Change the current site location.href = link7; } } } } } // Chart 8: Person function drawEighthChart() { var call8 = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var url8 = "/words/ajaxEndpoints/person.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; call8.open("GET", url8, true); //url reference of ajax endpoint call8.setRequestHeader("Content-type", "application/json"); call8.send(); call8.onload = function(e){ //process response from endpoint if (call8.readyState ===4){ if (call8.status === 200){ // if it's all good ==> do this var serverResponse8 = JSON.parse(call8.responseText); var data8raw = [['Person', 'Frequency', 'Finetune_material']]; for(var i = 0; i <serverResponse8.length; i++){ if('registered' in serverResponse8[i]){ var filter = '../registration.php'; }else{ var filter = "/words/detail.php?lemma="+JSLemma+"&charttype="+JSChartType+"&case="+JSCase+"&material="+JSMaterial+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+serverResponse8[i]['person']+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; } var rowdata = [serverResponse8[i]['person'], parseInt(serverResponse8[i]['frequency']), filter]; data8raw.push(rowdata); } var data8 = google.visualization.arrayToDataTable(data8raw); var charttype = " 1 "; if (charttype==1) { var chart8 = new google.visualization.PieChart(document.getElementById('googlechart8')); google.visualization.events.addListener(chart8, 'select', myClickHandler); var options8 = { pieSliceText: 'label', width: '85%', height: '85%', chartArea: {'width': '80%', 'height': '80%'}, legend: {'position': 'bottom', pagingTextStyle: {color: '#41ac89'}, scrollArrows:{activeColor: '#41ac89', inactiveColor:'#cbf788'}}, backgroundColor: {fill:'transparent'}, pieSliceBorderColor: 'transparent', colors: ['#41ac89', '#2b9b38', '#b3b300', '#D9C022', '#bab673'] }; } if (charttype==2) { var chart8 = new google.visualization.Table(document.getElementById('googlechart8')); google.visualization.events.addListener(chart8, 'select', myClickHandler); var person = " "; if (person!=" ") { var options8 = { width: '85%', height: '50px', }; } else { var options8 = { width: '85%', height: '110px', }; } } var view8 = new google.visualization.DataView(data8); view8.setColumns([0,1]); chart8.draw(view8, options8); function myClickHandler(){ var link8 = data8.getValue(chart8.getSelection()[0]['row'],2); // Change the current site location.href = link8; } } } } } // Chart 9: Derived function drawNinethChart() { var call9 = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var url9 = "/words/ajaxEndpoints/derived.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; call9.open("GET", url9, true); //url reference of ajax endpoint call9.setRequestHeader("Content-type", "application/json"); call9.send(); call9.onload = function(e){ //process response from endpoint if (call9.readyState ===4){ if (call9.status === 200){ // if it's all good ==> do this var serverResponse9 = JSON.parse(call9.responseText); var data9raw = [['Derived', 'Frequency', 'Finetune_material']]; for(var i = 0; i <serverResponse9.length; i++){ if('registered' in serverResponse9[i]){ var filter = '../registration.php'; }else{ var filter = "/words/detail.php?lemma="+JSLemma+"&charttype="+JSChartType+"&case="+JSCase+"&material="+JSMaterial+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+serverResponse9[i]['derived']+"&partner="+JSPartner+"&morph_type="+JSMorphType; } var rowdata = [serverResponse9[i]['derived'], parseInt(serverResponse9[i]['frequency']), filter]; data9raw.push(rowdata); } var data9 = google.visualization.arrayToDataTable(data9raw); var charttype = " 1 "; if (charttype==1) { var chart9 = new google.visualization.PieChart(document.getElementById('googlechart9')); google.visualization.events.addListener(chart9, 'select', myClickHandler); var options9 = { pieSliceText: 'label', width: '85%', height: '85%', chartArea: {'width': '80%', 'height': '80%'}, legend: {'position': 'bottom', pagingTextStyle: {color: '#41ac89'}, scrollArrows:{activeColor: '#41ac89', inactiveColor:'#cbf788'}}, backgroundColor: {fill:'transparent'}, pieSliceBorderColor: 'transparent', colors: ['#41ac89', '#2b9b38', '#b3b300', '#D9C022', '#bab673'] }; } if (charttype==2) { var chart9 = new google.visualization.Table(document.getElementById('googlechart9')); google.visualization.events.addListener(chart9, 'select', myClickHandler); var derived = " "; if (derived!=" ") { var options9 = { width: '85%', height: '50px', }; } else { var options9 = { width: '85%', height: '110px', }; } } var view9 = new google.visualization.DataView(data9); view9.setColumns([0,1]); chart9.draw(view9, options9); function myClickHandler(){ var link9 = data9.getValue(chart9.getSelection()[0]['row'],2); // Change the current site location.href = link9; } } } } } /* // Weighed dates function drawWeighedChart() { //console.log("Trigger weighed dates chart"); var hideClick = document.getElementById("ClickToTriggerWeights"); if(hideClick){ hideClick.parentNode.removeChild(hideClick); } var callWeight = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var urlWeight = "/words/ajaxEndpoints/weightFirst.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; callWeight.open("GET", urlWeight, true); //url reference of ajax endpoint callWeight.setRequestHeader("Content-type", "application/json"); callWeight.send(); callWeight.onload = function(e){ //process response from endpoint if (callWeight.readyState ===4){ if (callWeight.status === 200){ // if it's all good ==> do this var serverResponseWeight = JSON.parse(callWeight.responseText); var years_and_values = {}; // Do not show zeros if no data! // if you do this; it connects isolated points with a straight line in stead of dropping to 0 var rangeStart = JSMinDate; for (rangeStart; rangeStart<JSMaxDate; rangeStart++){ years_and_values[rangeStart.toString()] = 0; } var weightDataRaw = [['Weighed dates', 'Frequency']]; for (var i = 0; i < serverResponseWeight.length; i++){ var spread = parseFloat(serverResponseWeight[i]["spread"]); for (var y = serverResponseWeight[i]['min_date']; y <= serverResponseWeight[i]['max_date']; y++){ if (y != 0){ if (y.toString() in years_and_values){ years_and_values[y.toString()] = years_and_values[y.toString()]+spread; }else{ years_and_values[y.toString()] = spread; } } } } Object.keys(years_and_values).forEach(e => weightDataRaw.push([parseInt(e), parseFloat(years_and_values[e])]));//(`key=${e} value=${obj[e]}`)) var data = google.visualization.arrayToDataTable(weightDataRaw); //generate the call for the data_words_per_year variable: var data_words_per_year = []; var callWeightTwo = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var urlWeightTwo = "/words/ajaxEndpoints/weightSecond.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; callWeightTwo.open("GET", urlWeightTwo, true); //url reference of ajax endpoint callWeightTwo.setRequestHeader("Content-type", "application/json"); callWeightTwo.send(); callWeightTwo.onload = function(e){ //process response from endpoint if (callWeightTwo.readyState ===4){ if (callWeightTwo.status === 200){ // if it's all good ==> do this var data_words_per_year =[]; var serverResponseWeightTwo = JSON.parse(callWeightTwo.responseText); for(var d=0; d< serverResponseWeightTwo.length; d++){ data_words_per_year.push(serverResponseWeightTwo[d]["weighted_date"]); } var newData = google.visualization.data.group(data, [{ column: 0, type: 'number' }], [{ column: 1, label: 'Weighed', aggregation: google.visualization.data.sum, type: 'number' }]); newData.sort([{column: 0}]); var options_weighed = { legend: 'none', width: '85%', height: '85%', chartArea: {'width': '80%', 'height': '80%'}, backgroundColor: {fill:'transparent'}, colors: ['#41ac89'], //explorer: {keepInBounds: true, maxZoomIn: .5, maxZoomOut: .99}, lineWidth: 1, ////// NEW FOR SMOOTHING ////// //curveType: 'function', ==> causes deformed graphs with low frequencies vAxis: {viewWindowMode: "explicit", viewWindow:{ min: 0 }}, //hAxis: {viewWindowMode: "explicit", viewWindow:{ min: -350, max: 806.99 }}, hAxis: {viewWindowMode: "explicit", viewWindow:{ min: -799, max: 806.99 }}, ////// END NEW FOR SMOOTHING ////// }; newData.sort({column: 0, sort: 'enable'}) ////// NEW FOR SMOOTHING ////// ////// NEW FOR SMOOTHING ////// var years = []; var value4years=[]; var e_d_len = newData.getNumberOfRows(); for(n=0;n<e_d_len;n++){ years.push(newData.getValue(n,0)); value4years.push(newData.getValue(n,1)); } //smoothing happens here var by = 0; // the default smoothing applied is 0 function smooth (array, range) { var modespace = document.getElementById("modeselector"); var mode = modespace.options[modespace.selectedIndex].value; var smoothed = []; for (var i = 0; i < array.length; i++) { if (range !=0) { var low = i-range; //var high = i+range; if (low <0){ low = 0; } var subslice = array.slice(low,i+range); var total = subslice.length; var sum = 0; for (var n = 0; n < subslice.length; n++){ sum = sum + subslice[n];} } var smooth = sum/total; if (range == 0){var smooth = array[i];} smoothed.push(smooth); } var sweet_and_smooth_data = new google.visualization.DataTable(); sweet_and_smooth_data.addColumn("number","year"); sweet_and_smooth_data.addColumn("number","value"); var smoothedweights = []; // injecteer nieuwe smoothing van weights hierin. for (var i = 0; i < value4years.length; i++) { if (range !=0) { var low = i-range; if (low<0){ low = 0; } var subsliceweights = value4years.slice(low,i+range+1).filter(Boolean); var totalweights = subsliceweights.length; var sumweights = 0.000; for (var n = 0; n < totalweights; n++){ sumweights = parseFloat(sumweights) + parseFloat(subsliceweights[n]);} } var smoothweight = sumweights/totalweights; if (range == 0){var smoothweight = value4years[i];} //unary operator forces smoothweight to 0 if it's NaN! //Do not show zeros // show zeros for now smoothedweights.push(+smoothweight||0); //smoothedweights.push(smoothweight); } //smoothing weights. for(n=0;n<smoothedweights.length;n++){ //use symmetrical arrays to store year; value pair in table if (years[n] == 0){ sweet_and_smooth_data.addRow([0,null]);}else{ sweet_and_smooth_data.addRow([years[n],smoothedweights[n]]); } } //console.log(smoothedweights[0]); //// percentage or absolute display on Google Graph.///// //// percentage or absolute display on Google Graph.///// if (mode == "relative"){ options_weighed.vAxis = {viewWindowMode: "explicit", viewWindow:{ min: 0 }, format:'#\'%\''}; } else { options_weighed.vAxis = {viewWindowMode: "explicit", viewWindow:{ min: 0 }}; } //// end of percentage or absolute //// //// end of percentage or absolute //// // drawing charts var chart_weighed = new google.visualization.LineChart(document.getElementById('googlechart_weighed')); chart_weighed.draw(sweet_and_smooth_data, options_weighed); return smoothed; } // calling smoothing function with array and value var smooth_values_4y = smooth(value4years, by); // Smoothing value // creating new google object var sweet_and_smooth_data = new google.visualization.DataTable(); sweet_and_smooth_data.addColumn("number","year"); sweet_and_smooth_data.addColumn("number","value"); for(n=0;n<smooth_values_4y.length;n++){ sweet_and_smooth_data.addRow([years[n],smooth_values_4y[n]]);} ///// END NEW FOR SMOOTHING ///// var chart_weighed = new google.visualization.LineChart(document.getElementById('googlechart_weighed')); chart_weighed.draw(newData, options_weighed); ///// NEW FOR SMOOTHING ///// // JQuery slider $( function() { $( "#slider" ).slider({ range: "min", value: 0, min: 0, max: 50, change: function(event, ui) { var setavg = $('#slider').slider("option", "value"); $( "#amount" ).val( $( "#slider" ).slider( "value" ) ); var smooth_values_4y = smooth(value4years, setavg); } }); $( "#amount" ).val( $( "#slider" ).slider( "value" ) ); } ); ///// END NEW FOR SMOOTHING ///// } } } } } } } */ function drawWeighedChart() { //console.log("Trigger weighed dates chart"); var hideClick = document.getElementById("ClickToTriggerWeights"); if(hideClick){ hideClick.parentNode.removeChild(hideClick); } var callWeight = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var urlWeight = "/words/ajaxEndpoints/weightFirst.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; callWeight.open("GET", urlWeight, true); //url reference of ajax endpoint callWeight.setRequestHeader("Content-type", "application/json"); callWeight.send(); callWeight.onload = function(e){ //process response from endpoint if (callWeight.readyState ===4){ if (callWeight.status === 200){ // if it's all good ==> do this var serverResponseWeight = JSON.parse(callWeight.responseText); var years_and_values = {}; // Do not show zeros if no data! // if you do this; it connects isolated points with a straight line in stead of dropping to 0 var rangeStart = JSMinDate; for (rangeStart; rangeStart<JSMaxDate; rangeStart++){ years_and_values[rangeStart.toString()] = 0; } var weightDataRaw = [['Weighed dates', 'Frequency']]; for (var i = 0; i < serverResponseWeight.length; i++){ var spread = parseFloat(serverResponseWeight[i]["spread"]); for (var y = serverResponseWeight[i]['min_date']; y <= serverResponseWeight[i]['max_date']; y++){ if (y != 0){ if (y.toString() in years_and_values){ years_and_values[y.toString()] = years_and_values[y.toString()]+spread; }else{ years_and_values[y.toString()] = spread; } } } } Object.keys(years_and_values).forEach(e => weightDataRaw.push([parseInt(e), parseFloat(years_and_values[e])]));//(`key=${e} value=${obj[e]}`)) var data = google.visualization.arrayToDataTable(weightDataRaw); //generate the call for the data_words_per_year variable: var data_words_per_year = []; var callWeightTwo = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var urlWeightTwo = "/words/ajaxEndpoints/weightSecond.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; callWeightTwo.open("GET", urlWeightTwo, true); //url reference of ajax endpoint callWeightTwo.setRequestHeader("Content-type", "application/json"); callWeightTwo.send(); callWeightTwo.onload = function(e){ //process response from endpoint if (callWeightTwo.readyState ===4){ if (callWeightTwo.status === 200){ // if it's all good ==> do this var data_words_per_year =[]; var serverResponseWeightTwo = JSON.parse(callWeightTwo.responseText); for(var d=0; d< serverResponseWeightTwo.length; d++){ data_words_per_year.push(serverResponseWeightTwo[d]["weighted_date"]); } var newData = google.visualization.data.group(data, [{ column: 0, type: 'number' }], [{ column: 1, label: 'Weighed', aggregation: google.visualization.data.sum, type: 'number' }]); newData.sort([{column: 0}]); var options_weighed = { legend: 'none', width: '85%', height: '85%', chartArea: {'width': '80%', 'height': '80%'}, backgroundColor: {fill:'transparent'}, colors: ['#41ac89'], //explorer: {keepInBounds: true, maxZoomIn: .5, maxZoomOut: .99}, lineWidth: 1, ////// NEW FOR SMOOTHING ////// //curveType: 'function', ==> causes deformed graphs with low frequencies vAxis: {viewWindowMode: "explicit", viewWindow:{ min: 0 }}, //hAxis: {viewWindowMode: "explicit", viewWindow:{ min: -350, max: 806.99 }}, hAxis: {viewWindowMode: "explicit", viewWindow:{ min: -799, max: 806.99 }}, ////// END NEW FOR SMOOTHING ////// }; newData.sort({column: 0, sort: 'enable'}) ////// NEW FOR SMOOTHING ////// ////// NEW FOR SMOOTHING ////// var years = []; var value4years=[]; var e_d_len = newData.getNumberOfRows(); for(n=0;n<e_d_len;n++){ years.push(newData.getValue(n,0)); value4years.push(newData.getValue(n,1)); } //smoothing happens here var by = 0; // the default smoothing applied is 0 function smooth (array, range) { var smoothed = []; for (var i = 0; i < array.length; i++) { if (range !=0) { var subslice = array.slice(i-range,i+range); var total = subslice.length; var sum = 0 for (var n = 0; n < subslice.length; n++){ sum = sum + subslice[n];} var smooth = sum/total; } if (range == 0){var smooth = array[i];} smoothed.push(smooth); } var sweet_and_smooth_data = new google.visualization.DataTable(); sweet_and_smooth_data.addColumn("number","year"); sweet_and_smooth_data.addColumn("number","value"); //enables mode relative/absolute var modespace = document.getElementById("modeselector"); var mode = modespace.options[modespace.selectedIndex].value; var smoothedweights = []; // injecteer nieuwe smoothing van weights hierin. for (var i = 0; i < data_words_per_year.length; i++) { if (range !=0) { var subsliceweights = data_words_per_year.slice(i-range,i+range); var totalweights = subsliceweights.length; var sumweights = 0.000; for (var n = 0; n < subsliceweights.length; n++){ sumweights = parseFloat(sumweights) + parseFloat(subsliceweights[n]);} var smoothweight = sumweights/totalweights; } if (range == 0){var smoothweight = data_words_per_year[i];} smoothedweights.push(smoothweight); } //smoothing weights. for(n=0;n<smoothed.length;n++){ if(mode=="absolute"){ sweet_and_smooth_data.addRow([years[n],smoothed[n]]);} else{ sweet_and_smooth_data.addRow([years[n],smoothed[n]/smoothedweights[n]]);} } //// percentage or absolute display on Google Graph.///// if (mode == "relative"){ options_weighed.vAxis = {viewWindowMode: "explicit", viewWindow:{ min: 0 }, format:"#.000%"}; } else { options_weighed.vAxis = {viewWindowMode: "explicit", viewWindow:{ min: 0 }}; } //// end of percentage or absolute //// // drawing charts var chart_weighed = new google.visualization.LineChart(document.getElementById('googlechart_weighed')); chart_weighed.draw(sweet_and_smooth_data, options_weighed); //start of temporary thing /* var dumpOut = ((sweet_and_smooth_data['wg'])); var results = []; for (var i = 0; i < dumpOut.length; i++) { var pair = [dumpOut[i]['c'][0]['v'],dumpOut[i]['c'][1]['v']]; results.push(pair); }*/ // end of temporary thing return smoothed; } // calling smoothing function with array and value var smooth_values_4y = smooth(value4years, by); // Smoothing value // creating new google object var sweet_and_smooth_data = new google.visualization.DataTable(); sweet_and_smooth_data.addColumn("number","year"); sweet_and_smooth_data.addColumn("number","value"); for(n=0;n<smooth_values_4y.length;n++){ sweet_and_smooth_data.addRow([years[n],smooth_values_4y[n]]);} ///// END NEW FOR SMOOTHING ///// var chart_weighed = new google.visualization.LineChart(document.getElementById('googlechart_weighed')); chart_weighed.draw(newData, options_weighed); ///// NEW FOR SMOOTHING ///// // JQuery slider $( function() { $( "#slider" ).slider({ range: "min", value: 0, min: 0, max: 50, change: function(event, ui) { var setavg = $('#slider').slider("option", "value"); $( "#amount" ).val( $( "#slider" ).slider( "value" ) ); var smooth_values_4y = smooth(value4years, setavg); } }); $( "#amount" ).val( $( "#slider" ).slider( "value" ) ); } ); ///// END NEW FOR SMOOTHING ///// } } } } } } } //drawWeighedChart(); </script> </head> <!-- Matomo: tracking code for Trismegistos.org --> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//trismegistos.org/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '7']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Matomo Code --> <body> <!-- The top header section --> <header> <div class="wrapper header-flex"> <nav class="menu"> <ul class="active"> <li id="logo"><a href="..">Home</a></li> <li id="pagetitle"><a href="index.php">Words</a></li> <li><a href="about.php">About</a></li> </ul> <a class="toggle-nav" href="#">☰</a> </nav> <div id="header-right-section"> <div id="panic-button"> <a href="../forum/index.php"> <i class="fa fa-ambulance info-tooltip" aria-hidden="true"> </i> </a> </div> <div class="search-form"> <form action="detail.php?selection="> <input type="text" name="selection" placeholder="Enter Greek word"> <button>Go</button> </form> </div> <div id="session-login"> <p>Unregistered user (8.222.208.146). <a href=# id=show_login_btn style="color: #FCE903"><b>Log in</b></a><br><a href= "https://www.trismegistos.org/registration.php" style="color: #FCE903">I want to subscribe!</a></p> </div> </div> </div> <!-- End header.wrapper --> </header> <!-- the content starts here --> <div id="top" class="bg-light"> <script type="text/javascript" src="../js/halike-warning.js"></script> <div id="warning-halike"> <a href="https://www.trismegistos.org/keeptrismegistosalive.php"><img src="/img/banner1.png"></a><p><i class="fa fa-exclamation-triangle" aria-hidden="true" style="color: #034D90"></i></p><p><font color=blue>Have you remembered to use your institution's proxy or VPN?</font></p><p>Please log in or subscribe below:</p><p><b onClick=toggle_individual_form(this) id=individual_login_button>I have a login</b></p><form id=halike_individual_form action=/registrations_individual.php?cmd=login><input name=cmd value='login' type=hidden><input name=id value='' type=hidden><input name=redirect value='/words/detail.php?lemma=σορώιον&morph_type=noun' type=hidden><input id='halike-login-email' name=email value='' placeholder='email'><input id='halike-login-password' name=password type=password value='' placeholder='password'><input type=submit></form><p><a href="https://www.trismegistos.org/registration.php"><b>I want to subscribe</b></a><p class="no-margin">Please note that since 1 January 2020, full functionality of this page is reserved for registered users only.</p><div><div id="close-halike-warning">X</div></div> </div> <div class="container first-container"> <div class="row clearfix first-container"> <div id="lemma" class="col-md-6 col-sm-12 indent"> <h2>σορώιον</h2><p>noun --- "suspect, possibly non-existing word" (<a href="http://logeion.uchicago.edu/index.html#σορώιον">Logeion</a>)</p> </div> <!-- End .col-md-6 --> <div class="col-md-6 col-sm-12"> <div id="uri" class="infobox infobox-URI"> <i class="fa fa-bullhorn" style="color: #41ac89; font-size: 1.2em; padding-right: 5px" aria-hidden="true"></i> <span class="semibold">Stable URI (with TM Word ID): </span> <span>coming soon</span> <!-- <span style="padding-left: 24px">www.trismegistos.org/word/</span> --> </div> <!-- End .infobox --> </div> <!-- End .col-md-6 --> </div> <!-- End row first-container --> </div> <!-- End container first-container --> </div> <!-- End bg-light --> <div id="filter-wordref" class="bg-dark no-border"> <div class="container"> <div class="row clearfix"> <div class="col-md-8 col-sm-12"> <h4><i class="fa fa-thumb-tack" style="padding-right:5px" aria-hidden="true"></i> 7 attestations of σορώιον</h4> <p id="word-limitations" class="indent"> </p> <div class="filterbar margin-left"> <div id="document-filter" class="floatleft"> <div class="dropdown"> <form id="materialForm" method="POST" action="detail.php?lemma=σορώιον&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&type=noun&derived=&person=&script=&type_docpap=&provenance_top=&provenance_bottom=&corrected=&dotted=&abbreviated=&lacuna=&min_date=-799&max_date=799&material=#lemma"> <select name="material" id="material" onchange="this.form.submit()"><option value="" selected="selected">Any material ▾</option></select></form> <script> function getMaterialFilter() { var call10 = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var url10 = "/words/ajaxEndpoints/materialLimiter.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; call10.open("GET", url10, true); //url reference of ajax endpoint call10.setRequestHeader("Content-type", "application/json"); call10.send(); call10.onload = function(e){ //process response from endpoint if (call10.readyState ===4){ if (call10.status === 200){ // if it's all good ==> do this try{ var serverResponse10 = JSON.parse(call10.responseText); }catch{ getTypeDocPapFilter(); } var selectMaterial = document.getElementById("material"); for (var materialpair in serverResponse10){ var option = document.createElement('option'); option.appendChild(document.createTextNode(serverResponse10[materialpair]['material'] + '('+serverResponse10[materialpair]['frequency']+')' )); option.value = serverResponse10[materialpair]['material']; if(serverResponse10[materialpair]['material'] === JSMaterial){ option.selected ='selected'; } selectMaterial.appendChild(option); } getTypeDocPapFilter(); } } } } </script> </div><!-- End .dropdown --> <div class="dropdown"> <form id="type_docpapForm" method="POST" action="detail.php?lemma=σορώιον&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&type=noun&derived=&person=&script=&material=&provenance_top=&provenance_bottom=&corrected=&dotted=&abbreviated=&lacuna=&min_date=-799&max_date=799&type_docpap=#lemma"> <select name="type_docpap" id="type_docpap" onchange="this.form.submit()"><option value="" selected="selected">Any genre ▾</option></select></form> <script> function getTypeDocPapFilter() { //console.log('trigger docpap'); var call11 = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var url11 = "/words/ajaxEndpoints/docpapLimiter.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; console.log(url11); call11.open("GET", url11, true); //url reference of ajax endpoint call11.setRequestHeader("Content-type", "application/json"); call11.send(); call11.onload = function(e){ //process response from endpoint if (call11.readyState ===4){ if (call11.status === 200){ // if it's all good ==> do this var serverResponse11 = JSON.parse(call11.responseText); var selectMaterial = document.getElementById("type_docpap"); for (var docpapPair in serverResponse11){ var option = document.createElement('option'); option.appendChild(document.createTextNode(serverResponse11[docpapPair]['type_docpap1'] + '('+serverResponse11[docpapPair]['frequency']+')' )); option.value = serverResponse11[docpapPair]['type_docpap1']; if(serverResponse11[docpapPair]['type_docpap1'] === JSTypeDocPap){ option.selected ='selected'; } selectMaterial.appendChild(option); } getProvTop() } } } } </script> </div><!-- End .dropdown --> <div class="dropdown"> <form id="provenance_topForm" method="POST" action="detail.php?lemma=σορώιον&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&type=noun&derived=&person=&script=&material=&corrected=&dotted=&abbreviated=&lacuna=&min_date=-799&max_date=799&type_docpap=&provenance_bottom=&provenance_top=#lemma"> <select name="provenance_top" id="provenance_top" onchange="this.form.submit()"><option value="" selected="selected">Any provenance (written) ▾</option></select></form> <script> function getProvTop() { var call12a = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var url12a = "/words/ajaxEndpoints/provTopLimiter.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType; call12a.open("GET", url12a, true); //url reference of ajax endpoint call12a.setRequestHeader("Content-type", "application/json"); call12a.send(); call12a.onload = function(e){ //process response from endpoint if (call12a.readyState ===4){ if (call12a.status === 200){ // if it's all good ==> do this var serverResponse12a = JSON.parse(call12a.responseText); var selectMaterial = document.getElementById("provenance_top"); for (var regionPair in serverResponse12a){ if (serverResponse12a[regionPair]["region"] == ""){ serverResponse12a[regionPair]["region"] = "Unspecified"; } var selected = ""; if (serverResponse12a[regionPair]["region"] == ""){ selected = "selected=true"; } if (serverResponse12a[regionPair]["region"] == "Unspecified"){ serverResponse12a[regionPair]["region"] = ""; } var option = document.createElement('option'); option.appendChild(document.createTextNode(serverResponse12a[regionPair]["regionText"] + ' ('+ (serverResponse12a[regionPair]["frequency"])+')' )); if (serverResponse12a[regionPair]["region"] != ""){ option.value = serverResponse12a[regionPair]['region']; } selectMaterial.appendChild(option); } } } } } </script> </select> </form> </div><!-- End .dropdown --> </div> <!-- End #document-filter --> <div id="annotation-filter" class="floatleft"> <div class="dropdown"> <form id="abbreviated" method="POST" action="detail.php?lemma=σορώιον&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&type=noun&derived=&person=&script=&material=&type_docpap=&provenance_top=&provenance_bottom=&lacuna=&corrected=&dotted=&min_date=-799&max_date=799&abbreviated=#lemma"> <select name="abbreviated" id="abbreviated" onchange="this.form.submit()"><option value="" selected="selected">Abbreviated or not ▾</option><option value="not_abbreviated" >Only non-abbreviated</option><option value="abbreviated" >Only abbreviated</option> </select> </form> </div><!-- End .dropdown --> <div class="dropdown"> <form id="lacuna" method="POST" action="detail.php?lemma=σορώιον&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&type=noun&derived=&person=&script=&material=&type_docpap=&provenance_top=&provenance_bottom=&corrected=&dotted=&abbreviated=&min_date=-799&max_date=799&lacuna=#lemma"> <select name="lacuna" id="lacuna" onchange="this.form.submit()"><option value="" selected="selected">Lacuna or not ▾</option><option value="no_lacuna" >Only without lacuna</option><option value="lacuna" >Only with lacuna</option><option value="full_lacuna" >Only full lacuna</option> </select> </form> </div><!-- End .dropdown --> <div class="dropdown"> <form id="corrected" method="POST" action="detail.php?lemma=σορώιον&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&type=noun&derived=&person=&script=&material=&type_docpap=&provenance_top=&provenance_bottom=&lacuna=&dotted=&abbreviated=&min_date=-799&max_date=799&corrected=#lemma"> <select name="corrected" id="corrected" onchange="this.form.submit()"><option value="" selected="selected">Corrected or not ▾</option><option value="not_corrected" >Only not corrected</option><option value="corrected" >Only corrected</option> </select> </form> </div><!-- End .dropdown --> <div class="dropdown"> <form id="dotted" method="POST" action="detail.php?lemma=σορώιον&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&type=noun&derived=&person=&script=&material=&type_docpap=&provenance_top=&provenance_bottom=&lacuna=&corrected=&abbreviated=&min_date=-799&max_date=799&dotted=#lemma"> <select name="dotted" id="dotted" onchange="this.form.submit()"><option value="" selected="selected">Dotted or not ▾</option><option value="not_dotted" >Only not dotted</option><option value="dotted" >Only dotted</option> </select> </form> </div><!-- End .dropdown --> </div> <!-- End #annotation-filter --> </div><!--End .filterbar --> </div><!-- End .col-md-8 filters --> <div class="col-md-4 col-sm-12"> <div id="infobox" class="infobox infobox-pie"> <p><i class="fa fa-lightbulb-o" style="color: #41ac89; font-size: 1.2em; padding-right: 5px" aria-hidden="true"></i> Click on the appropriate sections of the charts or tables to limit your search to a specific grammatical form.</p> <p>Chart type:<br> <a class="charttype" href=/words/detail.php?lemma=σορώιον&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&type=noun&derived=&person=&script=&material=&derived=&type_docpap=&provenance_top=&provenance_bottom=&corrected=&dotted=&abbreviated=&lacuna=&min_date=-799&max_date=799&charttype=1#lemma><button class="btn" style="padding-left: 0"><i class="fa fa-pie-chart" style="color: #41ac89" aria-hidden="true"></i></button>Pie</a> <a class="charttype" href=/words/detail.php?lemma=σορώιον&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&type=noun&derived=&person=&script=&material=&derived=&type_docpap=&provenance_top=&provenance_bottom=&corrected=&dotted=&abbreviated=&lacuna=&charttype=2#lemma><button class="btn" style="padding-left: 30px"><i class="fa fa-table" style="color: #41ac89" aria-hidden="true"></i></button>Table</a> </p> </div><!-- End infobox --> </div><!-- End col-md-4 > infobox --> </div><!-- End row --> <div id="charts" class="row clearfix"> <div class="col-md-4 col-sm-12 piechart"><div id="googlechart"></div><div class="reset-pie">All cases</div></div> <div class="col-md-4 col-sm-12 piechart"><div id="googlechart3"></div><div class="reset-pie">All numbers</div></div> <!-- limit date weighed dates --> <div class="col-md-12"> <div class="filterbar margin-left"> <div id="filter-title">Chronological overview of the attestations<i class="fa fa-question info-tooltip" style="color: #41ac89; padding-left: 10px; font-size: 0.9em" aria-hidden="true"><span class="tooltiptext">Below is a weighed dates graph of the attestations. For the principles underlying this graph, see Van Beek / Depauw, Ancient Society 43 (2013), pp. 101-114.</span></i></div> <div id="filter-options"> <div class="filter-text">From</div> <div class="dropdown"> <form id="min_date" method="POST" action="detail.php?lemma=σορώιον&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&type=noun&derived=&person=&script=&material=&type_docpap=&provenance_top=&provenance_bottom=&lacuna=&corrected=&dotted=&abbreviated=&max_date=799&min_date=#charts"> <select name="min_date" id="min_date" onchange="this.form.submit()"><option value="-799" selected="selected">eighth century BC ▾</option> <option value="-699" >seventh century BC ▾</option> <option value="-599" >sixth century BC ▾</option> <option value="-499" >fifth century BC ▾</option> <option value="-399" >fourth century BC ▾</option> <option value="-299" >third century BC ▾</option> <option value="-199" >second century BC ▾</option> <option value="-99" >first century BC ▾</option> <option value="1" >first century AD ▾</option> <option value="100" >second century AD ▾</option> <option value="200" >third century AD ▾</option> <option value="300" >fourth century AD ▾</option> <option value="400" >fifth century AD ▾</option> <option value="500" >sixth century AD ▾</option> <option value="600" >seventh century AD ▾</option> <option value="700" >eighth century AD ▾</option> </select> </form> </div><!-- End .dropdown --> <div class="filter-text">to</div> <div class="dropdown"> <form id="max_date" method="POST" action="detail.php?lemma=σορώιον&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&type=noun&derived=&person=&script=&material=&type_docpap=&provenance_top=&provenance_bottom=&lacuna=&corrected=&dotted=&abbreviated=&min_date=-799&max_date=#charts"> <select name="max_date" id="max_date" onchange="this.form.submit()"><option value="-700" >eighth century BC ▾</option> <option value="-600" >seventh century BC ▾</option> <option value="-500" >sixth century BC ▾</option> <option value="-400" >fifth century BC ▾</option> <option value="-300" >fourth century BC ▾</option> <option value="-200" >third century BC ▾</option> <option value="-100" >second century BC ▾</option> <option value="-1" >first century BC ▾</option> <option value="99" >first century AD ▾</option> <option value="199" >second century AD ▾</option> <option value="299" >third century AD ▾</option> <option value="399" >fourth century AD ▾</option> <option value="499" >fifth century AD ▾</option> <option value="599" >sixth century AD ▾</option> <option value="699" >seventh century AD ▾</option> <option value="799" selected="selected">eighth century AD ▾</option> </select> </form> </div><!-- End .dropdown --> <div id="tooltip-WD" class="filter-text"> <i class="fa fa-question info-tooltip" style="color: #41ac89; padding: 7px; font-size: 1.1em" aria-hidden="true"> <span class="tooltiptext">To find out more about how Trismegistos deals with chronological limitations and imprecisely dated texts, click here. </span> </i> </div> <!-- End. filter-text --> </div> <!-- End. filter-options --> <div class="filter-text"> <div id="slider"></div> <div id="smoothing"> <label for="amount">Applied smoothing:</label> <input type="text" id="amount" readonly style="border:0; font-weight:bold; background:transparent;"> </div> <!-- End #smoothing --> <!-- Code added 8/11/17 ==> Checkbox relative/absolute in smoothing.--> <div id="modeselect"> Mode: <select id="modeselector" onchange="drawWeighedChart()"> <option value="absolute">Absolute ▾</option> <option value="relative">Relative ▾</option> </select> </div> <!-- end new code 8/11/17--> </div> <!-- End .filter-text --> <div id="tooltip-smoothing" class="filter-text"> <i class="fa fa-question info-tooltip" style="color: #41ac89; padding: 7px; font-size: 1.1em" aria-hidden="true"> <span class="tooltiptext">You can smooth the graph by moving the slider. A smoothing of 3 means that the values of each year are calculated as the average of the year itself, the three previous years and the three next years. </span> </i> </div> <!-- End. filter-text --> </div><!--End .filterbar --> </div> <!-- End .col-md-12 --> <div class="col-md-12"> <a href="/registration.php">Subscribe<a/> to see a chronological overview of the attestations. </div> </div><!-- End row clearfix --> </div> <!-- End container --> <div id="list" class="container second-container"> <div class="relative" style="padding-bottom:30px"> <div id="export"> <a href="../registration.php"><span class="semibold"><i class="fa fa-file-text-o" aria-hidden="true" style="padding-right: 5px"></i>Subscribe to export the full table</span></a> </div> <!-- End #export --> <!-- de vooruit-achteruit-pijltjes --> <div id="pages"><p><i class="fa fa-angle-left" aria-hidden="true" id="goLeft" style="cursor: pointer;" > </i><span style="padding: 0 6px 0 3px">Page <span id="curpagecounter">1</span> of 1</span><i class="fa fa-angle-right" aria-hidden="true" id="goRight" style="cursor: pointer;" > </i></p></div><!-- AJAX call to tabledata (not chained)--> <script> function fetchWordContext(word, text){ var callContext = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) var urlContext = "/words/ajaxEndpoints/define_context.php?word="+word+"&text="+text; callContext.open("GET", urlContext, true); //url reference of ajax endpoint callContext.setRequestHeader("Content-type", "application/json"); callContext.send(); callContext.onload = function(e){ //process response from endpoint if (callContext.readyState ===4){ if (callContext.status === 200){ // if it's all good ==> do this var serverResponseTable = JSON.parse(callContext.responseText); var string = ""; for(var wordOrder = 0; wordOrder< serverResponseTable.length; wordOrder++){ string = string + " "+ serverResponseTable[wordOrder]["word_orig"]; } var placeholder = "PH"+word+"_"+text; document.getElementById(placeholder).innerHTML = string; } } } } var pg = 1; var tableOrder = ""; //Make this table with AJAX ==> no reload of the entire page needed for the next 50 results! document.getElementById("goLeft").addEventListener('click', function(){ createTable('down'); }); document.getElementById("goRight").addEventListener('click', function(){ createTable('up'); }); function createTable(direction){ if (direction === 'init'){ pg = pg; }else if (direction === 'down' && pg > 1){ pg = pg-1; document.getElementById("curpagecounter").innerHTML = pg; }else if ( direction === 'up' && pg < 1){ pg = pg+1; document.getElementById("curpagecounter").innerHTML = pg; } /*Eetsy beetsy magic ==> hide left arrow when P = 1; hide Right arrow when p = PagesMax! */ if (pg ===1){ document.getElementById("goLeft").style.visibility='hidden'; } else{ document.getElementById("goLeft").style.visibility='visible'; } if (pg ===1 ){ document.getElementById("goRight").style.visibility='hidden'; } else{ document.getElementById("goRight").style.visibility='visible'; } var listURL = "/words/ajaxEndpoints/tableData.php?lemma="+JSLemma+"&type="+JSType+"&min_date="+JSMinDate+"&max_date="+JSMaxDate+"&case="+JSCase+"&abbreviated="+JSAbbreviated+"&lacuna="+JSLacuna+"&corrected="+JSCorrected+"&dotted="+JSDotted+"&gender="+JSGender+"&number="+JSNumber+"°ree="+JSDegree+"&diathese="+JSDiathese+"&mood="+JSMood+"&tense="+JSTense+"&person="+JSPerson+"&material="+JSMaterial+"&type_docpap="+JSTypeDocPap+"®ion="+JSRegion+"&nome_name="+JSNomeName+"&derived="+JSDerived+"&partner="+JSPartner+"&morph_type="+JSMorphType+"&p="+pg+"&order="+tableOrder; var callTable = new XMLHttpRequest(); //ajaxcall to (next line = adr dynamic) document.getElementById("addToThis").innerHTML = ""; callTable.open("GET", listURL, true); //url reference of ajax endpoint callTable.setRequestHeader("Content-type", "application/json"); callTable.send(); callTable.onload = function(e){ //process response from endpoint if (callTable.readyState ===4){ if (callTable.status === 200){ // if it's all good ==> do this var serverResponseTable = JSON.parse(callTable.responseText); for(var tr = 0; tr<serverResponseTable.length; tr++){ var century_short = serverResponseTable[tr]["century_short"]; var curr_tex_id = serverResponseTable[tr]["curr_tex_id"]; var curr_wordref_id = serverResponseTable[tr]["curr_wordref_id"]; var degree = serverResponseTable[tr]["degree"]; var derived = serverResponseTable[tr]["derived"]; var diathese = serverResponseTable[tr]["diathese"]; var gender = serverResponseTable[tr]["gender"]; var line = serverResponseTable[tr]["line"]; var material = serverResponseTable[tr]["material"]; var max_date = serverResponseTable[tr]["max_date"]; var min_date = serverResponseTable[tr]["min_date"]; var mood = serverResponseTable[tr]["mood"]; var morph_case = serverResponseTable[tr]["morph_case"]; var morphology = serverResponseTable[tr]["morphology"]; var name_reformat_lu = serverResponseTable[tr]["name_reformat_lu"]; var number = serverResponseTable[tr]["number"]; var person = serverResponseTable[tr]["person"]; var prev_morph_type = serverResponseTable[tr]["prev_morph_type"]; var publication = serverResponseTable[tr]["publication"]; var tense = serverResponseTable[tr]["tense"]; var tex_id = serverResponseTable[tr]["tex_id"]; var translation = serverResponseTable[tr]["translation"]; var type_docpap1 = serverResponseTable[tr]["type_docpap1"]; var word_orig = serverResponseTable[tr]["word_orig"]; var wordref_id = serverResponseTable[tr]["wordref_id"]; //once iterated ==> make string // OLD PHP CODE: var rowString = '<tr><td width="80">'+word_orig+'<i class="fa fa-question info-tooltip ajax_prepare" style="color: #41ac89; padding-left: 5px" aria-hidden="true" onmouseover=fetchWordContext('+curr_wordref_id+','+tex_id+')><span class="tooltiptext triggerContext">... <span id="PH'+curr_wordref_id+'_'+tex_id+'"></span> ...</span></i></td><td width="110">' +morphology+'<a href="../error_report.php?db=wordref&id='+wordref_id+'" target=blank><i class="fa fa-thumbs-down info-tooltip" style="color: #ffb049; padding-left: 5px" aria-hidden="true"><span class="tooltiptext" style ="background: rgba(255,255,255,0.9); color: black; top: -10px">Click here to communicate an error in the morphological interpretation of this word.</span></i></a></td> <td width="40">'+century_short+'</td><td width="100">'+name_reformat_lu+'</a></td> <td width="90" style="padding-right: 10px">'+publication+' '+line+'</td><td width="50"><a href="../tm/detail.php?tm='+tex_id+'&text_highlight_wordref='+wordref_id+'#information">TM '+tex_id+'</a></td></tr>'; //continue JS code here //var rowString = '<tr><td width="90" class="TM_id"><a href="../tm/detail.php?tm='+rowID+'">TM '+rowID+'</a></td><td width="160">'+rowPublication+'</td><td width="85">'+rowMaterial+'</td><td width="75">'+rowLanguage+'</td><td width="75">'+rowCentury+'</td><td width="75">'+rowFullName+'</td></tr>'; document.getElementById("addToThis").innerHTML +=rowString; } } } } } </script> <!-- End pages --> </div><!-- End relative --> <div class="tbl-header"> <table border="0" cellspacing="0" cellpadding="0"> <thead> <tr> <th width="80">Attestation<a href="detail.php?lemma=σορώιον&type=noun&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&person=&derived=&script=&material=&type_docpap=&provenance_top=&provenance_bottom=&corrected=&dotted=&abbreviated=&lacuna=&p=1&min_date=-799&max_date=799&order=attestations#filter-title"> ⇵</a></th><th width="110" style="padding-left: 10px">Morphology<a href="detail.php?lemma=σορώιον&type=noun&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&person=&derived=&script=&material=&type_docpap=&provenance_top=&provenance_bottom=&corrected=&dotted=&abbreviated=&lacuna=&p=1&min_date=-799&max_date=799&order=morphology#filter-title"> ⇵</a></th><th width="40" style="padding-left: 5px">Date<a href="detail.php?lemma=σορώιον&type=noun&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&person=&derived=&script=&material=&type_docpap=&provenance_top=&provenance_bottom=&corrected=&dotted=&abbreviated=&lacuna=&p=1&min_date=-799&max_date=799&order=chronology#filter-title"> ⇵</a></th><th width="100" style="padding-left: 5px">Written<a href="detail.php?lemma=σορώιον&type=noun&order=&charttype=1&case=&gender=&number=°ree=&diathese=&mood=&tense=&person=&derived=&script=&material=&type_docpap=&provenance_top=&provenance_bottom=&corrected=&dotted=&abbreviated=&lacuna=&p=1&min_date=-799&max_date=799&order=geography#filter-title"> ⇵</a></th> <th width="100" style="padding-left: 25px">Line</th> <th width="40" style="padding-left: 5px">Text</th> </tr> </thead> </table> </div> <div class="tbl-content"> <table cellpadding="0" cellspacing="0" border="0"> <tbody id="addToThis"> </tbody> </table> </div><!-- End tbl-content --> <div class="goto-top"><img src="img/arrowtop.png" /><a href="#top">Back to top</a></div> </div><!--End second-container --> </div> <!-- End bg-dark --> <!-- Footer --> <!-- Footer --> <footer> <div class="wrapper"> <div class="flex"> <section class="footer-col"> <a href="../about">About Trismegistos</a> </section> <section class="footer-col"> <!--<a href="../guide.php">First time guide</a> & --><a href="../about_how_to_cite.php">How to cite</a><br> </section> <section class="footer-col"> <a href="../terms-of-use.html">Terms & conditions</a> </section> <section class="footer-col"> Contact: <script language="JavaScript"> var username = "mark.depauw"; var hostname = "kuleuven.be"; var linktext = "<i class='fa fa-envelope' aria-hidden='true'></i>"; document.write("<a class='social' href='" + "mail" + "to:" + username + "@" + hostname + "'>" + linktext + "</a>"); </script> <a class="social" href="http://www.facebook.com/TrismegistosTM" target="_blank"><i class="fa fa-facebook-square fa-lg aria-hidden="true""></i></a> <a class="social" href="http://www.twitter.com/TrismegistosTM" target="_blank"><i class="fa fa-twitter-square fa-lg aria-hidden="true""></i></a> </section> <section class="footer-col"> Last update: <div id='updateplaceholder'></div> </section> <script> var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", '/lastupdate.txt', false); xmlhttp.send(); if (xmlhttp.status==200) { result = xmlhttp.responseText; document.getElementById('updateplaceholder').innerHTML = result; } </script> <section class="footer-col"> <img id="kul-logo" src="/img/KUL_logo.png"/> </section> <section id="cc-license" class="footer-col"> <a rel="license" target="blank" href="https://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a> </section> </div> </div> <!-- End footer.wrapper--> </footer> <!-- Cookie warning --> <div id='cookie_warning_box'> <p class="cookie-text">This site uses cookies to provide you with the best user experience. By using Trismegistos, you accept <a href='/terms-of-use.html'>our terms and conditions</a>, including the use of cookies.</p> <div id='close_cookie_warning' onClick='close_cookie_warning()'>X CLOSE</div> </div> <!-- End cookie warning --> <!-- Black screen --> <!-- End black screen --> <script> $("document").ready(function() { createTable('init') }); </script> <script>google.charts.setOnLoadCallback(drawWeighedChart);</script><!-- End Google Analytics code --> </body> </html>