Projet

Général

Profil

Paste
Télécharger (1,12 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / media / js / util / ba-debug.min.js @ 2b3c8cc1

1
/*
2
 * debug - v0.3 - 6/8/2009
3
 * http://benalman.com/projects/javascript-debug-console-log/
4
 *
5
 * Copyright (c) 2009 "Cowboy" Ben Alman
6
 * Licensed under the MIT license
7
 * http://benalman.com/about/license/
8
 *
9
 * With lots of help from Paul Irish!
10
 * http://paulirish.com/
11
 */
12
window.debug=(function(){var c=this,e=Array.prototype.slice,b=c.console,i={},f,g,j=9,d=["error","warn","info","debug","log"],m="assert clear count dir dirxml group groupEnd profile profileEnd time timeEnd trace".split(" "),k=m.length,a=[];while(--k>=0){(function(n){i[n]=function(){j!==0&&b&&b[n]&&b[n].apply(b,arguments)}})(m[k])}k=d.length;while(--k>=0){(function(n,o){i[o]=function(){var q=e.call(arguments),p=[o].concat(q);a.push(p);h(p);if(!b||!l(n)){return}b.firebug?b[o].apply(c,q):b[o]?b[o](q):b.log(q)}})(k,d[k])}function h(n){if(f&&(g||!b||!b.log)){f.apply(c,n)}}i.setLevel=function(n){j=typeof n==="number"?n:9};function l(n){return j>0?j>n:d.length+j<=n}i.setCallback=function(){var o=e.call(arguments),n=a.length,p=n;f=o.shift()||null;g=typeof o[0]==="boolean"?o.shift():false;p-=typeof o[0]==="number"?o.shift():n;while(p<n){h(a[p++])}};return i})();