document Ox.UI and include in index.json
This commit is contained in:
parent
9d877800b4
commit
3087b0637d
2 changed files with 28 additions and 5 deletions
|
@ -258,9 +258,13 @@ Ox.load.UI = function(options, callback) {
|
||||||
|
|
||||||
function initUI() {
|
function initUI() {
|
||||||
|
|
||||||
//@ Ox.UI <o> Object with various UI properties and methods
|
//@ UI
|
||||||
Ox.UI = {};
|
Ox.UI = {};
|
||||||
|
|
||||||
|
/*@
|
||||||
|
Ox.UI.ready <f> queue callback to be called once UI is ready
|
||||||
|
(callback) -> <u> call callback later
|
||||||
|
@*/
|
||||||
Ox.UI.ready = (function() {
|
Ox.UI.ready = (function() {
|
||||||
var callbacks = [];
|
var callbacks = [];
|
||||||
$(function() {
|
$(function() {
|
||||||
|
@ -287,21 +291,27 @@ Ox.load.UI = function(options, callback) {
|
||||||
}
|
}
|
||||||
}());
|
}());
|
||||||
|
|
||||||
Ox.UI.DEFAULT_THEME = 'classic'; // fixme: needed?
|
//@ Ox.UI.DIMENSIONS <o> horizontal, vertical dimensions
|
||||||
Ox.UI.DIMENSIONS = {
|
Ox.UI.DIMENSIONS = {
|
||||||
horizontal: ['width', 'height'],
|
horizontal: ['width', 'height'],
|
||||||
vertical: ['height', 'width']
|
vertical: ['height', 'width']
|
||||||
};
|
};
|
||||||
|
//@ Ox.UI.EDGES <o> horizontal, vertical edges
|
||||||
Ox.UI.EDGES = {
|
Ox.UI.EDGES = {
|
||||||
horizontal: ['left', 'right', 'top', 'bottom'],
|
horizontal: ['left', 'right', 'top', 'bottom'],
|
||||||
vertical: ['top', 'bottom', 'left', 'right']
|
vertical: ['top', 'bottom', 'left', 'right']
|
||||||
};
|
};
|
||||||
|
//@ Ox.UI.elements <o> reference to all UI element instnaces
|
||||||
Ox.UI.elements = {};
|
Ox.UI.elements = {};
|
||||||
|
/*@
|
||||||
|
Ox.UI.getImageName <f> get image name from url
|
||||||
|
(url) -> <s> Image Name
|
||||||
|
@*/
|
||||||
Ox.UI.getImageName = function(url) {
|
Ox.UI.getImageName = function(url) {
|
||||||
return imageNames[url];
|
return imageNames[url];
|
||||||
};
|
};
|
||||||
/*@
|
/*@
|
||||||
getImageURL <f> Returns an image URL
|
Ox.UI.getImageURL <f> Returns an image URL
|
||||||
(name[, theme[, color]]) -> <s> Image URL
|
(name[, theme[, color]]) -> <s> Image URL
|
||||||
Setting color works only when the `loadImages` option is set to
|
Setting color works only when the `loadImages` option is set to
|
||||||
`true`.
|
`true`.
|
||||||
|
@ -324,6 +334,11 @@ Ox.load.UI = function(options, callback) {
|
||||||
}
|
}
|
||||||
return imageURL;
|
return imageURL;
|
||||||
};
|
};
|
||||||
|
/*@
|
||||||
|
Ox.UI.getVideoFormat <f> Get supported video formats
|
||||||
|
(formats) -> <a> of supported formats
|
||||||
|
formats <a> list of available formats
|
||||||
|
@*/
|
||||||
Ox.UI.getVideoFormat = function(formats) {
|
Ox.UI.getVideoFormat = function(formats) {
|
||||||
var aliases = {
|
var aliases = {
|
||||||
'mp4': 'h264',
|
'mp4': 'h264',
|
||||||
|
@ -353,6 +368,10 @@ Ox.load.UI = function(options, callback) {
|
||||||
});
|
});
|
||||||
return format;
|
return format;
|
||||||
};
|
};
|
||||||
|
/*@
|
||||||
|
Ox.UI.hideLoadingScreen <f> hide loading screen
|
||||||
|
() -> <u> hide loading screen
|
||||||
|
@*/
|
||||||
Ox.UI.hideLoadingScreen = function() {
|
Ox.UI.hideLoadingScreen = function() {
|
||||||
//Ox.print('hideLoadingScreen')
|
//Ox.print('hideLoadingScreen')
|
||||||
var $div = $('.OxLoadingScreen'),
|
var $div = $('.OxLoadingScreen'),
|
||||||
|
@ -371,7 +390,6 @@ Ox.load.UI = function(options, callback) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
Ox.UI.IMAGE_CACHE = [];
|
|
||||||
/*@
|
/*@
|
||||||
Ox.UI.isElement <f> Checks if an object is an Ox.Element
|
Ox.UI.isElement <f> Checks if an object is an Ox.Element
|
||||||
(obj) -> <b> True if object is an Ox.Element
|
(obj) -> <b> True if object is an Ox.Element
|
||||||
|
@ -379,8 +397,11 @@ Ox.load.UI = function(options, callback) {
|
||||||
Ox.UI.isElement = function(object) {
|
Ox.UI.isElement = function(object) {
|
||||||
return Ox.isObject(object) && 'oxid' in object;
|
return Ox.isObject(object) && 'oxid' in object;
|
||||||
};
|
};
|
||||||
|
//@ Ox.UI.PATH <str> Path of Ox.UI
|
||||||
Ox.UI.PATH = Ox.PATH + 'Ox.UI/';
|
Ox.UI.PATH = Ox.PATH + 'Ox.UI/';
|
||||||
|
//@ Ox.UI.SCOLLBAR_SIZE <str> size of scrollbar
|
||||||
Ox.UI.SCROLLBAR_SIZE = $.browser.mozilla ? 16 : 12;
|
Ox.UI.SCROLLBAR_SIZE = $.browser.mozilla ? 16 : 12;
|
||||||
|
//@ Ox.UI.getBarSize <s> get bar size by name
|
||||||
// fixme: the follwing should be deprecated
|
// fixme: the follwing should be deprecated
|
||||||
Ox.UI.getBarSize = function(size) {
|
Ox.UI.getBarSize = function(size) {
|
||||||
var sizes = {
|
var sizes = {
|
||||||
|
@ -390,6 +411,7 @@ Ox.load.UI = function(options, callback) {
|
||||||
};
|
};
|
||||||
return sizes[size];
|
return sizes[size];
|
||||||
};
|
};
|
||||||
|
//@ Ox.UI.symbols <o> unicode symbols
|
||||||
Ox.UI.symbols = {
|
Ox.UI.symbols = {
|
||||||
alt: '\u2325',
|
alt: '\u2325',
|
||||||
apple: '\uF8FF',
|
apple: '\uF8FF',
|
||||||
|
|
|
@ -159,6 +159,7 @@ def build_oxjs(downloads=False, geo=False):
|
||||||
files = json.dumps(sorted(ui_files['dev']), indent=4)
|
files = json.dumps(sorted(ui_files['dev']), indent=4)
|
||||||
write_file(dev_path + 'Ox.UI/json/Ox.UI.files.json', files)
|
write_file(dev_path + 'Ox.UI/json/Ox.UI.files.json', files)
|
||||||
|
|
||||||
|
ui_files['dev'].append('Ox.UI/Ox.UI.js')
|
||||||
# index
|
# index
|
||||||
data = {
|
data = {
|
||||||
# sum(list, []) is flatten
|
# sum(list, []) is flatten
|
||||||
|
|
Loading…
Reference in a new issue