Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.1 KiB

  1. function IsValidChar( c )
  2. {
  3. return ('a' <= c && c <= 'z') ||
  4. ('A' <= c && c <= 'Z') ||
  5. ('0' <= c && c <= '9') ||
  6. c == '=' ||
  7. c == '&' ||
  8. c == ',' ||
  9. c == '.' ||
  10. c == '/' ||
  11. c == '?' ;
  12. }
  13. function UpgradeNow() {
  14. // reformat ?website=mywebsite&bla=... to 'http://mywebsite?bla=...'
  15. var querypart = window.location.search;
  16. var websiteKeyword = "website=";
  17. var websiteIndex = querypart.indexOf(websiteKeyword)+websiteKeyword.length;
  18. var website = querypart.substring( websiteIndex );
  19. // Replace all chars not in a..z, A..Z, 0-9, = ? , _ with _
  20. var newwebsite = "";
  21. for( var i=0; i < website.length; i++ ) {
  22. var c = website.charAt(i);
  23. if( !IsValidChar( c ) ) {
  24. newwebsite = newwebsite + '_';
  25. } else {
  26. newwebsite = newwebsite + website.charAt(i);
  27. }
  28. }
  29. var newURL = "http://"+newwebsite;
  30. // alert("debug info: website "+newURL);
  31. window.navigate( newURL );
  32. }
  33. function UpgradeLater() {
  34. var oWShell = new ActiveXObject( "WScript.Shell" )
  35. oWShell.Run( "dvdupgrd /remove" );
  36. pchealth.Close();
  37. }
  38. function OnLoad() {
  39. trg.style.setExpression( "left", document.body.clientWidth - trg.offsetWidth );
  40. }