From 8f948335ceaa315a92e133b47a05c80ec0204ce6 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Fri, 26 Sep 2014 14:49:38 +0200 Subject: [PATCH] UI.js: remove aliases --- source/Ox.UI/js/Core/UI.js | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/source/Ox.UI/js/Core/UI.js b/source/Ox.UI/js/Core/UI.js index c9539b86..2a33cc07 100644 --- a/source/Ox.UI/js/Core/UI.js +++ b/source/Ox.UI/js/Core/UI.js @@ -1,5 +1,20 @@ 'use strict'; +Ox.documentReady(function() { + // FIXME: use Ox.$foo everywhere! + //@ Ox.$body jQuery-wrapped body + Ox.$body = $('body'); + //@ Ox.$document jQuery-wrapped document + Ox.$document = $(document); + //@ Ox.$head jQuery-wrapped head + Ox.$head = $('head'); + //@ Ox.$window jQuery-wrapped window + Ox.$window = $(window); +}); + +//@ Ox.$elements Reference to all Ox Elements +Ox.$elements = {}; + //@ Ox.UI.DIMENSIONS 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 Path of Ox UI -Ox.UI_PATH = Ox.UI.PATH = Ox.PATH + 'Ox.UI/'; - -Ox.documentReady(function() { - // FIXME: use Ox.$foo everywhere! - //@ Ox.$body jQuery-wrapped body - Ox.$body = Ox.UI.$body = $('body'); - //@ Ox.$document jQuery-wrapped document - Ox.$document = Ox.UI.$document = $(document); - //@ Ox.$head jQuery-wrapped head - Ox.$head = Ox.UI.$head = $('head'); - //@ Ox.$window jQuery-wrapped window - Ox.$window = Ox.UI.$window = $(window); -}); - -//@ Ox.$elements Reference to all Ox Elements -Ox.$elements = Ox.UI.elements = {}; +Ox.UI.PATH = Ox.PATH + 'Ox.UI/'; /*@ Ox.UI.getImageData Returns properties of an Ox UI image (url) -> 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 Returns the URL of an Ox UI image color Color name or RGB values theme 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 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 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 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'); };