home *** CD-ROM | disk | FTP | other *** search
/ Hentai 69 / HENTAI69.iso / Extra / MPSetup.exe / 1033 / RCDATA / CABINET / wmploc.DLL / HTML / FILEINFO.HTC < prev    next >
Text File  |  2002-12-14  |  9KB  |  280 lines

  1. <PUBLIC:COMPONENT lightWeight=true>
  2. <PUBLIC:ATTACH EVENT="oncontentready" ONEVENT="load()" />
  3. <PUBLIC:METHOD NAME="reload" />
  4. <PUBLIC:METHOD NAME="updateMedia" />
  5. <PUBLIC:METHOD NAME="mediaChange" />
  6. <PUBLIC:METHOD NAME="edit" />
  7. <PUBLIC:ATTACH EVENT="onresize" ONEVENT="resize()" />
  8. <PUBLIC:METHOD NAME="noData" />
  9.  
  10. <SCRIPT LANGUAGE="JScript">
  11.  
  12. function reload() { load(); }
  13.  
  14. function load()
  15. {
  16.     var s = '<table width=368 class=pane border=0 cellpadding=0 cellspacing=0>';
  17.     s += '<tr><td class=artist>' + L_FileInfoTitle_Text + '</td></tr>';
  18.     s += '<tr><td height=16><table width=368 border=0 cellpadding=0 cellspacing=0><td>' + GetFileTOC(0) + '</td><td class=textTitle align=right id=editInfoButton onbuttonclick="trackIt(\'TIN0\'); return oCurrentPage.edit();" style="behavior:url(barbutton.htc)" text="' + L_EditInfoButton_Text + '"></td></tr></table></td></tr>';
  19.     s += '<tr><td height=14 class=text id=fileinfoHeader></td></tr>';
  20.     s += '<tr><td height=10></td></tr>';
  21.     s += '<tr><td valign=top height=40>' + GetButtons(-1, '', 15, L_PhotographyTitle_Text) + '</td></tr>';
  22.  
  23.     s += '<tr><td id=tagInfoData width=368 height=100% valign=top><div class=text style="overflow-y: scroll; width: 368;">';
  24.     s += '<table border=0 cellpadding=0 cellspacing=0>';
  25.     s += getBlock(L_TrackInfoLabel_Text, 'fiTrackInfo');
  26.     s += getBlock(L_ArtistInfoLabel_Text, 'fiArtistInfo');
  27.     s += getBlock(L_CommentsInfoLabel_Text, 'fiComments');
  28.     s += getBlock(L_WebsitesLabel_Text, 'fiWebsites');
  29.     s += getBlock(L_CreditsLabel_Text, 'fiCredits');
  30.     s += getBlock(L_DRMPropertiesLabel_Text, 'fiDRMProperties');
  31.     s += '</table></div></td></tr>';
  32.  
  33.     s += '<tr><td style="display:none" id=tagInfoError></td></tr>';
  34.     element.innerHTML = s + '</table>';    
  35.     resize();
  36. }
  37.  
  38. function getBlock(sTitle, sID)
  39. {
  40.     var s = '<tr><td><table id='+ sID + 'table border=0 cellpadding=0 cellspacing=0>';
  41.     s += '<tr><td colspan=3 class=textBold>' + sTitle + '</td></tr>';
  42.     return s + '<tr><td id=' + sID + 'data></td></tr></table></td></tr>';
  43. }
  44.  
  45. var aTrackInfo = new Array('Title', 'WM/SetSubTitle', 'WM/Genre', 'WM/Mood', 'WM/Track', 'WM/BeatsPerMinute', 'WM/InitialKey', 'WM/AlbumTitle', 
  46.     'WM/OriginalAlbumTitle', 'WM/PartOfSet', 'WM/ContentGroupDescription', 'WM/Language');
  47. 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, 
  48.     L_OriginalAlbumLabel_Text, L_PartOfSetLabel_Text, L_MusicCategoryLabel_Text, L_LanguageLabel_Text);
  49.  
  50. var aArtistInfo = new Array('Author', 'WM/AlbumArtist', 'WM/Conductor', 'WM/Writer', 'WM/OriginalLyricist',
  51.     'WM/Composer', 'WM/ModifiedBy', 'WM/OriginalArtist');
  52. var aArtistInfoLabels = new Array(L_LeadArtistLabel_Text, L_BandLabel_Text, L_ConductorLabel_Text, L_LyricistLabel_Text, L_OriginalLyricistLabel_Text,
  53.     L_ComposerLabel_Text, L_ModifiedByLabel_Text, L_OriginalArtistLabel_Text);
  54.  
  55. var aDRMInfo = new Array('Is_Protected', 'DRMHasLicense', 'DRMPlayRightsStatus', 'DRMCDCopyStatus', 'DRMDeviceCopyStatus', 'DRMSDMICopyStatus', 'DRMBackupStatus');
  56. 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);
  57.  
  58. var aInfoList = new Array(aTrackInfo, aArtistInfo);
  59. var aInfoLabels = new Array(aTrackInfoLabels, aArtistInfoLabels);
  60. var aInfoIDs = new Array('fiTrackInfo', 'fiArtistInfo');
  61.  
  62. function resize()
  63. {
  64.     var el = element.document.all('fileInfoText');
  65.     if (el)
  66.         el.style.height = Math.max(element.document.body.clientHeight - getElementTop('tagInfoData'), 10);
  67. }
  68.  
  69. function edit()
  70. {
  71.     if (window.external.appColorLight)
  72.         window.external.AdvancedEditDialog(); 
  73.     updateUI(); 
  74.     return false;
  75. }
  76.  
  77. function updateUI()
  78. {
  79.     try
  80.     {
  81.         var p = element.document.all('player');
  82.         var m = p.currentMedia;
  83.         updateMedia(m);
  84.     } catch(e)
  85.     {
  86.     }
  87. }
  88.  
  89. function mediaChange(m) { updateMedia(m); }
  90.  
  91. function updateMedia(media) 
  92. {
  93.     var i, sEditDisplay = 'none', a = element.document.all;
  94.  
  95.     a('tagInfoData').style.display = 'inline';
  96.     a('tagInfoError').style.display = 'none';
  97.     if (media)
  98.     {
  99.         SetArtistAlbumHeader('fileinfoHeader', true, true, false);
  100.         if (window.external.appColorMedium)
  101.         {
  102.             if (window.external.IsAdvancedEditDialogAvailable())
  103.                 sEditDisplay = 'inline';
  104.         }
  105.  
  106.         for (i = 0; i < aInfoList.length; i++)
  107.             GetInfo(aInfoIDs[i], media, aInfoList[i], aInfoLabels[i]);
  108.  
  109.         GetComments(media);
  110.         GetWebsites(media);
  111.         GetCredits(media);
  112.         GetDRMInfo(media);
  113.     }
  114.     else
  115.     {
  116.         var oDL = a('dataload');
  117.         oDL.setNoMedia();
  118.     }
  119.     resize();
  120.     a('editInfoButton').style.display = sEditDisplay;
  121. }
  122.  
  123. function GetInfo(sID, media, aFields, aLabels)
  124. {
  125.     var s = '<table border=0 cellpadding=0 cellspacing=0>', i, sText, a = element.document.all, fDisplay = false;
  126.     
  127.     for (i = 0; i < aFields.length; i++)
  128.     {
  129.         sText = media.getItemInfo(aFields[i]);
  130.         
  131.         if (sText && sText.length)
  132.         {    
  133.             fDisplay = true;
  134.             s += '<tr><td width=125 valign=top class=textGray>' + aLabels[i] + '</td><td width=8><td valign=top id=' + sID + i + ' class=text></td></tr>';
  135.         }
  136.     }
  137.     
  138.     if (fDisplay)
  139.     {
  140.         a(sID + 'data').innerHTML = s + '<tr><td height=5></td></tr></table>';
  141.         a(sID + 'table').style.display = 'inline';
  142.         
  143.         for (i = 0; i < aFields.length; i++)
  144.         {
  145.             sText = media.getItemInfo(aFields[i]);
  146.             
  147.             if(aFields[i] == 'Is_Protected')
  148.             {
  149.                 if (sText == 'False')
  150.                     sText = L_DRMProtectionNo_Text;
  151.                 else
  152.                     sText = L_DRMProtectionYes_Text;
  153.             }
  154.                 
  155.             if (sText && sText.length)
  156.                 a(sID + i).innerText = sText;        
  157.         }
  158.     }
  159.     else
  160.         a(sID + 'table').style.display = 'none';
  161. }
  162.  
  163. function GetComments(media)
  164. {
  165.     var s = '<table border=0 cellpadding=0 cellspacing=0>', c, i, o, sText = '', a = element.document.all;
  166.     sText = media.getItemInfo('Description');
  167.     if (sText.length) 
  168.     {
  169.         s += '<tr><td id=fiCommentsText class=text></td></tr>';
  170.         s += '<tr><td height=5></td></tr></table>';
  171.         a('fiCommentsdata').innerHTML = s;
  172.  
  173.         a('fiCommentsText').innerText = sText;
  174.         a('fiCommentstable').style.display = 'inline';
  175.     }
  176.     else
  177.         a('fiCommentstable').style.display = 'none';
  178. }
  179.  
  180. function GetWebsites(media)
  181. {
  182.     var s = '<table border=0 cellpadding=0 cellspacing=0>', fDisplay = false, sText, c, i, o, a = element.document.all;
  183.     sText = media.getItemInfo('WM/AudioFileURL');
  184.     if (sText.length)
  185.     {
  186.         fDisplay = true;
  187.         s += '<tr><td class=text><A href="" onclick="return visitLink(this, \'LTN0\');" id=fiAudioUrl></a></td></tr>';
  188.     }
  189.  
  190.     sText = media.getItemInfo('WM/AuthorURL');
  191.     if (sText.length) 
  192.     {
  193.         fDisplay = true;
  194.         s += '<tr><td class=text><A href="" onclick="return visitLink(this, \'LTN1\');" id=fiAuthorUrl></a></td></tr>';
  195.     }
  196.  
  197.     sText = media.getItemInfo('WM/AudioSourceURL');
  198.     if (sText.length) 
  199.     {
  200.         fDisplay = true;
  201.         s += '<tr><td class=text><A href="" onclick="return visitLink(this, \'LTN2\');" id=fiSourceUrl></a></td></tr>';
  202.     }
  203.  
  204.     c = media.getAttributeCountByType('WM/UserWebURL', '');
  205.     for (i = 0; i < c; i++)
  206.     {
  207.         o = media.getItemInfoByType('WM/UserWebURL', '', i);
  208.         sText = o.text;
  209.         if (sText.length)
  210.         {
  211.             fDisplay = true;
  212.             s += '<tr><td class=text><A href="" onclick="return visitLink(this, \'LTN' + getClickIndex(i + 3) + '\');" id=fiUserUrl' + i + '></a></td></tr>';
  213.         }
  214.     }
  215.  
  216.     if (fDisplay)
  217.     {
  218.         a('fiWebsitesdata').innerHTML = s + '<tr><td height=5></td></tr></table>';
  219.     
  220.         setText(media.getItemInfo('WM/AudioFileURL'), a, 'fiAudioUrl')
  221.         setText(media.getItemInfo('WM/AuthorURL'), a, 'fiAuthorUrl');        
  222.         setText(media.getItemInfo('WM/AudioSourceURL'), a, 'fiSourceUrl');        
  223.         
  224.         c = media.getAttributeCountByType('WM/UserWebURL', '');
  225.         for (i = 0; i < c; i++)
  226.         {
  227.             o = media.getItemInfoByType('WM/UserWebURL', '', i);
  228.             setText(o.text, a, 'fiUserUrl' + i);
  229.         }
  230.         
  231.         a('fiWebsitestable').style.display = 'inline';
  232.     }
  233.     else
  234.         a('fiWebsitestable').style.display = 'none';
  235. }
  236.  
  237. function setText(sText, a, sID)
  238. {
  239.     if (sText.length)
  240.     {
  241.         a(sID).href = sText;
  242.         a(sID).innerText = sText;
  243.     }
  244. }
  245.  
  246. function GetCredits(media)
  247. {
  248.     var s = '<table border=0 cellpadding=0 cellspacing=0>', c, i, o, sText = '', a = element.document.all;
  249.     sText = media.getItemInfo('WM/MusicianCreditsList');
  250.     if (sText.length) 
  251.     {
  252.         s += '<tr><td id=fiCreditsText class=text></td></tr>';
  253.         s += '<tr><td height=5></td></tr></table>';
  254.         a('fiCreditsdata').innerHTML = s;
  255.  
  256.         a('fiCreditsText').innerText = sText;
  257.         a('fiCreditstable').style.display = 'inline';
  258.     }
  259.     else
  260.         a('fiCreditstable').style.display = 'none';
  261. }
  262.  
  263. function GetDRMInfo(media)
  264. {
  265.     if (media.getItemInfo('Is_Protected') != 'False')
  266.         GetInfo('fiDRMProperties', media, aDRMInfo, aDRMInfoLabels);
  267.     else
  268.         element.document.all('fiDRMPropertiesTable').style.display = 'none';
  269. }
  270.  
  271. function noData(sHTML)
  272. {
  273.     var a = element.document.all;
  274.     a('tagInfoData').style.display = 'none';
  275.     a('tagInfoError').style.display = 'inline';
  276.     a('tagInfoError').innerHTML = sHTML;
  277. }
  278. </SCRIPT>
  279. </PUBLIC:COMPONENT>
  280.