Permalink
Commits on Jan 11, 2018
  1. Disable linting of more files to avoid issues when merging substates …

    Kevin Barabash committed Jan 11, 2018
    …in webapp
    
    Summary:
    When attempting to merge a substate update for live-editor into webapp,
    khan-linter complained about all of the prettier style deviations.  To
    avoid future complains I've optioned to prevent khan-linter from linting
    more files in live-editor.
    
    Test Plan:
    - run ka-lint third_party/javascript-khansrc/live-editor from webapp/
    
    Auditors: mattdunnrankin
  2. Disallow frameset and frame tags in webpage environment

    Kevin Barabash committed Jan 11, 2018
    Summary:
    https://khanacademy.atlassian.net/browse/IL-1169
    Frameset and frame tags should be disallowed b/c then people would be
    able to load KA pages within web scratchpads which we'd like to avoid
    b/c it could be used for spoofing or harvesting other users' data.
    
    {F1091978}
    
    {F1091979}
    
    Test Plan:
    - python -m SimpleHTTPServer 1234
    - load http://localhost:1234/demos/simple/webpage.html
    - try adding <frameset> or <frame> tags and see error buddy complain
    - load http://localhost:8080/computer-programming/new/webpage
    - try adding <frameset> or <frame> tags and see error buddy complain
    
    Reviewers: joshua, diedra
    
    Reviewed By: diedra
    
    Differential Revision: https://phabricator.khanacademy.org/D41728
Commits on Jan 8, 2018
  1. Upgrade Handlebars to 4.0.11

    kevinbarabash committed Jan 8, 2018
    Summary:
    https://khanacademy.atlassian.net/browse/INFRA-417
    Avoids an issue with a XSS in previous versions of Handlebars.
    
    Test Plan: - load http://localhost:1234/demos/simple/ without errors
    
    Reviewers: john, briangenisio, riley
    
    Reviewed By: john
    
    Differential Revision: https://phabricator.khanacademy.org/D41610
Commits on Jan 4, 2018
  1. Upgrade handlebars to 2.0.0

    kevinbarabash committed Jan 4, 2018
    Summary:
    webapp's handlebars was upgrade to 2.0.0 in D41371.  live-editor needs
    to use the same version of handlebars since it's a shared dependency.
    This diff upgrade's live-editor's version of handlebars.
    
    demo page
    {F1089119}
    
    in webapp
    {F1089120}
    
    Test Plan:
    - run python -m SimpleHTTPServer 1234
    - load http://localhost:1234/demos/simple/ without errors
    - load http://localhost:8080/computer-programming/new/pjs without errors
    
    Reviewers: john, jeff, riley
    
    Reviewed By: john
    
    Subscribers: csilvers
    
    Differential Revision: https://phabricator.khanacademy.org/D41571
Commits on Dec 5, 2017
  1. Add pointer-events:none; to hidden font container in processing-js

    kevinbarabash committed Dec 5, 2017
    Summary:
    opacity:0; isn't enough for Firefox to ignore processing-js' hiddent font
    container which results in the text cursor showing up and mouse
    events not getting through to the canvas. This diff adds
    pointer-events:none; to the container so that Firefox ignores
    it completely.
    
    Change to processing-js is in Khan/processing-js#11.
    
    Test Plan:
    - npm run build
    - load http://localhost:8080/computer-programming/new/pjs (in Firefox)
    - hover over the upper-left corner of the canvas
    - see that the mouse cursor is always the arrow
    
    Reviewers: joshua, idr
    
    Reviewed By: idr
    
    Differential Revision: https://phabricator.khanacademy.org/D41143
Commits on Aug 29, 2017
  1. On dev, make sure that postParent really posts to the parent window.

    tzjames committed Aug 28, 2017
    Summary:
    On prod, the live editor lives in kasandbox.org on a different domain.
    When postFrame gets called in webapp code, the source of the event is
    the window at the time or www.khanacademy.org.
    
    On dev however the postFrame code, while it should be executed from
    within the parent window, somehow is being executed within the iframe.
    It seems React from the very beginning of the stack frame is executing
    within the iframe.  It seems like that might be React's fault.
    
    At any rate I put in a temporary hack here until that can be figured
    out.  If we notice that the frameSource is actually the same window, then we
    must not really have the parent, and can handle that differently.
    
    Test Plan:
    http://localhost:8080/computing/computer-programming/programming/drawing-basics/p/drawing-more-shapes-with-code
    Hit spin off.  See the title change and the page redirect.
    
    Reviewers: john
    
    Subscribers: #contentplatform
    
    Differential Revision: https://phabricator.khanacademy.org/D38942
