Scripts:Up2date: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
This is a simple script that hides some of the entries on the up2date page. Groups as well as episode types can be hidden. Episode types are defined by the first character in the "ep" column, while groups need to be exact (including the []).
This is a simple script that hides some of the entries on the up2date page. Groups as well as episode types can be hidden. Episode types are defined by the first character in the "ep" column, while groups need to be exact (including the []).


You have to edit the first rows manually to change what is hidden. It is pretty easy though. Just add/remove entries in the lists (hideGroups,hideEpTypes) at the top. Save it as <something>.user.js.
You have to edit the first rows manually to change what is hidden. It is pretty easy though. Just add/remove entries in the lists (hideGroups,hideEpTypes) at the top. Save it as <something>.user.js and use it with firefox greasemonkey extension or opera user javascripts.


'''Updated 2007-01-10. A few minor changes to get it to work with the new up2pate page version. '''
'''Updated 2007-08-17. Changed anidb.info to anidb.net so that the script works again'''


<pre>
<pre>
Line 16: Line 16:
/*********************/
/*********************/


function TrimString(sInString) {
function TrimString(sInString)  
{
   sInString = sInString.replace( /^\s+/g, "" );// strip leading
   sInString = sInString.replace( /^\s+/g, "" );// strip leading
   return sInString.replace( /\s+$/g, "" );// strip trailing
   return sInString.replace( /\s+$/g, "" );// strip trailing
}
}


if(window.location.href == 'http://anidb.info/perl-bin/animedb.pl?show=up2date')
function HideTableRows()
{
window.addEventListener('load',
 
function()
{
{
  t1 = document.body.getElementsByTagName('tr');
  t1 = document.body.getElementsByTagName('tr');


    for(i=1;i<t1.length;i++)
  for(i=1;i<t1.length;i++)
  {
    t2 = t1[i].getElementsByTagName('td');
    for(j=0;j<t2.length;j++)
     {
     {
       t2 = t1[i].getElementsByTagName('td');
       if (t2[j].className == 'name group')
   
      for(j=0;j<t2.length;j++)
       {
       {
         if (t2[j].className == 'name group')
         groupName = TrimString(t2[j].textContent);
 
        //Hide entries that belongs to the selected groups
        for(k=0;k<hideGroups.length;k++)
         {
         {
           groupName = TrimString(t2[j].textContent);
           if(groupName == hideGroups[k])
       
            t1[i].style.display = 'none';  
          //Hide entries that don't belong to any group, or non-english groups
          for(k=0;k<hideGroups.length;k++)
          {
            if(groupName == hideGroups[k])
              t1[i].style.display = 'none';  
          }
         }
         }
      }
              
              
        if(t2[j].className == 'epno')  
      if(t2[j].className == 'epno')
      {
        epType = t2[j].textContent.charAt(0); // First character)
         
        //Hide Credits, Parodies, Trailers
        for(k=0;k<hideEpTypes.length;k++)
         {
         {
           epType = t2[j].textContent.charAt(0); // First character)
           if(epType == hideEpTypes[k])
         
            t1[i].style.display = 'none';  
          //Hide Credits, Parodies, Trailers
          for(k=0;k<hideEpTypes.length;k++)
          {
            if(epType == hideEpTypes[k])
              t1[i].style.display = 'none';  
          }
         }
         }
           
       }
       }
     }
     }
   }
   }
}
if(window.location.href == 'http://anidb.net/perl-bin/animedb.pl?show=up2date')
//if(window.location.href == 'file://localhost/c:/test.html')
{
window.addEventListener('load',
 
function()
{
  HideTableRows();
}
, false);
, false);
}</pre>
}
</pre>


[[Category:Development]][[Category:Misc]]
[[Category:Development]][[Category:Misc]]
2

edits

Navigation menu

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.