CharmView Class
View for the Charm details UI.
Item Index
Methods
Attributes
Methods
_addCharmEnvironment
-
ev
When the 'add' is clicked we need to work on adding the ghost to the environment.
Parameters:
-
evEventthe event from the click handler.
_bindTabEvents
-
tab
Watch the tab control for change events and dispatch accordingly.
Parameters:
-
tabTabViewthe 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:
-
responseDataObjectthe 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:
-
commitsArraya 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:
-
commitsArraya list of commit objects.
_loadFile
-
container -
filename
Fetch the contents from a file and drop it into the container specified.
Parameters:
-
containerNodethe node to set content to.
-
filenameStringthe name of the file to fetch from the api.
_loadHookContent
-
ev
Event handler for clicking on a hook filename to load that file.
Parameters:
-
evEventthe 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:
-
containerNodethe node to drop this default content into.
_renderCharmView
-
charm -
isFullscreen
Render the view of a single charm details page.
Parameters:
-
charmBrowserCharmthe charm model instance to view.
-
isFullscreenBooleanis this display for the fullscreen experiecne?
_toggleLog
-
ev
Clicking on the open log should toggle the list of log entries.
Parameters:
-
evEventthe 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:
-
dataObjectthe json decoded response text.
-
requestObjectthe original io_request object for debugging.
destructor
()
Clean up after ourselves.
initializer
-
cfg
Generic YUI initializer. Make sure we track indicators for cleanup.
Parameters:
-
cfgObjectconfiguration 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.
