Closed geoFlux closed 4 years ago
I can give it a shot. I'm new to Swift but it looks pretty straightforward.
Is that JS from somewhere or did you write it yourself?
It's based off the javascript from the forums. But I pretty much completely rewrote it. You can find it here: https://forums.somethingawful.com/js/vb/forums.combined.js?1476414202. If you prettify that, and search for imgur
I moved everything but the gyfcat code into swift. The code for gyfcat has to make an api call, and I don't know of a good way to make the swift code async.
Yep that's fair enough re: gfycat, that's the setup we do for tweets. Thanks so much!
Hey @geoFlux, appreciate it!
Historically I've done these kinds of transformations on the Swift side, in https://github.com/Awful/Awful.app/blob/1c3aef7bd83eb0ca466222e916c050aba1efd8d4/App/Misc/HTMLRenderingHelpers.swift. It makes life a bit easier when we (re-)render posts outside of the initial page load, e.g. because the user wants to see an ignored post.
Any interest in porting this over to HTMLRenderingHelpers.swift? I'm happy to help. Especially since I took so long to reply to you in #861 and didn't point you towards there sooner.