{"action":"created","comment":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls/comments/23008061","id":23008061,"diff_hunk":"@@ -806,8 +806,446 @@ ZSSEditor.removeImage = function(imageNodeIdentifier) {\n     }\n };\n \n+/**\n+ *  @brief      Updates the currently selected image, replacing its markup with\n+ *  new markup based on the specified meta data string.\n+ *\n+ *  @param      imageMetaString   A JSON string representing the updated meta data.\n+ */\n+ZSSEditor.updateCurrentImageMeta = function( imageMetaString ) {\n+    //    ZSSEditor.restoreRange();\n+\n+    if ( ZSSEditor.currentEditingImage ) {\n+        var imageMeta = JSON.parse( imageMetaString );\n+        var html = ZSSEditor.createImageFromMeta( imageMeta );\n+\n+        ZSSEditor.selectImageCaptionNode( ZSSEditor.currentEditingImage );\n+        ZSSEditor.insertHTML( html );\n+        return; // return to avoid sending enabled styles twice.\n+    }\n+\n+    ZSSEditor.sendEnabledStyles();\n+}\n+\n+\n+/**\n+ *  @brief      Selects the specified image, and its anchor and caption shortcode (if any).\n+ *\n+ *  @param      imageNode   An image node in the DOM to inspect.\n+ */\n+ZSSEditor.selectImageCaptionNode = function( imageNode ) {\n+    var node = imageNode;\n+    if ( node.parentNode && node.parentNode.nodeName === 'A' ) {","path":"Assets/ZSSRichTextEditor.js","position":null,"original_position":73,"commit_id":"13d3c51b28db59b3f673dc4210c195154ced9a92","original_commit_id":"17e7ab6f31787cd973f1d0517f774536fc6c1d36","user":{"login":"diegoreymendez","id":1836005,"avatar_url":"https://avatars.githubusercontent.com/u/1836005?v=3","gravatar_id":"","url":"https://api.github.com/users/diegoreymendez","html_url":"https://github.com/diegoreymendez","followers_url":"https://api.github.com/users/diegoreymendez/followers","following_url":"https://api.github.com/users/diegoreymendez/following{/other_user}","gists_url":"https://api.github.com/users/diegoreymendez/gists{/gist_id}","starred_url":"https://api.github.com/users/diegoreymendez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegoreymendez/subscriptions","organizations_url":"https://api.github.com/users/diegoreymendez/orgs","repos_url":"https://api.github.com/users/diegoreymendez/repos","events_url":"https://api.github.com/users/diegoreymendez/events{/privacy}","received_events_url":"https://api.github.com/users/diegoreymendez/received_events","type":"User","site_admin":false},"body":"@TooTallNate - Thanks for the tip.  We'll be able to revert the other `toLowerCase()` at some point, then.","created_at":"2015-01-15T13:11:13Z","updated_at":"2015-01-15T13:11:13Z","html_url":"https://github.com/wordpress-mobile/WordPress-iOS-Editor/pull/453#discussion_r23008061","pull_request_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls/453","_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls/comments/23008061"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-iOS-Editor/pull/453#discussion_r23008061"},"pull_request":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls/453"}}},"pull_request":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls/453","id":26082138,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS-Editor/pull/453","diff_url":"https://github.com/wordpress-mobile/WordPress-iOS-Editor/pull/453.diff","patch_url":"https://github.com/wordpress-mobile/WordPress-iOS-Editor/pull/453.patch","issue_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/issues/453","number":453,"state":"open","locked":false,"title":"Issues/427 add edit image meta *** DO NOT MERGE ***","user":{"login":"aerych","id":1435271,"avatar_url":"https://avatars.githubusercontent.com/u/1435271?v=3","gravatar_id":"","url":"https://api.github.com/users/aerych","html_url":"https://github.com/aerych","followers_url":"https://api.github.com/users/aerych/followers","following_url":"https://api.github.com/users/aerych/following{/other_user}","gists_url":"https://api.github.com/users/aerych/gists{/gist_id}","starred_url":"https://api.github.com/users/aerych/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerych/subscriptions","organizations_url":"https://api.github.com/users/aerych/orgs","repos_url":"https://api.github.com/users/aerych/repos","events_url":"https://api.github.com/users/aerych/events{/privacy}","received_events_url":"https://api.github.com/users/aerych/received_events","type":"User","site_admin":false},"body":"First pass (and work in progress) for adding the ability to edit image meta data, e.g. link, caption, etc.   Ready for your feedback!! \r\n\r\n### Points of interest!\r\n- Adds two new JS libraries: underscore.js and shortcode.js (from core WordPress)\r\n- Image parsing logic was borrowed and modified from wp core in order to be as consistent as possible with existing user expectations\r\n- Adds a WPImageMeta convenience class as a simple holder for meta values. \r\n- Adds a simple modal to demo the edit feature. \r\n\r\n### TODOs\r\n- There is some data sanitation and safety logic that needs to be implemented.\r\n- There are some slight differences in the logic that parses out the image, and the logic that rebuilds it. These need to be made uniform. \r\n- Some meta values can be derived from other meta values so the total number can likely be reduced (by at least 2)\r\n\r\n### Questions:\r\nWhat are your thoughts on the best approach to the demo form? Its as simple as possible right now. \r\n\r\n### Misc:\r\nI'm sure I'm forgetting something. :) \r\n\r\n@SergioEstevao @bummytime @diegoreymendez \r\n\r\n\r\n","created_at":"2014-12-15T16:37:17Z","updated_at":"2015-01-15T13:11:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ca71688b830d4c5ceff8ea752a62dad56c70f17","assignee":null,"milestone":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/milestones/5","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/milestones/5/labels","id":885939,"number":5,"title":"Release 4.8","description":"","creator":{"login":"bummytime","id":154014,"avatar_url":"https://avatars.githubusercontent.com/u/154014?v=3","gravatar_id":"","url":"https://api.github.com/users/bummytime","html_url":"https://github.com/bummytime","followers_url":"https://api.github.com/users/bummytime/followers","following_url":"https://api.github.com/users/bummytime/following{/other_user}","gists_url":"https://api.github.com/users/bummytime/gists{/gist_id}","starred_url":"https://api.github.com/users/bummytime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bummytime/subscriptions","organizations_url":"https://api.github.com/users/bummytime/orgs","repos_url":"https://api.github.com/users/bummytime/repos","events_url":"https://api.github.com/users/bummytime/events{/privacy}","received_events_url":"https://api.github.com/users/bummytime/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":24,"state":"open","created_at":"2014-12-01T14:51:01Z","updated_at":"2015-01-14T22:07:41Z","due_on":"2015-02-18T03:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls/453/commits","review_comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls/453/comments","review_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls/comments/{number}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/issues/453/comments","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/statuses/13d3c51b28db59b3f673dc4210c195154ced9a92","head":{"label":"wordpress-mobile:issues/427-add-edit-image-meta","ref":"issues/427-add-edit-image-meta","sha":"13d3c51b28db59b3f673dc4210c195154ced9a92","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":19703913,"name":"WordPress-iOS-Editor","full_name":"wordpress-mobile/WordPress-iOS-Editor","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS-Editor","description":"A reusable iOS rich text editor component.","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/issues/comments/{number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/releases{/id}","created_at":"2014-05-12T15:22:29Z","updated_at":"2015-01-14T14:01:24Z","pushed_at":"2015-01-14T23:51:00Z","git_url":"git://github.com/wordpress-mobile/WordPress-iOS-Editor.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-iOS-Editor.git","clone_url":"https://github.com/wordpress-mobile/WordPress-iOS-Editor.git","svn_url":"https://github.com/wordpress-mobile/WordPress-iOS-Editor","homepage":"","size":6782,"stargazers_count":152,"watchers_count":152,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":134,"forks":14,"open_issues":134,"watchers":152,"default_branch":"develop"}},"base":{"label":"wordpress-mobile:develop","ref":"develop","sha":"6c9bd12cc600b801eefb87a31be7c425f83c9054","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":19703913,"name":"WordPress-iOS-Editor","full_name":"wordpress-mobile/WordPress-iOS-Editor","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-iOS-Editor","description":"A reusable iOS rich text editor component.","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/issues/comments/{number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/releases{/id}","created_at":"2014-05-12T15:22:29Z","updated_at":"2015-01-14T14:01:24Z","pushed_at":"2015-01-14T23:51:00Z","git_url":"git://github.com/wordpress-mobile/WordPress-iOS-Editor.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-iOS-Editor.git","clone_url":"https://github.com/wordpress-mobile/WordPress-iOS-Editor.git","svn_url":"https://github.com/wordpress-mobile/WordPress-iOS-Editor","homepage":"","size":6782,"stargazers_count":152,"watchers_count":152,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":134,"forks":14,"open_issues":134,"watchers":152,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls/453"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-iOS-Editor/pull/453"},"issue":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/issues/453"},"comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/issues/453/comments"},"review_comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls/453/comments"},"review_comment":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/pulls/453/commits"},"statuses":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS-Editor/statuses/13d3c51b28db59b3f673dc4210c195154ced9a92"}}}}