Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bump new version

  • Loading branch information...
commit 5aa04e1d0adab732cddd8e5c9b28008ee796b1bb 1 parent 318923b
@pyrsmk authored
View
8 README.md
@@ -1,9 +1,9 @@
-molt 4.2.1
+molt 4.2.2
==========
-Molt is a tiny script that updates images according to the current viewport's width or height to have a better responsive design. It's built in top of [W](https://github.com/pyrsmk/W), supports AMD/CommonJS and is available on [bower](http://bower.io).
+Molt is a tiny script that updates images according to the current viewport's width or height to have a better responsive design. It's built in top of [W](https://github.com/pyrsmk/W).
-Molt aims to load your images in simple way, but if you want something more advanced to handle, per example, fluid images you can take a look at [picturefill](http://scottjehl.github.io/picturefill/) which follows the current W3C's `picture` proposal.
+Note that today molt is quite obsolete since the W3C's `picture` proposal is out. You can take a look at [picturefill](http://scottjehl.github.io/picturefill/) which is a `picture` polyfill and a more powerful library than molt.
Install
-------
@@ -11,9 +11,9 @@ Install
You can pick the minified library or install it with :
```
-jam install pyrsmk-molt
bower install molt
npm install pyrsmk-molt --save-dev
+jam install pyrsmk-molt
```
What's new since 3.0
View
2  molt.W.min.js
@@ -1,4 +1,4 @@
/*! W 1.2.2 (https://github.com/pyrsmk/W) */
!function(a,b,c){"undefined"!=typeof module&&module.exports?module.exports=c:"function"==typeof define&&define.amd?define(c):a[b]=c}(this,"W",function(){function a(){var a,b,c,d,e=[{width:screen.availWidth,height:screen.availHeight},{width:window.outerWidth,height:window.outerHeight},{width:window.innerWidth,height:window.innerHeight}];if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&"landscape"==m()?(a=screen.height,b=screen.width):(a=screen.width,b=screen.height),k)return{width:a,height:b};for(c=0,d=e.length;d>c;++c)e[c].note=e[c].width>a||e[c].height>b||!e[c].width||!e[c].height?0:e[c].width<a||e[c].height<b?2+(a-e[c].width)+(b-e[c].height):1;return e.sort(function(a,b){return b.note-a.note}),{width:e[0].width,height:e[0].height}}var b,c,d,e,f=window,g=document,h=g.documentElement,i=[],j=!1,k=!1,l=function(){b=g.createElement("div"),b.style.width="1em",h.appendChild(b),e=b.offsetWidth,e=e?e:16,h.removeChild(b)},m=function(){return"orientation"in window?window.orientation?"landscape":"portrait":h.clientWidth>h.clientHeight?"landscape":"portrait"};return l(),f.addEventListener?"onorientationchange"in f?f.addEventListener("orientationchange",function(){j=!0},!1):f.addEventListener("resize",function(){j=!0},!1):f.attachEvent("onresize",function(){j=!0}),c=g.createElement("b"),c.style.position="absolute",c.style.top="-99em",c.innerHTML="W",h.appendChild(c),d=c.offsetHeight,setInterval(function(){if(b=c.offsetHeight,b!=d&&(j=!0),d=b,j&&h.clientWidth){l();for(var a=0,e=i.length;e>a;++a)i[a]();j=!1}},250),{px2em:function(a){return a/e},getViewportWidth:function(){return a().width},getViewportHeight:function(){return a().height},addListener:function(a){return i.push(a),a},setAbsoluteMode:function(a){k=!!a},getOrientation:function(){return m()}}}());
-/*! molt 4.2.1 (https://github.com/pyrsmk/molt) */
+/*! molt 4.2.2 (https://github.com/pyrsmk/molt) */
!function(a,b,c){"undefined"!=typeof module&&module.exports?module.exports=c:"function"==typeof define&&define.amd?define(c):a[b]=c}(this,"molt",function(){var a=[],b={promises:{early:[],eachonce:[],each:[],thenonce:[],then:[]},add:function(a,b){"function"==typeof b&&this.promises[a].push(b)},run:function(a,b){for(var c=0,d=this.promises[a].length;d>c;++c)this.promises[a][c].apply(this,b)}},c=0,d=function(d,e,f){return function(){e.src=d,b.promises.eachonce.length&&(b.run("eachonce",[e,f]),b.promises.eachonce=[]),b.run("each",[e,f]),--c||(b.promises.thenonce.length&&(b.run("thenonce",[a]),b.promises.thenonce=[]),b.run("then",[a]))}},e=function(a){return function(){throw--c,"An error has occured when loading '"+a+"'"}},f=function(){var f,g,h,i,j,k,l,m,n,o,p,q=W.getViewportWidth(),r=W.getViewportHeight(),s=!0;for(c+=a.length,b.run("early",[a]),i=0,j=a.length;j>i;++i){for(m="",k=0,l=a[i].modes.length;l>k;++k)switch(f=a[i].modes[k].mode,g=parseInt(f.substring(0,f.length-1),10),h=f.substring(f.length-1)){case"w":q>=g&&(o=f,m=a[i].modes[k].src);break;case"h":r>=g&&(o=f,m=a[i].modes[k].src);break;default:throw"Invalid '"+f+"' mode encountered"}n=a[i].node,m?(s=!1,p=new Image,p.src=m,p.complete===!0?(n.src=m,d(m,n,o)()):(p.onload=d(m,n,o),p.onerror=e(m)),"visible"!=n.style.visibility&&(n.style.visibility="visible",n.style.width="auto",n.style.height="auto")):"hidden"!=n.style.visibility&&(--c,n.style.visibility="hidden",n.style.width=0,n.style.height=0)}s&&b.run("then")};return function(c){var d,e,g,h,i,j,k,l;for(void 0===c.length&&(c=[c]),W.addListener(f),g=0,h=c.length;h>g;++g){if(l=c[g].attributes,k={node:c[g],modes:[]},l["data-molt-src"])for(d=l["data-molt-src"].value.match(/\{(.+?)\}/)[1].split(/\s*,\s*/),i=0,j=d.length;j>i;++i)e=d[i].split(":"),k.modes.push({mode:e[0],src:l["data-molt-src"].value.replace(/\{.+?\}/,e[1]||e[0])});else for(i=0,j=l.length;j>i;++i)/^data-molt-\d+[wh]$/i.test(l[i].name)&&k.modes.push({mode:l[i].name.substring(10),src:l[i].value});k.modes.sort(function(a,b){return parseInt(a.mode.substring(0,a.mode.length-1),10)-parseInt(b.mode.substring(0,b.mode.length-1),10)}),a.push(k)}var m={early:function(a){return b.add("early",a),m},eachOnce:function(a){return b.add("eachonce",a),m},each:function(a){return b.add("each",a),m},thenOnce:function(a){return b.add("thenonce",a),m},then:function(a){return b.add("then",a),m},start:function(){f()}};return m}}());
View
2  molt.min.js
@@ -1,2 +1,2 @@
-/*! molt 4.2.1 (https://github.com/pyrsmk/molt) */
+/*! molt 4.2.2 (https://github.com/pyrsmk/molt) */
!function(a,b,c){"undefined"!=typeof module&&module.exports?module.exports=c:"function"==typeof define&&define.amd?define(c):a[b]=c}(this,"molt",function(){var a=[],b={promises:{early:[],eachonce:[],each:[],thenonce:[],then:[]},add:function(a,b){"function"==typeof b&&this.promises[a].push(b)},run:function(a,b){for(var c=0,d=this.promises[a].length;d>c;++c)this.promises[a][c].apply(this,b)}},c=0,d=function(d,e,f){return function(){e.src=d,b.promises.eachonce.length&&(b.run("eachonce",[e,f]),b.promises.eachonce=[]),b.run("each",[e,f]),--c||(b.promises.thenonce.length&&(b.run("thenonce",[a]),b.promises.thenonce=[]),b.run("then",[a]))}},e=function(a){return function(){throw--c,"An error has occured when loading '"+a+"'"}},f=function(){var f,g,h,i,j,k,l,m,n,o,p,q=W.getViewportWidth(),r=W.getViewportHeight(),s=!0;for(c+=a.length,b.run("early",[a]),i=0,j=a.length;j>i;++i){for(m="",k=0,l=a[i].modes.length;l>k;++k)switch(f=a[i].modes[k].mode,g=parseInt(f.substring(0,f.length-1),10),h=f.substring(f.length-1)){case"w":q>=g&&(o=f,m=a[i].modes[k].src);break;case"h":r>=g&&(o=f,m=a[i].modes[k].src);break;default:throw"Invalid '"+f+"' mode encountered"}n=a[i].node,m?(s=!1,p=new Image,p.src=m,p.complete===!0?(n.src=m,d(m,n,o)()):(p.onload=d(m,n,o),p.onerror=e(m)),"visible"!=n.style.visibility&&(n.style.visibility="visible",n.style.width="auto",n.style.height="auto")):"hidden"!=n.style.visibility&&(--c,n.style.visibility="hidden",n.style.width=0,n.style.height=0)}s&&b.run("then")};return function(c){var d,e,g,h,i,j,k,l;for(void 0===c.length&&(c=[c]),W.addListener(f),g=0,h=c.length;h>g;++g){if(l=c[g].attributes,k={node:c[g],modes:[]},l["data-molt-src"])for(d=l["data-molt-src"].value.match(/\{(.+?)\}/)[1].split(/\s*,\s*/),i=0,j=d.length;j>i;++i)e=d[i].split(":"),k.modes.push({mode:e[0],src:l["data-molt-src"].value.replace(/\{.+?\}/,e[1]||e[0])});else for(i=0,j=l.length;j>i;++i)/^data-molt-\d+[wh]$/i.test(l[i].name)&&k.modes.push({mode:l[i].name.substring(10),src:l[i].value});k.modes.sort(function(a,b){return parseInt(a.mode.substring(0,a.mode.length-1),10)-parseInt(b.mode.substring(0,b.mode.length-1),10)}),a.push(k)}var m={early:function(a){return b.add("early",a),m},eachOnce:function(a){return b.add("eachonce",a),m},each:function(a){return b.add("each",a),m},thenOnce:function(a){return b.add("thenonce",a),m},then:function(a){return b.add("then",a),m},start:function(){f()}};return m}}());
View
2  package.json
@@ -1,7 +1,7 @@
{
"name": "pyrsmk-molt",
"description": "A responsive image loader",
- "version": "4.2.1",
+ "version": "4.2.2",
"author": "Aurélien Delogu <pyrsmk@dreamysource.fr> (http://dreamysource.fr)",
"repository": {
"type": "git",
View
2  src/molt.js
@@ -1,4 +1,4 @@
-/*! molt 4.2.1 (https://github.com/pyrsmk/molt) */
+/*! molt 4.2.2 (https://github.com/pyrsmk/molt) */
;(function(context,name,definition){
if(typeof module!='undefined' && module.exports){
Please sign in to comment.
Something went wrong with that request. Please try again.