Better kontaktbazar.at posts

Expand images in posts - 6/20/2021, 6:05:09 AM

  1. // ==UserScript==
  2. // @name Better kontaktbazar.at posts
  3. // @namespace Violentmonkey Scripts
  4. // @match https://www.kontaktbazar.at/kbaz-details.php
  5. // @grant none
  6. // @version 1.0
  7. // @author -
  8. // @description Expand images in posts - 6/20/2021, 6:05:09 AM
  9. // ==/UserScript==
  10. $("td.eintragFooter").ready(function () {
  11. main_src = $("tr.eintragMain > td.eintragFoto > img").attr("src")
  12. // alert(main_src)
  13. images_onmouseover = $("td.eintragFooter td.eintragFoto > img.startbild").map((i, el) => el.getAttribute('onmouseover')).get()
  14. images_src = images_onmouseover.map(function (x) {
  15. /*
  16. the onmouseover is of the format:
  17. return overlib('<img src=/fotos/1234/1234_uf2_06-21.jpg height=450 \>',CAPTION,'',FGCOLOR,'#efefef',BGCOLOR,'#4b4b4b',CAPCOLOR,'#ffffff',VAUTO,HAUTO);
  18. */
  19. matches = x.match(/overlib\('<img src=(\/fotos\/[^ ]+)/)
  20. if (matches !== null && matches[1]) {
  21. return matches[1]
  22. }
  23. return null
  24. }).filter(x => x !== null)
  25. images_src.unshift(main_src)
  26. $("table.eintragFooter > tbody").append($('<tr>').append($('<td>').attr('id', 'largeImages').attr('class', 'eintragFooter').append($('<br>'))))
  27. images_src.map(function(i) {
  28. $("td#largeImages").append($('<br>')).append($('<br>')).append($('<img>').attr('src', i))
  29. })
  30. })