edx/edx-platform — pull request #5305 by lduarte1991 (2014-09-19 19:41:08+00:00)
Title: Fixes check for Image Annotation Tool to include ID from image server and fix scrolling bug

This addresses the bug **[TNL-443]**.
**Affected Courses:** 1 course is affected (Visualizing Japan) with a total enrollment of ~10,000 students.
**Ideal Fix Deployment:** Week of Sept 29th

**Background:** As explained in TNL-443, it was notified early this morning that when users clicked on the thumbnails within the tables they were not able to scroll back up and be zoomed/panned to the proper locations. After a little more fiddling around it was discovered that the issue affected every item after the first "failure." This code changes the way that you verify that the thumbnail/annotation are from the image currently being shown on the same page. It checks that the thumbnail contains the substring of the id as per OpenSeaDragon's API.

**Studio Changes:** None.

**LMS Changes:** 1) Removed old way of checking (not sure why that method was chosen by my predecessor, but it seems like a super bad idea) if annotation referred to the image on the current page. 2) Added the fix @sarina asked me to make at the end of the las PR related to the release candidate this week. 3) Added a few more checks for annotation.highlights attribute that sometimes does not get made (i.e. replies). These are not code-breaking but the code is now more correct than it used to be and that's always a plus.

**Testing:**
1. Create a sandbox instance WITHOUT this fix/PR
2. Install the [tarball](https://www.dropbox.com/s/r684ber7z4ddqtc/2014_T4.DPRfFs.tar.gz) as usual.
3. Make a few random image annotations.
4. This part is a little tricky: you need to simulate the current bug by changing the annotation.target.src attribute so that it breaks, please ask me to do it for you or talk you through it as you do.
5. Try clicking the thumbnail and you should not see anything happen. This breaks any annotations below the one you broke as well.
6. Switch to this PR branch and try #5 again and you should see it move up and zoom/pan to the correct location