An HTML section giving a compact display of Features, Video, Audio, and Subtitles in one small HTML window.
This software is Copyright (c) 2007 Matthias Wolf, Germany AKA goodguy. All rights reserved.
Permission is hereby granted, free of charge, to use and redistribute this software in unmodified form, for non-commercial purposes, and provided that any use or redistribution retains or reproduces, in the documentation and/or other materials, the copyright notice above, this permission and the following disclaimer.
DISCLAIMER This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the author be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
If you have questions, comments, or suggestions, you can send a PM to goodguy on the Invelos forums. Alternatively, you can reply to this Invelos forum thread.
These HTML Sections, as well as all other tools on my Web site, may be used free of charge, but if you wish to express your appreciation for the time and resources I have spent on developing this software, you are welcome to make a donation by using one of the following PayPal links:
<HTML>
<!--
*** MovieBase Sections: Features Plus ***
Copyright (c) 2007 Matthias Wolf, Germany AKA goodguy
-->
<HEAD>
<STYLE type="text/css">
BODY {
margin: 8px; /* window_onload() is using this! */
overflow: auto;
background-color: #DEE7F7; color: black;
}
BODY, TABLE { font: 11px/1.5em Tahoma; }
TABLE { border-style: none; border-collapse: collapse; }
TD,TH { border-style: none; padding: 0px; vertical-align: top; }
#idFeatures { margin-right: 16px; }
#idStandard { padding-bottom: 2px; }
#idOther { border-top: 1px solid gray; padding-top: 2px; }
#idVidAudio TD, #idVidAudio TH {
border: 1px solid gray; padding: 2px 5px; white-space: nowrap;
}
#idVidAudio TD { background-color: white; color: black; }
#idVidAudio TH {
background-color: transparent; color: #0A246A;
font-weight: bold; text-align: left;
}
</STYLE>
<SCRIPT language=javascript>
var g_nMinHeight; // Body height needed for 1-column features
var g_nMinWidth; // Body width needed for 2-column features
// Important subtitles to be listed before all others
g_aszTopSubtitles = new Array(
"English", "German", "Commentary", "Trivia", "Other"
);
function errText(nErrNo, szErrDesc) {
// Simple error text
if (szErrDesc != null && szErrDesc != "") return szErrDesc;
var n = nErrNo;
if (n < 0) n = n + 0xFFFFFFFF + 1;
return "Error " + nErrNo + " (0x" + n.toString(16) + ")";
}
function errHandler(e) {
// Simple error handler
alert(errText(e.number, e.description));
}
function sortSubtitles() {
// Sort subtitles alphabetically and put important subtitles first
var sz, a1, a2, i, k;
sz = idSubtitles.innerText;
if (sz == " ") return; // None, just the nbsp
sz = sz.substr(0, sz.length - 1); // Strip the trailing nbsp
a1 = sz.split("\r\n");
a1.sort();
a2 = new Array();
// Brute force has sufficient performance
for (i = 0; i < g_aszTopSubtitles.length; i++) {
sz = g_aszTopSubtitles[i];
for (k = 0; k < a1.length; k++) {
if (sz == a1[k]) {
a2.push(sz);
a1[k] = "";
}
}
}
for (i = 0; i < a1.length; i++) {
sz = a1[i];
if (sz != "") a2.push(sz);
}
idSubtitles.innerText = a2.join("\r\n");
}
function window_onresize() {
// Resize window
// Only active if standard features are present and can be split into 2 columns
if (document.body.clientHeight < g_nMinHeight &&
document.body.clientWidth > g_nMinWidth) {
idStandard(0).style.display = "none";
idStandard(1).style.display = "";
idStandard(2).style.display = "";
} else {
idStandard(0).style.display = "";
idStandard(1).style.display = "none";
idStandard(2).style.display = "none";
}
}
window.onload = window_onload;
function window_onload() {
// Page init
var sz, sz1, sz2, nPos1, nPos2;
var a, i, n, w;
var bResize;
try {
sortSubtitles();
// Split features into standard and other
sz = dptaFeatures.innerText;
sz1 = sz2 = "";
nPos1 = sz.indexOf("<NOBR>");
nPos2 = 0;
if (nPos1 >= 0) {
nPos1 += 6;
nPos2 = sz.lastIndexOf("</NOBR>");
if (nPos2 < nPos1)
nPos2 = 0;
else {
sz1 = sz.substring(nPos1, nPos2).replace(/<\/NOBR><BR><NOBR>/g, "\n");
nPos2 += 7;
if (sz.substr(nPos2, 4) == "<BR>") nPos2 += 4;
}
}
// If easter eggs are present, add an entry to standard features.
if (typeof(dptaEasterEggs) != "undefined" &&
dptaEasterEggs.innerText != "") {
if (sz1 != "") sz1 += "\n";
sz1 += "Easter Eggs";
}
sz2 = sz.substr(nPos2);
if (sz1 == "" && sz2 == "") {
// No features
idFeatures.removeNode(true);
} else {
if (sz1 != "") {
// All 3 idStandard TDs have a NOBR child instead of white-space:
// nowrap, because setting the width of a TD disables nowrap.
with (idStandard(0)) {
children(0).innerText = sz1;
w = scrollWidth + 8;
}
a = sz1.split("\n");
n = Math.floor((a.length + 1) / 2);
if (n < a.length) {
bResize = true;
g_nMinWidth = 2 * w + idVidAudio.offsetWidth + 2 * 8
+ parseInt(idFeatures.currentStyle.marginRight);
for (i = 0; i < idStandard.length; i++)
idStandard(i).style.pixelWidth = w;
idStandard(1).children(0).innerText = a.slice(0, n).join("\n");
idStandard(2).children(0).innerText = a.slice(n).join("\n");
}
} else {
idStandard(0).parentElement.removeNode(true);
idOther.style.borderTopStyle = "none";
}
if (sz2 != "")
idOther.innerText = sz2;
else
idOther.parentElement.removeNode(true);
if (bResize) {
g_nMinHeight = idFeatures.offsetHeight + 2 * 8;
window.onresize = window_onresize;
window_onresize();
}
}
} catch (e) { errHandler(e); }
}
</SCRIPT>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD>
<TABLE id=idFeatures>
<TR>
<TD id=idStandard><NOBR></NOBR></TD>
<TD id=idStandard style="display:none"><NOBR></NOBR></TD>
<TD id=idStandard style="display:none"><NOBR></NOBR></TD>
</TR>
<TR><TD id=idOther colspan=3></TD></TR>
</TABLE>
</TD>
<TD>
<TABLE id=idVidAudio>
<TR><TH colspan=2>Video <DP NAME="VIDSTANDARD"></TH></TR>
<TR><TD colspan=2><DP NAME="VIDFORMATS" RATIOS="YES" DIVIDER="<BR>"> </TD></TR>
<TR><TH>Subtitles</TH><TH>Audio</TH></TR>
<TR>
<TD id=idSubtitles><DP NAME="SUBTITLES" DIVIDER="<BR>"> </TD>
<TD><DP NAME="AUDIOTRACKS" DIVIDER="<BR>"> </TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<DIV style="display:none">
<!-- These are not safe outside a TEXTAREA due to lack of encoding -->
<TEXTAREA id=dptaFeatures><DP NAME="FEATURES" Divider="<BR>"></TEXTAREA>
<TEXTAREA id=dptaEasterEggs><DP NAME="EASTEREGGS"></TEXTAREA>
</DIV>
</BODY>
</HTML>