webshim
Version:
modular capability-based polyfill loading libary, which extends jQuery with HTML5 features in legacy browsers
57 lines (49 loc) • 1.32 kB
HTML
<html>
<head>
<meta charset="utf-8">
<title>combo build helper</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<style>
textarea {
width: 100%;
height: 100%;
min-height: 300px;
}
</style>
</head>
<body>
<textarea></textarea>
<script src="../src/polyfiller.js"></script>
<script>
(function($, r){
var combos = {version: webshims.version, features: {}, files: {}};
var makeFile = function(file){
file = (webshims.modules[file] && webshims.modules[file].src) || file;
return 'src/shims/'+file+'.js';
};
$.each(webshims.c, function(c, srces){
combos.files['src/shims/combos/'+c+'.js'] = $.map(srces, makeFile);
c *= 1;
$.each(srces, function(i, moduleName){
var feature = webshims.modules[moduleName].f || moduleName;
if(!combos.features[feature]){
combos.features[feature] = [];
}
if(combos.features[feature].indexOf(c) == -1){
combos.features[feature].push(c);
}
});
});
if(r.console){
r.console.log(combos);
}
combos = JSON.stringify(combos);
$('textarea').val(combos);
setTimeout(function(){
alert(combos);
}, 0);
})(jQuery, this);
</script>
</body>
</html>