Added iOS-related build commands to Makefile

Summary: New commands (similar to those that exist for webapp) for building Perseus
to mobile. This commit is paired with a change in the mobile repo that builds its
necessary JavaScript.

Test Plan: See rGIc95d0bb23244.

Auditors: jack
Allow configurable button sets.

Summary:
Four functions always available, with addons.

Issues remaining:
* I don't remember exactly what button sets we wanted.

Test Plan:
In Perseus test mode, repeatedly select and unselect button sets, verifying
that they do show up as expected. All of the buttons insert the symbol or
construct I would expect of them.

Reviewers: jack

Reviewed By: jack

Differential Revision: http://phabricator.khanacademy.org/D10910
Change expression version.

Test plan:
`node node/echo-item-version.js` shows the new version

Auditors: jack
No longer possible to have multiple Fancy dropdowns open at once

Summary:
Unlike HTML dropdowns, the Fancy dropdowns weren't closing when you clicked elsewhere on
the page. Now, they listen for a global click on the $(document) and close if the click isn't
within the widget. (Here be minor dragons!)

Test Plan:
- Run Perseus.
- Open test.html (the starting widget now has two dropdowns!).
- Try:
    - Opening one dropdown and clicking elsewhere on the page. The dropdown should close.
    - Opening one dropdown and clicking on the other dropdown. The initial dropdown should close.
    - Opening one dropdown and clicking on the same dropdown. The dropdown should close.
    - Opening one dropdown and clicking on one of its options. The dropdown should close.

Reviewers: jack

Reviewed By: jack

Subscribers: elizabethlin

Differential Revision: http://phabricator.khanacademy.org/D11088
Dot plot now works on touch devices (and mobile app in particular)

Summary:
The dot plot was using some strange touch handling mechanisms, most notably an onMouseOver
call that wasn't getting triggered on touch devices. I refactored the touch handling code to be
kinder to touch devices, which fixes several exercises on mobile.

Test Plan:
- Tested in an emulator and on the mobile app (try the "Creating Line Plots 2" exercise).
- Tested in Chrome to verify that nothing broke on browser.

Reviewers: jack

Reviewed By: jack

Differential Revision: http://phabricator.khanacademy.org/D11029
Fix issue focusing on translate.ka.org perseus items.

Summary:
Perseus bridge tries to focus the item after rendering, but this.widgetIds was
not set on translated.ka.org at that time and so focus() was throwing a js
error.

Test Plan:
make all
See that there are no js errors on focus on:
http://translate.khanacademy.dev/preview/content/items?exercises=defining-similarity-through-angle-preserving-transformations&mp-r-id=38d4P_c=#x84260325bf2f749c

Reviewers: alpert

Reviewed By: alpert

Subscribers: jack

Differential Revision: http://phabricator.khanacademy.org/D11108
Use HTTPS for khan academy URLs when embedding in Perseus

Summary:
Programs wont load on live right now due to HTTPS on an HTTP url.
This fixes that.
(Could also go protocol-less, I suppose.)

Test Plan:
- Put program ID 6563968606273536 in the box, see it load.
- Wait for it to deploy to prod, try that again.

Reviewers: jack, alpert

Reviewed By: alpert

Subscribers: alpert, #cs

Differential Revision: http://phabricator.khanacademy.org/D11163
Revert "Dot plot now works on touch devices (and mobile app in particular)"

Summary:
This reverts commit 29a72940f1507596f09177844be03eda3b389f60.

Dot plots are broken on web, so this will fix them until we make
a nicer root-cause fix :)

Auditors: charlie
Remove `this.props` references from `getDefaultProps`

Summary:
React 0.11 isn't going to be very happy about our deriving
the return value of `getDefaultProps` from `this.props`, so
we're removing references to `this.props`.

We previously used this when we added a new prop such as gridStep
or tickStep, which was previously derived from the old props.
In this situation, we needed old items that were saved
without this prop to be upgraded to use the correct default
based on their range and step, rather than a constant default.
In the future, we will handle this case with prop version
upgrades, instead.

We need to do this in the editor as well so that if a
content creator loads and saves an old question, they
don't change its grid/snap semantics.

Note: we don't really do "the right thing" here for the
transformer, because apparently we never have, so things
must be working reasonably without it (and changing it
at this point would probably break more things than not).

Test Plan:
 * Made an interactive-graph and transformer in test.html
 * Added an interactive-graph with no gridStep or tickStep
   to testrender.html, loaded testrender.html, and made sure
   that it rendered and the defaults for grid and tick step
   made sense based on the range and step.
 * Added the same interactive-graph to test.html, and loaded it,
   making sure the default grid and snap step were correct.

