Point.im Scripts

Подкраска своих постов + автоклик непрочитанных + горячие клавиши

  1. // ==UserScript==
  2. // @name Point.im Scripts
  3. // @version 2023.08.09
  4. // @description Подкраска своих постов + автоклик непрочитанных + горячие клавиши
  5. // @match 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: -1px -2px -1px -9px; padding: 4px 2px 4px 7px;' : '';
  25. } );
  26. }
  27.  
  28. if (
  29. ( UnreadAutoClicker == 1 ) &&
  30. ( window . location . href . match ( 'point.im/recent/unread' ) != null ) &&
  31. ( document . querySelector ( '.unread' ) . innerHTML * 1 > limit )
  32. ) document . querySelector ( '#older' ) . click ( );
  33.  
  34. document . querySelector ( '#header #new-post-label' ) . accessKey = 'w'; /* "Написать", акцесскей W */
  35. document . querySelector ( '#new-post-wrap .buttons #new-post-hide-label' ) . accessKey = '0'; /* "Отмена", акцесскей 0 */
  36. document . querySelector ( '#new-post-wrap .buttons input[type="submit"]' ) . accessKey = 's'; /* "Сохранить", акцесскей S */