epfl-elements 4.9.2 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/atoms/select/select.yml +1 -1
- package/dist/components/content-types/study-plan/study-plan.yml +0 -2
- package/dist/css/elements.css +903 -3141
- package/dist/css/elements.min.css +1 -1
- package/dist/css/elements.min.css.map +1 -1
- package/dist/css/reader.css +33 -128
- package/dist/css/reader.min.css +1 -1
- package/dist/css/reader.min.css.map +1 -1
- package/dist/docs/contribute/support-and-request.html +7 -8
- package/dist/icons/icons.svg +1 -1
- package/dist/index.html +0 -1
- package/dist/js/elements.js +1 -251
- package/dist/js/elements.min.js +1 -1
- package/dist/js/elements.min.js.LICENSE.txt +0 -2
- package/dist/js/elements.min.js.map +1 -1
- package/dist/js/reader.js +223 -213
- package/dist/js/reader.min.js +1 -1
- package/dist/js/reader.min.js.map +1 -1
- package/dist/package.json +13 -12
- package/package.json +13 -12
package/dist/js/elements.js
CHANGED
|
@@ -6916,245 +6916,6 @@ return ImagesLoaded;
|
|
|
6916
6916
|
});
|
|
6917
6917
|
|
|
6918
6918
|
|
|
6919
|
-
/***/ }),
|
|
6920
|
-
|
|
6921
|
-
/***/ 96797:
|
|
6922
|
-
/***/ (function(module) {
|
|
6923
|
-
|
|
6924
|
-
"use strict";
|
|
6925
|
-
/*! npm.im/object-fit-images 3.2.4 */
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
var OFI = 'bfred-it:object-fit-images';
|
|
6929
|
-
var propRegex = /(object-fit|object-position)\s*:\s*([-.\w\s%]+)/g;
|
|
6930
|
-
var testImg = typeof Image === 'undefined' ? {style: {'object-position': 1}} : new Image();
|
|
6931
|
-
var supportsObjectFit = 'object-fit' in testImg.style;
|
|
6932
|
-
var supportsObjectPosition = 'object-position' in testImg.style;
|
|
6933
|
-
var supportsOFI = 'background-size' in testImg.style;
|
|
6934
|
-
var supportsCurrentSrc = typeof testImg.currentSrc === 'string';
|
|
6935
|
-
var nativeGetAttribute = testImg.getAttribute;
|
|
6936
|
-
var nativeSetAttribute = testImg.setAttribute;
|
|
6937
|
-
var autoModeEnabled = false;
|
|
6938
|
-
|
|
6939
|
-
function createPlaceholder(w, h) {
|
|
6940
|
-
return ("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='" + w + "' height='" + h + "'%3E%3C/svg%3E");
|
|
6941
|
-
}
|
|
6942
|
-
|
|
6943
|
-
function polyfillCurrentSrc(el) {
|
|
6944
|
-
if (el.srcset && !supportsCurrentSrc && window.picturefill) {
|
|
6945
|
-
var pf = window.picturefill._;
|
|
6946
|
-
// parse srcset with picturefill where currentSrc isn't available
|
|
6947
|
-
if (!el[pf.ns] || !el[pf.ns].evaled) {
|
|
6948
|
-
// force synchronous srcset parsing
|
|
6949
|
-
pf.fillImg(el, {reselect: true});
|
|
6950
|
-
}
|
|
6951
|
-
|
|
6952
|
-
if (!el[pf.ns].curSrc) {
|
|
6953
|
-
// force picturefill to parse srcset
|
|
6954
|
-
el[pf.ns].supported = false;
|
|
6955
|
-
pf.fillImg(el, {reselect: true});
|
|
6956
|
-
}
|
|
6957
|
-
|
|
6958
|
-
// retrieve parsed currentSrc, if any
|
|
6959
|
-
el.currentSrc = el[pf.ns].curSrc || el.src;
|
|
6960
|
-
}
|
|
6961
|
-
}
|
|
6962
|
-
|
|
6963
|
-
function getStyle(el) {
|
|
6964
|
-
var style = getComputedStyle(el).fontFamily;
|
|
6965
|
-
var parsed;
|
|
6966
|
-
var props = {};
|
|
6967
|
-
while ((parsed = propRegex.exec(style)) !== null) {
|
|
6968
|
-
props[parsed[1]] = parsed[2];
|
|
6969
|
-
}
|
|
6970
|
-
return props;
|
|
6971
|
-
}
|
|
6972
|
-
|
|
6973
|
-
function setPlaceholder(img, width, height) {
|
|
6974
|
-
// Default: fill width, no height
|
|
6975
|
-
var placeholder = createPlaceholder(width || 1, height || 0);
|
|
6976
|
-
|
|
6977
|
-
// Only set placeholder if it's different
|
|
6978
|
-
if (nativeGetAttribute.call(img, 'src') !== placeholder) {
|
|
6979
|
-
nativeSetAttribute.call(img, 'src', placeholder);
|
|
6980
|
-
}
|
|
6981
|
-
}
|
|
6982
|
-
|
|
6983
|
-
function onImageReady(img, callback) {
|
|
6984
|
-
// naturalWidth is only available when the image headers are loaded,
|
|
6985
|
-
// this loop will poll it every 100ms.
|
|
6986
|
-
if (img.naturalWidth) {
|
|
6987
|
-
callback(img);
|
|
6988
|
-
} else {
|
|
6989
|
-
setTimeout(onImageReady, 100, img, callback);
|
|
6990
|
-
}
|
|
6991
|
-
}
|
|
6992
|
-
|
|
6993
|
-
function fixOne(el) {
|
|
6994
|
-
var style = getStyle(el);
|
|
6995
|
-
var ofi = el[OFI];
|
|
6996
|
-
style['object-fit'] = style['object-fit'] || 'fill'; // default value
|
|
6997
|
-
|
|
6998
|
-
// Avoid running where unnecessary, unless OFI had already done its deed
|
|
6999
|
-
if (!ofi.img) {
|
|
7000
|
-
// fill is the default behavior so no action is necessary
|
|
7001
|
-
if (style['object-fit'] === 'fill') {
|
|
7002
|
-
return;
|
|
7003
|
-
}
|
|
7004
|
-
|
|
7005
|
-
// Where object-fit is supported and object-position isn't (Safari < 10)
|
|
7006
|
-
if (
|
|
7007
|
-
!ofi.skipTest && // unless user wants to apply regardless of browser support
|
|
7008
|
-
supportsObjectFit && // if browser already supports object-fit
|
|
7009
|
-
!style['object-position'] // unless object-position is used
|
|
7010
|
-
) {
|
|
7011
|
-
return;
|
|
7012
|
-
}
|
|
7013
|
-
}
|
|
7014
|
-
|
|
7015
|
-
// keep a clone in memory while resetting the original to a blank
|
|
7016
|
-
if (!ofi.img) {
|
|
7017
|
-
ofi.img = new Image(el.width, el.height);
|
|
7018
|
-
ofi.img.srcset = nativeGetAttribute.call(el, "data-ofi-srcset") || el.srcset;
|
|
7019
|
-
ofi.img.src = nativeGetAttribute.call(el, "data-ofi-src") || el.src;
|
|
7020
|
-
|
|
7021
|
-
// preserve for any future cloneNode calls
|
|
7022
|
-
// https://github.com/bfred-it/object-fit-images/issues/53
|
|
7023
|
-
nativeSetAttribute.call(el, "data-ofi-src", el.src);
|
|
7024
|
-
if (el.srcset) {
|
|
7025
|
-
nativeSetAttribute.call(el, "data-ofi-srcset", el.srcset);
|
|
7026
|
-
}
|
|
7027
|
-
|
|
7028
|
-
setPlaceholder(el, el.naturalWidth || el.width, el.naturalHeight || el.height);
|
|
7029
|
-
|
|
7030
|
-
// remove srcset because it overrides src
|
|
7031
|
-
if (el.srcset) {
|
|
7032
|
-
el.srcset = '';
|
|
7033
|
-
}
|
|
7034
|
-
try {
|
|
7035
|
-
keepSrcUsable(el);
|
|
7036
|
-
} catch (err) {
|
|
7037
|
-
if (window.console) {
|
|
7038
|
-
console.warn('https://bit.ly/ofi-old-browser');
|
|
7039
|
-
}
|
|
7040
|
-
}
|
|
7041
|
-
}
|
|
7042
|
-
|
|
7043
|
-
polyfillCurrentSrc(ofi.img);
|
|
7044
|
-
|
|
7045
|
-
el.style.backgroundImage = "url(\"" + ((ofi.img.currentSrc || ofi.img.src).replace(/"/g, '\\"')) + "\")";
|
|
7046
|
-
el.style.backgroundPosition = style['object-position'] || 'center';
|
|
7047
|
-
el.style.backgroundRepeat = 'no-repeat';
|
|
7048
|
-
el.style.backgroundOrigin = 'content-box';
|
|
7049
|
-
|
|
7050
|
-
if (/scale-down/.test(style['object-fit'])) {
|
|
7051
|
-
onImageReady(ofi.img, function () {
|
|
7052
|
-
if (ofi.img.naturalWidth > el.width || ofi.img.naturalHeight > el.height) {
|
|
7053
|
-
el.style.backgroundSize = 'contain';
|
|
7054
|
-
} else {
|
|
7055
|
-
el.style.backgroundSize = 'auto';
|
|
7056
|
-
}
|
|
7057
|
-
});
|
|
7058
|
-
} else {
|
|
7059
|
-
el.style.backgroundSize = style['object-fit'].replace('none', 'auto').replace('fill', '100% 100%');
|
|
7060
|
-
}
|
|
7061
|
-
|
|
7062
|
-
onImageReady(ofi.img, function (img) {
|
|
7063
|
-
setPlaceholder(el, img.naturalWidth, img.naturalHeight);
|
|
7064
|
-
});
|
|
7065
|
-
}
|
|
7066
|
-
|
|
7067
|
-
function keepSrcUsable(el) {
|
|
7068
|
-
var descriptors = {
|
|
7069
|
-
get: function get(prop) {
|
|
7070
|
-
return el[OFI].img[prop ? prop : 'src'];
|
|
7071
|
-
},
|
|
7072
|
-
set: function set(value, prop) {
|
|
7073
|
-
el[OFI].img[prop ? prop : 'src'] = value;
|
|
7074
|
-
nativeSetAttribute.call(el, ("data-ofi-" + prop), value); // preserve for any future cloneNode
|
|
7075
|
-
fixOne(el);
|
|
7076
|
-
return value;
|
|
7077
|
-
}
|
|
7078
|
-
};
|
|
7079
|
-
Object.defineProperty(el, 'src', descriptors);
|
|
7080
|
-
Object.defineProperty(el, 'currentSrc', {
|
|
7081
|
-
get: function () { return descriptors.get('currentSrc'); }
|
|
7082
|
-
});
|
|
7083
|
-
Object.defineProperty(el, 'srcset', {
|
|
7084
|
-
get: function () { return descriptors.get('srcset'); },
|
|
7085
|
-
set: function (ss) { return descriptors.set(ss, 'srcset'); }
|
|
7086
|
-
});
|
|
7087
|
-
}
|
|
7088
|
-
|
|
7089
|
-
function hijackAttributes() {
|
|
7090
|
-
function getOfiImageMaybe(el, name) {
|
|
7091
|
-
return el[OFI] && el[OFI].img && (name === 'src' || name === 'srcset') ? el[OFI].img : el;
|
|
7092
|
-
}
|
|
7093
|
-
if (!supportsObjectPosition) {
|
|
7094
|
-
HTMLImageElement.prototype.getAttribute = function (name) {
|
|
7095
|
-
return nativeGetAttribute.call(getOfiImageMaybe(this, name), name);
|
|
7096
|
-
};
|
|
7097
|
-
|
|
7098
|
-
HTMLImageElement.prototype.setAttribute = function (name, value) {
|
|
7099
|
-
return nativeSetAttribute.call(getOfiImageMaybe(this, name), name, String(value));
|
|
7100
|
-
};
|
|
7101
|
-
}
|
|
7102
|
-
}
|
|
7103
|
-
|
|
7104
|
-
function fix(imgs, opts) {
|
|
7105
|
-
var startAutoMode = !autoModeEnabled && !imgs;
|
|
7106
|
-
opts = opts || {};
|
|
7107
|
-
imgs = imgs || 'img';
|
|
7108
|
-
|
|
7109
|
-
if ((supportsObjectPosition && !opts.skipTest) || !supportsOFI) {
|
|
7110
|
-
return false;
|
|
7111
|
-
}
|
|
7112
|
-
|
|
7113
|
-
// use imgs as a selector or just select all images
|
|
7114
|
-
if (imgs === 'img') {
|
|
7115
|
-
imgs = document.getElementsByTagName('img');
|
|
7116
|
-
} else if (typeof imgs === 'string') {
|
|
7117
|
-
imgs = document.querySelectorAll(imgs);
|
|
7118
|
-
} else if (!('length' in imgs)) {
|
|
7119
|
-
imgs = [imgs];
|
|
7120
|
-
}
|
|
7121
|
-
|
|
7122
|
-
// apply fix to all
|
|
7123
|
-
for (var i = 0; i < imgs.length; i++) {
|
|
7124
|
-
imgs[i][OFI] = imgs[i][OFI] || {
|
|
7125
|
-
skipTest: opts.skipTest
|
|
7126
|
-
};
|
|
7127
|
-
fixOne(imgs[i]);
|
|
7128
|
-
}
|
|
7129
|
-
|
|
7130
|
-
if (startAutoMode) {
|
|
7131
|
-
document.body.addEventListener('load', function (e) {
|
|
7132
|
-
if (e.target.tagName === 'IMG') {
|
|
7133
|
-
fix(e.target, {
|
|
7134
|
-
skipTest: opts.skipTest
|
|
7135
|
-
});
|
|
7136
|
-
}
|
|
7137
|
-
}, true);
|
|
7138
|
-
autoModeEnabled = true;
|
|
7139
|
-
imgs = 'img'; // reset to a generic selector for watchMQ
|
|
7140
|
-
}
|
|
7141
|
-
|
|
7142
|
-
// if requested, watch media queries for object-fit change
|
|
7143
|
-
if (opts.watchMQ) {
|
|
7144
|
-
window.addEventListener('resize', fix.bind(null, imgs, {
|
|
7145
|
-
skipTest: opts.skipTest
|
|
7146
|
-
}));
|
|
7147
|
-
}
|
|
7148
|
-
}
|
|
7149
|
-
|
|
7150
|
-
fix.supportsObjectFit = supportsObjectFit;
|
|
7151
|
-
fix.supportsObjectPosition = supportsObjectPosition;
|
|
7152
|
-
|
|
7153
|
-
hijackAttributes();
|
|
7154
|
-
|
|
7155
|
-
module.exports = fix;
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
6919
|
/***/ }),
|
|
7159
6920
|
|
|
7160
6921
|
/***/ 54842:
|
|
@@ -7807,9 +7568,6 @@ var __webpack_exports__ = {};
|
|
|
7807
7568
|
!function() {
|
|
7808
7569
|
"use strict";
|
|
7809
7570
|
|
|
7810
|
-
// EXTERNAL MODULE: ./node_modules/object-fit-images/dist/ofi.common-js.js
|
|
7811
|
-
var ofi_common_js = __webpack_require__(96797);
|
|
7812
|
-
var ofi_common_js_default = /*#__PURE__*/__webpack_require__.n(ofi_common_js);
|
|
7813
7571
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find.js
|
|
7814
7572
|
var es_array_find = __webpack_require__(69826);
|
|
7815
7573
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
|
|
@@ -8741,7 +8499,6 @@ var nutrimenuScore = ['E', 'D-', 'D', 'D+', 'C-', 'C', 'C+', 'B-', 'B', 'B+', 'A
|
|
|
8741
8499
|
|
|
8742
8500
|
|
|
8743
8501
|
|
|
8744
|
-
|
|
8745
8502
|
|
|
8746
8503
|
|
|
8747
8504
|
jQuery.fn.extend({
|
|
@@ -8769,14 +8526,7 @@ jQuery.fn.extend({
|
|
|
8769
8526
|
restauration();
|
|
8770
8527
|
study_plan();
|
|
8771
8528
|
guide();
|
|
8772
|
-
components_anchors();
|
|
8773
|
-
|
|
8774
|
-
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
|
|
8775
|
-
|
|
8776
|
-
if (isIE11) {
|
|
8777
|
-
ofi_common_js_default()();
|
|
8778
|
-
jQuery('body').addClass('ie');
|
|
8779
|
-
}
|
|
8529
|
+
components_anchors();
|
|
8780
8530
|
}
|
|
8781
8531
|
}); // Run that once the page is done loading:
|
|
8782
8532
|
|