| 9 |
for (var i = 0; i < head.all.length; i++) { |
for (var i = 0; i < head.all.length; i++) { |
| 10 |
var el = head.all(i); var tn = el.tagName; |
var el = head.all(i); var tn = el.tagName; |
| 11 |
if (tn == 'LINK') { |
if (tn == 'LINK') { |
| 12 |
var Ahref = el.href; var htext = ''; |
var Ahref = replace_specials (el.href); var htext = ''; |
|
Ahref = Ahref.replace(/&/g,'&'); |
|
|
Ahref = Ahref.replace(/</g,'<'); |
|
|
Ahref = Ahref.replace(/>/g,'>'); |
|
| 13 |
if (el.title) htext = el.title + ' '; |
if (el.title) htext = el.title + ' '; |
| 14 |
if (el.hreflang) htext += '{language=' + el.hreflang + '} '; |
if (el.hreflang) htext += '{language=' + el.hreflang + '} '; |
| 15 |
if (el.media) htext += '{media=' + el.media + '} '; |
if (el.media) htext += '{media=' + el.media + '} '; |
| 34 |
mname += ' {' + mlang + '}'; |
mname += ' {' + mlang + '}'; |
| 35 |
} |
} |
| 36 |
if (mtitle) mtext += ' title="' + replace_specials (mtitle) + '"'; |
if (mtitle) mtext += ' title="' + replace_specials (mtitle) + '"'; |
| 37 |
mtext += '>' + replace_specials (mname); |
if (el.scheme) mname += ' {scheme=' + el.scheme + '}'; |
| 38 |
|
mtext += '>' + replace_specials (mname) + ' '; |
| 39 |
mtext += replace_specials (mvalue) + '</li>'; |
mtext += replace_specials (mvalue) + '</li>'; |
| 40 |
} else if (tn == 'TITLE') { |
} else if (tn == 'TITLE') { |
| 41 |
var mlang = el.lang; |
var mlang = el.lang; |
| 63 |
mtext += '</li>'; |
mtext += '</li>'; |
| 64 |
} |
} |
| 65 |
} |
} |
| 66 |
|
|
| 67 |
|
// profile attribute of HEAD element |
| 68 |
|
var head = doc.getElementsByTagName('head').item(0); |
| 69 |
|
if (head.outerHTML.indexOf ('profile=')) { |
| 70 |
|
var profileURI = head.outerHTML.replace (/^.+profile="?/, ''); |
| 71 |
|
profileURI = profileURI.replace (head.innerHTML, ''); |
| 72 |
|
profileURI = profileURI.replace (/"?[> ].+$/, ''); |
| 73 |
|
var Ahref = replace_specials (profileURI); |
| 74 |
|
var htext = ''; |
| 75 |
|
if (head.title) htext = head.title + ' '; |
| 76 |
|
htext += '(' + profileURI + ')'; |
| 77 |
|
var lrel = '[profile]'; |
| 78 |
|
itext += '<li class="x-f-link">'; |
| 79 |
|
itext += '<a href="' + Ahref + '" class="x-f-link-rel"' |
| 80 |
|
+ ' title="' + htext + '" target="_self">' |
| 81 |
|
+ lrel + '</a></li>'; |
| 82 |
|
} |
| 83 |
|
|
| 84 |
// insert |
// insert |
| 85 |
if (mtext) { |
if (mtext) { |
| 86 |
mtext = '<ins class="x-f-meta"><ul>' + mtext + '</ul></ins>'; |
mtext = '<ins class="x-f-meta"><ul>' + mtext + '</ul></ins>'; |
| 94 |
rt = rt.replace(/&/g,'&'); |
rt = rt.replace(/&/g,'&'); |
| 95 |
rt = rt.replace(/</g,'<'); |
rt = rt.replace(/</g,'<'); |
| 96 |
rt = rt.replace(/>/g,'>'); |
rt = rt.replace(/>/g,'>'); |
| 97 |
|
rt = rt.replace(/"/g,'"'); |
| 98 |
return rt; |
return rt; |
| 99 |
} |
} |
| 100 |
</script> |
</script> |