{"action":"created","comment":{"url":"https://api.github.com/repos/krstffr/reactive-constructor/pulls/comments/27470549","id":27470549,"diff_hunk":"@@ -0,0 +1,188 @@\n+// TODO: Move to a better place\n+var moveInArray = function (array, fromIndex, toIndex) {\n+  array.splice(toIndex, 0, array.splice(fromIndex, 1)[0] );\n+  return array;\n+};\n+\n+Handlebars.registerHelper('getTemplateFromType', function () {\n+\n+  if (!this.type || !this.key)\n+    return 'editTemplate';\n+\n+  // Is it a string? Return the basic template\n+  if (this.type === 'String' || this.type === 'Number')\n+    return 'editTemplate__String';\n+\n+  // Is it a boolean?\n+  if (this.type === 'Boolean')\n+    return 'editTemplate__Boolean';\n+\n+  // Is it a collection of items?\n+  if (this.type.search(/Collection_/g) > -1)\n+    return 'editTemplate__Collection';\n+\n+  // no val? probably a reactive var which is not set?! TODO!\n+  if (!this.value)\n+    return 'editTemplate__noReactiveInstanceSet';\n+\n+  return 'editTemplate';\n+\n+});\n+\n+Handlebars.registerHelper('equals', function(a, b) {\n+  return a === b;\n+});\n+\n+Template.editTemplate__Collection.rendered = function () {\n+\n+  // This is the wrapper for the elements which will be sortable\n+  var sortableWrapper = this.find('.collection__items');\n+\n+  // The most important thing of all in this sortable is the\n+  // return false; in the update. This prevents jQuery sortabale's\n+  // built in DOM change (on update), and instead does nothing\n+  // to the DOM on update. Instead we let Meteor/Blaze update the DOM\n+  // from the setReactiveValue() method!\n+  $( this.find('.collection__items') ).sortable({\n+    // The placeholder element will get the same size as the\n+    // element we're moving, and it will get the built in class.\n+    placeholder: \"ui-state-highlight\",","path":"examples/example-1/packages/krstffr:temp-cms/temp-cms-templates.js","position":49,"original_position":49,"commit_id":"8f3d41a9dab3ae0ab4d6422a8759845a689cb451","original_commit_id":"8f3d41a9dab3ae0ab4d6422a8759845a689cb451","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Mixed double and single quotes.","created_at":"2015-03-31T11:20:19Z","updated_at":"2015-03-31T11:20:19Z","html_url":"https://github.com/krstffr/reactive-constructor/pull/14#discussion_r27470549","pull_request_url":"https://api.github.com/repos/krstffr/reactive-constructor/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/krstffr/reactive-constructor/pulls/comments/27470549"},"html":{"href":"https://github.com/krstffr/reactive-constructor/pull/14#discussion_r27470549"},"pull_request":{"href":"https://api.github.com/repos/krstffr/reactive-constructor/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/krstffr/reactive-constructor/pulls/14","id":32312552,"html_url":"https://github.com/krstffr/reactive-constructor/pull/14","diff_url":"https://github.com/krstffr/reactive-constructor/pull/14.diff","patch_url":"https://github.com/krstffr/reactive-constructor/pull/14.patch","issue_url":"https://api.github.com/repos/krstffr/reactive-constructor/issues/14","number":14,"state":"open","locked":false,"title":"Window fix","user":{"login":"krstffr","id":93975,"avatar_url":"https://avatars.githubusercontent.com/u/93975?v=3","gravatar_id":"","url":"https://api.github.com/users/krstffr","html_url":"https://github.com/krstffr","followers_url":"https://api.github.com/users/krstffr/followers","following_url":"https://api.github.com/users/krstffr/following{/other_user}","gists_url":"https://api.github.com/users/krstffr/gists{/gist_id}","starred_url":"https://api.github.com/users/krstffr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krstffr/subscriptions","organizations_url":"https://api.github.com/users/krstffr/orgs","repos_url":"https://api.github.com/users/krstffr/repos","events_url":"https://api.github.com/users/krstffr/events{/privacy}","received_events_url":"https://api.github.com/users/krstffr/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-31T11:20:12Z","updated_at":"2015-03-31T11:20:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c3ceeea2f19bcf0844a0eefd16ea522e033556d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/krstffr/reactive-constructor/pulls/14/commits","review_comments_url":"https://api.github.com/repos/krstffr/reactive-constructor/pulls/14/comments","review_comment_url":"https://api.github.com/repos/krstffr/reactive-constructor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/krstffr/reactive-constructor/issues/14/comments","statuses_url":"https://api.github.com/repos/krstffr/reactive-constructor/statuses/8f3d41a9dab3ae0ab4d6422a8759845a689cb451","head":{"label":"krstffr:window-fix","ref":"window-fix","sha":"8f3d41a9dab3ae0ab4d6422a8759845a689cb451","user":{"login":"krstffr","id":93975,"avatar_url":"https://avatars.githubusercontent.com/u/93975?v=3","gravatar_id":"","url":"https://api.github.com/users/krstffr","html_url":"https://github.com/krstffr","followers_url":"https://api.github.com/users/krstffr/followers","following_url":"https://api.github.com/users/krstffr/following{/other_user}","gists_url":"https://api.github.com/users/krstffr/gists{/gist_id}","starred_url":"https://api.github.com/users/krstffr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krstffr/subscriptions","organizations_url":"https://api.github.com/users/krstffr/orgs","repos_url":"https://api.github.com/users/krstffr/repos","events_url":"https://api.github.com/users/krstffr/events{/privacy}","received_events_url":"https://api.github.com/users/krstffr/received_events","type":"User","site_admin":false},"repo":{"id":31965435,"name":"reactive-constructor","full_name":"krstffr/reactive-constructor","owner":{"login":"krstffr","id":93975,"avatar_url":"https://avatars.githubusercontent.com/u/93975?v=3","gravatar_id":"","url":"https://api.github.com/users/krstffr","html_url":"https://github.com/krstffr","followers_url":"https://api.github.com/users/krstffr/followers","following_url":"https://api.github.com/users/krstffr/following{/other_user}","gists_url":"https://api.github.com/users/krstffr/gists{/gist_id}","starred_url":"https://api.github.com/users/krstffr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krstffr/subscriptions","organizations_url":"https://api.github.com/users/krstffr/orgs","repos_url":"https://api.github.com/users/krstffr/repos","events_url":"https://api.github.com/users/krstffr/events{/privacy}","received_events_url":"https://api.github.com/users/krstffr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/krstffr/reactive-constructor","description":"Meteor package for creating \"reactive objects\".","fork":false,"url":"https://api.github.com/repos/krstffr/reactive-constructor","forks_url":"https://api.github.com/repos/krstffr/reactive-constructor/forks","keys_url":"https://api.github.com/repos/krstffr/reactive-constructor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/krstffr/reactive-constructor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/krstffr/reactive-constructor/teams","hooks_url":"https://api.github.com/repos/krstffr/reactive-constructor/hooks","issue_events_url":"https://api.github.com/repos/krstffr/reactive-constructor/issues/events{/number}","events_url":"https://api.github.com/repos/krstffr/reactive-constructor/events","assignees_url":"https://api.github.com/repos/krstffr/reactive-constructor/assignees{/user}","branches_url":"https://api.github.com/repos/krstffr/reactive-constructor/branches{/branch}","tags_url":"https://api.github.com/repos/krstffr/reactive-constructor/tags","blobs_url":"https://api.github.com/repos/krstffr/reactive-constructor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/krstffr/reactive-constructor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/krstffr/reactive-constructor/git/refs{/sha}","trees_url":"https://api.github.com/repos/krstffr/reactive-constructor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/krstffr/reactive-constructor/statuses/{sha}","languages_url":"https://api.github.com/repos/krstffr/reactive-constructor/languages","stargazers_url":"https://api.github.com/repos/krstffr/reactive-constructor/stargazers","contributors_url":"https://api.github.com/repos/krstffr/reactive-constructor/contributors","subscribers_url":"https://api.github.com/repos/krstffr/reactive-constructor/subscribers","subscription_url":"https://api.github.com/repos/krstffr/reactive-constructor/subscription","commits_url":"https://api.github.com/repos/krstffr/reactive-constructor/commits{/sha}","git_commits_url":"https://api.github.com/repos/krstffr/reactive-constructor/git/commits{/sha}","comments_url":"https://api.github.com/repos/krstffr/reactive-constructor/comments{/number}","issue_comment_url":"https://api.github.com/repos/krstffr/reactive-constructor/issues/comments{/number}","contents_url":"https://api.github.com/repos/krstffr/reactive-constructor/contents/{+path}","compare_url":"https://api.github.com/repos/krstffr/reactive-constructor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/krstffr/reactive-constructor/merges","archive_url":"https://api.github.com/repos/krstffr/reactive-constructor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/krstffr/reactive-constructor/downloads","issues_url":"https://api.github.com/repos/krstffr/reactive-constructor/issues{/number}","pulls_url":"https://api.github.com/repos/krstffr/reactive-constructor/pulls{/number}","milestones_url":"https://api.github.com/repos/krstffr/reactive-constructor/milestones{/number}","notifications_url":"https://api.github.com/repos/krstffr/reactive-constructor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/krstffr/reactive-constructor/labels{/name}","releases_url":"https://api.github.com/repos/krstffr/reactive-constructor/releases{/id}","created_at":"2015-03-10T15:33:11Z","updated_at":"2015-03-16T09:43:27Z","pushed_at":"2015-03-31T11:20:12Z","git_url":"git://github.com/krstffr/reactive-constructor.git","ssh_url":"git@github.com:krstffr/reactive-constructor.git","clone_url":"https://github.com/krstffr/reactive-constructor.git","svn_url":"https://github.com/krstffr/reactive-constructor","homepage":null,"size":320,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"krstffr:master","ref":"master","sha":"a66296eae6972137b88b2d591ba91ab77b33e52a","user":{"login":"krstffr","id":93975,"avatar_url":"https://avatars.githubusercontent.com/u/93975?v=3","gravatar_id":"","url":"https://api.github.com/users/krstffr","html_url":"https://github.com/krstffr","followers_url":"https://api.github.com/users/krstffr/followers","following_url":"https://api.github.com/users/krstffr/following{/other_user}","gists_url":"https://api.github.com/users/krstffr/gists{/gist_id}","starred_url":"https://api.github.com/users/krstffr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krstffr/subscriptions","organizations_url":"https://api.github.com/users/krstffr/orgs","repos_url":"https://api.github.com/users/krstffr/repos","events_url":"https://api.github.com/users/krstffr/events{/privacy}","received_events_url":"https://api.github.com/users/krstffr/received_events","type":"User","site_admin":false},"repo":{"id":31965435,"name":"reactive-constructor","full_name":"krstffr/reactive-constructor","owner":{"login":"krstffr","id":93975,"avatar_url":"https://avatars.githubusercontent.com/u/93975?v=3","gravatar_id":"","url":"https://api.github.com/users/krstffr","html_url":"https://github.com/krstffr","followers_url":"https://api.github.com/users/krstffr/followers","following_url":"https://api.github.com/users/krstffr/following{/other_user}","gists_url":"https://api.github.com/users/krstffr/gists{/gist_id}","starred_url":"https://api.github.com/users/krstffr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krstffr/subscriptions","organizations_url":"https://api.github.com/users/krstffr/orgs","repos_url":"https://api.github.com/users/krstffr/repos","events_url":"https://api.github.com/users/krstffr/events{/privacy}","received_events_url":"https://api.github.com/users/krstffr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/krstffr/reactive-constructor","description":"Meteor package for creating \"reactive objects\".","fork":false,"url":"https://api.github.com/repos/krstffr/reactive-constructor","forks_url":"https://api.github.com/repos/krstffr/reactive-constructor/forks","keys_url":"https://api.github.com/repos/krstffr/reactive-constructor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/krstffr/reactive-constructor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/krstffr/reactive-constructor/teams","hooks_url":"https://api.github.com/repos/krstffr/reactive-constructor/hooks","issue_events_url":"https://api.github.com/repos/krstffr/reactive-constructor/issues/events{/number}","events_url":"https://api.github.com/repos/krstffr/reactive-constructor/events","assignees_url":"https://api.github.com/repos/krstffr/reactive-constructor/assignees{/user}","branches_url":"https://api.github.com/repos/krstffr/reactive-constructor/branches{/branch}","tags_url":"https://api.github.com/repos/krstffr/reactive-constructor/tags","blobs_url":"https://api.github.com/repos/krstffr/reactive-constructor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/krstffr/reactive-constructor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/krstffr/reactive-constructor/git/refs{/sha}","trees_url":"https://api.github.com/repos/krstffr/reactive-constructor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/krstffr/reactive-constructor/statuses/{sha}","languages_url":"https://api.github.com/repos/krstffr/reactive-constructor/languages","stargazers_url":"https://api.github.com/repos/krstffr/reactive-constructor/stargazers","contributors_url":"https://api.github.com/repos/krstffr/reactive-constructor/contributors","subscribers_url":"https://api.github.com/repos/krstffr/reactive-constructor/subscribers","subscription_url":"https://api.github.com/repos/krstffr/reactive-constructor/subscription","commits_url":"https://api.github.com/repos/krstffr/reactive-constructor/commits{/sha}","git_commits_url":"https://api.github.com/repos/krstffr/reactive-constructor/git/commits{/sha}","comments_url":"https://api.github.com/repos/krstffr/reactive-constructor/comments{/number}","issue_comment_url":"https://api.github.com/repos/krstffr/reactive-constructor/issues/comments{/number}","contents_url":"https://api.github.com/repos/krstffr/reactive-constructor/contents/{+path}","compare_url":"https://api.github.com/repos/krstffr/reactive-constructor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/krstffr/reactive-constructor/merges","archive_url":"https://api.github.com/repos/krstffr/reactive-constructor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/krstffr/reactive-constructor/downloads","issues_url":"https://api.github.com/repos/krstffr/reactive-constructor/issues{/number}","pulls_url":"https://api.github.com/repos/krstffr/reactive-constructor/pulls{/number}","milestones_url":"https://api.github.com/repos/krstffr/reactive-constructor/milestones{/number}","notifications_url":"https://api.github.com/repos/krstffr/reactive-constructor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/krstffr/reactive-constructor/labels{/name}","releases_url":"https://api.github.com/repos/krstffr/reactive-constructor/releases{/id}","created_at":"2015-03-10T15:33:11Z","updated_at":"2015-03-16T09:43:27Z","pushed_at":"2015-03-31T11:20:12Z","git_url":"git://github.com/krstffr/reactive-constructor.git","ssh_url":"git@github.com:krstffr/reactive-constructor.git","clone_url":"https://github.com/krstffr/reactive-constructor.git","svn_url":"https://github.com/krstffr/reactive-constructor","homepage":null,"size":320,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/krstffr/reactive-constructor/pulls/14"},"html":{"href":"https://github.com/krstffr/reactive-constructor/pull/14"},"issue":{"href":"https://api.github.com/repos/krstffr/reactive-constructor/issues/14"},"comments":{"href":"https://api.github.com/repos/krstffr/reactive-constructor/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/krstffr/reactive-constructor/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/krstffr/reactive-constructor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/krstffr/reactive-constructor/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/krstffr/reactive-constructor/statuses/8f3d41a9dab3ae0ab4d6422a8759845a689cb451"}}}}