hwm_work_at_home

work

目前為 2015-07-27 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name           hwm_work_at_home
// @author         Kopatych
// ==UserScript==
// @name work_hwm
// @description work
// @author Kopatych
// @license MIT
// @version 1.0.2
// @encoding utf-8
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js
// @include        http://www.heroeswm.ru/*
// @include        http://qrator.heroeswm.ru/*
// @include        http://178.248.235.15/*
// @include        http://www.lordswm.com/*
// @namespace https://greasyfork.org/users/13597
// ==/UserScript==

(function (window, undefined) {
    jQuery.ajaxSetup({async:false});
    var url_cur = location.href;
    var url = 'http://'+location.hostname+'/'
    var w;
    if (typeof unsafeWindow !== undefined) {
        w = unsafeWindow
    } else {
        w = window;
    }

    if (w.self != w.top) {
        return;
    }
    
    var appendEmployeement = function(type)
    {
        $.get(url + 'map.php?st='+type,
                  {},
                 function(html)
                  {
                      var html = $(html);
                      var factories = null;;
                      var factories = html.find('table .wb tbody tr');
                      workBlock.append(factories);
                      $('.work-space tr .wblight').remove();
                      $('.work-space tr:contains(Тип)').remove();
                  });
    }
    if (/\/home.php/.test(location.href)) {
        if (!this.GM_addStyle || (this.GM_addStyle.toString && this.GM_addStyle.toString().indexOf("not supported")>-1))
        {
            $('td [width = 55%]').append("</br><div id='workbench-button'> » Свободные предприятия</div><div class='wb-container'><table class = 'work-space wb'></table></div>")
                      var workBlock = $('.work-space');
            
            appendEmployeement('mn');
            appendEmployeement('fc');
            appendEmployeement('sh')
            $("#workbench-button").css({'cursor':'pointer', 'padding-left':'4px', 'font-size':'1.2em'});
            if($('body:contains(Вы нигде не работаете)')[0]===undefined)
            {
                $('.wb-container').hide();
            }
        };
        
        $("#workbench-button").click(function(){
            $('.wb-container').slideToggle(200);
        });
    }
})(window);