[BUG] Mylist export template bug/typo

Please report any sort of feature requests or bugs on the tracker instead of the forum! http://tracker.anidb.info

Moderator: AniDB

Locked
Hybr1d
Posts: 4
Joined: Mon May 14, 2007 1:05 pm

[BUG] Mylist export template bug/typo

Post by Hybr1d » Thu May 31, 2007 8:40 am

Hello.

EDIT: http://tracker.anidb.info/view.php?id=661

I found a bug/typo in the mylist export template "xml-dark", about the "Complete" button;

Original code "mylista.js"

Code: Select all

var xmlURL = "mylist.xml";
var xslURL = "mylistb.xsl";
var resultElementId = "resultDiv";
var lastclass ="";
var sfv = 0;
var selected = 0;
var lastsel = 0;
var watched = 0;
var completed = 0;
var sortName = "Name";
var sortOrder = "ascending";
var sortType = "text";

function over(obj, name){
	obj.style.cursor='pointer';
	obj.className=name;
}
function out(obj){
	obj.style.cursor='';
	obj.className='';
}
function over2(obj, name){
	lastclass = obj.className;
	obj.className=name;
}
function out2(obj){
	obj.className=lastclass;
}
function sort(field, type){
	selected = 0;
	if(sortName==field){
		if(sortOrder=="ascending")
			sortOrder="descending";
		else	sortOrder="ascending";
	}
	else sortName = field;

	sortType = type;
	
	setVariable(xslDocument, "selected", selected);
	sortColumns(xmlDocument, xslDocument, resultElementId, sortName, sortType, sortOrder);
	update();
}
function select(nr){
	if(lastsel==nr) nr = 0;
	lastsel = nr;
	selected=nr;
	
	setVariable(xslDocument, "selected", selected);
	update();
}
function swWatched(obj, name){
	selectedN = '0';
	if(watched=='0'){
		watched = '1';
		obj.className=name;
	}else{
		watched = '0';
		obj.className='';
	}
	
	setVariable(xslDocument, "watched", watched);
	update();
}
function swComplete(obj){
	selectedN = 0;
	if(completed=='0'){
			completed = '1';
			obj.className='opt';
		}else{
			completed = '0';
			obj.className='';
		}

	setVariable(xslDocument, "completed", completed);
	update();
}
function swSFV(obj){
	if(sfv==0){
			sfv = 1;
			obj.className='opt';
	}else{
		sfv = 0;
		obj.className='';
	}

	setVariable(xslDocument, "sfv", sfv);
	update();
}

