IISc MMCR

Adds Download option for IISc MMCR videos

  1. // ==UserScript==
  2. // @name IISc MMCR
  3. // @author Biplab Sarkar (sarkarbiplab@gmail.com)
  4. // @namespace http://www.cpdm.iisc.ernet.in/~biplab
  5. // @license GNU GPL v3 (http://www.gnu.org/copyleft/gpl.html)
  6. // @description Adds Download option for IISc MMCR videos
  7. // @include http://mmcr.iisc.ernet.in:8008/cgi-bin/nwayfiles.py?*
  8. // @require http://code.jquery.com/jquery-latest.min.js
  9. // @version 1.1
  10. // ==/UserScript==
  11.  
  12. // Load jQuery script explicitly. Required for google chrome
  13. function addJQuery(callback) {
  14. var script = document.createElement("script");
  15. script.setAttribute("src", "//code.jquery.com/jquery-latest.min.js");
  16. script.addEventListener('load', function() {
  17. var script = document.createElement("script");
  18. script.textContent = "(" + callback.toString() + ")();";
  19. document.body.appendChild(script);
  20. }, false);
  21. document.body.appendChild(script);
  22. }
  23.  
  24. addJQuery(function () {
  25. jQuery('table > tbody > tr > td > a').each(function() {
  26. this.href = this.href.replace(/client=other/,"client=download");
  27. if (jQuery(this).text() == "VLC") {
  28. jQuery(this).text("VLC|Download");
  29. }
  30. });
  31. });