share.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. function ds(ct) {
  2. ct = (ct + '').toString();
  3. return encodeURIComponent(ct).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
  4. };
  5. // 排行版链接
  6. function eF() {
  7. dp_Ranking();
  8. };
  9. function w596_rank(x){
  10. var s ='';
  11. var t ='跳跳蛙 我要跳得更远';
  12. var x1=''; // 部门
  13. var x2=''; // 公职
  14. var y=''; // 人数
  15. var z=''; // 百分比
  16. var arr ='';
  17. if(x>10000){
  18. x2='超凡跳跳蛙';
  19. z='99';
  20. y=Math.floor( + Math.random() * 713);
  21. }
  22. else if(x>3000){ // 特攻队
  23. arr= "王牌跳跳蛙 钢铁跳跳蛙 超级跳跳蛙 人气跳跳蛙".split(" ");
  24. x2=arr[Math.floor(Math.random() * arr.length)];
  25. z=myRnd(55,98);
  26. y=Math.floor( + Math.random() * 97596);
  27. }
  28. else if(x>1000){ // 陆战队
  29. arr= "奇葩跳跳蛙 红人跳跳蛙 得瑟跳跳蛙 天朝跳跳蛙".split(" ");
  30. x2=arr[Math.floor(Math.random() * arr.length)];
  31. z=myRnd(20,55);
  32. y=Math.floor( + Math.random() * 998899);
  33. }
  34. else if(x>500){ // 文艺兵
  35. arr= "屌丝跳跳蛙 普通跳跳蛙 山寨跳跳蛙".split(" ");
  36. x2=arr[Math.floor(Math.random() * arr.length)];
  37. z=myRnd(5,20);
  38. y=Math.floor( + Math.random() * 72568899);
  39. }
  40. else{ // 预备役
  41. x2='失败跳跳蛙';
  42. z=myRnd(1,5);
  43. if(x==0){z=1;}
  44. y=Math.floor( + Math.random() * 895968899);
  45. }
  46. dp_submitScore(x);
  47. return '<div id="weixin-share"></div><div id="weixin-text"><div id="j"><div id="txt">'+x2+'</div><div id="rank">排名 '+y+' 位 <br/>击败了 ' + z+ '% 玩家</div></div></div></div>';
  48. }
  49. function myRnd(min,max){
  50. return Math.floor(min+Math.random()*(max-min));
  51. }
  52. var isTouch = ('ontouchstart' in window);
  53. var touchStartEvent = isTouch ? "touchstart" : "mousedown";
  54. var touchEndEvent = isTouch ? "touchend" : "mouseup";
  55. document.addEventListener(touchStartEvent, function () {
  56. try {
  57. event.stopPropagation();
  58. }
  59. catch (err) {
  60. }
  61. }, false);
  62. document.addEventListener(touchEndEvent, function () {
  63. event.stopPropagation();
  64. }, false);
  65. function bodyClick(dom) {
  66. dom.addEventListener(touchStartEvent, function () {
  67. try {
  68. event.stopPropagation();
  69. }
  70. catch (err) {
  71. }
  72. }, false);
  73. dom.addEventListener(touchEndEvent, function () {
  74. var linkbtn = document.getElementById("linkbtn");
  75. if (linkbtn && linkbtn.length) {
  76. linkbtn.style.display = "none";
  77. }
  78. event.stopPropagation();
  79. }, false);
  80. };
  81. var bodyx = document.getElementById("hs");
  82. bodyClick(bodyx);