Greasy Fork is available in English.

GitHub Search Autocomplete

A userscript that adds autocomplete search filters to GitHub

Verze ze dne 10. 05. 2017. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name GitHub Search Autocomplete
  3. // @version 0.1.3
  4. // @description A userscript that adds autocomplete search filters to GitHub
  5. // @license https://opensource.org/licenses/MIT
  6. // @author Rob Garrison
  7. // @namespace https://github.com/Mottie
  8. // @include https://github.com/*
  9. // @include https://gist.github.com/*
  10. // @run-at document-idle
  11. // @grant GM_addStyle
  12. // @require https://code.jquery.com/jquery-3.2.1.min.js
  13. // @require https://cdnjs.cloudflare.com/ajax/libs/Caret.js/0.3.1/jquery.caret.min.js
  14. // @require https://cdnjs.cloudflare.com/ajax/libs/at.js/1.5.3/js/jquery.atwho.min.js
  15. // @icon https://github.com/fluidicon.png
  16. // ==/UserScript==
  17. (($) => {
  18. "use strict";
  19.  
  20. const data = {},
  21.  
  22. // search input classes used by GitHub
  23. selectors = [
  24. ".header-search-input", // main header search
  25. "[aria-label*='Search']", // https://github.com/search
  26. ".search-page-input", // https://github.com/search/advanced
  27. "#js-issues-search" // https://github.com/:user/:repo/issues & pulls
  28. ].join(","),
  29.  
  30. // update examples using current & previous year
  31. year = new Date().getFullYear(),
  32. /**
  33. * This data was manually extracted from the pages listed on
  34. * https://help.github.com/categories/search/
  35. */
  36. filters = {
  37. "AND": {
  38. "": "search operator (max 5 of any operator)"
  39. },
  40. // Issue
  41. "assignee": {
  42. "": "search for issues assigned to the named user",
  43. "fred": 'search for issues assigned to "@fred"'
  44. },
  45. // Commits & Issues
  46. "author": {
  47. "": "search for issues or commits authored by the username",
  48. "fred": 'search for issues or commits authored by "@fred"'
  49. },
  50. "author-date": {
  51. "": "search commits authored before or after a date",
  52. ">${year-1}-12-31": "search commits authored since ${year}",
  53. ">=${year}-01-01": "search commits authored since ${year}",
  54. "<${year}-01-01": "search commits authored before ${year}",
  55. "<=${year-1}-12-31": "search commits authored before ${year}"
  56. },
  57. "author-email": {
  58. "": "search for a commit authored by the specified user email",
  59. "fred@gmail.com": "search for commits authored by gmail fred"
  60. },
  61. "author-name": {
  62. "": "search for a commit created using the author's actual name",
  63. "smith": 'search for commits authored by someone named "smith"'
  64. },
  65. // Issues
  66. "base": {
  67. "": "search pull requests to be merged into the specified branch name",
  68. "gh-pages": 'search pull requests being merged into the "gh-pages" branch'
  69. },
  70. // Issues
  71. "closed": {
  72. "": "search issues & pull requests closed before or after a date",
  73. ">${year-1}-12-31": "search issues & pull requests closed since ${year}",
  74. ">=${year}-01-01": "search issues & pull requests closed since ${year}",
  75. "<${year}-01-01": "search issues & pull requests closed before ${year}",
  76. "<=${year-1}-12-31": "search issues & pull requests closed before ${year}"
  77. },
  78. "commenter": {
  79. "": "search for comments authored by the named user",
  80. "fred": 'search for comments authored by "@fred"'
  81. },
  82. "comments": {
  83. "": "search issues with specified number of comments",
  84. "100": "search issues with exactly 100 comments",
  85. ">100": "search issues with >100 comments",
  86. ">=100": "search issues with >=100 comments",
  87. "10..20": "search issues with 10-20 comments",
  88. "<100": "search issues with <100 comments",
  89. "<=100": "search issues with <=100 comments"
  90. },
  91. "committer": {
  92. "": "search for commits authored by the named user",
  93. "fred": 'search for commits authored by "@fred"'
  94. },
  95. "committer-date": {
  96. "": "search commits authored before or after a date",
  97. ">${year-1}-12-31": "search commits authored since ${year}",
  98. ">=${year}-01-01": "search commits authored since ${year}",
  99. "<${year}-01-01": "search commits authored before ${year}",
  100. "<=${year-1}-12-31": "search commits authored before ${year}"
  101. },
  102. "committer-email": {
  103. "": "search for a commit authored by the specified user email",
  104. "fred@gmail.com": "search for commits authored by gmail fred"
  105. },
  106. "committer-name": {
  107. "": "search for a commit created using the author's actual name",
  108. "smith": 'search for commits authored by someone named "smith"'
  109. },
  110. // Issues & user
  111. "created": {
  112. "": "search issues & user accounts created at the specified date",
  113. ">${year-1}-12-31": "search issues & user accounts created since ${year}",
  114. ">=${year}-01-01": "search issues & user accounts created since ${year}",
  115. "${year}-01-01..*": "search issues & user accounts created since ${year}",
  116. "${year}-01-01..${year}-01-31": "search commits authored in Jan ${year}",
  117. "<${year}-01-01": "search issues & user accounts created before ${year}",
  118. "<=${year-1}-12-31": "search issues & user accounts created before ${year}",
  119. "*..${year-1}-12-31": "search issues & user accounts created before ${year}"
  120. },
  121. // Code
  122. "extension": {
  123. "": "search within file extensions",
  124. "js": "search within JavaScript files",
  125. "rb": "search within Ruby files",
  126. "css": "search within CSS files",
  127. "coffee": "search within CoffeeScript files",
  128. "md": "search within markdown files"
  129. },
  130. "-extension": {
  131. "": "search excludes this file extension",
  132. "js": "search excludes JavaScript files",
  133. "rb": "search excludes Ruby files",
  134. "css": "search excludes CSS files",
  135. "coffee": "search excludes CoffeeScript files",
  136. "md": "search excludes markdown files"
  137. },
  138. // Code
  139. "filename": {
  140. "": "search within code files named as specified",
  141. "test_helper": 'search within the "test_helper" code file(s)',
  142. ".vimrc": 'search "*.vimfc*" code files named as specified'
  143. },
  144. // User
  145. "followers": {
  146. "": "search users & organizations with the specified number of followers",
  147. "100": "search users with exactly 100 followers",
  148. ">100": "search users with >100 followers",
  149. ">=100": "search users with >=100 followers",
  150. "10..20": "search users with 10-20 followers",
  151. "<100": "search users with <100 followers",
  152. "<=100": "search users with <=100 followers"
  153. },
  154. // Code... includes "-fork"?
  155. "fork": {
  156. "": "searches exclude forks when this filter is undefined",
  157. "only": "search only within forked repos",
  158. "true": "search includes forked repos"
  159. },
  160. // Repos, Code
  161. "forks": {
  162. "": "search repos with greater, less, or a range of forks",
  163. "100": "search repos with exactly 100 forks",
  164. ">100": "search repos with >100 forks",
  165. ">=100": "search repos with >=100 forks",
  166. "10..20": "search repos with 10-20 forks",
  167. "<100": "search repos with <100 forks",
  168. "<=100": "search repos with <=100 forks"
  169. },
  170. "-forks": {
  171. "": "search repos outside of the selected number of forks",
  172. "100": "search repos with that do not have exactly 100 forks",
  173. ">100": "search repos with <=100 forks",
  174. ">=100": "search repos with <100 forks",
  175. "10..20": "search repos with <10 or >20 forks",
  176. "<100": "search repos with >=100 forks",
  177. "<=100": "search repos with >100 forks"
  178. },
  179. "fullname": {
  180. "": "search within a user's full name",
  181. "linus": 'search for users with "linus" in their full name',
  182. '"Linus Torvalds"': "search for a full name wrapped in quotes"
  183. },
  184. // Commits
  185. "hash": {
  186. "": "search commits with the specified SHA-1 hash",
  187. "124a9a0ee1d8f1e15e833aff432fbb3b02632105": "search matching hash"
  188. },
  189. // Issues
  190. "head": {
  191. "": "search pull requests opened from the specified branch name",
  192. "fix": 'search pull requests opened from branch names containing the word "fix"'
  193. },
  194. // Repos, Issue, User
  195. "in": {
  196. "": "search within repo, issue or user meta data",
  197. // Repo
  198. "body": "search within an issue or wiki body",
  199. "description": "search within the repo description",
  200. "file": "search within the repo file contents",
  201. "file,path": "search within the repo file contents & path name",
  202. "name": "searh within a user, organization or repo name",
  203. "name,description" : "search within the repo name or description",
  204. "path": "search within the repo path name",
  205. "readme": "search within the repo readme",
  206. // Issue & Wiki
  207. "comments": "search within an issue comments",
  208. "title": "search within an issue or wiki title",
  209. "title,body": "search within an issue or wiki title & body",
  210. // User
  211. "email": "search within a user or organization email (not the domain name)",
  212. "login": "search within a user or organization username",
  213. "fullname": "search within a user's full name"
  214. },
  215. "involves": {
  216. "": "search for issues or commits that involves the named user",
  217. "fred": 'search for issues or commits that involve "@fred"'
  218. },
  219. // Commits
  220. "is": {
  221. "": "search commits and issues of the specified state (multiple allowed)",
  222. "public": "search public commits & issues",
  223. "private": "search private commits & issues",
  224. "open": "search open issues & pull requests",
  225. "closed": "search closed issues & pull requests",
  226. "issue": "search within issues",
  227. "pr": "search within pull requests",
  228. "merged": "search merged pull requests",
  229. "unmerged": "search unmerged pull requests"
  230. },
  231. // Issue
  232. "label": {
  233. "": "search issues & pull requests with the specified label (multiple allowed)",
  234. "bug": 'search for issues & pull requests labeled "bug"',
  235. '"in progress"': "search for multiword labels inside quotes"
  236. },
  237. "-label": {
  238. "": "search issues & pull requests without the specified label",
  239. "bug": 'search for issues & pull requests not labeled "bug"'
  240. },
  241. // Code, Issue, Repos, User
  242. "language": {
  243. "": "search within this language",
  244. "javascript": "search within repos containing JavaScript",
  245. "php": "search within repos containing PHP",
  246. "scss": "search within repos containing SCSS",
  247. "c#": "search within repos containing C#",
  248. "markdown": "search within repos containing markdown (.md, .markdown, etc)",
  249. },
  250. "-language": {
  251. "": "search excludes this language",
  252. "javascript": "search excludes repos with JavaScript",
  253. "php": "search excludes repos with PHP",
  254. "scss": "search excludes repos with SCSS",
  255. "xml": "search excludes repos with XML",
  256. "markdown": "search excludes repos with markdown (.md, .markdown, etc)",
  257. },
  258. "location": {
  259. "": "search users within a location",
  260. '"San Francisco, CA"': "search users in San Francisco",
  261. "london": "search users in london",
  262. "iceland": "search users in Iceland"
  263. },
  264. "-location": {
  265. "": "search users not in a specific location",
  266. '"San Francisco, CA"': "search users not in San Francisco",
  267. "london": "search users not in london",
  268. "iceland": "search users not in Iceland"
  269. },
  270. // Issues
  271. "mentions": {
  272. "": "search for issues mentioning the named user",
  273. "fred": 'search for issues that mention "@fred"'
  274. },
  275. // Commits
  276. "merge": {
  277. "true": "searches that match merge commits",
  278. "false": "searches that match non-merge commits"
  279. },
  280. "merged": {
  281. "": "search pull requests merged at the specified date",
  282. ">${year-1}-12-31": "search pull requests merged since ${year}",
  283. ">=${year}-01-01": "search pull requests merged since ${year}",
  284. "<${year}-01-01": "search pull requests merged before ${year}",
  285. "<=${year-1}-12-31": "search pull requests merged before ${year}"
  286. },
  287. "milestone": {
  288. "": "search for issues & pull requests within the specified milestone",
  289. "sprint-42": 'search for issues & pull requests in the "sprint-42" milestone'
  290. },
  291. "no": {
  292. "": "search issues & pull requests missing the specified association",
  293. "label": "search issues & pull requests that don't have a label",
  294. "assignee": "search issues & pull requests that don't have an assignee",
  295. "milestone": "search issues & pull requests that don't have a milestone",
  296. "project": "search issues & pull requests that don't have a project"
  297. },
  298. "NOT": {
  299. "": "search operator (max 5 of any operator)"
  300. },
  301. "OR": {
  302. "": "search operator (max 5 of any operator)"
  303. },
  304. "org": {
  305. "": "search within the named organization",
  306. "github": "search GitHub's repositories"
  307. },
  308. // Commits
  309. "parent": {
  310. "": "search children of specified SHA-1 hash",
  311. "124a9a0ee1d8f1e15e833aff432fbb3b02632105": "search children of hash"
  312. },
  313. "path": {
  314. "": "search code within the specific file path (directory)",
  315. "cgi-bin": 'search code within the "cgi-bin" folder'
  316. },
  317. "project": {
  318. "": "search issues within a specified repository project board",
  319. "github/linguist/1": "search issues in GitHub's linguist repo project board 1"
  320. },
  321. // Repos
  322. "pushed": {
  323. "": "search repo pushes before or after a date (no range)",
  324. ">${year}-01-15": "search repos pushed to after Jan 15, ${year}",
  325. ">=${year}-01-15": "search repos pushed to since Jan 15, ${year}",
  326. "<${year}-02-01": "pushed to before Feb ${year}",
  327. "<=${year}-02-01": "pushed to before and including Feb 1, ${year}"
  328. },
  329. "-pushed": {
  330. "": "search pushes opposite of selected dates (no range)",
  331. ">${year}-01-15": "search repos pushed to after Jan 15, ${year}",
  332. ">=${year}-01-15": "search repos pushed to since Jan 15, ${year}",
  333. "<${year}-02-01": "pushed to before Feb ${year}",
  334. "<=${year}-02-01": "pushed to before and including Feb 1, ${year}"
  335. },
  336. // Commits
  337. "repo": {
  338. "": "search within the specified user's repository",
  339. "torvalds/linux": "search commits within Linus' Linux repository"
  340. },
  341. "repos": {
  342. "": "search user or organization with specified number of repos",
  343. "100": "search user or org with exactly 100 repos",
  344. ">100": "search user or org with >100 repos",
  345. ">=100": "search user or org with >=100 repos",
  346. "10..20": "search user or org with 10-20 repos",
  347. "<100": "search user or org with <100 repos",
  348. "<=100": "search user or org with <=100 repos"
  349. },
  350. "review": {
  351. "": "search pull requests with the specified review state",
  352. "none": "search pull requests that have not been reviewed",
  353. "required": "search pull requests that require a review before merge",
  354. "approved": "search pull requests that have been approved",
  355. "changes_requested": "search pull requests where a reviewer requested changes"
  356. },
  357. "review-requested": {
  358. "": "search pull requests with a requested reviewer, but only before they review the PR",
  359. "fred": 'search pull requests where "@fred" was asked to review'
  360. },
  361. "reviewed-by": {
  362. "": "search pull requests that have been reviewed by the specified user",
  363. "fred": 'search pull requests reviewed by "@fred"'
  364. },
  365. // Repos, Code - include "-size"?
  366. "size": {
  367. "": "search repos or files with a specific size (in KB)",
  368. "1000": "search repos or files that are exactly 1 MB in size",
  369. ">10000": "search repos or files that are more than 10 MB in size",
  370. ">=10000": "search repos or files that are at least 10 MB in size",
  371. "1024..4096": "search repos or files between 1024 and 4096 KB in size",
  372. "<1000": "search repos or files less than 1 MB in size",
  373. "<=100": "search repos or files that are less than or equal to 100 KB in size"
  374. },
  375. "sort": {
  376. "": 'apply an ascending or descending sort to the specified filter; add "-asc" or "-desc"',
  377. "author-date-asc": "sort oldest authored date first",
  378. "author-date-desc": "sort newest authored date first",
  379. "comments-asc": "sort least comments fist",
  380. "comments-desc": "sort most comments first",
  381. "committer-date-asc": "sort oldest committer date first",
  382. "committer-date-desc": "sort newest committer date first",
  383. "created-asc": "sort oldest item first",
  384. "created-desc": "sort newest item first",
  385. "forks-asc": "sort least forks first",
  386. "forks-desc": "sort most forks first",
  387. "reactions-+1-asc": "sort least +1 reactions first",
  388. "reactions-+1-desc": "sort most +1 reactions first",
  389. "reactions--1-asc": "sort least -1 reactions first",
  390. "reactions--1-desc": "sort most -1 reactions first",
  391. "reactions-heart-asc": "sort least heart reactions first",
  392. "reactions-heart-desc": "sort most heart reactions first",
  393. "reactions-smile-asc": "sort least smile reactions first",
  394. "reactions-smile-desc": "sort most smile reactions first",
  395. "reactions-tada-asc": "sort least tada reactions first",
  396. "reactions-tada-desc": "sort most tada reactions first",
  397. "reactions-thinking_face-asc": "sort least thinking face reactions first",
  398. "reactions-thinking_face-desc": "sort most thinking face reactions first",
  399. "stars-asc": "sort least stars first",
  400. "stars-desc": "sort most stars first",
  401. "updated-asc": "sort least recently updated first",
  402. "updated-desc": "sort recently updated first"
  403. },
  404. "stars": {
  405. "": "search repos with greater, less, or a range of stars",
  406. "100": "search repos with exactly 100 stars",
  407. ">100": "search repos with >100 stars",
  408. ">=100": "search repos with >=100 stars",
  409. "10..20": "search repos with 10-20 stars",
  410. "<100": "search repos with <100 stars",
  411. "<=100": "search repos with <=100 stars"
  412. },
  413. "-stars": {
  414. "": "search repos outside of the selected number of stars",
  415. "100": "search repos with that do not have exactly 100 stars",
  416. ">100": "search repos with <=100 stars",
  417. ">=100": "search repos with <100 stars",
  418. "10..20": "search repos with <10 or >20 stars",
  419. "<100": "search repos with >=100 stars",
  420. "<=100": "search repos with >100 stars"
  421. },
  422. "state": {
  423. "closed": "search closed issues",
  424. "open": "search open issues"
  425. },
  426. "status": {
  427. "": "search pull requests with the specified status",
  428. "success": "search pull requests with a successful status",
  429. "pending": "search pull requests with a pending status",
  430. "failed": "search pull requests with a failed status"
  431. },
  432. "team": {
  433. "": "search issues or pull requests mentioning an organization team",
  434. "jekyll/owners": 'search issues or pull requests for team "@jekyll/owners"',
  435. "myorg/ops": 'search issues or pull requests for team "@myorg/ops"'
  436. },
  437. "topic": {
  438. "": "search repos with the specified topic",
  439. "jekyll": 'search for repos classified with a "jekyll" topic'
  440. },
  441. "topics": {
  442. "": "search repos with greater, less, or a range of topics",
  443. "3": "search repos with exactly 3 topics",
  444. ">3": "search repos with more than three topics",
  445. ">=3": "search repos with three or more topics",
  446. "<3": "search repos with less than 3 topics",
  447. "<=2": "search repos with zero to two topics"
  448. },
  449. // Commits
  450. "tree": {
  451. "": "searches commits referring to the specified tree hash",
  452. "99ca967": "search commits of tree hash"
  453. },
  454. "type": {
  455. "": "search for a user, organization, issue or pull request",
  456. "issue": "only search issues",
  457. "pr": "only search pull requests",
  458. "org": "only search organizations",
  459. "user": "only search personal accounts"
  460. },
  461. // Wiki
  462. "updated": {
  463. "": "search issue & wiki updates before or after a date (no range)",
  464. ">${year}-01-31": "search repos pushed to after Jan 31, ${year}",
  465. ">=${year}-01-31": "search repos pushed to since Jan 31, ${year}",
  466. "<${year}-02-01": "pushed to before Feb ${year}",
  467. "<=${year}-02-01": "pushed to before and including Feb 1, ${year}"
  468. },
  469. // User
  470. "user": {
  471. "": "search for a specific user or organization",
  472. "github": "search in github organization repos"
  473. },
  474. "-user": {
  475. "": "search excludes a specific user or organization",
  476. "github": "search does not include github organization repos"
  477. }
  478. },
  479. // array containing items that should not include a trailing colon
  480. noTrailingColon = [
  481. "AND",
  482. "OR",
  483. "NOT"
  484. ],
  485. list = Object.keys(filters);
  486.  
  487. function updateYear(string) {
  488. return string.replace(/(\$\{year(-1)?\})/g, function(str) {
  489. return {
  490. "${year}": year,
  491. "${year-1}": year - 1
  492. }[str];
  493. });
  494. }
  495.  
  496. // copied from atwho.js DEFAULT_CALLBACKS.highlighter
  497. // https://github.com/ichord/At.js/blob/master/dist/js/jquery.atwho.js#L105
  498. // to add a class to the <strong> html
  499. function highlighter(li, query) {
  500. if (!query) {
  501. return li;
  502. }
  503. const regexp = new RegExp(
  504. ">\\s*([^\<]*?)(" + query.replace("+", "\\+") + ")([^\<]*)\\s*<", "ig"
  505. );
  506. return li.replace(regexp, function(str, $1, $2, $3) {
  507. return `>${$1}<strong class="text-emphasized">${$2}</strong>${$3} <`;
  508. });
  509. }
  510.  
  511. function escapeHTML(string) {
  512. return updateYear(string).replace(/[<>"&]/g, function(str) {
  513. return {
  514. "<" : "&lt;",
  515. ">" : "&gt;",
  516. '"' : "&quot;",
  517. "&" : "&amp;"
  518. }[str];
  519. });
  520. }
  521.  
  522. function addAtJs() {
  523. const $selectors = $(selectors);
  524.  
  525. // add "?" to open list of filters
  526. $selectors.atwho({
  527. at: "?",
  528. data: list,
  529. insertTpl: "${name}",
  530. // show everything in dropdown
  531. limit: list.length,
  532. suffix: "",
  533. callbacks: {
  534. highlighter: highlighter,
  535. beforeInsert: function(value) {
  536. // add colon suffix, as needed
  537. return value + (noTrailingColon.includes(value) ? " " : ":");
  538. }
  539. },
  540. });
  541.  
  542. // Add specific filter examples
  543. list.forEach(label => {
  544. $selectors.atwho({
  545. at: label + (noTrailingColon.includes(label) ? " " : ":"),
  546. data: data[label],
  547. limit: 20,
  548. startWithSpace: false,
  549. callbacks: {
  550. highlighter: highlighter,
  551. tplEval: function(tpl, map) {
  552. // look for default displayTpl = "<li>${name}</li>"
  553. if (tpl.indexOf("<li>") > -1) {
  554. // menu template; text-emphasized needed for GitHub-Dark userstyle
  555. return `
  556. <li>
  557. <strong class="ghsa-key text-emphasized">
  558. ${escapeHTML(map.name)}
  559. </strong>
  560. <small>${escapeHTML(map.description)}</small>
  561. </li>`;
  562. }
  563. // insert text template
  564. return `${map["atwho-at"]}${updateYear(map.name)}`;
  565. },
  566. sorter: function(query, items) {
  567. // reset suffix setting
  568. this.setting.suffix = " ";
  569. return items;
  570. },
  571. beforeInsert: function(value) {
  572. // don't add a space if the user chooses an empty string value
  573. // meaning the filter ends with a colon, e.g. "in:"
  574. this.setting.suffix = value.slice(-1) === ":" ? "" : " ";
  575. return value;
  576. }
  577. }
  578. });
  579. });
  580. // use classes from GitHub-Dark to make theme match GitHub-Dark
  581. document.querySelectorAll(".atwho-view").forEach(el => {
  582. el.classList.add(...["popover", "suggester"]);
  583. });
  584. }
  585.  
  586. // prevent reinitializing if user clicks in the input multiple times
  587. function init() {
  588. // build data for At.js
  589. let array;
  590. list.forEach(label => {
  591. array = [];
  592. Object.keys(filters[label]).forEach(key => {
  593. array.push({
  594. "name": key,
  595. "description": filters[label][key]
  596. });
  597. });
  598. // sort empty string to top
  599. data[label] = array.sort((a, b) => {
  600. if (a.name === "") {
  601. return -1;
  602. }
  603. return a.name > b.name ? 1 : -1;
  604. });
  605. });
  606.  
  607. document.querySelector("body").addEventListener("click", event => {
  608. const target = event.target;
  609. if (
  610. target.nodeName === "INPUT" &&
  611. target.matches(selectors)
  612. ) {
  613. $(selectors).atwho("destroy");
  614. addAtJs();
  615. }
  616. });
  617. // remove At.js before the page refreshes
  618. document.querySelector("body").addEventListener("pjax:start", event => {
  619. const target = event.target;
  620. if (target.nodeName === "INPUT" && target.matches(selectors)) {
  621. $(selectors).atwho("destroy");
  622. }
  623. });
  624. }
  625.  
  626. GM_addStyle(`
  627. .atwho-view { position:absolute; top:0; left:0; display:none;
  628. margin-top:18px; border:1px solid #ddd; border-radius:3px;
  629. box-shadow:0 0 5px rgba(0,0,0,0.1); max-height:225px; min-width:300px;
  630. max-width:none !important; overflow: auto; z-index: 11110 !important; }
  631. .atwho-view .cur { background:#36F; color:#fff; }
  632. .atwho-view .cur small { color:#fff; }
  633. .atwho-view strong { color:#36F; }
  634. .atwho-view .cur strong { color:#fff; font:bold; }
  635. .atwho-view ul { list-style:none; padding:0; margin:auto; max-height: 200px;
  636. overflow-y:auto; }
  637. .atwho-view ul li { display:block; padding:5px 10px;
  638. border-bottom: 1px solid #ddd; cursor:pointer; text-align:right; }
  639. .atwho-view small { font-size:smaller; color:#777; font-weight:normal; }
  640. .atwho-view .ghsa-key { font-style:normal; float:left; margin-right:10px;
  641. color:#111; }`
  642. );
  643.  
  644. init();
  645.  
  646. })(jQuery.noConflict(true));