home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 September (Special)
/
Chip-Special_2002-09_Digitalni-Video.bin
/
servis
/
wm9
/
mpsetupXP.exe
/
RCDATA
/
CABINET
/
wmploc.DLL
/
HTML
/
HOME.HTC
< prev
next >
Wrap
Text File
|
2002-08-19
|
8KB
|
266 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" />
<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></span></td></tr>';
s += '<tr><td height=40></td></tr>';
s += '<tr><td width=368 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>';
element.innerHTML = s + '</table></td></tr></table>';
}
var g_media = null;
var g_iCurrentList = 0;
var oXML, oDL, oXMLCharts;
function updateMedia(media)
{
oDL = element.document.all('dataload');
oXML = oDL.getDataAsync('info_moremedia', moreMedia);
var a = element.document.all;
g_media = media;
if (media)
a('homeRatingArea').innerHTML = GetRating(media);
a('artistName').innerHTML = a('artistNameSaved').innerText;
a('trackName').innerHTML = a('trackNameSaved').innerText;
}
function moreMedia()
{
if (oXML)
{
if (oXML.readyState == 4)
{
oDL.saveIDs(oXML);
try
{
element.document.all('homeMoreMedia').innerHTML = GetMoreMedia(oDL, oXML);
} catch(e)
{
}
oXML = null;
oXMLCharts = oDL.getDataAsync('info_news', getNews);
}
}
}
function getNews()
{
if (oXMLCharts)
{
if (oXMLCharts.readyState == 4)
{
try
{
element.document.all('homeHeadlines').innerHTML = GetHeadlines(oDL, oXMLCharts);
element.document.all('homeTopAlbums').innerHTML = GetTopList(oDL, oXMLCharts, g_iCurrentList);
} catch(e)
{
}
oXML = null;
oXML = oDL.getDataAsync('info_artistinfo', getWebsite);
}
}
}
function getWebsite()
{
if (oXML)
{
if (oXML.readyState == 4)
{
oDL.saveIDs(oXML);
try
{
element.document.all('homeOfficialWebsite').innerHTML = GetWebsite(oDL, oXML);
} catch(e)
{
}
oXML = null;
}
}
}
function displayTopList(i)
{
var oDL = element.document.all('dataload');
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;
if (m)
iRating = m.getItemInfo('UserRating');
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=1 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];
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;
if (oMedia.length)
{
var s = '<table width=180 border=0 cellpadding=0 cellspacing=0>', i, aStream;
aStream = oMedia[0].getElementsByTagName('Stream');
s += '<tr><td width=180 class=textTitle>' + L_MoreMediaHeader_Text + '</td></tr>';
sType = oMedia[0].getAttribute('Type');
sLink = '<A ' + getHrefText(oDL.getNodeText(aStream[0], 'Url'), false, '', '') + ' 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="doflyout(flymedia, \'' + oDL.MSIDPerson + '\'); return false;" class=text>' + L_MoreDownloadsLink_Text + '</A></td></tr>';
s += '<tr><td height=20></td></tr>';
return s + '</table>';
}
else
return '';
}
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=textTitle>' + L_HeadlinesHeader_Text + '</td></tr>';
s += '<tr><td width=180 valign=top class=text><A href="X" onclick="doflyout(flyheadline, \'' + oDL.getNodeText(oHeadlines[0], 'article_id') + '\'); return false;" class=text>' + sHeadline + '</a></td></tr></table>';
return s;
}
else
return '';
}
function GetWebsite(oDL, oXML)
{
var sWeb = oDL.getNodeText(oXML, 'websiteURL');
if (sWeb.length)
{
var s = '<table border=0 cellpadding=0 cellspacing=0>';
s += '<tr><td class=text>' + L_OfficialWebsiteHeader_Text + '</td></tr>';
s += '<tr><td><A ' + getHrefText('http://' + sWeb, false, '', '') + ' class=textGray>' + fixText(sWeb) + '</a></td></tr>';
return s += '</table>';
}
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;
for (i = 0; i < aNodes.length; i++)
sTitles += fixText(oDL.getNodeText(aNodes[i], 'Title')) + ';';
s += '<tr><td width=180 valign=top';
s += '<span width=180 style="behavior:url(toc.htc)" onitemselect="' + element.uniqueID + '.displayTopList(window.event.item);" dropdowntop=110 onitemselect="" ';
s += 'menutext="' + sTitles + '"';
s += ' text="' + fixText(oDL.getNodeText(aNodes[iList], 'Title')) + '"></span></td></tr>';
for (i = 0; (i < oAlbums.length) && (i < 5); i++)
{
s += '<tr><td width=180 valign=top><A href="X" onclick="doflyout(flyalbum, \'' + oDL.getNodeText(oAlbums[i], 'AID') + '\'); return false;"><span class=textGray>' + fixText(oDL.getNodeText(oAlbums[i], 'Title')) + ', </span>';
s += '<span class=smText>' + 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>