6c43614ff6ec8fa5f080b7b4015a1884f2df20c0
Andrew Lewman new download page layout fr...

Andrew Lewman authored 12 years ago

1) $(function(){
2)   /* If javascript is enabled this hides all sections by default */
Andrew Lewman and we have a new download-...

Andrew Lewman authored 12 years ago

3)   $(".easy").css('display', 'none');
Andrew Lewman new download page layout fr...

Andrew Lewman authored 12 years ago

4)   /* Only show language selector if javascript is enabled */
5)   $('.lang').css('display', 'block');
Andrew Lewman and we have a new download-...

Andrew Lewman authored 12 years ago

6)   $('.lang-alt').css('display', 'none');
7)   $('.expander').css('display', 'block');
8)   $('.sidenav').css('display', 'none');
Andrew Lewman new download page layout fr...

Andrew Lewman authored 12 years ago

9) });
10) 
11) /* Uses result of jquery.client to open the relevant section */
12) function OScheck() {
13)   var clientos = $.client.os;
14)   if(clientos == "Linux"){
Andrew Lewman and we have a new download-...

Andrew Lewman authored 12 years ago

15)     $('.easy.linux').css('display', 'block');
Andrew Lewman new download page layout fr...

Andrew Lewman authored 12 years ago

16)   }else if(clientos == "Windows"){
Andrew Lewman and we have a new download-...

Andrew Lewman authored 12 years ago

17)     $('.easy.windows').css('display', 'block');
Andrew Lewman new download page layout fr...

Andrew Lewman authored 12 years ago

18)   }else if(clientos == "Mac"){
Andrew Lewman and we have a new download-...

Andrew Lewman authored 12 years ago

19)     $('.easy.mac').css('display', 'block');
Donncha O'Cearbhaill Display Orbot on Tor downlo...

Donncha O'Cearbhaill authored 8 years ago

20)   }else if(clientos == "Android"){
21)     $('.easy.android').css('display', 'block');
Andrew Lewman and we have a new download-...

Andrew Lewman authored 12 years ago

22)   }else{
23)     $('.easy').css('display', 'block');
Andrew Lewman new download page layout fr...

Andrew Lewman authored 12 years ago

24)   }
25) }
26)   $(function(){
27)   OScheck();
28) });
29) 
30) /* Reset language default - needed in the event of returning to the page via back button */
31) function resetAll() {
32)   var f = document.forms;
33)   var last = f.length - 1;
34)   for (var i = 0; i < last; i++) {
35)     f[i].reset();
36)   }
37) }
Andrew Lewman and we have a new download-...

Andrew Lewman authored 12 years ago

38) 
Arthur Edelstein Bug 22357: Move download la...

Arthur Edelstein authored 6 years ago

39) /* switches package links depending on selection */
40) function updateLang() {
41)   var caller = $( this );
42)   var pkg = caller.attr('id');
43)   var lang = caller.val();
44)   var versions = JSON.parse($("#version-data").text());
45)   var rootDir = '../dist/torbrowser/' + versions.torbrowserbundledir + '/';
46)   var bundles = {
47)     'win-tbb' : rootDir + 'torbrowser-install-' + versions.torbrowserbundle + '_' + lang + '.exe',
48)     'osx-tbb' : rootDir + 'TorBrowser-' + versions.torbrowserbundleosx64 + '-osx64_' + lang +'.dmg',
49)     'osx-tbb64' : rootDir + 'TorBrowser-' + versions.torbrowserbundleosx64 + '-osx64_' + lang + '.dmg',
50)     'lin-tbb32' : rootDir + 'tor-browser-linux32-' + versions.torbrowserbundlelinux32 + '_' + lang + '.tar.xz',
51)     'lin-tbb64' : rootDir + 'tor-browser-linux64-' + versions.torbrowserbundlelinux64 + '_' + lang + '.tar.xz'
52)   };
53) 
54)   $('.'+pkg).attr("href", bundles[pkg]);
55)   $('.'+pkg+'-sig').attr("href", bundles[pkg] + '.asc');
56) }
57) 
58) $(function(){
59)   $('.lang').ready(updateLang);
60)   $('.lang').change(updateLang);
61)   /* Only show language selector if javascript is enabled */
62)   $('.lang').css('display', 'block');
63) });
64) 
Andrew Lewman patch from jmtodaro for eve...

Andrew Lewman authored 12 years ago

65) $(document).ready(function () {
66) 
67)     $('.jump').click(function(event){
68)       //prevent the default action for the click event
69)       //event.preventDefault();
70) 
71)       //get the full url - like mysitecom/index.htm#home
72)       var full_url = this.href;
73) 
74)       //split the url by # and get the anchor target name - home in mysitecom/index.htm#home
75)       var parts = full_url.split("#");
76)       var trgt = parts[1];
77) 
78)       //get the top offset of the target anchor
79)       var target_offset = $("#"+trgt).offset();
80)       var target_top = target_offset.top;
81) 
82)       //goto that anchor by setting the body scroll top to anchor top
83) //      $('html, body').animate({scrollTop:target_top}, 1000);
84)     });
85) 
86)       
87)     // Bind an event to window.onhashchange
88)     $(window).bind( 'hashchange', function(e) {
89) 
90)       // Get the hash (fragment) as a string, with any leading # removed.
91)       var url = $.param.fragment();
92) 
93)       // Toggle the '.easy' divs to off
Donncha O'Cearbhaill Display Orbot on Tor downlo...

Donncha O'Cearbhaill authored 8 years ago

94)       if(url == 'windows'|url == 'mac'|url == 'linux'|url == 'android'){
Andrew Lewman patch from jmtodaro for eve...

Andrew Lewman authored 12 years ago

95) 
96) 	  $('.easy').css('display', 'none');
97)       }
98)       
99)       if(url == 'windows'){
100) 	$('.easy.windows').css('display', 'block');
101)       } else if(url == 'mac'){
102) 	$('.easy.mac').css('display', 'block');
103)       } else if(url == 'linux'){
104) 	$('.easy.linux').css('display', 'block');
Donncha O'Cearbhaill Display Orbot on Tor downlo...

Donncha O'Cearbhaill authored 8 years ago

105)       } else if(url == 'android'){
106)   $('.easy.android').css('display', 'block');
Andrew Lewman patch from jmtodaro for eve...

Andrew Lewman authored 12 years ago

107)       } else {
Andrew Lewman patch to dlpage01 javascript.

Andrew Lewman authored 12 years ago

108) 	  $('.easy').css('display', 'none');