function setVariable(xslDocument, varname, value) {
  var xslNamespace = 'http://www.w3.org/1999/XSL/Transform';
  if (typeof xslDocument.setProperty != 'undefined') {
    xslDocument.setProperty('SelectionLanguage', 'XPath');
    xslDocument.setProperty('SelectionNamespaces', 'xmlns:xsl="' + xslNamespace + '"');
    var xslvar = xslDocument.selectSingleNode("//xsl:variable[@name='"+varname+"']/@select");
    xslvar.value = value;
  }
  else if (typeof xslDocument.getElementsByTagNameNS != 'undefined'){
    var xslApplyTemplates = xslDocument.getElementsByTagNameNS(xslNamespace, 'variable');
    for(var i = 0; i < xslApplyTemplates.length; i++) {
      var xslApplyTemplate = xslApplyTemplates[i];
    if (xslApplyTemplate.getAttribute('name') == varname) {
        xslApplyTemplate.setAttribute('select', value);
        break;
      }
    }
  }
}
function sortColumns(xmlDocument, xslDocument, resultElementId, orderBy, dataType, sortOrder) {
  removeXslSort(xslDocument, 'Anime');
  if (typeof orderBy != 'undefined') {
    if (typeof dataType == 'undefined') {
      dataType = 'text';
    }
    if (typeof sortOrder == 'undefined') {
      sortOrder = 'ascending';
    }
    addXslSort(xslDocument, 'Anime', orderBy, dataType, sortOrder);
  }
}
function removeXslSort (xslDocument, tagName) {
  var xslNamespace = 'http://www.w3.org/1999/XSL/Transform';
  if (typeof xslDocument.setProperty != 'undefined') {
    xslDocument.setProperty('SelectionLanguage', 'XPath');
    xslDocument.setProperty('SelectionNamespaces', 'xmlns:xsl="' + xslNamespace + '"');
    var xslSort = xslDocument.selectSingleNode('//xsl:sort');
    if (xslSort) {
      xslSort.parentNode.removeChild(xslSort);
    }
  }
  else if (typeof xslDocument.getElementsByTagNameNS != 'undefined') {
    var xslSorts = xslDocument.getElementsByTagNameNS(xslNamespace, 'sort');
    if (xslSorts.length > 0) {
      xslSorts[0].parentNode.removeChild(xslSorts[0]);
    }
  }
}
function addXslSort (xslDocument, tagName, orderBy, dataType, sortOrder) {
  var xslNamespace = 'http://www.w3.org/1999/XSL/Transform';
  if (typeof xslDocument.setProperty != 'undefined') {
    xslDocument.setProperty('SelectionLanguage', 'XPath');
    xslDocument.setProperty('SelectionNamespaces', 'xmlns:xsl="' + xslNamespace + '"');
    var xslApplyTemplates = xslDocument.selectSingleNode('//xsl:apply-templates[@select = "' + tagName + '"]');
    if (xslApplyTemplates) {
      var xslSort = xslDocument.createNode(1, 'xsl:sort', xslNamespace);
      xslSort.setAttribute('select', orderBy);
      xslSort.setAttribute('data-type', dataType);
      xslSort.setAttribute('order', sortOrder);
      xslApplyTemplates.appendChild(xslSort);
    }
  }
  else if (typeof xslDocument.getElementsByTagNameNS != 'undefined'){
    var xslApplyTemplates = xslDocument.getElementsByTagNameNS(xslNamespace, 'apply-templates');
    for (var i = 0; i < xslApplyTemplates.length; i++) {
      var xslApplyTemplate = xslApplyTemplates[i];
      if (xslApplyTemplate.getAttribute('select') == tagName) {
        var xslSort = xslDocument.createElementNS(xslNamespace, 'xsl:sort');
        xslSort.setAttribute('select', orderBy);
        xslSort.setAttribute('data-type', dataType);
        xslSort.setAttribute('order', sortOrder);
        xslApplyTemplate.appendChild(xslSort);
        break;
      }
    }
  }
}
function update(){
  var resultElement;
  if (document.getElementById){
    resultElement = document.getElementById(resultElementId);
    if (resultElement) {
      if (typeof xmlDocument.transformNode != 'undefined') {
        resultElement.innerHTML = xmlDocument.transformNode(xslDocument);
      }
      else if (typeof XSLTProcessor != 'undefined') {
        var xsltProcessor = new XSLTProcessor()
        if (typeof xsltProcessor.importStylesheet != 'undefined') {
          xsltProcessor.importStylesheet(xslDocument);
          var documentFragment = xsltProcessor.transformToFragment(xmlDocument, resultElement.ownerDocument);
          while (resultElement.hasChildNodes()) {
            resultElement.removeChild(resultElement.lastChild);
          }
          resultElement.appendChild(documentFragment);
        }
        else if (typeof xsltProcessor.transformDocument != 'undefined') {
          var resultDocument = document.implementation.createDocument('', 'dummy', null);
          xsltProcessor.transformDocument(xmlDocument, xslDocument, resultDocument, null);
          while (resultElement.hasChildNodes()) {
            resultElement.removeChild(resultElement.lastChild);
          }
          resultElement.appendChild(resultElement.ownerDocument.importNode(resultDocument.documentElement, true));
        }
      }
    }
  }
}
////INIT////
function transformIfLoaded () {
	if(xmlDocument.readyState == 4 && xslDocument.readyState == 4) {
		sortColumns(xmlDocument, xslDocument, resultElementId);
		update();
	}
}

