So I have been developing a modal control for several months. It is custom coded to my clients needs but I want to release it to the generic public. I have been working to get it to minify via codekit as well as uglify.
Here is an example of the remaining warnings I am receiving.
How can I best remove theses warnings? I extended the typeof function in order to know the variations between objects and arrays.
var com = {
load: function(template, $el, obj, append, callback){
$.get(template, function(value){
$.templates("tmpl", value);
var html = $.render.tmpl(obj);
if(append){ $el.append(html); }else{ $el.html(html); }
}).done(function(){
if(callback !== undefined && com.type(callback) === "function"){ callback(); }
});
},
checkApiEvents: function(api){
if(!$.isEmptyObject(api.doc)){ $.each(api.doc, function(k,v){ if(com.type(v) === "function"){ $.e.doc[k].push(v); } }); }
if(!$.isEmptyObject(api.win)){ $.each(api.win, function(k,v){ if(com.type(v) === "function"){ $.e.win[k].push(v); } }); }
},
type: function(name){
switch(name){
case "function": return "function"; break;
case "object": if($.isArray(name)){return "array"; }else{ return "object"; } break;
case "string": return "string"; break;
case "number": if(!isNaN(name)){ return "number"; }else{ return "string"; } break;
case '': case "undefined": default: return "undefined"; break;
}
},
};