more documentation, more semicolons, some fixmes

This commit is contained in:
j 2012-05-21 21:23:16 +02:00
parent 509745407b
commit 520eac7a22
11 changed files with 56 additions and 25 deletions

View file

@ -1015,7 +1015,7 @@ Ox.Calendar = function(options, self) {
if (!Ox.isUndefined(line)) { if (!Ox.isUndefined(line)) {
scrollTo(line * 16 + 8 - self.$container.height() / 2, true); scrollTo(line * 16 + 8 - self.$container.height() / 2, true);
} }
}; }
function panToSelected() { function panToSelected() {
// fixme: '0' should zoom to selected if selected is already centered // fixme: '0' should zoom to selected if selected is already centered

View file

@ -1,9 +1,11 @@
'use strict'; 'use strict';
/*@ /*@
Ox.ListCalendar <f> ListCalendar object Ox.ListCalendar <function> List Calendar
(options[, self]) -> <o> List Calendar
options <o> Options
self <o> Shared private variable
@*/ @*/
// FIXME: should be Ox.CalendarEditor // FIXME: should be Ox.CalendarEditor
Ox.ListCalendar = function(options, self) { Ox.ListCalendar = function(options, self) {

View file

@ -4,6 +4,7 @@
Ox.Event <o> Basic event handler Ox.Event <o> Basic event handler
@*/ @*/
Ox.Event = (function() { Ox.Event = (function() {
var self = {}, that = {}; var self = {}, that = {};

View file

@ -2,9 +2,7 @@
/*@ /*@
Ox.JQueryElement <function> Wrapper for jQuery Ox.JQueryElement <function> Wrapper for jQuery
# Usage
($element) -> <object> Wrapped jQuery DOM element ($element) -> <object> Wrapped jQuery DOM element
# Arguments
$element <object> jQuery DOM Element $element <object> jQuery DOM Element
@*/ @*/

View file

@ -1,5 +0,0 @@
'use strict';
/**
Ox.Progressbar
*/
// FIXME: remove this!

View file

@ -1,7 +1,10 @@
'use strict'; 'use strict';
/*@ /*@
Ox.ArrayEditable <f> Array Editable Object Ox.ArrayEditable <function> Array Editable
(options, self) -> <f> Array Editable
options <o> Options object
self <o> Shared private variable
@*/ @*/
Ox.ArrayEditable = function(options, self) { Ox.ArrayEditable = function(options, self) {

View file

@ -1,7 +1,15 @@
'use strict'; 'use strict';
/*@ /*@
Ox.ArrayInput <f> Array input Ox.ArrayInput <function> Array input
(options, self) -> <f> Array input
options <o> Options object
label <s> string, ''
max <n> integer, maximum number of items, 0 for all
sort <b> fixme: this should probably be removed
value <[]> value
width <n|256> width
self <o> Shared private variable
@*/ @*/
Ox.ArrayInput = function(options, self) { Ox.ArrayInput = function(options, self) {

View file

@ -45,7 +45,7 @@ Ox.Filter = function(options, self) {
} else if (self.options.query.operator == '') { } else if (self.options.query.operator == '') {
self.options.query.operator = '&'; self.options.query.operator = '&';
} }
Ox.Log('Form', 'Ox.Filter self.options', self.options) Ox.Log('Form', 'Ox.Filter self.options', self.options);
self.conditionOperators = { self.conditionOperators = {
boolean: [ boolean: [

View file

@ -143,7 +143,7 @@ Ox.InputGroup = function(options, self) {
if (key == 'value') { if (key == 'value') {
setValue(); setValue();
} }
} };
// fixme: is this used? // fixme: is this used?
that.getInputById = function(id) { that.getInputById = function(id) {

View file

@ -308,7 +308,7 @@ Ox.TextList = function(options, self) {
(self.options.sort[0].operator == '+' ? '-' : '+') : (self.options.sort[0].operator == '+' ? '-' : '+') :
self.options.columns[i].operator, self.options.columns[i].operator,
map: self.options.columns[i].map map: self.options.columns[i].map
}] }];
updateColumn(); updateColumn();
// fixme: strangely, sorting the list blocks updating the column, // fixme: strangely, sorting the list blocks updating the column,
// so we use a timeout for now // so we use a timeout for now
@ -322,6 +322,7 @@ Ox.TextList = function(options, self) {
} }
function constructHead() { function constructHead() {
var pos;
self.$heads = []; self.$heads = [];
self.$titles = []; self.$titles = [];
self.$orderButtons = []; self.$orderButtons = [];
@ -354,7 +355,7 @@ Ox.TextList = function(options, self) {
dragend: function(data) { dragend: function(data) {
dragendColumn(column.id, data); dragendColumn(column.id, data);
} }
}) });
} }
self.$titles[i] = Ox.Element() self.$titles[i] = Ox.Element()
.addClass('OxTitle') .addClass('OxTitle')
@ -368,7 +369,7 @@ Ox.TextList = function(options, self) {
$('<img>').attr({ $('<img>').attr({
src: Ox.UI.getImageURL('symbol' + Ox.toTitleCase(column.titleImage)) src: Ox.UI.getImageURL('symbol' + Ox.toTitleCase(column.titleImage))
}) })
) );
} else { } else {
self.$titles[i].html(column.title); self.$titles[i].html(column.title);
} }
@ -413,9 +414,10 @@ Ox.TextList = function(options, self) {
that.$head.$content.css({ that.$head.$content.css({
width: (Ox.sum(self.columnWidths) + 2) + 'px' width: (Ox.sum(self.columnWidths) + 2) + 'px'
}); });
if (getColumnPositionById(self.options.columns[self.selectedColumn].id) > -1) { // fixme: save in var pos = getColumnPositionById(self.options.columns[self.selectedColumn].id);
if (pos > -1) {
toggleSelected(self.options.columns[self.selectedColumn].id); toggleSelected(self.options.columns[self.selectedColumn].id);
self.$titles[getColumnPositionById(self.options.columns[self.selectedColumn].id)].css({ self.$titles[pos].css({
width: (self.options.columns[self.selectedColumn].width - 25) + 'px' width: (self.options.columns[self.selectedColumn].width - 25) + 'px'
}); });
} }
@ -878,7 +880,8 @@ Ox.TextList = function(options, self) {
submit: submit submit: submit
}) })
.appendTo($cell); .appendTo($cell);
// fixme: why do we need a timeout? // use timeout to prevent key to be inserted
// into $input if triggered via keyboard shortcut
setTimeout(function() { setTimeout(function() {
$input.focusInput(select); $input.focusInput(select);
}, 0); }, 0);
@ -897,7 +900,7 @@ Ox.TextList = function(options, self) {
value: value value: value
}); });
} }
} };
/*@ /*@
gainFocus <f> gainFocus gainFocus <f> gainFocus
@ -955,7 +958,7 @@ Ox.TextList = function(options, self) {
that.resizeColumn = function(id, width) { that.resizeColumn = function(id, width) {
resizeColumn(id, width); resizeColumn(id, width);
return that; return that;
} };
/*@ /*@
size <f> size size <f> size
@ -963,7 +966,7 @@ Ox.TextList = function(options, self) {
that.size = function() { that.size = function() {
setWidth(); setWidth();
that.$body.size(); that.$body.size();
} };
// fixme: deprecated // fixme: deprecated
that.sortList = function(key, operator) { that.sortList = function(key, operator) {
@ -1031,7 +1034,7 @@ Ox.TextList = function(options, self) {
} }
return that; return that;
} }
} };
return that; return that;

View file

@ -2,6 +2,27 @@
/*@ /*@
Ox.AnnotationPanel <f> Video Annotation Panel Ox.AnnotationPanel <f> Video Annotation Panel
() -> <f> AnnotationPanel Object
(options) -> <f> AnnotationPanel Object
(options, self) -> <f> AnnotationPanel Object
options <o> Options object
calendarSize <n|256> calendar size
clickLink <f|null> click link callback
editable: <b|false> if true, annotations can be edited
font <s|'small'> small, medium, large
highlight <s|''> highlight given string in annotations
layers <a|[]> array with annotation objects
mapSize <n|256> map size
range <s|'all'> all, position, selection
selected <s|''> selected annotation
showCalendar <b|false> if true, calendar is shown
showFonts <b|false> if true, option to select font size is show
showLayers <o|{}> object with layers to show
showMap <b|false> if true, show map
showUsers <b|false> if true show user
sort <s|'position'> position, start, text
width <n|256> panel width
self <o> shared private variable
@*/ @*/
Ox.AnnotationPanel = function(options, self) { Ox.AnnotationPanel = function(options, self) {