From 044da383db742d942c7f047f5871254f7a207561 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Fri, 30 Mar 2012 01:41:47 +0000 Subject: [PATCH] minor changes, mostly documentation --- source/Ox/js/Core.js | 6 +++--- source/Ox/js/DOM.js | 6 +++--- source/Ox/js/Format.js | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/Ox/js/Core.js b/source/Ox/js/Core.js index 5e12f313..79b5d836 100644 --- a/source/Ox/js/Core.js +++ b/source/Ox/js/Core.js @@ -85,12 +85,12 @@ window.Ox = function(val) { /*@ Ox.load Loads a module - A module named "Test" provides Ox.Test/Ox.Test.js, in which it - defines one method, Ox.load.Test, that takes two arguments, + 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.Test and attach its own methods there. + define Ox.Foo and attach its own methods there. (module, callback) -> undefined (module, options, callback) -> undefined (modules, callback) -> undefined diff --git a/source/Ox/js/DOM.js b/source/Ox/js/DOM.js index d5468d00..315bedea 100644 --- a/source/Ox/js/DOM.js +++ b/source/Ox/js/DOM.js @@ -71,7 +71,9 @@ Ox.element Generic HTML element, mimics jQuery > Ox.element("
").html("red").html() "red" @*/ -Ox.element = function(str) { +Ox.$ = Ox.element = function(str) { + // fixme: add generic bind (remove click and mousedown), + // add native css selector return { //@ 0 The DOM element itself 0: str[0] == '<' ? document.createElement(str.substr(1, str.length - 2)) : @@ -141,7 +143,6 @@ Ox.element = function(str) { callback Callback function event The DOM event @*/ - // fixme: why not a generic bind? click: function(callback) { this[0].onclick = callback; return this; @@ -196,7 +197,6 @@ Ox.element = function(str) { callback Callback function event The DOM event @*/ - // fixme: why not a generic bind? mousedown: function(callback) { this[0].onmousedown = callback; return this; diff --git a/source/Ox/js/Format.js b/source/Ox/js/Format.js index 38de412f..8c970026 100644 --- a/source/Ox/js/Format.js +++ b/source/Ox/js/Format.js @@ -161,14 +161,14 @@ Ox.formatDate = function(date, str, utc) { ['S', function(d) {return Ox.pad(Ox.getSeconds(d, utc), 2);}], ['s', function(d) { return Math.floor(d.getTime() / 1000) - - (utc ? Ox.getTimezoneOffset() / 1000 : 0); + - (utc ? Ox.getTimezoneOffset() / 1000 : 0); }], ['U', function(d) {return Ox.pad(Ox.getWeek(d, utc), 2);}], ['u', function(d) {return Ox.getISODay(d, utc);}], ['V', function(d) {return Ox.pad(Ox.getISOWeek(d, utc), 2);}], ['W', function(d) { - return Ox.pad(Math.floor((Ox.getDayOfTheYear(d, utc) + - (Ox.getFirstDayOfTheYear(d, utc) || 7) - 2) / 7), 2); + return Ox.pad(Math.floor((Ox.getDayOfTheYear(d, utc) + + (Ox.getFirstDayOfTheYear(d, utc) || 7) - 2) / 7), 2); }], ['w', function(d) {return Ox.getDay(d, utc);}], ['X', function(d) {