PageSourceSearch

https://www.elicohen.org.il/scripts/eli_wcag.js

js elicohen.org.il collected 2026-10-02 22:00:02 UTC 11,369 bytes, 300 lines download raw bytes

1$(window).bind("load", function () {
2 
3 
4 //wcag_cssPanel = wcag_cssPanel + "body.grayscaleColors .body *{background-color:#ccc !important;}body.grayscaleColors *{background-color:#ccc !important;-moz-filter: url('data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'brightness\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#brightness');-o-filter: url('data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'brightness\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#brightness');-webkit-filter: brightness(100%);filter: gray;filter: url('data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'brightness\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#brightness');}"
5 //alert(wcag_cssPanel);
6 
7 $('head').append('<style type="text/css" id="' + "wcag-css-sub" + '">' + ":focus{border:0px solid #1DBAA8 !important} .open_accessibility_panel{padding:5px 10px 4px 10px;}.open_accessibility_panel:before{content:'';background:url('https://www.senseforce.co.il/widget/images/accessible_icon.png');display:block;width:20px;height:23px;}.accessibility_panel{top:40px;}" + '</style>');  
8
9 $('.open_accessibility_panel').text('')
10  
11 
12 $("body").on("click", "#wcagStopAnimation", function() {
13   $('#wcagStopAnimation').focus();
14 });
15 
16 $("body").on("click", "#defaultColors", function() {
17   $('#defaultColors').focus();
18 });
19
20 $('.skip_to_main_content').attr('data-wcag', 'skip-to-main-2').on( "click", function() {
21     scrollToAnchorOffset();
22	 $('h1').attr('tabindex', '0');
23	 $('h1').focus();
24 });
25 
26 $("body").on("click", "#fontLarge", function() {
27  jQuery('#header .header-nav-main nav > ul > li > a').css("padding-bottom", "20px");
28  jQuery('#header .header-nav-main nav > ul > li > ul').css("top", "25px");
29 });
30 
31 
32 
33 //--------------- focus keyboard only ---------------//
34 $('*').on('keydown.tab', function(e){
35	if ( 9== e.which && this == e.target ){
36	  window.setTimeout( function(){
37		$('.keyboard_focus').removeClass('keyboard_focus');
38		 $(document.activeElement).addClass('keyboard_focus');
39	  }, 100 );
40	}
41 });
42  
43 
44 $("#header nav").accessibleDropDown();
45 
46 $('.custom-control, .scroll-to-top').append( "<span style='font-size:0px'>arrow</span>");
47 $(".wcag-link-icon-only").each(function( i ) {
48	$(this).append( "<span style='font-size:0px;width:0px;text-indent:-18000px;color:transparent !important;display:table-caption;opacity:0 !important;'>"+$(this).attr("title")+"</span>");
49 });
50 $('.revolutionSlider_stop_button').addClass('tparrows_pause')
51 $('.revolutionSlider_resume_button').addClass('tparrows_resume')
52 $('.tparrows_resume').attr('title', 'המשך אפקט');
53 $('.tparrows_pause').attr('title', 'השהה אפקט');
54 $('.tparrows_pause').text("");
55 $('.tparrows_resume').text("");
56 $(".owl-carousel-pre-nav .owl-nav").each(function( i ) {
57    $(this).prependTo($(this).parent('.owl-carousel'));
58 });
59 $(".toggle label").each(function( i ) {
60	$(this).attr('tabindex', '0'); 
61    $(this).keypress(function(e){
62        if(e.which == 13){//Enter key pressed
63		    $(this).click();
64     }
65  });
66 });
67 
68 $('.radio-control-label').attr('tabindex', '0');
69 
70  $("body").on("click", "a.pop", function() {
71   setTimeout(
72   function() 
73   {
74	  $('.mfp-content').focus();
75	 }, 1000);
76 });
77 
78 setTimeout(
79  function() 
80  {
81	$(".tp-bullet").each(function( i ) {
82	 $(this).attr('tabindex', '0'); 
83	 $(this).attr('title', 'שקופית מצגת'); 
84    });	
85	
86	$(".owl-dot").each(function( i ) {
87	 $(this).attr('tabindex', '0'); 
88	 $(this).attr('title', 'שקופית מצגת'); 
89    });	 
90	
91	$('.scroll-to-top').attr('title', 'חזרה לראש הדף'); 
92	$('.pop, .lightbox a').attr('aria-label', 'הגדל תמונה'); 
93	
94	
95  }, 1000
96 );
97 
98
99   
100});
101
102
103
104$.fn.accessibleDropDown = function ()
105{
106	var el = $(this);
107	
108	/* Setup dropdown menus for IE 6 */
109	
110	$("li", el).mouseover(function() {
111		$(this).addClass("hover");
112	}).mouseout(function() {
113		$(this).removeClass("hover");
114	});
115	
116	/* Make dropdown menus keyboard accessible */
117	
118	$("a", el).focus(function() {
119		$(this).parents("li").addClass("hover");
120	}).blur(function() {
121		$(this).parents("li").removeClass("hover");
122	});
123}
124
125function scrollToAnchorOffset() {
126 $('html,body').animate({ scrollTop: 100 }, 'slow');
127}
128
129
130function initIMGelement() {
131    for (var i = 0; i < document.images.length; i++) {
132        //console.log(document.images[i].src);
133        if (!document.images[i].alt && document.images[i].alt != "") {
134            document.images[i].alt = "תמונה ללא כותרת";
135        }
136    }
137}
138
139function addBackToTopLink() {
140    if (jQuery('[data-wcag="main-content"]').length)
141        jQuery('[data-wcag="main-content"]').append('<a data-wcag="back-to-top" data-wcag-stat="15" title="הגעת לסוף התוכן הראשי בדף-לחץ כדי לחזור לראש הדף" href="javascript:void(0);">חזרה לראש הדף</a>');
142    else
143        jQuery('footer:last > div:first-child').prepend('<a data-wcag="back-to-top" data-wcag-stat="15" title="הגעת לסוף התוכן הראשי בדף-לחץ כדי לחזור לראש הדף" href="javascript:void(0);">חזרה לראש הדף</a>');
144}
145
146function setOwlCarouselPlugin() {
147	
148
149
150    //todo set dynamic text
151
152    if (jQuery().owlCarousel) {
153        var jQueryowl = jQuery('.owl-carousel');
154        jQuery('.owl-prev').attr({
155            'tabindex': 0,
156            'aria-label': 'חזרה לתמונה הקודמת',
157            'role': 'button'
158        });
159        
160        jQuery('.owl-prev').keypress(function (e) {
161            if (e.which == 13) {//Enter key pressed
162                jQueryowl.trigger('prev.owl')
163            }
164        });
165
166        jQuery('.owl-next').attr({
167            'tabindex': 0,
168            'aria-label': 'המשך לתמונה הבאה',
169            'role': 'button'
170        });
171
172        jQuery('.owl-next').keypress(function (e) {
173            if (e.which == 13) {//Enter key pressed
174                jQueryowl.trigger('next.owl')
175            }
176        });
177        		
178		jQuery(".owl-carousel:not(.product_gallery):not(.product_thumb_gallery):not(.timeline_owl)").prepend("<button class='owl_stop_button' title='השהה אפקט'></button>");
179        jQuery(".owl-carousel:not(.product_gallery):not(.product_thumb_gallery):not(.timeline_owl)").prepend("<button class='owl_resume_button' title='המשך אפקט'></button>");
180		
181		jQuery(".owl-carousel:not(.product_gallery):not(.product_thumb_gallery)").prepend("<button class='owl_skip_button'>דלג לאזור הבא</button>");
182		
183		if(!jQuery(".homepage_casualty_title").length){
184		 jQuery(".homepage_casualties_carousel .owl_stop_button").hide();
185		 jQuery(".homepage_casualties_carousel .owl_resume_button").hide();
186		 jQuery(".homepage_casualties_carousel .owl_skip_button").hide();
187		}
188		
189		// When skip button is clicked...
190        jQuery('.owl_skip_button').on('click', function (e) {
191		var skip_selected = jQuery(this).closest('div').find('a:last');
192		var skip_anchors = jQuery("a");
193		var skip_pos = skip_anchors.index(skip_selected);
194		var skip_next = skip_anchors.get(skip_pos+1);
195		skip_next.focus();
196			//jQuery(this).closest('section').find('a:last').focus();
197        });
198		jQuery('.timeline_owl .owl_skip_button').on('click', function (e) {
199			 jQuery('.post').find('a:first').focus();
200        });
201        jQuery('.owl_skip_button').keypress(function (e) {
202            if (e.which == 13) {//Enter key pressed
203                jQuery('.owl_skip_button').click();
204            }
205        });
206
207        // When stop button is clicked...
208        jQuery('.owl_stop_button').on('click', function (e) {
209            jQuery('.owl_stop_button').css("display", "none");
210            jQuery('.owl_resume_button').css("display", "block");
211            jQueryowl.trigger('stop.owl.autoplay');
212			jQueryowl.options.autoplayTimeout = '100000'; 
213            jQuery(this).siblings('.owl_resume_button').focus();
214        });
215        jQuery('.owl_stop_button').keypress(function (e) {
216            if (e.which == 13) {//Enter key pressed
217                jQuery('.owl_stop_button').click();
218            }
219        });
220        jQuery('.owl_stop_button').attr({
221            'aria-label': 'השהיית מצגת',
222            'role': 'button'
223        });
224
225        // When resume button is clicked...
226        jQuery('.owl_resume_button').on('click', function (e) {
227            jQuery('.owl_resume_button').css("display", "none");
228            jQuery('.owl_stop_button').css("display", "block");
229            jQueryowl.trigger('play.owl.autoplay',[500])
230			jQueryowl.options.autoplayTimeout = '500'; 
231            jQuery(this).siblings('.owl_stop_button').focus();
232        });
233        jQuery('.owl_resume_button').keypress(function (e) {
234            if (e.which == 13) {//Enter key pressed
235                jQuery('.owl_resume_button').click();
236            }
237        });
238        jQuery('.owl_resume_button').attr({
239            'aria-label': 'הפעלת מצגת',
240            'role': 'button'
241        });
242		
243	
244    }
245}
246
247function initAelement() {
248    for (var i = 0; i < document.links.length; i++) {
249        document.links[i].className += ' wcag-underline';
250    }
251
252    var tmpTitle = "";
253    //jQuery("a[href]").each(function () {
254
255    //    checks empty links
256    //    if (jQuery.trim(jQuery(this).text()) == '' && jQuery.trim(jQuery(this).html()) == '') {
257    //        jQuery(this).addClass('wcag-empty-link');
258    //        tmpTitle = jQuery(this).attr("title");
259    //        if (typeof tmpTitle == typeof undefined || tmpTitle == false || tmpTitle == '') {
260    //            jQuery(this).text('קישור ללא כותרת');
261    //        }
262    //        else {
263    //            jQuery(this).text(tmpTitle);
264    //            jQuery(this).removeAttr('title');
265    //        }
266    //    }
267        
268    //});
269
270    jQuery("a[href]").each(function () {
271
272        //checks empty links
273        var html = jQuery(this).html();
274        html = jQuery.trim(html.replace(/<!--(.*?)-->/ig, ''));
275        if (jQuery(this).text().trim() == '' && html == '') {
276            jQuery(this).addClass('wcag-empty-link');
277            tmpTitle = jQuery(this).attr("title");
278            if (typeof tmpTitle == typeof undefined || tmpTitle == false) {
279                jQuery(this).text('קישור ללא כותרת');
280            }
281            else {
282                jQuery(this).text(tmpTitle);
283                jQuery(this).removeAttr('title');
284            }
285        }
286
287    });
288
289    tmpTitle = "";
290    jQuery("[target='_blank']").each(function () {
291        tmpTitle = jQuery(this).attr("title");
292        if (typeof tmpTitle == typeof undefined || tmpTitle == false)
293            tmpTitle = "";
294        jQuery(this).attr("title", tmpTitle+" יפתח בחלון חדש").attr('rel', 'external');
295    });
296}
297
298
299
300

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.