What is the best way to inject JavaScript code?


I have my site up again and I am running the latest and greatest (version I have re-added a working example that you can inspect. I added it to the admin section under settings, content, (and this time) top of the page.

I have code on github here.

Warning: Do not add the CDN script call for jQuery (line 1) it will break your discourse instance. Everything else will translate using the native discourse jQuery script.

(Manthan Mallikarjun) #23

I just viewed your code, and im having a little bit of trouble understanding it. I dont see any part of your code which waits for ember to finish loading the posts.

@sam Do you know which function/method that is called for loading posts? I have no idea on how to phrase this since I dont know much ember. In other words, whats the equivalent of this: Discourse.TopicView.reopen but for loading the posts?