Skip to content

Commit 3d5bca6

Browse files
committed
fetch polyfill
for safari 10
1 parent d6298de commit 3d5bca6

19 files changed

Lines changed: 463 additions & 19 deletions

_build/js/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ inputColorByTextRadio = $('input_color_by__text');
88
NodeList.prototype.forEach = Array.prototype.forEach;
99

1010
if(!(typeof Promise !== "undefined" && Promise.toString().indexOf("[native code]") !== -1)) document.write(`<script src="assets/js/polyfills/es6-promise${min}.js"><\/script>`);
11+
window.fetch || document.write(`<script src="assets/js/polyfills/fetch${min}.js"><\/script>`);
1112

1213
document.querySelectorAll('[no-js]').forEach((element) => {element.remove()});
1314
$('fill-cells-on-click').removeAttribute('disabled');

assets/js/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ webpackJsonp([0],[
143143
});
144144

145145
function updateColor(color) {
146-
var updateTextField = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
147-
var doUpdateColorGrid = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];
146+
var updateTextField = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
147+
var doUpdateColorGrid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
148148

149149
var h = helpers.hexToRGBA(color);
150150
//console.log('updateColor', doUpdateColorGrid, h);
@@ -177,7 +177,7 @@ webpackJsonp([0],[
177177
}
178178

179179
function setRGBAttributes(element) {
180-
var color = arguments.length <= 1 || arguments[1] === undefined ? undefined : arguments[1];
180+
var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
181181

182182
//console.log('setRGBAttributes', element, color);
183183
var alpha = rgbaSlider.value;

assets/js/app.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
return color;
124124
},
125125
cssColorNameToRGB = function cssColorNameToRGB(colorName) {
126-
var returnArray = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
126+
var returnArray = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
127127
// http://stackoverflow.com/a/1573154/4671250
128128
var d = document.createElement("div");
129129
d.style.color = colorName;

assets/js/common.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/components/swatches.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ webpackJsonp([2],[
8282
var swatchesStore = getSwatchesStore();
8383

8484
function addSwatch(rgba) {
85-
var setLocalStorage = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];
85+
var setLocalStorage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
8686

8787
var swatches = document.querySelectorAll('.swatch');
8888
document.querySelector('.swatches').innerHTML += '<li class="swatch" data-r="' + rgba[0] + '" data-g="' + rgba[1] + '" data-b="' + rgba[2] + '" data-a="' + rgba[3] + '" style="background:rgba(' + rgba[0] + ',' + rgba[1] + ',' + rgba[2] + ',' + rgba[3] + ')">\n <input type="radio" name="swatch" id="swatch__' + swatches.length + '" />\n <label for="swatch__' + swatches.length + '">\n <span a11y-hidden>Red ' + rgba[0] + ', Green ' + rgba[1] + ', Blue ' + rgba[2] + ', Alpha ' + rgba[3] + '</span>\n </label>\n </li>';

assets/js/components/swatches.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/init.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var alertBanner,
1010
NodeList.prototype.forEach = Array.prototype.forEach;
1111

1212
if (!(typeof Promise !== "undefined" && Promise.toString().indexOf("[native code]") !== -1)) document.write('<script src="assets/js/polyfills/es6-promise' + min + '.js"></script>');
13+
window.fetch || document.write('<script src="assets/js/polyfills/fetch' + min + '.js"></script>');
1314

1415
document.querySelectorAll('[no-js]').forEach(function (element) {
1516
element.remove();
@@ -72,7 +73,7 @@ function addComponent(slug) {
7273
}
7374

7475
function addStyle(src) {
75-
var id = arguments.length <= 1 || arguments[1] === undefined ? '' : arguments[1];
76+
var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
7677

7778
if (id && document.getElementById('id')) {
7879
document.getElementById('id').remove();
@@ -81,7 +82,7 @@ function addStyle(src) {
8182
}
8283

8384
function addScript(src) {
84-
var id = arguments.length <= 1 || arguments[1] === undefined ? undefined : arguments[1];
85+
var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
8586

8687
return new Promise(function (resolve, reject) {
8788
var script = document.createElement('script');

0 commit comments

Comments
 (0)