Skip to content

Commit

Permalink
1.15.4
Browse files Browse the repository at this point in the history
  • Loading branch information
aFarkas committed Oct 22, 2014
1 parent 907c471 commit 1bf0af7
Show file tree
Hide file tree
Showing 35 changed files with 424 additions and 93 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webshim",
"version": "1.15.3",
"version": "1.15.4",
"homepage": "https://github.com/aFarkas/webshim",
"authors": [
"aFarkas <info@corrupt-system.de>"
Expand Down
2 changes: 1 addition & 1 deletion demos/demos/forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<div id="sidebar" class="interface">

<a class="toc_title" href="../index.html"> Webshim <span class="version">(<span class="ws-version">1.15.3</span>)</span></a>
<a class="toc_title" href="../index.html"> Webshim <span class="version">(<span class="ws-version">1.15.4</span>)</span></a>
<ul class="toc_section">
<li>
&raquo; <a href="https://github.com/aFarkas/webshim">GitHub Repository</a>
Expand Down
2 changes: 1 addition & 1 deletion demos/demos/mediaelement.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@

<div id="sidebar" class="interface">

<a class="toc_title" href="../index.html"> Webshim <span class="version">(<span class="ws-version">1.15.3</span>)</span></a>
<a class="toc_title" href="../index.html"> Webshim <span class="version">(<span class="ws-version">1.15.4</span>)</span></a>
<ul class="toc_section">
<li>
&raquo; <a href="https://github.com/aFarkas/webshim">GitHub Repository</a>
Expand Down
4 changes: 2 additions & 2 deletions demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<div id="sidebar" class="interface">

<a class="toc_title"> Webshim <span class="version">(<span class="ws-version">1.15.3</span>)</span></a>
<a class="toc_title"> Webshim <span class="version">(<span class="ws-version">1.15.4</span>)</span></a>
<ul class="toc_section">
<li>
&raquo; <a href="https://github.com/aFarkas/webshim">GitHub Repository</a>
Expand Down Expand Up @@ -146,7 +146,7 @@
<h3 id="downloads">Downloads &amp; Dependencies</h3>
<span style="padding-left: 7px; font-size:11px; font-weight: normal;" class="interface">(Right-click, and use "Save As")</span>
<p>
<a href="https://github.com/aFarkas/webshim/archive/1.15.3.zip" class="download-button"> <strong><i>Download</i></strong> </a>
<a href="https://github.com/aFarkas/webshim/archive/1.15.4.zip" class="download-button"> <strong><i>Download</i></strong> </a>
</p>

<p>
Expand Down
4 changes: 2 additions & 2 deletions js-webshim/dev/polyfiller.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
}

