implement applab events with limited properties#2398
Merged
Conversation
cpirich
commented
May 13, 2015
Contributor
- Start to implement applab events per spec: https://docs.google.com/document/d/1KtjlpVEyMoiH04ypJDFQoz3A05PBQc3h8uYGEGV3Kbo
- Limit properties on the event object to a specific list (we will likely tweak the list of allowed properties further)
- Restrict onEvent() to only allow 12 specific types of events
- Convert coordinates in x/y, clientX/Y, and pageX/Y to be relative to applab "window" as 0,0
- Convert event properties that expose DOM elements to expose a similar property with an element ID instead (e.g. srcElement is replaced with srcElementId) - this preserved the integrity of the applab sandbox and gives the user a property (an ID) they can use for other functions in our API set.
- Create .key property on the Event when possible. This property is not yet implemented in Chrome and Safari, so implement it ourselves using charCode, keyCode, and a keyCode->key map.
- Disable hammer.js touch events until we've settled on the specific list of touch events that we want to support.
Member
There was a problem hiding this comment.
Are all of these elements associated with the event guaranteed to be inside divApplab?
Contributor
Author
There was a problem hiding this comment.
Yes, we check that for all functions that operate on element id's, including onEvent
Member
|
LGTM. Very cool simplification of browser events! |
cpirich
added a commit
that referenced
this pull request
May 14, 2015
implement applab events with limited properties
deploy-code-org
added a commit
that referenced
this pull request
May 14, 2015
commit 80025ca Merge: 347233c e39fa24 Author: Bjvanminnen <Bjvanminnen@gmail.com> Date: Thu May 14 09:25:35 2015 -0700 Merge pull request #2402 from code-dot-org/sharedGulp Gulpify shared/js commit 347233c Author: Continuous Integration <dev@code.org> Date: Thu May 14 15:56:42 2015 +0000 Automatically built. commit bacf9bc Author: Brent Van Minnen <bjvanminnen@gmail.com> Date: Thu May 14 08:49:02 2015 -0700 jshint fix commit bacf9bc Author: Brent Van Minnen <bjvanminnen@gmail.com> Date: Thu May 14 08:49:02 2015 -0700 jshint fix commit 2059e9e Merge: 2ea55ea a373318 Author: Bjvanminnen <Bjvanminnen@gmail.com> Date: Thu May 14 08:39:11 2015 -0700 Merge pull request #2414 from code-dot-org/linklocal2 use localpaths + linklocal to manage dependencies between packages in same repo commit a373318 Author: Brent Van Minnen <bjvanminnen@gmail.com> Date: Wed May 13 16:38:07 2015 -0700 use localpaths + linklocal to manage dependencies between packages in same repo commit 2ea55ea Author: Brent Van Minnen <bjvanminnen@gmail.com> Date: Thu May 14 08:31:16 2015 -0700 remove old references to canvas from readmes commit 804075a Merge: 313c224 4879f3c Author: Chris Pirich <chris@code.org> Date: Thu May 14 07:28:57 2015 -0700 Merge pull request #2398 from code-dot-org/applab_event_changes implement applab events with limited properties commit 313c224 Author: Will Jordan <will@code.org> Date: Wed May 13 18:54:52 2015 -0700 add international auto-redirects to varnish config commit 23f3b55 Author: Will Jordan <will@code.org> Date: Wed May 13 17:49:14 2015 -0700 add "^/poste" to Varnish cookie whitelist commit 26ed67b Author: Will Jordan <will@code.org> Date: Wed May 13 16:25:14 2015 -0700 fix typo commit 5c266f5 Author: Will Jordan <will@code.org> Date: Wed May 13 16:23:00 2015 -0700 Map /dashboardapi to studio.code.org/api instead of learn.code.org/api commit 6ee5e6b Author: Laurel Fan <laurel@code.org> Date: Wed May 13 17:05:18 2015 -0700 fix progress dots in header commit 61e1301 Merge: 34e7b8f bc27e2f Author: Andre Stackhouse <CaptainStack@outlook.com> Date: Wed May 13 16:53:16 2015 -0700 Merge pull request #2411 from code-dot-org/poste-dashboard-template Adding authentication back to this page for testing purposes. commit bc27e2f Author: CaptainStack <CaptainStack@outlook.com> Date: Wed May 13 16:52:21 2015 -0700 Adding authentication back to this page for testing purposes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.