This repository was archived by the owner on Sep 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLabelSphere.tiny.js
More file actions
6 lines (6 loc) · 2.86 KB
/
LabelSphere.tiny.js
File metadata and controls
6 lines (6 loc) · 2.86 KB
1
2
3
4
5
6
ikaika=function(F){function G(){$(this)[A]({opacity:"1",fontSize:"100%"},"fast")}function H(){$(this)[A]({opacity:".5",fontSize:"70%"},"fast")}function I(a){if(a.text=="User does not have permission to read this blog.")t("This gadget only works on public blogs");else{var c;a:{c=a.data.feed.link;for(var f in c)if(c[f].rel=="alternate"){c=c[f].href;break a}c=void 0}if(typeof c=="undefined")t("Error getting Website URL");else{J(a,c);if(q){K();n.dismissMessage(B);L();M()}else t("No Labels")}}}function t(a){n.dismissMessage(B);
n.createStaticMessage(a)}function J(a,c){var f=a.data.feed.entry;for(var e in f){var d=f[e].category;for(var i in d){if(q>=u)break;var h=d[i].term;if(b.hasOwnProperty(h))b[h].c++;else{$(j).append('<div id="'+h+'" class="ikaikaLabel" style="position:absolute;border-width:1"><a href="'+c+"search/label/"+h+'" target="_parent">'+h+"</a></div>");b[h]={};b[h].c=1;q++}}}$("a")[l]({color:o("CONTENT_LINK_COLOR"),textDecoration:"none"});$(".ikaikaLabel")[v](function(){$(this)[l]({borderStyle:"solid"})},function(){$(this)[l]({borderStyle:"none"})})}
function K(){k=$(j)[w]>$(j)[x]?$(j)[x]():$(j)[w]();p=k*3/11;k=k/2-1;var a=Math.PI*(3-y(5)),c=2/q;$(".ikaikaLabel").each(function(f,e){var d=$(e)[N]("id");b[d].b=e;b[d].y=f*c-1+c/2;var i=y(1-b[d].y*b[d].y),h=f*a;b[d].x=C(h)*i;b[d].a=D(h)*i;E(b[d],0,0)})}function E(a){var c=a.y*p+k,f=a.a*p+k,e=a.x*p,d=(a.x+1)/4*100+50,i=d/100;$(a.b)[l]({fontSize:d+"%"});c-=$(a.b)[w]()/2;f-=$(a.b)[x]()/2;$(a.b)[l]({bottom:f,right:c,zIndex:Math.round(e)});$(a.b).fadeTo(0,i)}function L(){$(j).mousemove(function(a){var c=
$(j).offset(),f=a.pageX-c.left-k;a=k-(a.pageY-c.top);c=y(f*f+a*a);m=Math.atan2(c,p)/15;g.x=0;g.y=a/c;g.a=f/c})}function M(){$(j)[v](function(){r=0;s=setTimeout(z,33)},function(){r=1})}function z(){var a=C(m),c=1-a,f=D(m);for(var e in b){var d={},i={};i.x=g.y*b[e].a-g.a*b[e].y;i.y=g.a*b[e].x-g.x*b[e].a;i.a=g.x*b[e].y-g.y*b[e].x;var h=g.x*b[e].x+g.y*b[e].y+g.a*b[e].a;d.x=b[e].x*a;d.x+=i.x*f;d.x+=g.x*h*c;d.y=b[e].y*a;d.y+=i.y*f;d.y+=g.y*h*c;d.a=b[e].a*a;d.a+=i.a*f;d.a+=g.a*h*c;b[e].x=d.x;b[e].y=d.y;
b[e].a=d.a;E(b[e])}if(r){m-=m/20;if(m<0.01){r=0;clearTimeout(s)}else s=setTimeout(z,33)}else s=setTimeout(z,33)}var y=Math.sqrt,D=Math.sin,C=Math.cos,O=new gadgets.Prefs,l="css",v="hover",A="animate",w="width",x="height",N="attr",j,k,q=0,b={},p,s,r=0,m,g={},o=gadgets.skins.getProperty,P=o("FONT_FACE"),n=new gadgets.MiniMessage(F);if(google.hasOwnProperty("Blog")){var B=n.createStaticMessage("Loading..."),u=parseInt(O.getString("maxLabels"),10);if(isNaN(u))u=20;google.load("jquery","1");google.setOnLoadCallback(function(){j=
$("#ikaika-container");$("*")[l]({backgroundColor:o("CONTENT_BG_COLOR"),color:o("CONTENT_LINK_COLOR"),fontFamily:P});$(j)[l]({borderColor:o("BORDER_COLOR")});$("#ikaika")[v](G,H);var a=new google.Blog(function(){a.getPostsJson(I)},window.name)})}else n.createStaticMessage("Label Sphere only works in Blogger")};