function initDocuments (xmlURL, xslURL) {
  if (typeof ActiveXObject != 'undefined') {
    xmlDocument = new ActiveXObject('Msxml2.DOMDocument');
    xmlDocument.async = false;///!
    xmlDocument.onreadystatechange = transformIfLoaded;
    xslDocument = new ActiveXObject('Msxml2.DOMDocument');
    xslDocument.async = false;///!
    xslDocument.onreadystatechange = transformIfLoaded;
  }
  else if (typeof document.implementation != 'undefined' &&
           typeof document.implementation.createDocument != 'undefined') {
    xmlDocument = document.implementation.createDocument('', 'dummy', null);
    xmlDocument.async = true;
    xslDocument = document.implementation.createDocument('', 'dummy', null);
    xslDocument.async = true;
    xmlDocument.onload = function (evt) {
      xmlDocument.readyState = 4;
      transformIfLoaded();
    };
    xslDocument.onload = function (evt) {
      xslDocument.readyState = 4;
      transformIfLoaded();
    };
  }
  if (typeof xmlDocument != 'undefined' &&
      typeof xmlDocument.load != 'undefined') {
    xmlDocument.load(xmlURL);
    xslDocument.load(xslURL);
  }
  else {
    var message = 'This browser doesn\'t seem to support scripting of XML documents.';
    var p;
    if (document.createElement && (p = document.createElement('p'))) {
      p.appendChild(document.createTextNode(message));
      document.getElementById(resultElementId).appendChild(p);
    }
    else {
      alert(message);
    }
  }
}
window.onload = function (evt) {
  initDocuments(xmlURL, xslURL);
}
Original code "mylistb.xsl"

Code: Select all

<?xml version="1.0" encoding="utf-8"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="UTF-8" />

<xsl:variable name="completed" select="0"/>
<xsl:variable name="watched" select="0"/>
<xsl:variable name="sfv" select="0"/>

<xsl:template match="AC">

<table width="100%" border="0">
		<tr class="options">
		<td> Options: </td>

		<td style="cursor:pointer;" onclick="javascript:swWatched(this)">
		<xsl:choose>
         <xsl:when test="$watched=1"><xsl:attribute name="class">opt</xsl:attribute></xsl:when>
         <xsl:otherwise><xsl:attribute name="class"></xsl:attribute></xsl:otherwise>
		</xsl:choose> Watched </td>

		<td style="cursor:pointer;" onclick="javascript:swComplete(this)">
		<xsl:choose>
         <xsl:when test="$completed=1"><xsl:attribute name="class">opt</xsl:attribute></xsl:when>
         <xsl:otherwise><xsl:attribute name="class"></xsl:attribute></xsl:otherwise>
		</xsl:choose> Complete </td>

		<td style="cursor:pointer;" onclick="javascript:swSFV(this)">
		<xsl:choose>
         <xsl:when test="$sfv=1"><xsl:attribute name="class">opt</xsl:attribute></xsl:when>
         <xsl:otherwise><xsl:attribute name="class"></xsl:attribute></xsl:otherwise>
		</xsl:choose> Alt. filenames </td>

		</tr>
</table>

<table width="100%">

	<tr class="thead">
		<td> # </td>
		<td onClick="sort('Name', 'text')"    onMouseOver="over(this, 'sort')" onMouseOut="out(this)"> 
			Name </td>
		<td onClick="sort('substring(Year,1,4)', 'number')"  	onMouseOver="over(this, 'sort')" onMouseOut="out(this)"> 
			Year </td>
		<td onClick="sort('Rate', 'number')" 	onMouseOver="over(this, 'sort')" onMouseOut="out(this)"> 
			Rating </td>
		<td onClick="sort('Files/@number','number')" 	onMouseOver="over(this, 'sort')" onMouseOut="out(this)"> 
			Files </td>
		<td onClick="sort('translate(Size, \'.\', \'\')', 'number')"  onMouseOver="over(this, 'sort')" onMouseOut="out(this)"> 
			Size </td>	
	</tr>


