Agar.io++

ItsVoid

当前为 2015-06-10 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Agar.io++
  3. // @namespace Agar.io
  4. // @description ItsVoid
  5. // @include http://agar.io/*
  6. // @version 2.1
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. function addStyleSheet(style){
  11. var getHead = document.getElementsByTagName("HEAD")[0];
  12. var cssNode = window.document.createElement( 'style' );
  13. var elementStyle= getHead.appendChild(cssNode)
  14. elementStyle.innerHTML = style;
  15. return elementStyle;
  16. }
  17. var alerted = localStorage.getItem('alerted') || '';
  18. if (alerted != 'yes') {
  19. alert("/!\ Make sure you have the Charts & Stats userscript installed for ingame statistics! Check the description on Greasyfork for more info.");
  20. localStorage.setItem('alerted','yes');
  21. }
  22.  
  23.  
  24. addStyleSheet('@import "http://bootswatch.com/paper/bootstrap.css"; @import "http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css";');
  25.  
  26. $(document).ready(function() {
  27. var region = $("#region");
  28. if (region.length) {
  29. $("<br/><div class=\"input-group\"><div class=\"form-group\"><input id=\"serverInput\" class=\"form-control\" placeholder=\"255.255.255.255:443\" maxlength=\"20\"><span class=\"input-group-btn\"> &<button disabled id=\"connectBtn\" class=\"btn-needs-server btn btn-warning\" style=\"width: 80px\" onclick=\"connect('ws://' + $('#serverInput').val());\" type=\"button\">Join</button><button disabled id=\"connectBtn\" class=\"btn-needs-server btn btn-info\" style=\"width: 80px\" onclick=\"connect('ws://' + $('#serverInput').val());\" type=\"button\"><span class=\"fa fa-lg fa-refresh\"></span></button> </input></div>").insertAfter("#helloDialog > form > div:nth-child(3)");
  30. }
  31. });
  32.  
  33.  
  34. var elmDeleted = document.getElementById("instructions");
  35. elmDeleted.parentNode.removeChild(elmDeleted);
  36.  
  37. var elmDeleted = document.getElementById("blocker");
  38. elmDeleted.parentNode.removeChild(elmDeleted);
  39.  
  40. setShowMass(true);
  41. setDarkTheme(true);
  42. setNames(true);
  43. $("#nick").val("Netherlands");
  44.  
  45. WebFontConfig = {
  46. google: { families: [ 'Raleway::latin' ] }
  47. };
  48. (function() {
  49. var wf = document.createElement('script');
  50. wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
  51. '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
  52. wf.type = 'text/javascript';
  53. wf.async = 'true';
  54. var s = document.getElementsByTagName('script')[0];
  55. s.parentNode.insertBefore(wf, s);
  56. })();
  57.  
  58.  
  59. function addGlobalStyle(css) {
  60. var head, style;
  61. head = document.getElementsByTagName('head')[0];
  62. if (!head) { return; }
  63. style = document.createElement('style');
  64. style.type = 'text/css';
  65. style.innerHTML = css;
  66. head.appendChild(style);
  67. }
  68.  
  69. addGlobalStyle('html * { font-family: Raleway, sans-serif; }');; }');