{"action":"created","comment":{"url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls/comments/64977846","id":64977846,"diff_hunk":"@@ -187,4 +208,126 @@\n     @Html.ActionLink(\"Back to the opportunity list\", \"Index\")@*can't seem to make this a button like on the other opportunity views*@\n </div>\n \n+<script type=\"text/javascript\">\n+    function addSelectedMajor() {\n+        var selectlist = document.getElementById(\"Majors\");\n+        var option = selectlist.options[selectlist.selectedIndex];\n+\n+        if (option.value) {\n+            var majorlist = $(\"ol\");\n+            var li = document.createElement(\"li\");\n+            var newele = \"\";\n+            var id = option.value;\n+\n+            li.value = id;\n+            li.innerText = option.text;\n+            li.style = \"display: inline-block;\";\n+\n+            newele = '<div id=\"' + id + '\">\\n';\n+            newele += '<button type=\"button\" onclick=\"removeMajor(' + id + ');\">X</button> ';\n+            newele += '<li style=\"display:inline-block;\" value=\"' + id + '\">' + option.text + '</li>\\n';\n+            newele += '<br />';\n+            newele += '</div>';\n+\n+            majorlist.append(newele);\n+\n+            selectlist.remove(selectlist.selectedIndex);\n+\n+            addListValueToForm(li);\n+        }\n+    }\n+\n+    function removeMajor(id) {\n+        var majorDivs = $(\"ol div\");\n+        var hiddenFields = document.getElementsByName(\"MajorIDs\");\n \n+        for (var i = 0; i < majorDivs.length; i++) {\n+            if (majorDivs[i].id == id) {\n+                var div = majorDivs[i];\n+                var major = div.children[1];\n+                var option = document.createElement(\"option\");\n+                option.value = id;\n+                option.innerText = major.innerText;\n+\n+                var selectlist = document.getElementById(\"Majors\");\n+                selectlist.appendChild(option);\n+\n+                div.remove();\n+                break;\n+            }\n+        }\n+\n+        for (var i = 0; i < hiddenFields.length; i++) {\n+            if (hiddenFields[i].value == id) {\n+                hiddenFields[i].remove();\n+                break;\n+            }\n+        }\n+    }\n+\n+    function addCurrentMajors() {\n+        var majors = $(\"ol li\");\n+\n+        for (var i = 0; i < majors.length; i++) {\n+            addListValueToForm(majors[i]);\n+        }\n+    }\n+\n+    function addListValueToForm(item) {\n+        var form = $(\"form\"),\n+            majorid = item.value;\n+\n+        form.append('<input type=\"hidden\" name=\"MajorIDs\" value=\"' + majorid + '\" />')\n+    }\n+\n+    function getMajorsForDepartment(deptlist) {\n+        var id = deptlist.options[deptlist.selectedIndex].value;\n+        var topOption = document.getElementById(\"top-opt\");\n+        var majorSelect = document.getElementById(\"Majors\");\n+        var mlen = majorSelect.length;\n+        var curMajors = document.getElementsByName(\"MajorIDs\");\n+        var inList = false;\n+\n+        for (var i = 0; i < mlen - 1; i++) {\n+                majorSelect.remove(1);\n+        }\n+\n+\n+        if (id) {\n+            topOption.innerText = \"Loading...\";\n+\n+            $.post(\"/coop/getmajorsfordepartment\", { id: id }, function (majors) {\n+                for (var i = 0; i < majors.length; i++) {\n+                    for (var j = 0; j < curMajors.length; j++) {\n+                        if (curMajors[j].value == majors[i].MajorID)\n+                            inList = true;\n+                    }\n+\n+                    if (!inList) {\n+                        var option = document.createElement(\"option\");\n+                        option.value = majors[i].MajorID;","path":"Coop_Listing_Site/Coop_Listing_Site/Views/Coop/AddOpportunity.cshtml","position":149,"original_position":145,"commit_id":"6ebb1da6440792a442f60c817b6148dbbe6e7fc7","original_commit_id":"df6314ecb5dbc15dc7e1feb74407df0b7ba4e766","user":{"login":"Chef-Code","id":11050274,"avatar_url":"https://avatars.githubusercontent.com/u/11050274?v=3","gravatar_id":"","url":"https://api.github.com/users/Chef-Code","html_url":"https://github.com/Chef-Code","followers_url":"https://api.github.com/users/Chef-Code/followers","following_url":"https://api.github.com/users/Chef-Code/following{/other_user}","gists_url":"https://api.github.com/users/Chef-Code/gists{/gist_id}","starred_url":"https://api.github.com/users/Chef-Code/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chef-Code/subscriptions","organizations_url":"https://api.github.com/users/Chef-Code/orgs","repos_url":"https://api.github.com/users/Chef-Code/repos","events_url":"https://api.github.com/users/Chef-Code/events{/privacy}","received_events_url":"https://api.github.com/users/Chef-Code/received_events","type":"User","site_admin":false},"body":"@Kethsar \r\nIs it populated from this line of code?","created_at":"2016-05-27T23:27:46Z","updated_at":"2016-05-27T23:27:46Z","html_url":"https://github.com/CS297Sp16/LCC_Co-op_Site/pull/81#discussion_r64977846","pull_request_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls/81","_links":{"self":{"href":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls/comments/64977846"},"html":{"href":"https://github.com/CS297Sp16/LCC_Co-op_Site/pull/81#discussion_r64977846"},"pull_request":{"href":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls/81"}}},"pull_request":{"url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls/81","id":71665306,"html_url":"https://github.com/CS297Sp16/LCC_Co-op_Site/pull/81","diff_url":"https://github.com/CS297Sp16/LCC_Co-op_Site/pull/81.diff","patch_url":"https://github.com/CS297Sp16/LCC_Co-op_Site/pull/81.patch","issue_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/issues/81","number":81,"state":"open","locked":false,"title":"View model switch","user":{"login":"Kethsar","id":5915757,"avatar_url":"https://avatars.githubusercontent.com/u/5915757?v=3","gravatar_id":"","url":"https://api.github.com/users/Kethsar","html_url":"https://github.com/Kethsar","followers_url":"https://api.github.com/users/Kethsar/followers","following_url":"https://api.github.com/users/Kethsar/following{/other_user}","gists_url":"https://api.github.com/users/Kethsar/gists{/gist_id}","starred_url":"https://api.github.com/users/Kethsar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kethsar/subscriptions","organizations_url":"https://api.github.com/users/Kethsar/orgs","repos_url":"https://api.github.com/users/Kethsar/repos","events_url":"https://api.github.com/users/Kethsar/events{/privacy}","received_events_url":"https://api.github.com/users/Kethsar/received_events","type":"User","site_admin":false},"body":"Transitioned methods for Departments and Opportunities to use View Models\r\nIncorporated nifty JavaScript for adding majors to Departments and Opportunities\r\n","created_at":"2016-05-27T06:19:22Z","updated_at":"2016-05-27T23:27:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67f8e36c5fb4f5287fa186c77f777068b47d9560","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls/81/commits","review_comments_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls/81/comments","review_comment_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/issues/81/comments","statuses_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/statuses/6ebb1da6440792a442f60c817b6148dbbe6e7fc7","head":{"label":"CS297Sp16:view_model_switch","ref":"view_model_switch","sha":"6ebb1da6440792a442f60c817b6148dbbe6e7fc7","user":{"login":"CS297Sp16","id":17628471,"avatar_url":"https://avatars.githubusercontent.com/u/17628471?v=3","gravatar_id":"","url":"https://api.github.com/users/CS297Sp16","html_url":"https://github.com/CS297Sp16","followers_url":"https://api.github.com/users/CS297Sp16/followers","following_url":"https://api.github.com/users/CS297Sp16/following{/other_user}","gists_url":"https://api.github.com/users/CS297Sp16/gists{/gist_id}","starred_url":"https://api.github.com/users/CS297Sp16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CS297Sp16/subscriptions","organizations_url":"https://api.github.com/users/CS297Sp16/orgs","repos_url":"https://api.github.com/users/CS297Sp16/repos","events_url":"https://api.github.com/users/CS297Sp16/events{/privacy}","received_events_url":"https://api.github.com/users/CS297Sp16/received_events","type":"Organization","site_admin":false},"repo":{"id":53094234,"name":"LCC_Co-op_Site","full_name":"CS297Sp16/LCC_Co-op_Site","owner":{"login":"CS297Sp16","id":17628471,"avatar_url":"https://avatars.githubusercontent.com/u/17628471?v=3","gravatar_id":"","url":"https://api.github.com/users/CS297Sp16","html_url":"https://github.com/CS297Sp16","followers_url":"https://api.github.com/users/CS297Sp16/followers","following_url":"https://api.github.com/users/CS297Sp16/following{/other_user}","gists_url":"https://api.github.com/users/CS297Sp16/gists{/gist_id}","starred_url":"https://api.github.com/users/CS297Sp16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CS297Sp16/subscriptions","organizations_url":"https://api.github.com/users/CS297Sp16/orgs","repos_url":"https://api.github.com/users/CS297Sp16/repos","events_url":"https://api.github.com/users/CS297Sp16/events{/privacy}","received_events_url":"https://api.github.com/users/CS297Sp16/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CS297Sp16/LCC_Co-op_Site","description":"Potential new website to list LCC Co-op opportunities","fork":false,"url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site","forks_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/forks","keys_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/teams","hooks_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/hooks","issue_events_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/issues/events{/number}","events_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/events","assignees_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/assignees{/user}","branches_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/branches{/branch}","tags_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/tags","blobs_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/git/refs{/sha}","trees_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/statuses/{sha}","languages_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/languages","stargazers_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/stargazers","contributors_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/contributors","subscribers_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/subscribers","subscription_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/subscription","commits_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/commits{/sha}","git_commits_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/git/commits{/sha}","comments_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/comments{/number}","issue_comment_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/issues/comments{/number}","contents_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/contents/{+path}","compare_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/merges","archive_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/downloads","issues_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/issues{/number}","pulls_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls{/number}","milestones_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/milestones{/number}","notifications_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/labels{/name}","releases_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/releases{/id}","deployments_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/deployments","created_at":"2016-03-04T00:20:12Z","updated_at":"2016-05-27T21:02:24Z","pushed_at":"2016-05-27T17:58:47Z","git_url":"git://github.com/CS297Sp16/LCC_Co-op_Site.git","ssh_url":"git@github.com:CS297Sp16/LCC_Co-op_Site.git","clone_url":"https://github.com/CS297Sp16/LCC_Co-op_Site.git","svn_url":"https://github.com/CS297Sp16/LCC_Co-op_Site","homepage":null,"size":2579,"stargazers_count":3,"watchers_count":3,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":3,"default_branch":"master"}},"base":{"label":"CS297Sp16:master","ref":"master","sha":"dc703457471bd9788be5c3ebed94f1eebeedca7f","user":{"login":"CS297Sp16","id":17628471,"avatar_url":"https://avatars.githubusercontent.com/u/17628471?v=3","gravatar_id":"","url":"https://api.github.com/users/CS297Sp16","html_url":"https://github.com/CS297Sp16","followers_url":"https://api.github.com/users/CS297Sp16/followers","following_url":"https://api.github.com/users/CS297Sp16/following{/other_user}","gists_url":"https://api.github.com/users/CS297Sp16/gists{/gist_id}","starred_url":"https://api.github.com/users/CS297Sp16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CS297Sp16/subscriptions","organizations_url":"https://api.github.com/users/CS297Sp16/orgs","repos_url":"https://api.github.com/users/CS297Sp16/repos","events_url":"https://api.github.com/users/CS297Sp16/events{/privacy}","received_events_url":"https://api.github.com/users/CS297Sp16/received_events","type":"Organization","site_admin":false},"repo":{"id":53094234,"name":"LCC_Co-op_Site","full_name":"CS297Sp16/LCC_Co-op_Site","owner":{"login":"CS297Sp16","id":17628471,"avatar_url":"https://avatars.githubusercontent.com/u/17628471?v=3","gravatar_id":"","url":"https://api.github.com/users/CS297Sp16","html_url":"https://github.com/CS297Sp16","followers_url":"https://api.github.com/users/CS297Sp16/followers","following_url":"https://api.github.com/users/CS297Sp16/following{/other_user}","gists_url":"https://api.github.com/users/CS297Sp16/gists{/gist_id}","starred_url":"https://api.github.com/users/CS297Sp16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CS297Sp16/subscriptions","organizations_url":"https://api.github.com/users/CS297Sp16/orgs","repos_url":"https://api.github.com/users/CS297Sp16/repos","events_url":"https://api.github.com/users/CS297Sp16/events{/privacy}","received_events_url":"https://api.github.com/users/CS297Sp16/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CS297Sp16/LCC_Co-op_Site","description":"Potential new website to list LCC Co-op opportunities","fork":false,"url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site","forks_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/forks","keys_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/teams","hooks_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/hooks","issue_events_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/issues/events{/number}","events_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/events","assignees_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/assignees{/user}","branches_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/branches{/branch}","tags_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/tags","blobs_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/git/refs{/sha}","trees_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/statuses/{sha}","languages_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/languages","stargazers_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/stargazers","contributors_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/contributors","subscribers_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/subscribers","subscription_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/subscription","commits_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/commits{/sha}","git_commits_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/git/commits{/sha}","comments_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/comments{/number}","issue_comment_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/issues/comments{/number}","contents_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/contents/{+path}","compare_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/merges","archive_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/downloads","issues_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/issues{/number}","pulls_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls{/number}","milestones_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/milestones{/number}","notifications_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/labels{/name}","releases_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/releases{/id}","deployments_url":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/deployments","created_at":"2016-03-04T00:20:12Z","updated_at":"2016-05-27T21:02:24Z","pushed_at":"2016-05-27T17:58:47Z","git_url":"git://github.com/CS297Sp16/LCC_Co-op_Site.git","ssh_url":"git@github.com:CS297Sp16/LCC_Co-op_Site.git","clone_url":"https://github.com/CS297Sp16/LCC_Co-op_Site.git","svn_url":"https://github.com/CS297Sp16/LCC_Co-op_Site","homepage":null,"size":2579,"stargazers_count":3,"watchers_count":3,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls/81"},"html":{"href":"https://github.com/CS297Sp16/LCC_Co-op_Site/pull/81"},"issue":{"href":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/issues/81"},"comments":{"href":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/issues/81/comments"},"review_comments":{"href":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls/81/comments"},"review_comment":{"href":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/pulls/81/commits"},"statuses":{"href":"https://api.github.com/repos/CS297Sp16/LCC_Co-op_Site/statuses/6ebb1da6440792a442f60c817b6148dbbe6e7fc7"}}}}
{"actor":{"display_login":"Chef-Code"}}