UI.js: remove aliases

This commit is contained in:
rlx 2014-09-26 14:49:38 +02:00
parent 552aba4271
commit 8f948335ce

View file

@ -1,5 +1,20 @@
'use strict';
Ox.documentReady(function() {
// FIXME: use Ox.$foo everywhere!
//@ Ox.$body <o> jQuery-wrapped body
Ox.$body = $('body');
//@ Ox.$document <o> jQuery-wrapped document
Ox.$document = $(document);
//@ Ox.$head <o> jQuery-wrapped head
Ox.$head = $('head');
//@ Ox.$window <o> jQuery-wrapped window
Ox.$window = $(window);
});
//@ Ox.$elements <o> Reference to all Ox Elements
Ox.$elements = {};
//@ Ox.UI.DIMENSIONS <o> Names of horizontal and vertical dimensions
Ox.DIMENSIONS = Ox.UI.DIMENSIONS = {
horizontal: ['width', 'height'],
@ -36,28 +51,13 @@ Ox.SCROLLBAR_SIZE = Ox.UI.SCROLLBAR_SIZE = $.browser.webkit ? 8 : (function() {
})();
//@ Ox.UI.PATH <str> Path of Ox UI
Ox.UI_PATH = Ox.UI.PATH = Ox.PATH + 'Ox.UI/';
Ox.documentReady(function() {
// FIXME: use Ox.$foo everywhere!
//@ Ox.$body <o> jQuery-wrapped body
Ox.$body = Ox.UI.$body = $('body');
//@ Ox.$document <o> jQuery-wrapped document
Ox.$document = Ox.UI.$document = $(document);
//@ Ox.$head <o> jQuery-wrapped head
Ox.$head = Ox.UI.$head = $('head');
//@ Ox.$window <o> jQuery-wrapped window
Ox.$window = Ox.UI.$window = $(window);
});
//@ Ox.$elements <o> Reference to all Ox Elements
Ox.$elements = Ox.UI.elements = {};
Ox.UI.PATH = Ox.PATH + 'Ox.UI/';
/*@
Ox.UI.getImageData <f> Returns properties of an Ox UI image
(url) -> <s> Image Name
@*/
Ox.getImageData = Ox.UI.getImageData = Ox.cache(function(url) {
Ox.UI.getImageData = Ox.cache(function(url) {
var str = 'data:image/svg+xml;base64,';
return Ox.startsWith(url, str)
? JSON.parse(atob(url.split(',')[1]).match(/<!--(.+?)-->/)[1])
@ -71,7 +71,7 @@ Ox.UI.getImageURL <f> Returns the URL of an Ox UI image
color <s|[n]> Color name or RGB values
theme <s> Theme name
@*/
Ox.getImageURL = Ox.UI.getImageURL = Ox.cache(function(name, color, theme) {
Ox.UI.getImageURL = Ox.cache(function(name, color, theme) {
var colorName,
colors = {
marker: {
@ -120,18 +120,18 @@ Ox.getImageURL = Ox.UI.getImageURL = Ox.cache(function(name, color, theme) {
});
//@ Ox.UI.getElement <f> Returns the Ox.Element of a DOM element, or `undefined`
Ox.getOxElement = Ox.UI.getElement = Ox.UI.getOxElement = function(element) {
Ox.UI.getElement = function(element) {
return Ox.$elements[$(element).data('oxid')];
};
/*@
Ox.UI.hideScreen <f> Hide and remove Ox UI loading screen
@*/
Ox.hideScreen = Ox.UI.hideScreen = Ox.UI.hideLoadingScreen = function() {
Ox.UI.hideScreen = function() {
Ox.UI.LoadingScreen.hide();
};
//@ Ox.UI.isElement <f> Returns `true` if a DOM element is an Ox.Element
Ox.isOxElement = Ox.UI.isElement = Ox.UI.isOxElement = function(element) {
Ox.UI.isElement = function(element) {
return !!$(element).data('oxid');
};