<xsl:apply-templates select="Anime"/>

</table>

</xsl:template>


<xsl:template match="Anime">

<xsl:variable name="selected" select="0"/>
<xsl:variable name="position" select="position()"/>

<xsl:if test="($watched=0 or @watched=1) and ($completed=0 or @completed=1)">

<tr onMouseOver="over2(this, 'high1')" onMouseOut="out2(this)">
      <xsl:choose>
         <xsl:when test="position() mod 2"><xsl:attribute name="class">even</xsl:attribute></xsl:when>
         <xsl:otherwise><xsl:attribute name="class">odd</xsl:attribute></xsl:otherwise>
      </xsl:choose>

	<td align="center" style="cursor:pointer;" onClick="select('{$position}')"> <xsl:value-of select="$position"/></td>
	<td align="left">	<a href="http://anidb.info/a{Url}" target="_blank"> <xsl:value-of select="Name" /> </a> </td>
	<td align="center"> <xsl:value-of select="Year"/> </td>
	<td align="center"> <xsl:value-of select="Rate"/> </td>
	<td align="center"> <xsl:value-of select="Files/@number"/> </td>
	<td align="right"> 	<xsl:value-of select="Size"/> </td>
</tr>

<xsl:if test="position()=$selected">
<xsl:for-each select="Files/Episode/File">
	<tr class="dir" onMouseOver="over2(this, 'high2');window.status='State: {State}'" onMouseOut="out2(this);window.status=''">
		
<xsl:choose>
         <xsl:when test="$sfv=0">
		 	<td align="center"> <xsl:value-of select="position()" /></td>
		 	<td colspan="3"><a href="http://anidb.info/f{@fid}" target="_blank"><xsl:value-of select="Name"/></a> </td>
			<td align="center"><a href="{ED2K}">ed2k</a></td>
			<td align="right"> <xsl:value-of select="Size"/> </td>
		 </xsl:when>
         <xsl:otherwise>
		 	<td> </td>
		 	<td colspan="5">[<xsl:value-of select="translate(Group,' ','')"/>]_<xsl:value-of select="translate(../../../Name,' ','_')"/>_-_<xsl:value-of select="../@nr"/>_[<xsl:value-of select="translate(CRC,'abcdef','ABCDEF')"/>].<xsl:value-of select="Type"/></td>
		</xsl:otherwise>
</xsl:choose>
		
	</tr>
</xsl:for-each>
</xsl:if>

</xsl:if>

</xsl:template>


</xsl:stylesheet>
with this code, you can use the "Complete" button, but animes that is completed, doesn't get shown.

-
Here is a code that works; (only fixed the code that had anything to do with the Complete list)

Working code "mylista.js"

Code: Select all

var xmlURL = "mylist.xml";
var xslURL = "mylistb.xsl";
var resultElementId = "resultDiv";
var lastclass ="";
var sfv = 0;
var selected = 0;
var lastsel = 0;
var watched = 0;
var complete = 0;
var sortName = "Name";
var sortOrder = "ascending";
var sortType = "text";

