Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

gridstack-poly.js 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /** gridstack.js 1.1.2 - IE and older browsers Polyfills for this library @preserve*/
  2. /**
  3. * https://gridstackjs.com/
  4. * (c) 2019-2020 Alain Dumesny
  5. * gridstack.js may be freely distributed under the MIT license.
  6. */
  7. // https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
  8. (function () {
  9. if (typeof window.CustomEvent === "function") {
  10. return false;
  11. }
  12. function CustomEvent (event, params) {
  13. params = params || {bubbles: false, cancelable: false, detail: null};
  14. var evt = document.createEvent('CustomEvent');
  15. evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
  16. return evt;
  17. }
  18. window.CustomEvent = CustomEvent;
  19. })();
  20. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
  21. Number.isNaN = Number.isNaN || function isNaN(input) {
  22. return typeof input === 'number' && input !== input;
  23. }
  24. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
  25. if (!Array.prototype.find) {
  26. Object.defineProperty(Array.prototype, 'find', {
  27. value: function (predicate) {
  28. // 1. Let O be ? ToObject(this value).
  29. if (this == null) {
  30. throw TypeError('"this" is null or not defined');
  31. }
  32. var o = Object(this);
  33. // 2. Let len be ? ToLength(? Get(O, "length")).
  34. var len = o.length >>> 0;
  35. // 3. If IsCallable(predicate) is false, throw a TypeError exception.
  36. if (typeof predicate !== 'function') {
  37. throw TypeError('predicate must be a function');
  38. }
  39. // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
  40. var thisArg = arguments[1];
  41. // 5. Let k be 0.
  42. var k = 0;
  43. // 6. Repeat, while k < len
  44. while (k < len) {
  45. // a. Let Pk be ! ToString(k).
  46. // b. Let kValue be ? Get(O, Pk).
  47. // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
  48. // d. If testResult is true, return kValue.
  49. var kValue = o[k];
  50. if (predicate.call(thisArg, kValue, k, o)) {
  51. return kValue;
  52. }
  53. // e. Increase k by 1.
  54. k++;
  55. }
  56. // 7. Return undefined.
  57. return undefined;
  58. },
  59. configurable: true,
  60. writable: true
  61. });
  62. }
  63. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex
  64. if (!Array.prototype.findIndex) {
  65. Object.defineProperty(Array.prototype, 'findIndex', {
  66. value: function(predicate) {
  67. // 1. Let O be ? ToObject(this value).
  68. if (this == null) {
  69. throw new TypeError('"this" is null or not defined');
  70. }
  71. var o = Object(this);
  72. // 2. Let len be ? ToLength(? Get(O, "length")).
  73. var len = o.length >>> 0;
  74. // 3. If IsCallable(predicate) is false, throw a TypeError exception.
  75. if (typeof predicate !== 'function') {
  76. throw new TypeError('predicate must be a function');
  77. }
  78. // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
  79. var thisArg = arguments[1];
  80. // 5. Let k be 0.
  81. var k = 0;
  82. // 6. Repeat, while k < len
  83. while (k < len) {
  84. // a. Let Pk be ! ToString(k).
  85. // b. Let kValue be ? Get(O, Pk).
  86. // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
  87. // d. If testResult is true, return k.
  88. var kValue = o[k];
  89. if (predicate.call(thisArg, kValue, k, o)) {
  90. return k;
  91. }
  92. // e. Increase k by 1.
  93. k++;
  94. }
  95. // 7. Return -1.
  96. return -1;
  97. },
  98. configurable: true,
  99. writable: true
  100. });
  101. }