$.extend(webshims, {
version: '1.15.4-pre',
version: '1.15.4',

cfg: {
enhanceAuto: window.Audio && (!window.matchMedia || matchMedia('(min-device-width: 721px)').matches),
Expand Down Expand Up @@ -925,7 +925,7 @@
//<picture
create('picture');
addPolyfill('picture', {
test: ('picturefill' in window) || !!window.HTMLPictureElement,
test: ('picturefill' in window) || !!window.HTMLPictureElement || ('respimage' in window),
d: ['matchMedia'],
c: [18],
loadInit: function(){
Expand Down
8 changes: 6 additions & 2 deletions js-webshim/dev/shims/combos/10.js
Original file line number Diff line number Diff line change
Expand Up @@ -2280,9 +2280,13 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
},
time: function(val, o, noCorrect){
var fVal, i;

if(val){

val = val.split(':');
if(val.length != 2 || isNaN(parseInt(val[0] || '', 10)) || isNaN(parseInt(val[1] || '', 10))){
return val.join(':');
}
if(curCfg.meridian){
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
Expand Down Expand Up @@ -2437,6 +2441,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
createFormat('d');
var tmp, obj;
var ret = '';

if(opts.splitInput){
obj = {yy: 0, mm: 1, dd: 2};
} else {
Expand All @@ -2458,8 +2463,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}
ret = ([addZero(val[obj.yy]), addZero(val[obj.mm]), addZero(val[obj.dd])]).join('-');
}
return ret
;
return ret;
},
color: function(val, opts){
var ret = '#000000';
Expand Down
8 changes: 6 additions & 2 deletions js-webshim/dev/shims/combos/11.js
Original file line number Diff line number Diff line change
Expand Up @@ -1044,9 +1044,13 @@
},
time: function(val, o, noCorrect){
var fVal, i;

if(val){

val = val.split(':');
if(val.length != 2 || isNaN(parseInt(val[0] || '', 10)) || isNaN(parseInt(val[1] || '', 10))){
return val.join(':');
}
if(curCfg.meridian){
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
Expand Down Expand Up @@ -1201,6 +1205,7 @@
createFormat('d');
var tmp, obj;
var ret = '';

if(opts.splitInput){
obj = {yy: 0, mm: 1, dd: 2};
} else {
Expand All @@ -1222,8 +1227,7 @@
}
ret = ([addZero(val[obj.yy]), addZero(val[obj.mm]), addZero(val[obj.dd])]).join('-');
}
return ret
;
return ret;
},
color: function(val, opts){
var ret = '#000000';
Expand Down
8 changes: 6 additions & 2 deletions js-webshim/dev/shims/combos/17.js
Original file line number Diff line number Diff line change
Expand Up @@ -1660,9 +1660,13 @@ webshims.register('form-number-date-api', function($, webshims, window, document
},
time: function(val, o, noCorrect){
var fVal, i;

if(val){

val = val.split(':');
if(val.length != 2 || isNaN(parseInt(val[0] || '', 10)) || isNaN(parseInt(val[1] || '', 10))){
return val.join(':');
}
if(curCfg.meridian){
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
Expand Down Expand Up @@ -1817,6 +1821,7 @@ webshims.register('form-number-date-api', function($, webshims, window, document
createFormat('d');
var tmp, obj;
var ret = '';

if(opts.splitInput){
obj = {yy: 0, mm: 1, dd: 2};
} else {
Expand All @@ -1838,8 +1843,7 @@ webshims.register('form-number-date-api', function($, webshims, window, document
}
ret = ([addZero(val[obj.yy]), addZero(val[obj.mm]), addZero(val[obj.dd])]).join('-');
}
return ret
;
return ret;
},
color: function(val, opts){
var ret = '#000000';
Expand Down
119 changes: 106 additions & 13 deletions js-webshim/dev/shims/combos/18.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! respimage - v0.9.3 - 2014-10-13
/*! respimage - v0.9.5 - 2014-10-22
Licensed MIT */
!function(window, document, undefined) {
"use strict";
Expand Down Expand Up @@ -89,7 +89,7 @@
tLow: .1,
tHigh: .5,
tLazy: .1,
greed: .4
greed: .32
}, srcAttr = "data-risrc", srcsetAttr = srcAttr + "set";
ri.ns = ("ri" + new Date().getTime()).substr(0, 9), currentSrcSupported = "currentSrc" in image,
curSrcProp = currentSrcSupported ? "currentSrc" : "src", ri.supSrcset = "srcset" in image,
Expand Down Expand Up @@ -192,7 +192,7 @@
};
var sizeLengthCache = {};
ri.calcListLength = function(sourceSizeListStr) {
if (!(sourceSizeListStr in sizeLengthCache) || cfg.noCache) {
if (!(sourceSizeListStr in sizeLengthCache) || cfg.uT) {
var sourceSize, parsedSize, length, media, i, len, sourceSizeList = trim(sourceSizeListStr).split(/\s*,\s*/), winningLength = !1;
for (i = 0, len = sourceSizeList.length; len > i && (sourceSize = sourceSizeList[i],
parsedSize = ri.parseSize(sourceSize), length = parsedSize.length, media = parsedSize.media,
Expand All @@ -209,25 +209,27 @@
}
return candidates;
};
var dprM, tLow, greed, tLazy, tHigh, isWinComplete;
var dprM, tLow, greed, tLazy, tHigh, tMemory, isWinComplete;
ri.applySetCandidate = function(candidates, img) {
if (candidates.length) {
var candidate, dpr, i, j, diff, length, bestCandidate, curSrc, curCan, isSameSet, candidateSrc, imageData = img[ri.ns], evaled = !0;
if (curSrc = imageData.curSrc || img[curSrcProp], curCan = imageData.curCan || setSrcToCur(img, curSrc, candidates[0].set),
dpr = ri.getX(candidates, curCan), curSrc && (curCan && (curCan.res += tLazy), isSameSet = !imageData.pic || curCan && curCan.set == candidates[0].set,
curCan && isSameSet && curCan.res >= dpr ? bestCandidate = curCan : img.complete || imageData.src != getImgAttr.call(img, "src") || img.lazyload || (isSameSet || !isWinComplete && !inView(img)) && (bestCandidate = curCan,
curCan && isSameSet && curCan.res >= dpr && tMemory > curCan.res - dpr ? bestCandidate = curCan : img.complete || imageData.src != getImgAttr.call(img, "src") || img.lazyload || (isSameSet || !isWinComplete && !inView(img)) && (bestCandidate = curCan,
candidateSrc = curSrc, evaled = "lazy", isWinComplete && reevaluateAfterLoad(img))),
!bestCandidate) for (candidates.sort(ascendingSort), length = candidates.length,
bestCandidate = candidates[length - 1], i = 0; length > i; i++) if (candidate = candidates[i],
candidate.res >= dpr) {
j = i - 1, bestCandidate = candidates[j] && (diff = candidate.res - dpr) && curSrc != ri.makeUrl(candidate.url) && chooseLowRes(candidates[j].res, diff, dpr) ? candidates[j] : candidate;
break;
}
return bestCandidate && (candidateSrc = ri.makeUrl(bestCandidate.url), currentSrcSupported || (img.currentSrc = candidateSrc),
imageData.curSrc = candidateSrc, imageData.curCan = bestCandidate, candidateSrc != curSrc ? ri.setSrc(img, bestCandidate) : ri.setSize(img)),
return curSrc && curCan && (curCan.res -= tLazy), bestCandidate && (candidateSrc = ri.makeUrl(bestCandidate.url),
currentSrcSupported || (img.currentSrc = candidateSrc), imageData.curSrc = candidateSrc,
imageData.curCan = bestCandidate, candidateSrc != curSrc ? ri.setSrc(img, bestCandidate) : ri.setSize(img)),
evaled;
}
}, ri.getX = function() {
};
ri.getX = function() {
return ri.DPR * cfg.xQuant;
}, ri.setSrc = function(img, bestCandidate) {
var origWidth;
Expand Down Expand Up @@ -293,8 +295,9 @@
};
var resizeThrottle;
ri.setupRun = function(options) {
(!alreadyRun || options.reevaluate || isVwDirty) && (dprM = Math.min(Math.max(ri.DPR * cfg.xQuant, 1), 2),
tLow = cfg.tLow * dprM, tLazy = cfg.tLazy * dprM, greed = cfg.greed * dprM, tHigh = cfg.tHigh),
(!alreadyRun || options.reevaluate || isVwDirty) && (cfg.uT || (ri.DPR = window.devicePixelRatio || 1),
dprM = Math.min(Math.max(ri.DPR * cfg.xQuant, 1), 2.5), tLow = cfg.tLow * dprM,
tLazy = cfg.tLazy * dprM, greed = cfg.greed * dprM, tHigh = cfg.tHigh, tMemory = .6 + .4 * dprM + tLazy),
isVwDirty && (lengthCache = {}, sizeLengthCache = {}, updateView(), options.elements || options.context || clearTimeout(resizeThrottle));
}, ri.teardownRun = function() {
var parent;
Expand Down Expand Up @@ -328,10 +331,100 @@
alreadyRun && ri.fillImgs({
reevaluate: !0
});
}, window.respimage = respimage, "object" == typeof module && "object" == typeof module.exports ? module.exports = respimage : "function" == typeof define && define.amd && define(function() {
return respimage;
});
}, window.respimage = respimage;
}(window, document);
(function( factory ) {
"use strict";
var interValId;
var intervalIndex = 0;
var run = function(){
if ( window.respimage ) {
factory( window.respimage );
}
if(window.respimage || intervalIndex > 9999){
clearInterval(interValId);
}
intervalIndex++;
};
interValId = setInterval(run, 8);

run();

}( function( respimage ) {
"use strict";

var ri = respimage._;
var runningTests = 0;
var setTypeValue = function(types, value){
var i;
for(i = 0; i < types.length; i++){
ri.types[types[i]] = value;
}
};

if(window.HTMLPictureElement && !ri.cfg.uT){
respimage.testTypeSupport = function(){};
return;
}

ri.types["image/bmp"] = true;
ri.types["image/x-bmp"] = true;

respimage.testTypeSupport = function(types, url, width, useCanvas){
if(typeof types == "string"){
types = types.split(/\s*\,*\s+/g);
}
var canvas;
var supports = "pending";
var img = document.createElement('img');
var onComplete = function(){
runningTests--;
setTypeValue(types, supports);
if(runningTests < 1){
respimage({reevaluate: true});
}
};

if(useCanvas){
canvas = document.createElement('canvas');
if(!canvas.getContext){
setTypeValue(types, false);
return;
}
}

img.onload = function(){
var ctx;
supports = true;
if(width){
supports = img.width == width;
}

if(useCanvas){
ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0);
supports = ctx.getImageData(0, 0, 1, 1).data[3] === 0;
}
onComplete();
};

img.onerror = function(){
supports = false;
onComplete();
};
runningTests++;
setTypeValue(types, "pending");
img.src = url;
};


respimage.testTypeSupport("image/webp", "data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==", 1);
respimage.testTypeSupport("image/jp2 image/jpx image/jpm", "data:image/jp2;base64,AAAADGpQICANCocKAAAAFGZ0eXBqcDIgAAAAAGpwMiAAAABHanAyaAAAABZpaGRyAAAAAQAAAAEAAQAHAAAAAAAPY29scgEAAAAAABEAAAAacmVzIAAAABJyZXNjAGAA/gBgAP4EBAAAAABqcDJj/0//UQApAAAAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAABAAEB/1wADUAIEBAYEBAYEBAY/1IADAAAAAEAAwQEAAH/ZAAPAAFMV0ZfSlAyXzIxMf+QAAoAAAAAABIAAf+TgICAgP/Z", 1);
respimage.testTypeSupport("image/vnd.ms-photo", "data:image/vnd.ms-photo;base64,SUm8AQgAAAAFAAG8AQAQAAAASgAAAIC8BAABAAAAAQAAAIG8BAABAAAAAQAAAMC8BAABAAAAWgAAAMG8BAABAAAAHwAAAAAAAAAkw91vA07+S7GFPXd2jckNV01QSE9UTwAZAYBxAAAAABP/gAAEb/8AAQAAAQAAAA==", 1);
respimage.testTypeSupport("video/png video/apng video/x-mng video/x-png", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACGFjVEwAAAABAAAAAcMq2TYAAAANSURBVAiZY2BgYPgPAAEEAQB9ssjfAAAAGmZjVEwAAAAAAAAAAQAAAAEAAAAAAAAAAAD6A+gBAbNU+2sAAAARZmRBVAAAAAEImWNgYGBgAAAABQAB6MzFdgAAAABJRU5ErkJggg==", false, true);

}));

(function(){

webshim.isReady('picture', true);
Expand Down
8 changes: 6 additions & 2 deletions js-webshim/dev/shims/combos/5.js
Original file line number Diff line number Diff line change
Expand Up @@ -1871,9 +1871,13 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
},
time: function(val, o, noCorrect){
var fVal, i;

if(val){

val = val.split(':');
if(val.length != 2 || isNaN(parseInt(val[0] || '', 10)) || isNaN(parseInt(val[1] || '', 10))){
return val.join(':');
}
if(curCfg.meridian){
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
Expand Down Expand Up @@ -2028,6 +2032,7 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
createFormat('d');
var tmp, obj;
var ret = '';

if(opts.splitInput){
obj = {yy: 0, mm: 1, dd: 2};
} else {
Expand All @@ -2049,8 +2054,7 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
}
ret = ([addZero(val[obj.yy]), addZero(val[obj.mm]), addZero(val[obj.dd])]).join('-');
}
return ret
;
return ret;
},
color: function(val, opts){
var ret = '#000000';
Expand Down
8 changes: 6 additions & 2 deletions js-webshim/dev/shims/combos/6.js
Original file line number Diff line number Diff line change
Expand Up @@ -1871,9 +1871,13 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
},
time: function(val, o, noCorrect){
var fVal, i;

if(val){

val = val.split(':');
if(val.length != 2 || isNaN(parseInt(val[0] || '', 10)) || isNaN(parseInt(val[1] || '', 10))){
return val.join(':');
}
if(curCfg.meridian){
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
Expand Down Expand Up @@ -2028,6 +2032,7 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
createFormat('d');
var tmp, obj;
var ret = '';

if(opts.splitInput){
obj = {yy: 0, mm: 1, dd: 2};
} else {
Expand All @@ -2049,8 +2054,7 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
}
ret = ([addZero(val[obj.yy]), addZero(val[obj.mm]), addZero(val[obj.dd])]).join('-');
}
return ret
;
return ret;
},
color: function(val, opts){
var ret = '#000000';
Expand Down

0 comments on commit 1bf0af7

Please sign in to comment.