function over(obj, name){
	obj.style.cursor='pointer';
	obj.className=name;
}
function out(obj){
	obj.style.cursor='';
	obj.className='';
}
function over2(obj, name){
	lastclass = obj.className;
	obj.className=name;
}
function out2(obj){
	obj.className=lastclass;
}
function sort(field, type){
	selected = 0;
	if(sortName==field){
		if(sortOrder=="ascending")
			sortOrder="descending";
		else	sortOrder="ascending";
	}
	else sortName = field;

	sortType = type;
	
	setVariable(xslDocument, "selected", selected);
	sortColumns(xmlDocument, xslDocument, resultElementId, sortName, sortType, sortOrder);
	update();
}
function select(nr){
	if(lastsel==nr) nr = 0;
	lastsel = nr;
	selected=nr;
	
	setVariable(xslDocument, "selected", selected);
	update();
}
function swWatched(obj, name){
	selectedN = '0';
	if(watched=='0'){
		watched = '1';
		obj.className=name;
	}else{
		watched = '0';
		obj.className='';
	}
	
	setVariable(xslDocument, "watched", watched);
	update();
}
function swComplete(obj){
	selectedN = 0;
	if(complete=='0'){
			complete = '1';
			obj.className='opt';
		}else{
			complete = '0';
			obj.className='';
		}

	setVariable(xslDocument, "complete", complete);
	update();
}
function swSFV(obj){
	if(sfv==0){
			sfv = 1;
			obj.className='opt';
	}else{
		sfv = 0;
		obj.className='';
	}

	setVariable(xslDocument, "sfv", sfv);
	update();
}

function setVariable(xslDocument, varname, value) {
  var xslNamespace = 'http://www.w3.org/1999/XSL/Transform';
  if (typeof xslDocument.setProperty != 'undefined') {
    xslDocument.setProperty('SelectionLanguage', 'XPath');
    xslDocument.setProperty('SelectionNamespaces', 'xmlns:xsl="' + xslNamespace + '"');
    var xslvar = xslDocument.selectSingleNode("//xsl:variable[@name='"+varname+"']/@select");
    xslvar.value = value;
  }
  else if (typeof xslDocument.getElementsByTagNameNS != 'undefined'){
    var xslApplyTemplates = xslDocument.getElementsByTagNameNS(xslNamespace, 'variable');
    for(var i = 0; i < xslApplyTemplates.length; i++) {
      var xslApplyTemplate = xslApplyTemplates[i];
    if (xslApplyTemplate.getAttribute('name') == varname) {
        xslApplyTemplate.setAttribute('select', value);
        break;
      }
    }
  }
}
function sortColumns(xmlDocument, xslDocument, resultElementId, orderBy, dataType, sortOrder) {
  removeXslSort(xslDocument, 'Anime');
  if (typeof orderBy != 'undefined') {
    if (typeof dataType == 'undefined') {
      dataType = 'text';
    }
    if (typeof sortOrder == 'undefined') {
      sortOrder = 'ascending';
    }
    addXslSort(xslDocument, 'Anime', orderBy, dataType, sortOrder);
  }
}
function removeXslSort (xslDocument, tagName) {
  var xslNamespace = 'http://www.w3.org/1999/XSL/Transform';
  if (typeof xslDocument.setProperty != 'undefined') {
    xslDocument.setProperty('SelectionLanguage', 'XPath');
    xslDocument.setProperty('SelectionNamespaces', 'xmlns:xsl="' + xslNamespace + '"');
    var xslSort = xslDocument.selectSingleNode('//xsl:sort');
    if (xslSort) {
      xslSort.parentNode.removeChild(xslSort);
    }
  }
  else if (typeof xslDocument.getElementsByTagNameNS != 'undefined') {
    var xslSorts = xslDocument.getElementsByTagNameNS(xslNamespace, 'sort');
    if (xslSorts.length > 0) {
      xslSorts[0].parentNode.removeChild(xslSorts[0]);
    }
  }
}
function addXslSort (xslDocument, tagName, orderBy, dataType, sortOrder) {
  var xslNamespace = 'http://www.w3.org/1999/XSL/Transform';
  if (typeof xslDocument.setProperty != 'undefined') {
    xslDocument.setProperty('SelectionLanguage', 'XPath');
    xslDocument.setProperty('SelectionNamespaces', 'xmlns:xsl="' + xslNamespace + '"');
    var xslApplyTemplates = xslDocument.selectSingleNode('//xsl:apply-templates[@select = "' + tagName + '"]');
    if (xslApplyTemplates) {
      var xslSort = xslDocument.createNode(1, 'xsl:sort', xslNamespace);
      xslSort.setAttribute('select', orderBy);
      xslSort.setAttribute('data-type', dataType);
      xslSort.setAttribute('order', sortOrder);
      xslApplyTemplates.appendChild(xslSort);
    }
  }
  else if (typeof xslDocument.getElementsByTagNameNS != 'undefined'){
    var xslApplyTemplates = xslDocument.getElementsByTagNameNS(xslNamespace, 'apply-templates');
    for (var i = 0; i < xslApplyTemplates.length; i++) {
      var xslApplyTemplate = xslApplyTemplates[i];
      if (xslApplyTemplate.getAttribute('select') == tagName) {
        var xslSort = xslDocument.createElementNS(xslNamespace, 'xsl:sort');
        xslSort.setAttribute('select', orderBy);
        xslSort.setAttribute('data-type', dataType);
        xslSort.setAttribute('order', sortOrder);
        xslApplyTemplate.appendChild(xslSort);
        break;
      }
    }
  }
}
function update(){
  var resultElement;
  if (document.getElementById){
    resultElement = document.getElementById(resultElementId);
    if (resultElement) {
      if (typeof xmlDocument.transformNode != 'undefined') {
        resultElement.innerHTML = xmlDocument.transformNode(xslDocument);
      }
      else if (typeof XSLTProcessor != 'undefined') {
        var xsltProcessor = new XSLTProcessor()
        if (typeof xsltProcessor.importStylesheet != 'undefined') {
          xsltProcessor.importStylesheet(xslDocument);
          var documentFragment = xsltProcessor.transformToFragment(xmlDocument, resultElement.ownerDocument);
          while (resultElement.hasChildNodes()) {
            resultElement.removeChild(resultElement.lastChild);
          }
          resultElement.appendChild(documentFragment);
        }
        else if (typeof xsltProcessor.transformDocument != 'undefined') {
          var resultDocument = document.implementation.createDocument('', 'dummy', null);
          xsltProcessor.transformDocument(xmlDocument, xslDocument, resultDocument, null);
          while (resultElement.hasChildNodes()) {
            resultElement.removeChild(resultElement.lastChild);
          }
          resultElement.appendChild(resultElement.ownerDocument.importNode(resultDocument.documentElement, true));
        }
      }
    }
  }
}
////INIT////
function transformIfLoaded () {
	if(xmlDocument.readyState == 4 && xslDocument.readyState == 4) {
		sortColumns(xmlDocument, xslDocument, resultElementId);
		update();
	}
}

