File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
themes/freewill/source/js Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -30,16 +30,28 @@ function setupScrolling() {
30
30
31
31
function getOSName ( ) {
32
32
var os = "unknown" ;
33
- if ( ~ navigator . appVersion . indexOf ( "Win" ) ) os = "windows" ;
33
+ if ( navigator . userAgent . match ( / A n d r o i d / i) ) os = "android" ;
34
+ else if ( navigator . userAgent . match ( / B l a c k B e r r y / i) ) os = "blackberry" ;
35
+ else if ( navigator . userAgent . match ( / i P h o n e | i P a d | i P o d / i) ) os = "ios" ;
36
+ else if ( navigator . userAgent . match ( / w e b O S / i) ) os = "webos" ;
37
+ else if ( navigator . userAgent . match ( / W i n d o w s P h o n e / i) ) os = "windows-phone" ;
38
+ else if ( ~ navigator . appVersion . indexOf ( "Win" ) ) os = "windows" ;
34
39
else if ( ~ navigator . appVersion . indexOf ( "Mac" ) ) os = "mac" ;
35
40
else if ( ~ navigator . appVersion . indexOf ( "Linux" ) ) os = "linux" ;
36
- // else if (~navigator.appVersion.indexOf("X11")) os = "unix";
41
+ else if ( ~ navigator . appVersion . indexOf ( "X11" ) ) os = "unix" ;
37
42
return os ;
38
43
}
39
44
45
+ var rimeSupportedOS = {
46
+ mac : true ,
47
+ linux : true ,
48
+ windows : true ,
49
+ } ;
50
+
40
51
function detectOSForDownloads ( ) {
41
52
var os = getOSName ( ) ;
42
- if ( os != 'unknown' ) {
53
+ console . log ( 'os: ' + os ) ;
54
+ if ( rimeSupportedOS [ os ] ) {
43
55
$ ( '.os-unknown' ) . addClass ( 'hidden' ) ;
44
56
$ ( '.os-' + os ) . removeClass ( 'hidden' ) ;
45
57
$ ( '.downloads .footnote span.hidden' ) . removeClass ( 'hidden' ) ;
You can’t perform that action at this time.
0 commit comments