{"action":"created","comment":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/26080127","id":26080127,"diff_hunk":"@@ -0,0 +1,475 @@\n+/* jshint\n+ funcscope: true,\n+ newcap: true,\n+ nonew: true,\n+ shadow: false,\n+ unused: true,\n+\n+ maxlen: 90,\n+ maxstatements: 200\n+ */\n+/* global $ */\n+'use strict';\n+\n+require('../utils');\n+var NetSimWire = require('./NetSimWire');\n+var NetSimVizNode = require('./NetSimVizNode');\n+var NetSimVizWire = require('./NetSimVizWire');\n+var netsimUtils = require('./netsimUtils');\n+var tweens = require('./tweens');\n+\n+/**\n+ * Top-level controller for the network visualization.\n+ *\n+ * For the most part, the visualization attaches to the raw network state\n+ * representation (the storage tables) and updates to reflect that state,\n+ * independent of the rest of the controls on the page.  This separation means\n+ * that the visualization always has one canonical state to observe.\n+ *\n+ * @param {jQuery} svgRoot - The <svg> tag within which the visualization\n+ *        will be created.\n+ * @param {RunLoop} runLoop - Loop providing tick and render events that the\n+ *        visualization can hook up to and respond to.\n+ * @param {NetSimConnection} connection - Reference to the connection manager,\n+ *        which provides the hooks we need to get the shard, the local node,\n+ *        and to attach to the shared network state.\n+ * @constructor\n+ */\n+var NetSimVisualization = module.exports = function (svgRoot, runLoop, connection) {\n+  /**\n+   * @type {jQuery}\n+   * @private\n+   */\n+  this.svgRoot_ = svgRoot;\n+\n+  /**\n+   * The shard currently being represented.\n+   * We don't have a shard now, but we register with the connection manager\n+   * to find out when we have one.\n+   * @type {NetSimShard}\n+   * @private\n+   */\n+  this.shard_ = null;\n+  connection.shardChange.register(this.onShardChange_.bind(this));\n+\n+  /**\n+   * List of VizEntities, which are all the elements that will actually show up\n+   * in our visualization.\n+   * @type {Array.<NetSimVizEntity>}\n+   * @private\n+   */\n+  this.entities_ = [];\n+\n+  /**\n+   * Width (in svg-units) of visualization\n+   * @type {number}\n+   */\n+  this.visualizationWidth = 300;\n+\n+  /**\n+   * Height (in svg-units) of visualization\n+   * @type {number}\n+   */\n+  this.visualizationHeight = 300;\n+\n+  /**\n+   * Key used to unregister from the node table.\n+   * @type {Object}\n+   */\n+  this.nodeTableChangeKey = undefined;\n+\n+  /**\n+   * Key used to unregister from the wire table.\n+   * @type {Object}\n+   */\n+  this.wireTableChangeKey = undefined;\n+\n+  // Hook up tick and render methods\n+  runLoop.tick.register(this.tick.bind(this));\n+  runLoop.render.register(this.render.bind(this));\n+};\n+\n+/**\n+ * Tick: Update all vizentities, giving them an opportunity to recalculate\n+ *       their internal state, and remove any dead entities from the\n+ *       visualization.\n+ * @param {RunLoop.Clock} clock\n+ */\n+NetSimVisualization.prototype.tick = function (clock) {\n+  // Everyone gets an update\n+  this.entities_.forEach(function (entity) {\n+    entity.tick(clock);\n+  });\n+\n+  // Tear out dead entities.\n+  this.entities_ = this.entities_.filter(function (entity) {\n+    if (entity.isDead()) {\n+      entity.getRoot().remove();\n+      return false;\n+    }\n+    return true;\n+  });\n+};\n+\n+/**\n+ * Render: Let all vizentities \"redraw\" (or in our case, touch the DOM)\n+ */\n+NetSimVisualization.prototype.render = function () {\n+  this.entities_.forEach(function (entity) {\n+    entity.render();\n+  });\n+};\n+\n+/**\n+ * Called whenever the connection notifies us that we've connected to,\n+ * or disconnected from, a shard.\n+ * @param {?NetSimShard} newShard - null if disconnected.\n+ * @param {?NetSimLocalClientNode} localNode - null if disconnected\n+ * @private\n+ */\n+NetSimVisualization.prototype.onShardChange_= function (newShard, localNode) {\n+  this.setShard(newShard);\n+  this.setLocalNode(localNode);\n+};\n+\n+/**\n+ * Change the shard this visualization will source its data from.\n+ * Re-attaches table change listeners for all the tables we need to monitor.\n+ * @param {?NetSimShard} newShard - null if disconnected\n+ */\n+NetSimVisualization.prototype.setShard = function (newShard) {\n+  if (this.nodeTableChangeKey !== undefined) {\n+    this.shard_.nodeTable.tableChange.unregister(this.nodeTableChangeKey);\n+    this.nodeTableChangeKey = undefined;\n+  }\n+\n+  if (this.wireTableChangeKey !== undefined) {\n+    this.shard_.wireTable.tableChange.unregister(this.wireTableChangeKey);\n+    this.wireTableChangeKey = undefined;\n+  }\n+\n+  this.shard_ = newShard;\n+  if (!this.shard_) {\n+    return;\n+  }\n+\n+  this.nodeTableChangeKey = this.shard_.nodeTable.tableChange.register(\n+      this.onNodeTableChange_.bind(this));\n+\n+  this.wireTableChangeKey = this.shard_.wireTable.tableChange.register(\n+      this.onWireTableChange_.bind(this));\n+};\n+\n+/**\n+ * Change which node we consider the 'local node' in the visualization.\n+ * We go through a special creation process for this node, so that it\n+ * looks and behaves differently.\n+ * @param {?NetSimLocalClientNode} newLocalNode - null if disconnected\n+ */\n+NetSimVisualization.prototype.setLocalNode = function (newLocalNode) {\n+  if (newLocalNode) {\n+    if (this.localNode) {\n+      this.localNode.configureFrom(newLocalNode);\n+    } else {\n+      this.localNode = new NetSimVizNode(newLocalNode);\n+      this.entities_.push(this.localNode);\n+      this.svgRoot_.find('#background_group').append(this.localNode.getRoot());\n+    }\n+  } else {\n+    this.localNode.kill();\n+  }\n+  this.pullElementsToForeground();\n+};\n+\n+/**\n+ * Find a particular VizEntity in the visualization, by type and ID.\n+ * @param {function} entityType - constructor of entity we're looking for\n+ * @param {number} entityID - ID, with corresponds to NetSimEntity.entityID\n+ * @returns {NetSimVizEntity} or null if not found\n+ */\n+NetSimVisualization.prototype.getEntityByID = function (entityType, entityID) {\n+  return this.entities_.reduce(function (prev, cur) {\n+    if (prev) {\n+      return prev;\n+    } else if (cur instanceof entityType && cur.id === entityID) {\n+      return cur;\n+    }\n+    return null;\n+  }, null);\n+};\n+\n+/**\n+ * Gets the set of VizWires directly attached to the given VizNode, (either\n+ * on the local end or remote end)\n+ * @param {NetSimVizNode} vizNode\n+ * @returns {Array.<NetSimVizWire>} the attached wires\n+ */\n+NetSimVisualization.prototype.getWiresAttachedToNode = function (vizNode) {\n+  return this.entities_.filter(function (entity) {\n+    return entity instanceof NetSimVizWire &&\n+        (entity.localVizNode === vizNode || entity.remoteVizNode === vizNode);\n+  });\n+};\n+\n+/**\n+ * Handle notification that node table contents have changed.\n+ * @param {Array.<Object>} rows - node table rows\n+ * @private\n+ */\n+NetSimVisualization.prototype.onNodeTableChange_ = function (rows) {\n+  // Convert rows to correctly-typed objects\n+  var tableNodes = netsimUtils.nodesFromRows(this.shard_, rows);\n+\n+  // 1. Kill nodes from the visualization that are no longer in the table.\n+  this.entities_.filter(function (vizEntity) {\n+    return vizEntity instanceof NetSimVizNode;\n+  }).filter(function (vizNode) {\n+    return !tableNodes.some(function (node) {\n+      return node.entityID === vizNode.id;\n+    });\n+  }).forEach(function (vizNode) {\n+    vizNode.kill();\n+  });\n+\n+  // 2. Add new nodes from the table into the visualization\n+  tableNodes.forEach(function (node) {\n+    var vizNode = this.getEntityByID(NetSimVizNode, node.entityID);\n+    if (vizNode) {\n+      vizNode.configureFrom(node);\n+    } else {\n+      vizNode = new NetSimVizNode(node);\n+      vizNode.snapToPosition(\n+          Math.random() * this.visualizationWidth - (this.visualizationWidth / 2),\n+          Math.random() * this.visualizationHeight - (this.visualizationHeight / 2));\n+      this.entities_.push(vizNode);\n+      this.svgRoot_.find('#background_group').prepend(vizNode.getRoot());\n+    }\n+  }, this);\n+};\n+\n+/**\n+ * Handle notification taht wire table contents have changed.\n+ * @param {Array.<Object>} rows - wire table rows\n+ * @private\n+ */\n+NetSimVisualization.prototype.onWireTableChange_ = function (rows) {\n+  // Convert rows to correctly-typed objects\n+  var tableWires = rows.map(function (row) {\n+    return new NetSimWire(this.shard_, row);\n+  }.bind(this));\n+\n+  // 1. Kill wires that are no longer in the table\n+  this.entities_.filter(function (vizEntity) {\n+    return vizEntity instanceof NetSimVizWire;\n+  }).filter(function (vizWire) {\n+    return !tableWires.some(function (wire) {\n+      return wire.entityID === vizWire.id;\n+    });\n+  }).forEach(function (vizWire) {\n+    vizWire.kill();\n+  });\n+\n+  // 2. Add new wires into the visualization\n+  var vizWire;\n+  tableWires.forEach(function (wire) {\n+    vizWire = this.getEntityByID(NetSimVizWire, wire.entityID);\n+    if (vizWire) {\n+      vizWire.configureFrom(wire);\n+    } else {\n+      vizWire = new NetSimVizWire(wire, this.getEntityByID.bind(this));\n+      this.entities_.push(vizWire);\n+      this.svgRoot_.find('#background_group').prepend(vizWire.getRoot());\n+    }\n+  }, this);\n+\n+  // Since the wires table determines simulated connectivity, we trigger a\n+  // recalculation of which nodes are in the local network (should be in the\n+  // foreground) and then re-layout the foreground nodes.\n+  this.pullElementsToForeground();\n+  this.distributeForegroundNodes();\n+};\n+\n+/**\n+ * Recalculate which nodes should be in the foreground layer by doing a full\n+ * traversal starting with the local node.  In short, everything reachable\n+ * from the local node belongs in the foreground.\n+ */\n+NetSimVisualization.prototype.pullElementsToForeground = function () {\n+  // Begin by marking all entities background (unvisited)\n+  this.entities_.forEach(function (vizEntity) {\n+    vizEntity.speculativeIsForeground = false;\n+  });\n+\n+  // Use a simple stack for our list of nodes that need visiting.\n+  // If we have a local node, push it onto the stack as our starting point.\n+  // (If we don't have a local node, the next step is REALLY EASY)\n+  var exploreStack = [];\n+  if (this.localNode) {\n+    exploreStack.push(this.localNode);\n+  }\n+\n+  // While there are still nodes that need visiting,\n+  // visit the next node, marking it as \"foreground/visited\" and\n+  // pushing all of its unvisited connections onto the stack.\n+  var currentVizEntity;\n+  while (exploreStack.length > 0) {\n+    currentVizEntity = exploreStack.pop();\n+    this.visitEntityToSetForeground_(currentVizEntity, exploreStack);\n+  }\n+\n+  // Now, we have to correct \"depth\" for all nodes.\n+  // Move all nodes to their new, correct layers\n+  var foreground = this.svgRoot_.find('#foreground_group');\n+  var background = this.svgRoot_.find('#background_group');\n+  var newParent, isForeground;\n+  this.entities_.forEach(function (vizEntity) {\n+    newParent = undefined;\n+    isForeground = $.contains(foreground[0], vizEntity.getRoot()[0]);\n+\n+    // Check whether a change should occur.  If not, we leave\n+    // newParent undefined so that we don't make unneeded DOM changes.\n+    if (vizEntity.speculativeIsForeground && !isForeground) {\n+      newParent = foreground;\n+    } else if (!vizEntity.speculativeIsForeground && isForeground) {\n+      newParent = background;\n+    }\n+\n+    // If we do need a DOM change, detach the entity and reattach it to the\n+    // new layer.\n+    // Special rule (for now): Prepend wires so that they show up behind\n+    // nodes.  Will need a better solution for this if/when the viz gets\n+    // more complex.\n+    if (newParent) {\n+      vizEntity.getRoot().detach();\n+      if (vizEntity instanceof NetSimVizWire) {\n+        vizEntity.getRoot().prependTo(newParent);\n+      } else {\n+        vizEntity.getRoot().appendTo(newParent);\n+      }\n+      vizEntity.onDepthChange(newParent === foreground);\n+    }\n+  }, this);\n+};\n+\n+/**\n+ * Visit method for pullElementsToForeground, not used anywhere else.\n+ * Notes that the current entity is should be foreground when we're all done,\n+ * finds the current entity's unvisited connections,\n+ * pushes those connections onto the stack.\n+ * @param {NetSimVizEntity} entityBeingVisited\n+ * @param {Array.<NetSimVizEntity>} stack\n+ * @private\n+ */\n+NetSimVisualization.prototype.visitEntityToSetForeground_ = function (\n+    entityBeingVisited, stack) {\n+  var typedEntity; // Used to mitigate JSDoc complaints.\n+\n+  // Visit the entity\n+  entityBeingVisited.speculativeIsForeground = true;\n+\n+  // Push new entities to explore based on node type and connections\n+  if (entityBeingVisited instanceof NetSimVizNode) {\n+    typedEntity = /** @type {NetSimVizNode} */ (entityBeingVisited);","path":"apps/src/netsim/NetSimVisualization.js","position":372,"original_position":372,"commit_id":"9ec58bcdf34354b02b2ae3d44ef97f786865ea68","original_commit_id":"9ec58bcdf34354b02b2ae3d44ef97f786865ea68","user":{"login":"islemaster","id":1615761,"avatar_url":"https://avatars.githubusercontent.com/u/1615761?v=3","gravatar_id":"","url":"https://api.github.com/users/islemaster","html_url":"https://github.com/islemaster","followers_url":"https://api.github.com/users/islemaster/followers","following_url":"https://api.github.com/users/islemaster/following{/other_user}","gists_url":"https://api.github.com/users/islemaster/gists{/gist_id}","starred_url":"https://api.github.com/users/islemaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/islemaster/subscriptions","organizations_url":"https://api.github.com/users/islemaster/orgs","repos_url":"https://api.github.com/users/islemaster/repos","events_url":"https://api.github.com/users/islemaster/events{/privacy}","received_events_url":"https://api.github.com/users/islemaster/received_events","type":"User","site_admin":false},"body":"This is effectively a JSDoc cast.  RubyMine was complaining; but this is Javascript, and it's probably better to jump through fewer hoops even if my editor complains.  I'll change this back.","created_at":"2015-03-09T21:48:10Z","updated_at":"2015-03-09T21:48:10Z","html_url":"https://github.com/code-dot-org/code-dot-org/pull/1534#discussion_r26080127","pull_request_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1534","_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/26080127"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/1534#discussion_r26080127"},"pull_request":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1534"}}},"pull_request":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1534","id":30798238,"html_url":"https://github.com/code-dot-org/code-dot-org/pull/1534","diff_url":"https://github.com/code-dot-org/code-dot-org/pull/1534.diff","patch_url":"https://github.com/code-dot-org/code-dot-org/pull/1534.patch","issue_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/1534","number":1534,"state":"open","locked":false,"title":"Netsim: Visualization","user":{"login":"islemaster","id":1615761,"avatar_url":"https://avatars.githubusercontent.com/u/1615761?v=3","gravatar_id":"","url":"https://api.github.com/users/islemaster","html_url":"https://github.com/islemaster","followers_url":"https://api.github.com/users/islemaster/followers","following_url":"https://api.github.com/users/islemaster/following{/other_user}","gists_url":"https://api.github.com/users/islemaster/gists{/gist_id}","starred_url":"https://api.github.com/users/islemaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/islemaster/subscriptions","organizations_url":"https://api.github.com/users/islemaster/orgs","repos_url":"https://api.github.com/users/islemaster/repos","events_url":"https://api.github.com/users/islemaster/events{/privacy}","received_events_url":"https://api.github.com/users/islemaster/received_events","type":"User","site_admin":false},"body":"First version of visualization, so you can see which nodes you're connected to.\r\n\r\n![out](https://cloud.githubusercontent.com/assets/1615761/6563947/41e8c146-c662-11e4-97ae-8e6964401c7f.gif)\r\n\r\nThis is pretty rough.  I'm open to suggestions for improving it.  In particular, there's a lot of 'handcrafted' here where there's probably an awesome library to do some of it, that I just didn't know about.  Not sure whether it's worth pulling one in now though, since the viz won't get much more complex than this.\r\n\r\nThings I still need to add (maybe in a future PR?)\r\n* Better support for names extending beyond the node radius.\r\n* Show the node address (depending on the mode)\r\n\r\nThings that might change:\r\n* Switching from the dark background back to a light one.  White background sort of matches the page aesthetic better.\r\n* The blurry swimmy nodes in the background may have to go, both because they are potentially distracting and because IE9 isn't going to do the depth-of-field effect.","created_at":"2015-03-09T20:47:12Z","updated_at":"2015-03-09T21:48:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d5f2d689b6e4b05929f3b03828350b712a7b73b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1534/commits","review_comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1534/comments","review_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/1534/comments","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/9ec58bcdf34354b02b2ae3d44ef97f786865ea68","head":{"label":"code-dot-org:netsim_visualization","ref":"netsim_visualization","sha":"9ec58bcdf34354b02b2ae3d44ef97f786865ea68","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","created_at":"2014-09-20T00:46:11Z","updated_at":"2015-03-09T21:42:50Z","pushed_at":"2015-03-09T21:42:50Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":1726103,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":26,"forks":20,"open_issues":26,"watchers":27,"default_branch":"staging"}},"base":{"label":"code-dot-org:staging","ref":"staging","sha":"6442130c1f0d7eb33f1339cd256eb0870a3eee7a","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","created_at":"2014-09-20T00:46:11Z","updated_at":"2015-03-09T21:42:50Z","pushed_at":"2015-03-09T21:42:50Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":1726103,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":26,"forks":20,"open_issues":26,"watchers":27,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1534"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/1534"},"issue":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/1534"},"comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/1534/comments"},"review_comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1534/comments"},"review_comment":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1534/commits"},"statuses":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/9ec58bcdf34354b02b2ae3d44ef97f786865ea68"}}}}