renames & refactors annotations.js into annotable.js

This commit is contained in:
kikito
2015-12-16 16:07:23 +01:00
parent 7996f5f816
commit f43248b174
5 changed files with 16035 additions and 28 deletions

View File

@@ -0,0 +1,20 @@
App.Annotable =
initialize: ->
$("[data-annotable-type]").each ->
$this = $(this)
ann_type = $this.data("annotable-type")
ann_id = $this.data("annotable-id")
ann_user_id = $this.data("annotable-user-id")
app = new annotator.App()
.include(annotator.ui.main, { element: this })
.include(annotator.storage.http, { prefix: "", urls: { search: "/annotations/search" } })
.include ->
beforeannotationCreated: (ann) ->
ann[ann_type + "_id"] = ann_id
ann.user_id = ann_user_id
app.start().then ->
options = {}
options[ann_type + "_id"] = ann_id
app.annotations.load(options)