AniDB - Personal Tab Line

adds an other tab line to improve the tabs standalone usability

  1. // ==UserScript==
  2. // @name AniDB - Personal Tab Line
  3. // @namespace whut
  4. // @description adds an other tab line to improve the tabs standalone usability
  5. // @include http://anidb.net/perl-bin/animedb.pl?show=*
  6. // @include http://anidb.net/perl-bin/animedb.pl?do.update=*
  7. // @version 1.0.2
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. //checks if you're logged in
  12. if ($('#menu-login').length === 0) {
  13. //fetches the position where to add the new lines
  14. var content = document.getElementById('layout-tabs');
  15. //var content = document.getElementsByClassName('layout-tabs')[0];
  16. //creates the container where the new lines will be added
  17. var tabline = document.createElement('div');
  18. //inserts the new container into the desired position
  19. content.insertBefore(tabline, content.firstChild); //content.firstChild, null=at the end
  20. //code of the lines to add
  21. string = '<ul class="main-tabs tabs-line1" style="padding-bottom:10px;">';
  22. string += '<li class="myplace"><span><a href="animedb.pl?show=userpage">My Place</a></span></li> ';
  23. string += '<li class="mylist"><a href="animedb.pl?show=mylist&do.filter=1&uid=687303">My List</a></li> ';
  24. string += '<li class="mywishlist"><span><a href="animedb.pl?show=mywishlist">My Wishlist</a></span></li> ';
  25. string += '<li class="myreviews"><span><a href="animedb.pl?show=myreviews">My Reviews</a></span></li> ';
  26. string += '<li class="myvotes"><span><a href="animedb.pl?show=myvotes">My Votes</a></span></li> ';
  27. string += '<li class="myhints"><span><a href="animedb.pl?show=myhints">My Hints</a></span></li> ';
  28. string += '<li class="mymessages"><span><a href="animedb.pl?show=msg">My Messages</a></span></li> ';
  29. string += '<li class="mynotifies"><span><a href="animedb.pl?show=mynotifies">My Notifies</a></span></li> ';
  30. string += '<li class="mycreqs"><span><a href="animedb.pl?show=creq&my=1">My Creqs</a></span></li> ';
  31. string += '<li class="myentries"><span><a href="animedb.pl?show=mydb">My DB Entries</a></span></li> ';
  32. string += '<li class="myreports"><span><a href="animedb.pl?show=report">My Reports</a></span></li> ';
  33. //string += '<li class="mysignature"><span><a href="http://sig.anidb.net/">My Signatures</a></span></li> ';
  34. //string += '<li class="applet"><span><a href="animedb.pl?show=applet">Add To Mylist</a></span></li> ';
  35. //string += '<li class="ed2kdump"><span><a href="animedb.pl?show=ed2kdump">Ed2k Dump</a></span></li> ';
  36. string += '</ul>';
  37.  
  38. tabline.outerHTML = string;
  39. }