html.js | |
bbop.html | Right now contains bbop.html.tag, but all html producing functions should go in here somewhere. |
bbop. | |
Functions | |
tag | Create the fundamental tag object to work with and extend. |
to_string | Convert a tag object into a html-ized string. |
add_to | Add content between the tags. |
empty | Remove all content between the tags. |
get_id | Return the id if extant, null otherwise. |
bbop. | |
Functions | |
accordion | Create the a frame for the functional part of a jQuery accordion structure. |
to_string | Convert the accordion object into a html-ized string. |
add_to | Add a contect section to the accordion. |
empty | Empty all sections from the accordion. |
get_id | Return the id if extant, null otherwise. |
get_section_id | Get the “real” section id by way of the “convenience” section id? |
bbop. | |
Functions | |
list | Create the a frame for an unordered list object. |
to_string | Convert a list object into a html-ized string. |
add_to | Add a new li section to a list. |
empty | Remove all content (li’s) from the list. |
get_id | Return the id if extant, null otherwise. |
bbop. | |
Functions | |
input | Create a form input. |
to_string | Convert an input into a html-ized string. |
add_to | Add content between the input tags. |
empty | Reset/remove all children. |
get_id | Return the id if extant, null otherwise. |
bbop. | |
Functions | |
anchor | Create an anchor object. |
to_string | Convert an anchor object into a html-ized string. |
add_to | Add content between the tags. |
empty | Remove all content between the tags. |
get_id | Return the id if extant, null otherwise. |
bbop. | |
Functions | |
image | Create an image (img) object. |
to_string | Convert an image object into a html-ized string. |
add_to | Add content between the tags. |
empty | Remove all content between the tags. |
get_id | Return the id if extant, null otherwise. |
bbop. | |
Functions | |
table | Create a simple table structure. |
to_string | Convert a table object into a html-ized string. |
add_to | Add data row. |
empty | Headers do not get wiped, just the data rows in the tbody. |
get_id | Return the id if extant, null otherwise. |
bbop. | |
Functions | |
button | Create a button object. |
to_string | Convert a button object into a html-ized string. |
add_to | Add content between the tags. |
empty | Remove all content between the tags. |
get_id | Return the id if extant, null otherwise. |
bbop. | |
Functions | |
span | Create a span object. |
to_string | Convert a span object into a html-ized string. |
add_to | Add content between the tags. |
empty | Remove all content between the tags. |
get_id | Return the id if extant, null otherwise. |
Right now contains bbop.html.tag, but all html producing functions should go in here somewhere.
.to_string(): returns a string of you and below .add_to(): add things between the tags .empty(): empties all things between the tags .get_id(): return the id or null if not defined These are enforced during the tests.
For functions that take attribute hashes, there is a special attribute {‘generate_id’: true} that will generate a somewhat random id if an incoming id was not already specified. This id can be retrieved using get_id().
This package takes all of the bbop.html.* namespace.
bbop.html.tag = function( tag, attrs, below )
Create the fundamental tag object to work with and extend.
tag | the tag name to be created |
attrs | [serially optional] the typical attributes to add |
below | [optional] a list/array of other html objects that exists “between” the tags |
bbop.html.tag object
Functions | |
accordion | Create the a frame for the functional part of a jQuery accordion structure. |
to_string | Convert the accordion object into a html-ized string. |
add_to | Add a contect section to the accordion. |
empty | Empty all sections from the accordion. |
get_id | Return the id if extant, null otherwise. |
get_section_id | Get the “real” section id by way of the “convenience” section id? |
bbop.html.accordion = function( in_list, attrs, add_id_p )
Create the a frame for the functional part of a jQuery accordion structure.
Input: [[title, string/*.to_string()], ...] Output: <div id="accordion"> <h3><a href="#">Section 1</a></h3> <div> <p> foo </p> </div> ... </div>
in_list | accordion frame headers: [[title, string/*.to_string()], ...] |
attrs | [serially optional] attributes to apply to the new top-level div |
add_id_p | [optional] true or false; add a random id to each section |
bbop.html.accordion object
Also see: tag
bbop.html.accordion.prototype.add_to = function( section_info, content_blob, add_id_p )
Add a contect section to the accordion.
section_info | a string or a hash with ‘id’, ‘label’, and ‘description’ |
content_blob | string or bbop.html object to put in a section |
add_id_p | [optional] true or false; add a random id to the section |
Returns: n/a
bbop.html.list = function( in_list, attrs )
Create the a frame for an unordered list object.
Input: [string/*.to_string(), ...] Output: <ul id="list"> <li>foo</li> ... </ul>
in_list | list of strings/bbop.html objects to be li separated |
attrs | [optional] attributes to apply to the new top-level ul |
bbop.html.list object
Also see: tag
bbop.html.table = function( in_headers, in_entries, in_attrs )
Create a simple table structure. in_headers is necessary, but can be empty. in_entries is necessary, but can be empty.
in_headers | ordered list of headers |
in_entries | lists of lists of entry items |
in_attrs | [optional] the typical attributes to add to the table |
bbop.html.table object
bbop.html.button = function( in_label, in_attrs )
Create a button object. For after-the-fact decoration, take a look at: https://jquery-ui.googlecode.com
in_label | label |
in_attrs | [optional] the typical attributes to add |
bbop.html.button object
Create the fundamental tag object to work with and extend.
bbop.html.tag = function( tag, attrs, below )
Convert a tag object into a html-ized string.
bbop.html.tag.prototype.to_string = function()
Add content between the tags.
bbop.html.tag.prototype.add_to = function( bbop_html_tag_or_string )
Remove all content between the tags.
bbop.html.tag.prototype.empty = function()
Return the id if extant, null otherwise.
bbop.html.tag.prototype.get_id = function()
Create the a frame for the functional part of a jQuery accordion structure.
bbop.html.accordion = function( in_list, attrs, add_id_p )
Convert the accordion object into a html-ized string.
bbop.html.accordion.prototype.to_string = function()
Add a contect section to the accordion.
bbop.html.accordion.prototype.add_to = function( section_info, content_blob, add_id_p )
Empty all sections from the accordion.
bbop.html.accordion.prototype.empty = function()
Return the id if extant, null otherwise.
bbop.html.accordion.prototype.get_id = function()
Get the “real” section id by way of the “convenience” section id?
bbop.html.accordion.prototype.get_section_id = function( sect_id )
Create the a frame for an unordered list object.
bbop.html.list = function( in_list, attrs )
Convert a list object into a html-ized string.
bbop.html.list.prototype.to_string = function()
Add a new li section to a list.
bbop.html.list.prototype.add_to = function()
Remove all content (li’s) from the list.
bbop.html.list.prototype.empty = function()
Return the id if extant, null otherwise.
bbop.html.list.prototype.get_id = function()
Create a form input.
bbop.html.input = function( attrs )
Convert an input into a html-ized string.
bbop.html.input.prototype.to_string = function()
Add content between the input tags.
bbop.html.input.prototype.add_to = function( item )
Reset/remove all children.
bbop.html.input.prototype.empty = function()
Return the id if extant, null otherwise.
bbop.html.input.prototype.get_id = function()
Create an anchor object.
bbop.html.anchor = function( in_cont, in_attrs )
Convert an anchor object into a html-ized string.
bbop.html.anchor.prototype.to_string = function()
Add content between the tags.
bbop.html.anchor.prototype.add_to = function( item )
Remove all content between the tags.
bbop.html.anchor.prototype.empty = function()
Return the id if extant, null otherwise.
bbop.html.anchor.prototype.get_id = function()
Create an image (img) object.
bbop.html.image = function( in_attrs )
Convert an image object into a html-ized string.
bbop.html.image.prototype.to_string = function()
Add content between the tags.
bbop.html.image.prototype.add_to = function( item )
Remove all content between the tags.
bbop.html.image.prototype.empty = function()
Return the id if extant, null otherwise.
bbop.html.image.prototype.get_id = function()
Create a simple table structure.
bbop.html.table = function( in_headers, in_entries, in_attrs )
Convert a table object into a html-ized string.
bbop.html.table.prototype.to_string = function()
Add data row.
bbop.html.table.prototype.add_to = function( entries )
Headers do not get wiped, just the data rows in the tbody.
bbop.html.table.prototype.empty = function()
Return the id if extant, null otherwise.
bbop.html.table.prototype.get_id = function()
Create a button object.
bbop.html.button = function( in_label, in_attrs )
Convert a button object into a html-ized string.
bbop.html.button.prototype.to_string = function()
Add content between the tags.
bbop.html.button.prototype.add_to = function( item )
Remove all content between the tags.
bbop.html.button.prototype.empty = function()
Return the id if extant, null otherwise.
bbop.html.button.prototype.get_id = function()
Create a span object.
bbop.html.span = function( in_label, in_attrs )
Convert a span object into a html-ized string.
bbop.html.span.prototype.to_string = function()
Add content between the tags.
bbop.html.span.prototype.add_to = function( item )
Remove all content between the tags.
bbop.html.span.prototype.empty = function()
Return the id if extant, null otherwise.
bbop.html.span.prototype.get_id = function()