API Docs for:
Show:

CharmView Class

Extends Y.View
Module: store

View for the Charm details UI.

Methods

_addCharmEnvironment

(
  • ev
)
private

When the 'add' is clicked we need to work on adding the ghost to the environment.

Parameters:

  • ev Event

    the event from the click handler.

_bindTabEvents

(
  • tab
)

Watch the tab control for change events and dispatch accordingly.

Parameters:

  • tab TabView

    the tab control to monitor.

_buildQAData

(
  • responseData
)

The API retuns the questions and the scores. Combine the data into a single source to make looping in the handlebars templates nicer.

Parameters:

  • responseData Object

    the qa data from the store.

_formatCommitsForHtml

(
  • commits
)

Commits need to be formatted, dates made pretty for the output to the template. We have to break up the first one from the rest since it's displayed differently.

Parameters:

  • commits Array

    a list of commit objects.

_getInterfaceIntroFlag

(
  • commits
)

Determine which intro copy to display depending on the number of interfaces.

The goal is to build a property string like: noRequiresNoProvides

Parameters:

  • commits Array

    a list of commit objects.

_loadFile

(
  • container
  • filename
)
private

Fetch the contents from a file and drop it into the container specified.

Parameters:

  • container Node

    the node to set content to.

  • filename String

    the name of the file to fetch from the api.

_loadHookContent

(
  • ev
)

Event handler for clicking on a hook filename to load that file.

Parameters:

  • ev Event

    the click event created.

_loadQAContent

()

Load the charm's QA data and fill it into the tab when selected.

_locateReadme

() private

The readme file in a charm can be upper/lower/etc. This helps find a readme from the list of files in a charm.

_noReadme

(
  • container
)

When there is no readme setup some basic 'nothing found content'.

Parameters:

  • container Node

    the node to drop this default content into.

_renderCharmView

(
  • charm
  • isFullscreen
)

Render the view of a single charm details page.

Parameters:

  • charm BrowserCharm

    the charm model instance to view.

  • isFullscreen Boolean

    is this display for the fullscreen experiecne?

_toggleLog

(
  • ev
)
private

Clicking on the open log should toggle the list of log entries.

Parameters:

  • ev Event

    the click event of the open log control.

apiFailure

(
  • data
  • request
)

Shared method to generate a message to the user based on a bad api call.

Parameters:

  • data Object

    the json decoded response text.

  • request Object

    the original io_request object for debugging.

destructor

()

Clean up after ourselves.

initializer

(
  • cfg
)

Generic YUI initializer. Make sure we track indicators for cleanup.

Parameters:

  • cfg Object

    configuration object.

render

()

Render out the view to the DOM.

The View might be given either a charmID, which means go fetch the charm data, or a charm model instance, in which case the view has the data it needs to render.

Attributes

charm

juju.models.BrowserCharm

The charm we're viewing the details of.

Default: undefined

charmID

Int

Default: undefined

events

List the DOM based events to watch for in the container.

isFullscreen

Boolean

Default: false

store

Charmworld0

The store is the api endpoint for fetching data.

Default: undefined