Advertisement
Guest User

FH Dortmund Links Source Code

a guest
Sep 2nd, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Creates ContextMenus which will open the underlying urls when clicked
  2.  
  3. function createCategory(title,url)  //creates Context-menu
  4. {
  5.     console.log("createCategory");
  6.     chrome.contextMenus.create(
  7.     {
  8.         "title": title,
  9.         "id": title,
  10.         "contexts": ["page","selection","link","editable","image","video","audio"],
  11.         "onclick": function()
  12.         {
  13.             console.log(title);
  14.             popup(url);
  15.         }
  16.     });
  17.     return title;
  18. }
  19.  
  20. function popup(urlstring)       //opens a site in new tab
  21. {
  22.     console.log("popup");
  23.     chrome.tabs.create ({url: urlstring})
  24. }
  25.  
  26. function supaDupaRestart() //Don´t judge me,
  27.                //the name of this function was chosen by a friend of mine.
  28. {
  29.     console.log("supaDupaRestart");
  30.     chrome.contextMenus.removeAll();
  31.     for (var i = 0; i < catStrings.length;i++)
  32.     {
  33.         createCategory(catStrings[i], urls[i]);
  34.     }
  35.     //initMenus();
  36.     //initlocalStorage();
  37. }
  38.  
  39. var catStrings = [];
  40.  
  41. catStrings = ["E-Mail", "Stundenpläne", "Selbstverwaltung", "Fachschaftsrat", "Aktuelles", "ILIAS", "MSDNAA", "Studierbar"];
  42.  
  43. var urls = [];
  44.  
  45. urls = ["https://studwebmailer.fh-dortmund.de/gw/webacc","http://www.fh-dortmund.de/de/fb/4/lehre/stundenplaene.php","https://userapp.fh-dortmund.de:8443/IDMProv/jsps/login/Login.jsp",
  46. "http://www.fsrfb4.de/", "http://www.fh-dortmund.de/de/studi/fb/4/aktuelles.php", "https://www.ilias.fh-dortmund.de/ilias/login.php?target=&soap_pw=&ext_uid=&cookies=nocookies&client_id=ilias-fhdo&lang=de",
  47. "https://dokumente.fh-dortmund.de/msdnaa/login/index.php", "http://www.studierbar.de/"];
  48.  
  49. supaDupaRestart();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement