{"action":"created","comment":{"url":"https://api.github.com/repos/projecthydra/curation_concerns/pulls/comments/77029098","id":77029098,"diff_hunk":"@@ -82,4 +87,40 @@ export default class SortManager {\n       }\n     ).toArray()\n   }\n+\n+  get alpha_sort_button() {\n+    return $(\"*[data-action='alpha-sort-action']\")\n+  }\n+\n+  initialize_alpha_sort_button() {\n+    Blacklight.onLoad(() => {\n+      let that = this\n+      this.alpha_sort_button.click(function() { that.sort_alpha() } )\n+    })\n+  }\n+\n+  sort_alpha() {\n+    // create array of { title, element } objects\n+    let array = []\n+    let children = this.element.children().get()\n+    children.forEach(function(child) {\n+      let title = $(child).find(\"input.title\").val()\n+      array.push(\n+        { title: title,\n+          element: child }\n+      )\n+    })\n+    // sort array by title of each object\n+    array.sort(function(o1, o2) {\n+      let a = o1.title.toLowerCase()\n+      let b = o2.title.toLowerCase()\n+      return a < b ? -1 : (a > b ? 1 : 0);\n+    });\n+    // replace contents of #sortable with elements from the array\n+    this.element.empty()","path":"app/assets/javascripts/curation_concerns/file_manager/sorting.es6","position":69,"original_position":69,"commit_id":"acf6da6939e3070fb6037de40421ff5130652c55","original_commit_id":"acf6da6939e3070fb6037de40421ff5130652c55","user":{"login":"tpendragon","id":2806645,"avatar_url":"https://avatars.githubusercontent.com/u/2806645?v=3","gravatar_id":"","url":"https://api.github.com/users/tpendragon","html_url":"https://github.com/tpendragon","followers_url":"https://api.github.com/users/tpendragon/followers","following_url":"https://api.github.com/users/tpendragon/following{/other_user}","gists_url":"https://api.github.com/users/tpendragon/gists{/gist_id}","starred_url":"https://api.github.com/users/tpendragon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpendragon/subscriptions","organizations_url":"https://api.github.com/users/tpendragon/orgs","repos_url":"https://api.github.com/users/tpendragon/repos","events_url":"https://api.github.com/users/tpendragon/events{/privacy}","received_events_url":"https://api.github.com/users/tpendragon/received_events","type":"User","site_admin":false},"body":"Does sorting still work after you re-order this way? I'm not sure how grumpy jquery-ui-sortable gets if you delete its container contents.","created_at":"2016-08-31T17:07:42Z","updated_at":"2016-08-31T17:07:42Z","html_url":"https://github.com/projecthydra/curation_concerns/pull/947#discussion_r77029098","pull_request_url":"https://api.github.com/repos/projecthydra/curation_concerns/pulls/947","_links":{"self":{"href":"https://api.github.com/repos/projecthydra/curation_concerns/pulls/comments/77029098"},"html":{"href":"https://github.com/projecthydra/curation_concerns/pull/947#discussion_r77029098"},"pull_request":{"href":"https://api.github.com/repos/projecthydra/curation_concerns/pulls/947"}}},"pull_request":{"url":"https://api.github.com/repos/projecthydra/curation_concerns/pulls/947","id":83161692,"html_url":"https://github.com/projecthydra/curation_concerns/pull/947","diff_url":"https://github.com/projecthydra/curation_concerns/pull/947.diff","patch_url":"https://github.com/projecthydra/curation_concerns/pull/947.patch","issue_url":"https://api.github.com/repos/projecthydra/curation_concerns/issues/947","number":947,"state":"open","locked":false,"title":"Add alphabetical sort to file manager","user":{"login":"hackmastera","id":845363,"avatar_url":"https://avatars.githubusercontent.com/u/845363?v=3","gravatar_id":"","url":"https://api.github.com/users/hackmastera","html_url":"https://github.com/hackmastera","followers_url":"https://api.github.com/users/hackmastera/followers","following_url":"https://api.github.com/users/hackmastera/following{/other_user}","gists_url":"https://api.github.com/users/hackmastera/gists{/gist_id}","starred_url":"https://api.github.com/users/hackmastera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackmastera/subscriptions","organizations_url":"https://api.github.com/users/hackmastera/orgs","repos_url":"https://api.github.com/users/hackmastera/repos","events_url":"https://api.github.com/users/hackmastera/events{/privacy}","received_events_url":"https://api.github.com/users/hackmastera/received_events","type":"User","site_admin":false},"body":"Here's my approach; any comments, @tpendragon or @jcoyne ?\r\n\r\nThanks!","created_at":"2016-08-29T20:26:29Z","updated_at":"2016-08-31T17:07:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0b7025542321381110fcecfa836d1c6026a3080","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/projecthydra/curation_concerns/pulls/947/commits","review_comments_url":"https://api.github.com/repos/projecthydra/curation_concerns/pulls/947/comments","review_comment_url":"https://api.github.com/repos/projecthydra/curation_concerns/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projecthydra/curation_concerns/issues/947/comments","statuses_url":"https://api.github.com/repos/projecthydra/curation_concerns/statuses/acf6da6939e3070fb6037de40421ff5130652c55","head":{"label":"projecthydra:fm-alphasort#929","ref":"fm-alphasort#929","sha":"acf6da6939e3070fb6037de40421ff5130652c55","user":{"login":"projecthydra","id":109426,"avatar_url":"https://avatars.githubusercontent.com/u/109426?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra","html_url":"https://github.com/projecthydra","followers_url":"https://api.github.com/users/projecthydra/followers","following_url":"https://api.github.com/users/projecthydra/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra/subscriptions","organizations_url":"https://api.github.com/users/projecthydra/orgs","repos_url":"https://api.github.com/users/projecthydra/repos","events_url":"https://api.github.com/users/projecthydra/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra/received_events","type":"Organization","site_admin":false},"repo":{"id":35563024,"name":"curation_concerns","full_name":"projecthydra/curation_concerns","owner":{"login":"projecthydra","id":109426,"avatar_url":"https://avatars.githubusercontent.com/u/109426?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra","html_url":"https://github.com/projecthydra","followers_url":"https://api.github.com/users/projecthydra/followers","following_url":"https://api.github.com/users/projecthydra/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra/subscriptions","organizations_url":"https://api.github.com/users/projecthydra/orgs","repos_url":"https://api.github.com/users/projecthydra/repos","events_url":"https://api.github.com/users/projecthydra/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projecthydra/curation_concerns","description":"A Hydra-based Rails Engine that extends an application, adding the ability to Create, Read, Update and Destroy (CRUD) objects (based on Hydra::Works) and providing a generator for defining object types with custom workflows, views, access controls, etc.","fork":false,"url":"https://api.github.com/repos/projecthydra/curation_concerns","forks_url":"https://api.github.com/repos/projecthydra/curation_concerns/forks","keys_url":"https://api.github.com/repos/projecthydra/curation_concerns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projecthydra/curation_concerns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projecthydra/curation_concerns/teams","hooks_url":"https://api.github.com/repos/projecthydra/curation_concerns/hooks","issue_events_url":"https://api.github.com/repos/projecthydra/curation_concerns/issues/events{/number}","events_url":"https://api.github.com/repos/projecthydra/curation_concerns/events","assignees_url":"https://api.github.com/repos/projecthydra/curation_concerns/assignees{/user}","branches_url":"https://api.github.com/repos/projecthydra/curation_concerns/branches{/branch}","tags_url":"https://api.github.com/repos/projecthydra/curation_concerns/tags","blobs_url":"https://api.github.com/repos/projecthydra/curation_concerns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projecthydra/curation_concerns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projecthydra/curation_concerns/git/refs{/sha}","trees_url":"https://api.github.com/repos/projecthydra/curation_concerns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projecthydra/curation_concerns/statuses/{sha}","languages_url":"https://api.github.com/repos/projecthydra/curation_concerns/languages","stargazers_url":"https://api.github.com/repos/projecthydra/curation_concerns/stargazers","contributors_url":"https://api.github.com/repos/projecthydra/curation_concerns/contributors","subscribers_url":"https://api.github.com/repos/projecthydra/curation_concerns/subscribers","subscription_url":"https://api.github.com/repos/projecthydra/curation_concerns/subscription","commits_url":"https://api.github.com/repos/projecthydra/curation_concerns/commits{/sha}","git_commits_url":"https://api.github.com/repos/projecthydra/curation_concerns/git/commits{/sha}","comments_url":"https://api.github.com/repos/projecthydra/curation_concerns/comments{/number}","issue_comment_url":"https://api.github.com/repos/projecthydra/curation_concerns/issues/comments{/number}","contents_url":"https://api.github.com/repos/projecthydra/curation_concerns/contents/{+path}","compare_url":"https://api.github.com/repos/projecthydra/curation_concerns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projecthydra/curation_concerns/merges","archive_url":"https://api.github.com/repos/projecthydra/curation_concerns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projecthydra/curation_concerns/downloads","issues_url":"https://api.github.com/repos/projecthydra/curation_concerns/issues{/number}","pulls_url":"https://api.github.com/repos/projecthydra/curation_concerns/pulls{/number}","milestones_url":"https://api.github.com/repos/projecthydra/curation_concerns/milestones{/number}","notifications_url":"https://api.github.com/repos/projecthydra/curation_concerns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projecthydra/curation_concerns/labels{/name}","releases_url":"https://api.github.com/repos/projecthydra/curation_concerns/releases{/id}","deployments_url":"https://api.github.com/repos/projecthydra/curation_concerns/deployments","created_at":"2015-05-13T17:17:45Z","updated_at":"2016-06-26T17:43:56Z","pushed_at":"2016-08-31T16:45:44Z","git_url":"git://github.com/projecthydra/curation_concerns.git","ssh_url":"git@github.com:projecthydra/curation_concerns.git","clone_url":"https://github.com/projecthydra/curation_concerns.git","svn_url":"https://github.com/projecthydra/curation_concerns","homepage":"","size":4486,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":44,"forks":18,"open_issues":44,"watchers":10,"default_branch":"master"}},"base":{"label":"projecthydra:master","ref":"master","sha":"36fda61ecd7b4dc1a70c5b99a2126e4e6ac05536","user":{"login":"projecthydra","id":109426,"avatar_url":"https://avatars.githubusercontent.com/u/109426?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra","html_url":"https://github.com/projecthydra","followers_url":"https://api.github.com/users/projecthydra/followers","following_url":"https://api.github.com/users/projecthydra/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra/subscriptions","organizations_url":"https://api.github.com/users/projecthydra/orgs","repos_url":"https://api.github.com/users/projecthydra/repos","events_url":"https://api.github.com/users/projecthydra/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra/received_events","type":"Organization","site_admin":false},"repo":{"id":35563024,"name":"curation_concerns","full_name":"projecthydra/curation_concerns","owner":{"login":"projecthydra","id":109426,"avatar_url":"https://avatars.githubusercontent.com/u/109426?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra","html_url":"https://github.com/projecthydra","followers_url":"https://api.github.com/users/projecthydra/followers","following_url":"https://api.github.com/users/projecthydra/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra/subscriptions","organizations_url":"https://api.github.com/users/projecthydra/orgs","repos_url":"https://api.github.com/users/projecthydra/repos","events_url":"https://api.github.com/users/projecthydra/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projecthydra/curation_concerns","description":"A Hydra-based Rails Engine that extends an application, adding the ability to Create, Read, Update and Destroy (CRUD) objects (based on Hydra::Works) and providing a generator for defining object types with custom workflows, views, access controls, etc.","fork":false,"url":"https://api.github.com/repos/projecthydra/curation_concerns","forks_url":"https://api.github.com/repos/projecthydra/curation_concerns/forks","keys_url":"https://api.github.com/repos/projecthydra/curation_concerns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projecthydra/curation_concerns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projecthydra/curation_concerns/teams","hooks_url":"https://api.github.com/repos/projecthydra/curation_concerns/hooks","issue_events_url":"https://api.github.com/repos/projecthydra/curation_concerns/issues/events{/number}","events_url":"https://api.github.com/repos/projecthydra/curation_concerns/events","assignees_url":"https://api.github.com/repos/projecthydra/curation_concerns/assignees{/user}","branches_url":"https://api.github.com/repos/projecthydra/curation_concerns/branches{/branch}","tags_url":"https://api.github.com/repos/projecthydra/curation_concerns/tags","blobs_url":"https://api.github.com/repos/projecthydra/curation_concerns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projecthydra/curation_concerns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projecthydra/curation_concerns/git/refs{/sha}","trees_url":"https://api.github.com/repos/projecthydra/curation_concerns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projecthydra/curation_concerns/statuses/{sha}","languages_url":"https://api.github.com/repos/projecthydra/curation_concerns/languages","stargazers_url":"https://api.github.com/repos/projecthydra/curation_concerns/stargazers","contributors_url":"https://api.github.com/repos/projecthydra/curation_concerns/contributors","subscribers_url":"https://api.github.com/repos/projecthydra/curation_concerns/subscribers","subscription_url":"https://api.github.com/repos/projecthydra/curation_concerns/subscription","commits_url":"https://api.github.com/repos/projecthydra/curation_concerns/commits{/sha}","git_commits_url":"https://api.github.com/repos/projecthydra/curation_concerns/git/commits{/sha}","comments_url":"https://api.github.com/repos/projecthydra/curation_concerns/comments{/number}","issue_comment_url":"https://api.github.com/repos/projecthydra/curation_concerns/issues/comments{/number}","contents_url":"https://api.github.com/repos/projecthydra/curation_concerns/contents/{+path}","compare_url":"https://api.github.com/repos/projecthydra/curation_concerns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projecthydra/curation_concerns/merges","archive_url":"https://api.github.com/repos/projecthydra/curation_concerns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projecthydra/curation_concerns/downloads","issues_url":"https://api.github.com/repos/projecthydra/curation_concerns/issues{/number}","pulls_url":"https://api.github.com/repos/projecthydra/curation_concerns/pulls{/number}","milestones_url":"https://api.github.com/repos/projecthydra/curation_concerns/milestones{/number}","notifications_url":"https://api.github.com/repos/projecthydra/curation_concerns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projecthydra/curation_concerns/labels{/name}","releases_url":"https://api.github.com/repos/projecthydra/curation_concerns/releases{/id}","deployments_url":"https://api.github.com/repos/projecthydra/curation_concerns/deployments","created_at":"2015-05-13T17:17:45Z","updated_at":"2016-06-26T17:43:56Z","pushed_at":"2016-08-31T16:45:44Z","git_url":"git://github.com/projecthydra/curation_concerns.git","ssh_url":"git@github.com:projecthydra/curation_concerns.git","clone_url":"https://github.com/projecthydra/curation_concerns.git","svn_url":"https://github.com/projecthydra/curation_concerns","homepage":"","size":4486,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":44,"forks":18,"open_issues":44,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projecthydra/curation_concerns/pulls/947"},"html":{"href":"https://github.com/projecthydra/curation_concerns/pull/947"},"issue":{"href":"https://api.github.com/repos/projecthydra/curation_concerns/issues/947"},"comments":{"href":"https://api.github.com/repos/projecthydra/curation_concerns/issues/947/comments"},"review_comments":{"href":"https://api.github.com/repos/projecthydra/curation_concerns/pulls/947/comments"},"review_comment":{"href":"https://api.github.com/repos/projecthydra/curation_concerns/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projecthydra/curation_concerns/pulls/947/commits"},"statuses":{"href":"https://api.github.com/repos/projecthydra/curation_concerns/statuses/acf6da6939e3070fb6037de40421ff5130652c55"}}}}
{"actor":{"display_login":"tpendragon"}}