Created
October 13, 2012 22:43
-
-
Save bryanmenard/3886465 to your computer and use it in GitHub Desktop.
HEC ZoneCours 2 Improvements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name HEC ZoneCours 2 Improvements | |
// @version 0.1 | |
// @id hec-zc2-improvements | |
// @include https://zonecours2.hec.ca/portal* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js | |
// @author Bryan Ménard | |
// ==/UserScript== | |
(function ($) { | |
var subs = { | |
'52-201-08': 'Finance I', | |
'52-401-02': 'Stratégie I', | |
'52-301-02': 'Ressources humaines', | |
'52-501-03': 'GOP' | |
} | |
$(document).ready(function () { | |
$('#siteLinkList li').each(function () { | |
var origText = $(this).text(), | |
title = $(this).find('a').attr('title'), | |
courseNumber = origText.split('.', 1)[0], | |
customTitle = subs[courseNumber]; | |
if (!$(this).is(':first-child')) { | |
title = customTitle || title; | |
$(this).find('a span').text(title + ' - ' + courseNumber); | |
} | |
}); | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment