{"action":"created","comment":{"url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/pulls/comments/73189271","id":73189271,"diff_hunk":"@@ -437,15 +639,177 @@ function Compiler(domRoot, origFilters, windowLocalPrefix, onChangeCallback, lan\n \n     function setFilters(f) {\n         filters_ = $.extend({}, f);\n-        onChange();\n-        updateCompilerAndButtons();\n+        slots.forEach(function (slot) {\n+            onParamChange(slot);\n+            updateCompilerAndButtons(slot);\n+        });\n     }\n \n     function setEditorHeight(height) {\n-        const MinHeight = 100;\n+        const MinHeight = 80;\n         if (height < MinHeight) height = MinHeight;\n         cppEditor.setSize(null, height);\n-        asmCodeMirror.setSize(null, height);\n+        for (var i = 0; i < slots.length; i++) {\n+            slots[i].asmCodeMirror.setSize(null, height);\n+        }\n+    }\n+\n+    // External wrapper used by gcc.js only\n+    function refreshSlot(slot) {\n+        onCompilerChange(slot);\n+    }\n+    \n+    // Auxiliary function to slot_use_DOM\n+    function generate_change_callback(slot) {\n+        return function callback() {\n+            onParamChange(slot);\n+        }\n+    }\n+\n+    // Function to call each time a slot is added to the page.\n+    // This function requires that the slot's DOM object already exists.\n+    function slot_use_DOM(slot) {\n+        slot.asmCodeMirror = CodeMirror.fromTextArea(\n+        domRoot.find(\"#slot\"+slot.id+\" .asm textarea\")[0], {\n+            lineNumbers: true,\n+            mode: \"text/x-asm\",\n+            readOnly: true,\n+            gutters: ['CodeMirror-linenumbers'],\n+            lineWrapping: true\n+        });\n+        // handle compiler option (slot specific) such as '-O1'\n+        domRoot.find('#slot'+slot.id+' .compiler_options').change(\n+            generate_change_callback(slot)).keyup(\n+            generate_change_callback(slot));\n+\n+        setLeaderSlotMenu();\n+        if (slots.length == 1) {\n+            // \"force\" menu update if this is the first slot added\n+            var leaderSlotMenuNode = domRoot.find('#commonParams .leaderSlot');\n+            leaderSlotMenuNode.text('leader slot : '+0);\n+        }\n+    }\n+\n+    function get_slots_ids() {\n+        var ids = [];\n+        for (var i = 0; i < slots.length; i++) {\n+            ids.push(slots[i].id);\n+        }\n+        return ids;\n+    }\n+\n+    function slot_ctor(optionalId) {\n+        var newSlot = new Slot();\n+        if (optionalId) {\n+            newSlot.id = optionalId;\n+        } else {\n+            newSlot.id = get_available_id(slots);\n+        }\n+        slots.push(newSlot);\n+        setSetting('slotsId',JSON.stringify(get_slots_ids()));\n+        return newSlot;\n+    }\n+    \n+    // Array Remove - By John Resig (MIT Licensed)","path":"static/compiler.js","position":763,"original_position":763,"commit_id":"9f23ac54e825dbea88469ced46ce07d0a32d26c2","original_commit_id":"9f23ac54e825dbea88469ced46ce07d0a32d26c2","user":{"login":"mattgodbolt","id":633973,"avatar_url":"https://avatars.githubusercontent.com/u/633973?v=3","gravatar_id":"","url":"https://api.github.com/users/mattgodbolt","html_url":"https://github.com/mattgodbolt","followers_url":"https://api.github.com/users/mattgodbolt/followers","following_url":"https://api.github.com/users/mattgodbolt/following{/other_user}","gists_url":"https://api.github.com/users/mattgodbolt/gists{/gist_id}","starred_url":"https://api.github.com/users/mattgodbolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattgodbolt/subscriptions","organizations_url":"https://api.github.com/users/mattgodbolt/orgs","repos_url":"https://api.github.com/users/mattgodbolt/repos","events_url":"https://api.github.com/users/mattgodbolt/events{/privacy}","received_events_url":"https://api.github.com/users/mattgodbolt/received_events","type":"User","site_admin":false},"body":"Oh gosh you're absolutely right! Ignore my comment completely: I don't want\nto open this can of worms just now! :)\n\nOn Tue, Aug 2, 2016 at 10:43 AM Gabriel <notifications@github.com> wrote:\n\n> In static/compiler.js\n> <https://github.com/mattgodbolt/gcc-explorer/pull/135#discussion_r73181337>\n> :\n>\n> > +        return ids;\n> > +    }\n> > +\n> > +    function slot_ctor(optionalId) {\n> > +        var newSlot = new Slot();\n> > +        if (optionalId) {\n> > +            newSlot.id = optionalId;\n> > +        } else {\n> > +            newSlot.id = get_available_id(slots);\n> > +        }\n> > +        slots.push(newSlot);\n> > +        setSetting('slotsId',JSON.stringify(get_slots_ids()));\n> > +        return newSlot;\n> > +    }\n> > +\n> > +    // Array Remove - By John Resig (MIT Licensed)\n>\n> Isn't package.json a npm package ? This code runs in the browser.\n> Should I download https://github.com/jashkenas/underscore in\n> static/underscore (no as submodule) ?\n>\n> —\n> You are receiving this because you commented.\n>\n>\n> Reply to this email directly, view it on GitHub\n> <https://github.com/mattgodbolt/gcc-explorer/pull/135/files/9f23ac54e825dbea88469ced46ce07d0a32d26c2#r73181337>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AAmsdUZaOQ-72guKlqtYZbeK5uE5-p7Hks5qb2WUgaJpZM4JEgi2>\n> .\n>\n","created_at":"2016-08-02T16:26:49Z","updated_at":"2016-08-02T16:26:49Z","html_url":"https://github.com/mattgodbolt/gcc-explorer/pull/135#discussion_r73189271","pull_request_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/pulls/135","_links":{"self":{"href":"https://api.github.com/repos/mattgodbolt/gcc-explorer/pulls/comments/73189271"},"html":{"href":"https://github.com/mattgodbolt/gcc-explorer/pull/135#discussion_r73189271"},"pull_request":{"href":"https://api.github.com/repos/mattgodbolt/gcc-explorer/pulls/135"}}},"pull_request":{"url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/pulls/135","id":76185173,"html_url":"https://github.com/mattgodbolt/gcc-explorer/pull/135","diff_url":"https://github.com/mattgodbolt/gcc-explorer/pull/135.diff","patch_url":"https://github.com/mattgodbolt/gcc-explorer/pull/135.patch","issue_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/issues/135","number":135,"state":"open","locked":false,"title":"Pr/proposal","user":{"login":"Voxelf","id":19528126,"avatar_url":"https://avatars.githubusercontent.com/u/19528126?v=3","gravatar_id":"","url":"https://api.github.com/users/Voxelf","html_url":"https://github.com/Voxelf","followers_url":"https://api.github.com/users/Voxelf/followers","following_url":"https://api.github.com/users/Voxelf/following{/other_user}","gists_url":"https://api.github.com/users/Voxelf/gists{/gist_id}","starred_url":"https://api.github.com/users/Voxelf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Voxelf/subscriptions","organizations_url":"https://api.github.com/users/Voxelf/orgs","repos_url":"https://api.github.com/users/Voxelf/repos","events_url":"https://api.github.com/users/Voxelf/events{/privacy}","received_events_url":"https://api.github.com/users/Voxelf/received_events","type":"User","site_admin":false},"body":" It would be nice to be able to compare the output of the same compiler with different compiler flags (-O0,-O1,...) or of different compilers with the same flags.\r\nCurrently my code should do that.\r\nI use JQuery UI but only to allow the user to swap panes and therefore it could easily be dropped.\r\n\r\nThis is a proposal : I do not expect to be merged soon !\r\n\r\nAfter taking any comments into account, I will work on having real-time diff between two outputs :)","created_at":"2016-07-04T16:33:10Z","updated_at":"2016-08-02T16:26:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea5de4c86a91695c259c2dda88c5753dcb7621bd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/pulls/135/commits","review_comments_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/pulls/135/comments","review_comment_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/issues/135/comments","statuses_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/statuses/9f23ac54e825dbea88469ced46ce07d0a32d26c2","head":{"label":"Voxelf:pr/proposal","ref":"pr/proposal","sha":"9f23ac54e825dbea88469ced46ce07d0a32d26c2","user":{"login":"Voxelf","id":19528126,"avatar_url":"https://avatars.githubusercontent.com/u/19528126?v=3","gravatar_id":"","url":"https://api.github.com/users/Voxelf","html_url":"https://github.com/Voxelf","followers_url":"https://api.github.com/users/Voxelf/followers","following_url":"https://api.github.com/users/Voxelf/following{/other_user}","gists_url":"https://api.github.com/users/Voxelf/gists{/gist_id}","starred_url":"https://api.github.com/users/Voxelf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Voxelf/subscriptions","organizations_url":"https://api.github.com/users/Voxelf/orgs","repos_url":"https://api.github.com/users/Voxelf/repos","events_url":"https://api.github.com/users/Voxelf/events{/privacy}","received_events_url":"https://api.github.com/users/Voxelf/received_events","type":"User","site_admin":false},"repo":{"id":62377726,"name":"gcc-explorer","full_name":"Voxelf/gcc-explorer","owner":{"login":"Voxelf","id":19528126,"avatar_url":"https://avatars.githubusercontent.com/u/19528126?v=3","gravatar_id":"","url":"https://api.github.com/users/Voxelf","html_url":"https://github.com/Voxelf","followers_url":"https://api.github.com/users/Voxelf/followers","following_url":"https://api.github.com/users/Voxelf/following{/other_user}","gists_url":"https://api.github.com/users/Voxelf/gists{/gist_id}","starred_url":"https://api.github.com/users/Voxelf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Voxelf/subscriptions","organizations_url":"https://api.github.com/users/Voxelf/orgs","repos_url":"https://api.github.com/users/Voxelf/repos","events_url":"https://api.github.com/users/Voxelf/events{/privacy}","received_events_url":"https://api.github.com/users/Voxelf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Voxelf/gcc-explorer","description":"Run GCC (and other compilers) interactively from your web browser and experiment with its generated code","fork":true,"url":"https://api.github.com/repos/Voxelf/gcc-explorer","forks_url":"https://api.github.com/repos/Voxelf/gcc-explorer/forks","keys_url":"https://api.github.com/repos/Voxelf/gcc-explorer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Voxelf/gcc-explorer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Voxelf/gcc-explorer/teams","hooks_url":"https://api.github.com/repos/Voxelf/gcc-explorer/hooks","issue_events_url":"https://api.github.com/repos/Voxelf/gcc-explorer/issues/events{/number}","events_url":"https://api.github.com/repos/Voxelf/gcc-explorer/events","assignees_url":"https://api.github.com/repos/Voxelf/gcc-explorer/assignees{/user}","branches_url":"https://api.github.com/repos/Voxelf/gcc-explorer/branches{/branch}","tags_url":"https://api.github.com/repos/Voxelf/gcc-explorer/tags","blobs_url":"https://api.github.com/repos/Voxelf/gcc-explorer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Voxelf/gcc-explorer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Voxelf/gcc-explorer/git/refs{/sha}","trees_url":"https://api.github.com/repos/Voxelf/gcc-explorer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Voxelf/gcc-explorer/statuses/{sha}","languages_url":"https://api.github.com/repos/Voxelf/gcc-explorer/languages","stargazers_url":"https://api.github.com/repos/Voxelf/gcc-explorer/stargazers","contributors_url":"https://api.github.com/repos/Voxelf/gcc-explorer/contributors","subscribers_url":"https://api.github.com/repos/Voxelf/gcc-explorer/subscribers","subscription_url":"https://api.github.com/repos/Voxelf/gcc-explorer/subscription","commits_url":"https://api.github.com/repos/Voxelf/gcc-explorer/commits{/sha}","git_commits_url":"https://api.github.com/repos/Voxelf/gcc-explorer/git/commits{/sha}","comments_url":"https://api.github.com/repos/Voxelf/gcc-explorer/comments{/number}","issue_comment_url":"https://api.github.com/repos/Voxelf/gcc-explorer/issues/comments{/number}","contents_url":"https://api.github.com/repos/Voxelf/gcc-explorer/contents/{+path}","compare_url":"https://api.github.com/repos/Voxelf/gcc-explorer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Voxelf/gcc-explorer/merges","archive_url":"https://api.github.com/repos/Voxelf/gcc-explorer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Voxelf/gcc-explorer/downloads","issues_url":"https://api.github.com/repos/Voxelf/gcc-explorer/issues{/number}","pulls_url":"https://api.github.com/repos/Voxelf/gcc-explorer/pulls{/number}","milestones_url":"https://api.github.com/repos/Voxelf/gcc-explorer/milestones{/number}","notifications_url":"https://api.github.com/repos/Voxelf/gcc-explorer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Voxelf/gcc-explorer/labels{/name}","releases_url":"https://api.github.com/repos/Voxelf/gcc-explorer/releases{/id}","deployments_url":"https://api.github.com/repos/Voxelf/gcc-explorer/deployments","created_at":"2016-07-01T08:30:12Z","updated_at":"2016-07-01T08:30:13Z","pushed_at":"2016-07-04T16:21:51Z","git_url":"git://github.com/Voxelf/gcc-explorer.git","ssh_url":"git@github.com:Voxelf/gcc-explorer.git","clone_url":"https://github.com/Voxelf/gcc-explorer.git","svn_url":"https://github.com/Voxelf/gcc-explorer","homepage":"http://gcc.godbolt.org/","size":1858,"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":"mattgodbolt:master","ref":"master","sha":"1bcb8b9e5e6bb50f7c73c56137a705bf1812c2d0","user":{"login":"mattgodbolt","id":633973,"avatar_url":"https://avatars.githubusercontent.com/u/633973?v=3","gravatar_id":"","url":"https://api.github.com/users/mattgodbolt","html_url":"https://github.com/mattgodbolt","followers_url":"https://api.github.com/users/mattgodbolt/followers","following_url":"https://api.github.com/users/mattgodbolt/following{/other_user}","gists_url":"https://api.github.com/users/mattgodbolt/gists{/gist_id}","starred_url":"https://api.github.com/users/mattgodbolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattgodbolt/subscriptions","organizations_url":"https://api.github.com/users/mattgodbolt/orgs","repos_url":"https://api.github.com/users/mattgodbolt/repos","events_url":"https://api.github.com/users/mattgodbolt/events{/privacy}","received_events_url":"https://api.github.com/users/mattgodbolt/received_events","type":"User","site_admin":false},"repo":{"id":4414698,"name":"gcc-explorer","full_name":"mattgodbolt/gcc-explorer","owner":{"login":"mattgodbolt","id":633973,"avatar_url":"https://avatars.githubusercontent.com/u/633973?v=3","gravatar_id":"","url":"https://api.github.com/users/mattgodbolt","html_url":"https://github.com/mattgodbolt","followers_url":"https://api.github.com/users/mattgodbolt/followers","following_url":"https://api.github.com/users/mattgodbolt/following{/other_user}","gists_url":"https://api.github.com/users/mattgodbolt/gists{/gist_id}","starred_url":"https://api.github.com/users/mattgodbolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattgodbolt/subscriptions","organizations_url":"https://api.github.com/users/mattgodbolt/orgs","repos_url":"https://api.github.com/users/mattgodbolt/repos","events_url":"https://api.github.com/users/mattgodbolt/events{/privacy}","received_events_url":"https://api.github.com/users/mattgodbolt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattgodbolt/gcc-explorer","description":"Run GCC (and other compilers) interactively from your web browser and experiment with its generated code","fork":false,"url":"https://api.github.com/repos/mattgodbolt/gcc-explorer","forks_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/forks","keys_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/teams","hooks_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/hooks","issue_events_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/issues/events{/number}","events_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/events","assignees_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/assignees{/user}","branches_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/branches{/branch}","tags_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/tags","blobs_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/statuses/{sha}","languages_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/languages","stargazers_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/stargazers","contributors_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/contributors","subscribers_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/subscribers","subscription_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/subscription","commits_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/contents/{+path}","compare_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/merges","archive_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/downloads","issues_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/issues{/number}","pulls_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/pulls{/number}","milestones_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/milestones{/number}","notifications_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/labels{/name}","releases_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/releases{/id}","deployments_url":"https://api.github.com/repos/mattgodbolt/gcc-explorer/deployments","created_at":"2012-05-23T01:31:17Z","updated_at":"2016-08-01T16:15:17Z","pushed_at":"2016-08-02T13:58:13Z","git_url":"git://github.com/mattgodbolt/gcc-explorer.git","ssh_url":"git@github.com:mattgodbolt/gcc-explorer.git","clone_url":"https://github.com/mattgodbolt/gcc-explorer.git","svn_url":"https://github.com/mattgodbolt/gcc-explorer","homepage":"http://gcc.godbolt.org/","size":2088,"stargazers_count":1613,"watchers_count":1613,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":270,"mirror_url":null,"open_issues_count":43,"forks":270,"open_issues":43,"watchers":1613,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattgodbolt/gcc-explorer/pulls/135"},"html":{"href":"https://github.com/mattgodbolt/gcc-explorer/pull/135"},"issue":{"href":"https://api.github.com/repos/mattgodbolt/gcc-explorer/issues/135"},"comments":{"href":"https://api.github.com/repos/mattgodbolt/gcc-explorer/issues/135/comments"},"review_comments":{"href":"https://api.github.com/repos/mattgodbolt/gcc-explorer/pulls/135/comments"},"review_comment":{"href":"https://api.github.com/repos/mattgodbolt/gcc-explorer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattgodbolt/gcc-explorer/pulls/135/commits"},"statuses":{"href":"https://api.github.com/repos/mattgodbolt/gcc-explorer/statuses/9f23ac54e825dbea88469ced46ce07d0a32d26c2"}}}}
{"actor":{"display_login":"mattgodbolt"}}