Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

minified versions for 0.5

  • Loading branch information...
commit ce0a14507b59c6660ee02b33c8363cb9ebd03d2b 1 parent 42508c8
@tipiirai tipiirai authored
Showing with 23 additions and 22 deletions.
  1. +17 −16 dist/head.js
  2. +3 −3 dist/head.load.min.js
  3. +3 −3 dist/head.min.js
View
33 dist/head.js
@@ -1,20 +1,20 @@
/**
- Head JS The only script in your <HEAD>
+ Head JS The only script in your <HEAD>
Copyright Tero Piirainen (tipiirai)
- License MIT / http://bit.ly/mit-license
+ License MIT / http://bit.ly/mit-license
http://headjs.com
*/
(function(doc) {
var html = doc.documentElement,
- conf = {
+ conf = {
screens: [320, 480, 640, 768, 1024, 1280, 1440, 1680, 1920],
section: "-section",
page: "-page",
head: "head"
- },
- klass = [];
+ },
+ klass = [];
if (window.head_conf) {
@@ -50,7 +50,8 @@
// internal: apply all classes
if (!key) {
html.className += ' ' + klass.join( ' ' );
- return klass = [];
+ klass = [];
+ return;
}
if (Object.prototype.toString.call(enabled) == '[object Function]') {
@@ -103,8 +104,8 @@
if (this.length > 2 && this[i + 1] !== undefined) {
if (i) { pushClass(this.slice(1, i+1).join("-") + conf.section); }
-
- } else {
+
+ } else {
// pageId
var id = el || "index", index = id.indexOf(".");
@@ -112,7 +113,7 @@
html.id = id + conf.page;
// on root?
- if (!i) { pushClass("root" + conf.section); }
+ if (!i) { pushClass("root" + conf.section); }
}
});
@@ -143,9 +144,9 @@
/**
- Head JS The only script in your <HEAD>
+ Head JS The only script in your <HEAD>
Copyright Tero Piirainen (tipiirai)
- License MIT / http://bit.ly/mit-license
+ License MIT / http://bit.ly/mit-license
http://headjs.com
*/
@@ -252,9 +253,9 @@
/**
- Head JS The only script in your <HEAD>
+ Head JS The only script in your <HEAD>
Copyright Tero Piirainen (tipiirai)
- License MIT / http://bit.ly/mit-license
+ License MIT / http://bit.ly/mit-license
http://headjs.com
*/
@@ -262,7 +263,7 @@
var head = doc.documentElement,
ie = navigator.userAgent.toLowerCase().indexOf("msie") != -1,
- ready = false, // is HEAD "ready"
+ ready = false, // is HEAD "ready"
queue = [], // if not -> defer execution
handlers = {}, // user functions waiting for events
scripts = {}; // loadable scripts in different states
@@ -332,11 +333,11 @@
return api;
};
-
+ /*
api.dump = function() {
console.dir(scripts);
};
-/*
+
api.preload = function(url) {
url = { name: toLabel(url), url: url };
preload(url);
View
6 dist/head.load.min.js
@@ -1,7 +1,7 @@
/**
- Head JS The only script in your <HEAD>
+ Head JS The only script in your <HEAD>
Copyright Tero Piirainen (tipiirai)
- License MIT / http://bit.ly/mit-license
+ License MIT / http://bit.ly/mit-license
http://headjs.com
-*/(function(a){var b=a.documentElement,c=navigator.userAgent.toLowerCase().indexOf("msie")!=-1,d=false,e=[],f={},g={};var h=window.head_conf&&head_conf.head||"head",i=window[h]=window[h]||function(){i.ready.apply(null,arguments)};i.js=function(){var a=arguments,b=[].slice.call(a,1),c=b[0];if(!d){e.push(function(){i.js.apply(null,a)});return i}c?(m(c)||l(b,function(a){m(a)||o(k(a))}),p(k(a[0]),m(c)?c:function(){i.js.apply(null,b)})):p(k(a[0]));return i},i.ready=function(a,b){var c=g[a];if(c&&c.state=="loaded"){b.call();return i}m(a)&&(b=a,a="ALL");var d=f[a];d?d.push(b):d=f[a]=[b];return i},i.dump=function(){console.dir(g)};function j(a){var b=a.split("/"),c=b[b.length-1],d=c.indexOf("?");return d!=-1?c.substring(0,d):c}function k(a){var b;if(typeof a=="object")for(var c in a)a[c]&&(b={name:c,url:a[c]});else b={name:j(a),url:a};var d=g[b.name];if(d)return d;g[b.name]=b;return b}function l(a,b){if(a){typeof a=="object"&&(a=[].slice.call(a));for(var c=0;c<a.length;c++)b.call(a,a[c],c)}}function m(a){return Object.prototype.toString.call(a)=="[object Function]"}function n(a){a.state="preloaded",l(a.onpreload,function(a){a.call()})}function o(c,d){if(!c.state){c.state="preloading",c.onpreload=[];if(/Firefox/.test(navigator.userAgent)){var e=a.createElement("object");e.data=c.url,e.width=0,e.height=0,e.onload=function(){n(c),setTimeout(function(){b.removeChild(e)},1)},b.appendChild(e)}else q({src:c.url,type:"cache"},function(){n(c)})}}function p(a,b){if(a.state=="loaded")return b&&b();if(a.state=="preloading")return a.onpreload.push(function(){p(a,b)});a.state="loading",q(a.url,function(){a.state="loaded",b&&b.call(),l(f[a.name],function(a){a.call()});var c=true;for(var d in g)g[d].state!="loaded"&&(c=false);c&&l(f.ALL,function(a){a.done||a.call(),a.done=true})})}function q(c,d){var e=a.createElement("script");e.type="text/"+(c.type||"javascript"),e.src=c.src||c,e.onreadystatechange=e.onload=function(){var a=e.readyState;!d.done&&(!a||/loaded|complete/.test(a))&&(d.call(),d.done=true)},b.appendChild(e)}setTimeout(function(){d=true,l(e,function(a){a.call()})},200)})(document)
+*/(function(a){var b=a.documentElement,c=navigator.userAgent.toLowerCase().indexOf("msie")!=-1,d=false,e=[],f={},g={};var h=window.head_conf&&head_conf.head||"head",i=window[h]=window[h]||function(){i.ready.apply(null,arguments)};i.js=function(){var a=arguments,b=[].slice.call(a,1),c=b[0];if(!d){e.push(function(){i.js.apply(null,a)});return i}c?(m(c)||l(b,function(a){m(a)||o(k(a))}),p(k(a[0]),m(c)?c:function(){i.js.apply(null,b)})):p(k(a[0]));return i},i.ready=function(a,b){var c=g[a];if(c&&c.state=="loaded"){b.call();return i}m(a)&&(b=a,a="ALL");var d=f[a];d?d.push(b):d=f[a]=[b];return i};function j(a){var b=a.split("/"),c=b[b.length-1],d=c.indexOf("?");return d!=-1?c.substring(0,d):c}function k(a){var b;if(typeof a=="object")for(var c in a)a[c]&&(b={name:c,url:a[c]});else b={name:j(a),url:a};var d=g[b.name];if(d)return d;g[b.name]=b;return b}function l(a,b){if(a){typeof a=="object"&&(a=[].slice.call(a));for(var c=0;c<a.length;c++)b.call(a,a[c],c)}}function m(a){return Object.prototype.toString.call(a)=="[object Function]"}function n(a){a.state="preloaded",l(a.onpreload,function(a){a.call()})}function o(c,d){if(!c.state){c.state="preloading",c.onpreload=[];if(/Firefox/.test(navigator.userAgent)){var e=a.createElement("object");e.data=c.url,e.width=0,e.height=0,e.onload=function(){n(c),setTimeout(function(){b.removeChild(e)},1)},b.appendChild(e)}else q({src:c.url,type:"cache"},function(){n(c)})}}function p(a,b){if(a.state=="loaded")return b&&b();if(a.state=="preloading")return a.onpreload.push(function(){p(a,b)});a.state="loading",q(a.url,function(){a.state="loaded",b&&b.call(),l(f[a.name],function(a){a.call()});var c=true;for(var d in g)g[d].state!="loaded"&&(c=false);c&&l(f.ALL,function(a){a.done||a.call(),a.done=true})})}function q(c,d){var e=a.createElement("script");e.type="text/"+(c.type||"javascript"),e.src=c.src||c,e.onreadystatechange=e.onload=function(){var a=e.readyState;!d.done&&(!a||/loaded|complete/.test(a))&&(d.call(),d.done=true)},b.appendChild(e)}setTimeout(function(){d=true,l(e,function(a){a.call()})},200)})(document)
View
6 dist/head.min.js
@@ -1,7 +1,7 @@
/**
- Head JS The only script in your <HEAD>
+ Head JS The only script in your <HEAD>
Copyright Tero Piirainen (tipiirai)
- License MIT / http://bit.ly/mit-license
+ License MIT / http://bit.ly/mit-license
http://headjs.com
-*/(function(a){var b=a.documentElement,c={screens:[320,480,640,768,1024,1280,1440,1680,1920],section:"-section",page:"-page",head:"head"},d=[];if(window.head_conf)for(var e in head_conf)head_conf[e]&&(c[e]=head_conf[e]);function f(a){d.push(a)}function g(a){var c=new RegExp("\\b"+a+"\\b");b.className=b.className.replace(c,"")}function h(a,b){for(var c=0;c<a.length;c++)b.call(a,a[c],c)}var i=window[c.head]=function(){i.ready.apply(null,arguments)};i.feature=function(a,c,e){if(!a){b.className+=" "+d.join(" ");return d=[]}Object.prototype.toString.call(c)=="[object Function]"&&(c=c.call()),f((c?"":"no-")+a),i[a]=!!c,e||(g("no-"+a),g(a),i.feature());return i};var j=navigator.userAgent.toLowerCase();j=/(webkit)[ \/]([\w.]+)/.exec(j)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(j)||/(msie) ([\w.]+)/.exec(j)||!/compatible/.test(j)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(j)||[],j[1]=="msie"&&(j[1]="ie"),f(j[1]),i.browser={version:j[2]},i.browser[j[1]]=true;if(i.browser.ie)for(var k=3;k<11;k++)parseFloat(j[2])<k&&f("lt-ie"+k);h("abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video".split("|"),function(b){a.createElement(b)}),h(location.pathname.split("/"),function(a,d){if(this.length>2&&this[d+1]!==undefined)d&&f(this.slice(1,d+1).join("-")+c.section);else{var e=a||"index",g=e.indexOf(".");g>0&&(e=e.substring(0,g)),b.id=e+c.page,d||f("root"+c.section)}});function l(){var a=window.outerWidth||b.clientWidth;b.className=b.className.replace(/ (w|lt)-\d+/g,""),f("w-"+Math.round(a/100)*100),h(c.screens,function(b){a<=b&&f("lt-"+b)}),i.feature()}l(),window.onresize=l,i.feature("js",true).feature()})(document),function(){var a=document.createElement("i"),b=a.style,c=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),d=window.head_conf&&head_conf.head||"head",e=window[d];function f(a){b.cssText=c.join(a+";");var d=b.cssText;if(d.indexOf("-o")!=-1&&d.indexOf("-ms")!=-1)return false;return!!d}var g={gradient:function(){var a="background-image:",d="gradient(linear,left top,right bottom,from(#9f9),to(#fff));",e="linear-gradient(left top,#eee,#fff);";b.cssText=(a+c.join(d+a)+c.join(e+a)).slice(0,-a.length);return!!b.backgroundImage},rgba:function(){b.cssText="background-color:rgba(0,0,0,0.5)";return!!b.backgroundColor},boxshadow:function(){return f("box-shadow: 0 0 0 red")},textshadow:function(){return b.textShadow===""},multiplebgs:function(){b.cssText="background:url(//:),url(//:),red url(//:)";return(new RegExp("(url\\s*\\(.*?){3}")).test(b.background)},borderimage:function(){return f("border-image: url(m.png) 1 1 stretch")},borderradius:function(){return f("border-radius:0")},opacity:function(){return a.style.opacity===""},reflections:function(){return f("box-reflect:right 0")},transforms:function(){return f("transform:rotate(1deg)")},transitions:function(){return f("transition:all .1s linear")}};for(var h in g)g[h]&&e.feature(h,g[h].call(),true);e.feature()}(),function(a){var b=a.documentElement,c=navigator.userAgent.toLowerCase().indexOf("msie")!=-1,d=false,e=[],f={},g={};var h=window.head_conf&&head_conf.head||"head",i=window[h]=window[h]||function(){i.ready.apply(null,arguments)};i.js=function(){var a=arguments,b=[].slice.call(a,1),c=b[0];if(!d){e.push(function(){i.js.apply(null,a)});return i}c?(m(c)||l(b,function(a){m(a)||o(k(a))}),p(k(a[0]),m(c)?c:function(){i.js.apply(null,b)})):p(k(a[0]));return i},i.ready=function(a,b){var c=g[a];if(c&&c.state=="loaded"){b.call();return i}m(a)&&(b=a,a="ALL");var d=f[a];d?d.push(b):d=f[a]=[b];return i},i.dump=function(){console.dir(g)};function j(a){var b=a.split("/"),c=b[b.length-1],d=c.indexOf("?");return d!=-1?c.substring(0,d):c}function k(a){var b;if(typeof a=="object")for(var c in a)a[c]&&(b={name:c,url:a[c]});else b={name:j(a),url:a};var d=g[b.name];if(d)return d;g[b.name]=b;return b}function l(a,b){if(a){typeof a=="object"&&(a=[].slice.call(a));for(var c=0;c<a.length;c++)b.call(a,a[c],c)}}function m(a){return Object.prototype.toString.call(a)=="[object Function]"}function n(a){a.state="preloaded",l(a.onpreload,function(a){a.call()})}function o(c,d){if(!c.state){c.state="preloading",c.onpreload=[];if(/Firefox/.test(navigator.userAgent)){var e=a.createElement("object");e.data=c.url,e.width=0,e.height=0,e.onload=function(){n(c),setTimeout(function(){b.removeChild(e)},1)},b.appendChild(e)}else q({src:c.url,type:"cache"},function(){n(c)})}}function p(a,b){if(a.state=="loaded")return b&&b();if(a.state=="preloading")return a.onpreload.push(function(){p(a,b)});a.state="loading",q(a.url,function(){a.state="loaded",b&&b.call(),l(f[a.name],function(a){a.call()});var c=true;for(var d in g)g[d].state!="loaded"&&(c=false);c&&l(f.ALL,function(a){a.done||a.call(),a.done=true})})}function q(c,d){var e=a.createElement("script");e.type="text/"+(c.type||"javascript"),e.src=c.src||c,e.onreadystatechange=e.onload=function(){var a=e.readyState;!d.done&&(!a||/loaded|complete/.test(a))&&(d.call(),d.done=true)},b.appendChild(e)}setTimeout(function(){d=true,l(e,function(a){a.call()})},200)}(document)
+*/(function(a){var b=a.documentElement,c={screens:[320,480,640,768,1024,1280,1440,1680,1920],section:"-section",page:"-page",head:"head"},d=[];if(window.head_conf)for(var e in head_conf)head_conf[e]&&(c[e]=head_conf[e]);function f(a){d.push(a)}function g(a){var c=new RegExp("\\b"+a+"\\b");b.className=b.className.replace(c,"")}function h(a,b){for(var c=0;c<a.length;c++)b.call(a,a[c],c)}var i=window[c.head]=function(){i.ready.apply(null,arguments)};i.feature=function(a,c,e){{if(a){Object.prototype.toString.call(c)=="[object Function]"&&(c=c.call()),f((c?"":"no-")+a),i[a]=!!c,e||(g("no-"+a),g(a),i.feature());return i}b.className+=" "+d.join(" "),d=[]}};var j=navigator.userAgent.toLowerCase();j=/(webkit)[ \/]([\w.]+)/.exec(j)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(j)||/(msie) ([\w.]+)/.exec(j)||!/compatible/.test(j)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(j)||[],j[1]=="msie"&&(j[1]="ie"),f(j[1]),i.browser={version:j[2]},i.browser[j[1]]=true;if(i.browser.ie)for(var k=3;k<11;k++)parseFloat(j[2])<k&&f("lt-ie"+k);h("abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video".split("|"),function(b){a.createElement(b)}),h(location.pathname.split("/"),function(a,d){if(this.length>2&&this[d+1]!==undefined)d&&f(this.slice(1,d+1).join("-")+c.section);else{var e=a||"index",g=e.indexOf(".");g>0&&(e=e.substring(0,g)),b.id=e+c.page,d||f("root"+c.section)}});function l(){var a=window.outerWidth||b.clientWidth;b.className=b.className.replace(/ (w|lt)-\d+/g,""),f("w-"+Math.round(a/100)*100),h(c.screens,function(b){a<=b&&f("lt-"+b)}),i.feature()}l(),window.onresize=l,i.feature("js",true).feature()})(document),function(){var a=document.createElement("i"),b=a.style,c=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),d=window.head_conf&&head_conf.head||"head",e=window[d];function f(a){b.cssText=c.join(a+";");var d=b.cssText;if(d.indexOf("-o")!=-1&&d.indexOf("-ms")!=-1)return false;return!!d}var g={gradient:function(){var a="background-image:",d="gradient(linear,left top,right bottom,from(#9f9),to(#fff));",e="linear-gradient(left top,#eee,#fff);";b.cssText=(a+c.join(d+a)+c.join(e+a)).slice(0,-a.length);return!!b.backgroundImage},rgba:function(){b.cssText="background-color:rgba(0,0,0,0.5)";return!!b.backgroundColor},boxshadow:function(){return f("box-shadow: 0 0 0 red")},textshadow:function(){return b.textShadow===""},multiplebgs:function(){b.cssText="background:url(//:),url(//:),red url(//:)";return(new RegExp("(url\\s*\\(.*?){3}")).test(b.background)},borderimage:function(){return f("border-image: url(m.png) 1 1 stretch")},borderradius:function(){return f("border-radius:0")},opacity:function(){return a.style.opacity===""},reflections:function(){return f("box-reflect:right 0")},transforms:function(){return f("transform:rotate(1deg)")},transitions:function(){return f("transition:all .1s linear")}};for(var h in g)g[h]&&e.feature(h,g[h].call(),true);e.feature()}(),function(a){var b=a.documentElement,c=navigator.userAgent.toLowerCase().indexOf("msie")!=-1,d=false,e=[],f={},g={};var h=window.head_conf&&head_conf.head||"head",i=window[h]=window[h]||function(){i.ready.apply(null,arguments)};i.js=function(){var a=arguments,b=[].slice.call(a,1),c=b[0];if(!d){e.push(function(){i.js.apply(null,a)});return i}c?(m(c)||l(b,function(a){m(a)||o(k(a))}),p(k(a[0]),m(c)?c:function(){i.js.apply(null,b)})):p(k(a[0]));return i},i.ready=function(a,b){var c=g[a];if(c&&c.state=="loaded"){b.call();return i}m(a)&&(b=a,a="ALL");var d=f[a];d?d.push(b):d=f[a]=[b];return i};function j(a){var b=a.split("/"),c=b[b.length-1],d=c.indexOf("?");return d!=-1?c.substring(0,d):c}function k(a){var b;if(typeof a=="object")for(var c in a)a[c]&&(b={name:c,url:a[c]});else b={name:j(a),url:a};var d=g[b.name];if(d)return d;g[b.name]=b;return b}function l(a,b){if(a){typeof a=="object"&&(a=[].slice.call(a));for(var c=0;c<a.length;c++)b.call(a,a[c],c)}}function m(a){return Object.prototype.toString.call(a)=="[object Function]"}function n(a){a.state="preloaded",l(a.onpreload,function(a){a.call()})}function o(c,d){if(!c.state){c.state="preloading",c.onpreload=[];if(/Firefox/.test(navigator.userAgent)){var e=a.createElement("object");e.data=c.url,e.width=0,e.height=0,e.onload=function(){n(c),setTimeout(function(){b.removeChild(e)},1)},b.appendChild(e)}else q({src:c.url,type:"cache"},function(){n(c)})}}function p(a,b){if(a.state=="loaded")return b&&b();if(a.state=="preloading")return a.onpreload.push(function(){p(a,b)});a.state="loading",q(a.url,function(){a.state="loaded",b&&b.call(),l(f[a.name],function(a){a.call()});var c=true;for(var d in g)g[d].state!="loaded"&&(c=false);c&&l(f.ALL,function(a){a.done||a.call(),a.done=true})})}function q(c,d){var e=a.createElement("script");e.type="text/"+(c.type||"javascript"),e.src=c.src||c,e.onreadystatechange=e.onload=function(){var a=e.readyState;!d.done&&(!a||/loaded|complete/.test(a))&&(d.call(),d.done=true)},b.appendChild(e)}setTimeout(function(){d=true,l(e,function(a){a.call()})},200)}(document)
Please sign in to comment.
Something went wrong with that request. Please try again.