Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Planning Viewer Annotation Integration

nathanstitt edited this page Jan 22, 2013 · 7 revisions

dc.ui.ViewerControlPanel owns the AnnotationEditor

dc.app.editor initializes the AnnotationEditor at dc.app.editor.annotationEditor

dc.ui.ControlPanel enables it and hides/shows the help text in the sidebar.

The AnnotationEditor handles drawing the rectangle highlight rectangle and saving the annotation. The viewer handles displaying the annotation itself and editing it. The data model actually resides in the viewer. It's a plain javascript object though, not backbone.

In order to move the ControlPanel inside the viewer we'll have to:

  • Find a cross-domain method of saving Backbone models.

  • We can support this by writing a easyXDM based version of Backbone.sync. http://easyxdm.net/wp/2010/03/17/cross-domain-ajax/ has an example of performing Ajax which we can use as a starting point.

  • This should be written in a manner that keeps the original in-place unless it's cross domain. That way there's no additional overhead when the viewer is used on documentcloud.org

  • Account questions

  • How to pass the current account to the viewer? We could extend the JSON returned by DV.load to include the current user's canonical, or should the viewer perform a request as soon as it's initialized, before the load call.

  • Decide how to represent the accounts's capabilities and what controls to hide/show on the control panel.

  • Do we allow accounts to logout from the viewer?

  • Should the account object live at dc.account in the viewer like it does in the editor?

  • Files to move:

  • The editor. public/javascripts/editor/.js and app/views/jst/editor/.jst, and public/stylesheets/pages/viewer_editing.css

  • app/views/jst/editor/control_panel.jst

  • app/views/jst/editor/document_page_tile.jst

  • app/views/jst/editor/edit_page_text.jst

  • app/views/jst/editor/remove_pages.jst

  • app/views/jst/editor/reorder_pages.jst

  • app/views/jst/editor/replace_pages.jst

  • app/views/jst/editor/reviewer_welcome.jst

  • app/views/jst/editor/section_row.jst

  • public/javascripts/app/editor.js

  • public/javascripts/editor/annotation_editor.js

  • public/javascripts/editor/control_panel.js

  • public/javascripts/editor/edit_page_text_editor.js

  • public/javascripts/editor/editor_toolbar.js

  • public/javascripts/editor/remove_pages_editor.js

  • public/javascripts/editor/reorder_pages_editor.js

  • public/javascripts/editor/replace_pages_editor.js

  • public/javascripts/editor/section_editor.js

Files to somehow share. I'm unclear on how the best way to accomplish this. Should we move them to the viewer and extend the build:viewer rake task to copy them to documentcloud?

  • Dialogs.

  • DocumentData ui/documents/document_data_dialog.js, app/views/jst/workspace/document/data_dialog.jst

  • Document ui/documents/document_dialog.js, workspace/document/document_dialog.jst

  • The Note and Document embeds.

  • CSS:

    • pages/viewer_editing.css
    • ui/icons.css