Point.im Scripts

Подкраска своих постов, кликалка непрочитанных постов

目前为 2020-08-30 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Point.im Scripts
  3. // @version 2020.08.31
  4. // @description Подкраска своих постов, кликалка непрочитанных постов
  5. // @include http*://*.point.im/*
  6. // @icon https://www.google.com/s2/favicons?domain=point.im
  7. // @author Rainbow-Spike
  8. // @namespace https://greasyfork.org/users/7568
  9. // @homepage https://greasyfork.org/ru/users/7568-dr-yukon
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. var SelfPostMarker = 1,
  14. UnreadAutoClicker = 1,
  15. limit = 10,
  16. me = document.querySelector ( '#menu-profile' ),
  17. name = ( me != null ) ? me.href.replace ( /.*\/\/(.+)\.point\.im.*/i, "$1" ) : '-',
  18. link, comm;
  19.  
  20. if ( SelfPostMarker == 1 ) {
  21. document . querySelectorAll ( '#comments article.post' ) . forEach ( function ( e ) {
  22. link = ( e != null ) ? e . querySelector ( 'a' ) : '';
  23. comm = ( link != ( '' || null ) ) ? link . href . replace ( /.*\/\/(.+)\.point\.im.*/i, "$1" ) : '';
  24. e . style . cssText += ( comm == name ) ? 'border: 2px dashed #ccc; border-radius: 10px; margin: 0 -10px; padding: 10px 10px 0 10px;' : '';
  25. } )
  26. };
  27.  
  28. if (
  29. ( UnreadAutoClicker == 1 )
  30. &&
  31. ( window.location.href.match ( 'point.im/recent' ) != null )
  32. &&
  33. ( document . querySelector ( '.unread' ) . innerHTML > limit )
  34. ) document . querySelector ( '#older' ) . click ( );
  35.  
  36. document . querySelector ( '#header #new-post-label' ) . accessKey = 'w';
  37. document . querySelector ( '#new-post-wrap .buttons #new-post-hide-label' ) . accessKey = '0';
  38. document . querySelector ( '#new-post-wrap .buttons input[type="submit"]' ) . accessKey = 's';