function initDocuments (xmlURL, xslURL) {
  if (typeof ActiveXObject != 'undefined') {
    xmlDocument = new ActiveXObject('Msxml2.DOMDocument');
    xmlDocument.async = false;///!
    xmlDocument.onreadystatechange = transformIfLoaded;
    xslDocument = new ActiveXObject('Msxml2.DOMDocument');
    xslDocument.async = false;///!
    xslDocument.onreadystatechange = transformIfLoaded;
  }
  else if (typeof document.implementation != 'undefined' &&
           typeof document.implementation.createDocument != 'undefined') {
    xmlDocument = document.implementation.createDocument('', 'dummy', null);
    xmlDocument.async = true;
    xslDocument = document.implementation.createDocument('', 'dummy', null);
    xslDocument.async = true;
    xmlDocument.onload = function (evt) {
      xmlDocument.readyState = 4;
      transformIfLoaded();
    };
    xslDocument.onload = function (evt) {
      xslDocument.readyState = 4;
      transformIfLoaded();
    };
  }
  if (typeof xmlDocument != 'undefined' &&
      typeof xmlDocument.load != 'undefined') {
    xmlDocument.load(xmlURL);
    xslDocument.load(xslURL);
  }
  else {
    var message = 'This browser doesn\'t seem to support scripting of XML documents.';
    var p;
    if (document.createElement && (p = document.createElement('p'))) {
      p.appendChild(document.createTextNode(message));
      document.getElementById(resultElementId).appendChild(p);
    }
    else {
      alert(message);
    }
  }
}
window.onload = function (evt) {
  initDocuments(xmlURL, xslURL);
}
and

