Skip to content
Kyle Jaebker edited this page Jan 15, 2014 · 1 revision

The app is started by first calling:

app.bootstrap();

The configuration for the instance of the OSCI Toolkit is passed into bootstrap. Refer to devel.html for the configuration options (This will be better documented in the future).

After calling bootstrap, call the run function to start the app.

app.run();

This method will create a new PackageModel using the packageUrl passed into the bootstrap config object.

PackageModel.js triggers packageLoaded after initialization is complete

packageLoaded is subscribed to by:

  • GlossaryTermsCollection - starts glossary parsing
  • NavigationItemsCollection - parses navigation document and creates NavigationItemModels
  • TitleView - updates the publication title
  • zotero - adds COInS data to the DOM

NavigationItemCollection then triggers navigationLoaded after parsing the Nav document

navigationLoaded is subscribed to by:

  • TocView - renders the TOC

This completes the app initialization and the router takes over.

User navigates to #section/n

Router triggers routedToSection

routedToSection is subscribed to by:

  • GlossaryTooltipView - removes all tooltips currently created by the glossary view
  • NavigationView - sets the current navigation item and triggers currentNavigationItemChanged

currentNavigationItemChanged is subscribed to by:

  • NotesCollection - loads notes for the current section and triggers notesLoaded

  • SectionView - displays loader, creates sectionModel which triggers footnotesAvailable, figuresAvailable, sectionLoaded, then renders the section triggering layoutStart, layoutComplete

  • Router triggers routedToSection

  • views.Navigation handles routedToSection, triggers currentNavigationItemChanged

  • collections.Notes handles currentNavigationItemChanged, triggers notesLoaded

  • views.InlineNotes handles notesLoaded

  • views.Toc handles currentNavigationItemChanged and renders the table of contents

  • views.Section handles currentNavigationItemChanged

  • Creates a models.Section and calls loadContent

  • loadContent triggers footnotesAvailable * collections.Footnotes handles footnotesAvailable, triggers footnotesLoaded

  • loadContent triggers figuresAvailable * collections.Figures handles figuresAvailable, triggers figuresLoaded

  • loadContent triggers sectionLoaded

  • Triggers layoutStart

  • Triggers layoutComplete

  • views.Footnotes handles layoutComplete

  • views.Navigation handles layoutComplete, triggers navigate * views.MultiColumnSection handles navigate, triggers pageChanged

    • views.Navigation handles pageChanged
    • views.Notes handles pageChanged