collapsible.js

Summary
collapsible.js
bbop.html.collapsibleImplement the Bootstrap 3 collapse JS widget.
bbop.html.collapsible
Functions
collapsibleCreate the a frame for the functional part of a jQuery collapsible structure.
to_stringConvert the collapsible object into a html-ized string.
add_toAdd a contect section to the collapsible.
emptyEmpty all sections from the collapsible.
get_idReturn the id if extant, null otherwise.
get_section_idGet the “real” section id by way of the “convenience” section id?

bbop.html.collapsible

Implement the Bootstrap 3 collapse JS widget.  http://getbootstrap.com/javascript/#collapse

See also

bbop.html

bbop.html.collapsible

Summary
Functions
collapsibleCreate the a frame for the functional part of a jQuery collapsible structure.
to_stringConvert the collapsible object into a html-ized string.
add_toAdd a contect section to the collapsible.
emptyEmpty all sections from the collapsible.
get_idReturn the id if extant, null otherwise.
get_section_idGet the “real” section id by way of the “convenience” section id?

Functions

collapsible

bbop.html.collapsible = function(in_list,
attrs)

Create the a frame for the functional part of a jQuery collapsible structure.

Input:
 [[title, string/*.to_string()], ...]

Output:
<div class="panel-group" id="accordion">
 <div class="panel panel-default">
  <div class="panel-heading">
   <h4 class="panel-title">
    <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
     ...
    </a>
   </h4>
  </div>
  <div id="collapseOne" class="panel-collapse collapse in">
   <div class="panel-body">
    ...
   </div>
  </div>
 </div>
 ...

Parameters

in_listcollapsible frame headers: [[title, string/*.to_string()], ...]
attrs[serially optional] attributes to apply to the new top-level div

Returns

bbop.html.collapsible object

Also see: tag

to_string

bbop.html.collapsible.prototype.to_string = function()

Convert the collapsible object into a html-ized string.

Parameters: n/a

Returns

string

add_to

bbop.html.collapsible.prototype.add_to = function(section_info,
content_blob)

Add a contect section to the collapsible.

Parameters

section_infoa string or a hash with ‘id’, ‘label’, and ‘description’
content_blobstring or bbop.html object to put in a section

Returns: n/a

empty

bbop.html.collapsible.prototype.empty = function()

Empty all sections from the collapsible.

Parameters: n/a

Returns: n/a

get_id

bbop.html.collapsible.prototype.get_id = function()

Return the id if extant, null otherwise.

Parameters: n/a

Returns: string or null

get_section_id

bbop.html.collapsible.prototype.get_section_id = function(sect_id)

Get the “real” section id by way of the “convenience” section id?

Parameters

sect_idTODO ???

Returns: TODO ???

bbop.html.collapsible = function(in_list,
attrs)
Create the a frame for the functional part of a jQuery collapsible structure.
bbop.html.collapsible.prototype.to_string = function()
Convert the collapsible object into a html-ized string.
bbop.html.collapsible.prototype.add_to = function(section_info,
content_blob)
Add a contect section to the collapsible.
bbop.html.collapsible.prototype.empty = function()
Empty all sections from the collapsible.
bbop.html.collapsible.prototype.get_id = function()
Return the id if extant, null otherwise.
bbop.html.collapsible.prototype.get_section_id = function(sect_id)
Get the “real” section id by way of the “convenience” section id?
Right now contains bbop.html.tag, but all html producing functions should go in here somewhere.
Close