new Better WebQQ

使得WebQQ更方便使用更清爽: 自动打开登录(不可用)窗口, 自动设置桌面提示通知和使用SSL, 移除侧边栏, 移除浮动条, 移除添加按钮

当前为 2014-05-17 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name new Better WebQQ
  3. // @version 1.3
  4. // @description 使得WebQQ更方便使用更清爽: 自动打开登录(不可用)窗口, 自动设置桌面提示通知和使用SSL, 移除侧边栏, 移除浮动条, 移除添加按钮
  5. // @description 此版向原作代码中添加了我(Oaker)针对WebQQ自定的CSS样式,并整合“Web QQ Qun Search Bar”,在聊天窗口右侧添加群成员搜索框
  6. // @description 注意原作者(s2mairne)新版为1.4,已去除“自动打开登陆窗口”,链接:http://userscripts.org/scripts/show/140232
  7. // @include http://web.qq.com/webqq.html
  8. // @include http://web2.qq.com/webqq.html
  9. // @namespace https://gf.qytechs.cn/users/1397
  10. // ==/UserScript==
  11. function removeAllIDontWant(){
  12. var s = document.createElement('style');
  13. s.id = 'BetterWebQQStyle';
  14. s.innerHTML = '.dock_middle{opacity:.2!important}.indicator_wrapper{display:none!important}.EQQ_BuddyList_Nick,.EQQ_BuddyList_Sign,.EQQ_GroupList_Bulletin{padding-top:10px!important}img.EQQ_BuddyList_Avatar{padding:0!important}#EQQ_LoginSuccess{font-size:16px!important}.eqq_window .window_bg_container{border:none!important;background-image:none!important}.eqq_window .window_bg_container,.EQQ_tab,.EQQ_ListBottom{background-color:#d4d4d4!important}.EQQ_tab .current{background:#f5f5f5!important}.EQQ_buddyListPanel,.EQQ_groupTab,.EQQ_groupListOuter,.EQQ_recentListPanel{background-color:#f5f5f5!important}.EQQ_tab{height:28px!important}.EQQ_List_BigHead .EQQ_BuddyList_Buddy,.EQQ_List_BigHead .EQQ_GroupList_Group{padding:0!important;height:32px!important}.EQQ_BuddyList_Sign,.chatBox_announcementArea,.EQQ_BuddyList_Sign,.EQQ_GroupList_Bulletin,.chatLogTips{display:none!important}.EQQ_listClassBody,.EQQ_BuddyList_Buddy,.EQQ_GroupList_Group{border-bottom:1px solid #cecece!important;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.08)!important}.EQQ_List_BigHead .EQQ_BuddyList_AvatarContainer,.EQQ_List_BigHead .EQQ_GroupList_AvatarContainer{height:32px!important;width:32px!important}.EQQ_tabBuddyList_icon,.EQQ_tabGroupList_icon,.EQQ_tabRecentList_icon{background:none!important}.chatBox_groupMember_searchBar,.chatBox_groupMember_mainArea{background:#f0f0f0!important}.chatBox_mainArea{background-color:#f5f5f5!important}.chatBox_toolBar,.chatBox_controlPanel,.chatBox_toolBar_top,.chatBox_sideBar2{background-color:#d4d4d4!important}.chatLogMain{top:26px!important}';
  15. document.querySelector('head').appendChild(s);
  16. }
  17. function setMySetting(){
  18. unsafeWindow.alloy.config.setPortalConfig('notifySetting', 15);
  19. unsafeWindow.alloy.config.setHttpsSetting(1);
  20. }
  21. function showLogin(){
  22. eqqId = unsafeWindow.alloy.config.__eqqid;
  23. while (true){
  24. if (unsafeWindow.alloy.portal.isPortalReady()){
  25. break;
  26. }
  27. }
  28. unsafeWindow.alloy.portal.setLoginLevel(1);
  29. unsafeWindow.alloy.portal.runApp(eqqId);
  30. }
  31. function waitForReady(){
  32. if (unsafeWindow.alloy.portal.isPortalReady()){
  33. showLogin();
  34. setMySetting();
  35. }
  36. else{
  37. setTimeout(waitForReady, 1000);
  38. }
  39. }
  40. waitForReady();
  41. removeAllIDontWant();
  42. //为群添加搜索框,原脚本地址 http://userscripts.org/scripts/source/140941.user.js
  43. var PLACEHOLDER = '搜索成员……';
  44. var addStyle = function () {
  45. var s = document.createElement('style');
  46. s.innerHTML = [
  47. '.chatBox_groupMember_mainArea { top: 40px !important; }',
  48. '.chatBox_groupMember_searchBar ',
  49. '{ border: 0 none; height: 18px; padding: 1px 0; width: 100%; ',
  50. 'background: #E8F6FB; }'
  51. ].join('');
  52. document.querySelector('head').appendChild(s);
  53. };
  54. var addSearchBar = function () {
  55. var rl = document.querySelectorAll('.chatBox_groupMember'), i;
  56. for (i = 0; i < rl.length; i++)
  57. if (!rl[i].querySelector('.chatBox_groupMember_searchBar'))
  58. ((function (id) {
  59. console.log("!");
  60. var s = document.createElement('div');
  61. var l = document.querySelector('#chatBox_groupMember_' + id);
  62. s.innerHTML = [
  63. '<input class="chatBox_groupMember_searchBar" ',
  64. 'id="chatBox_groupMember_searchBar_', id, '" ',
  65. 'placeholder="', PLACEHOLDER, '"',
  66. '/>',
  67. ].join('');
  68. s = s.firstChild;
  69. var f = function () {
  70. var text = document
  71. .querySelector('#chatBox_groupMember_searchBar_' + id).value;
  72. var list = document
  73. .querySelectorAll('#chatBox_groupMember_mainArea_' + id +
  74. ' div[uin]');
  75. console.log(list.length);
  76. console.log(text);
  77. var name, nick;
  78. for (i = 0; i < list.length; i++) {
  79. name = list[i].querySelector('.chatBox_groupMember_nameArea').title;
  80. nick = list[i].querySelector('.chatBox_groupMember_nick').innerHTML;
  81. if (name.indexOf(text) !== -1 || nick.indexOf(text) !== -1)
  82. list[i].style.display = 'block';
  83. else list[i].style.display = 'none';
  84. }
  85. };
  86. s.addEventListener('change', f);
  87. s.addEventListener('keyup', f);
  88. s.addEventListener('keypress', f);
  89. s.addEventListener('keydown', f);
  90. l.insertBefore(s, l.querySelector('.chatBox_groupMember_mainArea'));
  91. })(Number(rl[i].id.replace(/[^0-9]*/g, ''))));
  92. }
  93. addStyle();
  94. setInterval(function () {
  95. addSearchBar();
  96. }, 10);

QingJ © 2025

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