GitHub PullRequestReviewCommentEvent at 2015-01-01 06:46:22
Repository: Coursemology/coursemology.org
Actor: houndci
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Coursemology/coursemology.org/pulls/comments/22398317","id":22398317,"diff_hunk":"@@ -0,0 +1,295 @@\n+// TODO\n+// - Add limit to panning\n+\n+\n+// HELPER FUNCITONS\n+\n+var getJSON = function (qid, canvas) {\n+  // remove all locked layers\n+  var layersList = $('#scribing-layers-' + qid);\n+  layersList.find('option').each(function (i, o) {\n+    $(o).data('toggleLayer')(false);\n+  });\n+\n+  // get json output for current user\n+  var output = JSON.stringify(canvas._objects);\n+\n+  // restore locked layers and return\n+  layersList.change();\n+  return '{\"objects\":'+ output +'}';\n+};\n+\n+var updateScribble = function (qid, canvas) {\n+  var ajaxField = $('#scribing-ajax-' + qid + ' .scribble-content');\n+  ajaxField.val(getJSON(qid, canvas));\n+  $('#scribing-ajax-' + qid).submit();\n+};\n+\n+\n+// INITIALISE CANVASES  \n+\n+$(document).ready(function () {\n+  //select all canvases and scribing images\n+  var allCanvases = $('.scribing-canvas');\n+  var allImages = $('.scribing-images');\n+\n+  //init associative arrays so canvases and images can be found by qid\n+  var fabricCanvases = {};\n+  var scribingImages = {};\n+\n+  //collect all img elements\n+  $.each(allImages, function(i, image) {\n+    scribingImages[$(image).data('qid')] = image;\n+  });\n+\n+  //init and collect all canvas elements\n+  $.each(allCanvases, function(i, htmlCanvas) {\n+    var qid = $(htmlCanvas).data('qid');\n+    var underlayUrl = $(htmlCanvas).data('url');\n+    var buttons = $('#scribing-buttons-' + qid + ' a');\n+    var c = new fabric.Canvas('scribing-canvas-' + qid); // js object \n+    c.clear();\n+    fabricCanvases[qid] = c;\n+\n+    //set brush width to value declared in scribing canvas view\n+    c.freeDrawingBrush.width = $('#scribing-width-' + qid).val();\n+\n+    $('#scribing-mode-' + qid)\n+      .click({ canvas: c, buttons: buttons }, function (event) {\n+        var canvas = event.data.canvas;\n+        var buttons = event.data.buttons;\n+\n+        canvas.isDrawingMode = true;\n+        canvas.isGrabMode = false;\n+        $(this).addClass('active');\n+        buttons.not(this).removeClass('active');\n+        $('#scribing-edit-tools-' + qid).addClass('hidden');\n+        $('#scribing-drawing-tools-' + qid).removeClass('hidden');\n+      });\n+\n+    $('#edit-mode-' + qid)\n+      .click({ canvas: c, buttons: buttons }, function (event) {\n+        var canvas = event.data.canvas;\n+        var buttons = event.data.buttons;\n+\n+        canvas.isDrawingMode = false;\n+        canvas.isGrabMode = false;\n+        canvas.selection = false;\n+        $(this).addClass('active');\n+        buttons.not(this).removeClass('active');\n+        $('#scribing-edit-tools-' + qid).removeClass('hidden');\n+        $('#scribing-drawing-tools-' + qid).addClass('hidden');\n+      });\n+\n+    $('#scribing-color-' + qid)\n+      .change({ canvas: c }, function(event) {\n+        event.data.canvas.freeDrawingBrush.color = this.value;\n+      });\n+\n+    $('#scribing-width-' + qid)\n+      .change({ canvas: c }, function(event) {\n+        event.data.canvas.freeDrawingBrush.width = this.value;\n+      });\n+\n+    $('#grab-mode-' + qid)\n+      .click({ canvas: c, buttons: buttons }, function (event) {\n+        var canvas = event.data.canvas;\n+        var buttons = event.data.buttons;\n+\n+        canvas.isDrawingMode = false;\n+        canvas.isGrabMode = true;\n+        canvas.selection = false;\n+        $(this).addClass('active');\n+        buttons.not(this).removeClass('active');\n+        $('#scribing-edit-tools-' + qid).addClass('hidden');\n+        $('#scribing-drawing-tools-' + qid).addClass('hidden');\n+      });\n+\n+    $('#scribing-delete-' + qid)\n+      .click({ \n+        canvas: c, \n+        ajaxSave: $('#answers_' + qid).data('locked'),\n+        qid: qid\n+      }, function (event) {\n+        var canvas = event.data.canvas;\n+        var ajaxSave = event.data.ajaxSave;\n+        var qid = event.data.qid;\n+\n+        if(canvas.getActiveGroup()) {\n+          canvas.getActiveGroup().forEachObject(function(o) {\n+            canvas.remove(o); ","path":"app/assets/javascripts/scribing_canvas.js","position":120,"original_position":120,"commit_id":"02f47c024ff6edab4119e1c5fd9d6631020dc9b6","original_commit_id":"02f47c024ff6edab4119e1c5fd9d6631020dc9b6","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":"Trailing whitespace.","created_at":"2015-01-01T06:46:22Z","updated_at":"2015-01-01T06:46:22Z","html_url":"https://github.com/Coursemology/coursemology.org/pull/328#discussion_r22398317","pull_request_url":"https://api.github.com/repos/Coursemology/coursemology.org/pulls/328","_links":{"self":{"href":"https://api.github.com/repos/Coursemology/coursemology.org/pulls/comments/22398317"},"html":{"href":"https://github.com/Coursemology/coursemology.org/pull/328#discussion_r22398317"},"pull_request":{"href":"https://api.github.com/repos/Coursemology/coursemology.org/pulls/328"}}},"pull_request":{"url":"https://api.github.com/repos/Coursemology/coursemology.org/pulls/328","id":26719112,"html_url":"https://github.com/Coursemology/coursemology.org/pull/328","diff_url":"https://github.com/Coursemology/coursemology.org/pull/328.diff","patch_url":"https://github.com/Coursemology/coursemology.org/pull/328.patch","issue_url":"https://api.github.com/repos/Coursemology/coursemology.org/issues/328","number":328,"state":"open","locked":false,"title":"Scribing questions","user":{"login":"kxmbrian","id":6252919,"avatar_url":"https://avatars.githubusercontent.com/u/6252919?v=3","gravatar_id":"","url":"https://api.github.com/users/kxmbrian","html_url":"https://github.com/kxmbrian","followers_url":"https://api.github.com/users/kxmbrian/followers","following_url":"https://api.github.com/users/kxmbrian/following{/other_user}","gists_url":"https://api.github.com/users/kxmbrian/gists{/gist_id}","starred_url":"https://api.github.com/users/kxmbrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kxmbrian/subscriptions","organizations_url":"https://api.github.com/users/kxmbrian/orgs","repos_url":"https://api.github.com/users/kxmbrian/repos","events_url":"https://api.github.com/users/kxmbrian/events{/privacy}","received_events_url":"https://api.github.com/users/kxmbrian/received_events","type":"User","site_admin":false},"body":"This feature allows teachers to have scribing questions as part of a mission, where students and teachers can draw on a canvas and submit that as an answer. Coursemology/coursemology.org#277\r\n\r\n- Teachers may upload PDFs or images as canvas background images. Multipage PDFs are allowed and one question will be produced per page. PDFs are converted and stored as PNG.\r\n- Background images are optional.\r\n- Scribbles by each user may be hidden/show.\r\n\r\nScreenshots to come!","created_at":"2014-12-31T09:16:57Z","updated_at":"2015-01-01T06:46:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e26d7b8971daf12f1e1867227895ad9122a57d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Coursemology/coursemology.org/pulls/328/commits","review_comments_url":"https://api.github.com/repos/Coursemology/coursemology.org/pulls/328/comments","review_comment_url":"https://api.github.com/repos/Coursemology/coursemology.org/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Coursemology/coursemology.org/issues/328/comments","statuses_url":"https://api.github.com/repos/Coursemology/coursemology.org/statuses/02f47c024ff6edab4119e1c5fd9d6631020dc9b6","head":{"label":"kxmbrian:scribing-qns","ref":"scribing-qns","sha":"02f47c024ff6edab4119e1c5fd9d6631020dc9b6","user":{"login":"kxmbrian","id":6252919,"avatar_url":"https://avatars.githubusercontent.com/u/6252919?v=3","gravatar_id":"","url":"https://api.github.com/users/kxmbrian","html_url":"https://github.com/kxmbrian","followers_url":"https://api.github.com/users/kxmbrian/followers","following_url":"https://api.github.com/users/kxmbrian/following{/other_user}","gists_url":"https://api.github.com/users/kxmbrian/gists{/gist_id}","starred_url":"https://api.github.com/users/kxmbrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kxmbrian/subscriptions","organizations_url":"https://api.github.com/users/kxmbrian/orgs","repos_url":"https://api.github.com/users/kxmbrian/repos","events_url":"https://api.github.com/users/kxmbrian/events{/privacy}","received_events_url":"https://api.github.com/users/kxmbrian/received_events","type":"User","site_admin":false},"repo":{"id":15742980,"name":"coursemology.org","full_name":"kxmbrian/coursemology.org","owner":{"login":"kxmbrian","id":6252919,"avatar_url":"https://avatars.githubusercontent.com/u/6252919?v=3","gravatar_id":"","url":"https://api.github.com/users/kxmbrian","html_url":"https://github.com/kxmbrian","followers_url":"https://api.github.com/users/kxmbrian/followers","following_url":"https://api.github.com/users/kxmbrian/following{/other_user}","gists_url":"https://api.github.com/users/kxmbrian/gists{/gist_id}","starred_url":"https://api.github.com/users/kxmbrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kxmbrian/subscriptions","organizations_url":"https://api.github.com/users/kxmbrian/orgs","repos_url":"https://api.github.com/users/kxmbrian/repos","events_url":"https://api.github.com/users/kxmbrian/events{/privacy}","received_events_url":"https://api.github.com/users/kxmbrian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kxmbrian/coursemology.org","description":"Coursemology","fork":true,"url":"https://api.github.com/repos/kxmbrian/coursemology.org","forks_url":"https://api.github.com/repos/kxmbrian/coursemology.org/forks","keys_url":"https://api.github.com/repos/kxmbrian/coursemology.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kxmbrian/coursemology.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kxmbrian/coursemology.org/teams","hooks_url":"https://api.github.com/repos/kxmbrian/coursemology.org/hooks","issue_events_url":"https://api.github.com/repos/kxmbrian/coursemology.org/issues/events{/number}","events_url":"https://api.github.com/repos/kxmbrian/coursemology.org/events","assignees_url":"https://api.github.com/repos/kxmbrian/coursemology.org/assignees{/user}","branches_url":"https://api.github.com/repos/kxmbrian/coursemology.org/branches{/branch}","tags_url":"https://api.github.com/repos/kxmbrian/coursemology.org/tags","blobs_url":"https://api.github.com/repos/kxmbrian/coursemology.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kxmbrian/coursemology.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kxmbrian/coursemology.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/kxmbrian/coursemology.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kxmbrian/coursemology.org/statuses/{sha}","languages_url":"https://api.github.com/repos/kxmbrian/coursemology.org/languages","stargazers_url":"https://api.github.com/repos/kxmbrian/coursemology.org/stargazers","contributors_url":"https://api.github.com/repos/kxmbrian/coursemology.org/contributors","subscribers_url":"https://api.github.com/repos/kxmbrian/coursemology.org/subscribers","subscription_url":"https://api.github.com/repos/kxmbrian/coursemology.org/subscription","commits_url":"https://api.github.com/repos/kxmbrian/coursemology.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/kxmbrian/coursemology.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/kxmbrian/coursemology.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/kxmbrian/coursemology.org/issues/comments/{number}","contents_url":"https://api.github.com/repos/kxmbrian/coursemology.org/contents/{+path}","compare_url":"https://api.github.com/repos/kxmbrian/coursemology.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kxmbrian/coursemology.org/merges","archive_url":"https://api.github.com/repos/kxmbrian/coursemology.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kxmbrian/coursemology.org/downloads","issues_url":"https://api.github.com/repos/kxmbrian/coursemology.org/issues{/number}","pulls_url":"https://api.github.com/repos/kxmbrian/coursemology.org/pulls{/number}","milestones_url":"https://api.github.com/repos/kxmbrian/coursemology.org/milestones{/number}","notifications_url":"https://api.github.com/repos/kxmbrian/coursemology.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kxmbrian/coursemology.org/labels{/name}","releases_url":"https://api.github.com/repos/kxmbrian/coursemology.org/releases{/id}","created_at":"2014-01-08T17:45:23Z","updated_at":"2014-12-25T19:23:23Z","pushed_at":"2015-01-01T06:46:17Z","git_url":"git://github.com/kxmbrian/coursemology.org.git","ssh_url":"git@github.com:kxmbrian/coursemology.org.git","clone_url":"https://github.com/kxmbrian/coursemology.org.git","svn_url":"https://github.com/kxmbrian/coursemology.org","homepage":"","size":32576,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"development"}},"base":{"label":"Coursemology:development","ref":"development","sha":"130c77b276f0396262a1e3ad188f4e6b086d2b6f","user":{"login":"Coursemology","id":4427741,"avatar_url":"https://avatars.githubusercontent.com/u/4427741?v=3","gravatar_id":"","url":"https://api.github.com/users/Coursemology","html_url":"https://github.com/Coursemology","followers_url":"https://api.github.com/users/Coursemology/followers","following_url":"https://api.github.com/users/Coursemology/following{/other_user}","gists_url":"https://api.github.com/users/Coursemology/gists{/gist_id}","starred_url":"https://api.github.com/users/Coursemology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Coursemology/subscriptions","organizations_url":"https://api.github.com/users/Coursemology/orgs","repos_url":"https://api.github.com/users/Coursemology/repos","events_url":"https://api.github.com/users/Coursemology/events{/privacy}","received_events_url":"https://api.github.com/users/Coursemology/received_events","type":"Organization","site_admin":false},"repo":{"id":10055153,"name":"coursemology.org","full_name":"Coursemology/coursemology.org","owner":{"login":"Coursemology","id":4427741,"avatar_url":"https://avatars.githubusercontent.com/u/4427741?v=3","gravatar_id":"","url":"https://api.github.com/users/Coursemology","html_url":"https://github.com/Coursemology","followers_url":"https://api.github.com/users/Coursemology/followers","following_url":"https://api.github.com/users/Coursemology/following{/other_user}","gists_url":"https://api.github.com/users/Coursemology/gists{/gist_id}","starred_url":"https://api.github.com/users/Coursemology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Coursemology/subscriptions","organizations_url":"https://api.github.com/users/Coursemology/orgs","repos_url":"https://api.github.com/users/Coursemology/repos","events_url":"https://api.github.com/users/Coursemology/events{/privacy}","received_events_url":"https://api.github.com/users/Coursemology/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Coursemology/coursemology.org","description":"","fork":false,"url":"https://api.github.com/repos/Coursemology/coursemology.org","forks_url":"https://api.github.com/repos/Coursemology/coursemology.org/forks","keys_url":"https://api.github.com/repos/Coursemology/coursemology.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Coursemology/coursemology.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Coursemology/coursemology.org/teams","hooks_url":"https://api.github.com/repos/Coursemology/coursemology.org/hooks","issue_events_url":"https://api.github.com/repos/Coursemology/coursemology.org/issues/events{/number}","events_url":"https://api.github.com/repos/Coursemology/coursemology.org/events","assignees_url":"https://api.github.com/repos/Coursemology/coursemology.org/assignees{/user}","branches_url":"https://api.github.com/repos/Coursemology/coursemology.org/branches{/branch}","tags_url":"https://api.github.com/repos/Coursemology/coursemology.org/tags","blobs_url":"https://api.github.com/repos/Coursemology/coursemology.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Coursemology/coursemology.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Coursemology/coursemology.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/Coursemology/coursemology.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Coursemology/coursemology.org/statuses/{sha}","languages_url":"https://api.github.com/repos/Coursemology/coursemology.org/languages","stargazers_url":"https://api.github.com/repos/Coursemology/coursemology.org/stargazers","contributors_url":"https://api.github.com/repos/Coursemology/coursemology.org/contributors","subscribers_url":"https://api.github.com/repos/Coursemology/coursemology.org/subscribers","subscription_url":"https://api.github.com/repos/Coursemology/coursemology.org/subscription","commits_url":"https://api.github.com/repos/Coursemology/coursemology.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/Coursemology/coursemology.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/Coursemology/coursemology.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/Coursemology/coursemology.org/issues/comments/{number}","contents_url":"https://api.github.com/repos/Coursemology/coursemology.org/contents/{+path}","compare_url":"https://api.github.com/repos/Coursemology/coursemology.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Coursemology/coursemology.org/merges","archive_url":"https://api.github.com/repos/Coursemology/coursemology.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Coursemology/coursemology.org/downloads","issues_url":"https://api.github.com/repos/Coursemology/coursemology.org/issues{/number}","pulls_url":"https://api.github.com/repos/Coursemology/coursemology.org/pulls{/number}","milestones_url":"https://api.github.com/repos/Coursemology/coursemology.org/milestones{/number}","notifications_url":"https://api.github.com/repos/Coursemology/coursemology.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Coursemology/coursemology.org/labels{/name}","releases_url":"https://api.github.com/repos/Coursemology/coursemology.org/releases{/id}","created_at":"2013-05-14T13:04:30Z","updated_at":"2015-01-01T05:50:46Z","pushed_at":"2015-01-01T05:50:44Z","git_url":"git://github.com/Coursemology/coursemology.org.git","ssh_url":"git@github.com:Coursemology/coursemology.org.git","clone_url":"https://github.com/Coursemology/coursemology.org.git","svn_url":"https://github.com/Coursemology/coursemology.org","homepage":"coursemology.org","size":37389,"stargazers_count":25,"watchers_count":25,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":50,"forks":29,"open_issues":50,"watchers":25,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/Coursemology/coursemology.org/pulls/328"},"html":{"href":"https://github.com/Coursemology/coursemology.org/pull/328"},"issue":{"href":"https://api.github.com/repos/Coursemology/coursemology.org/issues/328"},"comments":{"href":"https://api.github.com/repos/Coursemology/coursemology.org/issues/328/comments"},"review_comments":{"href":"https://api.github.com/repos/Coursemology/coursemology.org/pulls/328/comments"},"review_comment":{"href":"https://api.github.com/repos/Coursemology/coursemology.org/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Coursemology/coursemology.org/pulls/328/commits"},"statuses":{"href":"https://api.github.com/repos/Coursemology/coursemology.org/statuses/02f47c024ff6edab4119e1c5fd9d6631020dc9b6"}}}}