diff --git a/demos/doc2/js/doc.js b/demos/doc2/js/doc.js index 84c584e7..47c1d058 100644 --- a/demos/doc2/js/doc.js +++ b/demos/doc2/js/doc.js @@ -4,7 +4,7 @@ Ox.load('UI', { }, function() { Ox.Theme('classic'); $.getJSON(Ox.UI.PATH + 'json/Ox.UI.json', function(files) { - Ox.DocPanel({ + doc = Ox.DocPanel({ files: Ox.merge([ 'Ox.js', 'Ox.Geo/Ox.Geo.js', @@ -20,7 +20,18 @@ Ox.load('UI', { return item.section || file.split('/')[2]; }, path: Ox.PATH - }) - .appendTo(Ox.UI.$body); + }).bindEvent({ + load: function() { + doc.selectItem(document.location.hash.substring(1)); + }, + select: function(data) { + if(data.ids) + document.location.hash = data.ids[0]; + } + }); + doc.appendTo(Ox.UI.$body); + window.onhashchange = function() { + doc.selectItem(document.location.hash.substring(1)) + }; }); }); diff --git a/source/Ox.UI/js/Bar/Ox.Bar.js b/source/Ox.UI/js/Bar/Ox.Bar.js index 3f6a00af..c6c32df4 100644 --- a/source/Ox.UI/js/Bar/Ox.Bar.js +++ b/source/Ox.UI/js/Bar/Ox.Bar.js @@ -1,6 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -/** -*/ +/*@ +Ox.Bar Bar + () -> Bar object + (options) -> Bar object + (options, self) -> Bar object + options Options object + orientation + size can be small, medium, large or number + self Shared private variable +@*/ Ox.Bar = function(options, self) { var self = self || {}, that = new Ox.Element({}, self) diff --git a/source/Ox.UI/js/Bar/Ox.Resizebar.js b/source/Ox.UI/js/Bar/Ox.Resizebar.js index 08ffc3bf..0ab7e843 100644 --- a/source/Ox.UI/js/Bar/Ox.Resizebar.js +++ b/source/Ox.UI/js/Bar/Ox.Resizebar.js @@ -1,4 +1,21 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.Resizebar Resizebar + () -> Resizebar object + (options) -> Resizebar object + (options, self) -> Resizebar object + options Options object + collapsed inital collapse state + collapsible collapse state can be changed + edge edge + elements elements of the bar + orientation orientation, can be horizontal or vertical + panel panel object + resizeable can bar be resized + resize array with possible sizes + size default size + self Shared private variable +@*/ /** */ Ox.Resizebar = function(options, self) { diff --git a/source/Ox.UI/js/Bar/Ox.Tabbar.js b/source/Ox.UI/js/Bar/Ox.Tabbar.js index a801a05d..53b225cd 100644 --- a/source/Ox.UI/js/Bar/Ox.Tabbar.js +++ b/source/Ox.UI/js/Bar/Ox.Tabbar.js @@ -1,4 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.Tabbar Tabbar + () -> Tabbar object + (options) -> Tabbar object + (options, self) -> Tabbar object + options Options object + selected selected item + tabs tabs + self Shared private variable +@*/ /** */ Ox.Tabbar = function(options, self) { diff --git a/source/Ox.UI/js/Calendar/Ox.Calendar.js b/source/Ox.UI/js/Calendar/Ox.Calendar.js index b3305904..98c8bf98 100644 --- a/source/Ox.UI/js/Calendar/Ox.Calendar.js +++ b/source/Ox.UI/js/Calendar/Ox.Calendar.js @@ -1,7 +1,7 @@ // vim: et:ts=4:sw=4:sts=4:ft=js /*@ -Ox.Calendar Basic calendar object +Ox.Calendar Basic calendar object () -> Calendar object (options) -> Calendar object (options, self) -> Calendar object diff --git a/source/Ox.UI/js/Calendar/Ox.CalendarDate.js b/source/Ox.UI/js/Calendar/Ox.CalendarDate.js index 21bcdfd0..a1fe99ef 100644 --- a/source/Ox.UI/js/Calendar/Ox.CalendarDate.js +++ b/source/Ox.UI/js/Calendar/Ox.CalendarDate.js @@ -1,4 +1,12 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.CalendarDate CalendarDate + () -> CalendarData object + (options) -> CalendarData object + options Options object + start start date + stop stop date +@*/ Ox.CalendarDate = function(options) { var self = {}, diff --git a/source/Ox.UI/js/Core/Ox.App.js b/source/Ox.UI/js/Core/Ox.App.js index 5eb25e0a..309779c5 100644 --- a/source/Ox.UI/js/Core/Ox.App.js +++ b/source/Ox.UI/js/Core/Ox.App.js @@ -1,32 +1,21 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -/* -============================================================================ -Application -============================================================================ -*/ -// fixme: get rid of launch, fire load event +/*@ +Ox.App Basic application instance that communicates with a JSON API + () -> App object + (options) -> App object + (options, self) -> App object + options Options object + timeout request timeout + type HTTP Request type, i.e. 'GET' or 'POST' + url JSON API url + self Shared private variable + load app loaded + +@*/ Ox.App = (function() { - /*** - Ox.App - Basic application instance that communicates with a JSON API. - The JSON API must support at least the following actions: - api returns all api methods - init returns data (site, user, ...) - Options - timeout API timeout in msec - type 'GET' or 'POST' - url URL of the API - Methods - api[action] make a request - api.cancel cancel a request - options get or set options - Events - load app loaded - ***/ - return function(options) { options = options || {}; @@ -61,6 +50,12 @@ Ox.App = (function() { url: self.options.url }); + /*@ + api bakcend API + [action] all api requests available on backend + cancel cancel a request + options get or set options + @*/ that.api.api(function(result) { Ox.forEach(result.data.actions, function(val, key) { that.api[key] = function(data, callback) { @@ -114,10 +109,19 @@ Ox.App = (function() { }; } + /*@ + change change key/value + (key, value) -> currently not implemented + @*/ self.change = function(key, value) { }; + /*@ + options get/set options, see Ox.getset + () -> get options + (options) -> update/set options + @*/ that.options = function() { return Ox.getset(self.options, Array.prototype.slice.call(arguments), self.change, that); }; diff --git a/source/Ox.UI/js/Core/Ox.Clipboard.js b/source/Ox.UI/js/Core/Ox.Clipboard.js index 5f41aff5..0844db21 100644 --- a/source/Ox.UI/js/Core/Ox.Clipboard.js +++ b/source/Ox.UI/js/Core/Ox.Clipboard.js @@ -1,12 +1,15 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.Clipboard Basic clipboard handler + copy copy to clipbloard + (data) -> set clipboard to data + paste paste from clipbload + () -> get clipboard data + _print debug function + () -> print clipboard contents to console + data clipboard object +@*/ Ox.Clipboard = function() { - /*** - Ox.Clipboard - Basic clipboard handler - Methods - copy(data) copy data to clipboard - paste paste data from clipboard - ***/ var clipboard = {}; return { _print: function() { diff --git a/source/Ox.UI/js/Core/Ox.Container.js b/source/Ox.UI/js/Core/Ox.Container.js index 93d9e334..5949f6dd 100644 --- a/source/Ox.UI/js/Core/Ox.Container.js +++ b/source/Ox.UI/js/Core/Ox.Container.js @@ -4,6 +4,14 @@ // 0, 1, 2, etc, so that append would append 0, and appendTo // would append (length - 1)? +/*@ +Ox.Container Container (depricated) + () -> Container object + (options) -> Container object + (options, self) -> Container object + options Options object + self Shared private variable +@*/ Ox.Container = function(options, self) { // fixme: to be deprecated var that = new Ox.Element({}, self) diff --git a/source/Ox.UI/js/Core/Ox.DocPage.js b/source/Ox.UI/js/Core/Ox.DocPage.js index 2b5711f4..969ece78 100644 --- a/source/Ox.UI/js/Core/Ox.DocPage.js +++ b/source/Ox.UI/js/Core/Ox.DocPage.js @@ -1,3 +1,12 @@ +/*@ +Ox.DocPage DocPage + () -> DocPage object + (options) -> DocPage object + (options, self) -> DocPage object + options Options object + item doc item + self Shared private variable +@*/ Ox.DocPage = function(options, self) { self = self || {}; @@ -162,4 +171,4 @@ Ox.DocPage = function(options, self) { return that; -}; \ No newline at end of file +}; diff --git a/source/Ox.UI/js/Core/Ox.DocPanel.js b/source/Ox.UI/js/Core/Ox.DocPanel.js index 49d209ef..8e52a485 100644 --- a/source/Ox.UI/js/Core/Ox.DocPanel.js +++ b/source/Ox.UI/js/Core/Ox.DocPanel.js @@ -1,5 +1,19 @@ /*@ Ox.DocPanel Documentation Panel + () -> Documentation Panel + (options) -> Documentation Panel + (options, self) -> Documentation Panel + options Options object + collapsible can be collabsed + files files to parse for docs + getModule returns module for given item + getSection returns section for given item + path path prefix + resizable is resizable + resize resize positions + size default size + self shared private variable + load fired once all docs are loaded @*/ Ox.DocPanel = function(options, self) { @@ -43,6 +57,7 @@ Ox.DocPanel = function(options, self) { loadList(function(docItems) { self.items = docItems; + that.triggerEvent('load', {}); }); function loadList(callback) { @@ -58,6 +73,7 @@ Ox.DocPanel = function(options, self) { } }); }); + function makeTree(docItems) { var treeItems = []; docItems.forEach(function(docItem) { @@ -145,6 +161,7 @@ Ox.DocPanel = function(options, self) { }); } } + that.triggerEvent('select', data); } function sortByTitle(a, b) { @@ -156,7 +173,14 @@ Ox.DocPanel = function(options, self) { } return ret; } - + /*@ + selectItem select item + (id) -> select an item + id if of item to select + @*/ + that.selectItem = function(id) { + self.$list.triggerEvent('select', {'ids': [id]}); + } return that; -}; \ No newline at end of file +}; diff --git a/source/Ox.UI/js/Core/Ox.Focus.js b/source/Ox.UI/js/Core/Ox.Focus.js index 5103387e..abe37a3f 100644 --- a/source/Ox.UI/js/Core/Ox.Focus.js +++ b/source/Ox.UI/js/Core/Ox.Focus.js @@ -1,13 +1,9 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.Focus Basic focus handler +@*/ + Ox.Focus = function() { - /*** - Ox.Focus - Basic focus handler - Methods - blur(id) blur element - focus(id) focus element - focused() return id of focused element, or null - ***/ var stack = []; return { _print: function() { @@ -17,6 +13,10 @@ Ox.Focus = function() { $('.OxFocus').removeClass('OxFocus'); stack = []; }, + /*@ + blur blur element + (id) -> blur element by id + @*/ blur: function(id) { var index = stack.indexOf(id); if (index > -1 && index == stack.length - 1) { @@ -28,6 +28,10 @@ Ox.Focus = function() { Ox.print('blur', id, stack); } }, + /*@ + focus focus element + (id) -> focus element by id + @*/ focus: function(id) { var index = stack.indexOf(id); if (index == -1 || index < stack.length - 1) { @@ -38,6 +42,10 @@ Ox.Focus = function() { Ox.print('focus', id, stack); } }, + /*@ + focused return id of focused element, or null + () -> get id of currently focused element + @*/ focused: function() { return stack.length ? stack[stack.length - 1] : null; } diff --git a/source/Ox.UI/js/Core/Ox.LoadingIcon.js b/source/Ox.UI/js/Core/Ox.LoadingIcon.js index dedcfa0e..9662624c 100644 --- a/source/Ox.UI/js/Core/Ox.LoadingIcon.js +++ b/source/Ox.UI/js/Core/Ox.LoadingIcon.js @@ -1,4 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.LoadingIcon Loading Icon Element + () -> Loading Icon Element + (options) -> Loading Icon Element + (options, self) -> Loading Icon Element + options Options object + size size of icon + self Shared private variable +@*/ + Ox.LoadingIcon = function(options, self) { var self = self || {}, that = new Ox.Element('', self) @@ -12,12 +22,21 @@ Ox.LoadingIcon = function(options, self) { .addClass( 'OxLoadingIcon Ox' + Ox.toTitleCase(self.options.size) ); + /*@ + start Start loading animation + () -> Loading Icon Element + @*/ that.start = function() { that.animate({ opacity: 1 }, 250); return that; }; + + /*@ + stop Stop loading animation + () -> Loading Icon Element + @*/ that.stop = function() { that.animate({ opacity: 0 diff --git a/source/Ox.UI/js/Core/Ox.Request.js b/source/Ox.UI/js/Core/Ox.Request.js index aeeed4c2..6c971702 100644 --- a/source/Ox.UI/js/Core/Ox.Request.js +++ b/source/Ox.UI/js/Core/Ox.Request.js @@ -1,18 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -Ox.Request = function(options) { +/*@ +Ox.Request Basic request handler object +FIXME: options is not a property, just documenting defaults +options Options object + timeout request timeout + type request type, possible values POST, GET, PUT, DELETE + url request url +@*/ - /*** - Ox.Request - Basic request handler - Options - timeout - Methods - cancel() cancel request - clearCache() clear cache - options() get or set options - requests() return number of active requests - send() send request - ***/ +Ox.Request = function(options) { var cache = {}, //dfd = $.Deferred(), @@ -27,7 +23,12 @@ Ox.Request = function(options) { }; return { - + /*@ + cancel cancel pending requests + () -> cancel all requests + (f) -> cancel all requests where function returns true + (n) -> cancel request by id + @*/ cancel: function() { if (arguments.length == 0) { // cancel all requests @@ -44,19 +45,42 @@ Ox.Request = function(options) { delete requests[arguments[0]]; } }, - + /*@ + clearCache clear cached results + () -> + @*/ clearCache: function() { cache = {}; }, + /*@ + options get/set options + () -> get options + (options) -> set options + options Options Object + @*/ options: function(options) { return Ox.getset(self.options, options, $.noop(), this); }, + /*@ + requests pending requests + () -> returns number of requests + @*/ requests: function() { return Ox.len(requests); }, + /*@ + send send request + (options) -> returns request id + options Options Object + age cache age + id request id + timeout overwrite default timeout + type overwrite default type + url overwrite default url + @*/ send: function(options) { var options = $.extend({ diff --git a/source/Ox.UI/js/Core/Ox.Theme.js b/source/Ox.UI/js/Core/Ox.Theme.js index 31b228f4..488aa708 100644 --- a/source/Ox.UI/js/Core/Ox.Theme.js +++ b/source/Ox.UI/js/Core/Ox.Theme.js @@ -1,14 +1,15 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -// 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 get/set theme + () -> Get current theme + (theme) -> Set current theme + theme name of theme + > Ox.Theme() + 'classic' + > Ox.Theme('modern') + 'modern' +@*/ Ox.Theme = function(theme) { diff --git a/source/Ox.UI/js/Form/Ox.Button.js b/source/Ox.UI/js/Form/Ox.Button.js index 40d69216..cacfaca8 100644 --- a/source/Ox.UI/js/Form/Ox.Button.js +++ b/source/Ox.UI/js/Form/Ox.Button.js @@ -1,18 +1,29 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.Button Button Object + () -> Button Object + (options) -> Button Object + (options, self) -> Button Object + options Options object + disabled disabled + group is part of group + id: button id + overlap overlap + selectable is selecatable + selected is selected + size button size + style // can be default, checkbox, symbol, or tab + title title, can be array of titles + tooltip tooltip if multiple must be same number as titles + type button type, text or image, (for image, title must be symbolTitle.svg must be availabe) + width button width + self Shared private variable + click non-selectable button was clicked + deselect selectable button was deselected + select selectable button was selected +@*/ + 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 - */ - var self = self || {}, that = new Ox.Element('', self) .defaults({ @@ -137,6 +148,10 @@ Ox.Button = function(options, self) { } } + /*@ + toggleDisabled + () -> toggle disabled state + @*/ that.toggleDisabled = function() { that.options({ enabled: !self.options.disabled @@ -144,6 +159,10 @@ Ox.Button = function(options, self) { //self.options.disabled = !self.options.disabled; } + /*@ + toggleSelected + () -> toggle selected state + @*/ that.toggleSelected = function() { that.options({ selected: !self.options.selected @@ -151,6 +170,10 @@ Ox.Button = function(options, self) { //self.options.selected = !self.options.selected; } + /*@ + toggleTitle + () -> toggle through titles + @*/ that.toggleTitle = function() { self.selectedTitle = 1 - self.selectedTitle; setTitle(self.titles[self.selectedTitle].title); diff --git a/source/Ox.UI/js/Form/Ox.ButtonGroup.js b/source/Ox.UI/js/Form/Ox.ButtonGroup.js index bea7c3f3..fa4eeaba 100644 --- a/source/Ox.UI/js/Form/Ox.ButtonGroup.js +++ b/source/Ox.UI/js/Form/Ox.ButtonGroup.js @@ -1,17 +1,20 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -Ox.ButtonGroup = function(options, self) { +/*@ +Ox.ButtonGroup ButtonGroup Object + () -> ButtonGroup Object + (options) -> ButtonGroup Object + (options, self) -> ButtonGroup Object + options Options object + 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' + self Shared private variable + change {id, value} selection within a group changed +@*/ - /** - 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) diff --git a/source/Ox.UI/js/Form/Ox.Checkbox.js b/source/Ox.UI/js/Form/Ox.Checkbox.js index 32a1120a..380f6c6c 100644 --- a/source/Ox.UI/js/Form/Ox.Checkbox.js +++ b/source/Ox.UI/js/Form/Ox.Checkbox.js @@ -1,22 +1,21 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -Ox.Checkbox = function(options, self) { +/*@ +Ox.Checkbox Checkbox Element + () -> Checkbox Element + (options) -> Checkbox Element + (options, self) -> Checkbox Element + options Options object + disabled if true, checkbox is disabled + id element id + group if true, checkbox is part of a group + checked if true, checkbox is checked + title text on label + width width in px + self Shared private variable + change triggered when checked property changes, passes {checked, id, title} +@*/ - /** - 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: - toggleChecked function() - toggles checked property - returns that - events: - change triggered when checked property changes - passes {checked, id, title} - */ +Ox.Checkbox = function(options, self) { var self = self || {}, that = new Ox.Element({}, self) @@ -91,10 +90,18 @@ Ox.Checkbox = function(options, self) { } }; + /*@ + checked get current checked state + () -> returns self.options.checked + @*/ that.checked = function() { return self.options.checked; } + /*@ + toggleChecked toggle current checked state + () -> toggle state, returns Checkbox Element + @*/ that.toggleChecked = function() { self.$button.toggleTitle(); return that; diff --git a/source/Ox.UI/js/Form/Ox.CheckboxGroup.js b/source/Ox.UI/js/Form/Ox.CheckboxGroup.js index 7d254c8e..39e8cbde 100644 --- a/source/Ox.UI/js/Form/Ox.CheckboxGroup.js +++ b/source/Ox.UI/js/Form/Ox.CheckboxGroup.js @@ -1,16 +1,21 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -Ox.CheckboxGroup = function(options, self) { +/*@ +Ox.CheckboxGroup CheckboxGroup Object + () -> CheckboxGroup Object + (options) -> CheckboxGroup Object + (options, self) -> CheckboxGroup Object + options Options object + checkboxes array of checkboxes + max integer + min integer + width integer, width in px + self shared private variable + + change triggered when checked property changes + passes {checked, id, title} +@*/ - /** - 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 || {}, that = new Ox.Element({}, self) diff --git a/source/Ox.UI/js/Form/Ox.ColorInput.js b/source/Ox.UI/js/Form/Ox.ColorInput.js index 5fca378d..88771ea3 100644 --- a/source/Ox.UI/js/Form/Ox.ColorInput.js +++ b/source/Ox.UI/js/Form/Ox.ColorInput.js @@ -1,4 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.ColorInput ColorInput Element + () -> ColorInput Element + (options) -> ColorInput Element + (options, self) -> ColorInput Element + options Options object + id element id + value rgb value + self Shared private variable +@*/ Ox.ColorInput = function(options, self) { var self = $.extend(self || {}, { diff --git a/source/Ox.UI/js/Form/Ox.ColorPicker.js b/source/Ox.UI/js/Form/Ox.ColorPicker.js index 212bdeba..57db0d17 100644 --- a/source/Ox.UI/js/Form/Ox.ColorPicker.js +++ b/source/Ox.UI/js/Form/Ox.ColorPicker.js @@ -1,4 +1,17 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.ColorPicker ColorPicker Element + () -> ColorPicker Element + (options) -> ColorPicker Element + (options, self) -> ColorPicker Element + options Options object + id element id + value rgb value + self Shared private variable + change triggered on change of value +@*/ + Ox.ColorPicker = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/Form/Ox.DateInput.js b/source/Ox.UI/js/Form/Ox.DateInput.js index cc8c23cf..082dd08b 100644 --- a/source/Ox.UI/js/Form/Ox.DateInput.js +++ b/source/Ox.UI/js/Form/Ox.DateInput.js @@ -1,18 +1,19 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -Ox.DateInput = function(options, self) { - /** - options: - format: 'short' - value: date value - weekday: false - width: { - day: 32, - month: options.format == 'long' ? 80 : (options.format == 'medium' ? 40 : 32), - weekday: options.format == 'long' ? 80 : 40, - year: 48 - } - */ +/*@ +Ox.DateInput DateInput Element + () -> DateInput Element + (options) -> DateInput Element + (options, self) -> DateInput Element + options Options object + format format can be short, medium, long + value date value, defaults to now + weekday weekday + width: width object with day, month, weekday, year width + self Shared private variable + change triggered on change of value +@*/ +Ox.DateInput = function(options, self) { var self = $.extend(self || {}, { options: $.extend({ diff --git a/source/Ox.UI/js/Form/Ox.DateTimeInput.js b/source/Ox.UI/js/Form/Ox.DateTimeInput.js index a59ceecd..27349466 100644 --- a/source/Ox.UI/js/Form/Ox.DateTimeInput.js +++ b/source/Ox.UI/js/Form/Ox.DateTimeInput.js @@ -1,4 +1,20 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.DateTimeInput DateTimeInput Element + () -> DateTimeInput Element + (options) -> DateTimeInput Element + (options, self) -> DateTimeInput Element + options Options object + ampm false is 24h true is am/pm + format options are short, medium, long + seconds show seconds + value defautls to now + weekday weekday + self Shared private variable + change triggered on change of value +@*/ + Ox.DateTimeInput = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/Form/Ox.Filter.js b/source/Ox.UI/js/Form/Ox.Filter.js index b84a40ac..dd329b2b 100644 --- a/source/Ox.UI/js/Form/Ox.Filter.js +++ b/source/Ox.UI/js/Form/Ox.Filter.js @@ -1,11 +1,19 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -Ox.Filter = function(options, self) { - /*** - Options: - Methods: - Events: - ***/ +/*@ +Ox.Filter Filter Element + () -> Filter Element + (options) -> Filter Element + (options, self) -> Filter Element + options Options object + findKeys keys + query query object with conditions, operator + sortKeys keys to sort by + viewKeys visible keys + self Shared private variable +@*/ + +Ox.Filter = function(options, self) { var self = self || {}, that = new Ox.Element({}, self) diff --git a/source/Ox.UI/js/Form/Ox.Form.js b/source/Ox.UI/js/Form/Ox.Form.js index 21fec15d..a4deb3c6 100644 --- a/source/Ox.UI/js/Form/Ox.Form.js +++ b/source/Ox.UI/js/Form/Ox.Form.js @@ -1,8 +1,19 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -Ox.Form = function(options, self) { - /** - */ +/*@ +Ox.Form Form Object + () -> Form Object + (options) -> Form Object + (options, self) -> Form Object + options Options object + error error + id id + items [] + submit on submit function + self shared private variable +@*/ + +Ox.Form = function(options, self) { var self = self || {}, that = new Ox.Element({}, self) diff --git a/source/Ox.UI/js/Form/Ox.FormElementGroup.js b/source/Ox.UI/js/Form/Ox.FormElementGroup.js index 82bc0e44..abe2418f 100644 --- a/source/Ox.UI/js/Form/Ox.FormElementGroup.js +++ b/source/Ox.UI/js/Form/Ox.FormElementGroup.js @@ -1,4 +1,19 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.FormElementGroup FormElementGroup Element + () -> FormElementGroup Element + (options) -> FormElementGroup Element + (options, self) -> FormElementGroup Element + options Options object + id element id + elements elements in group + float alignment + separators separators (not implemented) + width group width + self Shared private variable +@*/ + Ox.FormElementGroup = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/Form/Ox.FormItem.js b/source/Ox.UI/js/Form/Ox.FormItem.js index 3c7a9476..80618d28 100644 --- a/source/Ox.UI/js/Form/Ox.FormItem.js +++ b/source/Ox.UI/js/Form/Ox.FormItem.js @@ -1,4 +1,16 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.FormItem FormItem Element, wrap form element with an error message + () -> FormItem Element + (options) -> FormItem Element + (options, self) -> FormItem Element + options Options object + element element + error error message + self Shared private variable +@*/ + Ox.FormItem = function(options, self) { var self = self || {}, @@ -15,10 +27,18 @@ Ox.FormItem = function(options, self) { .addClass('OxFormMessage') .appendTo(that); + /*@ + setMessage set message + (message) -> set message + @*/ that.setMessage = function(message) { self.$message.html(message)[message !== '' ? 'show' : 'hide'](); } + /*@ + value get value + () -> get value of wrapped element + @*/ that.value = function() { return self.options.element.value(); }; diff --git a/source/Ox.UI/js/Form/Ox.Input.js b/source/Ox.UI/js/Form/Ox.Input.js index f95e2f64..696df97e 100644 --- a/source/Ox.UI/js/Form/Ox.Input.js +++ b/source/Ox.UI/js/Form/Ox.Input.js @@ -1,59 +1,62 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -Ox.Input = function(options, self) { +/*@ +Ox.Input Input Element + () -> Input Element + (options) -> Input Element + (options, self) -> Input Element + options Options object + arrows if true, and type is 'float' or 'integer', display arrows + arrowStep step when clicking arrows + autocomplete array of possible values, or + function(key, value, callback), returns one or more values + autocompleteReplace if true, value is replaced + autocompleteReplaceCorrect if true, only valid values can be entered + autocompleteSelect if true, menu is displayed + autocompleteSelectHighlight if true, value in menu is highlighted + autocompleteSelectSubmit if true, submit input on menu selection + autocorrect ('email', 'float', 'integer', 'phone', 'url'), or + regexp(value), or + function(key, value, blur, callback), returns value + autovalidate --remote validation-- + clear if true, has clear button + disabled if true, is disabled + height px (for type='textarea' and type='range' with orientation='horizontal') + id element id + key to be passed to autocomplete and autovalidate functions + max max value if type is 'integer' or 'float' + min min value if type is 'integer' or 'float' + name will be displayed by autovalidate function ('invalid ' + name) + overlap '', 'left' or 'right', will cause padding and negative margin + picker picker object + rangeOptions range options + arrows boolean, if true, display arrows + //arrowStep number, step when clicking arrows + //arrowSymbols array of two strings + max number, maximum value + min number, minimum value + orientation 'horizontal' or 'vertical' + step number, step + thumbValue boolean, if true, value is displayed on thumb, or + array of strings per value, or + function(value), returns string + thumbSize integer, px + trackGradient string, css gradient for track + trackImage string, image url, or + array of image urls + //trackStep number, 0 for 'scroll here', positive for step + trackValues boolean + serialize function used to serialize value in submit + textAlign 'left', 'center' or 'right' + type 'float', 'integer', 'password', 'text', 'textarea' + value string + validate remote validation + width px - /** - 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 - function(key, value, callback), returns one or more values - autocompleteReplace boolean, if true, value is replaced - autocompleteReplaceCorrect boolean, if true, only valid values can be entered - autocompleteSelect boolean, if true, menu is displayed - autocompleteSelectHighlight boolean, if true, value in menu is highlighted - autocompleteSelectSubmit boolean, if true, submit input on menu selection - autocorrect string ('email', 'float', 'integer', 'phone', 'url'), or - regexp(value), or - function(key, value, blur, callback), returns value - autovalidate --remote validation-- - clear boolean, if true, has clear button - disabled boolean, if true, is disabled - height integer, px (for type='textarea' and type='range' with orientation='horizontal') - id string, element id - key string, to be passed to autocomplete and autovalidate functions - max number, max value if type is 'integer' or 'float' - min number, min value if type is 'integer' or 'float' - name string, will be displayed by autovalidate function ('invalid ' + name) - overlap string, '', 'left' or 'right', will cause padding and negative margin - picker - //rangeOptions - arrows boolean, if true, display arrows - //arrowStep number, step when clicking arrows - //arrowSymbols array of two strings - max number, maximum value - min number, minimum value - orientation 'horizontal' or 'vertical' - step number, step - thumbValue boolean, if true, value is displayed on thumb, or - array of strings per value, or - function(value), returns string - thumbSize integer, px - trackGradient string, css gradient for track - trackImage string, image url, or - array of image urls - //trackStep number, 0 for 'scroll here', positive for step - trackValues boolean - serialize - textAlign 'left', 'center' or 'right' - type 'float', 'integer', 'password', 'text', 'textarea' - value string - validate function, remote validation - width integer, px - methods: - events: - change - submit - */ + change input changed event + submit input submit event +@*/ + +Ox.Input = function(options, self) { var self = self || {}, that = new Ox.Element({}, self) diff --git a/source/Ox.UI/js/Form/Ox.InputGroup.js b/source/Ox.UI/js/Form/Ox.InputGroup.js index 37747437..1ee80d67 100644 --- a/source/Ox.UI/js/Form/Ox.InputGroup.js +++ b/source/Ox.UI/js/Form/Ox.InputGroup.js @@ -1,13 +1,19 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.InputGroup InputGroup Object + () -> InputGroup Object + (options) -> InputGroup Object + (options, self) -> InputGroup Object + options Options object + id id + inputs inputs + separators seperators + width width + self shared private variable +@*/ + Ox.InputGroup = function(options, self) { - - /*** - Ox.InputGroup - Options: - Methods: - Events: - ***/ - var self = self || {}, that = new Ox.Element({}, self) .defaults({ diff --git a/source/Ox.UI/js/Form/Ox.Label.js b/source/Ox.UI/js/Form/Ox.Label.js index 76302f72..1c2b9d33 100644 --- a/source/Ox.UI/js/Form/Ox.Label.js +++ b/source/Ox.UI/js/Form/Ox.Label.js @@ -1,4 +1,12 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.Label Label Object + () -> Label Object + (options) -> Label Object + (options, self) -> Label Object + options Options object + +@*/ Ox.Label = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/Form/Ox.OptionGroup.js b/source/Ox.UI/js/Form/Ox.OptionGroup.js index 1ba41887..e54b8e28 100644 --- a/source/Ox.UI/js/Form/Ox.OptionGroup.js +++ b/source/Ox.UI/js/Form/Ox.OptionGroup.js @@ -1,4 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.OptionGroup OptionGroup + (items, min, max, property) -> OptionGroup + items array of items + min minimum number of selected items + max maximum number of selected items + property property to check +@*/ + Ox.OptionGroup = function(items, min, max, property) { /* @@ -41,6 +51,10 @@ Ox.OptionGroup = function(items, min, max, property) { return num; } + /*@ + [property] returns an array with the positions of all checked item + () -> returns checked items + @*/ this[property] = function() { // returns an array with the positions of all checked item var checked = []; @@ -52,6 +66,10 @@ Ox.OptionGroup = function(items, min, max, property) { return checked; }; + /*@ + init init group + () -> returns items + @*/ this.init = function() { var num = getNumber(), count = 0; @@ -76,6 +94,10 @@ Ox.OptionGroup = function(items, min, max, property) { return items; }; + /*@ + toggle toggle options + (pos) -> returns toggled state + @*/ this.toggle = function(pos) { var last, num = getNumber(), diff --git a/source/Ox.UI/js/Form/Ox.Picker.js b/source/Ox.UI/js/Form/Ox.Picker.js index a1a70f07..f3bfcaab 100644 --- a/source/Ox.UI/js/Form/Ox.Picker.js +++ b/source/Ox.UI/js/Form/Ox.Picker.js @@ -1,4 +1,19 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.Picker Picker Object + () -> Picker Object + (options) -> Picker Object + (options, self) -> Picker Object + options Options object + element picker element + elementHeight height + elemementWidth width + id picker id + overlap select button overlap value + show picker is shown + hide picker is hidden +@*/ + Ox.Picker = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/Form/Ox.PlaceInput.js b/source/Ox.UI/js/Form/Ox.PlaceInput.js index fd178b87..b4a26b2f 100644 --- a/source/Ox.UI/js/Form/Ox.PlaceInput.js +++ b/source/Ox.UI/js/Form/Ox.PlaceInput.js @@ -1,4 +1,16 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.PlaceInput PlaceInput Object + () -> PlaceInput Object + (options) -> PlaceInput Object + (options, self) -> PlaceInput Object + options Options object + id element id + value default value of place input + self shared private variable +@*/ + Ox.PlaceInput = function(options, self) { var self = $.extend(self || {}, { diff --git a/source/Ox.UI/js/Form/Ox.PlacePicker.js b/source/Ox.UI/js/Form/Ox.PlacePicker.js index e2b56561..1984a1ee 100644 --- a/source/Ox.UI/js/Form/Ox.PlacePicker.js +++ b/source/Ox.UI/js/Form/Ox.PlacePicker.js @@ -1,4 +1,16 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.PlacePicker PlacePicker Object + () -> PlacePicker Object + (options) -> PlacePicker Object + (options, self) -> PlacePicker Object + options Options object + id element id + value default value of place input + self shared private variable +@*/ + Ox.PlacePicker = function(options, self) { var self = $.extend(self || {}, { diff --git a/source/Ox.UI/js/Form/Ox.Range.js b/source/Ox.UI/js/Form/Ox.Range.js index 570a908f..e645ebec 100644 --- a/source/Ox.UI/js/Form/Ox.Range.js +++ b/source/Ox.UI/js/Form/Ox.Range.js @@ -1,26 +1,31 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.Range Range Object + () -> Range Object + (options) -> Range Object + (options, self) -> Range Object + options Options object + arrows if true, show arrows + arrowStep step when clicking arrows + arrowSymbols arrow symbols, like ['minus', 'plus'] + max maximum value + min minimum value + orientation 'horizontal' or 'vertical' + step step between values + size width or height, in px + thumbSize minimum width or height of thumb, in px + thumbValue if true, display value on thumb + trackGradient colors + trackImages or one or multiple track background image URLs + trackStep 0 (scroll here) or step when clicking track + value initial value + valueNames value names to display on thumb + self shared private variable + change triggered on change of the range +@*/ Ox.Range = function(options, self) { - /** - options - arrows boolean if true, show arrows - arrowStep number step when clicking arrows - arrowSymbols array arrow symbols, like ['minus', 'plus'] - max number maximum value - min number minimum value - orientation string 'horizontal' or 'vertical' - step number step between values - size number width or height, in px - thumbSize number minimum width or height of thumb, in px - thumbValue boolean if true, display value on thumb - trackGradient array colors - trackImages string or array one or multiple track background image URLs - trackStep number 0 (scroll here) or step when clicking track - value number initial value - valueNames array value names to display on thumb - */ - var self = self || {}, that = new Ox.Element({}, self) .defaults({ diff --git a/source/Ox.UI/js/Form/Ox.Select.js b/source/Ox.UI/js/Form/Ox.Select.js index 34c721cf..f1f6ab7a 100644 --- a/source/Ox.UI/js/Form/Ox.Select.js +++ b/source/Ox.UI/js/Form/Ox.Select.js @@ -1,4 +1,26 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.Select Select Object + () -> Select Object + (options) -> Select Object + (options, self) -> Select Object + options Options object + id element id + items items + max minimum number of selected items + min maximum number of selected items + overlap can be none, left or right + selectable is selectable + size size, can be small, medium, large + title select title + type can be 'text' or 'image' + width can be auto or width in pixels + self shared private variable + click on click event + change on change event +@*/ + Ox.Select = function(options, self) { // fixme: selected item needs attribute "checked", not "selected" ... that's strange @@ -130,6 +152,10 @@ Ox.Select = function(options, self) { }; + /*@ + selectItem select item in group + () -> returns object of selected items with id, title + @*/ that.selected = function() { return $.map(/*self.checked*/self.optionGroup.checked(), function(v) { return { @@ -139,6 +165,11 @@ Ox.Select = function(options, self) { }); }; + /*@ + selectItem select item in group + (id) -> select item by id + id item id + @*/ that.selectItem = function(id) { //Ox.print('selectItem', id, Ox.getObjectById(self.options.items, id).title) self.options.type == 'text' && self.$title.html( diff --git a/source/Ox.UI/js/Form/Ox.TimeInput.js b/source/Ox.UI/js/Form/Ox.TimeInput.js index c92f8116..68e34571 100644 --- a/source/Ox.UI/js/Form/Ox.TimeInput.js +++ b/source/Ox.UI/js/Form/Ox.TimeInput.js @@ -1,4 +1,18 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.TimeInput TimeInput Object + () -> TimeInput Object + (options) -> TimeInput Object + (options, self) -> TimeInput Object + options Options object + ampm 24h/ampm + seconds show seconds + milliseconds show milliseconds + value value, defaults to now + self shared private variable +@*/ + Ox.TimeInput = function(options, self) { // fixme: seconds get set even if options.seconds is false diff --git a/source/Ox.UI/js/List/Ox.IconItem.js b/source/Ox.UI/js/List/Ox.IconItem.js index 555c5c6e..0d4c227a 100644 --- a/source/Ox.UI/js/List/Ox.IconItem.js +++ b/source/Ox.UI/js/List/Ox.IconItem.js @@ -1,4 +1,21 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.IconItem IconItem Object + () -> IconItem Object + (options) -> IconItem Object + (options, self) -> IconItem Object + options Options object + height icon height + id element id + info icon info + size icon size + title title + width icon width + url icon url + self shared private variable +@*/ + Ox.IconItem = function(options, self) { //Ox.print('IconItem', options, self) diff --git a/source/Ox.UI/js/List/Ox.IconList.js b/source/Ox.UI/js/List/Ox.IconList.js index a8099c39..a99cedbe 100644 --- a/source/Ox.UI/js/List/Ox.IconList.js +++ b/source/Ox.UI/js/List/Ox.IconList.js @@ -1,4 +1,26 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.IconList IconList Object + () -> IconList Object + (options) -> IconList Object + (options, self) -> IconList Object + options Options object + centerSelection scroll list so selection is always centered + draggable can be dragged + id element id + item called with data, sort, size, + extends data with information needed for Ox.IconItem + items items array or callback function + keys available item keys + max maximum selected selected items + min minimum of selcted items + orientation list orientation + selected array of selected items + size list size + sort sort keys + self shared private variable +@*/ + Ox.IconList = function(options, self) { var self = self || {}, @@ -81,6 +103,10 @@ Ox.IconList = function(options, self) { }); } + /*@ + setOption set key/value + (key, value) -> set eky in options to value + @*/ self.setOption = function(key, value) { if (key == 'items') { that.$element.options(key, value); @@ -91,28 +117,53 @@ Ox.IconList = function(options, self) { } } + /*@ + closePreview close preview + () -> close + @*/ that.closePreview = function() { that.$element.closePreview(); }; + /*@ + paste paste to list + (data) -> paste data, returns IconList + @*/ that.paste = function(data) { that.$element.paste(data); return that; }; + /*@ + reloadList reload list + () -> reload iconlist + @*/ that.reloadList = function() { that.$element.reloadList(); return that; }; + /*@ + scrollToSelection set key/value + () -> scroll list ot selection + @*/ that.scrollToSelection = function() { that.$element.scrollToSelection(); }; + /*@ + size set key/value + () -> get size of list + @*/ that.size = function() { that.$element.size(); }; + /*@ + sortList sort list + (key, operator) -> sort list by key with operator + operator can be + / - + @*/ that.sortList = function(key, operator) { self.options.sort = [{ key: key, @@ -122,6 +173,12 @@ Ox.IconList = function(options, self) { that.$element.sortList(key, operator); }; + /*@ + value get/set value of item in list + (id) -> get all data for item + (id, key) -> get value of key of item with id + (id, key, value) -> set value, returns IconList + @*/ that.value = function(id, key, value) { // fixme: make this accept id, {k: v, ...} if (arguments.length == 1) { diff --git a/source/Ox.UI/js/List/Ox.ItemInput.js b/source/Ox.UI/js/List/Ox.ItemInput.js index c6129b16..cdca8c91 100644 --- a/source/Ox.UI/js/List/Ox.ItemInput.js +++ b/source/Ox.UI/js/List/Ox.ItemInput.js @@ -1,4 +1,20 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.ItemInput ItemInput Object + () -> ItemInput Object + (options) -> ItemInput Object + (options, self) -> ItemInput Object + options Options object + type can be textare + value default value + height height + width width + self shared private variable + cancel triggered if cancel button is pressed + save triggered if save button is pressed +@*/ + Ox.ItemInput = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index 8b20bdd6..a53f45e5 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -1,52 +1,69 @@ // vim: et:ts=4:sw=4:sts=4:ft=js /*@ -Basic list object -(options) -> that -(options, self) -> that -options the list's options -self shared private variable +Ox.List List Element + () -> List Object + (options) -> List Object + (options, self) -> List Object + options Options object + centered if true, and orientation is 'horizontal', + then keep the selected item centered + construct (data) returns the list item HTML + draggable true if the items can be reordered + format <[]> ??? + itemHeight item height + items list of items, + (data) returns {items, size, ...} + (data, callback) returns [items] + itemWidth item width + keys keys of the list items + max max number of items that can be selected + min min number of items that must be selected + orientation 'horizontal' or 'vertical' + pageLength number of items per page + selected ids of the selected elements + sort sort order + sortable + type + unique name of the key that acts as unique id + self shared private variable + add item added + delete item removed + copy copy + paste paste + movie move item + load list loaded + openpreview preview of selected item opened + closepreview preview closed + select select item @*/ Ox.List = function(options, self) { - /*** - basic list object - Options - centered boolean if true, and orientation is 'horizontal', - then keep the selected item centered - construct function function(data), returns the list item HTML - items function function(callback) returns {items, size, ...} - function(data, callback) returns [items] - or array of items - Methods - Events - ***/ - var self = self || {}, that = new Ox.Container({}, self) .defaults({ - centered: false, //@ if true, and orientation is 'horizontal', - //@ then keep the selected item centered - construct: null, //@ (data) returns the list item HTML - draggable: false, //@ true if the items can be reordered - format: [], //@ ??? - itemHeight: 16, //@ item height - items: null, //@ list items - //@ (data) returns {items, size, ...} - //@ (data, callback) returns [items] - itemWidth: 16, //@ item width - keys: [], //@ keys of the list items - max: -1, //@ max number of items that can be selected - min: 0, //@ min number of items that must be selected - orientation: 'vertical', //@ 'horizontal' or 'vertical' - pageLength: 100, //@ number of items per page - selected: [], //@ ids of the selected elements - sort: [], //@ - sortable: false, //@ - type: 'text', //@ - unique: '' //@ name of the key that acts as unique id + centered: false, + + construct: null, + draggable: false, + format: [], + itemHeight: 16, + items: null, + + + itemWidth: 16, + keys: [], + max: -1, + min: 0, + orientation: 'vertical', + pageLength: 100, + selected: [], + sort: [], + sortable: false, + type: 'text', + unique: '' }) .options(options || {}) .scroll(scroll); @@ -265,7 +282,7 @@ Ox.List = function(options, self) { // fixme: why does chainging fail here? new Ox.ListItem({ construct: self.options.construct - }).appendTo($page); + }).appendTo($page); } //Ox.print('cEP done') return $page; @@ -1070,7 +1087,7 @@ Ox.List = function(options, self) { self.selected.splice(self.selected.indexOf(pos), 1); !Ox.isUndefined(self.$items[pos]) && self.$items[pos].removeClass('OxSelected'); - } + } }); ids.forEach(function(id, i) { var pos = getPositionById(id); @@ -1232,6 +1249,12 @@ Ox.List = function(options, self) { } }; + /*@ + addItems add item to list + (pos, items) -> add items to list at position + pos position to add items + items array of items ot add + @*/ that.addItems = function(pos, items) { var $items = [], length = items.length @@ -1268,6 +1291,11 @@ Ox.List = function(options, self) { updatePositions(); } + /*@ + editItem turn item into edit form + (pos) -> edit item at position + pos position of item to edit + @*/ that.editItem = function(pos) { var $input, item = self.options.items[pos], @@ -1307,26 +1335,47 @@ Ox.List = function(options, self) { } } + /*@ + clearCache empy list cache + () -> empy cache, returns List Element + @*/ that.clearCache = function() { // fixme: was used by TextList resizeColumn, now probably no longer necessary self.$pages = []; return that; }; + /*@ + closePreview close preview + () -> close preview, returns List Element + @*/ that.closePreview = function() { self.preview = false; return that; }; + /*@ + paste paste data + (data) -> paste data into list + data paste object + @*/ that.paste = function(data) { pasteItems(data); return that; }; + /*@ + reloadList reload list contents + () -> returns List Element + @*/ that.reloadList = function() { updateQuery(); return that; }; + /*@ + reloadPages reload list pages + () -> returns List Element + @*/ that.reloadPages = function() { //Ox.print('---------------- list reload, page', self.page) var page = self.page; @@ -1337,12 +1386,15 @@ Ox.List = function(options, self) { return that; }; + /*@ + removeItems remove items from list + (ids) -> remove items + (pos, length) -> remove items + ids array of item ids + pos delete items starting at this position + length number of items to remove + @*/ that.removeItems = function(pos, length) { - /* - removeItems(ids) - or - removeItems(pos, length) - */ if(!length) { //pos is list of ids pos.forEach(function(id) { var p = getPositionById(id); @@ -1363,12 +1415,19 @@ Ox.List = function(options, self) { updatePositions(); } } - + /*@ + scrollToSelection scroll list to current selection + () -> returns List Element + @*/ that.scrollToSelection = function() { self.selected.length && scrollToPosition(self.selected[0]); return that; }; + /*@ + size fixme: not a good function name + () -> returns List Element + @*/ that.size = function() { // fixme: not a good function name if (self.options.orientation == 'both') { var rowLength = getRowLength(), @@ -1404,6 +1463,12 @@ Ox.List = function(options, self) { return that; } + /*@ + sortList sort list + (key, operator) -> returns List Element + key key to sort list by + operator +/- sort ascending or descending + @*/ that.sortList = function(key, operator) { Ox.print('sortList', key, operator) if (key != self.options.sort[0].key || operator != self.options.sort[0].operator) { @@ -1414,6 +1479,15 @@ Ox.List = function(options, self) { return that; } + /*@ + value get/set list value + (id, key, value) -> sets value, returns List Element + (id, key) -> returns value + (id) -> returns all values of id + id id of item + key key if item property + value value, can be whatever that property is + @*/ that.value = function(id, key, value) { var pos = getPositionById(id), $item = self.$items[pos], diff --git a/source/Ox.UI/js/List/Ox.ListItem.js b/source/Ox.UI/js/List/Ox.ListItem.js index 09b9f2e0..710b5403 100644 --- a/source/Ox.UI/js/List/Ox.ListItem.js +++ b/source/Ox.UI/js/List/Ox.ListItem.js @@ -1,4 +1,21 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.ListItem ListItem Object + () -> ListItem Object + (options) -> ListItem Object + (options, self) -> ListItem Object + options Options object + construct construct function + data item data + draggable can be dragged + position item position + unique unique key + self shared private variable + cancel triggered if cancel button is pressed + save triggered if save button is pressed +@*/ + Ox.ListItem = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/List/Ox.ListPage.js b/source/Ox.UI/js/List/Ox.ListPage.js index d19ec59a..64c85bb7 100644 --- a/source/Ox.UI/js/List/Ox.ListPage.js +++ b/source/Ox.UI/js/List/Ox.ListPage.js @@ -1,4 +1,12 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.ListPage ListPage Object + () -> ListPage Object + (options) -> ListPage Object + (options, self) -> ListPage Object + options Options object + self shared private variable +@*/ Ox.ListPage = function(options, self) { var self = self || {}, that = new Ox.Element({}, self) diff --git a/source/Ox.UI/js/List/Ox.TextList.js b/source/Ox.UI/js/List/Ox.TextList.js index ffdf4a22..548ba826 100644 --- a/source/Ox.UI/js/List/Ox.TextList.js +++ b/source/Ox.UI/js/List/Ox.TextList.js @@ -1,4 +1,28 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.TextList TextList Object + () -> TextList Object + (options) -> TextList Object + (options, self) -> TextList Object + options Options object + columns + columnsMovable + columnsRemovable + columnsResizable + columnsVisible + columnWidth + id + items function() {} {sort, range, keys, callback} or array + max + min + pageLength + scrollbarVisible + selected + sort + self shared private variable +@*/ + Ox.TextList = function(options, self) { // fixme: rename to TableList diff --git a/source/Ox.UI/js/List/Ox.TreeList.js b/source/Ox.UI/js/List/Ox.TreeList.js index 388faac1..007ae1c1 100644 --- a/source/Ox.UI/js/List/Ox.TreeList.js +++ b/source/Ox.UI/js/List/Ox.TreeList.js @@ -1,4 +1,20 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.TreeList TreeList Object + () -> TreeList Object + (options) -> TreeList Object + (options, self) -> TreeList Object + options Options object + data data to be parsed to items, needs documentation + items array of items + max maximum number of items that can be selected, -1 unlimited + min minimum number of items that have to be selected + selected selected ids + width list width + self shared private variable +@*/ + Ox.TreeList = function(options, self) { // fixme: expanding the last item should cause some scroll diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index 6ac4c141..ac3fb627 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -1,4 +1,20 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.ListMap ListMap Object + () -> ListMap Object + (options) -> ListMap Object + (options, self) -> ListMap Object + options Options object + addPlace + height + labels + places + selected + width + self shared private variable +@*/ + Ox.ListMap = function(options, self) { var self = self || {}, @@ -339,6 +355,9 @@ Ox.ListMap = function(options, self) { return val.toFixed(8); } + /*@ + setOption setOption + @*/ self.setOption = function(key, value) { Ox.print('ONCHANGE') if (key == 'height' || key == 'width') { @@ -352,16 +371,25 @@ Ox.ListMap = function(options, self) { } } + /*@ + focusList focusList + @*/ that.focusList = function() { self.$list.gainFocus(); return that; } + /*@ + reloadList reloadList + @*/ that.reloadList = function() { self.$list.reloadList(); return that; } + /*@ + resizeMap resizeMap + @*/ that.resizeMap = function() { Ox.print('Ox.ListMap.resizeMap()') self.$map.resizeMap(); diff --git a/source/Ox.UI/js/Map/Ox.MapImage.js b/source/Ox.UI/js/Map/Ox.MapImage.js index 0af6c48c..39bd3094 100644 --- a/source/Ox.UI/js/Map/Ox.MapImage.js +++ b/source/Ox.UI/js/Map/Ox.MapImage.js @@ -1,14 +1,20 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -Ox.MapImage = function(options, self) { - /** - 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 MapImage Object + () -> MapImage Object + (options) -> MapImage Object + (options, self) -> MapImage Object + options Options object + 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) + self shared private variable +@*/ + +Ox.MapImage = function(options, self) { var self = self || {}, that = new Ox.Element('', self) diff --git a/source/Ox.UI/js/Map/Ox.MapMarker.js b/source/Ox.UI/js/Map/Ox.MapMarker.js index 9e2c3304..f1a5a21d 100644 --- a/source/Ox.UI/js/Map/Ox.MapMarker.js +++ b/source/Ox.UI/js/Map/Ox.MapMarker.js @@ -1,5 +1,15 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.MapMarker MapMarker Object + (options) -> MapMarker Object + options Options object + color marker color + map map + place place + size size +@*/ + Ox.MapMarker = function(options) { options = Ox.extend({ @@ -150,33 +160,56 @@ Ox.MapMarker = function(options) { } } + /*@ + add add to map + () -> add to map, returns MapMarker + @*/ that.add = function() { that.marker.setMap(that.map.map); google.maps.event.addListener(that.marker, 'click', click); return that; }; + /*@ + edit edit marker + () -> edit marker, returns MapMarker + @*/ that.edit = function() { setOptions(); google.maps.event.addListener(that.marker, 'dragstart', dragstart); google.maps.event.addListener(that.marker, 'drag', drag); google.maps.event.addListener(that.marker, 'dragend', dragend); + return that; }; - + + /*@ + remove remove marker + () -> remove marker from map, returns MapMarker + @*/ that.remove = function() { that.marker.setMap(null); google.maps.event.clearListeners(that.marker); return that; }; + /*@ + submit submit marker + () -> clear edit listeners, returns MapMarker + @*/ that.submit = function() { google.maps.event.clearListeners(that.marker, 'dragstart'); google.maps.event.clearListeners(that.marker, 'drag'); google.maps.event.clearListeners(that.marker, 'dragend'); + return that; } + /*@ + update update marker + () -> update marker, returns MapMarker + @*/ that.update = function() { setOptions(); + return that; } return that; diff --git a/source/Ox.UI/js/Map/Ox.MapMarkerImage.js b/source/Ox.UI/js/Map/Ox.MapMarkerImage.js index 952aa19e..83e322d5 100644 --- a/source/Ox.UI/js/Map/Ox.MapMarkerImage.js +++ b/source/Ox.UI/js/Map/Ox.MapMarkerImage.js @@ -1,5 +1,15 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.MapMarkerImage MapMarkerImage Object + (options) -> google.maps.MarkerImage + options Options object + color marker color + mode can be: normal, selected, editing + size size + type can be: place, result, rectangle +@*/ + Ox.MapMarkerImage = (function() { var cache = {}; @@ -46,4 +56,4 @@ Ox.MapMarkerImage = (function() { } -}()); \ No newline at end of file +}()); diff --git a/source/Ox.UI/js/Map/Ox.MapPlace.js b/source/Ox.UI/js/Map/Ox.MapPlace.js index 4bce02ea..c669221c 100644 --- a/source/Ox.UI/js/Map/Ox.MapPlace.js +++ b/source/Ox.UI/js/Map/Ox.MapPlace.js @@ -1,5 +1,24 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.MapPlace MapPlace Object + (options) -> MapPlace Object + options Options object + east + editing + geoname + map + markerColor 0> 0]> + markerSize + name + north + selected + south + type + visible + west +@*/ + Ox.MapPlace = function(options) { options = Ox.extend({ @@ -70,12 +89,18 @@ Ox.MapPlace = function(options) { return that.map.options('editable') && that.editable; } + /*@ + add add + @*/ that.add = function() { that.visible = true; that.marker.add(); return that; }; + /*@ + cancel cancel + @*/ that.cancel = function() { if (editable()) { that.undo(); @@ -86,10 +111,16 @@ Ox.MapPlace = function(options) { return that; }; + /*@ + crossesDateline crossesDateline + @*/ that.crossesDateline = function() { return that.west > that.east; } + /*@ + deselect dselect + @*/ that.deselect = function() { that.editing && that.submit(); that.selected = false; @@ -98,6 +129,9 @@ Ox.MapPlace = function(options) { return that; }; + /*@ + edit edit + @*/ that.edit = function() { if (editable()) { that.editing = true; @@ -113,6 +147,9 @@ Ox.MapPlace = function(options) { return that; } + /*@ + remove remove + @*/ that.remove = function() { that.editing && that.submit(); that.selected && that.deselect(); @@ -121,6 +158,9 @@ Ox.MapPlace = function(options) { return that; }; + /*@ + select select + @*/ that.select = function() { that.selected = true; !that.visible && that.add(); @@ -129,6 +169,9 @@ Ox.MapPlace = function(options) { return that; }; + /*@ + submit submit + @*/ that.submit = function() { if (editable()) { that.editing = false; @@ -138,11 +181,17 @@ Ox.MapPlace = function(options) { return that; }; + /*@ + update update + @*/ that.update = function() { update(); return that; }; - + + /*@ + undo undo + @*/ that.undo = function() { if (editable()) { Ox.forEach(that.original, function(v, k) { @@ -157,4 +206,4 @@ Ox.MapPlace = function(options) { return that; -}; \ No newline at end of file +}; diff --git a/source/Ox.UI/js/Map/Ox.MapRectangle.js b/source/Ox.UI/js/Map/Ox.MapRectangle.js index e899a7d1..0a4035dc 100644 --- a/source/Ox.UI/js/Map/Ox.MapRectangle.js +++ b/source/Ox.UI/js/Map/Ox.MapRectangle.js @@ -1,4 +1,16 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.MapRectangle MapRectangle Object + () -> MapRectangle Object + (options) -> MapRectangle Object + (options, self) -> MapRectangle Object + options Options object + map map + place place + self shared private variable +@*/ + Ox.MapRectangle = function(options, self) { var options = Ox.extend({ @@ -11,10 +23,16 @@ Ox.MapRectangle = function(options, self) { that[key] = val; }); + /*@ + rectangle google.maps.Rectangle + @*/ that.rectangle = new google.maps.Rectangle({ clickable: true, bounds: that.place.bounds, }); + /*@ + markers array of markers + @*/ that.markers = Ox.map(that.place.points, function(point, position) { return new Ox.MapRectangleMarker({ map: that.map, @@ -48,12 +66,18 @@ Ox.MapRectangle = function(options, self) { }) } + /*@ + add add + @*/ that.add = function() { that.rectangle.setMap(that.map.map); google.maps.event.addListener(that.rectangle, 'click', click); return that; }; + /*@ + deselect deselect + @*/ that.deselect = function() { setOptions(); Ox.print('MARKERS', that.markers) @@ -62,12 +86,18 @@ Ox.MapRectangle = function(options, self) { }); }; + /*@ + remove remove + @*/ that.remove = function() { that.rectangle.setMap(null); google.maps.event.clearListeners(that.rectangle); return that } + /*@ + select select + @*/ that.select = function() { setOptions(); Ox.forEach(that.markers, function(marker) { @@ -75,6 +105,9 @@ Ox.MapRectangle = function(options, self) { }); }; + /*@ + update udpate + @*/ that.update = function() { that.rectangle.setOptions({ bounds: that.place.bounds diff --git a/source/Ox.UI/js/Map/Ox.MapRectangleMarker.js b/source/Ox.UI/js/Map/Ox.MapRectangleMarker.js index 51a17b6f..957b7e9d 100644 --- a/source/Ox.UI/js/Map/Ox.MapRectangleMarker.js +++ b/source/Ox.UI/js/Map/Ox.MapRectangleMarker.js @@ -1,5 +1,17 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.MapRectangleMarker MapRectangleMarker Object + () -> MapRectangleMarker Object + (options) -> MapRectangleMarker Object + (options, self) -> MapRectangleMarker Object + options Options object + map map + place place + position + self shared private variable +@*/ + Ox.MapRectangleMarker = function(options, self) { options = Ox.extend({ @@ -73,6 +85,9 @@ Ox.MapRectangleMarker = function(options, self) { } } + /*@ + add add + @*/ that.add = function() { that.marker.setMap(that.map.map); google.maps.event.addListener(that.marker, 'dragstart', dragstart); @@ -80,11 +95,17 @@ Ox.MapRectangleMarker = function(options, self) { google.maps.event.addListener(that.marker, 'dragend', dragend); }; + /*@ + remove remove + @*/ that.remove = function() { that.marker.setMap(null); google.maps.event.clearListeners(that.marker); }; + /*@ + update update + @*/ that.update = function() { that.marker.setOptions({ position: that.place.points[that.position] diff --git a/source/Ox.UI/js/Menu/Ox.MainMenu.js b/source/Ox.UI/js/Menu/Ox.MainMenu.js index ba75447b..363410e4 100644 --- a/source/Ox.UI/js/Menu/Ox.MainMenu.js +++ b/source/Ox.UI/js/Menu/Ox.MainMenu.js @@ -1,6 +1,17 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -/** -*/ + +/*@ +Ox.MainMenu MainMenu Object + () -> MainMenu Object + (options) -> MainMenu Object + (options, self) -> MainMenu Object + options Options object + extras extra menus + menus submenus + size can be small, medium, large + self shared private variable +@*/ + Ox.MainMenu = function(options, self) { var self = self || {}, @@ -106,6 +117,9 @@ Ox.MainMenu = function(options, self) { }; + /*@ + checkItem checkItem + @*/ that.checkItem = function(id) { var ids = id.split('_'), itemId = ids.pop(), @@ -113,12 +127,18 @@ Ox.MainMenu = function(options, self) { that.getMenu(menuId).checkItem(itemId); }; + /*@ + disableItem disableItem + @*/ that.disableItem = function(id) { that.getItem(id).options({ disabled: true }); }; + /*@ + enableItem enableItem + @*/ that.enableItem = function(id) { Ox.print('ENABLE ITEM', id) that.getItem(id).options({ @@ -126,6 +146,9 @@ Ox.MainMenu = function(options, self) { }); }; + /*@ + getItem getItem + @*/ that.getItem = function(id) { var ids = id.split('_'), item; @@ -141,6 +164,9 @@ Ox.MainMenu = function(options, self) { return item; }; + /*@ + getMenu getMenu + @*/ that.getMenu = function(id) { var ids = id.split('_'), menu; @@ -162,18 +188,27 @@ Ox.MainMenu = function(options, self) { }; + /*@ + selectNextMenu selectNextMenu + @*/ that.selectNextMenu = function() { if (self.selected < self.options.menus.length - 1) { clickTitle(self.selected + 1); } }; + /*@ + selectPreviousMenu selectPreviousMenu + @*/ that.selectPreviousMenu = function() { if (self.selected) { clickTitle(self.selected - 1); } }; + /*@ + uncheckItem uncheckItem + @*/ that.uncheckItem = function(id) { that.getItem(id).options({ checked: false diff --git a/source/Ox.UI/js/Menu/Ox.Menu.js b/source/Ox.UI/js/Menu/Ox.Menu.js index dcf32b67..eca75e8a 100644 --- a/source/Ox.UI/js/Menu/Ox.Menu.js +++ b/source/Ox.UI/js/Menu/Ox.Menu.js @@ -1,24 +1,31 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -/** - options - element the element the menu is attached to - id the menu id - items array of menu items - mainmenu the main menu this menu is part of, if any - offset offset of the menu, in px - parent the supermenu, if any - selected the position of the selected item - side open to 'bottom' or 'right' - size 'large', 'medium' or 'small' +/*@ +Ox.Menu Menu Object + () -> Menu Object + (options) -> Menu Object + (options, self) -> Menu Object + options Options object + element the element the menu is attached to + id the menu id + items array of menu items + mainmenu the main menu this menu is part of, if any + offset offset of the menu, in px + left left + top top + parent the supermenu, if any + selected the position of the selected item + side open to 'bottom' or 'right' + size 'large', 'medium' or 'small' + self shared private variable + + change_groupId {id, value} checked item of a group has changed + click_itemId item not belonging to a group was clicked + click_menuId {id, value} item not belonging to a group was clicked + deselect_menuId {id, value} item was deselected not needed, not implemented + hide_menuId menu was hidden + select_menuId {id, value} item was selected +@*/ - events: - change_groupId {id, value} checked item of a group has changed - click_itemId item not belonging to a group was clicked - click_menuId {id, value} item not belonging to a group was clicked - 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) { Ox.print(options) var self = self || {}, @@ -524,18 +531,30 @@ Ox.print(options) } } + /*@ + addItem + @*/ that.addItem = function(item, position) { }; + /*@ + addItemAfter + @*/ that.addItemAfter = function(item, id) { }; + /*@ + addItemBefore + @*/ that.addItemBefore = function(item, id) { }; + /*@ + checkItem + @*/ that.checkItem = function(id) { var item = that.getItem(id); if (item.options('group')) { @@ -553,6 +572,9 @@ Ox.print(options) } }; + /*@ + getItem + @*/ that.getItem = function(id) { //Ox.print('id', id) var ids = id.split('_'), @@ -576,6 +598,9 @@ Ox.print(options) return item; }; + /*@ + getSubmenu + @*/ that.getSubmenu = function(id) { var ids = id.split('_'), submenu; @@ -588,6 +613,9 @@ Ox.print(options) return submenu; } + /*@ + hasEnabledItems + @*/ that.hasEnabledItems = function() { var ret = false; Ox.forEach(that.items, function(item) { @@ -598,6 +626,10 @@ Ox.print(options) return ret; }; + /*@ + hideMenu + () -> Menu Object + @*/ that.hideMenu = function() { if (that.is(':hidden')) { return; @@ -625,14 +657,24 @@ Ox.print(options) return that; }; + /*@ + removeItem removeItem + @*/ that.removeItem = function() { }; + /*@ + selectFirstItem selectFirstItem + @*/ that.selectFirstItem = function() { selectNextItem(); }; + /*@ + showMenu showMenu + () -> Menu Object + @*/ that.showMenu = function() { if (!that.is(':hidden')) { return; @@ -679,6 +721,9 @@ Ox.print(options) //that.triggerEvent('show'); }; + /*@ + toggelMenu toggleMenu + @*/ that.toggleMenu = function() { that.is(':hidden') ? that.showMenu() : that.hideMenu(); }; diff --git a/source/Ox.UI/js/Menu/Ox.MenuItem.js b/source/Ox.UI/js/Menu/Ox.MenuItem.js index 1c9d9641..74b7c14b 100644 --- a/source/Ox.UI/js/Menu/Ox.MenuItem.js +++ b/source/Ox.UI/js/Menu/Ox.MenuItem.js @@ -1,4 +1,24 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.MenuItem MenuItem Object + () -> MenuItem Object + (options) -> MenuItem Object + (options, self) -> MenuItem Object + options Options object + bind fixme: what's this? + checked + disabled + group + icon icon + id id + items items + keyboard keyboard + menu menu + position position + title title + self shared private variable +@*/ + Ox.MenuItem = function(options, self) { var self = self || {}, @@ -81,6 +101,9 @@ Ox.MenuItem = function(options, self) { }; } + /*@ + setOption setOption + @*/ self.setOption = function(key, value) { if (key == 'checked') { that.$status.html(value ? Ox.UI.symbols.check : '') @@ -96,6 +119,9 @@ Ox.MenuItem = function(options, self) { // toggle id and title }; + /*@ + toggelChecked toggleChecked + @*/ that.toggleChecked = function() { that.options({ checked: !self.options.checked @@ -105,7 +131,10 @@ Ox.MenuItem = function(options, self) { that.toggleDisabled = function() { }; - + + /*@ + toggelTitle toggleTitle + @*/ that.toggleTitle = function() { //Ox.print('s.o.t', self.options.title) that.options({ diff --git a/source/Ox.UI/js/Panel/Ox.CollapsePanel.js b/source/Ox.UI/js/Panel/Ox.CollapsePanel.js index 94d14c30..63b49717 100644 --- a/source/Ox.UI/js/Panel/Ox.CollapsePanel.js +++ b/source/Ox.UI/js/Panel/Ox.CollapsePanel.js @@ -1,6 +1,18 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -/** -*/ + +/*@ +Ox.CollapsePanel CollapsePanel Object + () -> CollapsePanel Object + (options) -> CollapsePanel Object + (options, self) -> CollapsePanel Object + options Options object + collapsed collapsed state + extras panel extras + size size + title title + self shared private variable +@*/ + Ox.CollapsePanel = function(options, self) { var self = self || {}, that = new Ox.Panel({}, self) @@ -68,6 +80,10 @@ Ox.CollapsePanel = function(options, self) { collapsed: self.options.collapsed }); } + /*@ + setOption setOption + (key, value) -> set key to value + @*/ self.setOption = function(key, value) { if (key == 'collapsed') { @@ -75,7 +91,11 @@ Ox.CollapsePanel = function(options, self) { $title.html(self.options.title); } }; - that.update = function() { // fixme: used anywhere? + + /*@ + update update // fixme: used anywhere? + @*/ + that.update = function() { self.options.collapsed && that.$content.css({ marginTop: -that.$content.height() }); diff --git a/source/Ox.UI/js/Panel/Ox.Panel.js b/source/Ox.UI/js/Panel/Ox.Panel.js index a28a5c38..7bfa2292 100644 --- a/source/Ox.UI/js/Panel/Ox.Panel.js +++ b/source/Ox.UI/js/Panel/Ox.Panel.js @@ -1,6 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js -/** -*/ + +/*@ +Ox.Panel Panel Object + () -> Panel Object + (options) -> Panel Object + (options, self) -> Panel Object + options Options object + self shared private variable +@*/ + Ox.Panel = function(options, self) { var self = self || {}, that = new Ox.Element({}, self) diff --git a/source/Ox.UI/js/Panel/Ox.SplitPanel.js b/source/Ox.UI/js/Panel/Ox.SplitPanel.js index 25e9f3c7..6e1f48e8 100644 --- a/source/Ox.UI/js/Panel/Ox.SplitPanel.js +++ b/source/Ox.UI/js/Panel/Ox.SplitPanel.js @@ -1,4 +1,15 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.SplitPanel SpliPanel Object + () -> SpliPanel Object + (options) -> SpliPanel Object + (options, self) -> SpliPanel Object + options Options object + self shared private variable + resize resize + toggle toggle +@*/ + /** options: elements: [{ array of one, two or three elements diff --git a/source/Ox.UI/js/Video/Ox.AnnotationPanel.js b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js index 110a6b94..b36f6594 100644 --- a/source/Ox.UI/js/Video/Ox.AnnotationPanel.js +++ b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js @@ -1,4 +1,19 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.AnnotationPanel AnnotationPanel Object + () -> AnnotationPanel Object + (options) -> AnnotationPanel Object + (options, self) -> AnnotationPanel Object + options Options object + id id + items items + titles title + type panel type + width + self shared private variable +@*/ + Ox.AnnotationPanel = function(options, self) { var self = self || {}, @@ -99,6 +114,9 @@ Ox.AnnotationPanel = function(options, self) { } + /*@ + addItem addItem + @*/ that.addItem = function(item) { var pos = 0; self.options.items.splice(pos, 0, item); @@ -106,9 +124,16 @@ Ox.AnnotationPanel = function(options, self) { self.$annotations.editItem(pos); } + /*@ + removeItems removeItems + @*/ that.removeItems = function(ids) { self.$annotations.removeItems(ids); } + + /*@ + deselectItems deselectItems + @*/ that.deselectItems = function() { if(self.$annotations.options('selected')) self.$annotations.options('selected',[]); diff --git a/source/Ox.UI/js/Video/Ox.BlockTimeline.js b/source/Ox.UI/js/Video/Ox.BlockTimeline.js index a63da8e7..1a875d8f 100644 --- a/source/Ox.UI/js/Video/Ox.BlockTimeline.js +++ b/source/Ox.UI/js/Video/Ox.BlockTimeline.js @@ -1,4 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.BlockTimeline BlockTimeline Object + () -> BlockTimeline Object + (options) -> BlockTimeline Object + (options, self) -> BlockTimeline Object + options Options object + self shared private variable +@*/ + Ox.BlockTimeline = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/Video/Ox.LargeTimeline.js b/source/Ox.UI/js/Video/Ox.LargeTimeline.js index 04a7e56c..d3d1bd2d 100644 --- a/source/Ox.UI/js/Video/Ox.LargeTimeline.js +++ b/source/Ox.UI/js/Video/Ox.LargeTimeline.js @@ -1,4 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.LargeTimeline LargeTimeline Object + () -> LargeTimeline Object + (options) -> LargeTimeline Object + (options, self) -> LargeTimeline Object + options Options object + self shared private variable +@*/ + Ox.LargeTimeline = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/Video/Ox.SmallTimeline.js b/source/Ox.UI/js/Video/Ox.SmallTimeline.js index c5bf0369..e0b57c72 100644 --- a/source/Ox.UI/js/Video/Ox.SmallTimeline.js +++ b/source/Ox.UI/js/Video/Ox.SmallTimeline.js @@ -1,4 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.SmallTimeline SmallTimeline Object + () -> SmallTimeline Object + (options) -> SmallTimeline Object + (options, self) -> SmallTimeline Object + options Options object + self shared private variable +@*/ + Ox.SmallTimeline = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index 7448cbbb..76509b69 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -1,4 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.VideoEditor VideoEditor Object + () -> VideoEditor Object + (options) -> VideoEditor Object + (options, self) -> VideoEditor Object + options Options object + self shared private variable +@*/ + Ox.VideoEditor = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/Video/Ox.VideoEditorPlayer.js b/source/Ox.UI/js/Video/Ox.VideoEditorPlayer.js index aa138cb5..0bdcf094 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditorPlayer.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditorPlayer.js @@ -1,5 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.VideoEditorPlayer VideoEditorPlayer Object + () -> VideoEditorPlayer Object + (options) -> VideoEditorPlayer Object + (options, self) -> VideoEditorPlayer Object + options Options object + self shared private variable +@*/ + Ox.VideoEditorPlayer = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/Video/Ox.VideoPanelPlayer.js b/source/Ox.UI/js/Video/Ox.VideoPanelPlayer.js index 26f0a333..05006544 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPanelPlayer.js +++ b/source/Ox.UI/js/Video/Ox.VideoPanelPlayer.js @@ -1,4 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.VideoPanelPlayer VideoPanelPlayer Object + () -> VideoPanelPlayer Object + (options) -> VideoPanelPlayer Object + (options, self) -> VideoPanelPlayer Object + options Options object + self shared private variable +@*/ + Ox.VideoPanelPlayer = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/Video/Ox.VideoPlayer.js b/source/Ox.UI/js/Video/Ox.VideoPlayer.js index 3c985aa1..9835ac2d 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPlayer.js +++ b/source/Ox.UI/js/Video/Ox.VideoPlayer.js @@ -1,3 +1,5 @@ +// vim: et:ts=4:sw=4:sts=4:ft=js + /*@ Ox.VideoPlayer Generic Video Player (options, self) -> Video Player @@ -1417,4 +1419,4 @@ Ox.VideoPlayer = function(options, self) { return that; -}; \ No newline at end of file +}; diff --git a/source/Ox.UI/js/Window/Ox.Dialog.js b/source/Ox.UI/js/Window/Ox.Dialog.js index a8f9b9f6..c153424b 100644 --- a/source/Ox.UI/js/Window/Ox.Dialog.js +++ b/source/Ox.UI/js/Window/Ox.Dialog.js @@ -1,4 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.Dialog Dialog Object + () -> Dialog Object + (options) -> Dialog Object + (options, self) -> Dialog Object + options Options object + self shared private variable +@*/ + Ox.Dialog = function(options, self) { // fixme: dialog should be derived from a generic draggable diff --git a/source/Ox.UI/js/Window/Ox.Tooltip.js b/source/Ox.UI/js/Window/Ox.Tooltip.js index 14da1dda..f1316d82 100644 --- a/source/Ox.UI/js/Window/Ox.Tooltip.js +++ b/source/Ox.UI/js/Window/Ox.Tooltip.js @@ -1,4 +1,14 @@ // vim: et:ts=4:sw=4:sts=4:ft=js + +/*@ +Ox.Tooltip Tooltip Object + () -> Tooltip Object + (options) -> Tooltip Object + (options, self) -> Tooltip Object + options Options object + self shared private variable +@*/ + Ox.Tooltip = function(options, self) { var self = self || {}, diff --git a/source/Ox.UI/js/Window/Ox.Window.js b/source/Ox.UI/js/Window/Ox.Window.js index 566a8765..2827943d 100644 --- a/source/Ox.UI/js/Window/Ox.Window.js +++ b/source/Ox.UI/js/Window/Ox.Window.js @@ -1,4 +1,18 @@ // vim: et:ts=4:sw=4:sts=4:ft=js +/*@ +Ox.Window Window object + () -> Window object + (options) -> Window object + (options, self) -> Window object + options Options object + draggable is window draggable + fullscreenable fixme: silly name + height height + resizeable resizeable + scaleable sccaleable + width width + self Shared private variable +@*/ Ox.Window = function(options, self) { self = self || {},