Changeset 5058 for branches/2.2/phpgwapi/js/browser
- Timestamp:
- 09/06/11 11:38:56 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/phpgwapi/js/browser/browserDetect.js
r4975 r5058 66 66 ['firefox5', ( agt.indexOf('firefox/5') != -1 ) ], 67 67 ['firefox6', ( agt.indexOf('firefox/6') != -1 ) ], 68 69 68 70 69 // ICEWEASEL … … 103 102 ]; 104 103 104 function isLoadApp() 105 { 106 var Browser = new Array(); 107 108 // Chrome; 109 Browser = [ 110 // Chrome; 111 {navigator : "chrome11"}, 112 // Epiphany 113 {navigator : "epiphany2"}, 114 // Firefox; 115 {navigator : "firefox3"}, 116 {navigator : "firefox4"}, 117 {navigator : "firefox5"}, 118 {navigator : "firefox6"}, 119 //IceWeasel 120 {navigator : "iceweasel3"}, 121 // IE; 122 {navigator : "ie8"}, 123 // Safari; 124 {navigator : "safari"} 125 ]; 126 127 if( arguments.length > 0 ) 128 { 129 for(var i = 0; i < Browser.length; i++) 130 { 131 if( Browser[i].navigator.indexOf(arguments[0]) > -1 ) 132 { 133 if( isCompatible(Browser[i].navigator) ) 134 return true; 135 } 136 } 137 138 return false; 139 } 140 else 141 { 142 return isCompatible(Browser); 143 } 144 } 145 105 146 function isCompatible() 106 147 { 107 148 if( arguments.length > 0 ) 108 149 { 109 var _args =arguments;110 111 150 var _args = ( typeof(arguments[0]) === 'object' ) ? arguments[0] : arguments; 151 152 for( i = 0; i < _args.length; i++ ) 112 153 { 113 154 for( j = 0; j < _browser.length; j++ ) 114 155 { 115 if( _args[i].toLowerCase() === _browser[j][0] ) 116 { 117 if( _browser[j][1] ) 118 return true; 119 } 156 var navigator = _args[i].toString().toLowerCase(); 157 158 if( typeof(_args[i]) === 'object' ) 159 var navigator = _args[i].navigator.toLowerCase(); 160 161 if ( navigator === _browser[j][0] ) 162 if( _browser[j][1] ) 163 return true; 120 164 } 121 165 } … … 125 169 } 126 170 127 function SnifferBrowser() 128 { 129 } 130 131 SnifferBrowser.prototype.isCompatible = isCompatible; 171 function SnifferBrowser(){} 172 173 SnifferBrowser.prototype.isLoadApp = isLoadApp; 174 SnifferBrowser.prototype.isCompatible = isCompatible; 132 175 133 176 window.SnifferBrowser = new SnifferBrowser;
Note: See TracChangeset
for help on using the changeset viewer.