hwm_work_at_home

work

当前为 2015-07-27 提交的版本,查看 最新版本

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