home *** CD-ROM | disk | FTP | other *** search
/ Hentai 69 / HENTAI69.iso / Extra / MPSetup.exe / 1033 / RCDATA / CABINET / wmploc.DLL / HTML / PHOTOS.HTC < prev    next >
Text File  |  2002-12-14  |  4KB  |  136 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="trackIt(\'TIN0\'); return oCurrentPage.edit();" style="behavior:url(barbutton.htc)" text="' + L_EditPhotosButton_Text + '"></td></tr></table></td></tr>';
  19.     s += '<tr><td height=14 class=text 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()
  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 id=photoImg src=""></td>'
  62.     s += '<td width=8></td>';
  63.     s += '<td valign=top class=text id=photoDescription></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.                 s += GetImageLayout();
  92.                 
  93.             s += '</table></td></tr></table>';
  94.             a('photoInfoText').innerHTML = s;
  95.  
  96.             for (i = 0; i < c; i++)
  97.             {
  98.                 o = media.getItemInfoByType('WM/Picture', '', i);
  99.                 if (c == 1)
  100.                 {
  101.                     a('photoImg').src = o.URL;
  102.                     a('photoDescription').innerText = o.description;
  103.                 }
  104.                 else
  105.                 {
  106.                     a('photoImg')[i].src = o.URL;
  107.                     a('photoDescription')[i].innerText = o.description;
  108.                 }
  109.             }
  110.         }
  111.         else
  112.         {
  113.             s = L_NoPhotos_Text;
  114.             if (sDisplay == 'inline') s += L_AddPhotos_Text;
  115.             a('photoInfoText').innerText = s;
  116.         }
  117.     }
  118.     else
  119.     {
  120.         var oDL = a('dataload');
  121.         oDL.setNoMedia();
  122.     }
  123.     
  124.     a('photoEditButton').style.display = sDisplay;
  125. }
  126.  
  127. function noData(sHTML)
  128. {
  129.     var a = element.document.all;
  130.     a('photoInfoData').style.display = 'none';
  131.     a('photoInfoError').style.display = 'block';
  132.     a('photoInfoError').innerHTML = sHTML;
  133. }
  134. </SCRIPT>
  135. </PUBLIC:COMPONENT>
  136.