Reviewers: charlie, joel

Reviewed By: charlie, joel

Differential Revision: http://phabricator.khanacademy.org/D11127
Revert "Revert "Dot plot now works on touch devices (and mobile app in particular)""

This reverts commit 9cef1ea2d155d79f1c90ad90d459f5f1ccd7b5d9.
Fixed plotter grading and interactions

Summary: Plotter was incorrectly grading because it wasn't correctly converting Graphie
coordinates to the number of dots present on the plot. Mouse interactions were also awkward
as you had to move the mouse to bind the onMouseUp event. Both of these things are now fixed.

Test Plan:
- Create a line plot
- Click and drag on some bars, just click on others
- Verify that grading works correctly with adjusted y-scales

Auditors: jack
Expanded click area for radio content

Summary:
Radio content boxes were dropping clicks because the event was bound on the inner content
rather than the box itself. Now, the touch event is bound to the box itself to avoid missing
out on clicks.

Test Plan:
- Run mobile app.
- Go to exercise with radio (e.g., "Decomposing Fractions").
- Try clicking radio boxes, especially around the perimeter.
- Try clicking the actual checkbox.

Reviewers: jack

Reviewed By: jack

Differential Revision: http://phabricator.khanacademy.org/D11101
make interactive2 tests run as part of make test

Summary:
We previously had interactive2 test inside the interactive2 folder.
This commit adds those to the test infrastructure already in the
top-level perseus Makefile. yay tests!

Test Plan:
    make test
    make jest

Note: make jest is currently [still] failing due to
https://github.com/facebook/jest/issues/62

Reviewers: charlie

Reviewed By: charlie

Subscribers: jlfwong

Differential Revision: http://phabricator.khanacademy.org/D11186
Added support for static input-numbers and expressions

Summary:
Mobile can now trigger a `staticRender` option in the Perseus API to have input-number
and expression widgets render as pretty latex (which will be set through the Perseus API). The
latex is rendered with the <Tex> component, which is then combined with some styling and wrapped
into a <MathOutput> component.

For some reason, this doesn't work when answer-area != "multiple", but I saw some other issues
related to that on Trello, so maybe it's not my fault?

Test Plan:
- Run the mobile app.
- Try "Groups of Tens" to test out input-number.
- To verify that input-number is grading mixed numbers correctly (but displays them as Tex), try out: "Adding and Subtracting Fractions with Like Denominators Word Problems" (some of the items have answer-area != "multiple", so those won't work).
- Try "Writing Expressions with Exponents" to test out expression.

Reviewers: jack

Differential Revision: http://phabricator.khanacademy.org/D11073
Unbind window.message in componentWillUnmount

Summary: If we don't unbind, then we get an error amount not being able to mount.

Test Plan:
- Have multiple items in an exercise, one of which has an iframe
- Complete the first one, click to go to next
- Don't see error
- This can be done live at: https://www.khanacademy.org/binary-search/e/card-finder-with-binary-search/edit .

Reviewers: jack

Reviewed By: jack

Differential Revision: http://phabricator.khanacademy.org/D11245
interactive-graph: fix js error in click-to-add-points

Summary:
We weren't passing the grab coord to Movable.grab() from
MovablePoint.grab()

Test Plan:
 * Make an unlimited-points interactive-graph
 * Click on both graphs
 * See no js error (this happens without this commit)
 * Also test grading

Auditors: charlie
interactive-graph: enable trashcan translucency

Summary:
We had to disable this in Chrome 34, since Chrome had a bug that
wouldn't render some of the svg when there was a translucent image.

This bug appears to be gone now, so we can bring back this
functionality and have a better UI!

Test Plan:
 * Make an interactive graph, with click-to-add-points mode for both
   points and polygons
 * Try dragging the points around
 * See that the trashcan becomes opaque only while dragging
 * See that the other points and the polygon are always visible
   and reasonably displayed (no weird stub lines to nowhere)

Auditors: charlie, jared
Fixed radio styling offset being overriden by ke

Summary: Ideally, we'd find a better long-term solution for this where all KE
styles are disabled for Perseus items... But we have a lot on our plate right now,
so !important it is!

Auditors: jack
Re-added radio styling fixes (which were overwritten)

Summary: I'd fixed a bunch of radio styling in exericses-webapp.css, but these were obviously overwritten.
I've re-added these fixes (in radio.less) here.

Test Plan:
- Run mobile app.
- Check that radios _always_ have correct margins.
- Check that radios _always_ have checkbox centered (e.g., "Measuring Lengths 1").

Auditors: jack
Add screenshot to README

Auditors: alex