Bearbeiten von „OS2.spielbericht.XXL“
Zur Navigation springen
Zur Suche springen
Die Bearbeitung kann rückgängig gemacht werden. Bitte prüfe den Vergleich unten, um sicherzustellen, dass du dies tun möchtest, und veröffentliche dann unten deine Änderungen, um die Bearbeitung rückgängig zu machen.
Aktuelle Version | Dein Text | ||
Zeile 1: | Zeile 1: | ||
[[Kategorie:Greasemonkey]] | [[Kategorie:Greasemonkey]] | ||
{| style="background-color:white; font-size:11px; float: right; margin:3px 3px 3px 10px; border:1px solid #999; border-color: #9C1818; border-collapse:collapse;" width=500 cellpadding=3 cellspacing=0 | {| style="background-color:white; font-size:11px; float: right; margin:3px 3px 3px 10px; border:1px solid #999; border-color: #9C1818; border-collapse:collapse;" width=500 cellpadding=3 cellspacing=0 | ||
| colspan="2" style="padding:0.3em; background-color:#9C1818; font-size: 18px; color:#FFFFFF" align=center| '''OS2.spielbericht.XXL''' | | colspan="2" style="padding:0.3em; background-color:#9C1818; font-size: 18px; color:#FFFFFF" align=center| '''OS2.spielbericht.XXL''' | ||
Zeile 8: | Zeile 7: | ||
|- bgcolor="#FFCC00" | |- bgcolor="#FFCC00" | ||
| '''Version''' | | '''Version''' | ||
| '''0. | | '''0.63''' | ||
|- bgcolor="#FFCC00" | |- bgcolor="#FFCC00" | ||
| '''Autor''' | | '''Autor''' | ||
| '''Andreas Eckes''', [[Strindheim BK]] <br> '''Michael Bertram''' | | '''Andreas Eckes''', [[Strindheim BK]] <br> '''Michael Bertram''' | ||
|- bgcolor="#FFCC00" | |- bgcolor="#FFCC00" | ||
| '''Beschreibung''' | | '''Beschreibung''' | ||
Zeile 27: | Zeile 26: | ||
|} | |} | ||
== Info == | === Info === | ||
Darf nur '''statt''' und nicht zusätzlich zum OS2.spielbericht verwendet werden, da sonst Funktionen gedoppelt werden. | Darf nur '''statt''' und nicht zusätzlich zum OS2.spielbericht verwendet werden, da sonst Funktionen gedoppelt werden. | ||
== | === Quellcode === | ||
<pre> | <pre> | ||
// ==UserScript== | // ==UserScript== | ||
// @name | // @name OS2.spielbericht.XXL | ||
// @version 0.63 | |||
// @version | // @description Zaehlt Textbausteine | ||
// @ | // @description OS 2.0 - Ergänzt Summen- und Durchschnittswerte bei den Spielerstatistiken im Spielbericht | ||
// @description | // @description Quoten mit Nachkomma | ||
// @include | // @description Leere Zeilen nicht genullt | ||
// @ | // @description Fenstergroesse | ||
// | // @include http*://os.ongapo.com/rep/saison/* | ||
// @include http*://www.os.ongapo.com/rep/saison/* | |||
// @ | // @include http*://online-soccer.eu/rep/saison/* | ||
// @ | // @include http*://www.online-soccer.eu/rep/saison/* | ||
// @ | // @grant none | ||
// ==/UserScript== | // ==/UserScript== | ||
// ************************************************************************************** | // ************************************************************************************** | ||
Zeile 77: | Zeile 72: | ||
var kopfz = [ "ZWKo", "ZWKo %","ZWKd", "ZWKd %","Pass", "P\u00E4sse %","Ansp."]; //der Tabelle berichtsstatistik | var kopfz = [ "ZWKo", "ZWKo %","ZWKd", "ZWKd %","Pass", "P\u00E4sse %","Ansp."]; //der Tabelle berichtsstatistik | ||
var kategorien = [ "Z_o_v", "Z_d_g","P_e", "P_f","Ansp_e", "Ansp_f","Sch_e","Sch_f"]; //zu | var kategorien = [ "Z_o_v", "Z_d_g","P_e", "P_f","Ansp_e", "Ansp_f","Sch_e","Sch_f"]; //zu zählende Elemente | ||
function regexsuche (begriff) { | function regexsuche (begriff) { | ||
Zeile 137: | Zeile 132: | ||
spielerakt[j][1-i] = spielernamen[i].textContent; | spielerakt[j][1-i] = spielernamen[i].textContent; | ||
if (spielbericht.rows[j].cells[0].textContent === "") { | if (spielbericht.rows[j].cells[0].textContent === "") { | ||
//spielbericht.rows[j].cells[3].textContent = spielbericht.rows[j-1].cells[4].textContent; //......................................................... | //spielbericht.rows[j].cells[3].textContent = spielbericht.rows[j-1].cells[4].textContent; //.........................................................Zweikampfgegener (Name) aus der letzten Zeile | ||
spielerakt[j][0] = spielerakt[j-1][1]; | spielerakt[j][0] = spielerakt[j-1][1]; | ||
} | } | ||
Zeile 210: | Zeile 205: | ||
} | } | ||
} | } | ||
if (ereignis[j][1] === 0) { //Ballverlust | |||
spielbericht.rows[j].cells[2+l].textContent = ereignis[j][0]; //Ereignis in Spielbericht eintragen | |||
if (ereignis[j][1] === 0) { // Ballverlust | |||
switch (ereignis[j][0]) { | switch (ereignis[j][0]) { | ||
case | case "SCH": | ||
spielbericht.rows[j].cells[2+l].innerHTML = '<img src="http://os2.bertram-michael.de/img/sch.png" height="15" width="15">'; | |||
break; | break; | ||
case | case "Pass": | ||
spielbericht.rows[j].cells[2+l].innerHTML = '<img src="http://os2.bertram-michael.de/img/pass.png" height="15" width="15">'; | |||
break; | break; | ||
case | case "ZWK_ov": | ||
spielbericht.rows[j].cells[2+l].innerHTML = '<img src="http://os2.bertram-michael.de/img/zwk.png" height="25" width="25">'; | |||
break; | break; | ||
} | } | ||
} | } | ||
else if (ereignis[j][0] == | else if (ereignis[j][0] == "SCH") { // Tor weil Erfolg = 1 (else) | ||
// | //spielbericht.rows[j].cells[2+l].textContent = "TOR"; //Ereignis in Spielbericht eintragen | ||
spielbericht.rows[j].cells[2+l].innerHTML = '<img src="http://os2.bertram-michael.de/img/tor.png" height="25" width="25">'; //TOR | |||
} | } | ||
Zeile 295: | Zeile 287: | ||
} | } | ||
for (j = 1; j < tabberstat.rows.length; j++) { // Spieler | for (j = 1; j < tabberstat.rows.length; j++) { // Spieler | ||
if (tabberstat.rows[j].cells[6].textContent !== "") | if (tabberstat.rows[j].cells[6].textContent !== "") tabberstat.rows[j].cells[6].textContent = (100 * tabberstat.rows[j].cells[6].textContent / tabberstat.rows[j].cells[5].textContent).toFixed(2); | ||
if (tabberstat.rows[j].cells[14].textContent !== "") | if (tabberstat.rows[j].cells[14].textContent !== "") tabberstat.rows[j].cells[14].textContent = (100 * tabberstat.rows[j].cells[14].textContent / tabberstat.rows[j].cells[13].textContent).toFixed(2); | ||
// Anzahl ZWK | // Anzahl ZWK | ||
if (tabberstat.rows[j].cells[0].textContent !== "") | if (tabberstat.rows[j].cells[0].textContent !== "") tabberstat.rows[j].cells[1].textContent = (tabspielstat.rows[j].cells[2].textContent * tabspielstat.rows[j].cells[3].textContent / 100).toFixed(0) - tabberstat.rows[j].cells[4].textContent + tabberstat.rows[j].cells[2].textContent * 1; | ||
if (tabberstat.rows[j].cells[0].textContent !== "") | if (tabberstat.rows[j].cells[0].textContent !== "") tabberstat.rows[j].cells[3].textContent = (tabspielstat.rows[j].cells[2].textContent * (100 - tabspielstat.rows[j].cells[3].textContent) / 100).toFixed(0) - tabberstat.rows[j].cells[2].textContent + tabberstat.rows[j].cells[4].textContent * 1; | ||
if (tabberstat.rows[j].cells[16].textContent !== "") | if (tabberstat.rows[j].cells[16].textContent !== "") tabberstat.rows[j].cells[9].textContent = (tabspielstat.rows[j].cells[13].textContent * tabspielstat.rows[j].cells[14].textContent / 100).toFixed(0) - tabberstat.rows[j].cells[12].textContent + tabberstat.rows[j].cells[10].textContent * 1; | ||
if (tabberstat.rows[j].cells[16].textContent !== "") | if (tabberstat.rows[j].cells[16].textContent !== "") tabberstat.rows[j].cells[11].textContent = (tabspielstat.rows[j].cells[13].textContent * (100 - tabspielstat.rows[j].cells[14].textContent) / 100).toFixed(0) - tabberstat.rows[j].cells[10].textContent + tabberstat.rows[j].cells[12].textContent * 1; | ||
// ZWKo % | // ZWKo % | ||
if (tabberstat.rows[j].cells[1].textContent === "0") | if (tabberstat.rows[j].cells[1].textContent === "0") tabberstat.rows[j].cells[2].textContent = (0).toFixed(2); | ||
if (tabberstat.rows[j].cells[9].textContent === "0") | else if (tabberstat.rows[j].cells[1].textContent === "") tabberstat.rows[j].cells[2].textContent = ""; | ||
else tabberstat.rows[j].cells[2].textContent = (100 - tabberstat.rows[j].cells[2].textContent / tabberstat.rows[j].cells[1].textContent * 100).toFixed(2); | |||
if (tabberstat.rows[j].cells[9].textContent === "0") tabberstat.rows[j].cells[10].textContent = (0).toFixed(2); | |||
else if (tabberstat.rows[j].cells[9].textContent === "") tabberstat.rows[j].cells[10].textContent = ""; | |||
else tabberstat.rows[j].cells[10].textContent = (100 - tabberstat.rows[j].cells[10].textContent / tabberstat.rows[j].cells[9].textContent * 100).toFixed(2); | |||
// ZWKd % | // ZWKd % | ||
if (tabberstat.rows[j].cells[3].textContent === "0") | if (tabberstat.rows[j].cells[3].textContent === "0") tabberstat.rows[j].cells[4].textContent = (0).toFixed(2); | ||
if (tabberstat.rows[j].cells[11].textContent === "0") | else if (tabberstat.rows[j].cells[3].textContent === "") tabberstat.rows[j].cells[4].textContent = ""; | ||
else tabberstat.rows[j].cells[4].textContent = (tabberstat.rows[j].cells[4].textContent / tabberstat.rows[j].cells[3].textContent * 100).toFixed(2); | |||
if (tabberstat.rows[j].cells[11].textContent === "0") tabberstat.rows[j].cells[12].textContent = (0).toFixed(2); | |||
else if (tabberstat.rows[j].cells[11].textContent === "") tabberstat.rows[j].cells[12].textContent = ""; | |||
else tabberstat.rows[j].cells[12].textContent = (tabberstat.rows[j].cells[12].textContent / tabberstat.rows[j].cells[11].textContent * 100).toFixed(2); | |||
// Zellen nullen | // Zellen nullen | ||
if (tabberstat.rows[j].cells[0].textContent !== "") { | if (tabberstat.rows[j].cells[0].textContent !== "") { | ||
if (tabberstat.rows[j].cells[5].textContent === "") | if (tabberstat.rows[j].cells[5].textContent === "") tabberstat.rows[j].cells[5].textContent = 0; | ||
if (tabberstat.rows[j].cells[6].textContent === "") | if (tabberstat.rows[j].cells[6].textContent === "") tabberstat.rows[j].cells[6].textContent = (0).toFixed(2); | ||
if (tabberstat.rows[j].cells[7].textContent === "") | if (tabberstat.rows[j].cells[7].textContent === "") tabberstat.rows[j].cells[7].textContent = 0; | ||
} | } | ||
if (tabberstat.rows[j].cells[16].textContent !== "") { | if (tabberstat.rows[j].cells[16].textContent !== "") { | ||
if (tabberstat.rows[j].cells[13].textContent === "") | if (tabberstat.rows[j].cells[13].textContent === "") tabberstat.rows[j].cells[13].textContent = 0; | ||
if (tabberstat.rows[j].cells[14].textContent === "") | if (tabberstat.rows[j].cells[14].textContent === "") tabberstat.rows[j].cells[14].textContent = (0).toFixed(2); | ||
if (tabberstat.rows[j].cells[15].textContent === "") | if (tabberstat.rows[j].cells[15].textContent === "") tabberstat.rows[j].cells[15].textContent = 0; | ||
} | } | ||
Zeile 587: | Zeile 587: | ||
return returnValue; | return returnValue; | ||
} | } | ||
</pre> | </pre> |