diff --git a/source/Ox.UI/Ox.UI.js b/source/Ox.UI/Ox.UI.js index fea47445..9c04cea4 100644 --- a/source/Ox.UI/Ox.UI.js +++ b/source/Ox.UI/Ox.UI.js @@ -58,9 +58,9 @@ Ox.load.UI = function(options, callback) { } }); - Ox.UI = {}; // FIXME: remove + Ox.UI = {}; - Ox.UILoadingScreen = (function() { + Ox.UI.LoadingScreen = (function() { var $body = Ox.$('body'), $screen = Ox.$('
') @@ -229,7 +229,7 @@ Ox.load.UI = function(options, callback) { Ox.documentReady(function() { Ox.$('body').addClass('OxTheme' + Ox.toTitleCase(options.theme)); - options.showScreen && Ox.UILoadingScreen.show(); + options.showScreen && Ox.UI.LoadingScreen.show(); }); loadUI(); @@ -276,7 +276,7 @@ Ox.load.UI = function(options, callback) { return false; }); if (options.showScreen && options.hideScreen) { - Ox.UILoadingScreen.hide(); + Ox.UI.LoadingScreen.hide(); } callback(browserSupported); }); diff --git a/source/Ox.UI/js/Bar/Bar.js b/source/Ox.UI/js/Bar/Bar.js index 55a23c40..1af93baf 100644 --- a/source/Ox.UI/js/Bar/Bar.js +++ b/source/Ox.UI/js/Bar/Bar.js @@ -18,7 +18,7 @@ Ox.Bar = function(options, self) { .options(options || {}) .addClass('OxBar Ox' + Ox.toTitleCase(self.options.orientation)); - self.dimensions = Ox.DIMENSIONS[self.options.orientation]; + self.dimensions = Ox.UI.DIMENSIONS[self.options.orientation]; that.css(self.dimensions[0], '100%') .css(self.dimensions[1], self.options.size + 'px'); diff --git a/source/Ox.UI/js/Bar/Resizebar.js b/source/Ox.UI/js/Bar/Resizebar.js index bda741ac..6613b9d0 100644 --- a/source/Ox.UI/js/Bar/Resizebar.js +++ b/source/Ox.UI/js/Bar/Resizebar.js @@ -66,8 +66,8 @@ Ox.Resizebar = function(options, self) { self.clientXY = self.options.orientation == 'horizontal' ? 'clientY' : 'clientX'; - self.dimensions = Ox.DIMENSIONS[self.options.orientation]; - self.edges = Ox.EDGES[self.options.orientation]; + self.dimensions = Ox.UI.DIMENSIONS[self.options.orientation]; + self.edges = Ox.UI.EDGES[self.options.orientation]; self.isLeftOrTop = self.options.edge == 'left' || self.options.edge == 'top'; that.css({cursor: getCursor()}); diff --git a/source/Ox.UI/js/Core/Element.js b/source/Ox.UI/js/Core/Element.js index 4179684d..aa7fa571 100644 --- a/source/Ox.UI/js/Core/Element.js +++ b/source/Ox.UI/js/Core/Element.js @@ -458,8 +458,8 @@ Ox.Element.prototype.childrenElements = function childrenElements() { return Ox.compact( Ox.slice(this.children()) - .filter(Ox.isOxElement) - .map(Ox.getOxElement) + .filter(Ox.UI.isElement) + .map(Ox.UI.getElement) ); }; @@ -498,7 +498,7 @@ @*/ Ox.Element.prototype.findElements = function findElements() { return Ox.compact( - Ox.slice(this.find('.OxElement')).map(Ox.getOxElement) + Ox.slice(this.find('.OxElement')).map(Ox.UI.getElement) ); }; @@ -551,7 +551,7 @@ @*/ Ox.Element.prototype.nextElements = function nextElements() { return Ox.compact( - this.nextAll().filter(Ox.isOxElement).map(Ox.getOxElement) + this.nextAll().filter(Ox.UI.isElement).map(Ox.UI.getElement) ); }; @@ -588,8 +588,8 @@ Ox.Element.prototype.parentElements = function parentElements() { return Ox.compact( Ox.slice(this.parents()) - .filter(Ox.isOxElement) - .map(Ox.getOxElement) + .filter(Ox.UI.isElement) + .map(Ox.UI.getElement) ); }; @@ -620,7 +620,7 @@ @*/ Ox.Element.prototype.prevElements = function prevElements() { return Ox.compact( - this.prevAll().filter(Ox.isOxElement).map(Ox.getOxElement) + this.prevAll().filter(Ox.UI.isElement).map(Ox.UI.getElement) ); }; @@ -698,8 +698,8 @@ Ox.Element.prototype.siblingElements = function siblingElements() { return Ox.compact( Ox.slice(this.siblings()) - .filter(Ox.isOxElement) - .map(Ox.getOxElement) + .filter(Ox.UI.isElement) + .map(Ox.UI.getElement) ); }; diff --git a/source/Ox.UI/js/Core/UI.js b/source/Ox.UI/js/Core/UI.js index 1ec116c8..ce82b445 100644 --- a/source/Ox.UI/js/Core/UI.js +++ b/source/Ox.UI/js/Core/UI.js @@ -1,18 +1,18 @@ 'use strict'; -//@ Ox.DIMENSIONS Names of horizontal and vertical dimensions +//@ Ox.UI.DIMENSIONS Names of horizontal and vertical dimensions Ox.DIMENSIONS = Ox.UI.DIMENSIONS = { horizontal: ['width', 'height'], vertical: ['height', 'width'] }; -//@ Ox.EDGES Names of horizontal and vertical edges +//@ Ox.UI.EDGES Names of horizontal and vertical edges Ox.EDGES = Ox.UI.EDGES = { horizontal: ['left', 'right', 'top', 'bottom'], vertical: ['top', 'bottom', 'left', 'right'] }; -//@ Ox.SCOLLBAR_SIZE Size of scrollbars +//@ Ox.UI.SCROLLBAR_SIZE Size of scrollbars Ox.SCROLLBAR_SIZE = Ox.UI.SCROLLBAR_SIZE = $.browser.webkit ? 8 : (function() { var inner = Ox.$('

