PageSourceSearch

https://www.indiacgny.org/JS/access.js

js indiacgny.org collected 2026-10-02 07:44:03 UTC 3,718 bytes, 129 lines download raw bytes

1//  Ref:  https://accesskeys.org/
2
3akCookie = {
4	create : function(name, value, days) {
5		var expires = "";
6		if(days) { 
7			var expireDate = new Date();
8			expireDate.setTime(expireDate.getTime() + (days * 24 * 60 * 60 * 1000));
9			expires = "; expires=" + expireDate.toGMTString();
10		}
11		document.cookie = name + "=" + value + expires + "; path=/";
12	},
13	read : function(name) {
14		var nameEQ = name + "=";
15		var ca = document.cookie.split(';');
16		for(var i=0;i < ca.length;i++) {
17			var c = ca[i];
18			while (c.charAt(0)==' ') c = c.substring(1,c.length);
19			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
20		}
21		return null;
22	},
23	erase : function(name) {
24		akCookie.create(name, '', -1);
25	}
26}
27
28$(function(){
29	$('#accessControl').show();
30	akAccess = function() {
31		var sizes = {normal : '65%', large : '75%', larger : '85%'};
32		var contrasts = ['normal', 'wob'];
33		var chosenSize;
34		var chosenContrast;
35		//check for cookie
36		var cookieValue = akCookie.read('akAccessSettings');
37		
38		if(cookieValue !== null) {
39			//read cookie to get 
40			settings = cookieValue.split(' ');
41			_setFontSize(settings[0]);	
42			_setContrast(settings[1]);
43		}else{
44			$('input#font-normal').addClass('current');
45			$('input#contrast-normal').addClass('current');
46		}
47
48		function _setFontSize(size) {
49			$('body').css('font-size', sizes[size]);
50			//$('body').animate({ fontSize: sizes[size] }, 500 );
51			for(key in sizes) { 
52				if(size === key) { chosenSize = key } 
53			}
54			if(!chosenSize) { chosenSize = 'normal'; }
55			$('#font-' + chosenSize).addClass('current');
56		}
57
58		function _setContrast(contrast) {
59			chosenContrast = contrast; 
60			if(!contrast in contrasts){ contrast = 'normal'; }
61			if(contrast === 'normal') {
62				$('body').removeClass(contrasts.join(' '));
63			}else{
64				$('body').addClass(contrast);
65			}
66			$('input.contrastChanger').each(function(){$(this).removeClass('current'); });
67			$('input#contrast-' + chosenContrast).addClass('current');
68		}
69
70		function _save() {
71			akCookie.create('akAccessSettings', (chosenSize + ' ' + chosenContrast), 2);
72		}
73
74
75		return {
76			handleFontSizeEvent : function(size) {
77			    var varFontSize = size.split('_')[size.split('_').length-1];
78				_setFontSize(varFontSize);
79				_save();
80				return false;
81			},
82			handleContrastEvent : function (contrast) {
83			
84			var varContrastSize = contrast.split('_')[contrast.split('_').length-1];
85				_setContrast(varContrastSize);
86				_save();
87				return false;
88			}
89		}
90	}();
91		$('#accessControl input.fontScaler').click(function(){
92			
93				akAccess.handleFontSizeEvent($(this).attr('id'));
94				$('#accessControl input.fontScaler').each(function(){$(this).removeClass('current');});
95				$(this).addClass('current');
96				return false;								
97		});
98		$('#accessControl input.contrastChanger').click(function(){
99			akAccess.handleContrastEvent($(this).attr('id'));
100		});
101		/*$('#accessControl input.fontScaler').click(function(){
102			var iFlag = true;
103			if($.browser.msie)
104			{
105				if($("html").hasClass("lt8"))
106				{					
107					iFlag = false;
108					return true;
109				}
110			}
111
112			if(iFlag)
113			{
114				akAccess.handleFontSizeEvent($(this).attr('id'));
115				$('#accessControl input.fontScaler').each(function(){$(this).removeClass('current');});
116				$(this).addClass('current');
117				return false;								
118			}
119		});
120		$('#accessControl input.contrastChanger').click(function(){
121			akAccess.handleContrastEvent($(this).attr('id'));
122		});*/
123//$('#accessControl').css({ marginTop: "-500px" }, 1000 );
124//$('#accessControl').animate({ marginTop: "0" }, 1000 );
125$('#backToTop').css({ marginRight: "-200px" }, 1000 );
126$('#backToTop').animate({ marginRight: "0" }, 1000 );		
127$('.sliderDesc').hide();
128$('body').removeClass('noJS');
129});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.