Twitter Settings sub-menu

Add sub-menu for Twitter settings for quick access.

  1. /* This program is free software. It comes without any warranty, to
  2. * the extent permitted by applicable law. You can redistribute it
  3. * and/or modify it under the terms of the Do What The Fuck You Want
  4. * To Public License, Version 2, as published by Sam Hocevar. See
  5. * http://www.wtfpl.net/ for more details. */
  6.  
  7. // ==UserScript==
  8. // @name Twitter Settings sub-menu
  9. // @namespace http://userscripts.org/users/12
  10. // @description Add sub-menu for Twitter settings for quick access.
  11. // @version 2.0
  12. // @author LouCypher
  13. // @license WTFPL http://www.wtfpl.net/
  14. // @resource license https://raw.github.com/LouCypher/userscripts/master/licenses/WTFPL/LICENSE.txt
  15. // @include http://twitter.com/*
  16. // @include https://twitter.com/*
  17. // @grant GM_addStyle
  18. // ==/UserScript==
  19.  
  20. (function() {
  21. var setting = document.querySelector('.dropdown-menu li > a.js-nav[data-nav="settings"]');
  22. if (!setting) return;
  23.  
  24. var text;
  25. var lang = document.documentElement.lang;
  26. switch (lang) {
  27. case "template":
  28. text = {
  29. account: "",
  30. password: "",
  31. devices: "",
  32. notifications: "",
  33. profile: "",
  34. design: "",
  35. applications: "",
  36. widgets: ""
  37. }
  38. break;
  39. case "ar": // العربية
  40. text = {
  41. account: "\u0627\u0644\u062D\u0633\u0627\u0628",
  42. password: "\u0643\u0644\u0645\u0629 \u0627\u0644\u0645\u0631\u0648\u0631",
  43. devices: "\u0627\u0644\u0647\u0627\u062A\u0641 \u0627\u0644\u0645\u062D\u0645\u0648\u0644",
  44. notifications: "\u062A\u0646\u0628\u064A\u0647\u0627\u062A \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",
  45. profile: "\u0627\u0644\u0645\u0644\u0641 \u0627\u0644\u0634\u062E\u0635\u064A",
  46. design: "\u0627\u0644\u062A\u0635\u0645\u064A\u0645",
  47. applications: "\u0627\u0644\u062A\u0637\u0628\u064A\u0642\u0627\u062A",
  48. widgets: "\u0627\u0644\u062A\u0637\u0628\u064A\u0642\u0627\u062A \u0627\u0644\u0645\u0635\u063A\u0651\u0631\u0629"
  49. }
  50. break;
  51. case "ca": // Català
  52. text = {
  53. account: "Account",
  54. password: "Password",
  55. devices: "M\u00F2bil",
  56. notifications: "Notificacions per correu electr\u00F2nic",
  57. profile: "Profile",
  58. design: "Design",
  59. applications: "Aplicacions",
  60. widgets: "Widgets"
  61. }
  62. break;
  63. case "cs": // Čeština
  64. text = {
  65. account: "\u00DA\u010Det",
  66. password: "Heslo",
  67. devices: "Mobil",
  68. notifications: "E-mailov\u00E9 upozorn\u011Bn\u00ED",
  69. profile: "Profil",
  70. design: "Vzhled",
  71. applications: "Aplikace",
  72. widgets: "Widgety"
  73. }
  74. break;
  75. case "da": // Dansk
  76. text = {
  77. account: "Konto",
  78. password: "Adgangskode",
  79. devices: "Mobil",
  80. notifications: "E-mail-meddelelser",
  81. profile: "Profil",
  82. design: "Design",
  83. applications: "Apps",
  84. widgets: "Widgets"
  85. }
  86. break;
  87. case "de": // Deutsch
  88. text = {
  89. account: "Account",
  90. password: "Passwort",
  91. devices: "Mobiltelefon",
  92. notifications: "E-Mail-Benachrichtigungen",
  93. profile: "Profil",
  94. design: "Design",
  95. applications: "Apps",
  96. widgets: "Widgets"
  97. }
  98. break;
  99. case "es": // Español
  100. text = {
  101. account: "Cuenta",
  102. password: "Contrase\u00F1a",
  103. devices: "M\u00F3vil",
  104. notifications: "Notificaciones por correo electr\u00F3nico",
  105. profile: "Perfil",
  106. design: "Dise\u00F1o",
  107. applications: "Aplicaciones",
  108. widgets: "Widgets"
  109. }
  110. break;
  111. case "eu": // Euskara
  112. text = {
  113. account: "Kontua",
  114. password: "Password",
  115. devices: "Mugikorra",
  116. notifications: "E-posta bidezko jakinarazpenak",
  117. profile: "Profila",
  118. design: "Diseinua",
  119. applications: "Aplikazioak",
  120. widgets: "Tresnak"
  121. }
  122. break;
  123. case "fa": // فارسی
  124. text = {
  125. account: "\u062D\u0633\u0627\u0628 \u06A9\u0627\u0631\u0628\u0631\u06CC",
  126. password: "\u06AF\u0630\u0631\u0648\u0627\u0698\u0647 - \u0631\u0645\u0632 \u0639\u0628\u0648\u0631",
  127. devices: "\u06AF\u0648\u0634\u06CC \u0647\u0645\u0631\u0627\u0647",
  128. notifications: "\u0622\u06AF\u0627\u0647\u200C\u0633\u0627\u0632\u06CC\u200C\u0647\u0627\u06CC \u0627\u06CC\u0645\u06CC\u0644\u06CC",
  129. profile: "\u0646\u0645\u0627\u06CC\u0647",
  130. design: "\u0637\u0631\u0627\u062D\u06CC",
  131. applications: "\u0628\u0631\u0646\u0627\u0645\u0647\u200C\u0647\u0627",
  132. widgets: "\u0627\u0628\u0632\u0627\u0631\u06A9\u200C\u0647\u0627"
  133. }
  134. break;
  135. case "fi": // Suomi
  136. text = {
  137. account: "Tili",
  138. password: "Salasana",
  139. devices: "Mobili",
  140. notifications: "S\u00E4hk\u00F6posti-ilmoitukset",
  141. profile: "Profili",
  142. design: "Ulkoasu",
  143. applications: "Sovellukset",
  144. widgets: "Pienoisohjelmat"
  145. }
  146. break;
  147. case "fil": // Filipino
  148. text = {
  149. account: "Account",
  150. password: "Password",
  151. devices: "Mobile",
  152. notifications: "Mga abiso sa email",
  153. profile: "Profile",
  154. design: "Disenyo",
  155. applications: "Mga App",
  156. widgets: "Mga Widget"
  157. }
  158. break;
  159. case "fr": // Français
  160. text = {
  161. account: "Compte",
  162. password: "Mot de passe",
  163. devices: "Mobile",
  164. notifications: "Notifications par email",
  165. profile: "Profil",
  166. design: "Th\u00E8me",
  167. applications: "Applications",
  168. widgets: "Widgets"
  169. }
  170. break;
  171. case "gl": // Galego
  172. text = {
  173. account: "Conta",
  174. password: "Contrasinal",
  175. devices: "M\u00F3bil",
  176. notifications: "Notificaci\u00F3ns por correo electr\u00F3nico",
  177. profile: "Profile",
  178. design: "Dese\u00F1o",
  179. applications: "Aplicaci\u00F3ns",
  180. widgets: "Widgets"
  181. }
  182. break;
  183. case "he": // עִבְרִית
  184. text = {
  185. account: "\u05D7\u05E9\u05D1\u05D5\u05DF",
  186. password: "\u05E1\u05E1\u05DE\u05D4",
  187. devices: "\u05D8\u05DC\u05E4\u05D5\u05DF \u05E0\u05D9\u05D9\u05D3",
  188. notifications: "\u05D4\u05EA\u05E8\u05E2\u05D5\u05EA \u05D1\u05D3\u05D5\u05D0\u05F4\u05DC",
  189. profile: "\u05E4\u05E8\u05D5\u05E4\u05D9\u05DC",
  190. design: "\u05E2\u05D9\u05E6\u05D5\u05D1",
  191. applications: "\u05D9\u05D9\u05E9\u05D5\u05DE\u05D9\u05DD",
  192. widgets: "\u05D5\u05D9\u05D3\u05D2\u05F3\u05D8\u05D9\u05DD"
  193. }
  194. break;
  195. case "hi": // हिन्दी
  196. text = {
  197. account: "\u0916\u093E\u0924\u093E",
  198. password: "\u092A\u093E\u0938\u0935\u0930\u094D\u0921",
  199. devices: "\u092E\u094B\u092C\u093E\u0907\u0932",
  200. notifications: "\u0908\u092E\u0947\u0932 \u0905\u0927\u093F\u0938\u0942\u091A\u0928\u093E\u090F\u0902",
  201. profile: "\u092A\u094D\u0930\u094B\u092B\u093C\u093E\u0907\u0932",
  202. design: "\u0921\u093F\u091C\u093C\u093E\u0907\u0928",
  203. applications: "\u090F\u092A\u094D\u092A\u094D\u0938",
  204. widgets: "\u0935\u093F\u091C\u0947\u091F\u094D\u0938"
  205. }
  206. break;
  207. case "hu": // Magyar
  208. text = {
  209. account: "Fi\u00F3k",
  210. password: "Jelsz\u00F3",
  211. devices: "Mobil",
  212. notifications: "E-mail \u00E9rtes\u00EDt\u00E9sek",
  213. profile: "Profil",
  214. design: "Kin\u00E9zet",
  215. applications: "Alkalmaz\u00E1sok",
  216. widgets: "Modulok"
  217. }
  218. break;
  219. case "id": // Bahasa Indonesia
  220. text = {
  221. account: "Akun",
  222. password: "Kata sandi",
  223. devices: "Ponsel",
  224. notifications: "Notifikasi email",
  225. profile: "Profil",
  226. design: "Desain",
  227. applications: "Applikasi",
  228. widgets: "Widget"
  229. }
  230. break;
  231. case "it": // Italiano
  232. text = {
  233. account: "Account",
  234. password: "Password",
  235. devices: "Cellulare",
  236. notifications: "Notifiche email",
  237. profile: "Profilo",
  238. design: "Aspetto",
  239. applications: "Applicazioni",
  240. widgets: "Widget"
  241. }
  242. break;
  243. case "ja": // 日本語
  244. text = {
  245. account: "\u30E6\u30FC\u30B6\u30FC\u60C5\u5831",
  246. password: "\u30D1\u30B9\u30EF\u30FC\u30C9",
  247. devices: "\u30E2\u30D0\u30A4\u30EB",
  248. notifications: "\u30E1\u30FC\u30EB\u901A\u77E5",
  249. profile: "\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB",
  250. design: "\u30C7\u30B6\u30A4\u30F3",
  251. applications: "\u30A2\u30D7\u30EA\u9023\u643A",
  252. widgets: "\u30A6\u30A3\u30B8\u30A7\u30C3\u30C8"
  253. }
  254. break;
  255. case "ko": // 한국어
  256. text = {
  257. account: "\uACC4\uC815",
  258. password: "\uBE44\uBC00\uBC88\uD638",
  259. devices: "\uBAA8\uBC14\uC77C",
  260. notifications: "\uC774\uBA54\uC77C \uC54C\uB9BC",
  261. profile: "\uD504\uB85C\uD544",
  262. design: "\uB514\uC790\uC778",
  263. applications: "\uC560\uD50C\uB9AC\uCF00\uC774\uC158",
  264. widgets: "\uC704\uC82F"
  265. }
  266. break;
  267. case "msa": // Bahasa Melayu
  268. text = {
  269. account: "Akaun",
  270. password: "Kata laluan",
  271. devices: "Mudah alih",
  272. notifications: "E-mel pemberitahuan",
  273. profile: "Profil",
  274. design: "Reka Bentuk",
  275. applications: "Aplikasi",
  276. widgets: "Widget"
  277. }
  278. break;
  279. case "pl": // Polski
  280. text = {
  281. account: "Konto",
  282. password: "Has\u0142o",
  283. devices: "Telefon kom\u00F3rkowy",
  284. notifications: "Powiadomienia e-mail",
  285. profile: "Profil",
  286. design: "Wygl\u0105d",
  287. applications: "Aplikacje",
  288. widgets: "Wid\u017Cety"
  289. }
  290. break;
  291. case "nl": // Nederlands
  292. text = {
  293. account: "Account",
  294. password: "Wachtwoord",
  295. devices: "Mobiel",
  296. notifications: "E-mailmeldingen",
  297. profile: "Profiel",
  298. design: "Ontwerp",
  299. applications: "Applicaties",
  300. widgets: "Widgets"
  301. }
  302. break;
  303. case "ro": // Română
  304. text = {
  305. account: "Account",
  306. password: "Parol\u0103",
  307. devices: "Mobil",
  308. notifications: "Notific\u0103ri prin email",
  309. profile: "Profil",
  310. design: "Design",
  311. applications: "Aplica\u0163ii",
  312. widgets: "Widgets"
  313. }
  314. break;
  315. case "ru": // Русский
  316. text = {
  317. account: "\u0423\u0447\u0451\u0442\u043D\u0430\u044F \u0437\u0430\u043F\u0438\u0441\u044C",
  318. password: "\u041F\u0430\u0440\u043E\u043B\u044C",
  319. devices: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D",
  320. notifications: "\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435",
  321. profile: "\u041F\u0440\u043E\u0444\u0438\u043B\u044C",
  322. design: "\u041E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435",
  323. applications: "\u041F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F",
  324. widgets: "\u0412\u0438\u0434\u0436\u0435\u0442\u044B"
  325. }
  326. break;
  327. case "tr": // Türkçe
  328. text = {
  329. account: "Hesap",
  330. password: "\u015Eifre",
  331. devices: "Mobil",
  332. notifications: "E-posta bildirimleri",
  333. profile: "Profil",
  334. design: "Tasar\u0131m",
  335. applications: "Uygulamalar",
  336. widgets: "Bile\u015Fenler"
  337. }
  338. break;
  339. case "uk": // Українська мова
  340. text = {
  341. account: "Account",
  342. password: "\u041F\u0430\u0440\u043E\u043B\u044C",
  343. devices: "\u041C\u043E\u0431\u0456\u043B\u044C\u043D\u0438\u0439",
  344. notifications: "\u0421\u043F\u043E\u0432\u0456\u0449\u0435\u043D\u043D\u044F \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u044E \u043F\u043E\u0448\u0442\u043E\u044E",
  345. profile: "\u041F\u0440\u043E\u0444\u0456\u043B\u044C",
  346. design: "\u041E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u043D\u044F",
  347. applications: "\u0414\u043E\u0434\u0430\u0442\u043A\u0438",
  348. widgets: "\u0412\u0456\u0434\u0436\u0435\u0442\u0438"
  349. }
  350. break;
  351. case "xx-lc": // LOLCATZ
  352. text = {
  353. account: "Account",
  354. password: "PASSWORD",
  355. devices: "MOBILE. KTHXBYE!",
  356. notifications: "EMAIL NOTIFICASHUNS",
  357. profile: "PROFILE",
  358. design: "DESIGN",
  359. applications: "APPS",
  360. widgets: "Widgets"
  361. }
  362. break;
  363. case "zh-cn": // 简体中文
  364. text = {
  365. account: "\u8D26\u53F7",
  366. password: "\u5BC6\u7801",
  367. devices: "\u79FB\u52A8\u8BBE\u5907",
  368. notifications: "\u7535\u5B50\u90AE\u4EF6\u901A\u77E5",
  369. profile: "\u4E2A\u4EBA\u8D44\u6599",
  370. design: "\u4E3B\u9898",
  371. applications: "\u5E94\u7528",
  372. widgets: "\u5C0F\u5DE5\u5177"
  373. }
  374. break;
  375. case "zh-tw": // 繁體中文
  376. text = {
  377. account: "\u5E33\u6236",
  378. password: "\u5BC6\u78BC",
  379. devices: "\u884C\u52D5\u96FB\u8A71",
  380. notifications: "\u96FB\u5B50\u90F5\u4EF6\u901A\u77E5",
  381. profile: "\u500B\u4EBA\u6A94\u6848",
  382. design: "\u8A2D\u8A08",
  383. applications: "\u61C9\u7528\u7A0B\u5F0F",
  384. widgets: "\u5C0F\u5DE5\u5177"
  385. }
  386. break;
  387. default: // English
  388. text = {
  389. account: "Account",
  390. password: "Password",
  391. devices: "Mobile",
  392. notifications: "Email notifications",
  393. profile: "Profile",
  394. design: "Design",
  395. applications: "Apps",
  396. widgets: "Widgets"
  397. }
  398. }
  399.  
  400. var submenu = setting.parentNode.insertBefore(document.createElement("ul"), setting);
  401. submenu.id = "sub-menu";
  402. submenu.className = "dropdown-menu";
  403. submenu.innerHTML = '<li><a data-nav="settings" href="/settings/account">'
  404. + text.account + '</a></li>'
  405. + '<li><a data-nav="settings" href="/settings/password">'
  406. + text.password + '</a></li>'
  407. + '<li><a data-nav="settings" href="/settings/devices">'
  408. + text.devices + '</a></li>'
  409. + '<li><a data-nav="settings" href="/settings/notifications">'
  410. + text.notifications + '</a></li>'
  411. + '<li><a data-nav="settings" href="/settings/profile">'
  412. + text.profile + '</a></li>'
  413. + '<li><a data-nav="settings" href="/settings/design">'
  414. + text.design + '</a></li>'
  415. + '<li><a data-nav="settings" href="/settings/applications">'
  416. + text.applications + '</a></li>'
  417. + '<li><a data-nav="settings" href="/settings/widgets">'
  418. + text.widgets + '</a></li>';
  419.  
  420. var css = "#sub-menu {\n\
  421. display: none;\n\
  422. min-width: 237px;\n\
  423. background-color: white;\n\
  424. position: absolute;\n\
  425. margin: -2.3em " + (document.body.dir == "rtl" ? "0 0 -227px" : "-227px 0 0") + ";\n\
  426. padding: .5em 0;\n\
  427. }\n\
  428. li:hover > #sub-menu { display: block; }";
  429.  
  430. if (typeof GM_addStyle === "function") return GM_addStyle(css);
  431. var style = document.head.appendChild(document.createElement("style"));
  432. style.type = "text/css";
  433. style.textContent = css;
  434. })()

QingJ © 2025

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