Skip to content

Commit 69994bc

Browse files
committed
Added jQuery.Console
1 parent 5c05711 commit 69994bc

File tree

4 files changed

+100
-0
lines changed

4 files changed

+100
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
jQueryPlugins/
2+
_site/
3+
boks/
4+
.project
5+
.tmp_*
6+
.DS_Store

jQuery.Console/README

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
jQuery Console Plugin
3+
4+
Copyright (c) 2009 Erik Zaadi
5+
6+
Home Page : http://erikzaadi.github.com/jQueryPlugins/jQuery.Console
7+
8+
Dual licensed under the MIT and GPL licenses:
9+
http://www.opensource.org/licenses/mit-license.php
10+
http://www.gnu.org/licenses/gpl.html

jQuery.Console/jQuery.Console.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* jQuery Console Plugin
3+
*
4+
* Copyright (c) 2009 Erik Zaadi
5+
*
6+
* Home Page : http://erikzaadi.github.com/jQueryPlugins/jQuery.Console
7+
* jQuery Plugin home page : http://plugins.jquery.com/project/Console
8+
*
9+
* Dual licensed under the MIT and GPL licenses:
10+
* http://www.opensource.org/licenses/mit-license.php
11+
* http://www.gnu.org/licenses/gpl.html
12+
*/
13+
;
14+
(function($){
15+
16+
//http://getfirebug.com/console.html
17+
var functions = {
18+
Log: 'log',
19+
Trace: 'trace',
20+
Debug: 'debug',
21+
Info: 'info',
22+
Warn: 'warn',
23+
Error: 'error',
24+
Dir: 'dir',
25+
DirXML: 'dirxml',
26+
Group: 'group',
27+
GroupCollapsed: 'groupCollapsed',
28+
GroupEnd: 'groupEnd',
29+
Time: 'time',
30+
TimeEnd: 'timeEnd',
31+
Profile: 'profile',
32+
ProfileEnd: 'profileEnd',
33+
Count: 'count'
34+
};
35+
36+
$.Console = {};
37+
38+
_initExports();
39+
40+
$.Console.functions = functions;
41+
42+
$.fn.Console = function(functionName){
43+
//log is default
44+
var funcToCall = functionName || functions.Log;
45+
return this.each(function(){
46+
_consoleCaller(funcToCall, this);
47+
});
48+
};
49+
50+
function _initExports(){
51+
for (var fn in functions) {
52+
$.Console[fn] = function(){
53+
_consoleCaller(arguments.callee.fn, arguments);
54+
};
55+
$.Console[fn].fn = functions[fn];
56+
}
57+
};
58+
59+
function _consoleCaller(func, params){
60+
//if it's the argument object
61+
if (params.callee) {
62+
for (var x = 0; x < params.length; x++) {
63+
_consoleCaller(func, params[x]);
64+
}
65+
return false;
66+
}
67+
if (typeof(window['console']) != 'undefined') {
68+
if (console[func]) {
69+
console[func](params);
70+
}
71+
else {
72+
if (console.log)
73+
console.log(params);
74+
}
75+
}
76+
else {
77+
if (window.opera) {
78+
opera.postError(params);
79+
}
80+
}
81+
return false;
82+
}
83+
})(jQuery);

jQuery.Console/jQuery.Console.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)