home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 December / PCWorld_2002-12_cd.bin / Software / Topware / wmp99xrc / mpsetup.exe / wmploc.DLL / HTML / PHOTOS.HTC < prev    next >
Encoding:
HTML Component  |  2002-10-28  |  3.5 KB  |  123 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_PhotographyTitle_Text + '</td></tr>';
  18.     s += '<tr><td height=16><table width=368 border=0 cellpadding=0 cellspacing=0><td>' + GetFileTOC(1) + '</td><td class=textTitle id=photoEditButton align=right onbuttonclick="return oCurrentPage.edit();" style="behavior:url(barbutton.htc)" text="' + L_EditPhotosButton_Text + '"></td></tr></table></td></tr>';
  19.     s += '<tr><td height=14 id=photosHeader></td></tr>';
  20.     s += '<tr><td height=10></td></tr>';
  21.     s += '<tr><td valign=top height=40>' + GetButtons(14, L_FileInfoTitle_Text, -1, '') + '</td></tr>';
  22.  
  23.     s += '<tr><td id=photoInfoData width=368 height=100% valign=top><div class=text id=photoInfoText style="overflow-x: scroll; overflow-y: scroll; width: 368;"></div></td></tr>';
  24.  
  25.     s += '<tr><td style="display:none" id=photoInfoError></td></tr>';
  26.     element.innerHTML = s + '</table>';    
  27.     resize();
  28. }
  29.  
  30. function resize()
  31. {
  32.     var el = element.document.all('photoInfoText');
  33.     if (el)
  34.         el.style.height = Math.max(element.document.body.clientHeight - getElementTop('photoInfoData'), 10);
  35. }
  36.  
  37. function edit()
  38. {
  39.     if (window.external.appColorLight)
  40.         window.external.AdvancedEditDialog(); 
  41.     updateUI(); 
  42.     return false;
  43. }
  44.  
  45. function updateUI()
  46. {
  47.     try
  48.     {
  49.         var p = element.document.all('player');
  50.         var m = p.currentMedia;
  51.         updateMedia(m);
  52.     } catch(e)
  53.     {
  54.     }
  55. }
  56.  
  57. function GetImageLayout(o)
  58. {
  59.     var s = '<tr><td valign=top>';
  60.     s += '<table border=0 cellpadding=0 cellspacing=0>';
  61.     s += '<tr><td valign=top><img border=0 src="' + o.URL + '"></td>'
  62.     s += '<td width=8></td>';
  63.     s += '<td valign=top class=text>' + o.description + '</td>';
  64.     s += '</tr></table></td></tr>';
  65.     return s;
  66. }
  67.  
  68. function mediaChange(m) { updateMedia(m); }
  69.  
  70. function updateMedia(media) 
  71. {
  72.     var s = '<table border=0 cellpadding=0 cellspacing=0>', i, c, o, iMid, sDisplay = 'none', a = element.document.all;
  73.  
  74.     SetArtistAlbumHeader('photosHeader', true, true, false);
  75.     a('photoInfoData').style.display = 'block';
  76.     a('photoInfoError').style.display = 'none';
  77.     
  78.     if (media)
  79.     {
  80.         if (window.external.appColorMedium)
  81.         {
  82.             if (window.external.IsAdvancedEditDialogAvailable())
  83.                 sDisplay = 'inline';
  84.         }
  85.         
  86.         s += '<tr><td width=368 valign=top><table border=0 cellpadding=0 cellspacing=0>';
  87.         c = media.getAttributeCountByType('WM/Picture', '');
  88.         if (c)
  89.         {
  90.             for (i = 0; i < c; i++)
  91.             {
  92.                 o = media.getItemInfoByType('WM/Picture', '', i);
  93.                 s += GetImageLayout(o);
  94.             }
  95.             s += '</table></td></tr></table>';
  96.             a('photoInfoText').innerHTML = s;
  97.         }
  98.         else
  99.         {
  100.             s = L_NoPhotos_Text;
  101.             if (sDisplay == 'inline') s += L_AddPhotos_Text;
  102.             a('photoInfoText').innerText = s;
  103.         }
  104.     }
  105.     else
  106.     {
  107.         var oDL = a('dataload');
  108.         oDL.setNoMedia();
  109.     }
  110.     
  111.     a('photoEditButton').style.display = sDisplay;
  112. }
  113.  
  114. function noData(sHTML)
  115. {
  116.     var a = element.document.all;
  117.     a('photoInfoData').style.display = 'none';
  118.     a('photoInfoError').style.display = 'block';
  119.     a('photoInfoError').innerHTML = sHTML;
  120. }
  121. </SCRIPT>
  122. </PUBLIC:COMPONENT>
  123.