hwm_work

work

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

  1. // ==UserScript==
  2. // @name hwm_work
  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. var url_cur = location.href;
  20. var url = 'http://'+location.hostname+'/'
  21. var w;
  22. if (typeof unsafeWindow !== undefined) {
  23. w = unsafeWindow
  24. } else {
  25. w = window;
  26. }
  27.  
  28. if (w.self != w.top) {
  29. return;
  30. }
  31. var appendEmployeement = function(type)
  32. {
  33. $.get(url + 'map.php?st='+type,
  34. {},
  35. function(html)
  36. {
  37. var html = $(html);
  38. var factories = null;;
  39. var factories = html.find('table .wb tbody tr');
  40. workBlock.append(factories);
  41. $('.work-space tr .wblight').remove();
  42. $('.work-space tr:contains(Тип)').remove();
  43. });
  44. }
  45. if (/\/home.php/.test(location.href)) {
  46. if (!this.GM_addStyle || (this.GM_addStyle.toString && this.GM_addStyle.toString().indexOf("not supported")>-1))
  47. {
  48. $('td [width = 55%]').append("</br><div id='workbench-button'> » Свободные предприятия</div><div class='wb-container'><table class = 'work-space wb'></table></div>")
  49. var workBlock = $('.work-space');
  50. appendEmployeement('mn');
  51. appendEmployeement('fc');
  52. appendEmployeement('sh')
  53. $("#workbench-button").css({'cursor':'pointer', 'padding-left':'4px', 'font-size':'1.2em'});
  54. if($('body:contains(Вы нигде не работаете)')[0]===undefined)
  55. {
  56. $('.wb-container').hide();
  57. }
  58. };
  59. $("#workbench-button").click(function(){
  60. $('.wb-container').slideToggle(200);
  61. });
  62. }
  63. })(window);