[483] | 1 | define(["./kernel", "./lang", "../sniff"], function(dojo, lang, has){ |
---|
| 2 | // module: |
---|
| 3 | // dojo/_base/sniff |
---|
| 4 | |
---|
| 5 | /*===== |
---|
| 6 | return { |
---|
| 7 | // summary: |
---|
| 8 | // Deprecated. New code should use dojo/sniff. |
---|
| 9 | // This module populates the dojo browser version sniffing properties like dojo.isIE. |
---|
| 10 | }; |
---|
| 11 | =====*/ |
---|
| 12 | |
---|
| 13 | if(!has("host-browser")){ |
---|
| 14 | return has; |
---|
| 15 | } |
---|
| 16 | |
---|
| 17 | // no idea what this is for, or if it's used |
---|
| 18 | dojo._name = "browser"; |
---|
| 19 | |
---|
| 20 | lang.mixin(dojo, { |
---|
| 21 | // isBrowser: Boolean |
---|
| 22 | // True if the client is a web-browser |
---|
| 23 | isBrowser: true, |
---|
| 24 | |
---|
| 25 | // isFF: Number|undefined |
---|
| 26 | // Version as a Number if client is FireFox. undefined otherwise. Corresponds to |
---|
| 27 | // major detected FireFox version (1.5, 2, 3, etc.) |
---|
| 28 | isFF: has("ff"), |
---|
| 29 | |
---|
| 30 | // isIE: Number|undefined |
---|
| 31 | // Version as a Number if client is MSIE(PC). undefined otherwise. Corresponds to |
---|
| 32 | // major detected IE version (6, 7, 8, etc.) |
---|
| 33 | isIE: has("ie"), |
---|
| 34 | |
---|
| 35 | // isKhtml: Number|undefined |
---|
| 36 | // Version as a Number if client is a KHTML browser. undefined otherwise. Corresponds to major |
---|
| 37 | // detected version. |
---|
| 38 | isKhtml: has("khtml"), |
---|
| 39 | |
---|
| 40 | // isWebKit: Number|undefined |
---|
| 41 | // Version as a Number if client is a WebKit-derived browser (Konqueror, |
---|
| 42 | // Safari, Chrome, etc.). undefined otherwise. |
---|
| 43 | isWebKit: has("webkit"), |
---|
| 44 | |
---|
| 45 | // isMozilla: Number|undefined |
---|
| 46 | // Version as a Number if client is a Mozilla-based browser (Firefox, |
---|
| 47 | // SeaMonkey). undefined otherwise. Corresponds to major detected version. |
---|
| 48 | isMozilla: has("mozilla"), |
---|
| 49 | // isMoz: Number|undefined |
---|
| 50 | // Version as a Number if client is a Mozilla-based browser (Firefox, |
---|
| 51 | // SeaMonkey). undefined otherwise. Corresponds to major detected version. |
---|
| 52 | isMoz: has("mozilla"), |
---|
| 53 | |
---|
| 54 | // isOpera: Number|undefined |
---|
| 55 | // Version as a Number if client is Opera. undefined otherwise. Corresponds to |
---|
| 56 | // major detected version. |
---|
| 57 | isOpera: has("opera"), |
---|
| 58 | |
---|
| 59 | // isSafari: Number|undefined |
---|
| 60 | // Version as a Number if client is Safari or iPhone. undefined otherwise. |
---|
| 61 | isSafari: has("safari"), |
---|
| 62 | |
---|
| 63 | // isChrome: Number|undefined |
---|
| 64 | // Version as a Number if client is Chrome browser. undefined otherwise. |
---|
| 65 | isChrome: has("chrome"), |
---|
| 66 | |
---|
| 67 | // isMac: Boolean |
---|
| 68 | // True if the client runs on Mac |
---|
| 69 | isMac: has("mac"), |
---|
| 70 | |
---|
| 71 | // isIos: Number|undefined |
---|
| 72 | // Version as a Number if client is iPhone, iPod, or iPad. undefined otherwise. |
---|
| 73 | isIos: has("ios"), |
---|
| 74 | |
---|
| 75 | // isAndroid: Number|undefined |
---|
| 76 | // Version as a Number if client is android browser. undefined otherwise. |
---|
| 77 | isAndroid: has("android"), |
---|
| 78 | |
---|
| 79 | // isWii: Boolean |
---|
| 80 | // True if client is Wii |
---|
| 81 | isWii: has("wii"), |
---|
| 82 | |
---|
| 83 | // isQuirks: Boolean |
---|
| 84 | // Page is in quirks mode. |
---|
| 85 | isQuirks: has("quirks"), |
---|
| 86 | |
---|
| 87 | // isAir: Boolean |
---|
| 88 | // True if client is Adobe Air |
---|
| 89 | isAir: has("air") |
---|
| 90 | }); |
---|
| 91 | |
---|
| 92 | return has; |
---|
| 93 | }); |
---|