Skip to content

Commit cdb5f29

Browse files
committed
Update feedback form
1 parent 93baa36 commit cdb5f29

File tree

8 files changed

+1221
-506
lines changed

8 files changed

+1221
-506
lines changed

_assets/javascripts/feedback.js

Lines changed: 377 additions & 379 deletions
Large diffs are not rendered by default.

_assets/javascripts/matchMedia.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
window.matchMedia || (window.matchMedia = function() {
2+
"use strict";
3+
4+
// For browsers that support matchMedium api such as IE 9 and webkit
5+
var styleMedia = (window.styleMedia || window.media);
6+
7+
// For those that don't support matchMedium
8+
if (!styleMedia) {
9+
var style = document.createElement('style'),
10+
script = document.getElementsByTagName('script')[0],
11+
info = null;
12+
13+
style.type = 'text/css';
14+
style.id = 'matchmediajs-test';
15+
16+
if (!script) {
17+
document.head.appendChild(style);
18+
} else {
19+
script.parentNode.insertBefore(style, script);
20+
}
21+
22+
// 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
23+
info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;
24+
25+
styleMedia = {
26+
matchMedium: function(media) {
27+
var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
28+
29+
// 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
30+
if (style.styleSheet) {
31+
style.styleSheet.cssText = text;
32+
} else {
33+
style.textContent = text;
34+
}
35+
36+
// Test if media query is true or false
37+
return info.width === '1px';
38+
}
39+
};
40+
}
41+
42+
return function(media) {
43+
return {
44+
matches: styleMedia.matchMedium(media || 'all'),
45+
media: media || 'all'
46+
};
47+
};
48+
}());

0 commit comments

Comments
 (0)