Created
September 9, 2014 09:16
-
-
Save rajiteh/73ad36b5baad6831f30c to your computer and use it in GitHub Desktop.
Hover over the Award link text instead of opening a popup window to quickly read award descriptions in YorkU's SFP application.
This file contains hidden or 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
//Execute the following javascript at the Award selection page of SFP and wait for the message 'success! :)' | |
var script = document.createElement("script"); | |
script.src = "https://code.jquery.com/jquery-2.1.1.min.js"; | |
script.type = "text/javascript"; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
var interval = setInterval(function() { | |
if (typeof jQuery === "function") { | |
clearInterval(interval); | |
jQuery(function($) { | |
var $dom = $('a[target="awardDescription"]') | |
var len = $dom.size(); | |
var i = 0; | |
$dom.each(function() { | |
(function($link) { | |
$.get($link.attr('href'), function(data) { | |
$link.attr('title', $(data).text()); | |
if (++i == len) { | |
alert('Success! :)') | |
} | |
}); | |
})($(this)); | |
}); | |
}); | |
} | |
}, 500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment