1
0
Fork 0
forked from 0x2620/oxjs

remove new for all Ox.Elements, dont declare arguments again, add some semicolons

This commit is contained in:
j 2011-06-19 19:48:32 +02:00
commit b27ed00356
69 changed files with 430 additions and 440 deletions

View file

@ -59,8 +59,8 @@ Ox.Input <f:Ox.Element> Input Element
Ox.Input = function(options, self) {
var self = self || {},
that = new Ox.Element({}, self)
self = self || {};
var that = Ox.Element({}, self)
.defaults({
arrows: false,
arrowStep: 1,
@ -133,7 +133,7 @@ Ox.Input = function(options, self) {
}
if (self.options.label) {
self.$label = new Ox.Label({
self.$label = Ox.Label({
overlap: 'right',
textAlign: 'right',
title: self.options.label,
@ -152,7 +152,7 @@ Ox.Input = function(options, self) {
if (self.options.arrows) {
self.arrows = [];
self.arrows[0] = [
new Ox.Button({
Ox.Button({
overlap: 'right',
title: 'left',
type: 'image'
@ -164,7 +164,7 @@ Ox.Input = function(options, self) {
clickArrow(0);
})
.appendTo(that),
new Ox.Button({
Ox.Button({
overlap: 'left',
title: 'right',
type: 'image'
@ -187,7 +187,7 @@ Ox.Input = function(options, self) {
});
if (self.options.clear) {
self.$button = new Ox.Button({
self.$button = Ox.Button({
overlap: 'left',
title: 'close',
type: 'image'
@ -401,7 +401,7 @@ Ox.Input = function(options, self) {
}
function constructAutocompleteMenu() {
var menu = new Ox.Menu({
var menu = Ox.Menu({
element: self.$input,
id: self.options.id + 'Menu', // fixme: we do this in other places ... are we doing it the same way? var name?,
offset: {
@ -908,8 +908,8 @@ Ox.Input_ = function(options, self) {
events:
*/
var self = self || {},
that = new Ox.Element({}, self)
self = self || {};
var that = Ox.Element({}, self)
.defaults({
autocomplete: null,
autocorrect: null,
@ -1066,7 +1066,7 @@ Ox.Input_ = function(options, self) {
self.options[self.keyName].forEach(function(key, keyPos) {
//Ox.print('keyPos key', keyPos, key)
if (self.keyName == 'label' && key.label.length == 1) {
that.$key[keyPos] = new Ox.Label({
that.$key[keyPos] = Ox.Label({
overlap: 'right',
title: key.label[0].title,
width: self.options.labelWidth
@ -1083,7 +1083,7 @@ Ox.Input_ = function(options, self) {
self.selectKeyId = self.options.id + Ox.toTitleCase(self.keyName) +
(self.options[self.keyName].length == 1 ? '' : keyPos);
//Ox.print('three', self.selectedKey, keyPos, self.selectedKey[keyPos]);
that.$key[keyPos] = new Ox.Select({
that.$key[keyPos] = Ox.Select({
id: self.selectKeyId,
items: $.map(key.label, function(value, valuePos) {
return {
@ -1107,7 +1107,7 @@ Ox.Input_ = function(options, self) {
}
if (self.options.clear) {
that.$clear = new Ox.Button({
that.$clear = Ox.Button({
overlap: 'left',
title: 'close',
type: 'image'
@ -1120,7 +1120,7 @@ Ox.Input_ = function(options, self) {
}
if (self.options.unit.length == 1) {
that.$unit = new Ox.Label({
that.$unit = Ox.Label({
overlap: 'left',
title: self.options.unit[0].title,
width: self.options.unitWidth
@ -1134,7 +1134,7 @@ Ox.Input_ = function(options, self) {
.appendTo(that);
} else if (self.options.unit.length > 1) {
self.selectUnitId = self.options.id + 'Unit';
that.$unit = new Ox.Select({
that.$unit = Ox.Select({
id: self.selectUnitId,
items: $.map(self.options.unit, function(unit, i) {
//Ox.print('unit', unit)
@ -1159,7 +1159,7 @@ Ox.Input_ = function(options, self) {
that.$separator = [];
self.options.value.forEach(function(v, i) {
if (i < self.values - 1) {
that.$separator[i] = new Ox.Label({
that.$separator[i] = Ox.Label({
textAlign: 'center',
title: self.options.separator[i],
width: self.options.separatorWidth[i] + 32
@ -1185,7 +1185,7 @@ Ox.Input_ = function(options, self) {
//self.margin -= (i == 0 ? 16 : self.options.value[i - 1].width)
//Ox.print('v:', v, 'id:', id)
if (self.options.type == 'select') {
that.$input[i] = new Ox.Select({
that.$input[i] = Ox.Select({
id: v.id,
items: v.items,
width: v.width
@ -1194,12 +1194,12 @@ Ox.Input_ = function(options, self) {
float: 'left'
});
} else if (self.options.type == 'range') {
that.$input[i] = new Ox.Range(v)
that.$input[i] = Ox.Range(v)
.css({
float: 'left'
});
} else {
that.$input[i] = new Ox.InputElement({
that.$input[i] = Ox.InputElement({
autocomplete: self.options.autocomplete[id],
autocorrect: self.options.autocorrect[id],
autosuggest: self.options.autosuggest[id],
@ -1339,8 +1339,8 @@ Ox.Input_ = function(options, self) {
Ox.InputElement_ = function(options, self) {
var self = self || {},
that = new Ox.Element(
self = self || {};
var that = Ox.Element(
options.type == 'textarea' ? 'textarea' : 'input', self
)
.defaults({
@ -1388,7 +1388,7 @@ Ox.InputElement_ = function(options, self) {
if (self.options.autosuggest) {
self.autosuggestId = self.options.id + 'Menu'; // fixme: we do this in other places ... are we doing it the same way? var name?
self.$autosuggestMenu = new Ox.Menu({
self.$autosuggestMenu = Ox.Menu({
element: that.$element,
id: self.autosuggestId,
offset: {
@ -1663,8 +1663,8 @@ Ox.Range_ = function(options, self) {
/*
init
*/
var self = self || {},
that = new Ox.Element({}, self)
self = self || {};
var that = Ox.Element({}, self)
.defaults({
animate: false,
arrows: false,
@ -1715,7 +1715,7 @@ Ox.Range_ = function(options, self) {
.click(clickArrowDec)
.appendTo(that.$element);
}
var $track = new Ox.Element()
var $track = Ox.Element()
.addClass('OxTrack')
.mousedown(clickTrack)
.appendTo(that.$element);