Unverified Commit 3dd61cd1 authored by Ray Schamp's avatar Ray Schamp Committed by GitHub

Merge pull request #1794 from LLK/hotfix/shim-formsy

[Master] ES6: Fixes for IE
parents 51533bbf cbc5bbd5
...@@ -100,7 +100,7 @@ class Search extends React.Component { ...@@ -100,7 +100,7 @@ class Search extends React.Component {
</li> </li>
</a> </a>
); );
if (this.props.tab === type) { if (this.state.tab === type) {
allTab = ( allTab = (
<a href={`/search/${type}?q=${term}/`}> <a href={`/search/${type}?q=${term}/`}>
<li className="active"> <li className="active">
...@@ -137,7 +137,7 @@ class Search extends React.Component { ...@@ -137,7 +137,7 @@ class Search extends React.Component {
<Grid <Grid
cards cards
showAvatar showAvatar
itemType={this.props.tab} itemType={this.state.tab}
items={this.state.loaded} items={this.state.loaded}
showFavorites={false} showFavorites={false}
showLoves={false} showLoves={false}
...@@ -159,8 +159,7 @@ class Search extends React.Component { ...@@ -159,8 +159,7 @@ class Search extends React.Component {
Search.propTypes = { Search.propTypes = {
dispatch: PropTypes.func, dispatch: PropTypes.func,
intl: intlShape, intl: intlShape,
searchTerm: PropTypes.string, searchTerm: PropTypes.string
tab: PropTypes.string
}; };
const mapStateToProps = state => ({ const mapStateToProps = state => ({
......
...@@ -32,6 +32,100 @@ ...@@ -32,6 +32,100 @@
*/ */
!function(){function t(t){this.message=t}var r="undefined"!=typeof exports?exports:this,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.prototype=new Error,t.prototype.name="InvalidCharacterError",r.btoa||(r.btoa=function(r){for(var o,n,a=String(r),i=0,c=e,d="";a.charAt(0|i)||(c="=",i%1);d+=c.charAt(63&o>>8-i%1*8)){if(n=a.charCodeAt(i+=.75),n>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return d}),r.atob||(r.atob=function(r){var o=String(r).replace(/=+$/,"");if(o.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,a,i=0,c=0,d="";a=o.charAt(c++);~a&&(n=i%4?64*n+a:a,i++%4)?d+=String.fromCharCode(255&n>>(-2*i&6)):0)a=e.indexOf(a);return d})}(); !function(){function t(t){this.message=t}var r="undefined"!=typeof exports?exports:this,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.prototype=new Error,t.prototype.name="InvalidCharacterError",r.btoa||(r.btoa=function(r){for(var o,n,a=String(r),i=0,c=e,d="";a.charAt(0|i)||(c="=",i%1);d+=c.charAt(63&o>>8-i%1*8)){if(n=a.charCodeAt(i+=.75),n>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return d}),r.atob||(r.atob=function(r){var o=String(r).replace(/=+$/,"");if(o.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,a,i=0,c=0,d="";a=o.charAt(c++);~a&&(n=i%4?64*n+a:a,i++%4)?d+=String.fromCharCode(255&n>>(-2*i&6)):0)a=e.indexOf(a);return d})}();
/*!
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice#Streamlining_cross-browser_behavior
*/
/**
* Shim for "fixing" IE's lack of support (IE < 9) for applying slice
* on host objects like NamedNodeMap, NodeList, and HTMLCollection
* (technically, since host objects have been implementation-dependent,
* at least before ES2015, IE hasn't needed to work this way).
* Also works on strings, fixes IE < 9 to allow an explicit undefined
* for the 2nd argument (as in Firefox), and prevents errors when
* called on other DOM objects.
*/
(function () {
'use strict';
var _slice = Array.prototype.slice;
try {
// Can't be used with DOM elements in IE < 9
_slice.call(document.documentElement);
} catch (e) { // Fails in IE < 9
// This will work for genuine arrays, array-like objects,
// NamedNodeMap (attributes, entities, notations),
// NodeList (e.g., getElementsByTagName), HTMLCollection (e.g., childNodes),
// and will not fail on other DOM objects (as do DOM elements in IE < 9)
Array.prototype.slice = function(begin, end) {
// IE < 9 gets unhappy with an undefined end argument
end = (typeof end !== 'undefined') ? end : this.length;
// For native Array objects, we use the native slice function
if (Object.prototype.toString.call(this) === '[object Array]'){
return _slice.call(this, begin, end);
}
// For array like object we handle it ourselves.
var i, cloned = [],
size, len = this.length;
// Handle negative value for "begin"
var start = begin || 0;
start = (start >= 0) ? start : Math.max(0, len + start);
// Handle negative value for "end"
var upTo = (typeof end == 'number') ? Math.min(end, len) : len;
if (end < 0) {
upTo = len + end;
}
// Actual expected size of the slice
size = upTo - start;
if (size > 0) {
cloned = new Array(size);
if (this.charAt) {
for (i = 0; i < size; i++) {
cloned[i] = this.charAt(start + i);
}
} else {
for (i = 0; i < size; i++) {
cloned[i] = this[start + i];
}
}
}
return cloned;
};
}
}());
/**
* https://gist.github.com/brettz9/4212262
* @license MIT, GPL, do whatever you want
* @requires polyfill: Array.prototype.slice fix {@link https://gist.github.com/brettz9/6093105}
*/
if (!Array.from) {
Array.from = function (object) {
'use strict';
return [].slice.call(object);
};
}
/**
* https://github.com/WebReflection/es6-collections
*/
(function(e){function f(a,c){function b(a){if(!this||this.constructor!==b)return new b(a);this._keys=[];this._values=[];this._itp=[];this.objectOnly=c;a&&v.call(this,a)}c||w(a,"size",{get:x});a.constructor=b;b.prototype=a;return b}function v(a){this.add?a.forEach(this.add,this):a.forEach(function(a){this.set(a[0],a[1])},this)}function d(a){this.has(a)&&(this._keys.splice(b,1),this._values.splice(b,1),this._itp.forEach(function(a){b<a[0]&&a[0]--}));return-1<b}function m(a){return this.has(a)?this._values[b]:
void 0}function n(a,c){if(this.objectOnly&&c!==Object(c))throw new TypeError("Invalid value used as weak collection key");if(c!=c||0===c)for(b=a.length;b--&&!y(a[b],c););else b=a.indexOf(c);return-1<b}function p(a){return n.call(this,this._values,a)}function q(a){return n.call(this,this._keys,a)}function r(a,c){this.has(a)?this._values[b]=c:this._values[this._keys.push(a)-1]=c;return this}function t(a){this.has(a)||this._values.push(a);return this}function h(){(this._keys||0).length=this._values.length=
0}function z(){return k(this._itp,this._keys)}function l(){return k(this._itp,this._values)}function A(){return k(this._itp,this._keys,this._values)}function B(){return k(this._itp,this._values,this._values)}function k(a,c,b){var g=[0],e=!1;a.push(g);return{next:function(){var f,d=g[0];!e&&d<c.length?(f=b?[c[d],b[d]]:c[d],g[0]++):(e=!0,a.splice(a.indexOf(g),1));return{done:e,value:f}}}}function x(){return this._values.length}function u(a,c){for(var b=this.entries();;){var d=b.next();if(d.done)break;
a.call(c,d.value[1],d.value[0],this)}}var b,w=Object.defineProperty,y=function(a,b){return isNaN(a)?isNaN(b):a===b};"undefined"==typeof WeakMap&&(e.WeakMap=f({"delete":d,clear:h,get:m,has:q,set:r},!0));"undefined"!=typeof Map&&"function"===typeof(new Map).values&&(new Map).values().next||(e.Map=f({"delete":d,has:q,get:m,set:r,keys:z,values:l,entries:A,forEach:u,clear:h}));"undefined"!=typeof Set&&"function"===typeof(new Set).values&&(new Set).values().next||(e.Set=f({has:p,add:t,"delete":d,clear:h,
keys:l,values:l,entries:B,forEach:u}));"undefined"==typeof WeakSet&&(e.WeakSet=f({"delete":d,add:t,clear:h,has:p},!0))})("undefined"!=typeof exports&&"undefined"!=typeof global?global:window);
/**
* https://github.com/rousan/symbol-es6
*/
!function(global,factory){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=factory(global):factory(global)}("undefined"!=typeof window?window:global,function(global){"use strict";var defineProperty=Object.defineProperty,defineProperties=Object.defineProperties,symbolHiddenCounter=0,globalSymbolRegistry=[],slice=Array.prototype.slice,ES6="object"==typeof global.ES6?global.ES6:global.ES6={},isArray=Array.isArray,objectToString=Object.prototype.toString,push=Array.prototype.push,emptyFunction=function(){},simpleFunction=function(arg){return arg},isCallable=function(fn){return"function"==typeof fn},Iterator=function(){},ArrayIterator=function(array,flag){this._array=array,this._flag=flag,this._nextIndex=0},StringIterator=function(string,flag){this._string=string,this._flag=flag,this._nextIndex=0},isObject=function(value){return null!==value&&("object"==typeof value||"function"==typeof value)},setupSymbolInternals=function(symbol,desc){return defineProperties(symbol,{_description:{value:desc},_isSymbol:{value:!0},_id:{value:symbolHiddenCounter++}}),symbol},appendArray=function(array1,array2){if("number"==typeof array1.length&&array1.length>=0&&"number"==typeof array2.length&&array2.length>=0){var length1=Math.floor(array1.length),length2=Math.floor(array2.length),i=0;for(array1.length=length1+length2;i<length2;++i)array2.hasOwnProperty(i)&&(array1[length1+i]=array2[i])}},simpleInheritance=function(child,parent){if("function"!=typeof child||"function"!=typeof parent)throw new TypeError("Child and Parent must be function type");child.prototype=Object.create(parent.prototype),child.prototype.constructor=child},Symbol=function Symbol(desc){if(desc=void 0===desc?"":String(desc),this instanceof Symbol)throw new TypeError("Symbol is not a constructor");return setupSymbolInternals(Object.create(Symbol.prototype),desc)};defineProperties(Symbol,{for:{value:function(key){key=String(key);for(var record,registryLength=globalSymbolRegistry.length,i=0;i<registryLength;++i)if((record=globalSymbolRegistry[i]).key===key)return record.symbol;return record={key:key,symbol:Symbol(key)},globalSymbolRegistry.push(record),record.symbol},writable:!0,configurable:!0},keyFor:{value:function(symbol){if(!ES6.isSymbol(symbol))throw new TypeError(String(symbol)+" is not a symbol");for(var record,registryLength=globalSymbolRegistry.length,i=0;i<registryLength;++i)if((record=globalSymbolRegistry[i]).symbol===symbol)return record.key},writable:!0,configurable:!0},hasInstance:{value:Symbol("Symbol.hasInstance")},isConcatSpreadable:{value:Symbol("Symbol.isConcatSpreadable")},iterator:{value:Symbol("Symbol.iterator")},toStringTag:{value:Symbol("Symbol.toStringTag")}}),Symbol.prototype.toString=function(){return"@@_____"+this._id+"_____"},Symbol.prototype.valueOf=function(){return this},defineProperty(Iterator.prototype,Symbol.iterator.toString(),{value:function(){return this},writable:!0,configurable:!0}),simpleInheritance(ArrayIterator,Iterator),simpleInheritance(StringIterator,Iterator),defineProperty(ArrayIterator.prototype,Symbol.toStringTag.toString(),{value:"Array Iterator",configurable:!0}),defineProperty(StringIterator.prototype,Symbol.toStringTag.toString(),{value:"String Iterator",configurable:!0}),ArrayIterator.prototype.next=function(){if(!(this instanceof ArrayIterator))throw new TypeError("Method Array Iterator.prototype.next called on incompatible receiver "+String(this));var nextValue;return-1===this._nextIndex?{done:!0,value:void 0}:"number"==typeof this._array.length&&this._array.length>=0&&this._nextIndex<Math.floor(this._array.length)?(1===this._flag?nextValue=[this._nextIndex,this._array[this._nextIndex]]:2===this._flag?nextValue=this._array[this._nextIndex]:3===this._flag&&(nextValue=this._nextIndex),this._nextIndex++,{done:!1,value:nextValue}):(this._nextIndex=-1,{done:!0,value:void 0})},StringIterator.prototype.next=function(){if(!(this instanceof StringIterator))throw new TypeError("Method String Iterator.prototype.next called on incompatible receiver "+String(this));var nextValue,stringObject=new String(this._string);return-1===this._nextIndex?{done:!0,value:void 0}:this._nextIndex<stringObject.length?(nextValue=stringObject[this._nextIndex],this._nextIndex++,{done:!1,value:nextValue}):(this._nextIndex=-1,{done:!0,value:void 0})};var SpreadOperatorImpl=function(target,thisArg){this._target=target,this._values=[],this._thisArg=thisArg};SpreadOperatorImpl.prototype.spread=function(){var self=this;return slice.call(arguments).forEach(function(iterable){ES6.forOf(iterable,function(value){self._values.push(value)})}),self},SpreadOperatorImpl.prototype.add=function(){var self=this;return slice.call(arguments).forEach(function(value){self._values.push(value)}),self},SpreadOperatorImpl.prototype.call=function(thisArg){if("function"!=typeof this._target)throw new TypeError("Target is not a function");return thisArg=arguments.length<=0?this._thisArg:thisArg,this._target.apply(thisArg,this._values)},SpreadOperatorImpl.prototype.new=function(){if("function"!=typeof this._target)throw new TypeError("Target is not a constructor");var temp,returnValue;return temp=Object.create(this._target.prototype),returnValue=this._target.apply(temp,this._values),isObject(returnValue)?returnValue:temp},SpreadOperatorImpl.prototype.array=function(){if(!isArray(this._target))throw new TypeError("Target is not a array");return push.apply(this._target,this._values),this._target};return defineProperties(ES6,{isSymbol:{value:function(symbol){return symbol instanceof Symbol&&function(symbol){return!0===symbol._isSymbol&&"number"==typeof symbol._id&&"string"==typeof symbol._description}(symbol)},writable:!0,configurable:!0},instanceOf:{value:function(object,constructor){if(!isObject(constructor))throw new TypeError("Right-hand side of 'instanceof' is not an object");var hasInstanceSymbolProp=constructor[Symbol.hasInstance];if(void 0===hasInstanceSymbolProp)return object instanceof constructor;if("function"!=typeof hasInstanceSymbolProp)throw new TypeError(typeof hasInstanceSymbolProp+" is not a function");return hasInstanceSymbolProp.call(constructor,object)},writable:!0,configurable:!0},forOf:{value:function(iterable,callback,thisArg){if(callback="function"!=typeof callback?emptyFunction:callback,"function"!=typeof iterable[Symbol.iterator])throw new TypeError("Iterable[Symbol.iterator] is not a function");var iterationResult,iterator=iterable[Symbol.iterator]();if("function"!=typeof iterator.next)throw new TypeError(".iterator.next is not a function");for(;;){if(iterationResult=iterator.next(),!isObject(iterationResult))throw new TypeError("Iterator result "+iterationResult+" is not an object");if(iterationResult.done)break;callback.call(thisArg,iterationResult.value)}},writable:!0,configurable:!0},spreadOperator:{value:function(target,thisArg){if("function"!=typeof target&&!isArray(target))throw new TypeError("Spread operator only supports on array and function objects at this moment");return new SpreadOperatorImpl(target,thisArg)},writable:!0,configurable:!0}}),defineProperty(global,"Symbol",{value:Symbol,writable:!0,configurable:!0}),defineProperty(Function.prototype,Symbol.hasInstance.toString(),{value:function(instance){return"function"==typeof this&&instance instanceof this}}),defineProperty(Array.prototype,"concat",{value:function(){if(void 0===this||null===this)throw new TypeError("Array.prototype.concat called on null or undefined");var self=Object(this),targets=slice.call(arguments),outputs=[];return targets.unshift(self),targets.forEach(function(target){isObject(target)?void 0!==target[Symbol.isConcatSpreadable]?target[Symbol.isConcatSpreadable]?appendArray(outputs,target):outputs.push(target):isArray(target)?appendArray(outputs,target):outputs.push(target):outputs.push(target)}),outputs},writable:!0,configurable:!0}),defineProperty(Object.prototype,"toString",{value:function(){return void 0===this||null===this?objectToString.call(this):"string"==typeof this[Symbol.toStringTag]?"[object "+this[Symbol.toStringTag]+"]":objectToString.call(this)},writable:!0,configurable:!0}),defineProperty(Array.prototype,Symbol.iterator.toString(),{value:function(){if(void 0===this||null===this)throw new TypeError("Cannot convert undefined or null to object");var self=Object(this);return new ArrayIterator(self,2)},writable:!0,configurable:!0}),defineProperty(Array,"from",{value:function(arrayLike,mapFn,thisArg){var constructor,length,outputs,i=0;if(constructor=isCallable(this)?this:Array,void 0===arrayLike||null===arrayLike)throw new TypeError("Cannot convert undefined or null to object");if(arrayLike=Object(arrayLike),void 0===mapFn)mapFn=simpleFunction;else if(!isCallable(mapFn))throw new TypeError(mapFn+" is not a function");if(void 0===arrayLike[Symbol.iterator]){if(!("number"==typeof arrayLike.length&&arrayLike.length>=0))return(outputs=new constructor(0)).length=0,outputs;for(length=Math.floor(arrayLike.length),(outputs=new constructor(length)).length=length;i<length;++i)outputs[i]=mapFn.call(thisArg,arrayLike[i])}else(outputs=new constructor).length=0,ES6.forOf(arrayLike,function(value){outputs.length++,outputs[outputs.length-1]=mapFn.call(thisArg,value)});return outputs},writable:!0,configurable:!0}),defineProperty(Array.prototype,"entries",{value:function(){if(void 0===this||null===this)throw new TypeError("Cannot convert undefined or null to object");var self=Object(this);return new ArrayIterator(self,1)},writable:!0,configurable:!0}),defineProperty(Array.prototype,"keys",{value:function(){if(void 0===this||null===this)throw new TypeError("Cannot convert undefined or null to object");var self=Object(this);return new ArrayIterator(self,3)},writable:!0,configurable:!0}),defineProperty(String.prototype,Symbol.iterator.toString(),{value:function(){if(void 0===this||null===this)throw new TypeError("String.prototype[Symbol.iterator] called on null or undefined");return new StringIterator(String(this),0)},writable:!0,configurable:!0}),ES6});
/*! /*!
* https://github.com/andyearnshaw/Intl.js * https://github.com/andyearnshaw/Intl.js
* @license The MIT License (MIT) Copyright (c) 2013 Andy Earnshaw * @license The MIT License (MIT) Copyright (c) 2013 Andy Earnshaw
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment