Kotonoha Context Concatenator

Joins the 3 result columns of Kotonoha search results.

  1. // ==UserScript==
  2. // @name Kotonoha Context Concatenator
  3. // @namespace rfindley
  4. // @description Joins the 3 result columns of Kotonoha search results.
  5. // @version 1.0.0
  6. // @include http://www.kotonoha.gr.jp/shonagon/search_result
  7. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js
  8. // @copyright 2017+, Robin Findley
  9. // @license MIT; http://opensource.org/licenses/MIT
  10. // @run-at document-end
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. window.kotonoha = {};
  15.  
  16. (function(gobj) {
  17.  
  18. //-------------------------------------------------------------------
  19. // Startup. Runs at document 'load' event.
  20. //-------------------------------------------------------------------
  21. function startup() {
  22. var arr = $('td.cell01,td.cell02,td.cell03');
  23. $('th.cell03').after('<th class="sample cell04">文脈</th>');
  24. for (var idx = 0; idx < arr.length; idx += 3) {
  25. arr.eq(idx+2).after('<td class="cell04">' + arr.eq(idx).text() + arr.eq(idx+1).text() + arr.eq(idx+2).text() + '</td>');
  26. }
  27. $('.cell01,.cell02,.cell03').hide();
  28. }
  29.  
  30. // Run startup() after window.onload event.
  31. if (document.readyState === 'complete')
  32. startup();
  33. else
  34. window.addEventListener("load", startup, false);
  35.  
  36. })(window.kotonoha);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址