]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/debian/missing-sources/framework/Web/Javascripts/source/tinymce-405/classes/Env.js
baculum: Add missing-sources directory in debian metadata structure
[bacula/bacula] / gui / baculum / debian / missing-sources / framework / Web / Javascripts / source / tinymce-405 / classes / Env.js
1 /**
2  * Env.js
3  *
4  * Copyright, Moxiecode Systems AB
5  * Released under LGPL License.
6  *
7  * License: http://www.tinymce.com/license
8  * Contributing: http://www.tinymce.com/contributing
9  */
10
11 /**
12  * This class contains various environment constrants like browser versions etc.
13  * Normally you don't want to sniff specific browser versions but sometimes you have
14  * to when it's impossible to feature detect. So use this with care.
15  *
16  * @class tinymce.Env
17  * @static
18  */
19 define("tinymce/Env", [], function() {
20         var nav = navigator, userAgent = nav.userAgent;
21         var opera, webkit, ie, ie11, gecko, mac, iDevice;
22
23         opera = window.opera && window.opera.buildNumber;
24         webkit = /WebKit/.test(userAgent);
25         ie = !webkit && !opera && (/MSIE/gi).test(userAgent) && (/Explorer/gi).test(nav.appName);
26         ie = ie && /MSIE (\w+)\./.exec(userAgent)[1];
27         ie11 = userAgent.indexOf('Trident') != -1 ? 11 : false;
28         ie = ie || ie11;
29         gecko = !webkit && /Gecko/.test(userAgent);
30         mac = userAgent.indexOf('Mac') != -1;
31         iDevice = /(iPad|iPhone)/.test(userAgent);
32
33         // Is a iPad/iPhone and not on iOS5 sniff the WebKit version since older iOS WebKit versions
34         // says it has contentEditable support but there is no visible caret.
35         var contentEditable = !iDevice || userAgent.match(/AppleWebKit\/(\d*)/)[1] >= 534;
36
37         return {
38                 /**
39                  * Constant that is true if the browser is Opera.
40                  *
41                  * @property opera
42                  * @type Boolean
43                  * @final
44                  */
45                 opera: opera,
46
47                 /**
48                  * Constant that is true if the browser is WebKit (Safari/Chrome).
49                  *
50                  * @property webKit
51                  * @type Boolean
52                  * @final
53                  */
54                 webkit: webkit,
55
56                 /**
57                  * Constant that is more than zero if the browser is IE.
58                  *
59                  * @property ie
60                  * @type Boolean
61                  * @final
62                  */
63                 ie: ie,
64
65                 /**
66                  * Constant that is true if the browser is Gecko.
67                  *
68                  * @property gecko
69                  * @type Boolean
70                  * @final
71                  */
72                 gecko: gecko,
73
74                 /**
75                  * Constant that is true if the os is Mac OS.
76                  *
77                  * @property mac
78                  * @type Boolean
79                  * @final
80                  */
81                 mac: mac,
82
83                 /**
84                  * Constant that is true if the os is iOS.
85                  *
86                  * @property iOS
87                  * @type Boolean
88                  * @final
89                  */
90                 iOS: iDevice,
91
92                 /**
93                  * Constant that is true if the browser supports editing.
94                  *
95                  * @property contentEditable
96                  * @type Boolean
97                  * @final
98                  */
99                 contentEditable: contentEditable,
100
101                 /**
102                  * Transparent image data url.
103                  *
104                  * @property transparentSrc
105                  * @type Boolean
106                  * @final
107                  */
108                 transparentSrc: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
109
110                 /**
111                  * Returns true/false if the browser can or can't place the caret after a inline block like an image.
112                  *
113                  * @property noCaretAfter
114                  * @type Boolean
115                  * @final
116                  */
117                 caretAfter: ie != 8,
118
119                 /**
120                  * Constant that is true if the browser supports native DOM Ranges. IE 9+.
121                  *
122                  * @property range
123                  * @type Boolean
124                  */
125                 range: window.getSelection && "Range" in window,
126
127                 /**
128                  * Returns the IE document mode for non IE browsers this will fake IE 10.
129                  *
130                  * @property documentMode
131                  * @type Number
132                  */
133                 documentMode: ie ? (document.documentMode || 7) : 10
134         };
135 });