Advertisement
Guest User

Untitled

a guest
Jan 8th, 2016
676
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Антиудалин для ЧатВдвоём
  3. // @description Скрипт оставляет ссылки на удалённые фотографии.
  4. // @author      noreply@2016mail.ml
  5. // @include     https://chatvdvoem.ru/*
  6. // @match       https://chatvdvoem.ru/*
  7. // @version     0.5
  8. // ==/UserScript==
  9.  
  10. var script = document.createElement("script");
  11. script.innerHTML = "\
  12. removeAllFiles = function(){\
  13.     $('.message[type=\"image\"]').each(function(){\
  14.         src=$(this).find(':first-child').attr('src');\
  15.         $(this).removeAttr(\"type\").removeAttr(\"ended\");\
  16.         $(this).css('color','#cccccc');\
  17.         $(this).html('<a href=\"'+src+'\" target=\"_blank\">'+src+'</a>');\
  18.     });\
  19. };\
  20. clearInterval(ImagesCheckTimer);\
  21. ImagesCheckTimer=setInterval(function(){\
  22.     $('.message[type=\"image\"]').each(function(){\
  23.         time=getCurrTime();\
  24.         ended=parseInt($(this).attr('ended'));\
  25.         diff=ended-time;\
  26.         if(diff<=0){\
  27.             src=$(this).find(':first-child').attr('src');\
  28.             $(this).removeAttr(\"type\").removeAttr(\"ended\");\
  29.             $(this).css('color','#cccccc');\
  30.             $(this).html('<a href=\"'+src+'\" target=\"_blank\">'+src+'</a>');\
  31.         }else{\
  32.             $(this).find('.image_timer').html(diff);\
  33.         }\
  34.     });\
  35. },500);";
  36. document.body.appendChild(script);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement