Digital EDOC URL Search

Search a text on Digital EDOC via Url with all fields checked. (https://edoc.uchicago.edu/edoc2013/digitaledoc_linearformat.php?q=切韻 & https://edoc.uchicago.edu/edoc2013/digitaledoc_tableformat.php?q=切韻)

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Digital EDOC URL Search
// @name:tr      Digital EDOC URL Araması
// @namespace    https://github.com/nhtctn
// @version      1.0
// @description  Search a text on Digital EDOC via Url with all fields checked. (https://edoc.uchicago.edu/edoc2013/digitaledoc_linearformat.php?q=切韻  &  https://edoc.uchicago.edu/edoc2013/digitaledoc_tableformat.php?q=切韻)
// @description:tr Digital EDOC sitesinde tüm alanlar seçili şekilde URL'den arama yapar. (https://edoc.uchicago.edu/edoc2013/digitaledoc_linearformat.php?q=切韻  &  https://edoc.uchicago.edu/edoc2013/digitaledoc_tableformat.php?q=切韻)
// @author       nht.ctn
// @license      MIT
// @match        *://edoc.uchicago.edu/edoc2013/digitaledoc_linearformat.php?q=*
// @match        *://edoc.uchicago.edu/edoc2013/digitaledoc_tableformat.php?q=*
// @grant        none
// @require	     https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// ==/UserScript==
/* global $ */
/*jshint esversion: 6 */
(function() {
    'use strict';

	$('head').prepend('<meta charset="Shift-JIS"/>');
	var urlParams = new URLSearchParams(window.location.search);
	var postKeyword = urlParams.get('q');
	var baseUrl = window.location.href.replace(/\.php.+/, ".php");

	if (urlParams.get('q') && postKeyword !== '') {
		$('#text_input').val(postKeyword);
		$(`[onclick="checkedAll('qygy[]');"]`).click();
		$(`[onclick="checkedAll('bs2012[]');"]`).click();
		$(`[onclick="checkedAll('edoc[]');"]`).click();
		$(`[name="Run_button"]`).click();
	}
	else{
		document.location = baseUrl;
	}
})();