template_share.js
上传用户:wenllgg125
上传日期:2020-04-09
资源大小:7277k
文件大小:5k
源码类别:

SCSI/ASPI

开发平台:

Others

  1. /*
  2.             
  3.         */
  4. var share={
  5. floatwin : function(list){
  6. floatwin('open_forward', -1, 350, 140);
  7. $('floatwin_forward_title').innerHTML = '转发';
  8. $('floatwin_forward_content').innerHTML = this.show(list);
  9. $('floatwin_forward_content').style.margin='15px';
  10. $('floatwin_forward_content').style.textAlign='left';
  11. },
  12. forward : function(c){
  13. (location.href = c) || (window.location = c);
  14. },
  15. show :function (list){
  16. var sharesite = list.split(",");
  17. var html = '';
  18. for (var i= 0 ;i< sharesite.length ; i++)
  19. {
  20. var s = sharesite[i].split("|");  
  21. if (parseInt(s[3]) == 1)
  22. {
  23.   html +='<a href="javascript:void(0)" target="_blank" onclick="javascript:share.'+s[1]+'();return false;" Style="background:URL(images/share/'+s[1]+'.gif) no-repeat 0 50%;margin-right:10px;white-Space:nowrap;padding:0px 0 4px 20px;float:left;display:inline;">'+s[2]+'</a>';
  24. }
  25. }
  26. return html;
  27. },
  28. renren : function (){
  29. var c = "http://share.xiaonei.com/share/buttonshare.do?link=" + encodeURIComponent(location.href) + "&title=" + encodeURIComponent(topictitle);
  30. if (!window.open(c, "xiaonei", "toolbar=0,resizable=1,scrollbars=yes,status=1,width=626,height=436")) 
  31. //(location.href = c) || (window.location = c);
  32. this.forward(c);
  33. },
  34. kaixin001 : function (){
  35. var c = "http://www.kaixin001.com/repaste/share.php?rtitle=" + encodeURIComponent(topictitle) + "&rurl=" + encodeURIComponent(location.href) + "&rcontent=" + encodeURIComponent(topictitle);
  36. //(location.href = c) || (window.location = c);
  37. if (!window.open(c, "kaixin001", "location = yes,menubar=yes,resizable=1,scrollbars=yes,status=1,titlebar=yes,toolbar=yes,scrollbars=yes")) 
  38. this.forward(c);
  39. },
  40. douban : function (){
  41. var c = "http://www.douban.com/recommend/?url=" + encodeURIComponent(location.href) + "&title=" + encodeURIComponent(topictitle);
  42. if (!window.open(c, "douban", "toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330")) 
  43. //(location.href = c) || (window.location = c);
  44. this.forward(c);
  45. },
  46. sohu : function ()
  47. {
  48. var c = "http://bai.sohu.com/share/blank/addbutton.do?link=" + location.href + "&title=" + topictitle;
  49.     if (!window.open(c, "sohu", "location = yes,menubar=yes,resizable=1,scrollbars=yes,status=1,titlebar=yes,toolbar=yes,scrollbars=yes")) 
  50.         this.forward(c);
  51. },
  52. sina : function (){
  53.         var c="http://v.t.sina.com.cn/share/share.php?url=" + encodeURIComponent(location.href) + "&title="+encodeURIComponent(topictitle)+"&source="+encodeURIComponent(forumtitle)+"&sourceUrl="+encodeURIComponent(document.domain)+"&content=gb2312";
  54. var pic=$('firstpost').getElementsByTagName('img');
  55. if(pic.length!=0){
  56. for(var j=0; j<pic.length;j++) {
  57. //pic[j].src.indexOf("http://")!=-1 || 
  58.   var getpic=is_ie?typeof pic[j].onload!="undefined":pic[j].getAttribute('onload')=='thumbImg(this)'
  59.   if(pic[j].src.indexOf("attachment.aspx?")!=-1 || getpic)
  60.   {
  61.   c+='&pic='+encodeURIComponent(pic[j].src);
  62.   break
  63.   }
  64. }
  65. }
  66. // else
  67. // {
  68. //   var pics=document.getElementsByTagName('img');
  69. //   for(var i=0; i<pics.length;i++)
  70. //   {
  71. //   if(pics[i].src.indexOf("attachment.aspx?")!=-1)
  72. //   {
  73. //   c+='&pic='+encodeURIComponent(pics[i].src);
  74. //   break;
  75. //   }
  76. //   }
  77. //     }
  78. if (!window.open(c, "sina", "toolbar=0,resizable=1,scrollbars=yes,status=1,width=626,height=436")) 
  79. //(location.href = c) || (window.location = c);
  80. this.forward(c);
  81. },
  82. qq : function (){
  83. //noui 是否开启界面
  84. var c = "http://shuqian.qq.com/post?title=" + encodeURIComponent(topictitle) + "&uri=" + encodeURIComponent(location.href) + "&jumpback=2&noui=1";
  85. if (!window.open(c, "qq", "location = yes,menubar=yes,resizable=1,scrollbars=yes,status=1,titlebar=yes,toolbar=yes,scrollbars=yes")) 
  86. this.forward(c);
  87. },
  88.     google: function(){
  89. var c="http://www.google.com/bookmarks/mark?op=add&bkmk=" + encodeURIComponent(location.href) + "&title=" + encodeURIComponent(topictitle);
  90.     if (!window.open(c, "google", "location = yes,menubar=yes,resizable=1,scrollbars=yes,status=1,titlebar=yes,toolbar=yes,scrollbars=yes")) 
  91. this.forward(c);
  92. },
  93.     vivi :function(){
  94. var c="http://vivi.sina.com.cn/collect/icollect.php?title=" + encodeURIComponent(topictitle) + "&url=" + encodeURIComponent(location.href);
  95. if (!window.open(c, "vivi", "location = yes,menubar=yes,resizable=1,scrollbars=yes,status=1,titlebar=yes,toolbar=yes,scrollbars=yes")) 
  96. this.forward(c);
  97. },
  98.     live:function(){
  99. var c="https://skydrive.live.com/sharefavorite.aspx/.SharedFavorites??url=&title=" + encodeURIComponent(topictitle) + "&jump=1&wa=wsignin1.0"
  100. if (!window.open(c, "live", "location = yes,menubar=yes,resizable=1,scrollbars=yes,status=1,titlebar=yes,toolbar=yes,scrollbars=yes")) 
  101. this.forward(c);
  102. },
  103. baidu : function(){
  104.     var c="http://cang.baidu.com/do/add?it=" + encodeURIComponent(topictitle) + "&iu=" + encodeURIComponent(location.href) + "&fr=ien#nw=1";
  105. if (!window.open(c, "baidu", "scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes")) 
  106. this.forward(c);
  107. },
  108.     favorite:function(){
  109. if (window.sidebar) { 
  110. window.sidebar.addPanel(topictitle,location.href,""); 
  111. } else if(document.all) {
  112. window.external.AddFavorite(location.href,topictitle);
  113. } else if(window.opera && window.print) {
  114. return true;
  115. }
  116. }
  117. }