move Ox. etc. into Core/UI.js, re-add some aliases
This commit is contained in:
parent
9db80ffb65
commit
f2141d792d
1 changed files with 16 additions and 5 deletions
|
@ -38,6 +38,18 @@ Ox.SCROLLBAR_SIZE = Ox.UI.SCROLLBAR_SIZE = $.browser.webkit ? 8 : (function() {
|
||||||
//@ Ox.UI_PATH <str> Path of Ox UI
|
//@ Ox.UI_PATH <str> Path of Ox UI
|
||||||
Ox.UI_PATH = Ox.UI.PATH = Ox.PATH + '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 <o> Reference to all Ox Elements
|
||||||
Ox.$elements = Ox.UI.elements = {};
|
Ox.$elements = Ox.UI.elements = {};
|
||||||
|
|
||||||
|
@ -45,7 +57,7 @@ Ox.$elements = Ox.UI.elements = {};
|
||||||
Ox.getImageData <f> Returns properties of an Ox UI image
|
Ox.getImageData <f> Returns properties of an Ox UI image
|
||||||
(url) -> <s> Image Name
|
(url) -> <s> Image Name
|
||||||
@*/
|
@*/
|
||||||
Ox.getImageData = Ox.cache(function(url) {
|
Ox.getImageData = Ox.UI.getImageData = Ox.cache(function(url) {
|
||||||
var str = 'data:image/svg+xml;base64,';
|
var str = 'data:image/svg+xml;base64,';
|
||||||
return Ox.startsWith(url, str)
|
return Ox.startsWith(url, str)
|
||||||
? JSON.parse(atob(url.split(',')[1]).match(/<!--(.+?)-->/)[1])
|
? JSON.parse(atob(url.split(',')[1]).match(/<!--(.+?)-->/)[1])
|
||||||
|
@ -59,7 +71,7 @@ Ox.getImageURL <f> Returns the URL of an Ox UI image
|
||||||
color <s|[n]> Color name or RGB values
|
color <s|[n]> Color name or RGB values
|
||||||
theme <s> Theme name
|
theme <s> Theme name
|
||||||
@*/
|
@*/
|
||||||
Ox.getImageURL = Ox.cache(function(name, color, theme) {
|
Ox.getImageURL = Ox.UI.getImageURL = Ox.cache(function(name, color, theme) {
|
||||||
var colorName,
|
var colorName,
|
||||||
colors = {
|
colors = {
|
||||||
marker: {
|
marker: {
|
||||||
|
@ -108,13 +120,12 @@ Ox.getImageURL = Ox.cache(function(name, color, theme) {
|
||||||
});
|
});
|
||||||
|
|
||||||
//@ Ox.getOxElement <f> Returns the Ox.Element of a DOM element, or `undefined`
|
//@ Ox.getOxElement <f> Returns the Ox.Element of a DOM element, or `undefined`
|
||||||
Ox.getOxElement = function(element) {
|
Ox.getOxElement = Ox.UI.getOxElement = function(element) {
|
||||||
return Ox.$elements[$(element).data('oxid')];
|
return Ox.$elements[$(element).data('oxid')];
|
||||||
};
|
};
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
Ox.hideScreen <f> hide loading screen
|
Ox.hideScreen <f> Hide and remove Ox UI loading screen
|
||||||
() -> <u> hide loading screen
|
|
||||||
@*/
|
@*/
|
||||||
Ox.hideScreen = Ox.UI.hideLoadingScreen = function() {
|
Ox.hideScreen = Ox.UI.hideLoadingScreen = function() {
|
||||||
Ox.UILoadingScreen.hide();
|
Ox.UILoadingScreen.hide();
|
||||||
|
|
Loading…
Reference in a new issue