Image loading enhancement
-
PR submitted:
The goal was to reduce jellypotato when scrolling down a thread, where images don't get loaded until they become visible. Only images above where you're viewing don't get loaded until they come into view.
-
@izzion said in How can this be so wrong??? (AKA the Discopocalypse thread):
That emoji sequence looks like the results of a pull request
@boomzilla said in Image loading enhancement:
PR submitted
-
@boomzilla said in Image loading enhancement:
The goal was to reduce jellypotato when scrolling down a thread, where images don't get loaded until they become visible. Only images above where you're viewing don't get loaded until they come into view.
So will this mean I don't need my "unfuck image loading" userscript-- which amongst other things shuts off the fucking "on demand" fuckery?
// ==UserScript== // @name tdwtf forum - unfuck image loading // @namespace Lorne // @include https://what.thedailywtf.com/topic/* // @version 1 // @grant none // @runat document-end // ==/UserScript== var $ = unsafeWindow.jQuery; $(document).ready(function() { var $ = unsafeWindow.jQuery; $(window).on('action:topic.loaded', function(event, data) { // image load hook $("img").load(function(e) { DoStupidScroll(); }); }); LoadImagesForce(); }); function DoStupidScroll() { var $ = unsafeWindow.jQuery; var $hl = $(".highlight"); if($hl.length > 0) { $('html, body').animate({scrollTop: $hl.offset().top}, 100); } else { setTimeout(DoStupidScroll, 500); } } function LoadImagesForce() { var $ = unsafeWindow.jQuery; var $imgs = $(".img-responsive"); $imgs.each(function() { var $ = unsafeWindow.jQuery; var $this = $(this); if($this.attr("src")=="about:blank") { $this.data("state", "loaded"); $this.attr("data-state", "loaded"); $this.attr("src", $this.data("src")); } }); setTimeout(LoadImagesForce, 2000); }
-
@boomzilla said in Image loading enhancement:
PR submitted
-
@ben_lubar Eh, crap. I guess I didn't set up my git username and stuff on there. I'll try to re-do that this weekend.
-
Does this also solve the unloading of images above the viewport that cause the messages to jump up so that you lose your place in the thread?
-
@Lorne-Kates said in Image loading enhancement:
So will this mean I don't need my "unfuck image loading" userscript-- which amongst other things shuts off the fucking "on demand" fuckery?
Did you try turning off the profile option to delay image loading?
-
@Jaloopa said in Image loading enhancement:
@Lorne-Kates said in Image loading enhancement:
So will this mean I don't need my "unfuck image loading" userscript-- which amongst other things shuts off the fucking "on demand" fuckery?
Did you try turning off the profile option to delay image loading?
I got excited for a second and then realised that that option doesn't fix jank :(
-
@bb36e
Ah, a technical users forum -- where everyone shows their over a pull request for a cool new feature.