lazy load comments, remove unused templates
This was really annoying to do. I followed the similar concept for infinite/endless scrolling so that it will load once it hits the viewport. To check if the user is within the viewport, I used the verge library which had a useful function to check if a certain element is in the viewport. Lots of trouble dealing with the comments loaded through AJAX as I figured out that since they are dynamically loaded, they dont acquire all the foundation javascript stuff that makes the modals, dropdowns, etc work. I really struggled to make that work and finally, I binded handlers on elements with classes 'dynamic' on a success() get() call and called document.foundation() again and they seem to be working fine. Screencasts on infinite scrolling: 'Basecamp: Infinite Scroll' by CodeSchool and 'Endless Page' from Railscast helped me get a foundation on how to do this. Cleaned up unused templates. Changed the 404 videos into a txt file.