Bundle update, including new webshims version

This commit is contained in:
echarp 2014-09-03 00:57:03 +02:00
parent 151e4937c4
commit 7da30d42a5
64 changed files with 5622 additions and 5704 deletions

View File

@ -114,7 +114,7 @@ GEM
font-awesome-rails (4.2.0.0)
railties (>= 3.2, < 5.0)
formatador (0.2.5)
formtastic (2.3.0)
formtastic (2.3.1)
actionpack (>= 3.0)
fssm (0.2.10)
geocoder (1.2.4)
@ -160,7 +160,7 @@ GEM
jbuilder (2.1.3)
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
jquery-rails (3.1.1)
jquery-rails (3.1.2)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
jquery-turbolinks (2.1.0)
@ -282,7 +282,7 @@ GEM
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.1.3)
sprockets-rails (2.1.4)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
@ -313,7 +313,7 @@ GEM
warden (1.2.3)
rack (>= 1.0)
webrick (1.3.1)
webshims-rails (1.14.6)
webshims-rails (1.15.2)
rails (> 3.1.0)
PLATFORMS

View File

@ -1,511 +0,0 @@
/* Modernizr 2.7.1 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-canvas-audio-video-input-inputtypes-geolocation-shiv-addtest-prefixed-testprop-testallprops-prefixes-domprefixes
*/
;
window.Modernizr = (function( window, document, undefined ) {
var version = '2.7.1',
Modernizr = {},
docElement = document.documentElement,
mod = 'modernizr',
modElem = document.createElement(mod),
mStyle = modElem.style,
inputElem = document.createElement('input') ,
smile = ':)',
toString = {}.toString,
prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
omPrefixes = 'Webkit Moz O ms',
cssomPrefixes = omPrefixes.split(' '),
domPrefixes = omPrefixes.toLowerCase().split(' '),
tests = {},
inputs = {},
attrs = {},
classes = [],
slice = classes.slice,
featureName,
_hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;
if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
hasOwnProp = function (object, property) {
return _hasOwnProperty.call(object, property);
};
}
else {
hasOwnProp = function (object, property) {
return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
};
}
if (!Function.prototype.bind) {
Function.prototype.bind = function bind(that) {
var target = this;
if (typeof target != "function") {
throw new TypeError();
}
var args = slice.call(arguments, 1),
bound = function () {
if (this instanceof bound) {
var F = function(){};
F.prototype = target.prototype;
var self = new F();
var result = target.apply(
self,
args.concat(slice.call(arguments))
);
if (Object(result) === result) {
return result;
}
return self;
} else {
return target.apply(
that,
args.concat(slice.call(arguments))
);
}
};
return bound;
};
}
function setCss( str ) {
mStyle.cssText = str;
}
function setCssAll( str1, str2 ) {
return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
}
function is( obj, type ) {
return typeof obj === type;
}
function contains( str, substr ) {
return !!~('' + str).indexOf(substr);
}
function testProps( props, prefixed ) {
for ( var i in props ) {
var prop = props[i];
if ( !contains(prop, "-") && mStyle[prop] !== undefined ) {
return prefixed == 'pfx' ? prop : true;
}
}
return false;
}
function testDOMProps( props, obj, elem ) {
for ( var i in props ) {
var item = obj[props[i]];
if ( item !== undefined) {
if (elem === false) return props[i];
if (is(item, 'function')){
return item.bind(elem || obj);
}
return item;
}
}
return false;
}
function testPropsAll( prop, prefixed, elem ) {
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
if(is(prefixed, "string") || is(prefixed, "undefined")) {
return testProps(props, prefixed);
} else {
props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
return testDOMProps(props, prefixed, elem);
}
}
tests['canvas'] = function() {
var elem = document.createElement('canvas');
return !!(elem.getContext && elem.getContext('2d'));
}; tests['geolocation'] = function() {
return 'geolocation' in navigator;
};
tests['video'] = function() {
var elem = document.createElement('video'),
bool = false;
try {
if ( bool = !!elem.canPlayType ) {
bool = new Boolean(bool);
bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,'');
bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');
bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
}
} catch(e) { }
return bool;
};
tests['audio'] = function() {
var elem = document.createElement('audio'),
bool = false;
try {
if ( bool = !!elem.canPlayType ) {
bool = new Boolean(bool);
bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,'');
bool.m4a = ( elem.canPlayType('audio/x-m4a;') ||
elem.canPlayType('audio/aac;')) .replace(/^no$/,'');
}
} catch(e) { }
return bool;
}; function webforms() {
Modernizr['input'] = (function( props ) {
for ( var i = 0, len = props.length; i < len; i++ ) {
attrs[ props[i] ] = !!(props[i] in inputElem);
}
if (attrs.list){
attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
}
return attrs;
})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
Modernizr['inputtypes'] = (function(props) {
for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {
inputElem.setAttribute('type', inputElemType = props[i]);
bool = inputElem.type !== 'text';
if ( bool ) {
inputElem.value = smile;
inputElem.style.cssText = 'position:absolute;visibility:hidden;';
if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {
docElement.appendChild(inputElem);
defaultView = document.defaultView;
bool = defaultView.getComputedStyle &&
defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
(inputElem.offsetHeight !== 0);
docElement.removeChild(inputElem);
} else if ( /^(search|tel)$/.test(inputElemType) ){
} else if ( /^(url|email)$/.test(inputElemType) ) {
bool = inputElem.checkValidity && inputElem.checkValidity() === false;
} else {
bool = inputElem.value != smile;
}
}
inputs[ props[i] ] = !!bool;
}
return inputs;
})('search tel url email datetime date month week time datetime-local number range color'.split(' '));
}
for ( var feature in tests ) {
if ( hasOwnProp(tests, feature) ) {
featureName = feature.toLowerCase();
Modernizr[featureName] = tests[feature]();
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
}
}
Modernizr.input || webforms();
Modernizr.addTest = function ( feature, test ) {
if ( typeof feature == 'object' ) {
for ( var key in feature ) {
if ( hasOwnProp( feature, key ) ) {
Modernizr.addTest( key, feature[ key ] );
}
}
} else {
feature = feature.toLowerCase();
if ( Modernizr[feature] !== undefined ) {
return Modernizr;
}
test = typeof test == 'function' ? test() : test;
if (typeof enableClasses !== "undefined" && enableClasses) {
docElement.className += ' ' + (test ? '' : 'no-') + feature;
}
Modernizr[feature] = test;
}
return Modernizr;
};
setCss('');
modElem = inputElem = null;
;(function(window, document) {
var version = '3.7.0';
var options = window.html5 || {};
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
var supportsHtml5Styles;
var expando = '_html5shiv';
var expanID = 0;
var expandoData = {};
var supportsUnknownElements;
(function() {
try {
var a = document.createElement('a');
a.innerHTML = '<xyz></xyz>';
supportsHtml5Styles = ('hidden' in a);
supportsUnknownElements = a.childNodes.length == 1 || (function() {
(document.createElement)('a');
var frag = document.createDocumentFragment();
return (
typeof frag.cloneNode == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createElement == 'undefined'
);
}());
} catch(e) {
supportsHtml5Styles = true;
supportsUnknownElements = true;
}
}());
function addStyleSheet(ownerDocument, cssText) {
var p = ownerDocument.createElement('p'),
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
p.innerHTML = 'x<style>' + cssText + '</style>';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
function getElements() {
var elements = html5.elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
}
function getExpandoData(ownerDocument) {
var data = expandoData[ownerDocument[expando]];
if (!data) {
data = {};
expanID++;
ownerDocument[expando] = expanID;
expandoData[expanID] = data;
}
return data;
}
function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nodeName]) {
node = data.cache[nodeName].cloneNode();
} else if (saveClones.test(nodeName)) {
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
} else {
node = data.createElem(nodeName);
}
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
}
function createDocumentFragment(ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data = data || getExpandoData(ownerDocument);
var clone = data.frag.cloneNode(),
i = 0,
elems = getElements(),
l = elems.length;
for(;i<l;i++){
clone.createElement(elems[i]);
}
return clone;
}
function shivMethods(ownerDocument, data) {
if (!data.cache) {
data.cache = {};
data.createElem = ownerDocument.createElement;
data.createFrag = ownerDocument.createDocumentFragment;
data.frag = data.createFrag();
}
ownerDocument.createElement = function(nodeName) {
if (!html5.shivMethods) {
return data.createElem(nodeName);
}
return createElement(nodeName, ownerDocument, data);
};
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
getElements().join().replace(/[\w\-]+/g, function(nodeName) {
data.createElem(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
}) +
');return n}'
)(html5, data.frag);
}
function shivDocument(ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
}
var data = getExpandoData(ownerDocument);
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
data.hasCSS = !!addStyleSheet(ownerDocument,
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
'mark{background:#FF0;color:#000}' +
'template{display:none}'
);
}
if (!supportsUnknownElements) {
shivMethods(ownerDocument, data);
}
return ownerDocument;
}
var html5 = {
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',
'version': version,
'shivCSS': (options.shivCSS !== false),
'supportsUnknownElements': supportsUnknownElements,
'shivMethods': (options.shivMethods !== false),
'type': 'default',
'shivDocument': shivDocument,
createElement: createElement,
createDocumentFragment: createDocumentFragment
};
window.html5 = html5;
shivDocument(document);
}(this, document));
Modernizr._version = version;
Modernizr._prefixes = prefixes;
Modernizr._domPrefixes = domPrefixes;
Modernizr._cssomPrefixes = cssomPrefixes;
Modernizr.testProp = function(prop){
return testProps([prop]);
};
Modernizr.testAllProps = testPropsAll;
Modernizr.prefixed = function(prop, obj, elem){
if(!obj) {
return testPropsAll(prop, 'pfx');
} else {
return testPropsAll(prop, obj, elem);
}
};
return Modernizr;
})(this, this.document);
;
if(window.console){
console.log('webshim no longer depends on Modernizr. You can still use for feature detection of course.');
}

