{"action":"created","comment":{"url":"https://api.github.com/repos/google/blockly/pulls/comments/319616193","pull_request_review_id":282168964,"id":319616193,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxOTYxNjE5Mw==","diff_hunk":"@@ -0,0 +1,141 @@\n+<!DOCTYPE html>\n+<html lang=\"en\">\n+  <head>\n+    <meta charset=\"UTF-8\">\n+    <title>Blockly Demo: Custom Fields</title>\n+    <script src=\"../../../blockly_uncompressed.js\"></script>\n+    <script src=\"blocks.js\"></script>\n+    <script src=\"field_pitch.js\"></script>\n+    <script src=\"../../../msg/js/en.js\"></script>\n+    <link rel=\"stylesheet\" type=\"text/css\" href=\"custom-fields.css\">\n+  </head>\n+  <body onload=\"start()\">\n+    <h1>\n+      <a href=\"https://developers.google.com/blockly/\">Blockly</a> &gt;\n+      <a href=\"../../index.html\">Demos</a> &gt;\n+      <a href=\"../index.html\">Custom Fields</a> &gt; Pitch Field</h1>\n+\n+\n+    <p>This is a demo of creating custom block fields. In this case the field\n+      is used to select a note pitch.\n+    </p>\n+\n+    <p>All of the custom field implementation is in\n+     demos/custom-fields/pitch/field_pitch.js, including comments on each required\n+     function.\n+    </p>\n+\n+    <p>\n+      <input type=\"button\" value=\"Export to XML\" onclick=\"toXml()\">\n+      <input type=\"button\" value=\"Import from XML\" onclick=\"fromXml()\">\n+    </p>\n+\n+    <table>\n+      <tr>\n+        <td>\n+          <textarea id=\"importExport\"\n+                    style=\"width: 200px; height: 480px;\"\n+                    onchange=\"textAreaChange();\"\n+                    onkeyup=\"textAreaChange()\"></textarea>\n+        </td>\n+        <td>\n+          <div id=\"blocklyDiv\" style=\"width: 600px; height: 480px;\"></div>\n+        </td>\n+      </tr>\n+    </table>\n+\n+    <script>\n+      function toXml() {\n+        var output = document.getElementById('importExport');\n+        var xml = Blockly.Xml.workspaceToDom(workspace);\n+        output.value = Blockly.Xml.domToPrettyText(xml);\n+        output.focus();\n+        output.select();\n+      }\n+\n+      function fromXml() {\n+        var input = document.getElementById('importExport');\n+        var xml = Blockly.Xml.textToDom(input.value);\n+        Blockly.Xml.domToWorkspace(xml, workspace);\n+      }\n+\n+      function setRandomStyle() {","path":"demos/custom-fields/pitch/index.html","position":62,"original_position":62,"commit_id":"e1a45190be4a69ebb5cc89d19e2b0e0ea6c3137f","original_commit_id":"e1a45190be4a69ebb5cc89d19e2b0e0ea6c3137f","user":{"login":"samelhusseini","id":16690124,"node_id":"MDQ6VXNlcjE2NjkwMTI0","avatar_url":"https://avatars3.githubusercontent.com/u/16690124?v=4","gravatar_id":"","url":"https://api.github.com/users/samelhusseini","html_url":"https://github.com/samelhusseini","followers_url":"https://api.github.com/users/samelhusseini/followers","following_url":"https://api.github.com/users/samelhusseini/following{/other_user}","gists_url":"https://api.github.com/users/samelhusseini/gists{/gist_id}","starred_url":"https://api.github.com/users/samelhusseini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samelhusseini/subscriptions","organizations_url":"https://api.github.com/users/samelhusseini/orgs","repos_url":"https://api.github.com/users/samelhusseini/repos","events_url":"https://api.github.com/users/samelhusseini/events{/privacy}","received_events_url":"https://api.github.com/users/samelhusseini/received_events","type":"User","site_admin":false},"body":"Yep.","created_at":"2019-08-30T17:50:28Z","updated_at":"2019-08-30T17:50:29Z","html_url":"https://github.com/google/blockly/pull/2930#discussion_r319616193","pull_request_url":"https://api.github.com/repos/google/blockly/pulls/2930","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/google/blockly/pulls/comments/319616193"},"html":{"href":"https://github.com/google/blockly/pull/2930#discussion_r319616193"},"pull_request":{"href":"https://api.github.com/repos/google/blockly/pulls/2930"}},"in_reply_to_id":319575336},"pull_request":{"url":"https://api.github.com/repos/google/blockly/pulls/2930","id":312437853,"node_id":"MDExOlB1bGxSZXF1ZXN0MzEyNDM3ODUz","html_url":"https://github.com/google/blockly/pull/2930","diff_url":"https://github.com/google/blockly/pull/2930.diff","patch_url":"https://github.com/google/blockly/pull/2930.patch","issue_url":"https://api.github.com/repos/google/blockly/issues/2930","number":2930,"state":"open","locked":false,"title":"Field Text transformation methods","user":{"login":"samelhusseini","id":16690124,"node_id":"MDQ6VXNlcjE2NjkwMTI0","avatar_url":"https://avatars3.githubusercontent.com/u/16690124?v=4","gravatar_id":"","url":"https://api.github.com/users/samelhusseini","html_url":"https://github.com/samelhusseini","followers_url":"https://api.github.com/users/samelhusseini/followers","following_url":"https://api.github.com/users/samelhusseini/following{/other_user}","gists_url":"https://api.github.com/users/samelhusseini/gists{/gist_id}","starred_url":"https://api.github.com/users/samelhusseini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samelhusseini/subscriptions","organizations_url":"https://api.github.com/users/samelhusseini/orgs","repos_url":"https://api.github.com/users/samelhusseini/repos","events_url":"https://api.github.com/users/samelhusseini/events{/privacy}","received_events_url":"https://api.github.com/users/samelhusseini/received_events","type":"User","site_admin":false},"body":"\r\n## The basics\r\n\r\n- [x] I branched from develop\r\n- [x] My pull request is against develop\r\n- [x] My code follows the [style guide](https://developers.google.com/blockly/guides/modify/web/style-guide)\r\n\r\n## The details\r\n### Resolves\r\n\r\nThere's no obvious extension path for fields that show a different value than their stored value when editing.\r\n\r\n### Proposed Changes\r\n\r\n- Add transform methods in ``FieldTextInput`` that allow field subclasses to override to accept a different value than the one stored.\r\n- Removed the ``htmlInputValue_`` cache, because Neil pointed out that the html input is still around when widgetDispose is called.\r\n- Add the Blockly Games ``FieldPitch`` into demos/customblocks. Updated the ``FieldPitch`` to match this architecture.\r\n- Moved the turtle field into a directory within custom fields, and updated references so it all works.\r\n- Moved ``updateGraph`` in ``FieldAngle`` from the render method and into the doUpdate/Invalid methods to match other fields. \r\n\r\n### Reason for Changes\r\n\r\n\r\n### Test Coverage\r\n\r\n* Desktop Chrome\r\n\r\n### Documentation\r\n\r\nField customization documentation needs to be updated once all this settles.\r\n\r\n### Additional Information\r\n\r\n@BeksOmega @NeilFraser would love your feedback on this.\r\n","created_at":"2019-08-29T18:20:16Z","updated_at":"2019-08-30T17:50:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b22f0b67238506bfe675e3f6c4938c40b70a0e6","assignee":null,"assignees":[],"requested_reviewers":[{"login":"NeilFraser","id":250480,"node_id":"MDQ6VXNlcjI1MDQ4MA==","avatar_url":"https://avatars3.githubusercontent.com/u/250480?v=4","gravatar_id":"","url":"https://api.github.com/users/NeilFraser","html_url":"https://github.com/NeilFraser","followers_url":"https://api.github.com/users/NeilFraser/followers","following_url":"https://api.github.com/users/NeilFraser/following{/other_user}","gists_url":"https://api.github.com/users/NeilFraser/gists{/gist_id}","starred_url":"https://api.github.com/users/NeilFraser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NeilFraser/subscriptions","organizations_url":"https://api.github.com/users/NeilFraser/orgs","repos_url":"https://api.github.com/users/NeilFraser/repos","events_url":"https://api.github.com/users/NeilFraser/events{/privacy}","received_events_url":"https://api.github.com/users/NeilFraser/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/blockly/pulls/2930/commits","review_comments_url":"https://api.github.com/repos/google/blockly/pulls/2930/comments","review_comment_url":"https://api.github.com/repos/google/blockly/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/blockly/issues/2930/comments","statuses_url":"https://api.github.com/repos/google/blockly/statuses/e1a45190be4a69ebb5cc89d19e2b0e0ea6c3137f","head":{"label":"samelhusseini:fieldtexttransform","ref":"fieldtexttransform","sha":"e1a45190be4a69ebb5cc89d19e2b0e0ea6c3137f","user":{"login":"samelhusseini","id":16690124,"node_id":"MDQ6VXNlcjE2NjkwMTI0","avatar_url":"https://avatars3.githubusercontent.com/u/16690124?v=4","gravatar_id":"","url":"https://api.github.com/users/samelhusseini","html_url":"https://github.com/samelhusseini","followers_url":"https://api.github.com/users/samelhusseini/followers","following_url":"https://api.github.com/users/samelhusseini/following{/other_user}","gists_url":"https://api.github.com/users/samelhusseini/gists{/gist_id}","starred_url":"https://api.github.com/users/samelhusseini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samelhusseini/subscriptions","organizations_url":"https://api.github.com/users/samelhusseini/orgs","repos_url":"https://api.github.com/users/samelhusseini/repos","events_url":"https://api.github.com/users/samelhusseini/events{/privacy}","received_events_url":"https://api.github.com/users/samelhusseini/received_events","type":"User","site_admin":false},"repo":{"id":196248561,"node_id":"MDEwOlJlcG9zaXRvcnkxOTYyNDg1NjE=","name":"blockly","full_name":"samelhusseini/blockly","private":false,"owner":{"login":"samelhusseini","id":16690124,"node_id":"MDQ6VXNlcjE2NjkwMTI0","avatar_url":"https://avatars3.githubusercontent.com/u/16690124?v=4","gravatar_id":"","url":"https://api.github.com/users/samelhusseini","html_url":"https://github.com/samelhusseini","followers_url":"https://api.github.com/users/samelhusseini/followers","following_url":"https://api.github.com/users/samelhusseini/following{/other_user}","gists_url":"https://api.github.com/users/samelhusseini/gists{/gist_id}","starred_url":"https://api.github.com/users/samelhusseini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samelhusseini/subscriptions","organizations_url":"https://api.github.com/users/samelhusseini/orgs","repos_url":"https://api.github.com/users/samelhusseini/repos","events_url":"https://api.github.com/users/samelhusseini/events{/privacy}","received_events_url":"https://api.github.com/users/samelhusseini/received_events","type":"User","site_admin":false},"html_url":"https://github.com/samelhusseini/blockly","description":"The web-based visual programming editor.","fork":true,"url":"https://api.github.com/repos/samelhusseini/blockly","forks_url":"https://api.github.com/repos/samelhusseini/blockly/forks","keys_url":"https://api.github.com/repos/samelhusseini/blockly/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samelhusseini/blockly/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samelhusseini/blockly/teams","hooks_url":"https://api.github.com/repos/samelhusseini/blockly/hooks","issue_events_url":"https://api.github.com/repos/samelhusseini/blockly/issues/events{/number}","events_url":"https://api.github.com/repos/samelhusseini/blockly/events","assignees_url":"https://api.github.com/repos/samelhusseini/blockly/assignees{/user}","branches_url":"https://api.github.com/repos/samelhusseini/blockly/branches{/branch}","tags_url":"https://api.github.com/repos/samelhusseini/blockly/tags","blobs_url":"https://api.github.com/repos/samelhusseini/blockly/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samelhusseini/blockly/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samelhusseini/blockly/git/refs{/sha}","trees_url":"https://api.github.com/repos/samelhusseini/blockly/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samelhusseini/blockly/statuses/{sha}","languages_url":"https://api.github.com/repos/samelhusseini/blockly/languages","stargazers_url":"https://api.github.com/repos/samelhusseini/blockly/stargazers","contributors_url":"https://api.github.com/repos/samelhusseini/blockly/contributors","subscribers_url":"https://api.github.com/repos/samelhusseini/blockly/subscribers","subscription_url":"https://api.github.com/repos/samelhusseini/blockly/subscription","commits_url":"https://api.github.com/repos/samelhusseini/blockly/commits{/sha}","git_commits_url":"https://api.github.com/repos/samelhusseini/blockly/git/commits{/sha}","comments_url":"https://api.github.com/repos/samelhusseini/blockly/comments{/number}","issue_comment_url":"https://api.github.com/repos/samelhusseini/blockly/issues/comments{/number}","contents_url":"https://api.github.com/repos/samelhusseini/blockly/contents/{+path}","compare_url":"https://api.github.com/repos/samelhusseini/blockly/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samelhusseini/blockly/merges","archive_url":"https://api.github.com/repos/samelhusseini/blockly/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samelhusseini/blockly/downloads","issues_url":"https://api.github.com/repos/samelhusseini/blockly/issues{/number}","pulls_url":"https://api.github.com/repos/samelhusseini/blockly/pulls{/number}","milestones_url":"https://api.github.com/repos/samelhusseini/blockly/milestones{/number}","notifications_url":"https://api.github.com/repos/samelhusseini/blockly/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samelhusseini/blockly/labels{/name}","releases_url":"https://api.github.com/repos/samelhusseini/blockly/releases{/id}","deployments_url":"https://api.github.com/repos/samelhusseini/blockly/deployments","created_at":"2019-07-10T17:31:57Z","updated_at":"2019-07-10T17:32:02Z","pushed_at":"2019-08-30T17:23:45Z","git_url":"git://github.com/samelhusseini/blockly.git","ssh_url":"git@github.com:samelhusseini/blockly.git","clone_url":"https://github.com/samelhusseini/blockly.git","svn_url":"https://github.com/samelhusseini/blockly","homepage":"https://developers.google.com/blockly/","size":94632,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:develop","ref":"develop","sha":"a27e059f2cf4cd460f116e6d8b502dafdc51352a","user":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":13872231,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg3MjIzMQ==","name":"blockly","full_name":"google/blockly","private":false,"owner":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/google/blockly","description":"The web-based visual programming editor.","fork":false,"url":"https://api.github.com/repos/google/blockly","forks_url":"https://api.github.com/repos/google/blockly/forks","keys_url":"https://api.github.com/repos/google/blockly/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/blockly/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/blockly/teams","hooks_url":"https://api.github.com/repos/google/blockly/hooks","issue_events_url":"https://api.github.com/repos/google/blockly/issues/events{/number}","events_url":"https://api.github.com/repos/google/blockly/events","assignees_url":"https://api.github.com/repos/google/blockly/assignees{/user}","branches_url":"https://api.github.com/repos/google/blockly/branches{/branch}","tags_url":"https://api.github.com/repos/google/blockly/tags","blobs_url":"https://api.github.com/repos/google/blockly/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/blockly/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/blockly/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/blockly/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/blockly/statuses/{sha}","languages_url":"https://api.github.com/repos/google/blockly/languages","stargazers_url":"https://api.github.com/repos/google/blockly/stargazers","contributors_url":"https://api.github.com/repos/google/blockly/contributors","subscribers_url":"https://api.github.com/repos/google/blockly/subscribers","subscription_url":"https://api.github.com/repos/google/blockly/subscription","commits_url":"https://api.github.com/repos/google/blockly/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/blockly/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/blockly/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/blockly/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/blockly/contents/{+path}","compare_url":"https://api.github.com/repos/google/blockly/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/blockly/merges","archive_url":"https://api.github.com/repos/google/blockly/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/blockly/downloads","issues_url":"https://api.github.com/repos/google/blockly/issues{/number}","pulls_url":"https://api.github.com/repos/google/blockly/pulls{/number}","milestones_url":"https://api.github.com/repos/google/blockly/milestones{/number}","notifications_url":"https://api.github.com/repos/google/blockly/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/blockly/labels{/name}","releases_url":"https://api.github.com/repos/google/blockly/releases{/id}","deployments_url":"https://api.github.com/repos/google/blockly/deployments","created_at":"2013-10-25T21:13:33Z","updated_at":"2019-08-30T16:38:56Z","pushed_at":"2019-08-30T17:47:44Z","git_url":"git://github.com/google/blockly.git","ssh_url":"git@github.com:google/blockly.git","clone_url":"https://github.com/google/blockly.git","svn_url":"https://github.com/google/blockly","homepage":"https://developers.google.com/blockly/","size":96845,"stargazers_count":6795,"watchers_count":6795,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2353,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":463,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2353,"open_issues":463,"watchers":6795,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/blockly/pulls/2930"},"html":{"href":"https://github.com/google/blockly/pull/2930"},"issue":{"href":"https://api.github.com/repos/google/blockly/issues/2930"},"comments":{"href":"https://api.github.com/repos/google/blockly/issues/2930/comments"},"review_comments":{"href":"https://api.github.com/repos/google/blockly/pulls/2930/comments"},"review_comment":{"href":"https://api.github.com/repos/google/blockly/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/blockly/pulls/2930/commits"},"statuses":{"href":"https://api.github.com/repos/google/blockly/statuses/e1a45190be4a69ebb5cc89d19e2b0e0ea6c3137f"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"samelhusseini"}}