var ge = window.ge ? window.ge : {}; isc.addMethods(ge, { objectIsEmpty : function (object) { return isc.isAn.emptyObject(object); }, objectIsNotEmpty : function (object) { if (!isc.isAn.Object(object)) { return false; } for (var i in object) { return true; } return false; } }); // Add Debug constants isc.addProperties(ge, { DEBUG: { tinyDebug: false } }); // Add UnitUtils constants and methods isc.addProperties(ge, { MM_PER_INCH: 25.4, POINT_PER_INCH: 72 }); isc.addProperties(ge, { MM_PER_POINT: ge.MM_PER_INCH / ge.POINT_PER_INCH, POINT_PER_MM: ge.POINT_PER_INCH / ge.MM_PER_INCH }); isc.addMethods(ge, { convertPointToMillimeter: function(point) { return point * ge.MM_PER_POINT; }, convertMillimeterToPoint: function(mm) { return mm * ge.POINT_PER_MM; } }); if (!Array.prototype.indexOfById) { Array.prototype.indexOfById = function(elt /*, from*/) { var len = this.length; var from = Number(arguments[1]) || 0; from = (from < 0) ? Math.ceil(from) : Math.floor(from); if (from < 0) from += len; for (; from < len; from++) { if (from in this && this[from].id == elt.id) return from; } return -1; }; }