Commits on Jun 16, 2017
  1. Set the height of the SVG icons on the scrubber

    kevinbarabash committed Jun 16, 2017
    Summary:
    IE has a default height for SVG elements and will use that height if
    none is specified.  We were only specifying the width of these elements
    b/c that was enough to ensure they were the right size in other browsers.
    This diff adds the height as well so things render correctly in IE as well.
    
    BEFORE
    {F735891}
    
    AFTER
    {F735892}
    
    Test Plan:
    - gulp watch
    - load http://localhost:8080/computer-programming/new/pjs in IE
    - add some code
    - use the scrubber on one of the numbers, see that it's the right size
    
    Reviewers: charlie, joshua
    
    Reviewed By: charlie
    
    Differential Revision: https://phabricator.khanacademy.org/D36661
  2. Update eslint

    kevinbarabash committed Jun 16, 2017
    Summary:
    When substating live-editor from webapp, git tries to run ka-lint on this repo
    which uses khan-linter's version of eslint which is 3.10.2.  Since some of the
    eslint rules have changed, this was working.  This diff update's live-editor's
    version of eslint to match khan-linter's version and update's its eslintrc so
    that running ka-lint from webapp on this sub-repo works
    
    Test Plan: - run ka-lint third_party/javascript-khansrc/live-editor from webapp
    
    Reviewers: charlie
    
    Reviewed By: charlie
    
    Differential Revision: https://phabricator.khanacademy.org/D36662
Commits on Jun 6, 2017
  1. Surface errors thrown by PJS

    Charles Marsh committed Jun 4, 2017
    Summary:
    Users were reporting that calling `.resize` would lead to an error, without any explanation or
    trace. It turns out that this specific error is raised by Processing directly (via `throw "..."`),
    in which case the surfaced error is a plain string rather than an object.
    
    On Asana @ https://app.asana.com/0/257584043292808/354893629127022.
    
    Test Plan:
    - Substate into webapp.
    - Open up a scratchpad.
    - Enter:
    
    ```
    var img = getImage("avatars/avatar-team");
    img.resize(200, 200);
    ```
    - Verify that you see Oh Noes with an error RE resizing a remotely-loaded image.
    
    Reviewers: kevinb
    
    Reviewed By: kevinb
    
    Differential Revision: https://phabricator.khanacademy.org/D36244
