hwm_work_at_home

work

  1. // ==UserScript==
  2. // @name hwm_work_at_home
  3. // @author Kopatych
  4. // ==UserScript==
  5. // @name work_hwm
  6. // @description work
  7. // @author Kopatych
  8. // @license MIT
  9. // @version 1.0.2
  10. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js
  11. // @include http://www.heroeswm.ru/*
  12. // @include http://qrator.heroeswm.ru/*
  13. // @include http://178.248.235.15/*
  14. // @include http://www.lordswm.com/*
  15. // @namespace https://greasyfork.org/users/13597
  16. // ==/UserScript==
  17.  
  18. (function (window, undefined) {
  19. jQuery.ajaxSetup({async:false});
  20. var url_cur = location.href;
  21. var url = 'http://'+location.hostname+'/'
  22. var w;
  23. if (typeof unsafeWindow !== undefined) {
  24. w = unsafeWindow
  25. } else {
  26. w = window;
  27. }
  28.  
  29. if (w.self != w.top) {
  30. return;
  31. }
  32. var appendEmployeement = function(type)
  33. {
  34. $.get(url + 'map.php?st='+type,
  35. {},
  36. function(html) {
  37. var html = $(html);
  38. html.encoding = 'windows-125';
  39. var factories = null;;
  40. var factories = html.find('table .wb tbody tr');
  41. workBlock.append(factories);
  42. $('.work-space tr .wblight').remove();
  43. $('.work-space tr:contains(Тип)').remove();
  44. $('.work-space tr:contains(Type)').remove();
  45. });
  46. }
  47. if (/\/home.php/.test(location.href)) {
  48. if (!this.GM_addStyle || (this.GM_addStyle.toString
  49. && this.GM_addStyle.toString().indexOf("not supported") > -1)
  50. ) {
  51. $('td [width = 55%]').append('</br><div id="workbench-button">' +
  52. '» Свободные предприятия</div>' +
  53. '<div class="wb-container">' +
  54. '<table class = "work-space wb"></table></div>');
  55. var workBlock = $('.work-space');
  56. appendEmployeement('mn');
  57. appendEmployeement('fc');
  58. appendEmployeement('sh')
  59. $("#workbench-button").css({'cursor':'pointer', 'padding-left':'4px', 'font-size':'1.2em'});
  60. if ($('body:contains(Вы нигде не работаете)')[0] === undefined
  61. && $('body:contains(You are currently unemployed)')[0] ===undefined
  62. ) {
  63. $('.wb-container').hide();
  64. }
  65. };
  66. $("#workbench-button").click(function(){
  67. $('.wb-container').slideToggle(200);
  68. });
  69. }
  70. })(window);