class Util { public static HandleLink(e: Event) { Search($(e.target).text()); Settings.SaveResults(); } public static HandleHiddenLink(e: Event) { Search($(e.target).find(".searchvalue").text()); Settings.SaveResults(); } public static RemoveResult(e: Event) { let ref = $(e.target).parent().parent().children(".resultbody").children("h2").children("a").text(); delete CurrentReferences[ref.trim().toLowerCase()]; $(e.target).parent().parent().remove(); Settings.SaveResults(); } public static HandleError(e) { let self = this; // for now we're going to put the error in the main result div. let t = $("
"); $("#result").prepend(t); t.find(".removeresult").click(function (e) { self.RemoveResult(e); }); return false; } public static GetUrlVars() { // Read a page's GET URL variables and return them as an associative array. var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for (var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } };