ox.ui docstring cleanup

This commit is contained in:
j 2010-12-06 18:42:45 +01:00
parent 7718254bd4
commit 0ff26a5b53

View File

@ -116,19 +116,10 @@ requires
============================================================================ ============================================================================
*/ */
/* /**
---------------------------------------------------------------------------- Creates an App instance.
Ox.App
----------------------------------------------------------------------------
*/ */
Ox.App = function() { Ox.App = function() {
/*
options:
apiTimeout
apiType
apiURL
*/
return function(options) { return function(options) {
options = options || {}; options = options || {};
@ -284,12 +275,9 @@ requires
}(); }();
/* /**
---------------------------------------------------------------------------- Creates an Ox.Event
Ox.Event
----------------------------------------------------------------------------
*/ */
Ox.Event = function() { Ox.Event = function() {
var $eventHandler = $('<div>'), var $eventHandler = $('<div>'),
events = {}; events = {};
@ -405,10 +393,8 @@ requires
} }
}(); }();
/* /**
---------------------------------------------------------------------------- Ox.Focus
Ox.Focus
----------------------------------------------------------------------------
*/ */
Ox.Focus = function() { Ox.Focus = function() {
@ -445,16 +431,12 @@ requires
}; };
}(); }();
/* /**
---------------------------------------------------------------------------- Ox.History
Ox.History
----------------------------------------------------------------------------
*/ */
/* /**
---------------------------------------------------------------------------- Ox.Keyboard
Ox.Keyboard
----------------------------------------------------------------------------
*/ */
(function() { (function() {
@ -645,18 +627,13 @@ requires
})(); })();
/* /**
----------------------------------------------------------------------------
Ox.Mouse (??) Ox.Mouse (??)
----------------------------------------------------------------------------
*/ */
/* /**
----------------------------------------------------------------------------
Ox.Request Ox.Request
----------------------------------------------------------------------------
*/ */
Ox.Request = function() { Ox.Request = function() {
// fixme: do we want, instead of request('find', data, callback), // fixme: do we want, instead of request('find', data, callback),
@ -851,20 +828,15 @@ requires
}; };
}(); }();
/* /**
---------------------------------------------------------------------------- not implemented
Ox.Theme
----------------------------------------------------------------------------
*/ */
Ox.Theme = function() { Ox.Theme = function() {
}; };
/* /**
----------------------------------------------------------------------------
Ox.URL Ox.URL
----------------------------------------------------------------------------
*/ */
/* /*
@ -873,16 +845,14 @@ requires
============================================================================ ============================================================================
*/ */
/*
----------------------------------------------------------------------------
Ox.Container
----------------------------------------------------------------------------
*/
// fixme: wouldn't it be better to let the elements be, // fixme: wouldn't it be better to let the elements be,
// rather then $element, $content, and potentially others, // rather then $element, $content, and potentially others,
// 0, 1, 2, etc, so that append would append 0, and appendTo // 0, 1, 2, etc, so that append would append 0, and appendTo
// would append (length - 1)? // would append (length - 1)?
/**
*/
Ox.Container = function(options, self) { Ox.Container = function(options, self) {
var that = new Ox.Element('div', self) var that = new Ox.Element('div', self)
.options(options || {}) .options(options || {})
@ -894,14 +864,11 @@ requires
return that; return that;
}; };
/*
----------------------------------------------------------------------------
Ox.Element
----------------------------------------------------------------------------
*/
// check out http://ejohn.org/apps/learn/#36 (-#38, making fns work w/o new) // check out http://ejohn.org/apps/learn/#36 (-#38, making fns work w/o new)
/**
Ox.Element
*/
Ox.Element = function() { Ox.Element = function() {
return function(options, self) { return function(options, self) {
@ -1306,12 +1273,9 @@ requires
return that; return that;
}; };
/* /**
----------------------------------------------------------------------------
Ox.Window Ox.Window
----------------------------------------------------------------------------
*/ */
Ox.Window = function(options, self) { Ox.Window = function(options, self) {
self = self || {}, self = self || {},
@ -1366,16 +1330,17 @@ requires
}; };
/*
----------------------------------------------------------------------------
Ox.theme()
get theme
Ox.theme('foo')
set theme to 'foo'
----------------------------------------------------------------------------
*/
// fixme: this should be Ox.Theme, and provide Ox.Theme.set(), Ox.Theme.load, etc. // fixme: this should be Ox.Theme, and provide Ox.Theme.set(), Ox.Theme.load, etc.
/**
if name is given as argument, switch to this theme.
return current theme otherwise.
Ox.theme()
get theme
Ox.theme('foo')
set theme to 'foo'
*/
Ox.theme = function() { Ox.theme = function() {
var length = arguments.length, var length = arguments.length,
classes = $body.attr('class').split(' '), classes = $body.attr('class').split(' '),
@ -1414,12 +1379,8 @@ requires
return theme; return theme;
}; };
/* /**
============================================================================
Bars
============================================================================
*/ */
Ox.Bar = function(options, self) { Ox.Bar = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Element({}, self) that = new Ox.Element({}, self)
@ -1437,12 +1398,8 @@ requires
return that; return that;
}; };
/* /**
----------------------------------------------------------------------------
Ox.Resizebar
----------------------------------------------------------------------------
*/ */
Ox.Resizebar = function(options, self) { Ox.Resizebar = function(options, self) {
var self = self || {}, var self = self || {},
@ -1560,12 +1517,8 @@ requires
}; };
/* /**
----------------------------------------------------------------------------
Ox.Tabbar
----------------------------------------------------------------------------
*/ */
Ox.Tabbar = function(options, self) { Ox.Tabbar = function(options, self) {
var self = self || {}, var self = self || {},
@ -1592,7 +1545,9 @@ requires
}; };
// fixme: no need for this /**
fixme: no need for this
*/
Ox.Toolbar = function(options, self) { Ox.Toolbar = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Bar({ that = new Ox.Bar({
@ -1601,12 +1556,8 @@ requires
return that; return that;
}; };
/* /**
============================================================================
Ox.Dialog
============================================================================
*/ */
Ox.Dialog = function(options, self) { Ox.Dialog = function(options, self) {
// fixme: dialog should be derived from a generic draggable // fixme: dialog should be derived from a generic draggable
@ -1935,12 +1886,8 @@ requires
============================================================================ ============================================================================
*/ */
/* /**
----------------------------------------------------------------------------
Ox.Filter
----------------------------------------------------------------------------
*/ */
Ox.Filter = function(options, self) { Ox.Filter = function(options, self) {
var self = self || {} var self = self || {}
@ -1954,14 +1901,9 @@ requires
}; };
/* /**
----------------------------------------------------------------------------
Ox.Form
----------------------------------------------------------------------------
*/ */
Ox.Form = function(options, self) { Ox.Form = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Element('div', self) that = new Ox.Element('div', self)
.defaults({ .defaults({
@ -2037,6 +1979,11 @@ requires
}; };
that.values = function() { // fixme: can this be private? that.values = function() { // fixme: can this be private?
/*
get/set form values
call without arguments to get current form values
pass values as array to set values (not implemented)
*/
var values = {}; var values = {};
if (arguments.length == 0) { if (arguments.length == 0) {
$.each(self.$items, function(i, $item) { $.each(self.$items, function(i, $item) {
@ -2055,6 +2002,8 @@ requires
}; };
/**
*/
Ox.FormItem = function(options, self) { Ox.FormItem = function(options, self) {
var self = self || {}, var self = self || {},
@ -2068,6 +2017,7 @@ requires
.append(self.options.element); .append(self.options.element);
that.value = function() { that.value = function() {
//FIXME: Ox.Input does not have a public $input attribute
return self.options.element.$input.val(); return self.options.element.$input.val();
}; };
@ -2075,19 +2025,22 @@ requires
} }
/* /**
----------------------------------------------------------------------------
Form Elements Form Elements
----------------------------------------------------------------------------
*/ */
Ox.Button = function(options, self) { /**
/* methods:
toggleDisabled enable/disable button
toggleSelected select/unselect button
toggleTitle if more than one title was provided,
toggle to next title.
events: events:
click non-selectable button was clicked click non-selectable button was clicked
deselect selectable button was deselected deselect selectable button was deselected
select selectable button was selected select selectable button was selected
*/ */
Ox.Button = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Element('input', self) that = new Ox.Element('input', self)
.defaults({ .defaults({
@ -2230,20 +2183,18 @@ requires
}; };
Ox.ButtonGroup = function(options, self) { /**
options
/*
Ox.ButtonGroup
options:
buttons array of buttons buttons array of buttons
max integer, maximum number of selected buttons, 0 for all max integer, maximum number of selected buttons, 0 for all
min integer, minimum number of selected buttons, 0 for none min integer, minimum number of selected buttons, 0 for none
selectable if true, buttons are selectable selectable if true, buttons are selectable
type string, 'image' or 'text' type string, 'image' or 'text'
methods:
events: events:
change {id, value} selection within a group changed change {id, value} selection within a group changed
*/ */
Ox.ButtonGroup = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Element({}, self) that = new Ox.Element({}, self)
.defaults({ .defaults({
@ -2305,26 +2256,24 @@ requires
return that; return that;
}; };
Ox.Checkbox = function(options, self) { /**
options
/***
Ox.Checkbox
Checkbox Form Element
Options:
disabled boolean, if true, checkbox is disabled disabled boolean, if true, checkbox is disabled
id element id id element id
group boolean, if true, checkbox is part of a group group boolean, if true, checkbox is part of a group
checked boolean, if true, checkbox is checked checked boolean, if true, checkbox is checked
title string, text on label title string, text on label
width integer, width in px width integer, width in px
Methods: methods:
toggleChecked function() toggleChecked function()
toggles checked property toggles checked property
returns that returns that
Events: events:
change triggered when checked property changes change triggered when checked property changes
passes {checked, id, title} passes {checked, id, title}
***/ */
Ox.Checkbox = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Element('div', self) that = new Ox.Element('div', self)
@ -2404,6 +2353,16 @@ requires
}; };
/**
options
checkboxes [] array of checkboxes
max 1 integer
min 1 integer
width integer, width in px
events:
change triggered when checked property changes
passes {checked, id, title}
*/
Ox.CheckboxGroup = function(options, self) { Ox.CheckboxGroup = function(options, self) {
var self = self || {}, var self = self || {},
@ -2464,10 +2423,8 @@ requires
}; };
Ox.Input = function(options, self) { /**
options
/*
options:
arrows boolearn, if true, and type is 'float' or 'integer', display arrows arrows boolearn, if true, and type is 'float' or 'integer', display arrows
arrowStep number, step when clicking arrows arrowStep number, step when clicking arrows
autocomplete array of possible values, or autocomplete array of possible values, or
@ -2517,8 +2474,8 @@ requires
events: events:
change change
submit submit
*/ */
Ox.Input = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Element('div', self) that = new Ox.Element('div', self)
.defaults({ .defaults({
@ -3922,11 +3879,8 @@ requires
} }
Ox.Range = function(options, self) { /**
options
/***
Ox.Range
Options:
arrows boolean if true, show arrows arrows boolean if true, show arrows
arrowStep number step when clicking arrows arrowStep number step when clicking arrows
arrowSymbols array arrow symbols, like ['minus', 'plus'] arrowSymbols array arrow symbols, like ['minus', 'plus']
@ -3942,8 +3896,8 @@ requires
trackStep number 0 (scroll here) or step when clicking track trackStep number 0 (scroll here) or step when clicking track
value number initial value value number initial value
valueNames array value names to display on thumb valueNames array value names to display on thumb
***/ */
Ox.Range = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Element({}, self) that = new Ox.Element({}, self)
.defaults({ .defaults({
@ -4706,10 +4660,8 @@ requires
}; };
/* /**
----------------------------------------------------------------------------
delete below delete below
----------------------------------------------------------------------------
*/ */
Ox.Input_ = function(options, self) { Ox.Input_ = function(options, self) {
@ -7668,16 +7620,17 @@ requires
}; };
Ox.MapImage = function(options, self) {
/* /**
options: options
height image height (px) height image height (px)
places array of either names (''), points ([0, 0]), places array of either names (''), points ([0, 0]),
or objects ({name, point, highlight}) or objects ({name, point, highlight})
type map type ('hybrid', 'roadmap', 'satellite', 'terrain') type map type ('hybrid', 'roadmap', 'satellite', 'terrain')
width image width (px) width image width (px)
*/ */
Ox.MapImage = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Element('img', self) that = new Ox.Element('img', self)
@ -7741,14 +7694,9 @@ requires
============================================================================ ============================================================================
*/ */
/**
*/
Ox.MainMenu = function(options, self) { Ox.MainMenu = function(options, self) {
/* options:
* extras
* menus
* size
*/
var self = self || {}, var self = self || {},
that = new Ox.Bar({}, self) that = new Ox.Bar({}, self)
.defaults({ .defaults({
@ -7929,11 +7877,8 @@ requires
}; };
Ox.Menu = function(options, self) { /**
options
/*
options:
element the element the menu is attached to element the element the menu is attached to
id the menu id id the menu id
items array of menu items items array of menu items
@ -7944,8 +7889,6 @@ requires
side open to 'bottom' or 'right' side open to 'bottom' or 'right'
size 'large', 'medium' or 'small' size 'large', 'medium' or 'small'
methods:
events: events:
change_groupId {id, value} checked item of a group has changed change_groupId {id, value} checked item of a group has changed
click_itemId item not belonging to a group was clicked click_itemId item not belonging to a group was clicked
@ -7953,9 +7896,8 @@ requires
deselect_menuId {id, value} item was deselected not needed, not implemented deselect_menuId {id, value} item was deselected not needed, not implemented
hide_menuId menu was hidden hide_menuId menu was hidden
select_menuId {id, value} item was selected select_menuId {id, value} item was selected
*/
*/ Ox.Menu = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Element({}, self) that = new Ox.Element({}, self)
.defaults({ .defaults({
@ -8744,12 +8686,8 @@ requires
============================================================================ ============================================================================
*/ */
/* /**
----------------------------------------------------------------------------
Ox.CollapsePanel
----------------------------------------------------------------------------
*/ */
Ox.CollapsePanel = function(options, self) { Ox.CollapsePanel = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Panel({}, self) that = new Ox.Panel({}, self)
@ -8814,12 +8752,8 @@ requires
return that; return that;
}; };
/* /**
----------------------------------------------------------------------------
Ox.Panel
----------------------------------------------------------------------------
*/ */
Ox.Panel = function(options, self) { Ox.Panel = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Element({}, self) that = new Ox.Element({}, self)
@ -8827,34 +8761,25 @@ requires
return that; return that;
}; };
/* /**
---------------------------------------------------------------------------- options:
Ox.SplitPanel elements: [{ array of one, two or three elements
options: collapsible: false, collapsible or not (only for outer elements)
elements: [{ array of one, two or three elements collapsed: false, collapsed or not (only for collapsible elements)
collapsible: false, collapsible or not (only for outer elements) element: {}, OxElement (if any element is resizable or
collapsed: false, collapsed or not (only for collapsible elements) collapsible, all OxElements must have an id)
element: {}, OxElement (if any element is resizable or resizable: false, resizable or not (only for outer elements)
collapsible, all OxElements must have an id) resize: [], array of sizes (only for resizable elements,
resizable: false, resizable or not (only for outer elements) first value is min, last value is max,
resize: [], array of sizes (only for resizable elements, other values are 'snappy' points in between)
first value is min, last value is max, size: 0 size in px (one element must have no size)
other values are 'snappy' points in between) }],
size: 0 size in px (one element must have no size) orientation: '' 'horizontal' or 'vertical'
}], events:
orientation: '' 'horizontal' or 'vertical' resize
methods: toggle
isCollapsed(id) element is collapsed or not
resize(id, size) resize element to size px
toggle(id) collapse or expand element
events:
resize
toggle
----------------------------------------------------------------------------
*/ */
Ox.SplitPanel = function(options, self) { Ox.SplitPanel = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Element({}, self) // fixme: Container that = new Ox.Element({}, self) // fixme: Container
.defaults({ .defaults({
@ -9038,12 +8963,8 @@ requires
============================================================================ ============================================================================
*/ */
/* /**
----------------------------------------------------------------------------
Ox.LoadingIcon
----------------------------------------------------------------------------
*/ */
Ox.LoadingIcon = function(options, self) { Ox.LoadingIcon = function(options, self) {
var self = self || {}, var self = self || {},
that = new Ox.Element('img', self) that = new Ox.Element('img', self)
@ -9096,10 +9017,8 @@ requires
return that; return that;
} }
/* /**
----------------------------------------------------------------------------
Ox.Progressbar Ox.Progressbar
----------------------------------------------------------------------------
*/ */
@ -9109,6 +9028,8 @@ requires
============================================================================ ============================================================================
*/ */
/**
*/
Ox.LargeTimeline = function(options, self) { Ox.LargeTimeline = function(options, self) {
var self = self || {}, var self = self || {},
@ -9312,6 +9233,8 @@ requires
}; };
/**
*/
Ox.SmallTimeline = function(options, self) { Ox.SmallTimeline = function(options, self) {
var self = self || {}, var self = self || {},
@ -9609,6 +9532,8 @@ requires
}; };
/**
*/
Ox.VideoEditor = function(options, self) { Ox.VideoEditor = function(options, self) {
var self = self || {}, var self = self || {},
@ -10037,6 +9962,8 @@ requires
}; };
/**
*/
Ox.VideoPlayer = function(options, self) { Ox.VideoPlayer = function(options, self) {
var self = self || {}, var self = self || {},
@ -10444,12 +10371,8 @@ requires
============================================================================ ============================================================================
*/ */
/* /**
----------------------------------------------------------------------------
Ox.Tooltip
----------------------------------------------------------------------------
*/ */
Ox.Tooltip = function(options, self) { Ox.Tooltip = function(options, self) {
var self = self || {}, var self = self || {},