').css({ height: '200px', @@ -35,7 +35,7 @@ Ox.SCROLLBAR_SIZE = Ox.UI.SCROLLBAR_SIZE = $.browser.webkit ? 8 : (function() { return width; })(); -//@ Ox.UI_PATH Path of Ox UI +//@ Ox.UI.PATH Path of Ox UI Ox.UI_PATH = Ox.UI.PATH = Ox.PATH + 'Ox.UI/'; Ox.documentReady(function() { @@ -54,7 +54,7 @@ Ox.documentReady(function() { Ox.$elements = Ox.UI.elements = {}; /*@ -Ox.getImageData Returns properties of an Ox UI image +Ox.UI.getImageData Returns properties of an Ox UI image (url) -> Image Name @*/ Ox.getImageData = Ox.UI.getImageData = Ox.cache(function(url) { @@ -65,7 +65,7 @@ Ox.getImageData = Ox.UI.getImageData = Ox.cache(function(url) { }); /*@ -Ox.getImageURL Returns the URL of an Ox UI image +Ox.UI.getImageURL Returns the URL of an Ox UI image (name[, color[, theme]]) -> Image URL name Image name color Color name or RGB values @@ -119,19 +119,19 @@ Ox.getImageURL = Ox.UI.getImageURL = Ox.cache(function(name, color, theme) { } }); -//@ Ox.getOxElement Returns the Ox.Element of a DOM element, or `undefined` -Ox.getOxElement = Ox.UI.getOxElement = function(element) { +//@ Ox.UI.getElement Returns the Ox.Element of a DOM element, or `undefined` +Ox.getOxElement = Ox.UI.getElement = Ox.UI.getOxElement = function(element) { return Ox.$elements[$(element).data('oxid')]; }; /*@ -Ox.hideScreen Hide and remove Ox UI loading screen +Ox.UI.hideScreen Hide and remove Ox UI loading screen @*/ -Ox.hideScreen = Ox.UI.hideLoadingScreen = function() { - Ox.UILoadingScreen.hide(); +Ox.hideScreen = Ox.UI.hideScreen = Ox.UI.hideLoadingScreen = function() { + Ox.UI.LoadingScreen.hide(); }; -//@ Ox.isOxElement Returns `true` if a DOM element is an Ox.Element -Ox.isOxElement = Ox.UI.isOxElement = function(element) { +//@ Ox.UI.isElement Returns `true` if a DOM element is an Ox.Element +Ox.isOxElement = Ox.UI.isElement = Ox.UI.isOxElement = function(element) { return !!$(element).data('oxid'); }; diff --git a/source/Ox.UI/js/Form/Editable.js b/source/Ox.UI/js/Form/Editable.js index 71edaac7..019e40aa 100644 --- a/source/Ox.UI/js/Form/Editable.js +++ b/source/Ox.UI/js/Form/Editable.js @@ -252,9 +252,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.SCROLLBAR_SIZE to prevent scrollbar from showing up + // +Ox.UI.SCROLLBAR_SIZE to prevent scrollbar from showing up if (self.options.type == 'textarea') { - width += Ox.SCROLLBAR_SIZE; + width += Ox.UI.SCROLLBAR_SIZE; } width = self.options.width || Ox.limit(width, self.minWidth, self.maxWidth); self.$test.css({display: 'none'}); diff --git a/source/Ox.UI/js/Form/InsertHTMLDialog.js b/source/Ox.UI/js/Form/InsertHTMLDialog.js index 698ba468..c637ec8d 100644 --- a/source/Ox.UI/js/Form/InsertHTMLDialog.js +++ b/source/Ox.UI/js/Form/InsertHTMLDialog.js @@ -202,7 +202,7 @@ Ox.InsertHTMLDialog = function(options, self) { height: 184, keys: {enter: 'insert', escape: 'cancel'}, title: Ox._('Insert HTML'), - width: 416 + Ox.SCROLLBAR_SIZE + width: 416 + Ox.UI.SCROLLBAR_SIZE }); function renderForm() { diff --git a/source/Ox.UI/js/List/CustomList.js b/source/Ox.UI/js/List/CustomList.js index efed2f2b..93d06324 100644 --- a/source/Ox.UI/js/List/CustomList.js +++ b/source/Ox.UI/js/List/CustomList.js @@ -34,7 +34,7 @@ Ox.CustomList = function(options, self) { self.$list.options({items: self.options.items}); }, itemWidth: function() { - var width = self.options.itemWidth - Ox.SCROLLBAR_SIZE; + var width = self.options.itemWidth - Ox.UI.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.SCROLLBAR_SIZE + data, self.options.itemWidth - Ox.UI.SCROLLBAR_SIZE ).addClass('OxTarget'); }, draggable: self.options.draggable, itemHeight: self.options.itemHeight, itemWidth: self.options.itemWidth - - self.options.scrollbarVisible * Ox.SCROLLBAR_SIZE, + - self.options.scrollbarVisible * Ox.UI.SCROLLBAR_SIZE, items: self.options.items, keys: self.options.keys.concat(self.options.unique), max: self.options.max, diff --git a/source/Ox.UI/js/List/InfoList.js b/source/Ox.UI/js/List/InfoList.js index 33ff242f..b3f5bf27 100644 --- a/source/Ox.UI/js/List/InfoList.js +++ b/source/Ox.UI/js/List/InfoList.js @@ -167,9 +167,9 @@ Ox.InfoList = function(options, self) { function getItemWidth(cached) { if (!cached) { - self.cachedWidth = that.width() - Ox.SCROLLBAR_SIZE; + self.cachedWidth = that.width() - Ox.UI.SCROLLBAR_SIZE; } else if (!self.cachedWidth || self.cachedWidthTime < +new Date() - 5000) { - self.cachedWidth = that.width() - Ox.SCROLLBAR_SIZE; + self.cachedWidth = that.width() - Ox.UI.SCROLLBAR_SIZE; self.cachedWidthTime = +new Date(); } return self.cachedWidth; diff --git a/source/Ox.UI/js/List/List.js b/source/Ox.UI/js/List/List.js index 6ff9c777..b5421c02 100644 --- a/source/Ox.UI/js/List/List.js +++ b/source/Ox.UI/js/List/List.js @@ -493,7 +493,7 @@ Ox.List = function(options, self) { if (self.$pages[0]) { if (self.options.type == 'text') { self.$pages[0].find('.OxEmpty').each(function() { - Ox.getOxElement($(this)).remove(); + Ox.UI.getElement($(this)).remove(); }); } else if (self.options.orientation == 'both') { that.$content.css({height: getListSize() + 'px'}); @@ -594,7 +594,7 @@ Ox.List = function(options, self) { return that.height() - ( !self.options.disableHorizontalScrolling && that.$content.width() > that.width() - ? Ox.SCROLLBAR_SIZE : 0 + ? Ox.UI.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.SCROLLBAR_SIZE : 0 + that.$content.height() > that.height() ? Ox.UI.SCROLLBAR_SIZE : 0 ); } diff --git a/source/Ox.UI/js/List/TableList.js b/source/Ox.UI/js/List/TableList.js index cb268806..e5d3f0af 100644 --- a/source/Ox.UI/js/List/TableList.js +++ b/source/Ox.UI/js/List/TableList.js @@ -206,7 +206,7 @@ Ox.TableList = function(options, self) { .addClass('OxHead') .css({ right: self.options.scrollbarVisible - ? Ox.SCROLLBAR_SIZE + 'px' : 0 + ? Ox.UI.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.SCROLLBAR_SIZE == 16 ? { + .css(Ox.UI.SCROLLBAR_SIZE == 16 ? { right: 0, width: '14px' } : { @@ -241,7 +241,7 @@ Ox.TableList = function(options, self) { }) .bindEvent('change', changeColumns) .appendTo(that.$bar); - Ox.SCROLLBAR_SIZE < 16 && $(that.$select.find('input')[0]).css({ + Ox.UI.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.SCROLLBAR_SIZE == 16 ? { + .css(Ox.UI.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.SCROLLBAR_SIZE : 0) + (self.options.scrollbarVisible ? Ox.UI.SCROLLBAR_SIZE : 0) ); } diff --git a/source/Ox.UI/js/List/TreeList.js b/source/Ox.UI/js/List/TreeList.js index c1e2d08e..73f5cda8 100644 --- a/source/Ox.UI/js/List/TreeList.js +++ b/source/Ox.UI/js/List/TreeList.js @@ -94,7 +94,7 @@ Ox.TreeList = function(options, self) { function constructItem(data) { var $item = $('

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