1(function() { 2 var Realmac = Realmac || {}; 3 4 Realmac.meta = { 5 6 // Set the browser title 7 // 8 // @var String text 9 setTitle: function(text) { 10 return document.title = text; 11 }, 12 13 // Set the content attribute of a meta tag 14 // 15 // @var String name 16 // @var String content 17 setTagContent: function(tag, content){ 18 // If the tag being set is title 19 // return the result of setTitle 20 if ( tag === 'title' ) 21 { 22 return this.setTitle(content); 23 } 24 25 // Otherwise try and find the meta tag 26 var tag = this.getTag(tag); 27 28 // If we have a tag, set the content 29 if ( tag !== false ) 30 { 31 return tag.setAttribute('content', content); 32 } 33 34 return false; 35 }, 36 37 // Find a meta tag 38 // 39 // @var String name 40 getTag: function(name) { 41 var meta = document.querySelectorAll('meta'); 42 43 for ( var i=0; i<meta.length; i++ ) 44 { 45 if (meta[i].name == name){ 46 return meta[i]; 47 } 48 } 49 50 var tag = document.createElement('meta'); 51 tag.name = name; 52 document.getElementsByTagName('head')[0].appendChild(tag); 53 54 return tag; 55 } 56 }; 57 58 // Object containing all website meta info 59 var websiteMeta = {"archive-june-2019.html":"Archives for June 2019","archive-december-2021.html":"Archives for December 2021","archive-april-2016.html":"Archives for April 2016","archive-march-2018.html":"Archives for March 2018","archive-november-2024.html":"Archives for November 2024","archive-february-2020.html":"Archives for February 2020","archive-june-2021.html":"Archives for June 2021","archive-december-2020.html":"Archives for December 2020","archive-march-2022.html":"Archives for March 2022","archive-february-2019.html":"Archives for February 2019"}; 60 61 // pageId must match the key in websiteMeta object 62 var url = window.location.pathname; 63 var pageId = url.substring(url.lastIndexOf('/')+1); 64 if (!pageId || pageId.length == 0){ 65 pageId = 'index.html'; 66 } 67 pageMeta = websiteMeta[pageId]; 68 69 // If we have meta for this page 70 if (pageMeta){ 71 Realmac.meta.setTagContent('description', pageMeta); 72 } 73 74 })();
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.