src/js/utils.js
author hamidouk
Tue, 11 Oct 2011 17:13:08 +0200
branchpopcorn-port
changeset 61 dc7b5ed7b02b
parent 60 ffc038fdb8f1
child 73 a8192c57c87d
permissions -rw-r--r--
DataLoader, first draft.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     1
/* utils.js - various utils that don't belong anywhere else */
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     2
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     3
/* trace function, for debugging */
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     4
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     5
IriSP.traceNum = 0;
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     6
IriSP.trace = function( msg, value ) {
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     7
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     8
	if( IriSP.config.gui.debug === true ) {
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
     9
		IriSP.traceNum += 1;
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    10
		IriSP.jQuery( "<div>"+IriSP.traceNum+" - "+msg+" : "+value+"</div>" ).appendTo( "#Ldt-output" );
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    11
	}
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    12
};
cbb1425bc769 begun breaking the code across multiple files.
hamidouk
parents:
diff changeset
    13
60
ffc038fdb8f1 commented ie8 helper function
hamidouk
parents: 31
diff changeset
    14
/* for ie compatibility
ffc038fdb8f1 commented ie8 helper function
hamidouk
parents: 31
diff changeset
    15
if (Object.prototype.__defineGetter__&&!Object.defineProperty) {
ffc038fdb8f1 commented ie8 helper function
hamidouk
parents: 31
diff changeset
    16
   Object.defineProperty=function(obj,prop,desc) {
ffc038fdb8f1 commented ie8 helper function
hamidouk
parents: 31
diff changeset
    17
      if ("get" in desc) obj.__defineGetter__(prop,desc.get);
ffc038fdb8f1 commented ie8 helper function
hamidouk
parents: 31
diff changeset
    18
      if ("set" in desc) obj.__defineSetter__(prop,desc.set);
ffc038fdb8f1 commented ie8 helper function
hamidouk
parents: 31
diff changeset
    19
   }
ffc038fdb8f1 commented ie8 helper function
hamidouk
parents: 31
diff changeset
    20
}
ffc038fdb8f1 commented ie8 helper function
hamidouk
parents: 31
diff changeset
    21
*/