home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 March / Chip_2002-03_cd1.bin / zkuste / vbasic / Data / ActiveX / mdac27.exe / sqloldb.cab / sqlsoldb.chm / basics / mailto.js < prev    next >
Encoding:
JavaScript  |  2001-03-08  |  4.0 KB  |  117 lines

  1. //Final version 1.000.
  2.  
  3. function EMailStream(obj)
  4. {
  5. var stream;
  6. if(document.body.innerHTML.search(/fbRating/) != -1)  {fbReload();} 
  7.  
  8. // *****Start: Localization Section************************  
  9.  
  10. var fbTitle_Text = 'VßÜ nßzor na dokumentaci';
  11. var fbParagraph_Text = 'T²m tv∙rc∙ dokumentace k serveru SQL nem∙₧e zodpovφdat na dotazy odbornΘ pomoci, ale uvφtß vaÜe nßvrhy a p°ipomφnky k dokumentaci a vzorov²m p°φklad∙m. Pomocφ nφ₧e uvedenΘho textovΘho pole nßm m∙₧ete elektronickou poÜtou odeslat vaÜe nßzory rychle a p°φmo. VaÜe komentß°e musφ b²t v angliΦtin∞.';
  12.     //---Note to localization: Do not change <A> and </A> tags.---
  13. var fbRateThisTopic_Text = 'Ohodno¥te tuto Φßst (1-5):';
  14. var fbPoor_Text = "èpatnß";
  15. var fbExcellent_Text = "V²bornß";
  16. var fbEnterFeedbackHere_Text = 'Chcete-li pφsemn∞ sd∞lit vßÜ nßzor, klepn∞te sem.';
  17. var fbCancel_Text = 'Storno';
  18.  
  19. // ******End: Localization Section************************
  20. // *****(There is another localization section below.)*****
  21.  
  22. stream = '<DIV ID="feedbackarea">'
  23.     + '<br>'
  24.     + '<hr COLOR="#99CCFF">'
  25.     + '<H6 STYLE="margin-top:0.5em;">' + fbTitle_Text + '</H6>'
  26.     + '<P>' + fbParagraph_Text + '</P>'
  27.     + '<FORM METHOD="post" ENCTYPE="text/plain" NAME="formRating">'
  28.     + '<P>' + fbRateThisTopic_Text + '    '
  29.     + fbPoor_Text + ' <INPUT TYPE="radio" value="1" NAME="fbRating">'
  30.     + '<INPUT TYPE="radio" value="2" NAME="fbRating">'
  31.     + '<INPUT TYPE="radio" value="3" NAME="fbRating">'
  32.     + '<INPUT TYPE="radio" value="4" NAME="fbRating">'
  33.     + '<INPUT TYPE="radio" value="5" NAME="fbRating"> ' + fbExcellent_Text + '</P>'
  34.     + '</FORM>'
  35.     + '<P>' + fbEnterFeedbackHere_Text + '    '
  36.     + '<SPAN ONCLICK="feedbackarea.style.display=\'none\';' + obj.id + '.innerHTML=\'\'">'+ submitFeedback() + '</SPAN></P>'
  37.     + '<P STYLE="width:100%;position:relative;float:left;clear:left;margin-bottom:-0.7em;margin-top:0em;" align=right><A HREF="#Feedback" ONCLICK=EMailStream(' + obj.id + ')>' + fbCancel_Text
  38.     + '</A>       </P>'
  39.     + '<hr COLOR="#99CCFF">'
  40.     + '</div>';
  41.  
  42. obj.innerHTML = stream;
  43. }
  44.  
  45. function submitFeedback()
  46. {
  47.  
  48. // *****Start: Localization Section**********************
  49.  
  50. var fbTypeHere_Text = 'Sem zadejte komentß°e a p°edm∞t zprßvy ponechejte beze zm∞ny.'
  51. var fbSubmit_Text = 'Odeslat vßÜ nßzor';
  52.  
  53. // ******End: Localization Section***********************
  54.  
  55.  
  56.   var sRecipient = "mailto:mdacdoc@microsoft.com";
  57.   var sTitle = ParseTitle(document.title);
  58.   var sCHM = ParseFileName(window.location.href,1);
  59.   var sHTM = ParseFileName(window.location.href,2);
  60.   var sLang = navigator.systemLanguage;
  61.   
  62.  
  63.   var sSubject =  sTitle + ' (' + sCHM + '::/' + sHTM + '>>'  
  64.     + '\' + GetRating() + \':' + sLang + ')'; 
  65.  
  66.   var sEntireMailMessage = sRecipient + '?subject=' + sSubject 
  67.     + '&body=---' + fbTypeHere_Text + '---';
  68.  
  69.   var sHREF = '<A HREF=\"' + sRecipient + '" ONCLICK=\"this.href=\''
  70.     + sEntireMailMessage + '\';\">' + fbSubmit_Text + '</A>';
  71.  
  72.   return sHREF;
  73. }
  74.  
  75. //---Parses document title.---
  76. function ParseTitle(theTitle)
  77. {
  78.     theTitle = theTitle.replace(/\"/g,"--");
  79.       theTitle = theTitle.replace(/'/g,"-");
  80.     if (theTitle == "") {theTitle = "Documentation Feedback";}
  81.     if (theTitle.length > 60) {theTitle = theTitle.slice(0,57) + "...";}
  82.     return theTitle;
  83. }
  84.  
  85. //---Parses document filename.---
  86. function ParseFileName(Filename, theNum)
  87. {
  88.       var intPos = Filename.lastIndexOf("\\");
  89.       var intLen = Filename.length;
  90.       var newFileName = Filename.substr(intPos + 1, intLen  - intPos)
  91.       newFileName = newFileName.replace(/#Feedback/g,"");
  92.       var x = newFileName.lastIndexOf("/");
  93.  
  94.     if (theNum == 1) {newFileName = newFileName.substr(0, (x-2));}
  95.     if (theNum == 2) {newFileName = newFileName.substr(x + 1);}
  96.  
  97.       return(newFileName);
  98. }
  99.  
  100. function GetRating()
  101. {
  102.     sRating = "0";
  103.     for(var x = 0;x < 5;x++)
  104.       {
  105.               if(document.formRating.fbRating(x).checked) {sRating = x + 1;}
  106.       }
  107.     return sRating;
  108. }
  109.  
  110. //---Reloads window.---
  111. function fbReload()
  112. {
  113.     window.location.reload(true);
  114.  
  115. }
  116.  
  117.