1 2var currentDate = new Date(); 3var timeFormat = 0; 4switchFormat(0); 5 6function selectCity() { 7var e = document.getElementById("azCities"); 8if (!e) { 9 return false; 10} 11 12var value = e.options[e.selectedIndex].value; 13var text = e.options[e.selectedIndex].text; 14return [value, text]; 15} 16 17 18// display monthly timetable 19function displayMonth(offset) { 20/* var lat = $('latitude').value; 21var lng = $('longitude').value; 22var timeZone = $('timezone').value; 23var dst = $('dst').value; 24var method = $('method').value;*/ 25 26var e = document.getElementById("azCities"); 27if (!e) { 28 return false; 29} 30 31var values = selectCity(); 32var latlngArr = values[0].split(','); 33var lat2 = latlngArr[0]; 34var lng2 = latlngArr[1]; 35selectCity(); 36var lat = lat2 || "40.409264"; 37var lng = lng2 || "49.867092"; 38var timeZone = "+4"; 39var dst = "auto"; 40var method = "Jafari"; 41 42prayTimes.setMethod(method); 43currentDate.setMonth(currentDate.getMonth()+ 1* offset); 44var month = currentDate.getMonth(); 45var year = currentDate.getFullYear(); 46var title = monthFullName(month)+ ' '+ year; 47 48/* 49$('table-title').innerHTML = title; 50*/ 51makeTable(year, month, lat, lng, timeZone, dst); 52} 53 54// make monthly timetable 55function makeTable(year, month, lat, lng, timeZone, dst) { 56/* var items = {day: 'Day', fajr: 'Fajr', sunrise: 'Sunrise', 57dhuhr: 'Dhuhr', asr: 'Asr', // sunset: 'Sunset', 58maghrib: 'Maghrib', isha: 'Isha'};*/ 59var items = {day: 'Gün', fajr: 'Sübh', sunrise: 'GünÉÅ', 60dhuhr: 'Zöhr', asr: 'Æsr', // sunset: 'Sunset', 61maghrib: 'MÉÄrib', isha: 'İÅa' }; 62 63var items2 = {fajr: 'Sübh', sunrise: 'GünÉÅ', 64 dhuhr: 'Zöhr', asr: 'Æsr', // sunset: 'Sunset', 65 maghrib: 'MÉÄrib', isha: 'İÅa' }; 66 67var tbody = document.createElement('tbody'); 68tbody.appendChild(makeTableRow(items, items, 'head-row')); 69 70var tbody2 = document.createElement('tbody'); 71tbody2.appendChild(makeTableRow(items2, items2, 'head-row')); 72 73var date = new Date(year, month, 1); 74var endDate = new Date(year, month+ 1, 1); 75var format = timeFormat ? '12hNS' : '24h'; 76var isToday_var = 0; 77 78while (date < endDate) { 79 var times = prayTimes.getTimes(date, [lat, lng], timeZone, dst, format); 80 times.day = date.getDate(); 81 var today = new Date(); 82 var isToday = (date.getMonth() == today.getMonth()) && (date.getDate() == today.getDate()); 83 var klass = isToday ? 'today-row' : ''; 84 tbody.appendChild(makeTableRow(times, items, klass)); 85 date.setDate(date.getDate()+ 1); // next day 86 87 if(isToday) { 88 isToday_var = 1; 89 tbody2.appendChild(makeTableRow(times, items2, klass)); 90 } 91} 92 93removeAllChild(idbb('timetable')); 94idbb('timetable').appendChild(tbody); 95 96removeAllChild(idbb('timetable2')); 97idbb('timetable2').appendChild(tbody2); 98} 99 100// make a table row 101function makeTableRow(data, items, klass) { 102var row = document.createElement('tr'); 103for (var i in items) { 104var cell = document.createElement('td'); 105cell.innerHTML = data[i]; 106cell.style.width = i=='day' ? '2.5em' : '3.7em'; 107row.appendChild(cell); 108} 109row.className = klass; 110return row; 111} 112 113// remove all children of a node 114function removeAllChild(node) { 115if (node == undefined || node == null) 116return; 117 118while (node.firstChild) 119node.removeChild(node.firstChild); 120} 121 122// switch time format 123function switchFormat(offset) { 124var formats = ['24-hour', '12-hour']; 125timeFormat = (timeFormat+ offset)% 2; 126update(); 127} 128 129// update table 130var updCount = 0; 131function update() { 132if (updCount < 1) { 133displayMonth(0); 134} 135updCount += 1; 136} 137 138// return month full name 139function monthFullName(month) { 140var monthName = new Array('Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'İyun', 141'İyul', 'Avqust', 'Sentyabr', 'Oktyabr', 'Noyabr', 'Dekabr'); 142return monthName[month]; 143} 144 145function idbb(id) { 146return document.getElementById(id); 147} 148 149setTimeout(function() { update(); }, 500); 150 151
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.