Skip to content

implement applab events with limited properties#2398

Merged
cpirich merged 1 commit into
stagingfrom
applab_event_changes
May 14, 2015
Merged

implement applab events with limited properties#2398
cpirich merged 1 commit into
stagingfrom
applab_event_changes

Conversation

@cpirich

@cpirich cpirich commented May 13, 2015

Copy link
Copy Markdown
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.

Comment thread apps/src/applab/applab.js

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all of these elements associated with the event guaranteed to be inside divApplab?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we check that for all functions that operate on element id's, including onEvent

@davidsbailey

Copy link
Copy Markdown
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
@cpirich cpirich merged commit 804075a into staging May 14, 2015
@cpirich cpirich deleted the applab_event_changes branch May 14, 2015 14:29
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants