Ox.UI -> Ox

This commit is contained in:
rlx 2014-09-25 18:35:17 +02:00
parent eaaa8602e7
commit 775aa607c8
13 changed files with 31 additions and 31 deletions

View file

@ -586,7 +586,7 @@ Ox.load(/^https?:\/\/(www\.)?oxjs\.org\//.test(
var $item = $('<div>')
.addClass('item')
.attr({id: item.id})
.css({width: 224 - Ox.UI.SCROLLBAR_SIZE + 'px'})
.css({width: 224 - Ox.SCROLLBAR_SIZE + 'px'})
.appendTo($list);
$('<div>')
.addClass('OxSerif title')

View file

@ -18,7 +18,7 @@ Ox.Bar = function(options, self) {
.options(options || {})
.addClass('OxBar Ox' + Ox.toTitleCase(self.options.orientation));
self.dimensions = Ox.UI.DIMENSIONS[self.options.orientation];
self.dimensions = Ox.DIMENSIONS[self.options.orientation];
that.css(self.dimensions[0], '100%')
.css(self.dimensions[1], self.options.size + 'px');

View file

@ -66,8 +66,8 @@ Ox.Resizebar = function(options, self) {
self.clientXY = self.options.orientation == 'horizontal'
? 'clientY' : 'clientX';
self.dimensions = Ox.UI.DIMENSIONS[self.options.orientation];
self.edges = Ox.UI.EDGES[self.options.orientation];
self.dimensions = Ox.DIMENSIONS[self.options.orientation];
self.edges = Ox.EDGES[self.options.orientation];
self.isLeftOrTop = self.options.edge == 'left' || self.options.edge == 'top';
that.css({cursor: getCursor()});

View file

@ -249,9 +249,9 @@ Ox.Editable = function(options, self) {
self.$test.css({display: 'inline-block'});
height = self.options.height || Ox.limit(self.$test.height(), self.minHeight, self.maxHeight);
width = self.$test.width();
// +Ox.UI.SCROLLBAR_SIZE to prevent scrollbar from showing up
// +Ox.SCROLLBAR_SIZE to prevent scrollbar from showing up
if (self.options.type == 'textarea') {
width += Ox.UI.SCROLLBAR_SIZE;
width += Ox.SCROLLBAR_SIZE;
}
width = self.options.width || Ox.limit(width, self.minWidth, self.maxWidth);
self.$test.css({display: 'none'});

View file

@ -650,7 +650,7 @@ Ox.Input = function(options, self) {
self.options.autovalidate && autovalidate(true);
self.options.placeholder && setPlaceholder();
self.options.validate && validate();
self.bindKeyboard && Ox.UI.$document.off('keydown', keydown);
self.bindKeyboard && Ox.$document.off('keydown', keydown);
if (!self.cancelled && !self.submitted) {
that.triggerEvent('blur', {value: self.options.value});
self.options.value !== self.originalValue && that.triggerEvent('change', {
@ -782,8 +782,8 @@ Ox.Input = function(options, self) {
self.options.placeholder && setPlaceholder();
if (self.bindKeyboard) {
// fixme: different in webkit and firefox (?), see keyboard handler, need generic function
Ox.UI.$document.keydown(keydown);
//Ox.UI.$document.keypress(keypress);
Ox.$document.keydown(keydown);
//Ox.$document.keypress(keypress);
// temporarily disabled autocomplete on focus
//self.options.autocompleteSelect && setTimeout(autocomplete, 0); // fixme: why is the timeout needed?
}

View file

@ -202,7 +202,7 @@ Ox.InsertHTMLDialog = function(options, self) {
height: 184,
keys: {enter: 'insert', escape: 'cancel'},
title: Ox._('Insert HTML'),
width: 416 + Ox.UI.SCROLLBAR_SIZE
width: 416 + Ox.SCROLLBAR_SIZE
});
function renderForm() {

View file

@ -34,7 +34,7 @@ Ox.CustomList = function(options, self) {
self.$list.options({items: self.options.items});
},
itemWidth: function() {
var width = self.options.itemWidth - Ox.UI.SCROLLBAR_SIZE;
var width = self.options.itemWidth - Ox.SCROLLBAR_SIZE;
if (self.options.resize) {
that.find('.OxItem').each(function(element) {
self.options.resize($(this), width);
@ -58,13 +58,13 @@ Ox.CustomList = function(options, self) {
self.$list = Ox.List({
construct: function(data) {
return self.options.item(
data, self.options.itemWidth - Ox.UI.SCROLLBAR_SIZE
data, self.options.itemWidth - Ox.SCROLLBAR_SIZE
).addClass('OxTarget');
},
draggable: self.options.draggable,
itemHeight: self.options.itemHeight,
itemWidth: self.options.itemWidth
- self.options.scrollbarVisible * Ox.UI.SCROLLBAR_SIZE,
- self.options.scrollbarVisible * Ox.SCROLLBAR_SIZE,
items: self.options.items,
keys: self.options.keys.concat(self.options.unique),
max: self.options.max,

View file

@ -46,7 +46,7 @@ Ox.IconItem = function(options, self) {
infoIsObject: Ox.isObject(self.options.info),
lineLength: self.options.itemWidth == 64 ? 15 : 23,
lines: self.options.itemWidth == 64 ? 4 : 5,
url: Ox.UI.PATH + 'png/transparent.png'
url: Ox.UI_PATH + 'png/transparent.png'
});
self.title = formatText(self.options.title, self.lines - 1 - self.infoIsObject, self.lineLength);

View file

@ -167,9 +167,9 @@ Ox.InfoList = function(options, self) {
function getItemWidth(cached) {
if (!cached) {
self.cachedWidth = self.$list.width() - Ox.UI.SCROLLBAR_SIZE;
self.cachedWidth = self.$list.width() - Ox.SCROLLBAR_SIZE;
} else if (!self.cachedWidth || self.cachedWidthTime < +new Date() - 5000) {
self.cachedWidth = self.$list.width() - Ox.UI.SCROLLBAR_SIZE;
self.cachedWidth = self.$list.width() - Ox.SCROLLBAR_SIZE;
self.cachedWidthTime = +new Date();
}
return self.cachedWidth;

View file

@ -594,7 +594,7 @@ Ox.List = function(options, self) {
return that.height() - (
!self.options.disableHorizontalScrolling
&& that.$content.width() > that.width()
? Ox.UI.SCROLLBAR_SIZE : 0
? Ox.SCROLLBAR_SIZE : 0
);
}
@ -782,7 +782,7 @@ Ox.List = function(options, self) {
function getWidth() {
//Ox.Log('List', 'LIST THAT.WIDTH()', that.width())
return that.width() - (
that.$content.height() > that.height() ? Ox.UI.SCROLLBAR_SIZE : 0
that.$content.height() > that.height() ? Ox.SCROLLBAR_SIZE : 0
);
}

View file

@ -206,7 +206,7 @@ Ox.TableList = function(options, self) {
.addClass('OxHead')
.css({
right: self.options.scrollbarVisible
? Ox.UI.SCROLLBAR_SIZE + 'px' : 0
? Ox.SCROLLBAR_SIZE + 'px' : 0
})
.appendTo(that.$bar);
that.$head.$content.addClass('OxTitles');
@ -232,7 +232,7 @@ Ox.TableList = function(options, self) {
return column.id;
})
})
.css(Ox.UI.SCROLLBAR_SIZE == 16 ? {
.css(Ox.SCROLLBAR_SIZE == 16 ? {
right: 0,
width: '14px'
} : {
@ -241,7 +241,7 @@ Ox.TableList = function(options, self) {
})
.bindEvent('change', changeColumns)
.appendTo(that.$bar);
Ox.UI.SCROLLBAR_SIZE < 16 && $(that.$select.find('input')[0]).css({
Ox.SCROLLBAR_SIZE < 16 && $(that.$select.find('input')[0]).css({
marginRight: '-3px',
marginTop: '1px',
width: '8px',
@ -254,7 +254,7 @@ Ox.TableList = function(options, self) {
})
.addClass('OxClear')
.attr({src: Ox.getImageURL('symbolClose')})
.css(Ox.UI.SCROLLBAR_SIZE == 16 ? {
.css(Ox.SCROLLBAR_SIZE == 16 ? {
paddingLeft: '4px',
paddingRight: '2px',
marginRight: 0
@ -777,7 +777,7 @@ Ox.TableList = function(options, self) {
return Math.max(
Ox.sum(self.columnWidths),
self.cachedWidth -
(self.options.scrollbarVisible ? Ox.UI.SCROLLBAR_SIZE : 0)
(self.options.scrollbarVisible ? Ox.SCROLLBAR_SIZE : 0)
);
}
@ -950,14 +950,14 @@ Ox.TableList = function(options, self) {
// FIXME: not yet used
that.$body.find('img').each(function(i, element) {
var $element = $(element),
data = Ox.UI.getImageData($element.attr('src'));
data = Ox.getImageData($element.attr('src'));
if (data && data.color == 'selected') {
$element.attr({src: Ox.getImageURL(data.name, 'default')});
}
});
that.$body.find('.OxSelected img').each(function(i, element) {
var $element = $(element),
data = Ox.UI.getImageData($element.attr('src'));
data = Ox.getImageData($element.attr('src'));
if (data && data.color == 'default') {
$element.attr({src: Ox.getImageURL(data.name, 'selected')});
}

View file

@ -94,7 +94,7 @@ Ox.TreeList = function(options, self) {
function constructItem(data) {
var $item = $('<div>').css({
width: self.options.width == 'auto' ? '100%'
: self.options.width - Ox.UI.SCROLLBAR_SIZE + 'px'
: self.options.width - Ox.SCROLLBAR_SIZE + 'px'
}),
$cell = $('<div>').addClass('OxCell').css({width: '8px'}),
$icon = data.id ? getIcon(data.id, data.expanded || (
@ -112,7 +112,7 @@ Ox.TreeList = function(options, self) {
$('<div>')
.addClass('OxCell OxTarget')
.css({
width: self.options.width - padding - 32 - Ox.UI.SCROLLBAR_SIZE + 'px'
width: self.options.width - padding - 32 - Ox.SCROLLBAR_SIZE + 'px'
})
.html(data.title || '')
.appendTo($item);

View file

@ -788,7 +788,7 @@ Ox.Menu = function(options, self) {
if (!that.is(':hidden')) {
return;
}
that.parent().length == 0 && that.appendTo(Ox.UI.$body);
that.parent().length == 0 && that.appendTo(Ox.$body);
that.css({
left: '-1000px',
top: '-1000px'
@ -797,13 +797,13 @@ Ox.Menu = function(options, self) {
width = self.options.element.outerWidth(),
height = self.options.element.outerHeight(),
menuWidth = that.width(),
windowWidth = Ox.UI.$window.width(),
windowHeight = Ox.UI.$window.height(),
windowWidth = Ox.$window.width(),
windowHeight = Ox.$window.height(),
left = offset.left + self.options.offset.left + (self.options.edge == 'bottom' ? 0 : width),
right,
top = offset.top + self.options.offset.top + (self.options.edge == 'bottom' ? height : 0),
menuHeight = that.$content.outerHeight(), // fixme: why is outerHeight 0 when hidden?
menuMaxHeight = Math.floor(Ox.UI.$window.height() - top - 16);
menuMaxHeight = Math.floor(Ox.$window.height() - top - 16);
if (self.options.edge == 'bottom' && left + menuWidth > windowWidth) {
left = offset.left + width - menuWidth;
that.is('.OxRight') && that.removeClass('OxRight') && that.addClass('OxLeft');