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