TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Page 1 of 2 12 LastLast
Results 1 to 25 of 29

Thread: Image cuts?

  1. #1
    Member
    Registered: Aug 2002
    Location: Maupertuis

    Image cuts?

    Hey all. Is there a way to post images so that they only become visible when their text description is clicked on? I'd like something that works the way Livejournal cuts did back in the day. I have a bunch of images to post, so I don't want to post them raw.

  2. #2
    Member
    Registered: Sep 2002
    Location: I think I've been here
    Quote Originally Posted by Anarchic Fox View Post
    Hey all. Is there a way to post images so that they only become visible when their text description is clicked on?

  3. #3
    Member
    Registered: Aug 2002
    Location: Maupertuis
    I meant a way that doesn't involve external links. So that clicking simply shows an image, rather than loading a new page.

  4. #4
    Member
    Registered: Sep 2002
    Location: I think I've been here
    <a onclick="(function(e){let p=e.nextSibling;if (p.style.display=='none')p.style.display='block';else p.style.display='none'})(this)">A picture of a hare in an overcoat</a><img src="https://i.imgur.com/RXxsyDa.jpg" ********"this.style.display='none'" />

    You'll have to quote this post to see what I did. Just replace the image description and the image link to make your own image toggle-able.
    This may not work forever, since it exploits a security hole in TTLG forum software. On the other hand it has been this way for some 15 years.
    Note that the image is loaded before the user clicks, so don't post a load of huge images this way.

    @Al_B: While script tags and style tags are replaced, onclick onload and onchange attributes are not. This allows running arbitrary JS on the site.
    Last edited by Kolya; 14th Jun 2020 at 13:02.

  5. #5
    Member
    Registered: Aug 2002
    Location: Maupertuis
    Er, if this requires exploiting a security hole, I'll just use links. Thanks for the help.

  6. #6
    Administrator
    Registered: Oct 2000
    Location: Athens of the North
    Yeah, probably shouldn't allow that! (now disabled). I've added a new bbcode to allow you to do the same thing, however, called imghide instead of img. Use in the form [ imghide=Title text]<image url>[/imghide] or simply [ imghide]<imageurl>[/imghide] (remove the space at the start of the "[" when using it yourself). That way you'll get the following using Kolya's earlier examples:

    A picture of 3 neon colored chewbaccas posing with matching guns
    A picture of a hare in an overcoat
    A picture of two young potted banana plants

  7. #7
    Member
    Registered: Aug 2002
    Location: Maupertuis
    Thanks! That's exactly what I was looking for.

  8. #8
    Member
    Registered: May 2004
    Quote Originally Posted by Al_B View Post
    Yeah, probably shouldn't allow that! (now disabled).
    Test: <img src="https://i.imgur.com/hC4sDTX.png" width="600">

    Hmm... I guess that also means no resizing images or embedding videos with html :/

  9. #9
    Administrator
    Registered: Oct 2000
    Location: Athens of the North
    Nope, sorry.

  10. #10
    ZylonBane
    Registered: Sep 2000
    Location: ZylonBane
    How is this different from just posting a link using the URL tag?

    A picture of 3 neon colored chewbaccas posing with matching guns

  11. #11
    Administrator
    Registered: Oct 2000
    Location: Athens of the North
    Should be clearer now - I'd added a censorship option and that had inadvertently broken the behaviour.

  12. #12
    ZylonBane
    Registered: Sep 2000
    Location: ZylonBane
    Ah, I see. So does this do lazy loading, or does it let someone grind page load to a halt by spamming the forums with dozens of hidden images?

  13. #13
    Administrator
    Registered: Oct 2000
    Location: Athens of the North
    No lazy loading but if someone posts loads of images that way then they'll earn a slap.

  14. #14
    Member
    Registered: Mar 2001
    Location: Ireland
    I notice that there's not actually any way to differentiate between a normal link and an expanding image.

  15. #15
    Member
    Registered: Sep 2002
    Location: I think I've been here
    Lazy loading could work by exchanging the src attribute:
    Code:
    <a href="https://i.imgur.com/Wk6DTCn.jpg" style="display:block" onclick="(function(e){let el=e.nextSibling;if(el.hasAttribute('src'))el.removeAttribute('src');else el.setAttribute('src',el.getAttribute('data-src'))})(this);return false;">Unreliable reader</a><img data-src="https://i.imgur.com/Wk6DTCn.jpg">
    jsfiddle: https://jsfiddle.net/KolyaKorruptis/uz3a0q4r/8/

  16. #16
    Member
    Registered: Sep 2002
    Location: I think I've been here
    @Nameless Voice It would be easy enough to style the link, but why would you need to know that?

  17. #17
    Member
    Registered: Apr 2002
    Location: Third grave from left.
    Because one should never assume that clicking a link opens a new tab - i, for one, just discovered that TTLG does that for the first time ever. I always open any and all links in new tab manually (for consistency/sanity with every other darn site on the internet - you cannot assume "open in new page" behavior is default everywhere). That makes the behavior of the new link completely indistinguishable from the old - making it completely pointless. Which i would call a critical fault of even having it.

  18. #18
    Member
    Registered: Sep 2002
    Location: I think I've been here
    Anarchic Fox asked for image links that open inline. That as is a valid request and not made pointless by your minor inconvenience of not being able to force them into a new tab right now.

    These links can easily be made recognisable. Or they could possibly support opening in a new tab, when pressing Ctrl while clicking (which I assume you do). Anyway, give it some time and don't slam it as pointless right away just because it doesn't fit your particular use case.

  19. #19
    Member
    Registered: May 2004
    You could manually write an instruction before the links. Otherwise, yeah, they'd be completely pointless for people who are used to opening links with the middle click.

  20. #20
    Member
    Registered: Sep 2002
    Location: I think I've been here
    You seem a bit stuck on this being a link and your expectation of how a link should work. Think of them as buttons that load an inline image. Because with a little bit of styling, that's what they are.
    Basically it's an interactive element. And it isn't pointless, just because it doesn't work like something else.

  21. #21
    Member
    Registered: Jun 2003
    Location: Darmstadt, Germany
    The problem is that it looks like a link, so people expect it to behave like one (and thus automatically middle-click it so it doesn't open in the same tab like some links on the internet do).

    Having the functionality is nice and most of us "middle-clickers" (who ISN'T one nowadays anyway?) would like to make use of it, but we just can't risk the "link" being an actual link and doing what we don't want it to do.

    So yeah, as Starker, NV and zombe and you already mentioned, it would be better if the styling is changed so no confusion is possible. Any while at it, maybe add a button in the message editor next to the normal insert-picture one, if it's not too much work.

  22. #22
    Administrator
    Registered: Oct 2000
    Location: Athens of the North
    I'll look to change the styling when I get a chance - it was a proof of concept more than anything else. I agree that having them indistinguishable from normal links isn't ideal and if they're going to be more useful than one or two posts then they merit a bit more attention.

  23. #23
    Member
    Registered: Apr 2002
    Location: Third grave from left.
    Quote Originally Posted by Kolya View Post
    Anarchic Fox asked for image links that open inline. That as is a valid request and not made pointless by your minor inconvenience of not being able to force them into a new tab right now.

    These links can easily be made recognisable. Or they could possibly support opening in a new tab, when pressing Ctrl while clicking (which I assume you do). Anyway, give it some time and don't slam it as pointless right away just because it doesn't fit your particular use case.
    I presume holding Ctrl normally would force them to open in new tab/window ... that was news to me (ie. i never use that nor have i ever used it). In that light you might realize that there literally is no perceivable difference between the link types - making it, indeed, pointless. My assessment stands. A visual distinction is a must.

  24. #24
    Member
    Registered: Mar 2001
    Location: Ireland
    Quote Originally Posted by dj_ivocha View Post
    Having the functionality is nice and most of us "middle-clickers" (who ISN'T one nowadays anyway?) would like to make use of it, but we just can't risk the "link" being an actual link and doing what we don't want it to do.
    I'm not, my middle mouse button is acting up!
    More seriously, most sites I visit open external links in new tabs, so I rarely bother using the middle-mouse.


    Middle-clicking on them does work just fine, it opens the image in a new tab as expected.
    Ctrl-clicking doesn't work, though. Do many people use that?

  25. #25
    Member
    Registered: Sep 2002
    Location: I think I've been here
    I use ctrl-clicks. But that doesn't matter. If I get this correctly some people here always use middle clicks on links which still opens these images in new tabs. (Middle clicking links does nothing for me, so please excuse me.) And that's what makes this feature pointless to you.

    But if you use middle click to force links to open in a new tab and they do...isn't that what you wanted? Yes, the feature is then useless to you. But what do you expect? Should your middle-clicking be ignored (if that was even possible) and the image opened inline for you, despite your clear signal of intent to open it in a new tab? And why should this feature be specially marked up for you, if you're ignoring how the website wants to open a link by forcing new tabs through middle clicks? So you can not ignore it for once and enjoy inline images? How about you just stop forcing new tabs on TTLG where external links open in new tabs anyway, just like most of the web?
    Last edited by Kolya; 19th Jun 2020 at 13:03.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •