Note
DOM Element vs JavaScript Object
When talking about the DOM Element representing an item, I’ll use DOM .item — otherwise, for JavaScript or Python data sets, I’ll write: (Object/dict) Item.
arg data: Object to pass to the template arg name: name of the template (without the “view_” prefix)
Arguments: |
|
---|
Returns the HTML content
Arguments: |
|
---|
Draws this template on screen, replacing #contents with PageTemplate.draw()
Clears display
Inherits PageTemplate()
Aims at handling a list of Resource()
Get the Resource() used for this link
Arguments: |
|
---|---|
Return type: |
Refresh DOM informations of the item matching link
Arguments: |
|
---|
Add a Resource() to current Page
Remove the given Resource()
Call UI.fix_nav() and change the current sort criteria
The most basic object you can work on
arg dict: the Object containing initial metadata for this Resource
More or less the lowercased name corresponding to this class name
Space-separated list of properties available for filtering, see UI.filter_items()
List of file names to load prior loading this item
Returns a human readable size for this Item(), see UI.hr_size() .
Returns a fresh item from this one, by requesting data to server.
Called when this item has been loaded. You may add your custom DOM processing here
Edit this item, if the Resource.link TODO: refactor it
Deletes an item (from server)
Displays an item, calling Nano.load_resource()
Returns resource’s path (HTML view)
Returns resource’s path for RAW data
Returns resource’s path for JSON metadata
Returns resource’s path for JSON child resources list
Inherits Resource()
Just adds title from link in case it’s empty and sets a default description
The UI object ;)
Arguments: |
|
---|
Filters the DOM content according to a pattern, if pattern is empty the display will be unfiltered. If pattern is prefixed by a name (without spaces) and colon (ex: type:), then the filtering will be done against this metadata name.
Handles the “click” on the given link in the .navbar (sort criteria)
Example usage:
<a href="#" onclick="UI.fix_nav(this); do_some_action();">link</a>
Arguments: |
|
---|---|
Returns: | Human readable size |
Return type: | string |
Renders an Item() by calling it’s Resource.post_view_callback() after calling MimeManager.load_dependencies()
Arguments: |
|
---|
Removes the edited item and close the modal
Saves current item metadata
Returns the DOM element owning the link from one of its child elements Useful to handle actions / clicks.
Uncompresses a list of “compact” (Object/dict) Items as returned by weye.root_objects.list_children() for instance.
Arguments: |
|
---|---|
Returns: | “flat” array of objects. Ex: [ {'link': 'toto', 'age': 1}, {'name': 'tata', 'age': 4}, {'name': 'titi', 'age': 42} ]
|
This is the main object to use in the API
Current document path, ex: “/”
Current document’s template, see ItemList()
Current Resource() in use (displayed / matches Nano.doc_ref)
Displays given :arg:`item`
Arguments: |
|
---|
Loads an Item() by its link name (using load_resource())
Arguments: |
|
---|
Loads a Resource(), if it’s a shallow one (no size) then it will fetch the full object first. At the end, UI.render_dom() is called with the resource
Arguments: |
|
---|
Back to upper level. Leaves the current navigation level and reach the parent calling Nano.load_link()
Arguments: |
|
---|
Object handling templates currently, will probably be refactored later.
Arguments: |
|
---|---|
Return type: | Array of String |
Returns: | The list of mimes |
Get a template suitable for this mime type, the best value from MimeManager.find_choices() is returned
Arguments: |
|
---|---|
Returns: | a template |
Return type: | Template() |
Load dependencies for the given item
Arguments: |
|
---|
JavaScript reference