1$(document).ready(function () { 2 $(".mainContent a").each 3 ( 4 function () { 5 var elem = $(this); 6 if (elem.attr("href") != undefined) 7 { 8 var fileExt = elem.attr("href").split('.').pop().toLowerCase(); 9 10 //if ($.inArray(fileExt, ['aspx', 'html', 'htm', '']) >= 0) elem.addClass("page"); 11 if ($.inArray(fileExt, ['pdf']) >= 0) elem.addClass("file pdf"); 12 if ($.inArray(fileExt, ['txt', 'rtf']) >= 0) elem.addClass("file txt"); 13 if ($.inArray(fileExt, ['doc', 'docx']) >= 0) elem.addClass("file doc"); 14 if ($.inArray(fileExt, ['xls', 'xlsx']) >= 0) elem.addClass("file xls"); 15 if ($.inArray(fileExt, ['ppt', 'pptx']) >= 0) elem.addClass("file ppt"); 16 if ($.inArray(fileExt, ['exe', 'msi', 'app', 'apk']) >= 0) elem.addClass("file application"); 17 if ($.inArray(fileExt, ['zip', 'rar', '7z', '7zip', 'gz', 'tar', 'ace']) >= 0) elem.addClass("file archive"); 18 if (fileExt.substr("mailto:") >= 0) elem.addClass("file email"); 19 //if ($.inArray(fileExt, ['', '']) >= 0) elem.addClass(""); 20 } 21 } 22 ); 23 24 /* 25 //Add the external link overlay 26 $('.mainContent a').filter(function () { 27 //Compare the anchor tag's host name with location's host name 28 return this.hostname && this.hostname !== location.hostname; 29 }).wrapInner('<span class="iconOverlayExternal"></span>'); 30 */ 31 32 33 //Checking if file exists 34 /* 35 $.ajax({
36 url: 'http://www.example.com/somefile.ext', 37 type: 'HEAD', 38 error: 39 function () { 40 //do something depressing 41 }, 42 success: 43 function (data) { 44 //do something cheerful :) 45 } 46 }); 47 */ 48 49 50});
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.