From cc75e25415deebf2e8b0b7c9091b3d923bbbe4c8 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 16 May 2011 12:49:48 +0200 Subject: [PATCH] more docs --- source/Ox.UI/js/Bar/Ox.Resizebar.js | 18 +++---- source/Ox.UI/js/Core/Ox.App.js | 11 +++- source/Ox.UI/js/Core/Ox.Clipboard.js | 16 +++--- source/Ox.UI/js/Core/Ox.Container.js | 2 +- source/Ox.UI/js/Core/Ox.DocPage.js | 1 + source/Ox.UI/js/Core/Ox.Focus.js | 24 ++++++--- source/Ox.UI/js/Core/Ox.LoadingIcon.js | 1 + source/Ox.UI/js/Form/Ox.Checkbox.js | 41 ++++++++------ source/Ox.UI/js/Form/Ox.ColorInput.js | 10 ++++ source/Ox.UI/js/Form/Ox.ColorPicker.js | 13 +++++ source/Ox.UI/js/Form/Ox.DateInput.js | 27 +++++----- source/Ox.UI/js/Form/Ox.DateTimeInput.js | 16 ++++++ source/Ox.UI/js/Form/Ox.Filter.js | 20 ++++--- source/Ox.UI/js/Form/Ox.Form.js | 4 +- source/Ox.UI/js/Form/Ox.FormElementGroup.js | 15 ++++++ source/Ox.UI/js/Form/Ox.FormItem.js | 20 +++++++ source/Ox.UI/js/Form/Ox.OptionGroup.js | 22 ++++++++ source/Ox.UI/js/Form/Ox.Picker.js | 8 ++- source/Ox.UI/js/Form/Ox.PlaceInput.js | 12 +++++ source/Ox.UI/js/Form/Ox.PlacePicker.js | 12 +++++ source/Ox.UI/js/Form/Ox.Range.js | 4 +- source/Ox.UI/js/Form/Ox.Select.js | 31 +++++++++++ source/Ox.UI/js/Form/Ox.TimeInput.js | 14 +++++ source/Ox.UI/js/List/Ox.IconItem.js | 17 ++++++ source/Ox.UI/js/List/Ox.IconList.js | 57 ++++++++++++++++++++ source/Ox.UI/js/List/Ox.ItemInput.js | 16 ++++++ source/Ox.UI/js/List/Ox.List.js | 10 +++- source/Ox.UI/js/List/Ox.ListItem.js | 17 ++++++ source/Ox.UI/js/List/Ox.TextList.js | 15 ++++++ source/Ox.UI/js/Map/Ox.ListMap.js | 18 +++++++ source/Ox.UI/js/Map/Ox.MapImage.js | 16 +++--- source/Ox.UI/js/Map/Ox.MapMarker.js | 35 +++++++++++- source/Ox.UI/js/Map/Ox.MapMarkerImage.js | 12 ++++- source/Ox.UI/js/Map/Ox.MapPlace.js | 53 +++++++++++++++++- source/Ox.UI/js/Map/Ox.MapRectangle.js | 33 ++++++++++++ source/Ox.UI/js/Map/Ox.MapRectangleMarker.js | 21 ++++++++ source/Ox.UI/js/Menu/Ox.MainMenu.js | 30 +++++++++-- source/Ox.UI/js/Menu/Ox.Menu.js | 8 +-- source/Ox.UI/js/Menu/Ox.MenuItem.js | 22 +++++++- source/Ox.UI/js/Panel/Ox.CollapsePanel.js | 16 +++++- source/Ox.UI/js/Video/Ox.AnnotationPanel.js | 15 ++++++ source/Ox.UI/js/Video/Ox.VideoPlayer.js | 4 +- 42 files changed, 664 insertions(+), 93 deletions(-) diff --git a/source/Ox.UI/js/Bar/Ox.Resizebar.js b/source/Ox.UI/js/Bar/Ox.Resizebar.js index 4525f0fd..0ab7e843 100644 --- a/source/Ox.UI/js/Bar/Ox.Resizebar.js +++ b/source/Ox.UI/js/Bar/Ox.Resizebar.js @@ -5,15 +5,15 @@ Ox.Resizebar Resizebar (options) -> Resizebar object (options, self) -> Resizebar object options Options object - collapsed - collapsible - edge - elements - orientation - panel - resizeable - resize - size + 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 @*/ /** diff --git a/source/Ox.UI/js/Core/Ox.App.js b/source/Ox.UI/js/Core/Ox.App.js index ac379648..309779c5 100644 --- a/source/Ox.UI/js/Core/Ox.App.js +++ b/source/Ox.UI/js/Core/Ox.App.js @@ -7,7 +7,7 @@ Ox.App Basic application instance that communicates with a JSON API (options, self) -> App object options Options object timeout request timeout - type 'GET' or 'POST' + type HTTP Request type, i.e. 'GET' or 'POST' url JSON API url self Shared private variable load app loaded @@ -109,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 1cc87e54..0844db21 100644 --- a/source/Ox.UI/js/Core/Ox.Clipboard.js +++ b/source/Ox.UI/js/Core/Ox.Clipboard.js @@ -1,13 +1,13 @@ // vim: et:ts=4:sw=4:sts=4:ft=js /*@ -Ox.Clipboard Basic clipboard handler - () -> Clipboard object - (options) -> Clipboard object - (options, self) -> Clipboard object - copy(data) copy data to clipboard - paste paste data from clipboard - options Options object - self Shared private variable +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() { var clipboard = {}; diff --git a/source/Ox.UI/js/Core/Ox.Container.js b/source/Ox.UI/js/Core/Ox.Container.js index 7109ff54..5949f6dd 100644 --- a/source/Ox.UI/js/Core/Ox.Container.js +++ b/source/Ox.UI/js/Core/Ox.Container.js @@ -5,7 +5,7 @@ // would append (length - 1)? /*@ -Ox.Container Container +Ox.Container Container (depricated) () -> Container object (options) -> Container object (options, self) -> Container object diff --git a/source/Ox.UI/js/Core/Ox.DocPage.js b/source/Ox.UI/js/Core/Ox.DocPage.js index 024601d3..969ece78 100644 --- a/source/Ox.UI/js/Core/Ox.DocPage.js +++ b/source/Ox.UI/js/Core/Ox.DocPage.js @@ -4,6 +4,7 @@ Ox.DocPage DocPage (options) -> DocPage object (options, self) -> DocPage object options Options object + item doc item self Shared private variable @*/ Ox.DocPage = function(options, self) { 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 77520f83..9662624c 100644 --- a/source/Ox.UI/js/Core/Ox.LoadingIcon.js +++ b/source/Ox.UI/js/Core/Ox.LoadingIcon.js @@ -32,6 +32,7 @@ Ox.LoadingIcon = function(options, self) { }, 250); return that; }; + /*@ stop Stop loading animation () -> Loading Icon Element 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.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 6e600e38..a4deb3c6 100644 --- a/source/Ox.UI/js/Form/Ox.Form.js +++ b/source/Ox.UI/js/Form/Ox.Form.js @@ -8,8 +8,8 @@ Ox.Form Form Object options Options object error error id id - items [] - submit null + items [] + submit on submit function self shared private variable @*/ 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.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 ce07ce4f..f3bfcaab 100644 --- a/source/Ox.UI/js/Form/Ox.Picker.js +++ b/source/Ox.UI/js/Form/Ox.Picker.js @@ -5,7 +5,13 @@ Ox.Picker 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) { 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 ec912f50..e645ebec 100644 --- a/source/Ox.UI/js/Form/Ox.Range.js +++ b/source/Ox.UI/js/Form/Ox.Range.js @@ -16,10 +16,12 @@ Ox.Range Range Object thumbSize minimum width or height of thumb, in px thumbValue if true, display value on thumb trackGradient colors - trackImages or array one or multiple track background image URLs + 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) { 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 22b57c2b..a53f45e5 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -27,7 +27,15 @@ Ox.List List Element 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 @*/ 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.TextList.js b/source/Ox.UI/js/List/Ox.TextList.js index d7941118..548ba826 100644 --- a/source/Ox.UI/js/List/Ox.TextList.js +++ b/source/Ox.UI/js/List/Ox.TextList.js @@ -1,10 +1,25 @@ // 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 @*/ diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index fd08bc52..ac3fb627 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -6,6 +6,12 @@ Ox.ListMap ListMap Object (options) -> ListMap Object (options, self) -> ListMap Object options Options object + addPlace + height + labels + places + selected + width self shared private variable @*/ @@ -349,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') { @@ -362,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 ddc8c757..39bd3094 100644 --- a/source/Ox.UI/js/Map/Ox.MapImage.js +++ b/source/Ox.UI/js/Map/Ox.MapImage.js @@ -6,20 +6,16 @@ Ox.MapImage MapImage Object (options) -> MapImage Object (options, self) -> MapImage Object options Options object - self shared private variable + 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) { - /** - 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) - */ - var self = self || {}, that = new Ox.Element('', self) .defaults({ 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 5658424c..363410e4 100644 --- a/source/Ox.UI/js/Menu/Ox.MainMenu.js +++ b/source/Ox.UI/js/Menu/Ox.MainMenu.js @@ -6,9 +6,9 @@ Ox.MainMenu MainMenu Object (options) -> MainMenu Object (options, self) -> MainMenu Object options Options object - extras [] - menus [] - size medium + extras extra menus + menus submenus + size can be small, medium, large self shared private variable @*/ @@ -117,6 +117,9 @@ Ox.MainMenu = function(options, self) { }; + /*@ + checkItem checkItem + @*/ that.checkItem = function(id) { var ids = id.split('_'), itemId = ids.pop(), @@ -124,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({ @@ -137,6 +146,9 @@ Ox.MainMenu = function(options, self) { }); }; + /*@ + getItem getItem + @*/ that.getItem = function(id) { var ids = id.split('_'), item; @@ -152,6 +164,9 @@ Ox.MainMenu = function(options, self) { return item; }; + /*@ + getMenu getMenu + @*/ that.getMenu = function(id) { var ids = id.split('_'), menu; @@ -173,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 8fbe912a..eca75e8a 100644 --- a/source/Ox.UI/js/Menu/Ox.Menu.js +++ b/source/Ox.UI/js/Menu/Ox.Menu.js @@ -658,21 +658,21 @@ Ox.print(options) }; /*@ - removeItem + removeItem removeItem @*/ that.removeItem = function() { }; /*@ - selectFirstItem + selectFirstItem selectFirstItem @*/ that.selectFirstItem = function() { selectNextItem(); }; /*@ - showMenu + showMenu showMenu () -> Menu Object @*/ that.showMenu = function() { @@ -722,7 +722,7 @@ Ox.print(options) }; /*@ - toggelMenu + 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 e6b63f5c..74b7c14b 100644 --- a/source/Ox.UI/js/Menu/Ox.MenuItem.js +++ b/source/Ox.UI/js/Menu/Ox.MenuItem.js @@ -5,6 +5,17 @@ Ox.MenuItem 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 @*/ @@ -90,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 : '') @@ -105,6 +119,9 @@ Ox.MenuItem = function(options, self) { // toggle id and title }; + /*@ + toggelChecked toggleChecked + @*/ that.toggleChecked = function() { that.options({ checked: !self.options.checked @@ -114,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 86c6e365..63b49717 100644 --- a/source/Ox.UI/js/Panel/Ox.CollapsePanel.js +++ b/source/Ox.UI/js/Panel/Ox.CollapsePanel.js @@ -1,11 +1,15 @@ // vim: et:ts=4:sw=4:sts=4:ft=js /*@ -Ox.CollapsePanel CollapsePanel Object +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 @*/ @@ -76,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') { @@ -83,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/Video/Ox.AnnotationPanel.js b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js index 3c07a3e9..b36f6594 100644 --- a/source/Ox.UI/js/Video/Ox.AnnotationPanel.js +++ b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js @@ -6,6 +6,11 @@ Ox.AnnotationPanel 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 @*/ @@ -109,6 +114,9 @@ Ox.AnnotationPanel = function(options, self) { } + /*@ + addItem addItem + @*/ that.addItem = function(item) { var pos = 0; self.options.items.splice(pos, 0, item); @@ -116,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.VideoPlayer.js b/source/Ox.UI/js/Video/Ox.VideoPlayer.js index 7e02e999..c0e96da3 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 @@ -1285,4 +1287,4 @@ Ox.VideoPlayer = function(options, self) { return that; -}; \ No newline at end of file +};