document Ox.UI and include in index.json

This commit is contained in:
j 2012-06-13 14:15:27 +02:00
parent 9d877800b4
commit 3087b0637d
2 changed files with 28 additions and 5 deletions

View file

@ -258,9 +258,13 @@ Ox.load.UI = function(options, callback) {
function initUI() {
//@ Ox.UI <o> Object with various UI properties and methods
//@ 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() {
var callbacks = [];
$(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 = {
horizontal: ['width', 'height'],
vertical: ['height', 'width']
};
//@ Ox.UI.EDGES <o> horizontal, vertical edges
Ox.UI.EDGES = {
horizontal: ['left', 'right', 'top', 'bottom'],
vertical: ['top', 'bottom', 'left', 'right']
};
//@ Ox.UI.elements <o> reference to all UI element instnaces
Ox.UI.elements = {};
/*@
Ox.UI.getImageName <f> get image name from url
(url) -> <s> Image Name
@*/
Ox.UI.getImageName = function(url) {
return imageNames[url];
};
/*@
getImageURL <f> Returns an image URL
Ox.UI.getImageURL <f> Returns an image URL
(name[, theme[, color]]) -> <s> Image URL
Setting color works only when the `loadImages` option is set to
`true`.
@ -324,6 +334,11 @@ Ox.load.UI = function(options, callback) {
}
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) {
var aliases = {
'mp4': 'h264',
@ -353,6 +368,10 @@ Ox.load.UI = function(options, callback) {
});
return format;
};
/*@
Ox.UI.hideLoadingScreen <f> hide loading screen
() -> <u> hide loading screen
@*/
Ox.UI.hideLoadingScreen = function() {
//Ox.print('hideLoadingScreen')
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
(obj) -> <b> True if object is an Ox.Element
@ -379,8 +397,11 @@ Ox.load.UI = function(options, callback) {
Ox.UI.isElement = function(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.SCOLLBAR_SIZE <str> size of scrollbar
Ox.UI.SCROLLBAR_SIZE = $.browser.mozilla ? 16 : 12;
//@ Ox.UI.getBarSize <s> get bar size by name
// fixme: the follwing should be deprecated
Ox.UI.getBarSize = function(size) {
var sizes = {
@ -390,6 +411,7 @@ Ox.load.UI = function(options, callback) {
};
return sizes[size];
};
//@ Ox.UI.symbols <o> unicode symbols
Ox.UI.symbols = {
alt: '\u2325',
apple: '\uF8FF',

View file

@ -158,7 +158,8 @@ def build_oxjs(downloads=False, geo=False):
write_file(build_path + 'Ox.UI/json/Ox.UI.files.json', files)
files = json.dumps(sorted(ui_files['dev']), indent=4)
write_file(dev_path + 'Ox.UI/json/Ox.UI.files.json', files)
ui_files['dev'].append('Ox.UI/Ox.UI.js')
# index
data = {
# sum(list, []) is flatten