Commits on May 3, 2017
  1. Avoid freezing window for newer versions of Chrome

    Charles Marsh committed May 3, 2017
    Summary:
    This is a "paper over the cracks" fix to keep scratchpads working in Chrome Canary (namely, in
    Chrome 59 and onward). The rationale for the change is:
    
    - We're already _not_ freezing `window` in Firefox, Safari, and IE.
    - With this simple change, we can downgrade from a P1 to, say, a P3, and take our time in
      thinking through a more holistic fix.
    
    On Asana @ https://app.asana.com/0/257584043292808/330880247083459.
    
    Test Plan:
    - Substate this change into webapp.
    - In webapp, run `make serve`.
    - Open up a scratchpad (http://localhost:8080/computing/computer-science/algorithms/merge-sort/p/challenge-implement-merge)
      in Chrome stable and Chrome Canary.
        - In both cases, verify that the scratchpad loads without any console errors.
    
    Reviewers: kevinb, diedra
    
    Reviewed By: kevinb
    
    Subscribers: benkomalo
    
    Differential Revision: https://phabricator.khanacademy.org/D35493
Commits on Apr 13, 2017
  1. Change out throbber for spinner

    askerry committed Apr 13, 2017
    Summary: We are updating the loading animation we use on KA and would like to update the live editor throbber as well. Since the live editor only uses gif versions of the animations, we just need to swap in the new gifs.
    
    Test Plan: load up http://0.0.0.0:1111/demos/simple/ and confirm that we see the new spinner animation
    
    Reviewers: john, kevinb
    
    Subscribers: lauren, tom
    
    Differential Revision: https://phabricator.khanacademy.org/D35040
Commits on Feb 13, 2017
  1. warn against PRs

    kevinbarabash committed Feb 13, 2017
Commits on Nov 19, 2016
Commits on Nov 7, 2016
  1. Move ohnoes images to creatures folder (#619)

    MattMS committed with kevinbarabash Nov 7, 2016
    * Move OhNoes-Happy and Hmm to creatures folder
    
    * Update OhNoes in live-editor template
    
    * Add OhNoes Happy and Hmm to all-images.js
    
    * Move OhNoes images in build folder
    
    * Add OhNoes to shared images.js
    
    * Fix OhNoes image path in live editor template
    
    * Fix OhNoes case in live editor template
    
    * Add OhNoes images to build js shared
    
    * Fix case in build js live editor
    
    * Add OhNoes to build live-editor.shared.js
Commits on Oct 31, 2016
  1. Use rimraf in npm install script (#618)

    MattMS committed with kevinbarabash Oct 31, 2016
    rimraf is used as a replacement for 'rm -rf' on windows.
Commits on Oct 14, 2016
  1. Add more images to Pixar in a Box

    mpolyak committed Oct 14, 2016
    Summary:
    Follow up to: D31010
    
    https://app.asana.com/0/27216215224639/184924284741616
    
    Test Plan:
     - Run `python -m SimpleHTTPServer`
     - Open http://localhost:8000/demos/simple/
     - Type `image(getImage("pixar/bing1"), 0, 100, 400, 200);`
     - Verify image is displayed.
     - Change image to `bing2`, `cars1` and `food1` and verify all are displayed.
    
    Reviewers: eater, kevinb
    
    Reviewed By: kevinb
    
    Differential Revision: https://phabricator.khanacademy.org/D31373
Commits on Sep 28, 2016
  1. Add new avatars to the image picker

    rileyjshaw committed Sep 28, 2016
    Our new avatars are official! They were added to the picker in D31051;
    time to thrust them into the limelight.
    
    Adds the following avatars:
    
    - duskpin-sapling
    - duskpin-seed
    - duskpin-seedling
    - duskpin-tree
    - duskpin-ultimate
    - marcimus-orange
    - marcimus-purple
    - marcimus-red
    - mr-pants-green
    - mr-pants-orange
    - mr-pants-pink
    - mr-pants-purple
    - mr-pink-green
    - mr-pink-orange
    - old-spice-man-blue
    - primosaur-sapling
    - primosaur-seed
    - primosaur-seedling
    - primosaur-tree
    - primosaur-ultimate
    - purple-pi-pink
    - purple-pi-teal
    - spunky-sam-green
    - spunky-sam-orange
    - spunky-sam-red
    - starky-sapling
    - starky-seed
    - starky-seedling
    - starky-tree
    - starky-ultimate
    
    Test Plan:
    
    - Run `python -m SimpleHTTPServer`
    - Go to http://localhost:8000/demos/simple/
    - Type `image(getImage(""), 0, 100, 400, 200);`
    - Click to see the image picker
    
    So many new pals!
    
    Auditors: dhruv
  2. Add some missing avatars to our image picker

    rileyjshaw committed Sep 28, 2016
    Running a comparison of `all-images.js` and `images.js`, we appear to
    be missing some avatars from our picker. This adds "avatar-team" and
    "mr-pants-with-hat".
    
    I've left "mystery-1" and "mystery-2" out because they sound like
    they're meant to be a secret. Also, the images don't seem as fun as
    the others : )
    
    Test Plan:
    
    - Run `python -m SimpleHTTPServer`
    - Go to http://localhost:8000/demos/simple/
    - Type `image(getImage(""), 0, 100, 400, 200);`
    - Click to see the image picker
    
    "avatar-team" and "mr-pants-with-hat" should appear.
    
    Auditors: dhruv
  3. Alphabetize the avatar image list

    rileyjshaw committed Sep 28, 2016
    This construct seems pretty clunky, but I'm just here to add avatars!
    Before I get to that, I'm alphabetizing the list to make diffs easier
    to check.
    
    This affects the list's display order for users! That seems OK to me -
    it's already in a completely different order than our avatar picker.
    
    Test Plan:
    
    - Run `python -m SimpleHTTPServer`
    - Go to http://localhost:8000/demos/simple/
    - Type `image(getImage("avatars/aqualine-seed"), 0, 100, 400, 200);`
    - See an image
    
    Auditors: dhruv
Commits on Sep 26, 2016
  1. Add more Pixar images for PiaB

    beneater committed Sep 26, 2016
    Summary: For https://app.asana.com/0/27216215224639/184924284741616
    
    Test Plan:
    - Run `python -m SimpleHTTPServer`
    - Go to http://localhost:8000/demos/simple/
    - Type `image(getImage("pixar/rat_1"), 0, 100, 400, 200);`
    - See an image
    - Change `rat_1` to `rat_2` and `rat_3` to see the other images
    
    Reviewers: john
    
    Reviewed By: john
    
    Differential Revision: https://phabricator.khanacademy.org/D31010
Commits on Sep 18, 2016
  1. Used escodegen instead of memberExpressionToString (#602)

    benburrill committed with kevinbarabash Sep 18, 2016
    Removed the function `memberExpressionToString` and replaced it with
    `escodegen.generate`.  The reason for this change is that escodegen
    does everything `memberExpressionToString` does, but handles all node
    types, which is important for some code.  See #601.
Commits on Sep 17, 2016
Commits on Jul 6, 2016
Commits on Jun 16, 2016
  1. Date and Number allowed; Semicolon after background, (#585)

    MatthiasSaihttam committed with kevinbarabash Jun 16, 2016
    * Allow Number and Date in PJS
    * Include test for Date and Number
    * Add semicolons unconditionally after background
    * Added functionParamCount entry for Date
    I added `"Date": [0, 1, 2, 3, 4, 5, 6, 7],` to correctly reflect the number of parameters `new Date()` can take. Otherwise BabyHint insists on there being 7 parameters.
Commits on May 24, 2016
  1. Add some more images to live-editor for Pixar in a Box

    dkapadia committed May 23, 2016
    Summary: Ticket: https://app.asana.com/0/27216215224639/132246768956926
    
    Test Plan:
    1. Visited the editor in a browser at the following URL:
       `http://localhost:8080/computer-programming/imageimage-x-y/937672662`
    
    2. Added `image(getImage("insideout/shot1_layer5blur0"), 0, 10, 200, 150);`
       to the editor
    
    3. Saw an image of the sad emotion appear!
    
    Reviewers: johnsullivan, kevinb
    
    Reviewed By: kevinb
    
    Differential Revision: https://phabricator.khanacademy.org/D27518
Commits on May 13, 2016
  1. Add some images to live-editor for Pixar in a Box

    brownhead committed May 12, 2016
    Summary: Ticket: https://app.asana.com/0/27216215224639/132246768956926
    
    Test Plan:
    Go to /computer-programming/imageimage-x-y/937672662 and run the code:
    
    	image(getImage("insideout/layer3blur0"), 100, 100);
    
    See some delicious pizza appear.
    
    Reviewers: lauren, kevinb
    
    Reviewed By: kevinb
    
    Differential Revision: https://phabricator.khanacademy.org/D27296
Commits on Apr 10, 2016
  1. Default to the new error experience in the demo

    kevinbarabash committed Apr 10, 2016
    Summary:
    Without using the new error experience error buddy gets into a
    state where it thinks you haven't fixed an error even though
    you have.  There was some talk about possibly allowing users
    to switch between the two experiences.  I'll see about actually
    fixing the bug in a following diff.
    
    Test Plan:
    - gulp
    - load http://localhost:63343/live-editor/demos/simple/index.html
    - verify that the new error experience runs
    
    Auditors: john
  2. Update imagePicker tests

    kevinbarabash committed Apr 10, 2016
    Summary:
    We only append the semicolon when autocompleting getImage in an
    assigment statement.
    
    Test Plan:
    - load http://localhost:63343/live-editor/tests/tooltips/index.html
    
    Auditors: john
  3. Merge pull request #573 from Khan/fill_stroke_append_semicolon

    kevinbarabash committed Apr 10, 2016
    Add semicolons unconditionally for fill/stroke function calls
  4. Add semicolons unconditionally for fill/stroke function calls

    kevinbarabash committed Apr 10, 2016
    Summary:
    Since fill/stroke commands shouldn't appear as args to other
    function calls it's okay to append a semicolon.
    
    Test Plan:
    - load http://localhost:63343/live-editor/demos/simple/index.html?new_error_experience=yes
    - type fill( and see the semicolon being added at the end of the autocomplete
    - do the same for stroke(
    - type color( and see the semicolon not being added
    - do the same for getImage(
    - assign color( and getImage( to variables and verify that semicolons are being added
    
    Reviewers: john
Commits on Mar 24, 2016
  1. Edit the styling on the play button.

    csilvers committed Mar 24, 2016
    Summary:
    This fixes https://app.asana.com/0/25429045350268/81183266511495
    
    Once it's checked in I'll also need to update the live-editor substate
    in webapp before people can see it.
    
    Test Plan: None!  I trust kitt's css-foo.
    
    Reviewers: john, kitt, kevinb
    
    Reviewed By: kevinb
    
    Differential Revision: https://phabricator.khanacademy.org/D26118
Commits on Mar 7, 2016
  1. Merge pull request #560 from Khan/fix-autocomplete

    kevinbarabash committed Mar 7, 2016
    Change color() and getImage() auto-complete to not insert ; as often. Fixes #262.
Commits on Mar 4, 2016
  1. Fix link-redirector regex

    benjaminjkraft committed Mar 4, 2016
    Summary:
    We don't make users use the link-redirector for links to `khanacademy.org`.
    However, our regex wasn't quite correct, so they could also avoid it for links
    to e.g. `khanacademy.org.evil.com`.  Now they can't.
    
    Test Plan:
    * Copy the content of
      `https://www.khanacademy.org/computer-programming/test-webpage-please-ignore/3142111237`
      into a new webpage on a dev server, and check that the second link still
      bypasses the redirector, but the third link no longer does.
    * `gulp test` (fails with only the `tests/` change, passes with the `js/`
      change)
    
    Reviewers: kevinb
    
    Subscribers: sean
    
    Differential Revision: https://phabricator.khanacademy.org/D25727