HideEmptyModules

hides empty modules in the uspace overview

目前为 2016-08-03 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name HideEmptyModules
  3. // @namespace hem
  4. // @description hides empty modules in the uspace overview
  5. // @include https://uspace.univie.ac.at/web/studierende/pruefungspass*
  6. // @author oerpli
  7. // @version 1
  8. // @grant none
  9. // ==/UserScript==
  10. var textH = $('#language_selection_dropdown').text().contains('DE')?'Leere Module ausblenden':'Hide empty modules';
  11. //var textS = $('#language_selection_dropdown').text().contains('DE')?'Leere Module einblenden':'Show empty modules';
  12. var emptyM = true;
  13. $('.nav-pills').append('<li id=\'switchB\'><a href=\'#\' id=\'sBT\'>' + textH + '</a></li>');
  14. $('#switchB').toggle('highlight').toggle('highlight');
  15. $('#switchB').click(function () {
  16. var eelems = $('.ectsLabel').parent().filter(function () {
  17. return $(this).html().startsWith('0/');
  18. }).parent().parent().parent().parent().parent().parent();
  19. if (emptyM) {
  20. $('#sBT').html($(this).html().replace('aus', 'ein').replace('Hide','Show'));
  21. //$('sBT').text(textH);
  22. eelems.hide();
  23. } else {
  24. $('#sBT').html($(this).html().replace('ein', 'aus').replace('Show','Hide'));
  25. // $('sBT').text(textS);
  26. eelems.show();
  27. }
  28. emptyM = !emptyM
  29. });