-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcaptioner.min.js
More file actions
1 lines (1 loc) · 884 Bytes
/
captioner.min.js
File metadata and controls
1 lines (1 loc) · 884 Bytes
1
(function(){if(!($=window.jQuery)){script=document.createElement('script');script.src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';script.onload=getCaptions;document.body.appendChild(script)}else{getCaptions()}function getCaptions(){m=$("img[typeof='foaf:Image']");$(m).hover(showCaption,hideCaption)}function showCaption(){var b=$(this).parent();var c=b.attr("href");console.log(c);b.append($("<p style='background-color:white;margin-top:-20px; opacity:0.8;clear:both;display:block;text-decoration:none !important'>retrieving caption...</p>"));lastH=c;$.get(lastH,function(a){parseAndPrint(b,a)})}function hideCaption(){$(this).parent().find("p:last").remove()}function parseAndPrint(a,b){var h=$(b).find("#block-system-main p");sp=a.find("p:last");sp.text(h.text());sp.css("margin-top","-"+sp.height()+"px");sp.css(":hover","text-decoration:none !important")}}());