home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Minami 40
/
MINAMI40.ISO
/
Extra
/
MPSetup.exe
/
1033
/
RCDATA
/
CABINET
/
wmploc.DLL
/
HTML
/
HOME.HTC
< prev
next >
Wrap
Text File
|
2002-12-14
|
8KB
|
268 lines
<PUBLIC:COMPONENT lightWeight=true>
<PUBLIC:ATTACH EVENT="oncontentready" ONEVENT="load()" />
<PUBLIC:METHOD NAME="reload" />
<PUBLIC:METHOD NAME="updateMedia" />
<PUBLIC:METHOD NAME="SetRating" />
<PUBLIC:METHOD NAME="displayTopList" />
<PUBLIC:METHOD NAME="noData" />
<SCRIPT LANGUAGE="JScript">
function reload() { load(); }
function load()
{
var s = '<table class=pane border=0 cellpadding=0 cellspacing=0>';
s += '<tr><td valign=top height=55><table border=0 cellpadding=0 cellspacing=0><tr><td class="artist" id=artistName></td></tr>';
s += '<tr><td class=song id=trackName></td></tr></table></td></tr>';
s += '<tr><td height=15 class=text>' + L_RateThisSongLabel_Text + ' <span id=homeRatingArea>' + GetRating(null) + '</span></td></tr>';
s += '<tr><td height=40></td></tr>';
s += '<tr><td width=368 id=homeData valign=top><table style="table-layout:fixed" border=0 cellpadding=0 cellspacing=0>';
s += '<tr><td valign=top><table style="table-layout:fixed" border=0 cellpadding=0 cellspacing=0>';
s += '<tr><td class=text id=homeMoreMedia></span></td></tr>';
s += '<tr><td class=text id=homeHeadlines></td></tr>';
s += '</table></td><td width=8></td>';
s += '<td width=180 valign=top><table cellpadding=0 cellspacing=0 border=0>';
s += '<tr><td width=180 valign=top id=homeTopAlbums></td></tr>';
s += '<tr><td width=180 id=homeOfficialWebsite></td></tr>';
s += '</table></td></tr></table></td></tr>';
s += '<tr><td width=368 id=homeNoData style="display:none"></td></tr>';
element.innerHTML = s + '</table>';
}
var g_media = null;
var g_iCurrentList = 0;
var oXML, oDL, oXMLCharts = null;
function updateMedia(media)
{
oDL = element.document.all('dataload');
oDL.getDataAsync('info_home', doall);
var a = element.document.all;
g_media = media;
if (media)
a('homeRatingArea').innerHTML = GetRating(media);
a('artistName').innerText = a('artistNameSaved').innerText;
a('trackName').innerText = a('trackNameSaved').innerText;
noData(GetLoading('black'));
}
function doall(oXML)
{
var oXMLTemp, a = element.document.all;
oXMLCharts = oXML;
a('homeData').style.display = 'block';
a('homeNoData').style.display = 'none';
try
{
oXMLTemp = oXML.getElementsByTagName('Articles');
if (oXMLTemp.length)
oDL.saveIDs(oXMLTemp[0]);
a('homeMoreMedia').innerHTML = GetMoreMedia(oDL, oXML);
a('homeHeadlines').innerHTML = GetHeadlines(oDL, oXMLCharts);
a('homeTopAlbums').innerHTML = GetTopList(oDL, oXMLCharts, g_iCurrentList);
a('homeOfficialWebsite').innerHTML = GetWebsite(oDL, oXML);
} catch(e)
{
}
}
function noData(sHTML)
{
var a = element.document.all;
a('homeTopAlbums').innerHTML = '';
a('homeData').style.display = 'none';
a('homeNoData').style.display = 'block';
a('homeNoData').innerHTML = sHTML;
}
function displayTopList(i)
{
var oDL = element.document.all('dataload');
if (oXMLCharts)
{
element.document.all('homeTopAlbums').innerHTML = GetTopList(oDL, oXMLCharts, i);
g_iCurrentList = i;
}
}
var aStarImages = new Array('images\\outline_star.gif', 'images\\full_star.gif', 'images\\outline_star_light.gif', 'images\\full_star_light.gif');
function GetRating(m)
{
var s = '', iRating = '', iStars, iStarIndex = 2, sAllowChange = '1';
if (m)
{
iRating = m.getItemInfo('UserRating');
if (IsMediaStream())
sAllowChange = '0';
else
{
try
{
if (m.isReadOnlyItem('UserRating'))
sAllowChange = '0';
} catch(e)
{
sAllowChange = '0';
}
}
}
if ((iRating == '') || (iRating == 0))
{
if (m)
iRating = m.getItemInfo('UserEffectiveRating');
if (iRating == '')
iRating = 0;
}
else
iStarIndex = 0; // User Rating stars are brighter
if (iRating == 0)
iStars = 0;
else if (iRating < 25)
iStars = 1;
else if (iRating < 50)
iStars = 2;
else if (iRating < 75)
iStars = 3;
else if (iRating < 99)
iStars = 4;
else if (iRating == 99)
iStars = 5;
else
{
iStars = 0;
iStarIndex = 2;
}
s = '<span id=homeRating onRatingChange="oCurrentPage.SetRating()" allowChange=' + sAllowChange + ' style="behavior:url(rating.htc)" rating="' + iStars + '" emptyImage="' + aStarImages[iStarIndex] + '" fullImage="' + aStarImages[iStarIndex + 1] + '" ></span>';
return s;
}
var aRateMap = new Array(0, 1, 25, 50, 75, 99);
function SetRating()
{
var iStars = event.rating, iWMPRating;
iWMPRating = aRateMap[iStars];
trackIt('SRG0');
if (g_media)
{
try
{
g_media.setItemInfo('UserRating', iWMPRating);
element.document.all('homeRatingArea').innerHTML = GetRating(g_media);
} catch(e)
{
}
}
}
function GetMoreMedia(oDL, oXML)
{
var oMedia = oXML.getElementsByTagName('Media'), sType, sLink, sLabel, sImg, sArtist;
var s = '<table width=180 border=0 cellpadding=0 cellspacing=0>', i, aStream;
s += '<tr><td width=180 class=textTitleHue>' + L_MoreMediaHeader_Text + '</td></tr>';
if (oMedia.length)
{
aStream = oMedia[0].getElementsByTagName('Stream');
sType = oMedia[0].getAttribute('Type');
sLink = '<A ' + getHrefText(oDL.getUrl(aStream[0]), false, 'MMT0') + ' class=text>';
if (sType == 'Video')
{
sImg = 'images\\video.gif';
sLabel = L_VideoMediaLabel_Text;
}
else
{
sImg = 'images\\music.gif';
sLabel = L_AudioMediaLabel_Text;
}
s += '<tr><td width=180 valign=top><IMG border=0 width=16 align=absmiddle src="' + sImg + '"> ' + sLink + '<span class=textGray>' + sLabel + ' </span>';
s += fixText(oDL.getNodeText(oMedia[0], 'TrackName')) + '</A></td></tr>';
}
s += '<tr><td width=180 valign=top><A href="X" onclick="trackIt(\'MMT1\'); return doMoreMedia();" class=text>' + L_MoreDownloadsLink_Text + '</A></td></tr>';
s += '<tr><td height=20></td></tr>';
return s + '</table>';
}
function GetHeadlines(oDL, oXML)
{
var oHeadlines = oXML.getElementsByTagName('Headline'), sHeadline;
sHeadline = fixText(oDL.getNodeText(oHeadlines[0], 'Text'));
if (sHeadline.length)
{
var s = '<table width=180 border=0 cellpadding=0 cellspacing=0>', i;
s += '<tr><td class=textTitleHue>' + L_HeadlinesHeader_Text + '</td></tr>';
s += '<tr><td width=180 valign=top class=text><A href="X" onclick="trackIt(\'MHT0\'); doflyout(flyheadline, \'' + fixText(oDL.getNodeText(oHeadlines[0], 'article_id')) + '\'); return false;" class=text>' + sHeadline + '</a></td></tr></table>';
s += '<tr><td width=180 valign=top><A href="X" onclick="trackIt(\'MHT1\'); doflyout(flymoreheadlines, \'\'); return false;" class=text>' + L_MoreHeadlinesLink_Text + '</A></td></tr>';
return s;
}
else
return '';
}
function GetWebsite(oDL, oXML)
{
var oArtist = oXML.getElementsByTagName('ArtistInfo'), oWeb;
oWeb = oArtist[0].getElementsByTagName('WebsiteLoc');
var sWeb = oDL.getUrl(oWeb[0]);
if (sWeb.length > 7)
return getArtistWebsite(sWeb);
else
return '';
}
function GetTopList(oDL, oXML, iList)
{
var aNodes = oXML.getElementsByTagName('TopList');
if (aNodes.length)
{
var oAlbums = aNodes[iList].getElementsByTagName('Album'), sTitles = '';
var s = '<table width=180 border=0 cellpadding=0 cellspacing=0>', i;
s += '<tr><td width=180 class=textTitleHue>' + L_TopListHeader_Text + '</td></tr>';
for (i = 0; i < aNodes.length; i++)
{
sTitles += fixTextExt(oDL.getNodeText(aNodes[i], 'Title'), 20);
if (i != (aNodes.length - 1))
sTitles += ';';
}
s += '<tr><td width=180 valign=top';
s += '<span width=180 style="behavior:url(toc.htc)" code="XM" onitemselect="' + element.uniqueID + '.displayTopList(window.event.item);" dropdowntop=110 dropdownleft=179 onitemselect="" ';
s += 'menutext="' + sTitles + '"';
s += ' text="' + fixTextExt(oDL.getNodeText(aNodes[iList], 'Title'), 20) + '"></span></td></tr>';
for (i = 0; (i < oAlbums.length) && (i < 5); i++)
{
s += '<tr><td width=180 valign=top><A href="X" onclick="trackIt(\'XMT' + i + '\'); doflyout(flyalbum, \'' + quoteText(oDL.getNodeText(oAlbums[i], 'AID')) + '\'); return false;"><span class=textGray>' + fixText(oDL.getNodeText(oAlbums[i], 'Title')) + ', </span>';
s += '<span class=text>' + fixText(oDL.getNodeText(oAlbums[i], 'Artist')) + '</span></a></td></tr>';
}
s += '<tr><td height=15></td></tr></table>';
return s;
}
else
return '';
}
</SCRIPT>
</PUBLIC:COMPONENT>