View File

@ -16,7 +16,7 @@
factory = function(){return window.webshims;};
}
};
window.webshims = {
setOptions: function(){
@ -37,7 +37,7 @@
window.asyncWebshims.polyfill = features;
},
_curScript: (function(){
var scripts, i, scriptUrl;
var scripts, i, scriptUrl, match, regUrl;
//modern browsers: Chrome 29+, Firefox 4+
var currentScript = document.currentScript;
@ -53,8 +53,17 @@
} catch (e) {
//Safari has sourceURL
scriptUrl = (e.sourceURL || e.stack || '').split('\n');
//extract scriptUrl from stack: this is dangerous! All browsers have different string patterns (pattern can even vary between different browser versions). Help to make it bulletproof!!!
scriptUrl = ((scriptUrl[scriptUrl.length - 1] || scriptUrl[scriptUrl.length - 2] || '').match(/(?:fil|htt|wid|abo|app|res)(.)+/i) || [''])[0].replace(/[\:\s\(]+[\d\:\)\(\s]+$/, '');
regUrl = /(?:fil|htt|wid|abo|app|res)(.)+/i;
for(i = 0; i < scriptUrl.length; i++){
//extract scriptUrl from stack: this is dangerous! All browsers have different string patterns (pattern can even vary between different browser versions). Help to make it bulletproof!!!
if((match = scriptUrl[i].match(regUrl))){
scriptUrl = match[0].replace(/[\:\s\(]+[\d\:\)\(\s]+$/, '');
break;
}
}
}
scripts = document.scripts || document.getElementsByTagName('script');
@ -127,7 +136,7 @@
}
$.extend(webshims, {
version: '1.14.6',
version: '1.15.2',
cfg: {
enhanceAuto: window.Audio && (!window.matchMedia || matchMedia('(min-device-width: 721px)').matches),
@ -139,15 +148,7 @@
wspopover: {appendTo: 'auto', hideOnBlur: true},
ajax: {},
loadScript: function(src, success){
if(!$.ajax || !$.ajaxSettings.xhr){
if(window.yepnope){
yepnope.injectJs(src, success);
} else if(window.require){
require([src], success);
}
} else {
$.ajax($.extend({}, webCFG.ajax, {url: src, success: success, dataType: 'script', cache: true, global: false, dataFilter: addSource}));
}
$.ajax($.extend({}, webCFG.ajax, {url: src, success: success, dataType: 'script', cache: true, global: false, dataFilter: addSource}));
},
basePath: path
},
@ -166,20 +167,6 @@
$.extend(true, webCFG, name);
}
},
getLazyFn: function(fn, modules){
var load = function(){
loadList(modules);
};
onReady('WINDOWLOAD', load);
return function(){
var args = arguments;
var obj = this;
load();
onReady(modules, function(){
obj[fn].apply(obj, args);
});
};
},
_getAutoEnhance: getAutoEnhance,
addPolyfill: function(name, cfg){
cfg = cfg || {};
@ -192,7 +179,7 @@
webshimsFeatures[feature].push(name);
cfg.options = $.extend(webCFG[feature], cfg.options);
addModule(name, cfg);
if (cfg.methodNames) {
$.each(cfg.methodNames, function(i, methodName){
@ -207,11 +194,11 @@
features = webshims.featureList;
WSDEBUG && webshims.warn('loading all features without specifing might be bad for performance');
}
if (typeof features == 'string') {
features = features.split(' ');
}
if(WSDEBUG){
for(var i = 0; i < features.length; i++){
if(loaded[features[i]]){
@ -233,7 +220,7 @@
if(hasFormsExt && $.inArray('forms', features) == -1){
features.push('forms');
if(WSDEBUG){
webshims.error('need to load forms feature to use forms-ext feature.');
webshims.warn('need to load forms feature to use forms-ext feature.');
}
}
if(webCFG.loadStyles){
@ -241,14 +228,14 @@
}
}
if (webCFG.waitReady) {
$.readyWait++;
onReady(features, function(){
$.ready(true);
});
}
$.each(features, function(i, feature){
feature = featureAlias[feature] || feature;
@ -280,7 +267,7 @@
}
});
},
/*
* handle ready modules
*/
@ -294,7 +281,7 @@
delete special[readyName];
}
webshimsFeatures[module.f];
resList.push(name);
}
};
@ -308,13 +295,13 @@
};
})(),
isReady: function(name, _set){
name = name + 'Ready';
if (_set) {
if (special[name] && special[name].add) {
return true;
}
special[name] = $.extend(special[name] || {}, {
add: function(details){
details.handler.call(this, name);
@ -329,7 +316,7 @@
if (typeof events == 'string') {
events = events.split(' ');
}
if (!_created) {
events = $.map($.grep(events, function(evt){
return !isReady(evt);
@ -344,15 +331,15 @@
var readyEv = events.shift(), readyFn = function(){
onReady(events, fn, true);
};
$(document).one(readyEv, readyFn);
},
/*
* basic DOM-/jQuery-Helpers
*/
capturingEvents: function(names, _maybePrevented){
if (!document.addEventListener) {
return;
@ -398,14 +385,14 @@
} else {
ready();
}
},
c: {},
/*
* loader
*/
loader: {
addModule: function(name, ext){
modules[name] = ext;
ext.name = ext.name || name;
@ -420,7 +407,7 @@
});
},
loadList: (function(){
var loadedModules = [];
var loadScript = function(src, names){
if (typeof names == 'string') {
@ -429,7 +416,7 @@
$.merge(loadedModules, names);
loader.loadScript(src, false, names);
};
var noNeedToLoad = function(name, list){
if (isReady(name) || $.inArray(name, loadedModules) != -1) {
return true;
@ -447,7 +434,7 @@
}
return true;
};
var setDependencies = function(module, list){
if (module.d && module.d.length) {
var addDependency = function(i, dependency){
@ -461,7 +448,7 @@
addDependency(i, dependency);
}
}
else
else
if (webshimsFeatures[dependency]) {
$.each(webshimsFeatures[dependency], addDependency);
onReady(webshimsFeatures[dependency], function(){
@ -474,7 +461,7 @@
}
}
};
return function(list){
var module;
var loadCombos = [];
@ -494,7 +481,7 @@
return false;
}
};
//length of list is dynamically
for (i = 0; i < list.length; i++) {
module = modules[list[i]];
@ -507,24 +494,24 @@
if (module.css && webCFG.loadStyles) {
loader.loadCSS(module.css);
}
if (module.loadInit) {
module.loadInit();
}
setDependencies(module, list);
if(!module.loaded){
loadCombos.push(module.name);
}
module.loaded = true;
}
for(i = 0, len = loadCombos.length; i < len; i++){
foundCombo = false;
module = loadCombos[i];
if($.inArray(module, loadedModules) == -1){
if(webCFG.debug != 'noCombo'){
$.each(modules[module].c, loadCombo);
@ -536,12 +523,12 @@
}
};
})(),
makePath: function(src){
if (src.indexOf('//') != -1 || src.indexOf('/') === 0) {
return src;
}
if (src.indexOf('.') == -1) {
src += '.js';
}
@ -550,7 +537,7 @@
}
return webCFG.basePath + src;
},
loadCSS: (function(){
var parent, loadedSrcs = {};
return function(src){
@ -565,7 +552,7 @@
});
};
})(),
loadScript: (function(){
var loadedSrcs = {};
return function(src, callback, name, noShimPath){
@ -574,11 +561,11 @@
}
if (loadedSrcs[src]) {return;}
var complete = function(){
if (callback) {
callback();
}
if (name) {
if (typeof name == 'string') {
name = name.split(' ');
@ -592,22 +579,22 @@
}
isReady(!modules[name].noAutoCallback ? name : name + 'FileLoaded', true);
});
}
};
loadedSrcs[src] = 1;
webCFG.loadScript(src, complete, $.noop);
};
})()
}
});
/*
* shortcuts
*/
var webCFG = webshims.cfg;
var webshimsFeatures = webshims.features;
var isReady = webshims.isReady;
@ -625,7 +612,7 @@
};
var $fn = $.fn;
var video = create('video');
webshims.addMethodName = function(name){
name = name.split(':');
var prop = name[1];
@ -635,7 +622,7 @@
} else {
name = name[0];
}
$fn[name] = function(){
return this.callProp(prop, arguments);
};
@ -644,11 +631,11 @@
$fn.callProp = function(prop, args){
var ret;
if(!args){
args = [];
args = [];
}
this.each(function(){
var fn = $.prop(this, prop);
if (fn && fn.apply) {
ret = fn.apply(this, args);
if (ret !== undefined) {
@ -660,8 +647,8 @@
});
return (ret !== undefined) ? ret : this;
};
webshims.activeLang = (function(){
@ -687,7 +674,7 @@
return curLang;
};
})();
webshims.errorLog = [];
$.each(['log', 'error', 'warn', 'info'], function(i, fn){
webshims[fn] = function(message){
@ -705,21 +692,21 @@
webshims.error('Could not detect currentScript! Use basePath to set script path.');
}
}
/*
* jQuery-plugins for triggering dom updates can be also very usefull in conjunction with non-HTML5 DOM-Changes (AJAX)
* Example:
* $.webshims.addReady(function(context, insertedElement){
* webshim.addReady(function(context, insertedElement){
* $('div.tabs', context).add(insertedElement.filter('div.tabs')).tabs();
* });
*
*
* $.ajax({
* success: function(html){
* $('#main').htmlPolyfill(html);
* }
* });
*/
(function(){
//Overwrite DOM-Ready and implement a new ready-method
$.isDOMReady = $.isReady;
@ -731,10 +718,10 @@
isReady('WINDOWLOAD', true);
}, 9999);
};
firstRun = function(){
if(!firstRun.run){
if(webCFG.debug || (!('crossDomain' in webCFG.ajax) && location.protocol.indexOf('http'))){
webCFG.ajax.crossDomain = true;
}
@ -750,11 +737,11 @@
webshims.error('in a jQuery mobile enviroment: you should change the waitReady to false.')
}
}
if (WSDEBUG && webCFG.waitReady && $.isReady) {
webshims.warn('Call webshims.polyfill before DOM-Ready or set waitReady to false.');
}
if(!$.isDOMReady && webCFG.waitReady){
var $Ready = $.ready;
$.ready = function(unwait){
@ -780,7 +767,7 @@
isReady('WINDOWLOAD', true);
}, 9);
});
var readyFns = [];
var eachTrigger = function(){
if(this.nodeType == 1){
@ -828,11 +815,11 @@
}
return ret;
};
$fn.jProp = function(){
return this.pushStack($($fn.prop.apply(this, arguments) || []));
};
$.each(['after', 'before', 'append', 'prepend', 'replaceWith'], function(i, name){
$fn[name+'Polyfill'] = function(a){
a = $(a);
@ -842,9 +829,9 @@
}
return this;
};
});
$.each(['insertAfter', 'insertBefore', 'appendTo', 'prependTo', 'replaceAll'], function(i, name){
$fn[name.replace(/[A-Z]/, function(c){return "Polyfill"+c;})] = function(){
$fn[name].apply(this, arguments);
@ -854,23 +841,23 @@
return this;
};
});
$fn.updatePolyfill = function(){
if($.isDOMReady){
webshims.triggerDomUpdate(this);
}
return this;
};
$.each(['getNativeElement', 'getShadowElement', 'getShadowFocusElement'], function(i, name){
$fn[name] = function(){
return this.pushStack(this);
};
});
})();
if(WSDEBUG){
webCFG.debug = true;
}
@ -891,18 +878,18 @@
return o;
};
}
/*
* Start Features
* Start Features
*/
/* general modules */
/* change path $.webshims.modules[moduleName].src */
addModule('swfmini', {
test: function(){
if(window.swfobject && !window.swfmini){
@ -913,19 +900,18 @@
c: [16, 7, 2, 8, 1, 12, 23]
});
modules.swfmini.test();
addModule('sizzle', {test: $.expr.filters});
addModule('jajax', {test: $.ajax && $.ajaxSettings.xhr});
/*
* polyfill-Modules
/*
* polyfill-Modules
*/
// webshims lib uses a of http://github.com/kriskowal/es5-shim/ to implement
addPolyfill('es5', {
test: !!(support.ES5 && Function.prototype.bind),
d: ['sizzle']
});
addPolyfill('dom-extend', {
f: DOMSUPPORT,
noAutoCallback: true,
@ -952,15 +938,22 @@
});
//>
//<sticky
addPolyfill('sticky', {
test: (($(create('b')).attr('style', 'position: -webkit-sticky; position: sticky').css('position') || '').indexOf('sticky') != -1),
d: ['es5', 'matchMedia']
});
//>
//<es6
addPolyfill('es6', {
test: !!(Math.imul && Number.MIN_SAFE_INTEGER && Object.is && window.Promise && Promise.all),// && window.Map && Map.prototype && typeof Map.prototype.forEach !== 'function' && window.Set
d: ['es5']
});
//>
//<geolocation
addPolyfill('geolocation', {
test: 'geolocation' in navigator,
options: {
@ -976,17 +969,17 @@
addPolyfill('usermedia-core', {
f: 'usermedia',
test: userMediaTest,
d: [DOMSUPPORT]
test: userMediaTest && window.URL,
d: ['url', DOMSUPPORT]
});
addPolyfill('usermedia-shim', {
f: 'usermedia',
test: !!(userMediaTest || navigator.webkitGetUserMedia || navigator.mozGetUserMedia),
test: !!(userMediaTest || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia),
d: ['url', 'mediaelement', DOMSUPPORT]
});
//>
//<canvas
(function(){
addPolyfill('canvas', {
@ -994,7 +987,7 @@
test: ('getContext' in create('canvas')),
options: {type: 'flash'}, //excanvas | flash | flashpro
noAutoCallback: true,
loadInit: function(){
var type = this.options.type;
if(type && type.indexOf('flash') !== -1 && (!modules.swfmini.test() || swfmini.hasFlashPlayerVersion('9.0.0'))){
@ -1006,8 +999,8 @@
});
})();
//>
//<forms
(function(){
var formExtend, formOptions;
@ -1092,13 +1085,13 @@
webshims.validationMessages = webshims.validityMessages = {
langSrc: 'i18n/formcfg-',
langSrc: 'i18n/formcfg-',
availableLangs: "ar cs el es fa fr he hi hu it ja lt nl pl pt pt-BR pt-PT ru sv zh-CN zh-TW".split(' ')
};
webshims.formcfg = $.extend({}, webshims.validationMessages);
webshims.inputTypes = {};
addPolyfill('form-core', {
f: 'forms',
d: ['es5'],
@ -1124,9 +1117,9 @@
methodNames: ['setCustomValidity', 'checkValidity', 'setSelectionRange'],
c: [16, 7, 2, 8, 1, 15, 30, 3, 31]
});
formOptions = webCFG.forms;
addPolyfill('form-native-extend', {
f: 'forms',
test: function(toLoad){
@ -1136,7 +1129,7 @@
d: ['form-core', DOMSUPPORT, 'form-message'],
c: [6, 5, 14, 29]
});
addPolyfill(fShim, {
f: 'forms',
test: function(){
@ -1146,7 +1139,7 @@
d: ['form-core', DOMSUPPORT, 'sizzle'],
c: [16, 15, 28]
});
addPolyfill(fShim+'2', {
f: 'forms',
test: function(){
@ -1156,7 +1149,7 @@
d: [fShim],
c: [27]
});
addPolyfill('form-message', {
f: 'forms',
test: function(toLoad){
@ -1187,7 +1180,7 @@
d: ['forms', DOMSUPPORT],
c: [6, 5, 17, 14, 28, 29, 33]
});
addModule('range-ui', {
options: {},
noAutoCallback: true,
@ -1197,7 +1190,7 @@
d: ['es5'],
c: [6, 5, 9, 10, 17, 11]
});
addPolyfill('form-number-date-ui', {
f: 'forms-ext',
test: function(){
@ -1219,7 +1212,7 @@
},
c: [6, 5, 9, 10, 17, 11]
});
addPolyfill('form-datalist', {
f: 'forms',
test: function(){
@ -1234,19 +1227,32 @@
});
})();
//>
//<filereader
webshim.loader.addModule('moxie', {
src: 'moxie/js/moxie',
c: [26]
var supportFileReader = 'FileReader' in window && 'FormData' in window;
addPolyfill('filereader-xhr', {
f: 'filereader',
test: supportFileReader,
d: [DOMSUPPORT, 'swfmini'],
c: [25, 27]
});
addPolyfill('filereader', {
test: 'FileReader' in window && 'FormData' in window,
d: [DOMSUPPORT, 'jajax'],
c: [25, 26, 27]
addPolyfill('canvas-blob', {
f: 'filereader',
methodNames: ['toBlob'],
test: !(supportFileReader && !create('canvas').toBlob)
});
//>
/*
//<mediacapture
addPolyfill('mediacapture', {
test: 'capture' in create('input'),
d: ['swfmini', 'usermedia', DOMSUPPORT, 'filereader', 'forms', 'canvas']
});
//>
*/
//<details
addPolyfill('details', {
test: ('open' in create('details')),
@ -1306,7 +1312,7 @@
c: [16, 7, 2, 8, 1, 12, 13, 23]
});
addPolyfill('mediaelement-jaris', {
f: 'mediaelement',
d: ['mediaelement-core', DOMSUPPORT],
@ -1360,18 +1366,18 @@
addModule('track-ui', {
d: ['track', DOMSUPPORT]
});
})();
//>
//>removeCombos<
addPolyfill('feature-dummy', {
test: true,
loaded: true,
c: removeCombos
});
webshims.$ = $;
$.webshims = webshims;
$.webshim = webshim;

View File

@ -0,0 +1,97 @@
/*
* JavaScript Canvas to Blob 2.0.5
* https://github.com/blueimp/JavaScript-Canvas-to-Blob
*
* Copyright 2012, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*
* Based on stackoverflow user Stoive's code snippet:
* http://stackoverflow.com/q/4998908
*/
/*jslint nomen: true, regexp: true */
/*global window, atob, Blob, ArrayBuffer, Uint8Array, define */
(function (window) {
'use strict';
var CanvasPrototype = window.HTMLCanvasElement &&
window.HTMLCanvasElement.prototype,
hasBlobConstructor = window.Blob && (function () {
try {
return Boolean(new Blob());
} catch (e) {
return false;
}
}()),
hasArrayBufferViewSupport = hasBlobConstructor && window.Uint8Array &&
(function () {
try {
return new Blob([new Uint8Array(100)]).size === 100;
} catch (e) {
return false;
}
}()),
BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder ||