|
1 // The appearance of XUL elements is platform-specific, so we set the |
|
2 // style of the root element according to the platform, so that the |
|
3 // CSS code inside input.css can select the correct styles for each |
|
4 // platform. |
|
5 |
|
6 var id; |
|
7 var ua = navigator.userAgent; |
|
8 |
|
9 if (/Windows/.test(ua)) { |
|
10 id = "win"; |
|
11 if (/NT 5\.1/.test(ua) || /NT 5\.2; Win64/.test(ua)) |
|
12 var classname = "winxp"; |
|
13 } |
|
14 else if (/Linux/.test(ua)) |
|
15 id = "linux"; |
|
16 else if (/SunOS/.test(ua)) |
|
17 id = "linux"; |
|
18 else if (/Mac OS X/.test(ua)) |
|
19 id = "mac"; |
|
20 |
|
21 if (id) |
|
22 document.documentElement.setAttribute("id", id); |
|
23 else |
|
24 document.documentElement.appendChild( |
|
25 document.createTextNode("Unrecognized platform") |
|
26 ); |
|
27 if (classname) |
|
28 document.documentElement.setAttribute("class", classname); |