11 Commits (06f85d6fffc19f7c3f39aaf433c1dab1d6e37b1a)

Author SHA1 Message Date
Julian Lam 1d1639d46f fix: improper neutralization of user input in image wrapping code 2 years ago
Barış Soner Uşaklı d8d486a633 fix: closes #11613, closes #11614
don't add input listener on every send message
2 years ago
gasoved b0a24d6dd5
refactor: var to const and let (#9885)
* refactor: var to const and let

* fix: missed global bootbox usage

* refactor: align with eslint expectations
4 years ago
Julian Lam 040e6a9a4c fix: reverse tabnabbing exploit in post images 5 years ago
Peter Jaszkowiak ba619c7ec8 style(eslint): match operator-linebreak preferences 6 years ago
Julian Lam 98c14e0e68 fix: removal of scroll anchoring code in favour of browser handling
closes #6150
6 years ago
Stjepan Osojnički 9b491e4c2e Add post images hook (#5828)
* Add post images hook

This hook would allow plugins to manipulate images inside posts  after images are manipulated by nodebb (for example, delay loading). Without this hook we can manipulate images by searching post data for them and manipulate that data, but any change on that level is either erased by nodebb once image loading starts (if delay is turned on) or it disables native image behaviour by changing image code so native behaviour is not triggered.
Hook at this place works for both delayed loading turned on and off.
Usage for this kind of hook was talked about here: https://community.nodebb.org/topic/10960/opening-uploaded-images-in-modal-windows

* trying to fix Travis error

* Update images.js

Hook moved out of wrapImagesInLinks function to places where images are actually loaded. One of the places is inside unloadImage function but in place where loading is happening because of failed if check (delayImageLoading not se in users configuration).
8 years ago
Barış Soner Uşaklı 2f3aceb7d3 dont do anything if config is off 8 years ago
Julian Lam 6060b8e13b fix tests 8 years ago
Aziz Khoury 6682e048ea wrapImagesInLinks with <a download> attribute
if the `src` of the `img` does not have an extension, most browsers will trigger a download with whatever filename is set, also without an extension, so when it's opened in any OS, it wont have a default application to open it with.

So, In this case, if the `alt` attribute has an extension (meaning if it looks like filename) - we use that with the html5 [`download` attr](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download)

The PR does not affect any src if they have an extension.
8 years ago
barisusakli 5ca8456340 move image code to client/topic/images 8 years ago