@@ -7,6 +7,115 @@ function htmlEncode(text) {
77var csrf ;
88var suburl ;
99
10+ // Polyfill for IE9+ support (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)
11+ if ( ! Array . from ) {
12+ Array . from = ( function ( ) {
13+ var toStr = Object . prototype . toString ;
14+ var isCallable = function ( fn ) {
15+ return typeof fn === 'function' || toStr . call ( fn ) === '[object Function]' ;
16+ } ;
17+ var toInteger = function ( value ) {
18+ var number = Number ( value ) ;
19+ if ( isNaN ( number ) ) { return 0 ; }
20+ if ( number === 0 || ! isFinite ( number ) ) { return number ; }
21+ return ( number > 0 ? 1 : - 1 ) * Math . floor ( Math . abs ( number ) ) ;
22+ } ;
23+ var maxSafeInteger = Math . pow ( 2 , 53 ) - 1 ;
24+ var toLength = function ( value ) {
25+ var len = toInteger ( value ) ;
26+ return Math . min ( Math . max ( len , 0 ) , maxSafeInteger ) ;
27+ } ;
28+
29+ // The length property of the from method is 1.
30+ return function from ( arrayLike /*, mapFn, thisArg */ ) {
31+ // 1. Let C be the this value.
32+ var C = this ;
33+
34+ // 2. Let items be ToObject(arrayLike).
35+ var items = Object ( arrayLike ) ;
36+
37+ // 3. ReturnIfAbrupt(items).
38+ if ( arrayLike == null ) {
39+ throw new TypeError ( "Array.from requires an array-like object - not null or undefined" ) ;
40+ }
41+
42+ // 4. If mapfn is undefined, then let mapping be false.
43+ var mapFn = arguments . length > 1 ? arguments [ 1 ] : void undefined ;
44+ var T ;
45+ if ( typeof mapFn !== 'undefined' ) {
46+ // 5. else
47+ // 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
48+ if ( ! isCallable ( mapFn ) ) {
49+ throw new TypeError ( 'Array.from: when provided, the second argument must be a function' ) ;
50+ }
51+
52+ // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.
53+ if ( arguments . length > 2 ) {
54+ T = arguments [ 2 ] ;
55+ }
56+ }
57+
58+ // 10. Let lenValue be Get(items, "length").
59+ // 11. Let len be ToLength(lenValue).
60+ var len = toLength ( items . length ) ;
61+
62+ // 13. If IsConstructor(C) is true, then
63+ // 13. a. Let A be the result of calling the [[Construct]] internal method of C with an argument list containing the single item len.
64+ // 14. a. Else, Let A be ArrayCreate(len).
65+ var A = isCallable ( C ) ? Object ( new C ( len ) ) : new Array ( len ) ;
66+
67+ // 16. Let k be 0.
68+ var k = 0 ;
69+ // 17. Repeat, while k < len… (also steps a - h)
70+ var kValue ;
71+ while ( k < len ) {
72+ kValue = items [ k ] ;
73+ if ( mapFn ) {
74+ A [ k ] = typeof T === 'undefined' ? mapFn ( kValue , k ) : mapFn . call ( T , kValue , k ) ;
75+ } else {
76+ A [ k ] = kValue ;
77+ }
78+ k += 1 ;
79+ }
80+ // 18. Let putStatus be Put(A, "length", len, true).
81+ A . length = len ;
82+ // 20. Return A.
83+ return A ;
84+ } ;
85+ } ( ) ) ;
86+ }
87+
88+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
89+ if ( typeof Object . assign != 'function' ) {
90+ // Must be writable: true, enumerable: false, configurable: true
91+ Object . defineProperty ( Object , "assign" , {
92+ value : function assign ( target , varArgs ) { // .length of function is 2
93+ 'use strict' ;
94+ if ( target == null ) { // TypeError if undefined or null
95+ throw new TypeError ( 'Cannot convert undefined or null to object' ) ;
96+ }
97+
98+ var to = Object ( target ) ;
99+
100+ for ( var index = 1 ; index < arguments . length ; index ++ ) {
101+ var nextSource = arguments [ index ] ;
102+
103+ if ( nextSource != null ) { // Skip over if undefined or null
104+ for ( var nextKey in nextSource ) {
105+ // Avoid bugs when hasOwnProperty is shadowed
106+ if ( Object . prototype . hasOwnProperty . call ( nextSource , nextKey ) ) {
107+ to [ nextKey ] = nextSource [ nextKey ] ;
108+ }
109+ }
110+ }
111+ }
112+ return to ;
113+ } ,
114+ writable : true ,
115+ configurable : true
116+ } ) ;
117+ }
118+
10119function initCommentPreviewTab ( $form ) {
11120 var $tabMenu = $form . find ( '.tabular.menu' ) ;
12121 $tabMenu . find ( '.item' ) . tab ( ) ;
@@ -2348,7 +2457,6 @@ function initHeatmap(appElementId, heatmapUser, locale) {
23482457 this . getColor ( 4 ) ,
23492458 this . getColor ( 5 )
23502459 ] ;
2351- console . log ( this . colorRange ) ;
23522460 this . endDate = new Date ( ) ;
23532461 this . loadHeatmap ( this . user ) ;
23542462 } ,
0 commit comments