{"action":"created","comment":{"url":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls/comments/30377677","id":30377677,"diff_hunk":"@@ -0,0 +1,42 @@\n+function UserDefinedInBasic() {\n+}\n+\n+UserDefinedInBasic.prototype.init = function(record_type, fields, read_only_view) {\n+    var bi = $(\"#basic_information\");\n+\n+    if (bi.length == 0) {\n+        // Section not visible yet (e.g. on a Resource edit page).  We'll try\n+        // again when the event fires.\n+        return false;\n+    }\n+\n+    // add user defined if necessary, and disable remove button\n+    var user_defined_section = $('section.subrecord-form[data-object-name=\"user_defined\"]');\n+    var remove_btn = user_defined_section.find('.subrecord-form-remove');\n+    if (remove_btn.length == 0) {\n+        user_defined_section.find('.btn-default').filter(':visible').click();\n+        remove_btn.attr('disabled', 'disabled');\n+        window.scrollTo(0,0);\n+    } else {\n+        remove_btn.attr('disabled', 'disabled');\n+    }\n+\n+    fields.map(function (field) {\n+        // Find our fields of interest by their label text\n+        var fld_lab = $('.control-label').filter(function() { return $(this).text() === field });\n+\n+        if (fld_lab.length > 0) {\n+            if (read_only_view) {","path":"frontend/assets/user_defined_in_basic.js","position":29,"original_position":29,"commit_id":"515e5202d1fce24668c0403b09dcebace5ee3622","original_commit_id":"515e5202d1fce24668c0403b09dcebace5ee3622","user":{"login":"marktriggs","id":149123,"avatar_url":"https://avatars.githubusercontent.com/u/149123?v=3","gravatar_id":"","url":"https://api.github.com/users/marktriggs","html_url":"https://github.com/marktriggs","followers_url":"https://api.github.com/users/marktriggs/followers","following_url":"https://api.github.com/users/marktriggs/following{/other_user}","gists_url":"https://api.github.com/users/marktriggs/gists{/gist_id}","starred_url":"https://api.github.com/users/marktriggs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marktriggs/subscriptions","organizations_url":"https://api.github.com/users/marktriggs/orgs","repos_url":"https://api.github.com/users/marktriggs/repos","events_url":"https://api.github.com/users/marktriggs/events{/privacy}","received_events_url":"https://api.github.com/users/marktriggs/received_events","type":"User","site_admin":false},"body":":mask:","created_at":"2015-05-15T00:43:49Z","updated_at":"2015-05-15T00:43:49Z","html_url":"https://github.com/hudmol/user_defined_in_basic/pull/1#discussion_r30377677","pull_request_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls/comments/30377677"},"html":{"href":"https://github.com/hudmol/user_defined_in_basic/pull/1#discussion_r30377677"},"pull_request":{"href":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls/1","id":35476110,"html_url":"https://github.com/hudmol/user_defined_in_basic/pull/1","diff_url":"https://github.com/hudmol/user_defined_in_basic/pull/1.diff","patch_url":"https://github.com/hudmol/user_defined_in_basic/pull/1.patch","issue_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/issues/1","number":1,"state":"open","locked":false,"title":"Mark hacks","user":{"login":"marktriggs","id":149123,"avatar_url":"https://avatars.githubusercontent.com/u/149123?v=3","gravatar_id":"","url":"https://api.github.com/users/marktriggs","html_url":"https://github.com/marktriggs","followers_url":"https://api.github.com/users/marktriggs/followers","following_url":"https://api.github.com/users/marktriggs/following{/other_user}","gists_url":"https://api.github.com/users/marktriggs/gists{/gist_id}","starred_url":"https://api.github.com/users/marktriggs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marktriggs/subscriptions","organizations_url":"https://api.github.com/users/marktriggs/orgs","repos_url":"https://api.github.com/users/marktriggs/repos","events_url":"https://api.github.com/users/marktriggs/events{/privacy}","received_events_url":"https://api.github.com/users/marktriggs/received_events","type":"User","site_admin":false},"body":"Well, this ended up being more in-depth as intended as I stumbled my way through all the pitfalls you found along the way and had several moments of enlightenment of why things were done the way they were :)\r\n\r\nThere were two things I wanted to change:\r\n\r\n  * I didn't want to keep a copy of the `read_only_view`, even though I liked the new name.  I know you just put this here for me to find anyway...\r\n\r\n  * I don't think we can support a .js.erb file in a plugin.  When we've tried these before they blow up because the asset pipeline won't serve out a non-precompiled file.  Muh.  So I had to switch the .js bit to be vanilla JavaScript and pass the stuff it needed from the layout.\r\n\r\nI'll add comments to the major changes, and don't feel like you have to take all my changes.  I just hacked through with no regard for anyone but myself.","created_at":"2015-05-15T00:39:34Z","updated_at":"2015-05-15T00:43:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"461f04070b1161a261a1c840ebff6d4b16039dd7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls/1/commits","review_comments_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls/1/comments","review_comment_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/issues/1/comments","statuses_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/statuses/515e5202d1fce24668c0403b09dcebace5ee3622","head":{"label":"hudmol:mark-hacks","ref":"mark-hacks","sha":"515e5202d1fce24668c0403b09dcebace5ee3622","user":{"login":"hudmol","id":1821448,"avatar_url":"https://avatars.githubusercontent.com/u/1821448?v=3","gravatar_id":"","url":"https://api.github.com/users/hudmol","html_url":"https://github.com/hudmol","followers_url":"https://api.github.com/users/hudmol/followers","following_url":"https://api.github.com/users/hudmol/following{/other_user}","gists_url":"https://api.github.com/users/hudmol/gists{/gist_id}","starred_url":"https://api.github.com/users/hudmol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hudmol/subscriptions","organizations_url":"https://api.github.com/users/hudmol/orgs","repos_url":"https://api.github.com/users/hudmol/repos","events_url":"https://api.github.com/users/hudmol/events{/privacy}","received_events_url":"https://api.github.com/users/hudmol/received_events","type":"Organization","site_admin":false},"repo":{"id":35552424,"name":"user_defined_in_basic","full_name":"hudmol/user_defined_in_basic","owner":{"login":"hudmol","id":1821448,"avatar_url":"https://avatars.githubusercontent.com/u/1821448?v=3","gravatar_id":"","url":"https://api.github.com/users/hudmol","html_url":"https://github.com/hudmol","followers_url":"https://api.github.com/users/hudmol/followers","following_url":"https://api.github.com/users/hudmol/following{/other_user}","gists_url":"https://api.github.com/users/hudmol/gists{/gist_id}","starred_url":"https://api.github.com/users/hudmol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hudmol/subscriptions","organizations_url":"https://api.github.com/users/hudmol/orgs","repos_url":"https://api.github.com/users/hudmol/repos","events_url":"https://api.github.com/users/hudmol/events{/privacy}","received_events_url":"https://api.github.com/users/hudmol/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hudmol/user_defined_in_basic","description":"An ArchivesSpace plugin that displays selected user defined fields in the basic information section","fork":false,"url":"https://api.github.com/repos/hudmol/user_defined_in_basic","forks_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/forks","keys_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/teams","hooks_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/hooks","issue_events_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/issues/events{/number}","events_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/events","assignees_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/assignees{/user}","branches_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/branches{/branch}","tags_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/tags","blobs_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/git/refs{/sha}","trees_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/statuses/{sha}","languages_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/languages","stargazers_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/stargazers","contributors_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/contributors","subscribers_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/subscribers","subscription_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/subscription","commits_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/commits{/sha}","git_commits_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/git/commits{/sha}","comments_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/comments{/number}","issue_comment_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/issues/comments{/number}","contents_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/contents/{+path}","compare_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/merges","archive_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/downloads","issues_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/issues{/number}","pulls_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls{/number}","milestones_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/milestones{/number}","notifications_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/labels{/name}","releases_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/releases{/id}","created_at":"2015-05-13T14:02:43Z","updated_at":"2015-05-14T20:03:48Z","pushed_at":"2015-05-15T00:39:34Z","git_url":"git://github.com/hudmol/user_defined_in_basic.git","ssh_url":"git@github.com:hudmol/user_defined_in_basic.git","clone_url":"https://github.com/hudmol/user_defined_in_basic.git","svn_url":"https://github.com/hudmol/user_defined_in_basic","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"hudmol:master","ref":"master","sha":"d0e20664ae76e4864f106f19bc989fbe6c294fb4","user":{"login":"hudmol","id":1821448,"avatar_url":"https://avatars.githubusercontent.com/u/1821448?v=3","gravatar_id":"","url":"https://api.github.com/users/hudmol","html_url":"https://github.com/hudmol","followers_url":"https://api.github.com/users/hudmol/followers","following_url":"https://api.github.com/users/hudmol/following{/other_user}","gists_url":"https://api.github.com/users/hudmol/gists{/gist_id}","starred_url":"https://api.github.com/users/hudmol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hudmol/subscriptions","organizations_url":"https://api.github.com/users/hudmol/orgs","repos_url":"https://api.github.com/users/hudmol/repos","events_url":"https://api.github.com/users/hudmol/events{/privacy}","received_events_url":"https://api.github.com/users/hudmol/received_events","type":"Organization","site_admin":false},"repo":{"id":35552424,"name":"user_defined_in_basic","full_name":"hudmol/user_defined_in_basic","owner":{"login":"hudmol","id":1821448,"avatar_url":"https://avatars.githubusercontent.com/u/1821448?v=3","gravatar_id":"","url":"https://api.github.com/users/hudmol","html_url":"https://github.com/hudmol","followers_url":"https://api.github.com/users/hudmol/followers","following_url":"https://api.github.com/users/hudmol/following{/other_user}","gists_url":"https://api.github.com/users/hudmol/gists{/gist_id}","starred_url":"https://api.github.com/users/hudmol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hudmol/subscriptions","organizations_url":"https://api.github.com/users/hudmol/orgs","repos_url":"https://api.github.com/users/hudmol/repos","events_url":"https://api.github.com/users/hudmol/events{/privacy}","received_events_url":"https://api.github.com/users/hudmol/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hudmol/user_defined_in_basic","description":"An ArchivesSpace plugin that displays selected user defined fields in the basic information section","fork":false,"url":"https://api.github.com/repos/hudmol/user_defined_in_basic","forks_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/forks","keys_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/teams","hooks_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/hooks","issue_events_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/issues/events{/number}","events_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/events","assignees_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/assignees{/user}","branches_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/branches{/branch}","tags_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/tags","blobs_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/git/refs{/sha}","trees_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/statuses/{sha}","languages_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/languages","stargazers_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/stargazers","contributors_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/contributors","subscribers_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/subscribers","subscription_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/subscription","commits_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/commits{/sha}","git_commits_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/git/commits{/sha}","comments_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/comments{/number}","issue_comment_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/issues/comments{/number}","contents_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/contents/{+path}","compare_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/merges","archive_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/downloads","issues_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/issues{/number}","pulls_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls{/number}","milestones_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/milestones{/number}","notifications_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/labels{/name}","releases_url":"https://api.github.com/repos/hudmol/user_defined_in_basic/releases{/id}","created_at":"2015-05-13T14:02:43Z","updated_at":"2015-05-14T20:03:48Z","pushed_at":"2015-05-15T00:39:34Z","git_url":"git://github.com/hudmol/user_defined_in_basic.git","ssh_url":"git@github.com:hudmol/user_defined_in_basic.git","clone_url":"https://github.com/hudmol/user_defined_in_basic.git","svn_url":"https://github.com/hudmol/user_defined_in_basic","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls/1"},"html":{"href":"https://github.com/hudmol/user_defined_in_basic/pull/1"},"issue":{"href":"https://api.github.com/repos/hudmol/user_defined_in_basic/issues/1"},"comments":{"href":"https://api.github.com/repos/hudmol/user_defined_in_basic/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hudmol/user_defined_in_basic/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/hudmol/user_defined_in_basic/statuses/515e5202d1fce24668c0403b09dcebace5ee3622"}}}}