From 3087b0637d58892c7c08d3bc8ba355972225afe3 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 13 Jun 2012 14:15:27 +0200 Subject: [PATCH] document Ox.UI and include in index.json --- source/Ox.UI/Ox.UI.js | 30 ++++++++++++++++++++++++++---- tools/build/build.py | 3 ++- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/source/Ox.UI/Ox.UI.js b/source/Ox.UI/Ox.UI.js index 29040e22..eaa1e3ee 100644 --- a/source/Ox.UI/Ox.UI.js +++ b/source/Ox.UI/Ox.UI.js @@ -258,9 +258,13 @@ Ox.load.UI = function(options, callback) { function initUI() { - //@ Ox.UI Object with various UI properties and methods + //@ UI Ox.UI = {}; + /*@ + Ox.UI.ready queue callback to be called once UI is ready + (callback) -> 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 horizontal, vertical dimensions Ox.UI.DIMENSIONS = { horizontal: ['width', 'height'], vertical: ['height', 'width'] }; + //@ Ox.UI.EDGES horizontal, vertical edges Ox.UI.EDGES = { horizontal: ['left', 'right', 'top', 'bottom'], vertical: ['top', 'bottom', 'left', 'right'] }; + //@ Ox.UI.elements reference to all UI element instnaces Ox.UI.elements = {}; + /*@ + Ox.UI.getImageName get image name from url + (url) -> Image Name + @*/ Ox.UI.getImageName = function(url) { return imageNames[url]; }; /*@ - getImageURL Returns an image URL + Ox.UI.getImageURL Returns an image URL (name[, theme[, color]]) -> 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 Get supported video formats + (formats) -> of supported formats + formats 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 hide loading screen + () -> 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 Checks if an object is an Ox.Element (obj) -> 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 Path of Ox.UI Ox.UI.PATH = Ox.PATH + 'Ox.UI/'; + //@ Ox.UI.SCOLLBAR_SIZE size of scrollbar Ox.UI.SCROLLBAR_SIZE = $.browser.mozilla ? 16 : 12; + //@ Ox.UI.getBarSize 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 unicode symbols Ox.UI.symbols = { alt: '\u2325', apple: '\uF8FF', diff --git a/tools/build/build.py b/tools/build/build.py index 63183fa2..0dcd59d6 100755 --- a/tools/build/build.py +++ b/tools/build/build.py @@ -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