-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcode.js
15 lines (15 loc) · 6.48 KB
/
code.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var shareNiceConfig={"bebo.com":{"url":"http://www.bebo.com/c/signin_popup?Member=N&Page=c%2Fshare&QueryString=Page%3Dc%2Fshare%26Url%3D%SHARE_URL%"},"bit.ly":{"url":"https://bitly.com/?url=%SHARE_URL%"},"delicious.com":{"url":"http://del.icio.us/post?url=%SHARE_URL%"},"digg.com":{"url":"http://digg.com/submit?phase=2&url=%SHARE_URL%"},"email":{"url":"mailto:?subject=%SHARE_TITLE%&body=%SHARE_URL%","icon":"icon.email.png"},"evernote.com":{"url":"https://www.evernote.com/clip.action?url=%SHARE_URL%"},
"facebook.com":{"url":"http://www.facebook.com/sharer.php?u=%SHARE_URL%&t=%SHARE_TITLE%"},"google.com":{"url":"http://www.google.com/bookmarks/mark?op=add&bkmk=%SHARE_URL%"},"identi.ca":{"url":"https://identi.ca/?action=newnotice&status_textarea='%SHARE_URL%'"},"linkedin.com":{"url":"http://www.linkedin.com/shareArticle?mini=true&url=%SHARE_URL%"},"livejournal.com":{"url":"http://www.livejournal.com/update.bml?subject=%SHARE_URL%"},"myweb2.search.yahoo.com":{"url":"http://myweb2.search.yahoo.com/myresults/bookmarklet?t=%SHARE_URL%",
"icon":"mail.yahoo.com.png"},"mixx.com":{"url":"http://www.mixx.com/submit?page_url=%SHARE_URL%"},"myspace.com":{"url":"http://www.myspace.com/Modules/PostTo/Pages/?u=%SHARE_URL%"},"newsvine.com":{"url":"http://www.newsvine.com/_tools/seed&save?popoff=0&u=%SHARE_URL%"},"reddit.com":{"url":"http://reddit.com/submit?url=%SHARE_URL%"},"stumbleupon.com":{"url":"http://www.stumbleupon.com/submit?url=%SHARE_URL%"},"www.tumblr.com":{"url":"http://www.tumblr.com/share","icon":"tumblr.com.png"},"twitter.com":{"url":"http://twitter.com/?status=%SHARE_URL%"}};
function shareNiceHide(){if(document.getElementById)document.getElementById("shareNice-wrapper").style.display="none"}var shareNiceTimeout=null;
function shareNiceShow(iconSizeInt){if(shareNiceTimeout!=null){window.clearTimeout(shareNiceTimeout);shareNiceTimeout=null}if(document.getElementById){var shareLink=document.getElementById("shareNice-Link");var originalDim=GetTopLeft(shareLink);var shareWrapper=document.getElementById("shareNice-wrapper");shareWrapper.style.display="block";shareWrapper.style.top=originalDim.Top+(iconSizeInt-6)+"px";shareWrapper.style.left=originalDim.Left+"px"}}function getPageTitle(){return document.title}
function GetTopLeft(elm){var x,y=0;x=elm.offsetLeft;y=elm.offsetTop;elm=elm.offsetParent;while(elm!=null){x=parseInt(x)+parseInt(elm.offsetLeft);y=parseInt(y)+parseInt(elm.offsetTop);elm=elm.offsetParent}return{Top:y,Left:x}}
function shareNiceLoad(){var shareNice=document.getElementById("shareNice");if(shareNice==null)return;shareNice.style.margin="0px";shareNice.style.padding="0px";shareNice.style.display="inline-block";var filter=null;var sattr=shareNice.getAttribute("data-services");if(sattr!=null){filter={};var a=sattr.split(",");for(var s in a)filter[a[s]]=1}var prot=window.location.protocol;var label="Share";var lattr=shareNice.getAttribute("data-share-label");if(lattr!=null)label=lattr;var cScheme="orange";var cSchemeAttr=
shareNice.getAttribute("data-color-scheme");if(cSchemeAttr!=null)cScheme=cSchemeAttr;var iconSize="16";var iconSizeAttr=shareNice.getAttribute("data-icon-size");if(iconSizeAttr!=null&&iconSizeAttr=="32")iconSize=iconSizeAttr;var iconSizeInt=parseInt(iconSize);var iconImg="icon-share-"+cScheme+iconSize+".png";var labelTopPadding=0;var labelTopPaddingAttr=shareNice.getAttribute("data-label-topPadding");if(labelTopPaddingAttr!=null&&typeof parseInt(labelTopPaddingAttr)=="number")labelTopPadding=parseInt(labelTopPaddingAttr);
var panelBottom="default";var panelBottomAttr=shareNice.getAttribute("data-panel-bottom");var zindexconf=shareNice.getAttribute("data-share-zindex");var shareniceWrapperStyle="position:absolute; display:none; padding: 0; margin:0px auto;";if(zindexconf!=null)shareniceWrapperStyle="z-index:"+zindexconf+";"+shareniceWrapperStyle;if(panelBottomAttr!=null&&panelBottomAttr=="plain")panelBottom=panelBottomAttr;var paddingLeftPixelsInt=iconSizeInt;if(label!=="")paddingLeftPixelsInt=paddingLeftPixelsInt+
6;var shareBoxHTML='<style>#shareNice-wrapper ul li:before {content:"" !important}</style><div><a href="" id="shareNice-Link" style="background: url('+prot+"//sharenice.org/images/icons/"+iconImg+") no-repeat center left; padding-left: "+paddingLeftPixelsInt+"px; padding-top: "+labelTopPadding+"px; cursor: pointer; text-decoration: none; height: "+(iconSizeInt-labelTopPadding)+'px; display: inline-block;"><span>'+label+'</span></a></div> <div id="shareNice-wrapper" style="'+shareniceWrapperStyle+
'"> <div id="shareNice-box"> <div id="shareNice-box-top" style="width: 216px; height: 14px; background: url('+prot+'//sharenice.org/images/panel/share-box-top.png) no-repeat bottom center; margin-top: 10px;"></div> <div id="shareNice-box-body" style="width: 216px; background: url('+prot+'//sharenice.org/images/panel/share-box-body.png) repeat-y; margin: 0; padding: 0;"> <ul id="shareNice-socialLinks" style="margin: 0; padding: 1px 0 0 8px; list-style:none; text-indent:0;">';if(shareNiceConfig!=null){var currentPage=
window.location.href;var title=document.title;if(title.length<1)title=currentPage;for(var site in shareNiceConfig){if(filter!=null&&!filter[site])continue;var icon=site+".png";if(shareNiceConfig[site].icon!=null)icon=shareNiceConfig[site].icon;shareBoxHTML=shareBoxHTML+'<li style="margin: 0; float: left; display: inline; padding: 0 2px 0 2px; text-indent:0;"><a href="'+shareNiceConfig[site].url.replace("%SHARE_URL%",encodeURIComponent(currentPage)).replace("%SHARE_TITLE%",encodeURIComponent(title))+
'" target="_blank" style="margin:0px; padding:0px;">'+'<img src="'+prot+"//sharenice.org/images/"+icon+'" style="border: 0" alt="'+site+'_icon" title="'+site+'" />'+"</a></li>"}}shareBoxHTML=shareBoxHTML+"</ul>";if(panelBottom=="default")shareBoxHTML=shareBoxHTML+'<a style="padding:0;margin:0;"href="http://sharenice.org/website/privacy">';shareBoxHTML=shareBoxHTML+'<div style="clear:both;"></div> </div> <div id="shareNice-box-bottom" style="width: 216px; height: 44px; background: url('+prot+"//sharenice.org/images/panel/share-box-bottom-"+
panelBottom+'.png) no-repeat top center;"></div>';if(panelBottom=="default")shareBoxHTML=shareBoxHTML+"</a>";shareBoxHTML=shareBoxHTML+" </div> </div>";shareNice.innerHTML=shareBoxHTML;shareNice.onmouseover=function(){shareNiceShow(iconSizeInt)};shareNice.onmouseout=function(){shareNiceTimeout=window.setTimeout("shareNiceHide()",250)}}
if(window.attachEvent)window.attachEvent("onload",shareNiceLoad);else if(window.addEventListener)window.addEventListener("load",shareNiceLoad,false);else document.addEventListener("load",shareNiceLoad,false);