Working code "mylistb.xsl"

Code: Select all

<?xml version="1.0" encoding="utf-8"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="UTF-8" />

<xsl:variable name="complete" select="0"/>
<xsl:variable name="watched" select="0"/>
<xsl:variable name="sfv" select="0"/>

<xsl:template match="AC">

<table width="100%" border="0">
		<tr class="options">
		<td> Options: </td>

		<td style="cursor:pointer;" onclick="javascript:swWatched(this)">
		<xsl:choose>
         <xsl:when test="$watched=1"><xsl:attribute name="class">opt</xsl:attribute></xsl:when>
         <xsl:otherwise><xsl:attribute name="class"></xsl:attribute></xsl:otherwise>
		</xsl:choose> Watched </td>

		<td style="cursor:pointer;" onclick="javascript:swComplete(this)">
		<xsl:choose>
         <xsl:when test="$complete=1"><xsl:attribute name="class">opt</xsl:attribute></xsl:when>
         <xsl:otherwise><xsl:attribute name="class"></xsl:attribute></xsl:otherwise>
		</xsl:choose> Complete </td>

		<td style="cursor:pointer;" onclick="javascript:swSFV(this)">
		<xsl:choose>
         <xsl:when test="$sfv=1"><xsl:attribute name="class">opt</xsl:attribute></xsl:when>
         <xsl:otherwise><xsl:attribute name="class"></xsl:attribute></xsl:otherwise>
		</xsl:choose> Alt. filenames </td>

		</tr>
</table>

<table width="100%">

	<tr class="thead">
		<td> # </td>
		<td onClick="sort('Name', 'text')"    onMouseOver="over(this, 'sort')" onMouseOut="out(this)"> 
			Name </td>
		<td onClick="sort('substring(Year,1,4)', 'number')"  	onMouseOver="over(this, 'sort')" onMouseOut="out(this)"> 
			Year </td>
		<td onClick="sort('Rate', 'number')" 	onMouseOver="over(this, 'sort')" onMouseOut="out(this)"> 
			Rating </td>
		<td onClick="sort('Files/@number','number')" 	onMouseOver="over(this, 'sort')" onMouseOut="out(this)"> 
			Files </td>
		<td onClick="sort('translate(Size, \'.\', \'\')', 'number')"  onMouseOver="over(this, 'sort')" onMouseOut="out(this)"> 
			Size </td>	
	</tr>


<xsl:apply-templates select="Anime"/>

</table>

</xsl:template>


<xsl:template match="Anime">

<xsl:variable name="selected" select="0"/>
<xsl:variable name="position" select="position()"/>

<xsl:if test="($watched=0 or @watched=1) and ($complete=0 or @complete=1)">

<tr onMouseOver="over2(this, 'high1')" onMouseOut="out2(this)">
      <xsl:choose>
         <xsl:when test="position() mod 2"><xsl:attribute name="class">even</xsl:attribute></xsl:when>
         <xsl:otherwise><xsl:attribute name="class">odd</xsl:attribute></xsl:otherwise>
      </xsl:choose>

	<td align="center" style="cursor:pointer;" onClick="select('{$position}')"> <xsl:value-of select="$position"/></td>
	<td align="left">	<a href="http://anidb.info/a{Url}" target="_blank"> <xsl:value-of select="Name" /> </a> </td>
	<td align="center"> <xsl:value-of select="Year"/> </td>
	<td align="center"> <xsl:value-of select="Rate"/> </td>
	<td align="center"> <xsl:value-of select="Files/@number"/> </td>
	<td align="right"> 	<xsl:value-of select="Size"/> </td>
</tr>

<xsl:if test="position()=$selected">
<xsl:for-each select="Files/Episode/File">
	<tr class="dir" onMouseOver="over2(this, 'high2');window.status='State: {State}'" onMouseOut="out2(this);window.status=''">
		
