# HG changeset patch # User František Kučera # Date 1234389637 -3600 # Node ID 29bb67aa99fdc584db5ea5fd437a9620cdad98d2 # Parent 38625daa449bbef46bea42067dc9c27a12c26395 Řazení tabulky hříšníků klikáním na záhlaví tabulky – JS na straně klienta. diff -r 38625daa449b -r 29bb67aa99fd java/HrisniciSpameri/web/index.jsp --- a/java/HrisniciSpameri/web/index.jsp Wed Feb 11 22:25:09 2009 +0100 +++ b/java/HrisniciSpameri/web/index.jsp Wed Feb 11 23:00:37 2009 +0100 @@ -7,6 +7,7 @@ + Hříšníci spameři diff -r 38625daa449b -r 29bb67aa99fd java/HrisniciSpameri/web/souhrn.jspx --- a/java/HrisniciSpameri/web/souhrn.jspx Wed Feb 11 22:25:09 2009 +0100 +++ b/java/HrisniciSpameri/web/souhrn.jspx Wed Feb 11 23:00:37 2009 +0100 @@ -25,7 +25,7 @@ - + @@ -33,12 +33,14 @@

Denní souhrn

- +
- - - - + + + + + + diff -r 38625daa449b -r 29bb67aa99fd java/HrisniciSpameri/web/styl.css --- a/java/HrisniciSpameri/web/styl.css Wed Feb 11 22:25:09 2009 +0100 +++ b/java/HrisniciSpameri/web/styl.css Wed Feb 11 23:00:37 2009 +0100 @@ -15,5 +15,13 @@ thead { background: silver; font-weight:bold; +} +thead td a { + color: black; + text-decoration: none; +} + +img { + border: none; } \ No newline at end of file diff -r 38625daa449b -r 29bb67aa99fd java/HrisniciSpameri/web/tabulka-dolu.gif Binary file java/HrisniciSpameri/web/tabulka-dolu.gif has changed diff -r 38625daa449b -r 29bb67aa99fd java/HrisniciSpameri/web/tabulka-nahoru.gif Binary file java/HrisniciSpameri/web/tabulka-nahoru.gif has changed diff -r 38625daa449b -r 29bb67aa99fd java/HrisniciSpameri/web/tridenitabulky.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/HrisniciSpameri/web/tridenitabulky.js Wed Feb 11 23:00:37 2009 +0100 @@ -0,0 +1,357 @@ +addEvent(window, "load", sortables_init); + +var SORT_COLUMN_INDEX; + +function trim(myText) +{ + if (myText != null) + { + while (myText.indexOf(". ") != -1 || myText.indexOf(": ") != -1 || myText.indexOf("\n") != -1) + { + myText = myText.replace(/\. /,"."); + myText = myText.replace(/\: /,"."); + myText = myText.replace(/\s /,""); + } + } + return myText; +} + +function sortables_init() +{ + predemNactiNahoru = new Image(14,11); + predemNactiNahoru.src ="tabulka-nahoru.gif"; + predemNactiDolu = new Image(14,11); + predemNactiDolu.src ="tabulka-dolu.gif"; + + if (!document.getElementsByTagName) + return; + tbls = document.getElementsByTagName("table"); + for (ti=0;ti 0) + { + var firstRow = table.rows[0]; + } + if (!firstRow) + return; + var cell; + var txt; + for (var i=0;i'; + } + } +} + +function ts_getInnerText(el) +{ + if (typeof el == "string") + return el; + if (typeof el == "undefined") + return el; + if (el.innerText) + return el.innerText; //Not needed but it is faster + var str = ""; + + var cs = el.childNodes; + var l = cs.length; + for (var i = 0; i < l; i++) + { + switch (cs[i].nodeType) + { + case 1: //ELEMENT_NODE + str += ts_getInnerText(cs[i]); + break; + case 3: //TEXT_NODE + str += cs[i].nodeValue; + break; + } + } + return str; +} + +function findValidRowInColumn(table,column) +{ + var ir = 1; + for (ir=1 ;ir < table.rows.length; ir++) + { + if (table.rows[ir].cells[column] != undefined && table.rows[ir].cells[column].className != 'dontsort' && ts_getInnerText(table.rows[ir].cells[column]).length > 0 && ts_getInnerText(table.rows[ir].cells[column]) != " ") + return ir; + } + return 0; +} + +function ts_resortTable(lnk) +{ + var span; + for (var ci=0;ci 0 && ts_getInnerText(a.cells[SORT_COLUMN_INDEX]) != " ") + { + aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]); + var aaList = trim(aa).split(" "); + var aaDateList; + var aaTimeList; + if (aaList[0].indexOf(".") != -1) + {// první je datum + + aaDateList = aaList[0].split("."); + + if (aaList[1] != null && aaList[1].indexOf(":") != -1) + { // rozbrakovat �as + aaTimeList = aaList[1].split(":"); + if (aaTimeList.length > 2) + aaDateTime = new Date(aaDateList[2],(aaDateList[1]-1),aaDateList[0],aaTimeList[0],aaTimeList[1],aaTimeList[2]); + else + aaDateTime = new Date(aaDateList[2],(aaDateList[1]-1),aaDateList[0],aaTimeList[0],aaTimeList[1],0); + } + else + { // jenom datum + aaDateTime = new Date(aaDateList[2],(aaDateList[1]-1),aaDateList[0]); + } + } + else + { // první je �as + aaTimeList = aaList[1].split(":"); + aaDateList = aaList[0].split("."); + if (aaTimeList.length > 2) + aaDateTime = new Date(aaDateList[2],(aaDateList[1]-1),aaDateList[0],aaTimeList[0],aaTimeList[1],aaTimeList[2]); + else + aaDateTime = new Date(aaDateList[2],(aaDateList[1]-1),aaDateList[0],aaTimeList[0],aaTimeList[1],0); + } + } + else + aaDateTime = new Date(1900,0,1); + + var bbDateTime; + if (b.cells[SORT_COLUMN_INDEX] != undefined && b.cells[SORT_COLUMN_INDEX].className != 'dontsort' && ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).length > 0 && ts_getInnerText(b.cells[SORT_COLUMN_INDEX]) != " ") + { + bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]); + var bbList = trim(bb).split(" "); + var bbDateList; + var bbTimeList; + + if (bbList[0].indexOf(".") != -1) + {// první je datum + bbDateList = bbList[0].split("."); + if (bbList[1] != null && bbList[1].indexOf(":") != -1) + { // rozbrakovat �as + bbTimeList = bbList[1].split(":"); + if (bbTimeList.length > 2) + bbDateTime = new Date(bbDateList[2],(bbDateList[1]-1),bbDateList[0],bbTimeList[0],bbTimeList[1],bbTimeList[2]); + else + bbDateTime = new Date(bbDateList[2],(bbDateList[1]-1),bbDateList[0],bbTimeList[0],bbTimeList[1],0); + } + else + { // jenom datum + bbDateTime = new Date(bbDateList[2],(bbDateList[1]-1),bbDateList[0]); + } + } + else + { // první je �as + bbTimeList = bbList[1].split(":"); + bbDateList = bbList[0].split("."); + if (bbTimeList.length > 2) + bbDateTime = new Date(bbDateList[2],(bbDateList[1]-1),bbDateList[0],bbTimeList[0],bbTimeList[1],bbTimeList[2]); + else + bbDateTime = new Date(bbDateList[2],(bbDateList[1]-1),bbDateList[0],bbTimeList[0],bbTimeList[1],0); + } + } + else + bbDateTime = new Date(1900,0,1); + + if (aaDateTime == bbDateTime) + return 0; + else if (aaDateTime < bbDateTime) + return -1; + else + return 1; +} + +function ts_sort_currency(a,b) +{ + aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,''); + bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,''); + return parseFloat(aa) - parseFloat(bb); +} + +function ts_sort_numeric(a,b) +{ + if (a.cells[SORT_COLUMN_INDEX] != undefined && a.cells[SORT_COLUMN_INDEX].className != 'dontsort' && ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).length > 0 && ts_getInnerText(a.cells[SORT_COLUMN_INDEX]) != " ") + aa = parseFloat(ts_getInnerText(a.cells[SORT_COLUMN_INDEX])); + else + aa = 0; + if (b.cells[SORT_COLUMN_INDEX] != undefined && b.cells[SORT_COLUMN_INDEX].className != 'dontsort' && ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).length > 0 && ts_getInnerText(b.cells[SORT_COLUMN_INDEX]) != " ") + bb = parseFloat(ts_getInnerText(b.cells[SORT_COLUMN_INDEX])); + else + bb = 0; + return aa-bb; +} + +function char2Diacritic(transDiacritic) +{ + var charDiacritic = "�����ĚĽ�����ŠŤ�Ŏ�Ž"; + var numDiacritic = "ACDEILLNOORRSTUUYZ"; + var tmpDiacritic = ""; + var newDiacritic = ""; + transDiacritic = transDiacritic.toUpperCase(); + for(i=0;i 0) + aa = char2Diacritic(ts_getInnerText(a.cells[SORT_COLUMN_INDEX])); + if (b.cells[SORT_COLUMN_INDEX] != undefined && b.cells[SORT_COLUMN_INDEX].className != 'dontsort' && ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).length > 0) + bb = char2Diacritic(ts_getInnerText(b.cells[SORT_COLUMN_INDEX])); + if (aa==bb) + return 0; + else if (aa < bb) + return -1; + else + return 1; +} + +function ts_sort_default(a,b) +{ + aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]); + bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]); + if (aa==bb) + return 0; + else if (aa
IP adresaDoménaPočet pokusůCíl útoku
IP adresaDoménaPočet pokusůCíl útoku