home *** CD-ROM | disk | FTP | other *** search
HTML Component | 2002-08-19 | 8.2 KB | 203 lines |
- <PUBLIC:COMPONENT lightWeight=true>
- <PUBLIC:ATTACH EVENT="oncontentready" ONEVENT="load()" />
- <PUBLIC:METHOD NAME="reload" />
- <PUBLIC:METHOD NAME="updateMedia" />
- <PUBLIC:METHOD NAME="edit" />
-
- <SCRIPT LANGUAGE="JScript">
-
- function reload() { load(); }
-
- function load()
- {
- var s = '<table width=368 class=pane border=0 cellpadding=0 cellspacing=0>';
- s += '<tr><td class=artist>' + L_FileInfoTitle_Text + '</td></tr>';
- s += '<tr><td height=16><table width=368 border=0 cellpadding=0 cellspacing=0><td>' + GetFileTOC(0) + '</td><td class=textTitle align=right onbuttonclick="return oCurrentPage.edit();" style="behavior:url(barbutton.htc)" text="' + L_EditInfoButton_Text + '"></td></tr></table></td></tr>';
- s += '<tr><td height=14><table width=368 border=0 cellpadding=0 cellspacing=0><tr><td height=14><span class=textGray id=fileinfoArtistName>' + element.document.all('artistNameSaved').innerText + '</span> / <span id=fileinfoAlbumName class=textGray></span></td><td width=10></td></tr></table></td></tr>';
- s += '<tr><td height=10></td></tr>';
- s += '<tr><td align=right valign=top height=40><a href="X" onclick="return pageSlide(15)" alt="' + L_PhotographyTitle_Text + '" style="behavior: url(button.htc)" direction=0></a></td></tr>';
-
- s += '<tr><td width=368 height=100% valign=top><div class=text id=fileInfoText style="overflow-y: scroll; width: 368; height: expression(Math.max(144, document.body.clientHeight - 176))"></div></td></tr>';
-
- element.innerHTML = s + '</table>';
- }
-
- var aTrackInfo = new Array('Title', 'WM/SetSubTitle', 'WM/Genre', 'WM/Mood', 'WM/Track', 'WM/BeatsPerMinute', 'WM/InitialKey', 'WM/AlbumTitle',
- 'WM/OriginalAlbumTitle', 'WM/PartOfSet', 'WM/ContentGroupDescription', 'WM/Language', 'WM/MediaClassPrimaryID', 'WM/MediaClassSecondaryID');
- var aTrackInfoLabels = new Array(L_SongNameLabel_Text, L_SubtitleLabel_Text, L_GenreLabel_Text, L_MoodLabel_Text, L_TrackNumberLabel_Text, L_BeatsPerMinuteLabel_Text, L_InitialKeyLabel_Text, L_AlbumLabel_Text,
- L_OriginalAlbumLabel_Text, L_PartOfSetLabel_Text, L_MusicCategoryLabel_Text, L_LanguageLabel_Text, L_PrimaryMediaLabel_Text, L_SecondaryMediaLabel_Text);
-
- var aArtistInfo = new Array('Author', 'WM/AlbumArtist', 'WM/Conductor', 'WM/Writer', 'WM/OriginalLyricist',
- 'WM/Composer', 'WM/ModifiedBy', 'WM/OriginalArtist');
- var aArtistInfoLabels = new Array(L_LeadArtistLabel_Text, L_BandLabel_Text, L_ConductorLabel_Text, L_LyricistLabel_Text, L_OriginalLyricistLabel_Text,
- L_ComposerLabel_Text, L_ModifiedByLabel_Text, L_OriginalArtistLabel_Text);
-
- var aDRMInfo = new Array('Is_Protected', 'DRMHasLicense', 'DRMPlayRightsStatus', 'DRMCDCopyStatus', 'DRMDeviceCopyStatus', 'DRMSDMICopyStatus', 'DRMBackupStatus');
- var aDRMInfoLabels = new Array(L_ProtectedLabel_Text, L_HasLicenseLabel_Text, L_PlayRightsLabel_Text, L_CopyRightsLabel_Text, L_DeviceCopyRightsLabel_Text, L_SDMICopyRightsLabel_Text, L_BackupRightsLabel_Text);
-
- var aInfoList = new Array(aTrackInfo, aArtistInfo);
- var aInfoLabels = new Array(aTrackInfoLabels, aArtistInfoLabels);
- var aInfoTitles = new Array(L_TrackInfoLabel_Text, L_ArtistInfoLabel_Text);
-
- function edit()
- {
- if (window.external.appColorLight)
- window.external.AdvancedEditDialog();
- updateUI();
- return false;
- }
-
- function updateUI()
- {
- try
- {
- var p = element.document.all('player');
- var m = p.currentMedia;
- updateMedia(m);
- } catch(e)
- {
- }
- }
-
- function updateMedia(media)
- {
- var s = '<table border=0 cellpadding=0 cellspacing=0>', i;
-
- if (media)
- {
- element.document.all('fileinfoAlbumName').innerHTML = fixText(media.getItemInfo('WM/AlbumTitle'));
- element.document.all('fileinfoArtistName').innerHTML = element.document.all('artistNameSaved').innerText;
-
- for (i = 0; i < aInfoList.length; i++)
- s += GetInfo(aInfoTitles[i], media, aInfoList[i], aInfoLabels[i]);
-
- s += GetComments(media);
- s += GetWebsites(media);
- s += GetCredits(media);
- s += GetDRMInfo(media);
- }
- element.document.all('fileInfoText').innerHTML = s + '</table>';
- }
-
- var aPrimaryID = new Array();
- aPrimaryID['{D1607DBC-E323-4BE2-86A1-48A42A28441E}'] = 'Music';
- aPrimaryID['{01CD0F29-DA4E-4157-897B-6275D50C4F11}'] = 'Audio';
- aPrimaryID['{DB9830BD-3AB3-4FAB-8A37-1A995F7FF74B}'] = 'Video';
- aPrimaryID['{FCF24A76-9A57-4036-990D-E35DD8B244E1}'] = 'Other';
-
- var aSecondaryID = new Array();
- aSecondaryID['{6677DB9B-E5A0-4063-A1AD-ACEB52840CF1}'] = 'News';
- aSecondaryID['{1B824A67-3F80-4E3E-9CDE-F7361B0F5F1B}'] = 'Talk Show';
- aSecondaryID['{E0236BEB-C281-4EDE-A36D-7AF76A3D45B5}'] = 'Audio Book';
- aSecondaryID['{3A172A13-2BD9-4831-835B-114F6A95943F}'] = 'Spoken Word';
- aSecondaryID['{1FE2E091-4E1E-40CE-B22D-348C732E0B10}'] = 'News';
- aSecondaryID['{D6DE1D88-C77C-4593-BFBC-9C61E8C373E3}'] = 'Talk Show';
- aSecondaryID['{B76628F4-300D-443D-9CB5-01C285109DAF}'] = 'Home Video';
- aSecondaryID['{A9B87FC9-BD47-4BF0-AC4F-655B89F7D868}'] = 'Movie/Film';
- aSecondaryID['{BA7F258A-62F7-47A9-B21F-4651C42A000E}'] = 'TV Show';
- aSecondaryID['{44051B5B-B103-4B5C-92AB-93060A9463F0}'] = 'Corporate Video';
- aSecondaryID['{E3E689E2-BA8C-4330-96DF-A0EEEFFA6876}'] = 'Music Video';
-
- function GetInfo(sTitle, media, aFields, aLabels)
- {
- var s = '<table border=0 cellpadding=0 cellspacing=0>', i, sText;
-
- s += '<tr><td colspan=3 class=textBold>' + sTitle + '</td></tr>';
-
- for (i = 0; i < aFields.length; i++)
- {
- sText = fixText(media.getItemInfo(aFields[i]));
-
- if (aFields[i] == 'WM/MediaClassPrimaryID')
- sText = aPrimaryID[sText];
- else if (aFields[i] == 'WM/MediaClassSecondaryID')
- sText = aSecondaryID[sText];
-
- if (sText && sText.length)
- s += '<tr><td width=110 valign=top class=textGray>' + aLabels[i] + '</td><td width=8><td valign=top class=text>' + sText + '</td></tr>';
- }
-
- return s + '<tr><td height=5></td></tr></table>';
- }
-
- function GetComplexText(media, strField)
- {
- var s = '', c, i, o;
- c = media.getAttributeCountByType(strField, '');
- for (i = 0; i < c; i++)
- {
- o = media.getItemInfoByType(strField, '', i);
- s += fixText(o.text) + '<br>';
- }
- return s;
- }
-
- function GetComments(media)
- {
- var s = '<table border=0 cellpadding=0 cellspacing=0>', c, i, o, sText = '', fDisplay = false;
-
- s += '<tr><td class=textBold>' + L_CommentsInfoLabel_Text + '</td></tr>';
- sText = fixText(media.getItemInfo('Description'));
- if (sText.length) fDisplay = true;
- s += '<tr><td class=text>' + sText + '</td></tr>';
-
- if (fDisplay)
- return s + '<tr><td height=5></td></tr></table>';
- else
- return '';
- }
-
- function GetWebsites(media)
- {
- var s = '<table border=0 cellpadding=0 cellspacing=0>', fDisplay = false, sText, c, i, o;
-
- s += '<tr><td class=textBold>' + L_WebsitesLabel_Text + '</td></tr>';
- sText = fixText(media.getItemInfo('WM/AudioFileURL'));
- if (sText.length) fDisplay = true;
- s += '<tr><td class=text><A href="' + sText + '" target=web>' + sText + '</a></td></tr>';
-
- sText = fixText(media.getItemInfo('WM/AuthorURL'));
- if (sText.length) fDisplay = true;
- s += '<tr><td class=text><A href="' + sText + '" target=web>' + sText + '</a></td></tr>';
-
- sText = fixText(media.getItemInfo('WM/AudioSourceURL'));
- if (sText.length) fDisplay = true;
- s += '<tr><td class=text><A href="' + sText + '" target=web>' + sText + '</a></td></tr>';
-
- c = media.getAttributeCountByType('WM/UserWebURL', '');
- for (i = 0; i < c; i++)
- {
- o = media.getItemInfoByType('WM/UserWebURL', '', i);
- sText = fixText(o.text);
- s += '<tr><td class=text><A href="' + sText + '" target=web>' + sText + '</a></td></tr>';
- }
-
- if (fDisplay)
- return s + '<tr><td height=5></td></tr></table>';
- else
- return '';
- }
-
- function GetCredits(media)
- {
- var s = '<table border=0 cellpadding=0 cellspacing=0>', fDisplay = false, sText;
-
- s += '<tr><td class=textBold>' + L_CreditsLabel_Text + '</td></tr>';
-
- sText = fixText(media.getItemInfo('WM/MusicianCreditsList'));
- if (sText.length) fDisplay = true;
- s += '<tr><td class=text>' + sText + '</td></tr>';
-
- if (fDisplay)
- return s + '<tr><td height=5></td></tr></table>';
- else
- return '';
- }
-
- function GetDRMInfo(media)
- {
- return GetInfo(L_DRMPropertiesLabel_Text, media, aDRMInfo, aDRMInfoLabels);
- }
- </SCRIPT>
- </PUBLIC:COMPONENT>
-