1
0
Fork 0
forked from 0x2620/oxjs

'use strict';

This commit is contained in:
rolux 2011-11-05 17:46:53 +01:00
commit 56370aa0a7
113 changed files with 207 additions and 15 deletions

View file

@ -2,6 +2,8 @@
// OxJS (c) 2011 0x2620, dual-licensed GPL/MIT, see http://oxjs.org for details
'use strict';
/*
Some conventions:
Functions
@ -113,6 +115,7 @@ Ox.load = function() {
length = Ox.len(modules);
Ox.forEach(modules, function(options, module) {
Ox.loadFile(Ox.PATH + 'Ox.' + module + '/Ox.' + module + '.js', function() {
Ox.print('?', module)
Ox.load[module](options, function(s) {
success += s;
++counter == length && callback(success == counter);
@ -172,9 +175,9 @@ Ox.Log = (function() {
if (!log.filterEnabled || log.filter.indexOf(args[0]) > -1) {
date = new Date();
args.unshift(
Ox.formatDate(date, '%H:%M:%S.') + (+date).toString().substr(-3),
Ox.formatDate(date, '%H:%M:%S.') + (+date).toString().substr(-3)/*,
(arguments.callee.caller && arguments.callee.caller.name)
|| '(anonymous)'
|| '(anonymous)'*/
);
window.console && window.console.log.apply(window.console, args);
ret = args.join(' ');
@ -198,9 +201,9 @@ Ox.print = function() {
var args = Ox.makeArray(arguments),
date = new Date();
args.unshift(
Ox.formatDate(date, '%H:%M:%S.') + (+date).toString().substr(-3),
Ox.formatDate(date, '%H:%M:%S.') + (+date).toString().substr(-3)/*,
(arguments.callee.caller && arguments.callee.caller.name)
|| '(anonymous)'
|| '(anonymous)'*/
);
window.console && window.console.log.apply(window.console, args);
return args.join(' ');
@ -248,7 +251,11 @@ Ox.wrap = function(val, chained) {
}
};
Object.getOwnPropertyNames(Ox).forEach(function(name) {
if (name[0] == name[0].toLowerCase() && Ox.isFunction(Ox[name])) {
if (
['arguments', 'callee', 'caller', 'length'].indexOf(name) == -1
&& name[0] == name[0].toLowerCase()
&& Ox.isFunction(Ox[name])
) {
wrapper[name] = function() {
var args = Array.prototype.slice.call(arguments), ret;
args.unshift(val);