diff --git a/.jshintrc b/.jshintrc index 3cc877f..c2d2967 100644 --- a/.jshintrc +++ b/.jshintrc @@ -17,5 +17,9 @@ "strict": false, "trailing": true, "smarttabs": true, - "globals": {"define": false} + "globals": { + "define": false, + "XDomainRequest": false, + "ActiveXObject": false + } } diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 782fcc1..b1d6387 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -1,10 +1,13 @@ 'use strict' module.exports = (grunt) -> # load all grunt tasks - # this assumes matchdep, grunt-contrib-watch, grunt-contrib-coffee, + # this assumes matchdep, grunt-contrib-watch, grunt-contrib-coffee, # grunt-coffeelint, grunt-contrib-clean, grunt-contrib-uglify is in the package.json file require('matchdep').filterDev('grunt-*').forEach grunt.loadNpmTasks + # Timing on Grunt tasks completion + require('time-grunt') grunt + grunt.initConfig # load in the module information pkg: grunt.file.readJSON 'package.json' @@ -18,7 +21,7 @@ module.exports = (grunt) -> ' * Copyright (c) <%= grunt.template.today("yyyy") %>' + ' | <%= pkg.authors %>;\n' + '**/\n' - + # clear out any unneccessary files clean: ['js/<%= pkg.name %>.min.js'] @@ -40,9 +43,9 @@ module.exports = (grunt) -> files: 'js/<%= pkg.name %>.min.js': 'js/<%= pkg.name %>.js' - ## TODO: add some tests - - + ## TODO: add some tests + + grunt.registerTask 'default', [ 'clean' 'jshint' diff --git a/index.html b/index.html index dec35aa..0a0f213 100644 --- a/index.html +++ b/index.html @@ -10,11 +10,10 @@ - -
Hello World!
diff --git a/js/rem.js b/js/rem.js index c6221e8..b05e426 100644 --- a/js/rem.js +++ b/js/rem.js @@ -135,7 +135,7 @@ return v > 4 ? v : undef; }()); - if ( ie >= 7 ){ //If IE is greater than 6 + if ( ie >= 8 ){ //If IE is greater than 7 // This targets modern browsers and modern versions of IE, // which don't need the "new" keyword. xhr.onreadystatechange = function () { diff --git a/js/rem.min.js b/js/rem.min.js index 3e6f32b..b9150dd 100644 --- a/js/rem.min.js +++ b/js/rem.min.js @@ -1,7 +1,7 @@ /** - * Module: rem - v1.2.2 + * Module: rem - v1.2.4 * Description: A polyfill to parse CSS links and rewrite pixel equivalents into head for non supporting browsers - * Date Built: 2014-04-05 + * Date Built: 2014-06-06 * Copyright (c) 2014 | Chuck Carpenter ,Lucas Serven ; **/ -!function(a){"use strict";var b=function(){var a=document.createElement("div");return a.style.cssText="font-size: 1rem;",/rem/.test(a.style.fontSize)},c=function(){for(var a=document.getElementsByTagName("link"),b=[],c=0;c0?(u=[],t=[],q=[],d()):g()}},f=function(a,b){for(var c,d=k(m(a)),e=/[\w\d\s\-\/\\\[\]:,.'"*()<>+~%#^$_=|@]+\{[\w\d\s\-\/\\%#:!;,.'"*()]+\d*\.?\d+rem[\w\d\s\-\/\\%#:!;,.'"*()]*\}/g,f=d.match(e),g=/\d*\.?\d+rem/g,h=d.match(g),i=/(.*\/)/,j=i.exec(b)[0],l=/@import (?:url\()?['"]?([^'\)"]*)['"]?\)?[^;]*/gm;null!==(c=l.exec(a));)q.push(j+c[1]);null!==f&&0!==f.length&&(r=r.concat(f),s=s.concat(h))},g=function(){for(var a=/[\w\d\s\-\/\\%#:,.'"*()]+\d*\.?\d+rem[\w\d\s\-\/\\%#:!,.'"*()]*[;}]/g,b=0;b",d[0];);return b>4?b:a}();e.onreadystatechange=f>=7?function(){4===e.readyState&&c(e,d)}:new function(){4===e.readyState&&c(e,d)}}catch(g){if(a.XDomainRequest){var h=new XDomainRequest;h.open("get",b),h.onload=function(){c(h,d)},h.onerror=function(){return!1},h.send()}}},k=function(a){for(var b=a.search(/\/\*/),c=a.search(/\*\//);b>-1&&c>b;)a=a.substring(0,b)+a.substring(c+2),b=a.search(/\/\*/),c=a.search(/\*\//);return a},l=function(){return a.matchMedia||a.msMatchMedia?!0:!1},m=function(a){return l()||(a=a.replace(/@media[\s\S]*?\}\s*\}/,"")),a},n=function(){if(a.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP")}catch(b){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}};if(!b()){var o="",p=[],q=[],r=[],s=[],t=[],u=[],v=[],w=document.getElementsByTagName("body")[0],x="";w.currentStyle?x=w.currentStyle.fontSize.indexOf("px")>=0?w.currentStyle.fontSize.replace("px",""):w.currentStyle.fontSize.indexOf("em")>=0?w.currentStyle.fontSize.replace("em",""):w.currentStyle.fontSize.indexOf("pt")>=0?w.currentStyle.fontSize.replace("pt",""):w.currentStyle.fontSize.replace("%","")/100*16:a.getComputedStyle&&(x=document.defaultView.getComputedStyle(w,null).getPropertyValue("font-size").replace("px","")),d()}}(window); \ No newline at end of file +!function(a){"use strict";var b=function(){var a=document.createElement("div");return a.style.cssText="font-size: 1rem;",/rem/.test(a.style.fontSize)},c=function(){for(var a=document.getElementsByTagName("link"),b=[],c=0;c0?(u=[],t=[],q=[],d()):g()}},f=function(a,b){for(var c,d=k(m(a)),e=/[\w\d\s\-\/\\\[\]:,.'"*()<>+~%#^$_=|@]+\{[\w\d\s\-\/\\%#:!;,.'"*()]+\d*\.?\d+rem[\w\d\s\-\/\\%#:!;,.'"*()]*\}/g,f=d.match(e),g=/\d*\.?\d+rem/g,h=d.match(g),i=/(.*\/)/,j=i.exec(b)[0],l=/@import (?:url\()?['"]?([^'\)"]*)['"]?\)?[^;]*/gm;null!==(c=l.exec(a));)q.push(j+c[1]);null!==f&&0!==f.length&&(r=r.concat(f),s=s.concat(h))},g=function(){for(var a=/[\w\d\s\-\/\\%#:,.'"*()]+\d*\.?\d+rem[\w\d\s\-\/\\%#:!,.'"*()]*[;}]/g,b=0;b",d[0];);return b>4?b:a}();e.onreadystatechange=f>=8?function(){4===e.readyState&&c(e,d)}:new function(){4===e.readyState&&c(e,d)}}catch(g){if(a.XDomainRequest){var h=new XDomainRequest;h.open("get",b),h.onload=function(){c(h,d)},h.onerror=function(){return!1},h.send()}}},k=function(a){for(var b=a.search(/\/\*/),c=a.search(/\*\//);b>-1&&c>b;)a=a.substring(0,b)+a.substring(c+2),b=a.search(/\/\*/),c=a.search(/\*\//);return a},l=function(){return a.matchMedia||a.msMatchMedia?!0:!1},m=function(a){return l()||(a=a.replace(/@media[\s\S]*?\}\s*\}/,"")),a},n=function(){if(a.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP")}catch(b){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}};if(!b()){var o="",p=[],q=[],r=[],s=[],t=[],u=[],v=[],w=document.getElementsByTagName("body")[0],x="";w.currentStyle?x=w.currentStyle.fontSize.indexOf("px")>=0?w.currentStyle.fontSize.replace("px",""):w.currentStyle.fontSize.indexOf("em")>=0?w.currentStyle.fontSize.replace("em",""):w.currentStyle.fontSize.indexOf("pt")>=0?w.currentStyle.fontSize.replace("pt",""):w.currentStyle.fontSize.replace("%","")/100*16:a.getComputedStyle&&(x=document.defaultView.getComputedStyle(w,null).getPropertyValue("font-size").replace("px","")),d()}}(window); \ No newline at end of file diff --git a/package.json b/package.json index 8a2f4de..ef015cc 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "karma-ie-launcher": "~0.1.1", "karma-firefox-launcher": "~0.1.0", "karma-phantomjs-launcher": "~0.1.0", - "karma-safari-launcher": "~0.1.1" + "karma-safari-launcher": "~0.1.1", + "time-grunt": "^0.3.2" }, "dependencies": {} }