- Registriert
- Jan. 2008
- Beiträge
- 5.270
Schade, hab dieses Profil 9 Jahre lang gepflegt wie meinen eigenen Pokalschrank
http://de.xfire.com/profile/moe89pentiumd830/
http://de.xfire.com/profile/moe89pentiumd830/
Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
function toggle_extra_rows( theObject )
{
if(!theObject) return;
var element = document.getElementById( theObject );
if(!element) return;
var toggleLink = document.getElementById( theObject + '_show_link' );
var showText = toggleLink.getAttribute( "showText" );
var hideText = toggleLink.getAttribute( "hideText" );
var numRows = element.getAttribute( "numRows" );
if( element.getAttribute( "showingAll" ) == null )
element.setAttribute( "showingAll", "hidden" );
if ( element.getAttribute( "showingAll" ) == "hidden" )
{
element.setAttribute( "showingAll", "visible" );
hide_rows( theObject, numRows, false );
toggleLink.innerHTML = hideText;
}
else
{
element.setAttribute( "showingAll", "hidden" );
hide_rows( theObject, numRows, true );
toggleLink.innerHTML = showText;
}
}
// Hide/show/set the row visibility
function hide_rows( tableName, numRows, hideRows )
{
var theTable=document.getElementById(tableName);
if(!theTable)
return;
var tbody = theTable.tBodies[0];
if (numRows == -1)
{
// special case for always showing all rows, regardless
for( var i = 0; i < tbody.rows.length; i++)
{
tbody.rows.style.display = "";
}
}
else
{
for( var i = 0; i < tbody.rows.length; i++ )
{
if( hideRows == true && i >= numRows )
tbody.rows.style.display = "none";
else
tbody.rows.style.display = "";
}
}
// Determine if there are enough elements in the table to justify having the toggle link
var toggleLink=document.getElementById(tableName + "_ToggleLink");
if( tbody.rows.length <= numRows || numRows == -1)
toggleLink.style.display = "none";
else
toggleLink.style.display = "block";
}
// Helper sort function that takes the id and the column number
function do_sort_table( tableName, columnNumber )
{
var theTable = document.getElementById(tableName);
if( theTable )
{
theColumn = theTable.rows[0].cells[columnNumber];
if( theColumn )
sort_table(theColumn);
}
}
// Sort the table, based on the column heading that was clicked
function sort_table( theColumn )
{
// Go up the chain until we hit the enclosing table
var theTable = theColumn;
while( theTable != null && theTable.tagName.toLowerCase() != 'table' )
{
theTable = theTable.parentNode;
}
// Did we never hit a table? If so, do get out.
if( theTable == null )
return;
// Determine the index of this column
var cells = theTable.rows[0].cells;
var len = cells.length;
for (i = 0; i < len; i++) {
if (cells == theColumn) break;
}
var colNum = i;
// Make a temporary copy of the table's rows
// sort those using array.sort
// Set the table's rows to be the now ordered set
var numRows = theTable.tBodies[0].rows.length;
var tempArray = new Array();
for(var i = 0; i < numRows; i++ )
{
tempArray = theTable.tBodies[0].rows;
}
// Get the sorting type (ie, how we should treat the data in the cells)
var sortType = theColumn.getAttribute( 'datatype' );
// Determine whether we're sorting ascending or descending
var bDescending;
if( theColumn.getAttribute( "sortOrder" ) == "Ascending" )
{
theColumn.setAttribute( "sortOrder", "Descending" );
bDescending = true;
}
else
{
theColumn.setAttribute( "sortOrder", "Ascending" );
bDescending = false;
}
// Set the up/down sorting indicator for this column
SetColumnSortIndicator( theTable, theColumn, bDescending );
// Sort the rows
tempArray.sort( compareColData( colNum, bDescending, sortType ) );
for(var i = 0; i < numRows; i++ )
{
theTable.tBodies[0].appendChild( tempArray );
}
// Get the row hiding/showing back to normal - toggle twice, and it'll be fixed.
toggle_extra_rows( theTable.getAttribute( "ID" ) );
toggle_extra_rows( theTable.getAttribute( "ID" ) );
// Fix the row colorations
fixColors( theTable );
}
function SetColumnSortIndicator( theTable, theColumn, bDescending )
{
// If there's nothing to sort, then don't show the indicator
// (also if there's only one row, since one can only sort more
// than one object.)
if( theTable.tBodies[0].rows.length <= 1 )
return;
var uid = "sortIndicator" + theTable.getAttribute( "id" );
var sortNode = document.getElementById( uid );
if( sortNode != null )
{
var theParent = sortNode.parentNode;
theParent.removeChild( sortNode );
}
// create the sort indicator node
var sortNode = document.createElement( "span" );
sortNode.setAttribute( "id", uid );
var textNode = document.createTextNode( "" );
sortNode.appendChild( textNode );
// Set the sort indicator to point in the right direction (up or down)
if( bDescending == true )
sortNode.innerHTML = " ^";
else
sortNode.innerHTML = " v";
// Place the indicator on this column heading (this should move it from its
// previous home automatically)
theColumn.appendChild( sortNode );
}
function compareColData( colNum, bDescending, sortType )
{
switch( sortType )
{
case "numeric":
return numericSort( colNum, bDescending );
case "wow":
return wowSort( bDescending );
default: // "alphanumeric" also goes here
return alphaSort( colNum, bDescending );
}
}
function wowSort( bDescending )
{
return function( n1, n2 )
{
// WoW rankings specially formatted as "<level> <Character Name>"
// We will sort bDescending on the level first, if they have the same level
// then sort by !bDescending on the Character Name
// To minimalize the impact elsewhere, we ignore the colNum argument and always
// get the WoW specific attributes
var level1 = Number(n1.getAttribute( "level" ));
var level2 = Number(n2.getAttribute( "level" ));
if (level1 != level2)
return (bDescending?(level1 - level2)level2 - level1));
var name1 = n1.getAttribute( "charname" );
var name2 = n2.getAttribute( "charname" );
if (name1 == name2)
return 0;
if (name1 > name2)
return (bDescending?-1:1);
return (bDescending?1:-1);
};
}
function alphaSort( colNum, bDescending )
{
return function( n1, n2 )
{
if( String(n1.getAttribute( "colData" + colNum )).toUpperCase() > String(n2.getAttribute( "colData" + colNum ) ).toUpperCase() )
{
return bDescending ? +1 : -1;
}
else
{
return bDescending ? -1 : +1;
}
};
}
function numericSort( colNum, bDescending )
{
return function( n1, n2 )
{
if( Number(n1.getAttribute( "colData" + colNum )) > Number(n2.getAttribute( "colData" + colNum )) )
{
return bDescending ? +1 : -1;
}
else if( Number(n1.getAttribute( "colData" + colNum )) < Number(n2.getAttribute( "colData" + colNum )) )
{
return bDescending ? -1 : +1;
}
else
{
return 0;
}
};
}
function fixColors( theTable )
{
var len = theTable.rows.length;
for(var i = 1; i < len; i++ ) // start at one so we don't touch the header row
{
// respect multiple classes
var classname = theTable.rows.className;
if(classname.indexOf("est_row1")!=-1)
classname = classname.replace(/est_row1/g, "");
if(classname.indexOf("est_row2")!=-1)
classname = classname.replace(/est_row2/g, "");
if( i % 2 == 0 )
classname += " est_row1";
else
classname += " est_row2";
theTable.rows.className = classname;
}
}
// for expanding individual rows
function toggle_row_content( theImage )
{
// Go up the chain until we hit the enclosing table
var theTable = theImage;
while( theTable != null && theTable.tagName.toLowerCase() != 'table' )
{
theTable = theTable.parentNode;
}
// Did we never hit a table? If so, do get out.
if( theTable == null )
return;
var theRow = theTable.rows[1];
if( theRow.className == "est_toggle_display_on" )
{
theRow.className = "est_toggle_display_off";
theImage.className = "est_toggle_up";
}
else
{
theRow.className = "est_toggle_display_on";
theImage.className = "est_toggle_down";
}
}
BLACKDIAMONT schrieb:Ich hab mir mal evolve angeschaut, der importiert auch die Daten von Xfire. Teste das gerade, bisher läufts gut
https://blog.evolvehq.com/2015/06/goodbye-xfire-we-will-miss-you/