diff --git a/source/Ox.Image/Ox.Image.js b/source/Ox.Image/Ox.Image.js index 9a185750..48312af1 100644 --- a/source/Ox.Image/Ox.Image.js +++ b/source/Ox.Image/Ox.Image.js @@ -6,8 +6,8 @@ Ox.load.Image = function(options, callback) { /*@ Ox.Image Generic image object - To render the image as an image element, use its src() - method, to render it as a canvas, use its canvas property. + To render the image as an image element, use its `src()` method, to + render it as a canvas, use its `canvas` property. (src, callback) -> undefined (width, height, callback) -> undefined (width, height, background, callback) -> undefined @@ -187,7 +187,7 @@ Ox.load.Image = function(options, callback) { /*@ drawCircle Draws a circle (point, radius, options) -> The image object - point <[n]> Center ([x, y]) + point <[n]> Center (`[x, y]`) radius Radius in px options Options color CSS color @@ -206,7 +206,7 @@ Ox.load.Image = function(options, callback) { /*@ drawLine Draws a line (points, options) -> The image object - points <[a]> End points ([[x1, y1], [x2, y2]]) + points <[a]> End points (`[[x1, y1], [x2, y2]]`) options Options color CSS color width Line width in px @@ -223,7 +223,7 @@ Ox.load.Image = function(options, callback) { /*@ drawPath Draws a path (points, options) -> The image object - points <[a]> Points ([[x1, y2], [x2, y2], ...]) + points <[a]> Points (`[[x1, y2], [x2, y2], ...]`) options Options color CSS color fill CSS color @@ -245,8 +245,8 @@ Ox.load.Image = function(options, callback) { /*@ drawRectangle Draws a rectangle (point, size, options) -> The image object - point <[n]> Top left corner ([x, y]) - size <[n]> Width and height in px ([w, h]) + point <[n]> Top left corner (`[x, y]`) + size <[n]> Width and height in px (`[w, h]`) options Options color CSS color fill CSS color @@ -263,7 +263,7 @@ Ox.load.Image = function(options, callback) { drawText Draws text (text, point, options) -> The image object text Text - point <[n]> Top left corner ([x, y]) + point <[n]> Top left corner (`[x, y]`) options Options color CSS color font CSS font @@ -316,9 +316,9 @@ Ox.load.Image = function(options, callback) { For most purposes, deflate and mode should be omitted, since the defaults make the existence of the message harder to detect. A valid use case for deflate and mode would be to first encode a more easily - detected decoy string, and only then the secret string: - image.encode(decoy, false, 1, function(image) { image.encode(secret, - -1, callback); }). + detected decoy string, and only then the secret string: + `image.encode(decoy, false, 1, function(image) { + image.encode(secret, -1, callback); })`. (str, callback) -> The image object (unmodified) (str, deflate, callback) -> The image object (unmodified) (str, mode, callback) -> The image object (unmodified) diff --git a/source/Ox.UI/js/Core/Element.js b/source/Ox.UI/js/Core/Element.js index 3de2a26a..ef00e0e0 100644 --- a/source/Ox.UI/js/Core/Element.js +++ b/source/Ox.UI/js/Core/Element.js @@ -296,7 +296,7 @@ Ox.Element = function(options, self) { callback Callback function data event data (key/value pairs) event Event name - Event names can be namespaced, like 'click.foo' + Event names can be namespaced, like `'click.foo'` @*/ that.bindEvent = function() { if (Ox.typeOf(arguments[0]) == 'function') { @@ -316,7 +316,7 @@ Ox.Element = function(options, self) { callback Callback function data event data (key/value pairs) event Event name - Event names can be namespaced, like 'click.foo' + Event names can be namespaced, like `'click.foo'` @*/ that.bindEventOnce = function() { Ox.forEach(Ox.makeObject(arguments), function(callback, event) { @@ -478,8 +478,7 @@ Ox.Element = function(options, self) { /*@ unbindEvent Unbinds all callbacks from an event To unbind a specific handler, use namespaced events, like - bindEvent('click.foo', callback), and then - unbindEvent('click.foo'). + `bindEvent('click.foo', callback)`, and then `unbindEvent('click.foo')`. () -> This element Unbinds all callbacks from all events (callback) -> This element diff --git a/source/Ox.UI/js/Core/Event.js b/source/Ox.UI/js/Core/Event.js index 89e02c1c..8cbac9f0 100644 --- a/source/Ox.UI/js/Core/Event.js +++ b/source/Ox.UI/js/Core/Event.js @@ -4,6 +4,7 @@ Ox.Event Basic event handler @*/ +// FIXME: unused Ox.Event = (function() { @@ -18,7 +19,7 @@ Ox.Event = (function() { callback Callback function data <*> Event data event Event name - Event names can be namespaced, like 'click.foo' + Event names can be namespaced, like `'click.foo'` @*/ that.bind = function() { Ox.forEach(Ox.makeObject(arguments), function(callback, event) { @@ -38,7 +39,7 @@ Ox.Event = (function() { callback Callback function data <*> Event data event Event name - Event names can be namespaced, like 'click.foo' + Event names can be namespaced, like `'click.foo'` @*/ that.bindOnce = function() { Ox.forEach(Ox.makeObject(arguments), function(callback, event) { @@ -68,8 +69,7 @@ Ox.Event = (function() { /*@ unbind Unbinds all callbacks from an event To unbind a specific handler, use namespaced events, like - bind('click.foo', callback), and then - unbind('click.foo'). + `bind('click.foo', callback)`, and then `unbind('click.foo')`. () -> The event handler Unbinds all events (event) -> The event handler diff --git a/source/Ox.UI/js/Map/Map.js b/source/Ox.UI/js/Map/Map.js index 948e031c..f08ddd95 100644 --- a/source/Ox.UI/js/Map/Map.js +++ b/source/Ox.UI/js/Map/Map.js @@ -3,9 +3,8 @@ /*@ Ox.Map Basic map object # DESCRIPTION -------------------------------------------------------------- - Ox.Map is a wrapper around the - Google - Maps API. + `Ox.Map` is a wrapper around the [Google Maps + API](http://code.google.com/apis/maps/documentation/javascript/). # ARGUMENTS ---------------------------------------------------------------- options options clickable If true, clicking on the map finds a place diff --git a/source/Ox.UI/js/Panel/TabPanel.js b/source/Ox.UI/js/Panel/TabPanel.js index 9435c5a6..b3a28d19 100644 --- a/source/Ox.UI/js/Panel/TabPanel.js +++ b/source/Ox.UI/js/Panel/TabPanel.js @@ -5,8 +5,8 @@ Ox.TabPanel Tabbed panel ([options[, self]]) -> Panel options Options content Content per tab - Either ({id1: $element1, id2: $element2}} or - function(id) { return $element; }) + Either `({id1: $element1, id2: $element2}}` or `function(id) { + return $element; })` size Height of the tab bar tabs [o] Tabs id Tab id diff --git a/source/Ox/js/Constants.js b/source/Ox/js/Constants.js index e10274f7..8fff0f0b 100644 --- a/source/Ox/js/Constants.js +++ b/source/Ox/js/Constants.js @@ -101,7 +101,7 @@ Ox.PATH = Ox.toArray( ).reverse().filter(function(element) { return /Ox\.js$/.test(element.src); })[0].src.replace(/Ox\.js$/, ''); -//@ Ox.PREFIXES <[str]> ['', 'K', 'M', 'G', 'T', 'P'] +//@ Ox.PREFIXES <[str]> `['', 'K', 'M', 'G', 'T', 'P']` Ox.PREFIXES = ['', 'K', 'M', 'G', 'T', 'P']; //@ Ox.SEASONS <[str]> Names of the seasons of the year Ox.SEASONS = ['Winter', 'Spring', 'Summer', 'Fall']; diff --git a/source/Ox/js/Core.js b/source/Ox/js/Core.js index 58207c6a..40dcbde4 100644 --- a/source/Ox/js/Core.js +++ b/source/Ox/js/Core.js @@ -76,8 +76,8 @@ Some conventions: (function(global) { /*@ - Ox The Ox object - See Ox.wrap for details. + Ox The `Ox` object + See `Ox.wrap` for details. (value) -> wrapped value value <*> Any value @*/ @@ -87,7 +87,7 @@ Some conventions: })(this); /*@ -Ox.Break Breaks from Ox.forEach and Ox.loop +Ox.Break Breaks from `Ox.forEach` and `Ox.loop` @*/ Ox.Break = function() { throw Ox.BreakError; @@ -97,12 +97,11 @@ Ox.BreakError = new SyntaxError('Illegal Ox.Break() statement'); /*@ Ox.load Loads a module - A module named "Foo" provides Ox.Foo/Ox.Foo.js, in which it - defines one method, Ox.load.Foo, that takes two arguments, - options and callback, and calls - callback with one argument, true for success or - false if an error occurred. Generally, the module should - define Ox.Foo and attach its own methods there. + A module named "Foo" provides `Ox.Foo/Ox.Foo.js`, in which it defines one + method, `Ox.load.Foo`, that takes two arguments, `options` and `callback`, + and calls `callback` with one argument, `true` for success or `false` if an + error occurred. Generally, the module should define `Ox.Foo` and attach its + own methods there. (module, callback) -> undefined (module, options, callback) -> undefined (modules, callback) -> undefined @@ -240,20 +239,19 @@ Ox.Log = (function() { /*@ Ox.loop For-loop, functional-style - Returning false from the iterator function acts like a - break statement. Unlike a for loop, - Ox.loop doesn't leak its counter variable to the outer scope, - but returns it. + Returning `false` from the iterator function acts like a `break` statement. + Unlike a `for` loop, `Ox.loop` doesn't leak its counter variable to the + outer scope, but returns it. (stop, fn) -> Next value - equivalent to for (var i = 0; i < stop; i++) { fn(i); } + equivalent to `for (var i = 0; i < stop; i++) { fn(i); }` (start, stop, fn) -> Next value - equivalent to for (var i = start; i < stop; i++) { fn(i); } - or, if start is larger than stop, - for (var i = start; i > stop; i--) { fn(i); } + equivalent to `for (var i = start; i < stop; i++) { fn(i); }` or, if + `start` is larger than `stop`, `for (var i = start; i > stop; i--) { + fn(i); }` (start, stop, step, fn) -> Next value - equivalent to for (var i = start; i < stop; i += step) { fn(i); - } or, if step is negative, for (var i = start; - i > stop; i += step) { fn(i); } + equivalent to `for (var i = start; i < stop; i += step) { fn(i); }` or, + if `step` is negative, `for (var i = start; i > stop; i += step) { + fn(i); }` start Start value stop Stop value (exclusive) step Step value @@ -321,10 +319,10 @@ Ox.uid = (function() { /*@ Ox.wrap Wraps a value so that one can directly call any Ox function on it - Ox(value) is a shorthand for Ox.wrap(value). + `Ox(value)` is a shorthand for `Ox.wrap(value)`. (value) -> wrapped value chain Wrap return values to allow chaining - value Unwrap the value wrapped by chain() + value Unwrap the value wrapped by `chain()` value <*> Any value > Ox("foobar").repeat(2) "foobarfoobar" diff --git a/source/Ox/js/DOM.js b/source/Ox/js/DOM.js index e9a17840..55d48a19 100644 --- a/source/Ox/js/DOM.js +++ b/source/Ox/js/DOM.js @@ -289,8 +289,8 @@ Ox.$ = Ox.element = function(value) { /*@ Ox.canvas Generic canvas object # Description -------------------------------------------------------------- - Returns an object with the properties: canvas, - context, data and imageData. + Returns an object with the properties: `canvas`, `context`, `data` and + `imageData`. # Usage -------------------------------------------------------------------- Ox.canvas(width, height) -> canvas Ox.canvas(image) -> canvas diff --git a/source/Ox/js/Date.js b/source/Ox/js/Date.js index 5b1f071e..d52c14ed 100644 --- a/source/Ox/js/Date.js +++ b/source/Ox/js/Date.js @@ -178,7 +178,7 @@ Ox.getISOYear = function(date, utc) { //@ Ox.getSeconds Get the seconds of a date // see Ox.setSeconds for source code -//@ Ox.getTime Alias for +new Date() +//@ Ox.getTime Alias for `+new Date()` Ox.getTime = function(utc) { return +new Date() - (utc ? Ox.getTimezoneOffset() : 0); }; diff --git a/source/Ox/js/Encoding.js b/source/Ox/js/Encoding.js index f29e8779..94522bdc 100644 --- a/source/Ox/js/Encoding.js +++ b/source/Ox/js/Encoding.js @@ -140,11 +140,10 @@ Ox.decodeBase256 = function(string) { /*@ Ox.encodeDeflate Encodes a string, using deflate - Since PNGs are deflate-encoded, the canvas object's - toDataURL method provides an efficient implementation. - The string is encoded as UTF-8 and written to the RGB channels of a - canvas element, then the PNG dataURL is decoded from base64, and some - head, tail and chunk names are removed. + Since PNGs are deflate-encoded, the `canvas` object's `toDataURL` method + provides an efficient implementation. The string is encoded as UTF-8 and + written to the RGB channels of a canvas element, then the PNG dataURL is + decoded from base64, and some head, tail and chunk names are removed. (str) -> The encoded string str The string to be encoded > Ox.decodeDeflate(Ox.encodeDeflate('foo'), function(str) { Ox.test(str, 'foo'); }) @@ -189,11 +188,10 @@ Ox.encodeDeflate = function(string, callback) { /*@ Ox.decodeDeflate Decodes an deflate-encoded string - Since PNGs are deflate-encoded, the canvas object's - drawImage method provides an efficient implementation. The - string will be wrapped as a PNG dataURL, encoded as base64, and drawn - onto a canvas element, then the RGB channels will be read, and the - result will be decoded from UTF8. + Since PNGs are deflate-encoded, the `canvas` object's `drawImage` method + provides an efficient implementation. The string will be wrapped as a PNG + dataURL, encoded as base64, and drawn onto a canvas element, then the RGB + channels will be read, and the result will be decoded from UTF8. (str) -> undefined str The string to be decoded callback Callback function diff --git a/source/Ox/js/HTML.js b/source/Ox/js/HTML.js index c8881da2..5713e1ab 100644 --- a/source/Ox/js/HTML.js +++ b/source/Ox/js/HTML.js @@ -200,9 +200,8 @@ (string[, decodeAll]) -> String string String decodeAll If true, decode named entities for characters > 127 - Note that decodeAll relies on - Ox.normalizeHTML, which uses the DOM and may transform - the string + Note that `decodeAll` relies on `Ox.normalizeHTML`, which uses the + DOM and may transform the string > Ox.decodeHTMLEntities('<'&">') '<\'&">' > Ox.decodeHTMLEntities('<'&">') diff --git a/source/Ox/js/JavaScript.js b/source/Ox/js/JavaScript.js index df7b5bd3..780dbcb0 100644 --- a/source/Ox/js/JavaScript.js +++ b/source/Ox/js/JavaScript.js @@ -11,8 +11,7 @@ Ox.doc Generates documentation for annotated JavaScript callback Callback function doc <[o]> Array of doc objects arguments <[o]|u> Arguments (array of doc objects) - Present if the type of the item is - "function". + Present if the `type` of the item is `"function"`. class Class of the item default Default value of the item description Multi-line description with some Markdown @@ -28,9 +27,8 @@ Ox.doc Generates documentation for annotated JavaScript order <[s]> Order of returns, arguments, properties Present if the type of the item is "function" properties <[o]|u> Properties (array of doc objects) - Present if the type of the item is - "event", "function" - or "object". + May be present if the `type` of the item is `"event"`, + `"function"` or `"object"`. section Section in the file source <[o]> Source code (array of tokens) column Column @@ -38,8 +36,7 @@ Ox.doc Generates documentation for annotated JavaScript type Type (see Ox.tokenize for a list of types) value Value returns <[o]> Return values (array of doc objects) - Present if the type of the item is - "function". + Present if the `type` of the item is `"function"`. summary One-line summary, with some Markdown See Ox.parseMarkdown for details tests <[o]> Tests (array of test objects) @@ -467,9 +464,8 @@ Ox.doc = (function() { /*@ Ox.identify Returns the type of a JavaScript identifier (str) -> Type - Type can be constant, identifier, - keyword, method, object or - property + Type can be `constant`, `identifier`, `keyword`, `method`, `object` or + `property`. @*/ Ox.identify = (function() { // see https://developer.mozilla.org/en/JavaScript/Reference @@ -852,11 +848,8 @@ Ox.tokenize Tokenizes JavaScript column Column of the token line Line of the token type Type of the token - Type can be "comment", "error", - "identifier", "linebreak", - "number", "operator", - "regexp", "string" or - "whitespace" + Type can be `"comment"`, `"error"`, `"identifier"`, `"linebreak"`, + `"number"`, `"operator"`, `"regexp"`, `"string"` or `"whitespace"` value Value of the token source JavaScript source code > Ox.tokenize('// comment\nvar foo = bar / baz;').length diff --git a/source/Ox/js/Math.js b/source/Ox/js/Math.js index 41438a09..fe0a79c9 100644 --- a/source/Ox/js/Math.js +++ b/source/Ox/js/Math.js @@ -2,7 +2,7 @@ /*@ Ox.asinh Inverse hyperbolic sine - Missing from Math. + Missing from `Math`. > Ox.asinh(0) 0 @*/ @@ -12,7 +12,7 @@ Ox.asinh = function(x) { /*@ Ox.deg Takes radians, returns degrees - Missing from Math. + Missing from `Math`. > Ox.deg(2 * Math.PI) 360 @*/ @@ -22,10 +22,9 @@ Ox.deg = function(rad) { /*@ Ox.divideInt Divides a number by another and returns an array of integers - Ox.divideInt(num, by) returns a sorted array of integers that - has a sum of num, a length of by, a minimum of - Math.floor(num / by) and a maximum of - Math.ceil(num / by). + `Ox.divideInt(num, by)` returns a sorted array of integers that has a sum of + `num`, a length of `by`, a minimum of `Math.floor(num / by)` and a maximum + of `Math.ceil(num / by)`. > Ox.divideInt(100, 3) [33, 33, 34] > Ox.divideInt(100, 6) @@ -42,11 +41,11 @@ Ox.divideInt = function(number, by) { /*@ Ox.limit Limits a number by a given mininum and maximum - Ox.limit(num, min, max) is a shorthand for - Math.min(Math.max(num, min), max) - (num) -> num - (num, max) -> Math.max(num, max) - (num, min, max) -> Math.min(Math.max(num, min), max) + `Ox.limit(num, min, max)` is a shorthand for `Math.min(Math.max(num, min), + max)` + (num) -> `num` + (num, max) -> `Math.max(num, max)` + (num, min, max) -> `Math.min(Math.max(num, min), max)` num number min minimum max maximum @@ -68,7 +67,7 @@ Ox.limit = function(/*number[[, min], max]*/) { /*@ Ox.log Returns the logarithm of a given number to a given base - Missing from Math. + Missing from `Math`. > Ox.log(100, 10) 2 > Ox.log(Math.E) @@ -80,8 +79,7 @@ Ox.log = function(number, base) { /*@ Ox.mod Modulo function - Unlike -1 % 10, which returns -1, - Ox.mod(-1, 10) returns 9. + Unlike `-1 % 10`, which returns `-1`, `Ox.mod(-1, 10)` returns `9`. > Ox.mod(11, 10) 1 > Ox.mod(-11, 10) @@ -93,7 +91,7 @@ Ox.mod = function(number, by) { /*@ Ox.rad Takes degrees, returns radians - Missing from Math. + Missing from `Math`. > Ox.rad(360) 2 * Math.PI @*/ @@ -135,7 +133,7 @@ Ox.round = function(number, decimals) { /*@ Ox.sinh Hyperbolic sine - Missing from Math. + Missing from `Math`. > Ox.sinh(0) 0 @*/ diff --git a/source/Ox/js/Object.js b/source/Ox/js/Object.js index a678e2f1..c05b4480 100644 --- a/source/Ox/js/Object.js +++ b/source/Ox/js/Object.js @@ -104,8 +104,8 @@ Ox.keyOf = function(object, value) { /*@ Ox.makeObject Takes an array and returns an object - Ox.makeObject is a helper for functions with two alternative - signatures like ('key', 'val') and ({key: 'val'}). + `Ox.makeObject` is a helper for functions with two alternative signatures + like `('key', 'val')` and `({key: 'val'})`. > (function() { return Ox.makeObject(arguments); }({foo: 1, bar: 2})) {foo: 1, bar: 2} > (function() { return Ox.makeObject(arguments); }('foo', 1)) diff --git a/source/Ox/js/String.js b/source/Ox/js/String.js index 21a9aaef..98b34d08 100644 --- a/source/Ox/js/String.js +++ b/source/Ox/js/String.js @@ -38,8 +38,8 @@ Ox.clean = function(string) { /*@ Ox.endsWith Checks if a string ends with a given substring If the substring is a string literal (and not a variable), - /sub$/.test(str) or !!/sub$/.exec(str) - is shorter than Ox.ends(str, sub). + `/sub$/.test(str)` or `!!/sub$/.exec(str)` is shorter than `Ox.ends(str, + sub)`. > Ox.endsWith('foobar', 'bar') true @*/ @@ -381,7 +381,7 @@ Ox.repeat = function(value, times) { }; /*@ -Ox.splice [].splice for strings, returns a new string +Ox.splice `[].splice` for strings, returns a new string > Ox.splice('12xxxxx89', 2, 5, 3, 4, 5, 6, 7) '123456789' @*/ @@ -394,8 +394,8 @@ Ox.splice = function(string, index, remove) { /*@ Ox.startsWith Checks if a string starts with a given substring If the substring is a string literal (and not a variable), - /^sub/.test(str) or !!/^sub/.exec(str) - is shorter than Ox.starts(str, sub). + `/^sub/.test(str)` or `!!/^sub/.exec(str)` is shorter than `Ox.starts(str, + sub)`. > Ox.startsWith('foobar', 'foo') true @*/ diff --git a/source/Ox/js/Type.js b/source/Ox/js/Type.js index 927d084d..17b5ef3f 100644 --- a/source/Ox/js/Type.js +++ b/source/Ox/js/Type.js @@ -210,8 +210,8 @@ Ox.isInt = function(value) { }; /*@ -Ox.isNaN Tests if a value is NaN - (value) -> True if the value is NaN +Ox.isNaN Tests if a value is `NaN` + (value) -> True if the value is `NaN` value <*> Any value > Ox.isNaN(NaN) true @@ -221,8 +221,8 @@ Ox.isNaN = function(value) { } /*@ -Ox.isNull Tests if a value is null - (value) -> True if the value is null +Ox.isNull Tests if a value is `null` + (value) -> True if the value is `null` value <*> Any value > Ox.isNull(null) true