Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotatable Elements #1

Open
datapimp opened this issue Mar 7, 2014 · 0 comments
Open

Annotatable Elements #1

datapimp opened this issue Mar 7, 2014 · 0 comments

Comments

@datapimp
Copy link
Member

datapimp commented Mar 7, 2014

I would like to use the following API for a Javascript component:

# browserify
annotations = require("annotations")

# enable annotations on the specified element
obj = annotations.enable(el: "#my-iframe", style: "points", maskClass: "dark-translucent")

Once enabled, a shim should be placed on top of the element, which captures any click events. Based on the style passed in as an option, elements should be placed and positioned wherever the click occurred.

Other things I'd like to be able to do:

# This should give me a structure representing all of the annotations
persisted  = obj.annotations()

# This should redraw all of the annotations on the given iframe
obj.restore(persisted)

# this should allow me to bind to annotation events
obj.on("annotation:received", (element, details) -> ...)

# disable the annotations behavior
obj.disable()

Annotation Styles

  • points puts numbered points ontop of the element
  • boxes boxes allows me to drag boxes for annotations

Annotation Objects

annotations = obj.annotations()
annotation = annotations.first()

annotation = 
  index: 0
  style: "points"
  meta: {}
  position:
    top: 25
    left: 25
@datapimp datapimp added bug and removed bug labels Mar 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant