1(function(){ 2 3 4 5 var DomReady = window.DomReady = {}; 6 7 8 9 // Everything that has to do with properly supporting our document ready event. Brought over from the most awesome jQuery. 10 11 12 13 var userAgent = navigator.userAgent.toLowerCase(); 14 15 16 17 // Figure out what browser is being used 18 19 var browser = { 20 21 version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1], 22 23 safari: /webkit/.test(userAgent), 24 25 opera: /opera/.test(userAgent), 26 27 msie: (/msie/.test(userAgent)) && (!/opera/.test( userAgent )), 28 29 mozilla: (/mozilla/.test(userAgent)) && (!/(compatible|webkit)/.test(userAgent)) 30 31 }; 32 33 34 35 var readyBound = false; 36 37 var isReady = false; 38 39 var readyList = []; 40 41 42 43 // Handle when the DOM is ready 44 45 function domReady() { 46 47 // Make sure that the DOM is not already loaded 48 49 if(!isReady) { 50 51 // Remember that the DOM is ready 52 53 isReady = true; 54 55 56 57 if(readyList) { 58 59 for(var fn = 0; fn < readyList.length; fn++) { 60 61 readyList[fn].call(window, []); 62 63 } 64 65 66 67 readyList = []; 68 69 } 70 71 } 72 73 }; 74 75 76 77 // From Simon Willison. A safe way to fire onload w/o screwing up everyone else. 78 79 function addLoadEvent(func) { 80 81 var oldonload = window.onload; 82 83 if (typeof window.onload != 'function') { 84 85 window.onload = func; 86 87 } else { 88 89 window.onload = function() { 90 91 if (oldonload) { 92 93 oldonload(); 94 95 } 96 97 func(); 98 99 } 100 101 } 102 103 }; 104 105 106 107 // does the heavy work of working through the browsers idiosyncracies (let's call them that) to hook onload. 108 109 function bindReady() { 110 111 if(readyBound) { 112 113 return; 114 115 } 116 117 118 119 readyBound = true; 120 121 122 123 // Mozilla, Opera (see further below for it) and webkit nightlies currently support this event 124 125 if (document.addEventListener && !browser.opera) { 126 127 // Use the handy event callback 128 129 document.addEventListener("DOMContentLoaded", domReady, false); 130 131 } 132 133 134 135 // If IE is used and is not in a frame 136 137 // Continually check to see if the document is ready 138 139 if (browser.msie && window == top) (function(){ 140 141 if (isReady) return; 142 143 try { 144 145 // If IE is used, use the trick by Diego Perini 146 147 // http://javascript.nwbox.com/IEContentLoaded/ 148 149 document.documentElement.doScroll("left"); 150 151 } catch(error) { 152 153 setTimeout(arguments.callee, 0); 154 155 return; 156 157 } 158 159 // and execute any waiting functions 160 161 domReady(); 162 163 })(); 164 165 166 167 if(browser.opera) { 168 169 document.addEventListener( "DOMContentLoaded", function () { 170 171 if (isReady) return; 172 173 for (var i = 0; i < document.styleSheets.length; i++) 174 175 if (document.styleSheets[i].disabled) { 176 177 setTimeout( arguments.callee, 0 ); 178 179 return; 180 181 } 182 183 // and execute any waiting functions 184 185 domReady(); 186 187 }, false); 188 189 } 190 191 192 193 if(browser.safari) { 194 195 var numStyles; 196 197 (function(){ 198 199 if (isReady) return; 200 201 if (document.readyState != "loaded" && document.readyState != "complete") { 202 203 setTimeout( arguments.callee, 0 ); 204 205 return; 206 207 } 208 209 if (numStyles === undefined) { 210 211 var links = document.getElementsByTagName("link"); 212 213 for (var i=0; i < links.length; i++) { 214 215 if(links[i].getAttribute('rel') == 'stylesheet') { 216 217 numStyles++; 218 219 } 220 221 } 222 223 var styles = document.getElementsByTagName("style"); 224 225 numStyles += styles.length; 226 227 } 228 229 if (document.styleSheets.length != numStyles) { 230 231 setTimeout( arguments.callee, 0 ); 232 233 return; 234 235 } 236 237 238 239 // and execute any waiting functions 240 241 domReady(); 242 243 })(); 244 245 } 246 247 248 249 // A fallback to window.onload, that will always work 250 251 addLoadEvent(domReady); 252 253 }; 254 255 256 257 // This is the public function that people can use to hook up ready. 258 259 DomReady.ready = function(fn, args) { 260 261 // Attach the listeners 262 263 bindReady(); 264 265 266 267 // If the DOM is already ready 268 269 if (isReady) { 270 271 // Execute the function immediately 272 273 fn.call(window, []); 274 275 } else { 276 277 // Add the function to the wait list 278
279 readyList.push( function() { return fn.call(window, []); } ); 280 281 } 282 283 }; 284 285 286 287 bindReady(); 288 289 290 291})(); 292 293 294 295jQuery(document).ready( 296 function(e) 297 { 298 jQuery('#tbdy .holder li.bit-input').css({"display": "block", "max-width": "175px"}); 299 } 300);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.