1 2var Nabble = new Object(); 3Nabble.main = 1; 4 5Nabble.getParent = function() { 6 if (typeof(customParent) != 'undefined') 7 return customParent(); 8 try { 9 if (parent.Nabble.main == 1) 10 return parent.parent; 11 } catch(err) {} 12 return parent; 13}; 14 15if (!Array.prototype.indexOf) { 16 Array.prototype.indexOf = function(e, start) { 17 start = start || 0; 18 if (start < 0) 19 start += this.length; 20 for (var i=start; i<this.length; i++) 21 if (this[i] == e) 22 return i; 23 return -1; 24 }; 25} 26 27Nabble.get = function(id) { 28 return document.getElementById(id); 29}; 30 31Nabble.loadScript = function(url) { 32 var e = document.createElement("script"); 33 e.src = url; 34 e.type="text/javascript"; 35 document.getElementsByTagName("head")[0].appendChild(e); 36}; 37 38Nabble.escapeHTML = function(str) { 39 var div = document.createElement('div'); 40 var text = document.createTextNode(str); 41 div.appendChild(text); 42 return div.innerHTML; 43}; 44 45Nabble.escape = function(value) { 46 if (typeof value == 'string') { 47 var hasSpace = value.indexOf(' ') >= 0; 48 var hasQuote = value.indexOf('"') >= 0; 49 50 value = value.replace(/\;/g, '%3B'); 51 value = value.replace(/"/g, '\\"'); 52 53 if (hasSpace || hasQuote) 54 value = '"' + value + '"'; 55 } 56 return value; 57}; 58 59Nabble.unescape = function(value) { 60 if (value.charAt(0) == '"' && value.charAt(value.length-1) == '"') 61 value = value.substring(1, value.length-1); 62 63 value = value.replace(/\\"/g, '"'); 64 value = value.replace(/%3B/g, ';'); 65 return value; 66}; 67 68Nabble.getCookie = function(name) { 69 var dc = document.cookie; 70 var prefix = name + "="; 71 var begin = dc.indexOf("; " + prefix); 72 if (begin == -1) { 73 begin = dc.indexOf(prefix); 74 if (begin != 0) return null; 75 } else 76 begin += 2; 77 var end = document.cookie.indexOf(";", begin); 78 if (end == -1) 79 end = dc.length; 80 return Nabble.unescape(dc.substring(begin + prefix.length, end)); 81}; 82 83Nabble.setCookie = function(name, value) { 84 var curCookie = name + "=" + Nabble.escape(value) + ";path=/"; 85 document.cookie = curCookie; 86}; 87 88Nabble.setPersistentCookie = function(name, value) { 89 var expires = new Date(); 90 expires.setFullYear(expires.getFullYear()+10); 91 var curCookie = name + "=" + Nabble.escape(value) + "; expires=" + expires.toGMTString() + "; path=/"; 92 document.cookie = curCookie; 93}; 94 95Nabble.deleteCookie = function(name) { 96 if (this.getCookie(name)) { 97 document.cookie = name + "=" + 98 "; path=/" + 99 "; expires=Thu, 01-Jan-1970 00:00:01 GMT"; 100 } 101}; 102 103Nabble.vars = ["appnotice"]; 104Nabble.pvars = ["tview"]; /* persistent */ 105 106(function(){ 107 for(var i=0;i<Nabble.vars.length;i++) { 108 var v = Nabble.vars[i]; 109 Nabble[v] = Nabble.getCookie(v); 110 } 111 for(var i=0;i<Nabble.pvars.length;i++) { 112 var v = Nabble.pvars[i]; 113 Nabble[v] = Nabble.getCookie(v); 114 } 115})(); 116 117Nabble.handleVars = function() { 118 for( var i=0; i<Nabble.vars.length; i++ ) { 119 var v = Nabble.vars[i]; 120 if( Nabble[v] != Nabble.getCookie(v) ) { 121 Nabble.setVar(v,Nabble[v]); 122 } 123 } 124 for( var i=0; i<Nabble.pvars.length; i++ ) { 125 var v = Nabble.pvars[i]; 126 if( Nabble[v] != Nabble.getCookie(v) ) { 127 Nabble.setVar(v,this[v]); 128 } 129 } 130}; 131 132Nabble.contains = function(a,v) { 133 for( var i=0; i<a.length; i++ ) { 134 if( a[i]==v ) 135 return true; 136 } 137 return false; 138}; 139 140Nabble.setVar = function(v,val) { 141 Nabble[v] = val; 142 try { 143 Nabble.getParent().Nabble[v] = val; 144 } catch(err) {} 145 if(val) { 146 if( this.contains(this.vars,v) ) { 147 this.setCookie(v,val); 148 } else if( this.contains(this.pvars,v) ) { 149 this.setPersistentCookie(v,val); 150 } else { 151 throw new Error("var not found: "+v); 152 } 153 } else { 154 this.deleteCookie(v); 155 } 156}; 157 158Nabble.toggle = function(id, callback) { 159 $('#'+id).slideToggle('slow', function(){ 160 if (callback) callback(); 161 Nabble.resizeFrames(); 162 }); 163}; 164 165Nabble.trim = function(s) { 166 return s.replace(/^\s+|\s+$/g,''); 167}; 168 169/* overridden in javascript_library macro */ 170// Nabble.getClientID = function(){}; 171 172var userHeaderListeners = []; 173var userHeaderReady = false; 174Nabble.addUserHeaderListener = function(listener){ 175 if (!userHeaderReady) userHeaderListeners.push(listener); 176 else listener(); 177}; 178 179Nabble.userHeader = function() { 180 $(document).ready(function(){ 181 var s = ''; 182 if (Nabble.siteHeader) 183 s += Nabble.siteHeader(); 184 $("#nabble-user-header").html(s); 185 for(var i=0;i<userHeaderListeners.length;i++) 186 userHeaderListeners[i](); 187 userHeaderReady = true; 188 }); 189}; 190 191function notice(s, wait, fade) { 192 var $n = $('#notice'); 193 $n.html(s); 194 var hw = $n.width()/2; 195 $n.css('margin-left', -hw + 'px'); 196 $n.show(); 197 if (wait && fade) 198 setTimeout(function() { 199 $n.fadeOut(fade); 200 }, wait); 201}; 202 203function singleSubmit(f) { 204 if (f.done) 205 return false; 206 f.done = true; 207 return true; 208}; 209 210Nabble.analytics = function() { 211 if (navigator.cookieEnabled && !Nabble.getCookie("v")) { 212 var visitCounter = "/util/VisitCounter.jtp?referrer=" + encodeURIComponent(document.referrer); 213 Nabble.loadScript(visitCounter); 214 } 215 var expires = new Date(); 216 expires.setTime(expires.getTime()+30*60*1000); 217 document.cookie = "v=x; expires=" + expires.toGMTString() + "; path=/"; 218}; 219 220Nabble.months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; 221Nabble.now = new Date(); 222Nabble.fmt2 = function(i) { return i <= 9? '0'+i:i; }; 223 224Nabble.isToday = function(date) { 225 return date.toDateString() == this.now.toDateString(); 226}; 227 228Nabble.isThisYear = function(date) { 229 return date.getYear() == this.now.getYear(); 230}; 231 232Nabble.dateFormatters = { 233 us: new (function(){ 234 this.formatTime = function(date) { 235 var hours = date.getHours(); 236 if (hours < 12) { 237 var xm = "am"; 238 if (hours==0) 239 hours = 12; 240 } else { 241 var xm = "pm"; 242 if (hours > 12) 243 hours -= 12; 244 } 245 return hours + ":" + Nabble.fmt2(date.getMinutes()) + xm; 246 }; 247 this.formatDateOnly = function(date) { 248 return Nabble.months[date.getMonth()] + " " + Nabble.fmt2(date.getDate()) + ", " + date.getFullYear(); 249 }; 250 this.formatDateLong = function(date) { 251 return this.formatDateOnly(date) + ";
251 " + this.formatTime(date); 252 }; 253 this.formatDateShort = function(date) { 254 if( Nabble.isToday(date) ) 255 return this.formatTime(date); 256 if( Nabble.isThisYear(date) ) 257 return Nabble.months[date.getMonth()] + " " + Nabble.fmt2(date.getDate()); 258 return this.formatDateOnly(date); 259 }; 260 })() 261 , 262 euro: new (function(){ 263 this.formatTime = function(date) { 264 return Nabble.fmt2(date.getHours()) + ":" + Nabble.fmt2(date.getMinutes()); 265 }; 266 this.formatDateOnly = function(date) { 267 return Nabble.fmt2(date.getDate()) + "." + Nabble.months[date.getMonth()] + "." + date.getFullYear(); 268 }; 269 this.formatDateLong = function(date) { 270 return this.formatTime(date) + ", " + this.formatDateOnly(date); 271 }; 272 this.formatDateShort = function(date) { 273 if( Nabble.isToday(date) ) 274 return this.formatTime(date); 275 if( Nabble.isThisYear(date) ) 276 return Nabble.fmt2(date.getDate()) + "." + Nabble.months[date.getMonth()]; 277 return this.formatDateOnly(date); 278 }; 279 })() 280 , 281 tech: new (function(){ 282 this.formatTime = function(date) { 283 return Nabble.fmt2(date.getHours()) + ":" + Nabble.fmt2(date.getMinutes()); 284 }; 285 this.formatDateOnly = function(date) { 286 return "" + date.getFullYear() + "-" + Nabble.fmt2(date.getMonth()+1) + "-" + Nabble.fmt2(date.getDate()) 287 }; 288 this.formatDateLong = function(date) { 289 return this.formatDateOnly(date) + " " + this.formatTime(date); 290 }; 291 this.formatDateShort = function(date) { 292 if( Nabble.isToday(date) ) 293 return this.formatTime(date); 294 if( Nabble.isThisYear(date) ) 295 return Nabble.fmt2(date.getMonth()+1) + "-" + Nabble.fmt2(date.getDate()); 296 return this.formatDateOnly(date); 297 }; 298 })() 299}; 300 301Nabble.getDateFmt = function() { 302 var dateFmt = Nabble.getCookie("date_fmt"); 303 return dateFmt==null ? "us" : dateFmt; 304}; 305 306Nabble.formatDateOnly = function(date) { 307 return Nabble.dateFormatters[Nabble.getDateFmt()].formatDateOnly(date); 308}; 309 310Nabble.formatTimeOnly = function(date) { 311 return Nabble.dateFormatters[Nabble.getDateFmt()].formatTime(date); 312}; 313 314Nabble.formatDateLong = function(date) { 315 return Nabble.dateFormatters[Nabble.getDateFmt()].formatDateLong(date); 316}; 317 318Nabble.formatDateShort = function(date) { 319 var fmt = Nabble.dateFormatters[Nabble.getDateFmt()]; 320 return '<span title="' + fmt.formatDateLong(date) + '">' 321 + fmt.formatDateShort(date) + '</span>'; 322};
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.