{"action":"created","comment":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/26782133","id":26782133,"diff_hunk":"@@ -0,0 +1,495 @@\n+/* jshint\n+ funcscope: true,\n+ newcap: true,\n+ nonew: true,\n+ shadow: false,\n+ unused: true,\n+\n+ maxlen: 90,\n+ maxparams: 3,\n+ maxstatements: 200\n+ */\n+/* global $ */\n+'use strict';\n+\n+require('../utils'); // For Function.prototype.inherits()\n+var netsimMsg = require('../../locale/current/netsim');\n+var markup = require('./NetSimPacketEditor.html');\n+var KeyCodes = require('../constants').KeyCodes;\n+var NetSimEncodingControl = require('./NetSimEncodingControl');\n+var PacketEncoder = require('./PacketEncoder');\n+var dataConverters = require('./dataConverters');\n+var BITS_PER_BYTE = require('./netsimConstants').BITS_PER_BYTE;\n+\n+var minifyBinary = dataConverters.minifyBinary;\n+var formatBinary = dataConverters.formatBinary;\n+var formatHex = dataConverters.formatHex;\n+var alignDecimal = dataConverters.alignDecimal;\n+var binaryToInt = dataConverters.binaryToInt;\n+var intToBinary = dataConverters.intToBinary;\n+var hexToInt = dataConverters.hexToInt;\n+var intToHex = dataConverters.intToHex;\n+var hexToBinary = dataConverters.hexToBinary;\n+var binaryToHex = dataConverters.binaryToHex;\n+var decimalToBinary = dataConverters.decimalToBinary;\n+var binaryToDecimal = dataConverters.binaryToDecimal;\n+var asciiToBinary = dataConverters.asciiToBinary;\n+var binaryToAscii = dataConverters.binaryToAscii;\n+\n+/**\n+ * Generator and controller for message sending view.\n+ * @param {Object} initialConfig\n+ * @param {number} [initialConfig.toAddress]\n+ * @param {number} [initialConfig.fromAddress]\n+ * @param {number} [initialConfig.packetIndex]\n+ * @param {number} [initialConfig.packetCount]\n+ * @param {string} [initialConfig.message]\n+ * @param {number} [initialConfig.maxPacketSize]\n+ * @param {number} [initialConfig.chunkSize]\n+ * @param {EncodingType[]} [initialConfig.enabledEncodings]\n+ * @param {function} initialConfig.removePacketCallback\n+ * @constructor\n+ */\n+var NetSimPacketEditor = module.exports = function (initialConfig) {\n+\n+  /**\n+   * @type {jQuery}\n+   * @private\n+   */\n+  this.rootDiv_ = $('<div>').addClass('netsim-packet');\n+\n+  /** @type {number} */\n+  this.toAddress = initialConfig.toAddress || 0;\n+  \n+  /** @type {number} */\n+  this.fromAddress = initialConfig.fromAddress || 0;\n+  \n+  /** @type {number} */\n+  this.packetIndex = initialConfig.packetIndex || 1;\n+  \n+  /** @type {number} */\n+  this.packetCount = initialConfig.packetCount || 1;\n+\n+  /**\n+   * Binary string of message body, live-interpreted to other values.\n+   * @type {string}\n+   */\n+  this.message = initialConfig.message || '';\n+\n+  /**\n+   * Maximum packet length configurable by slider.\n+   * @type {Number}\n+   * @private\n+   */\n+  this.maxPacketSize_ = initialConfig.maxPacketSize || Infinity;\n+\n+  /**\n+   * Bits per chunk/byte for parsing and formatting purposes.\n+   * @type {number}\n+   * @private\n+   */\n+  this.currentChunkSize_ = initialConfig.chunkSize || BITS_PER_BYTE;\n+\n+  /**\n+   * Which encodings should be visible in the editor.\n+   * @type {EncodingType[]}\n+   * @private\n+   */\n+  this.enabledEncodings_ = initialConfig.enabledEncodings || [];\n+\n+  /**\n+   * Method to call in order to remove this packet from its parent.\n+   * Function should take this PacketEditor as an argument.\n+   * @type {function}\n+   * @private\n+   */\n+  this.removePacketCallback_ = initialConfig.removePacketCallback;\n+\n+  /**\n+   * @type {jQuery}\n+   * @private\n+   */\n+  this.removePacketButton_ = null;\n+\n+  /**\n+   * @type {jQuery}\n+   * @private\n+   */\n+  this.bitCounter_ = null;\n+  \n+  this.render();\n+};\n+\n+/**\n+ * Return root div, for hooking up to a parent element.\n+ * @returns {jQuery}\n+ */\n+NetSimPacketEditor.prototype.getRoot = function () {\n+  return this.rootDiv_;\n+};\n+\n+/** Replace contents of our root element with our own markup. */\n+NetSimPacketEditor.prototype.render = function () {\n+  var newMarkup = $(markup({}));\n+  this.rootDiv_.html(newMarkup);\n+  this.bindElements_();\n+  this.updateFields_();\n+  this.removePacketButton_.toggle(this.packetCount > 1);\n+  NetSimEncodingControl.hideRowsByEncoding(this.rootDiv_, this.enabledEncodings_);\n+};\n+\n+/**\n+ * Focus event handler.  If the target element has a 'watermark' class then\n+ * it contains text we intend to clear before any editing occurs.  This\n+ * handler clears that text and removes the class.\n+ * @param focusEvent\n+ */\n+var removeWatermark = function (focusEvent) {\n+  var target = $(focusEvent.target);\n+  if (target.hasClass('watermark')) {\n+    target.val('');\n+    target.removeClass('watermark');\n+  }\n+};\n+\n+/**\n+ * Creates a keyPress handler that allows only the given characters to be\n+ * typed into a text field.\n+ * @param {RegExp} whitelistRegex\n+ * @return {function} appropriate to pass to .keypress()\n+ */\n+var whitelistCharacters = function (whitelistRegex) {\n+  /**\n+   * A keyPress handler that blocks all visible characters except those\n+   * matching the whitelist.  Passes through invisible characters (backspace,\n+   * delete) and control combinations (copy, paste).\n+   *\n+   * @param keyEvent\n+   * @returns {boolean} - Whether to propagate this event.  Should return\n+   *          FALSE if we handle the event and don't want to pass it on, TRUE\n+   *          if we are not handling the event.\n+   */\n+  return function (keyEvent) {\n+\n+    // Don't block control combinations (copy, paste, etc.)\n+    if (keyEvent.metaKey || keyEvent.ctrlKey) {\n+      return true;\n+    }\n+\n+    // Don't block invisible characters; we want to allow backspace, delete, etc.\n+    if (keyEvent.which < KeyCodes.SPACE || keyEvent.which >= KeyCodes.DELETE) {\n+      return true;\n+    }\n+\n+    // At this point, if the character doesn't match, we should block it.\n+    var key = String.fromCharCode(keyEvent.which);\n+    if (!whitelistRegex.test(key)) {\n+      keyEvent.preventDefault();\n+      return false;\n+    }\n+  };\n+};\n+\n+/**\n+ * Generate a jQuery-appropriate keyup handler for a text field.\n+ * Grabs the new value of the text field, runs it through the provided\n+ * converter function, sets the result on the SendWidget's internal state\n+ * and triggers a field update on the widget that skips the field being edited.\n+ *\n+ * Similar to makeBlurHandler, but does not update the field currently\n+ * being edited.\n+ *\n+ * @param {string} fieldName - name of internal state field that the text\n+ *        field should update.\n+ * @param {function} converterFunction - Takes the text field's value and\n+ *        converts it to a format appropriate to the internal state field.\n+ * @returns {function} that can be passed to $.keyup()\n+ */\n+NetSimPacketEditor.prototype.makeKeyupHandler = function (fieldName, converterFunction) {\n+  return function (jqueryEvent) {\n+    var newValue = converterFunction(jqueryEvent.target.value);\n+    if (!isNaN(newValue)) {\n+      this[fieldName] = newValue;\n+      this.updateFields_(jqueryEvent.target);\n+    }\n+  }.bind(this);\n+};\n+\n+/**\n+ * Generate a jQuery-appropriate blur handler for a text field.\n+ * Grabs the new value of the text field, runs it through the provided\n+ * converter function, sets the result on the SendWidget's internal state\n+ * and triggers a full field update of the widget (including the field that was\n+ * just edited).\n+ *\n+ * Similar to makeKeyupHandler, but also updates the field that was\n+ * just edited.\n+ *\n+ * @param {string} fieldName - name of internal state field that the text\n+ *        field should update.\n+ * @param {function} converterFunction - Takes the text field's value and\n+ *        converts it to a format appropriate to the internal state field.\n+ * @returns {function} that can be passed to $.blur()\n+ */\n+NetSimPacketEditor.prototype.makeBlurHandler = function (fieldName, converterFunction) {\n+  return function (jqueryEvent) {\n+    var newValue = converterFunction(jqueryEvent.target.value);\n+    if (isNaN(newValue)) {\n+      newValue = converterFunction('0');\n+    }\n+    this[fieldName] = newValue;\n+    this.updateFields_();\n+  }.bind(this);\n+};\n+\n+/**\n+ * Get relevant elements from the page and bind them to local variables.\n+ * @private\n+ */\n+NetSimPacketEditor.prototype.bindElements_ = function () {\n+  var rootDiv = this.rootDiv_;\n+\n+  var shortNumberFields = [\n+    'toAddress',\n+    'fromAddress',\n+    'packetIndex',\n+    'packetCount'\n+  ];\n+\n+  var rowTypes = [\n+    {\n+      typeName: 'binary',\n+      shortNumberAllowedCharacters: /[01]/,\n+      shortNumberConversion: binaryToInt,\n+      messageAllowedCharacters: /[01\\s]/,\n+      messageConversion: minifyBinary\n+    },\n+    {\n+      typeName: 'hexadecimal',\n+      shortNumberAllowedCharacters: /[0-9a-f]/i,\n+      shortNumberConversion: hexToInt,\n+      messageAllowedCharacters: /[0-9a-f\\s]/i,\n+      messageConversion: hexToBinary\n+    },\n+    {\n+      typeName: 'decimal',\n+      shortNumberAllowedCharacters: /[0-9]/,\n+      shortNumberConversion: parseInt,\n+      messageAllowedCharacters: /[0-9\\s]/,\n+      messageConversion: function (decimalString) {\n+        return decimalToBinary(decimalString, this.currentChunkSize_);\n+      }.bind(this)\n+    },\n+    {\n+      typeName: 'ascii',\n+      shortNumberAllowedCharacters: /[0-9]/,\n+      shortNumberConversion: parseInt,\n+      messageAllowedCharacters: /./,\n+      messageConversion: function (asciiString) {\n+        return asciiToBinary(asciiString, this.currentChunkSize_);\n+      }.bind(this)\n+    }\n+  ];\n+\n+  rowTypes.forEach(function (rowType) {\n+    var tr = rootDiv.find('tr.' + rowType.typeName);\n+    var rowUIKey = rowType.typeName + 'UI';\n+    this[rowUIKey] = {};\n+    var rowFields = this[rowUIKey];\n+\n+    // We attach focus (sometimes) to clear the field watermark, if present\n+    // We attach keypress to block certain characters\n+    // We attach keyup to live-update the widget as the user types\n+    // We attach blur to reformat the edited field when the user leaves it,\n+    //    and to catch non-keyup cases like copy/paste.\n+\n+    shortNumberFields.forEach(function (fieldName) {\n+      rowFields[fieldName] = tr.find('input.' + fieldName);\n+      rowFields[fieldName].keypress(\n+          whitelistCharacters(rowType.shortNumberAllowedCharacters));\n+      rowFields[fieldName].keyup(\n+          this.makeKeyupHandler(fieldName, rowType.shortNumberConversion));\n+      rowFields[fieldName].blur(\n+          this.makeBlurHandler(fieldName, rowType.shortNumberConversion));\n+    }, this);\n+\n+    rowFields.message = tr.find('textarea.message');\n+    rowFields.message.focus(removeWatermark);\n+    rowFields.message.keypress(\n+        whitelistCharacters(rowType.messageAllowedCharacters));\n+    rowFields.message.keyup(\n+        this.makeKeyupHandler('message', rowType.messageConversion));\n+    rowFields.message.blur(\n+        this.makeBlurHandler('message', rowType.messageConversion));\n+  }, this);\n+\n+  this.removePacketButton_ = rootDiv.find('.remove-packet-button');\n+  this.removePacketButton_.click(this.onRemovePacketButtonClick_.bind(this));\n+  this.bitCounter_ = rootDiv.find('.bit-counter');\n+};\n+\n+/**\n+ * Update send widget display\n+ * @param {HTMLElement} [skipElement] - A field to skip while updating,\n+ *        because we don't want to transform content out from under the\n+ *        user's cursor.\n+ * @private\n+ */\n+NetSimPacketEditor.prototype.updateFields_ = function (skipElement) {\n+  var chunkSize = this.currentChunkSize_;\n+  var liveFields = [];\n+\n+  [\n+    'toAddress',\n+    'fromAddress',\n+    'packetIndex',\n+    'packetCount'\n+  ].forEach(function (fieldName) {\n+        liveFields.push({\n+          inputElement: this.binaryUI[fieldName],\n+          newValue: intToBinary(this[fieldName], 4)\n+        });\n+\n+        liveFields.push({\n+          inputElement: this.hexadecimalUI[fieldName],\n+          newValue: intToHex(this[fieldName], 1)\n+        });\n+\n+        liveFields.push({\n+          inputElement: this.decimalUI[fieldName],\n+          newValue: this[fieldName].toString(10)\n+        });\n+\n+        liveFields.push({\n+          inputElement: this.asciiUI[fieldName],\n+          newValue: this[fieldName].toString(10)\n+        });\n+      }, this);\n+\n+  liveFields.push({\n+    inputElement: this.binaryUI.message,\n+    newValue: formatBinary(this.message, chunkSize),\n+    watermark: netsimMsg.binary()\n+  });\n+\n+  liveFields.push({\n+    inputElement: this.hexadecimalUI.message,\n+    newValue: formatHex(binaryToHex(this.message), chunkSize),\n+    watermark: netsimMsg.hexadecimal()\n+  });\n+\n+  liveFields.push({\n+    inputElement: this.decimalUI.message,\n+    newValue: alignDecimal(binaryToDecimal(this.message, chunkSize)),\n+    watermark: netsimMsg.decimal()\n+  });\n+\n+  liveFields.push({\n+    inputElement: this.asciiUI.message,\n+    newValue: binaryToAscii(this.message, chunkSize),\n+    watermark: netsimMsg.ascii()\n+  });\n+\n+  liveFields.forEach(function (field) {\n+    if (field.inputElement[0] !== skipElement) {\n+      if (field.watermark && field.newValue === '') {\n+        field.inputElement.val(field.watermark);\n+        field.inputElement.addClass('watermark');\n+      } else {\n+        field.inputElement.val(field.newValue);\n+        field.inputElement.removeClass('watermark');\n+      }\n+\n+      // TODO: If textarea, scroll to bottom?","path":"apps/src/netsim/NetSimPacketEditor.js","position":403,"original_position":403,"commit_id":"82df49f6461751507fdf6f3a78a51e160c31f933","original_commit_id":"82df49f6461751507fdf6f3a78a51e160c31f933","user":{"login":"bcjordan","id":206973,"avatar_url":"https://avatars.githubusercontent.com/u/206973?v=3","gravatar_id":"","url":"https://api.github.com/users/bcjordan","html_url":"https://github.com/bcjordan","followers_url":"https://api.github.com/users/bcjordan/followers","following_url":"https://api.github.com/users/bcjordan/following{/other_user}","gists_url":"https://api.github.com/users/bcjordan/gists{/gist_id}","starred_url":"https://api.github.com/users/bcjordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcjordan/subscriptions","organizations_url":"https://api.github.com/users/bcjordan/orgs","repos_url":"https://api.github.com/users/bcjordan/repos","events_url":"https://api.github.com/users/bcjordan/events{/privacy}","received_events_url":"https://api.github.com/users/bcjordan/received_events","type":"User","site_admin":false},"body":"TODO","created_at":"2015-03-19T18:12:22Z","updated_at":"2015-03-19T18:12:22Z","html_url":"https://github.com/code-dot-org/code-dot-org/pull/1683#discussion_r26782133","pull_request_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1683","_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/26782133"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/1683#discussion_r26782133"},"pull_request":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1683"}}},"pull_request":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1683","id":31543021,"html_url":"https://github.com/code-dot-org/code-dot-org/pull/1683","diff_url":"https://github.com/code-dot-org/code-dot-org/pull/1683.diff","patch_url":"https://github.com/code-dot-org/code-dot-org/pull/1683.patch","issue_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/1683","number":1683,"state":"open","locked":false,"title":"NetSim: Compose and send multiple packets","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":"Allows the student to compose multiple packets at once, and send them all together.  Can be enabled/disabled from level configuration.\r\n\r\n![multi_packet_demo](https://cloud.githubusercontent.com/assets/1615761/6735704/2be643a6-ce1d-11e4-8c9c-1dc855c03866.gif)\r\n\r\n_Note: Since the above screencast was taken, I updated this PR to show the packet info columns in the log, and to use a font-awesome icon for the \"remove packet\" button instead of the letter X._\r\n\r\nThe big hairy part of this change is extracting most of `NetSimSendPanel` into a `NetSimPacketEditor`, and creating a one-to-many relationship between the two.  Along the way I did some cleanup to the sending/receiving/processing logic of both the `LocalClientNode` and the `RouterNode`, adding a few helpers for running a series of asynchronous requests (e.g. `NetSimEntity.deleteEntities`) and adding new tests around that behavior as well.","created_at":"2015-03-19T16:55:16Z","updated_at":"2015-03-19T18:12:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"69fada506f68d0e04d4d8678cbabfc7ea3bb559b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1683/commits","review_comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1683/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/1683/comments","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/82df49f6461751507fdf6f3a78a51e160c31f933","head":{"label":"code-dot-org:netsim_multiple_packets","ref":"netsim_multiple_packets","sha":"82df49f6461751507fdf6f3a78a51e160c31f933","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-19T17:29:45Z","pushed_at":"2015-03-19T18:04:21Z","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":1775203,"stargazers_count":28,"watchers_count":28,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":20,"forks":22,"open_issues":20,"watchers":28,"default_branch":"staging"}},"base":{"label":"code-dot-org:staging","ref":"staging","sha":"83949d62eb13b83cee81adacf5962a23c923f94d","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-19T17:29:45Z","pushed_at":"2015-03-19T18:04:21Z","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":1775203,"stargazers_count":28,"watchers_count":28,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":20,"forks":22,"open_issues":20,"watchers":28,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1683"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/1683"},"issue":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/1683"},"comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/1683/comments"},"review_comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/1683/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/1683/commits"},"statuses":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/82df49f6461751507fdf6f3a78a51e160c31f933"}}}}