Advertisement
assaflavie

main.js

Feb 4th, 2012
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var dict = {
  2.     'en' : {
  3.         'Chrome' : {
  4.             'default' : '16',
  5.             '16' : {
  6.                 'default' : 'Windows',
  7.                 'Windows' : [
  8.                     "Click on the wrench button.",
  9.                     "Choose 'Options'",
  10.                     "Click on 'Under the Hood'",
  11.                     "Click on 'Clear browsing data...'",
  12.                     "Check <b>only</b> the \"Empty the cache\" checkbox and make sure the other checkboxes are not checked. Then click on 'Clear browsing data'."
  13.                 ]
  14.             },
  15.             'logo' : 'chrome_logo.png'
  16.         },
  17.         'Firefox' : {
  18.             '10' : {
  19.                 'default' : 'Windows',
  20.                 'Windows' : [
  21.                     "Click on the Firefox menu.",
  22.                     "Click on the little arrow next to 'History'",
  23.                     "Choose 'Clear recent history'.",
  24.                     "Select 'Everything' in the 'Time range to clear' box.",
  25.                     "Check <b>only</b> the \"Cache\" checkbox and make sure the other checkboxes are not checked.",
  26.                     "Click on 'Clear Now'"
  27.                 ]
  28.             },
  29.             'default' : '10',
  30.             'logo' : 'firefox.png'
  31.         },
  32.         'Explorer' : {
  33.             '9' : {
  34.                 'default' : 'Windows',
  35.                 'Windows' : [
  36.                     "Click on the tools button.",
  37.                     "Choose Internet Options.",
  38.                     "In the 'General' tab click on 'Delete...' button.",
  39.                     "Check the 'Temporary Internet files' checkbox and <b>un-check all others.</b>",
  40.                     "Click on 'Delete'."
  41.                 ]
  42.             },
  43.             'default' : '9',
  44.             'logo' : 'ie.png'
  45.         }   }
  46. }
  47.        
  48.  
  49. function main()
  50. {
  51.     var lang = 'en'; // Supporting other languages later...
  52.    
  53.     var key = dict[lang];
  54.    
  55.     var bro = BrowserDetect.browser;
  56.     var version = BrowserDetect.version;
  57.     var os = BrowserDetect.OS;
  58.    
  59.     if (!key[bro])
  60.     {
  61.         $(".identify").html("Your browser is " + bro + " " + version + " on " + os);
  62.         setTimeout("window.location.href = 'http://www.clearbrowsercache.com/'", 2000);
  63.     }
  64.        
  65.     if (!key[bro][version])    
  66.         version = key[bro]['default'];
  67.  
  68.     if (!key[bro][version][os])
  69.         os = key[bro][version]['default'];
  70.    
  71.     steps = key[bro][version][os];
  72.    
  73.     logo = key[bro]['logo'];
  74.    
  75.     browserDir = lang + "/" + bro + "/";
  76.     manualDir = browserDir + version + "/" + os + "/";
  77.     $(".identify").html("Your browser is " + bro);
  78.     $(".logo").append("<img src='" + browserDir + logo + "'></img>");
  79.     for (var i in steps) {
  80.         n = parseInt(i) + 1;
  81.         step = '<li class="step">';
  82.         step += "<div class='instruction'>" + steps[i] + "</div>";
  83.         step += "<div class='illustration'><img src='" + manualDir + "image" + n.toString() + ".png'></img></div>"
  84.         step += '</li>';
  85.         $(".manual").append(step);
  86.     }
  87. }
  88.  
  89. main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement