Last active
December 18, 2020 17:21
-
-
Save itskingori/2f5d4984fdfe1f1c1646 to your computer and use it in GitHub Desktop.
Revisions
-
King'ori Maina ♛ revised this gist
Mar 4, 2015 . 1 changed file with 30 additions and 15 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,53 +1,68 @@ Annotator.Plugin.Example = function (element, options) { var myPlugin = {}; myPlugin.pluginInit = function () { // This annotator instance this.annotator // LOADING .subscribe("annotationsLoaded", function (annotations) { console.log("annotationsLoaded called when the annotations have been loaded."); console.log(annotations); }) // CREATE .subscribe("beforeAnnotationCreated", function (annotation) { console.log("beforeAnnotationCreated called immediately before an annotation is created. If you need to modify the annotation before it is saved use this event."); console.log(annotation); }) .subscribe("annotationCreated", function (annotation) { console.log("annotationCreated called when the annotation is created use this to store the annotations."); console.log(annotation); }) // UPDATE .subscribe("beforeAnnotationUpdated", function (annotation) { console.log("beforeAnnotationUpdated as annotationCreated, but just before an existing annotation is saved."); console.log(annotation); }) .subscribe("annotationUpdated", function (annotation) { console.log("annotationUpdated as beforeAnnotationUpdated, but for an existing annotation which has just been edited."); console.log(annotation); }) // DELETE .subscribe("annotationDeleted", function (annotation) { console.log("annotationDeleted called when the user deletes an annotation."); console.log(annotation); }) // VIEWER .subscribe("annotationViewerShown", function (viewer, annotations) { console.log("annotationViewerShown called when the annotation viewer is shown and provides the annotations being displayed."); console.log(viewer); console.log(annotations); }) .subscribe("annotationViewerTextField", function (field, annotation) { console.log("annotationViewerTextField called when the text field displaying the annotation comment in the viewer is created."); console.log(field); console.log(annotation); }) // EDITOR .subscribe("annotationEditorShown", function (editor, annotation) { console.log("annotationEditorShown called when the annotation editor is presented to the user."); console.log(editor); console.log(annotation); }) .subscribe("annotationEditorHidden", function (editor) { console.log("annotationEditorHidden called when the annotation editor is hidden, both when submitted and when editing is cancelled."); console.log(editor); }) .subscribe("annotationEditorSubmit", function (editor, annotation) { console.log("annotationEditorSubmit called when the annotation editor is submitted."); console.log(editor); console.log(annotation); }) }; return myPlugin; }; -
King'ori Maina ♛ revised this gist
Mar 4, 2015 . 1 changed file with 46 additions and 44 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,51 +1,53 @@ Annotator.Plugin.Voting = function (element, options) { var voter = {}; voter.pluginInit = function () { // This annotator instance this.annotator // LOADING .subscribe("annotationsLoaded", function (annotations) { console.log("annotationsLoaded called when the annotations have been loaded.") }) // CREATE .subscribe("beforeAnnotationCreated", function (annotation) { console.log("beforeAnnotationCreated called immediately before an annotation is created. If you need to modify the annotation before it is saved use this event.") }) .subscribe("annotationCreated", function (annotation) { console.log("annotationCreated called when the annotation is created use this to store the annotations.") }) // UPDATE .subscribe("beforeAnnotationUpdated", function (annotation) { console.log("beforeAnnotationUpdated as annotationCreated, but just before an existing annotation is saved.") }) .subscribe("annotationUpdated", function (annotation) { console.log("annotationUpdated as beforeAnnotationUpdated, but for an existing annotation which has just been edited.") }) // DELETE .subscribe("annotationDeleted", function (annotation) { console.log("annotationDeleted called when the user deletes an annotation.") }) // VIEWER .subscribe("annotationViewerShown", function (viewer, annotations) { console.log("annotationViewerShown called when the annotation viewer is shown and provides the annotations being displayed.") }) .subscribe("annotationViewerTextField", function (field, annotation) { console.log("annotationViewerTextField called when the text field displaying the annotation comment in the viewer is created.") }) // EDITOR .subscribe("annotationEditorShown", function (editor, annotation) { console.log("annotationEditorShown called when the annotation editor is presented to the user.") }) .subscribe("annotationEditorHidden", function (editor) { console.log("annotationEditorHidden called when the annotation editor is hidden, both when submitted and when editing is cancelled.") }) .subscribe("annotationEditorSubmit", function (editor, annotation) { console.log("annotationEditorSubmit called when the annotation editor is submitted.") }) }; return voter; }; -
King'ori Maina ♛ revised this gist
Mar 4, 2015 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,11 @@ Annotator.Plugin.Example = function (element, options) { var myPlugin = {}; myPlugin.pluginInit = function () { this.annotator // LOADING // .subscribe("annotationsLoaded", function (annotations) { // console.log("annotationsLoaded called when the annotations have been loaded.") // }) // CREATE // .subscribe("beforeAnnotationCreated", function (annotation) { // console.log("beforeAnnotationCreated called immediately before an annotation is created. If you need to modify the annotation before it is saved use this event.") -
King'ori Maina ♛ renamed this gist
Mar 4, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
King'ori Maina ♛ created this gist
Mar 4, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ Annotator.Plugin.Example = function (element, options) { var myPlugin = {}; myPlugin.pluginInit = function () { this.annotator // CREATE // .subscribe("beforeAnnotationCreated", function (annotation) { // console.log("beforeAnnotationCreated called immediately before an annotation is created. If you need to modify the annotation before it is saved use this event.") // }) // .subscribe("annotationCreated", function (annotation) { // console.log("annotationCreated called when the annotation is created use this to store the annotations.") // }) // UPDATE // .subscribe("beforeAnnotationUpdated", function (annotation) { // console.log("beforeAnnotationUpdated as annotationCreated, but just before an existing annotation is saved.") // }) // .subscribe("annotationUpdated", function (annotation) { // console.log("annotationUpdated as beforeAnnotationUpdated, but for an existing annotation which has just been edited.") // }) // DELETE // .subscribe("annotationDeleted", function (annotation) { // console.log("annotationDeleted called when the user deletes an annotation.") // }) // VIEWER // .subscribe("annotationViewerShown", function (viewer, annotations) { // console.log("annotationViewerShown called when the annotation viewer is shown and provides the annotations being displayed.") // }) // .subscribe("annotationViewerTextField", function (field, annotation) { // console.log("annotationViewerTextField called when the text field displaying the annotation comment in the viewer is created.") // }) // EDITOR // .subscribe("annotationEditorShown", function (editor, annotation) { // console.log("annotationEditorShown called when the annotation editor is presented to the user.") // }) // .subscribe("annotationEditorHidden", function (editor) { // console.log("annotationEditorHidden called when the annotation editor is hidden, both when submitted and when editing is cancelled.") // }) // .subscribe("annotationEditorSubmit", function (editor, annotation) { // console.log("annotationEditorSubmit called when the annotation editor is submitted.") // }) }; return myPlugin; };