{"action":"created","comment":{"url":"https://api.github.com/repos/openseadragon/openseadragon/pulls/comments/32168951","id":32168951,"diff_hunk":"@@ -968,4 +968,76 @@\n         viewer.open( '/test/data/testpattern.dzi' );\n     } );\n \n+    // tile-loaded event tests\n+    asyncTest( 'Viewer: tile-loaded event without callback.', function () {\n+\n+        function tileLoaded ( event ) {\n+            viewer.removeHandler( 'tile-loaded', tileLoaded);\n+            var tile = event.tile;\n+            ok( tile.loading, \"The tile should be marked as loading.\");\n+            notOk( tile.loaded, \"The tile should not be marked as loaded.\");\n+            setTimeout(function() {\n+                notOk( tile.loading, \"The tile should not be marked as loading.\");\n+                ok( tile.loaded, \"The tile should not be marked as loaded.\");\n+                start();\n+            }, 0);\n+        }\n+\n+        viewer.addHandler( 'tile-loaded', tileLoaded);\n+        viewer.open( '/test/data/testpattern.dzi' );\n+    } );\n+\n+    asyncTest( 'Viewer: tile-loaded event with 1 callback.', function () {\n+\n+        function tileLoaded ( event ) {\n+            viewer.removeHandler( 'tile-loaded', tileLoaded);\n+            var tile = event.tile;\n+            var callback = event.getCompletionCallback();\n+            ok( tile.loading, \"The tile should be marked as loading.\");\n+            notOk( tile.loaded, \"The tile should not be marked as loaded.\");\n+            ok( callback, \"The event should have a callback.\");\n+            setTimeout(function() {\n+                ok( tile.loading, \"The tile should be marked as loading.\");\n+                notOk( tile.loaded, \"The tile should not be marked as loaded.\");\n+                callback();\n+                notOk( tile.loading, \"The tile should not be marked as loading.\");\n+                ok( tile.loaded, \"The tile should not be marked as loaded.\");","path":"test/modules/events.js","position":37,"original_position":37,"commit_id":"606d25dbe62b167b359a0939a465ef1728b02b8e","original_commit_id":"606d25dbe62b167b359a0939a465ef1728b02b8e","user":{"login":"iangilman","id":338989,"avatar_url":"https://avatars.githubusercontent.com/u/338989?v=3","gravatar_id":"","url":"https://api.github.com/users/iangilman","html_url":"https://github.com/iangilman","followers_url":"https://api.github.com/users/iangilman/followers","following_url":"https://api.github.com/users/iangilman/following{/other_user}","gists_url":"https://api.github.com/users/iangilman/gists{/gist_id}","starred_url":"https://api.github.com/users/iangilman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iangilman/subscriptions","organizations_url":"https://api.github.com/users/iangilman/orgs","repos_url":"https://api.github.com/users/iangilman/repos","events_url":"https://api.github.com/users/iangilman/events{/privacy}","received_events_url":"https://api.github.com/users/iangilman/received_events","type":"User","site_admin":false},"body":"\"should be\" ","created_at":"2015-06-10T21:30:55Z","updated_at":"2015-06-10T21:30:55Z","html_url":"https://github.com/openseadragon/openseadragon/pull/659#discussion_r32168951","pull_request_url":"https://api.github.com/repos/openseadragon/openseadragon/pulls/659","_links":{"self":{"href":"https://api.github.com/repos/openseadragon/openseadragon/pulls/comments/32168951"},"html":{"href":"https://github.com/openseadragon/openseadragon/pull/659#discussion_r32168951"},"pull_request":{"href":"https://api.github.com/repos/openseadragon/openseadragon/pulls/659"}}},"pull_request":{"url":"https://api.github.com/repos/openseadragon/openseadragon/pulls/659","id":36519576,"html_url":"https://github.com/openseadragon/openseadragon/pull/659","diff_url":"https://github.com/openseadragon/openseadragon/pull/659.diff","patch_url":"https://github.com/openseadragon/openseadragon/pull/659.patch","issue_url":"https://api.github.com/repos/openseadragon/openseadragon/issues/659","number":659,"state":"open","locked":false,"title":"Move tile caching code inside tilecache.js.","user":{"login":"avandecreme","id":465389,"avatar_url":"https://avatars.githubusercontent.com/u/465389?v=3","gravatar_id":"","url":"https://api.github.com/users/avandecreme","html_url":"https://github.com/avandecreme","followers_url":"https://api.github.com/users/avandecreme/followers","following_url":"https://api.github.com/users/avandecreme/following{/other_user}","gists_url":"https://api.github.com/users/avandecreme/gists{/gist_id}","starred_url":"https://api.github.com/users/avandecreme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avandecreme/subscriptions","organizations_url":"https://api.github.com/users/avandecreme/orgs","repos_url":"https://api.github.com/users/avandecreme/repos","events_url":"https://api.github.com/users/avandecreme/events{/privacy}","received_events_url":"https://api.github.com/users/avandecreme/received_events","type":"User","site_admin":false},"body":"I was looking on how to handle modifying the tiles in an asynchronous way in case the operation is lengthy.\r\nThat would also allow interaction with http://camanjs.com/.\r\n\r\nThe idea would be to provide a way to modify a tile before it is stored in cache. Probably some sort of callback or event inside onTileLoad in tiledimage.js\r\n\r\nThis first commit is just some cleanup. I suspect it might also save a bit of memory because the ImageRecord was keeping a reference to the image even if it has been rendered.\r\nI deleted a method, hopefully this is internal enough for not being a breaking change.","created_at":"2015-05-29T16:00:17Z","updated_at":"2015-06-10T21:30:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0723aa9d94025d6ac07250b7e4729607261fbd18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openseadragon/openseadragon/pulls/659/commits","review_comments_url":"https://api.github.com/repos/openseadragon/openseadragon/pulls/659/comments","review_comment_url":"https://api.github.com/repos/openseadragon/openseadragon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openseadragon/openseadragon/issues/659/comments","statuses_url":"https://api.github.com/repos/openseadragon/openseadragon/statuses/606d25dbe62b167b359a0939a465ef1728b02b8e","head":{"label":"avandecreme:master","ref":"master","sha":"606d25dbe62b167b359a0939a465ef1728b02b8e","user":{"login":"avandecreme","id":465389,"avatar_url":"https://avatars.githubusercontent.com/u/465389?v=3","gravatar_id":"","url":"https://api.github.com/users/avandecreme","html_url":"https://github.com/avandecreme","followers_url":"https://api.github.com/users/avandecreme/followers","following_url":"https://api.github.com/users/avandecreme/following{/other_user}","gists_url":"https://api.github.com/users/avandecreme/gists{/gist_id}","starred_url":"https://api.github.com/users/avandecreme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avandecreme/subscriptions","organizations_url":"https://api.github.com/users/avandecreme/orgs","repos_url":"https://api.github.com/users/avandecreme/repos","events_url":"https://api.github.com/users/avandecreme/events{/privacy}","received_events_url":"https://api.github.com/users/avandecreme/received_events","type":"User","site_admin":false},"repo":{"id":12491418,"name":"openseadragon","full_name":"avandecreme/openseadragon","owner":{"login":"avandecreme","id":465389,"avatar_url":"https://avatars.githubusercontent.com/u/465389?v=3","gravatar_id":"","url":"https://api.github.com/users/avandecreme","html_url":"https://github.com/avandecreme","followers_url":"https://api.github.com/users/avandecreme/followers","following_url":"https://api.github.com/users/avandecreme/following{/other_user}","gists_url":"https://api.github.com/users/avandecreme/gists{/gist_id}","starred_url":"https://api.github.com/users/avandecreme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avandecreme/subscriptions","organizations_url":"https://api.github.com/users/avandecreme/orgs","repos_url":"https://api.github.com/users/avandecreme/repos","events_url":"https://api.github.com/users/avandecreme/events{/privacy}","received_events_url":"https://api.github.com/users/avandecreme/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/avandecreme/openseadragon","description":"An open-source, web-based viewer for zoomable images, implemented in pure JavaScript. ","fork":true,"url":"https://api.github.com/repos/avandecreme/openseadragon","forks_url":"https://api.github.com/repos/avandecreme/openseadragon/forks","keys_url":"https://api.github.com/repos/avandecreme/openseadragon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avandecreme/openseadragon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avandecreme/openseadragon/teams","hooks_url":"https://api.github.com/repos/avandecreme/openseadragon/hooks","issue_events_url":"https://api.github.com/repos/avandecreme/openseadragon/issues/events{/number}","events_url":"https://api.github.com/repos/avandecreme/openseadragon/events","assignees_url":"https://api.github.com/repos/avandecreme/openseadragon/assignees{/user}","branches_url":"https://api.github.com/repos/avandecreme/openseadragon/branches{/branch}","tags_url":"https://api.github.com/repos/avandecreme/openseadragon/tags","blobs_url":"https://api.github.com/repos/avandecreme/openseadragon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avandecreme/openseadragon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avandecreme/openseadragon/git/refs{/sha}","trees_url":"https://api.github.com/repos/avandecreme/openseadragon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avandecreme/openseadragon/statuses/{sha}","languages_url":"https://api.github.com/repos/avandecreme/openseadragon/languages","stargazers_url":"https://api.github.com/repos/avandecreme/openseadragon/stargazers","contributors_url":"https://api.github.com/repos/avandecreme/openseadragon/contributors","subscribers_url":"https://api.github.com/repos/avandecreme/openseadragon/subscribers","subscription_url":"https://api.github.com/repos/avandecreme/openseadragon/subscription","commits_url":"https://api.github.com/repos/avandecreme/openseadragon/commits{/sha}","git_commits_url":"https://api.github.com/repos/avandecreme/openseadragon/git/commits{/sha}","comments_url":"https://api.github.com/repos/avandecreme/openseadragon/comments{/number}","issue_comment_url":"https://api.github.com/repos/avandecreme/openseadragon/issues/comments{/number}","contents_url":"https://api.github.com/repos/avandecreme/openseadragon/contents/{+path}","compare_url":"https://api.github.com/repos/avandecreme/openseadragon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avandecreme/openseadragon/merges","archive_url":"https://api.github.com/repos/avandecreme/openseadragon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avandecreme/openseadragon/downloads","issues_url":"https://api.github.com/repos/avandecreme/openseadragon/issues{/number}","pulls_url":"https://api.github.com/repos/avandecreme/openseadragon/pulls{/number}","milestones_url":"https://api.github.com/repos/avandecreme/openseadragon/milestones{/number}","notifications_url":"https://api.github.com/repos/avandecreme/openseadragon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avandecreme/openseadragon/labels{/name}","releases_url":"https://api.github.com/repos/avandecreme/openseadragon/releases{/id}","created_at":"2013-08-30T17:07:34Z","updated_at":"2015-02-27T19:07:55Z","pushed_at":"2015-06-08T14:38:30Z","git_url":"git://github.com/avandecreme/openseadragon.git","ssh_url":"git@github.com:avandecreme/openseadragon.git","clone_url":"https://github.com/avandecreme/openseadragon.git","svn_url":"https://github.com/avandecreme/openseadragon","homepage":"http://openseadragon.github.io/","size":8156,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openseadragon:master","ref":"master","sha":"300cf6e7779f6a5da49add83938adb81a1d779ad","user":{"login":"openseadragon","id":3392630,"avatar_url":"https://avatars.githubusercontent.com/u/3392630?v=3","gravatar_id":"","url":"https://api.github.com/users/openseadragon","html_url":"https://github.com/openseadragon","followers_url":"https://api.github.com/users/openseadragon/followers","following_url":"https://api.github.com/users/openseadragon/following{/other_user}","gists_url":"https://api.github.com/users/openseadragon/gists{/gist_id}","starred_url":"https://api.github.com/users/openseadragon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openseadragon/subscriptions","organizations_url":"https://api.github.com/users/openseadragon/orgs","repos_url":"https://api.github.com/users/openseadragon/repos","events_url":"https://api.github.com/users/openseadragon/events{/privacy}","received_events_url":"https://api.github.com/users/openseadragon/received_events","type":"Organization","site_admin":false},"repo":{"id":7941882,"name":"openseadragon","full_name":"openseadragon/openseadragon","owner":{"login":"openseadragon","id":3392630,"avatar_url":"https://avatars.githubusercontent.com/u/3392630?v=3","gravatar_id":"","url":"https://api.github.com/users/openseadragon","html_url":"https://github.com/openseadragon","followers_url":"https://api.github.com/users/openseadragon/followers","following_url":"https://api.github.com/users/openseadragon/following{/other_user}","gists_url":"https://api.github.com/users/openseadragon/gists{/gist_id}","starred_url":"https://api.github.com/users/openseadragon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openseadragon/subscriptions","organizations_url":"https://api.github.com/users/openseadragon/orgs","repos_url":"https://api.github.com/users/openseadragon/repos","events_url":"https://api.github.com/users/openseadragon/events{/privacy}","received_events_url":"https://api.github.com/users/openseadragon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openseadragon/openseadragon","description":"An open-source, web-based viewer for zoomable images, implemented in pure JavaScript. ","fork":false,"url":"https://api.github.com/repos/openseadragon/openseadragon","forks_url":"https://api.github.com/repos/openseadragon/openseadragon/forks","keys_url":"https://api.github.com/repos/openseadragon/openseadragon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openseadragon/openseadragon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openseadragon/openseadragon/teams","hooks_url":"https://api.github.com/repos/openseadragon/openseadragon/hooks","issue_events_url":"https://api.github.com/repos/openseadragon/openseadragon/issues/events{/number}","events_url":"https://api.github.com/repos/openseadragon/openseadragon/events","assignees_url":"https://api.github.com/repos/openseadragon/openseadragon/assignees{/user}","branches_url":"https://api.github.com/repos/openseadragon/openseadragon/branches{/branch}","tags_url":"https://api.github.com/repos/openseadragon/openseadragon/tags","blobs_url":"https://api.github.com/repos/openseadragon/openseadragon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openseadragon/openseadragon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openseadragon/openseadragon/git/refs{/sha}","trees_url":"https://api.github.com/repos/openseadragon/openseadragon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openseadragon/openseadragon/statuses/{sha}","languages_url":"https://api.github.com/repos/openseadragon/openseadragon/languages","stargazers_url":"https://api.github.com/repos/openseadragon/openseadragon/stargazers","contributors_url":"https://api.github.com/repos/openseadragon/openseadragon/contributors","subscribers_url":"https://api.github.com/repos/openseadragon/openseadragon/subscribers","subscription_url":"https://api.github.com/repos/openseadragon/openseadragon/subscription","commits_url":"https://api.github.com/repos/openseadragon/openseadragon/commits{/sha}","git_commits_url":"https://api.github.com/repos/openseadragon/openseadragon/git/commits{/sha}","comments_url":"https://api.github.com/repos/openseadragon/openseadragon/comments{/number}","issue_comment_url":"https://api.github.com/repos/openseadragon/openseadragon/issues/comments{/number}","contents_url":"https://api.github.com/repos/openseadragon/openseadragon/contents/{+path}","compare_url":"https://api.github.com/repos/openseadragon/openseadragon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openseadragon/openseadragon/merges","archive_url":"https://api.github.com/repos/openseadragon/openseadragon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openseadragon/openseadragon/downloads","issues_url":"https://api.github.com/repos/openseadragon/openseadragon/issues{/number}","pulls_url":"https://api.github.com/repos/openseadragon/openseadragon/pulls{/number}","milestones_url":"https://api.github.com/repos/openseadragon/openseadragon/milestones{/number}","notifications_url":"https://api.github.com/repos/openseadragon/openseadragon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openseadragon/openseadragon/labels{/name}","releases_url":"https://api.github.com/repos/openseadragon/openseadragon/releases{/id}","created_at":"2013-01-31T17:44:24Z","updated_at":"2015-06-02T01:55:06Z","pushed_at":"2015-06-08T14:38:31Z","git_url":"git://github.com/openseadragon/openseadragon.git","ssh_url":"git@github.com:openseadragon/openseadragon.git","clone_url":"https://github.com/openseadragon/openseadragon.git","svn_url":"https://github.com/openseadragon/openseadragon","homepage":"http://openseadragon.github.io/","size":11048,"stargazers_count":345,"watchers_count":345,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":147,"mirror_url":null,"open_issues_count":127,"forks":147,"open_issues":127,"watchers":345,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openseadragon/openseadragon/pulls/659"},"html":{"href":"https://github.com/openseadragon/openseadragon/pull/659"},"issue":{"href":"https://api.github.com/repos/openseadragon/openseadragon/issues/659"},"comments":{"href":"https://api.github.com/repos/openseadragon/openseadragon/issues/659/comments"},"review_comments":{"href":"https://api.github.com/repos/openseadragon/openseadragon/pulls/659/comments"},"review_comment":{"href":"https://api.github.com/repos/openseadragon/openseadragon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openseadragon/openseadragon/pulls/659/commits"},"statuses":{"href":"https://api.github.com/repos/openseadragon/openseadragon/statuses/606d25dbe62b167b359a0939a465ef1728b02b8e"}}}}