<xsl:choose>
         <xsl:when test="$sfv=0">
		 	<td align="center"> <xsl:value-of select="position()" /></td>
		 	<td colspan="3"><a href="http://anidb.info/f{@fid}" target="_blank"><xsl:value-of select="Name"/></a> </td>
			<td align="center"><a href="{ED2K}">ed2k</a></td>
			<td align="right"> <xsl:value-of select="Size"/> </td>
		 </xsl:when>
         <xsl:otherwise>
		 	<td> </td>
		 	<td colspan="5">[<xsl:value-of select="translate(Group,' ','')"/>]_<xsl:value-of select="translate(../../../Name,' ','_')"/>_-_<xsl:value-of select="../@nr"/>_[<xsl:value-of select="translate(CRC,'abcdef','ABCDEF')"/>].<xsl:value-of select="Type"/></td>
		</xsl:otherwise>
</xsl:choose>
		
	</tr>
</xsl:for-each>
</xsl:if>

</xsl:if>

</xsl:template>


</xsl:stylesheet>

Hope this will get fixed soon :)

I'm out;
~Hybr1d

epoximator
AniDB Staff
Posts: 379
Joined: Sun Nov 07, 2004 11:05 am

Post by epoximator » Thu May 31, 2007 8:46 am

will do

Hybr1d
Posts: 4
Joined: Mon May 14, 2007 1:05 pm

Post by Hybr1d » Wed Jul 11, 2007 9:36 am

the complete button does still not work :/

epoximator
AniDB Staff
Posts: 379
Joined: Sun Nov 07, 2004 11:05 am

Post by epoximator » Wed Jul 11, 2007 9:51 am

blame fahrenheit, he's responsible for exports now

User avatar
fahrenheit
AniDB Staff
Posts: 438
Joined: Thu Apr 08, 2004 1:43 am
Location: Portugal

Post by fahrenheit » Wed Jul 11, 2007 1:45 pm

epoximator wrote:blame fahrenheit, he's responsible for exports now
ah, so you are shifting blame to me !? I saw this one assigned to you on the tracker :P

And when did i got responsible for exports? I can't even upload themes to the server :P

okay okay, i'll make the changes...

Der Idiot
AniDB Staff
Posts: 1227
Joined: Fri Mar 21, 2003 10:19 am

Post by Der Idiot » Wed Jul 11, 2007 2:04 pm

he put me in charge of css as well even though i do almost nothing ;_; epoxi is a mean man :(

Hybr1d
Posts: 4
Joined: Mon May 14, 2007 1:05 pm

Post by Hybr1d » Fri Jul 13, 2007 10:11 am

cool, it works now. thanks for the changes fahrenheit ;)

EDIT:

eeh, now there is a new bug, when you mark the button "Alt. filenames"
the episode number dissapear :/

~Hybr1d

epoximator
AniDB Staff
Posts: 379
Joined: Sun Nov 07, 2004 11:05 am

Post by epoximator » Fri Jul 13, 2007 10:55 am

that's intentional

User avatar
fahrenheit
AniDB Staff
Posts: 438
Joined: Thu Apr 08, 2004 1:43 am
Location: Portugal

Post by fahrenheit » Fri Jul 13, 2007 8:15 pm

didn't do anything, thank epox :P

Hybr1d
Posts: 4
Joined: Mon May 14, 2007 1:05 pm

Post by Hybr1d » Thu Jul 19, 2007 9:15 am

oh, sorry.. thanks epoximator :)

hmm,
but why remove the ep number?

epoximator
AniDB Staff
Posts: 379
Joined: Sun Nov 07, 2004 11:05 am

Post by epoximator » Thu Jul 19, 2007 9:59 am

the ep number is still there, just not in front. the idea was to allow direct copy of file names; in fact, it was the entire point of "Alt. filenames". i don't use that template anyway (nor any other), so i don't really care what's done with it. if you want to "maintain" it see http://wiki.anidb.info/w/Mylist_export_ ... SVN_Access

Locked