John White HIT Helper

Turns company name into a Google search link or turns the website address into a clickable link.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        John White HIT Helper
// @author      mmmturkeybacon + ScottB
// @description Turns company name into a Google search link or turns the website address into a clickable link.
// @include     https://www.mturkcontent.com*
// @require     http://code.jquery.com/jquery-latest.min.js
// @version     1.2
// @grant       none
// @namespace https://greasyfork.org/users/6129
// ==/UserScript==

if ( $('.panel-body:contains("Find the Company Name")').length > 0 )
{ // John White Website Search
    var company_node = $("td:contains('Website:')").next();

    var company_text = company_node.text().trim().replace("&", "%26");
    var google_URL = "http://" + company_text;
    google_URL = google_URL.replace(/[" "]/g, "+");
    company_node.html('<a href="' + google_URL + '" target="_blank">' + company_text + '</a>');
}

if ( $('.panel-body:contains("Find the website address for this School")').length > 0 )
{ // John White Website Search
    var company_node = $("td:contains('School name and location:')").next();

    var company_text = company_node.text().trim().replace("&", "%26");
    var google_URL = "http://www.google.com/search?q=" + company_text;
    google_URL = google_URL.replace(/[" "]/g, "+");
    company_node.html('<a href="' + google_URL + '" target="_blank">' + company_text + '</a>');
}

else
{ // John White Company Search
    var company_node = $("td:contains('Company Name:')").next();
    var city_node = $("td:contains('City:')").next();
    var state_node = $("td:contains('State:')").next();

    var company_text = company_node.text().trim().replace("&", "%26");
    var city_text = city_node.text().trim().replace("None Listed", "");
    var state_text = state_node.text().trim().replace("None Listed", "");
    var google_URL = "http://www.google.com/search?q=" + company_text + " " + city_text + " " + state_text;
    google_URL = google_URL.replace(/[" "]/g, "+");
    company_node.html('<a href="' + google_URL + '" target="_blank">' + company_text + '</a>');
}