PageSourceSearch

https://themaritimehotel.com/wp-content/plugins/gcommerce-ada-fixes/public/js/gcommerce-ada-fixes.js?ver=7.1.1

js themaritimehotel.com collected 2026-10-01 13:02:59 UTC 14,168 bytes, 292 lines download raw bytes

1jQuery(window).on('load', function () {
2
3  // var t0 = performance.now();
4
5  /**********************************
6    GENERAL 
7  ***********************************/
8  // Add alt tag to any image missing it
9  var $image = jQuery('img');
10
11  $image.each(function() {
12    // First figure out of the alt tag is missing or empty.
13    if ( jQuery(this).attr('alt') == '' || !(jQuery(this).attr('alt')) )  {
14      // The tag is empty or not present, now let's figure out what to do with it.
15      if ( jQuery(this).attr('src') !== undefined && jQuery(this).attr('src') !== '' )  {
16        // Since we don't have a good alt tag, let's get the name of the file from the img's src
17        var imgName = jQuery(this).attr('src');
18        // Get the position of the last slash in the src url
19        var index = imgName.lastIndexOf("/") + 1;
20        // get just the file name itself, stripping out the rest of the url
21        var filename = imgName.substr(index);
22        // Strip off the extension
23        filename = filename.substr(0, filename.length-4);
24        // Apply the file name to the alt tag
25        jQuery(this).attr('alt', filename );
26      } else {
27        jQuery(this).attr('alt', 'Image Placeholder');
28      }
29    }
30  });
31
32  // Focus styles for menus when using keyboard navigation
33  // Properly update the ARIA states on focus (keyboard) and mouse over events
34  jQuery( '[role="menubar"]' ).on( 'focus.aria  mouseenter.aria', '[aria-haspopup="true"]', function ( ev ) {
35    jQuery( ev.currentTarget ).attr( 'aria-expanded', true );
36  } );
37
38  // Properly update the ARIA states on blur (keyboard) and mouse out events
39  jQuery( '[role="menubar"]' ).on( 'blur.aria  mouseleave.aria', '[aria-haspopup="true"]', function ( ev ) {
40    jQuery( ev.currentTarget ).attr( 'aria-expanded', false );
41  } );
42
43  // Generic next and previous links
44  jQuery(".next-link a").attr('aria-label', 'next room');
45  jQuery(".prev-link a").attr('aria-label', 'previous room');
46
47  // datepicker fixes
48  jQuery(".calendar").attr('aria-label', 'Pick a date');
49
50  // Remove all empty headings (h1, h2, etc.)
51  jQuery(':header:empty').remove();
52
53  // Remove all empty labels
54  jQuery('label:empty').remove();
55
56  // Add an aria-label to empty anchor tags.
57  jQuery('a:empty').attr('aria-label', 'Navigation Link');
58
59  /**********************************
60    ENABLE ACCESSIBILITY PLUGIN
61  ***********************************/
62  // Irony, thy name is Hebrew accessibility tool fix. We load this here because the script wasn't done loading yet when put earlier, it requires the on.load event.
63  jQuery(".tr-trigger").attr('role', 'button');
64  jQuery(".tr-trigger").attr('aria-label', 'Enable Language');
65  jQuery(".tr-trigger").attr('title', 'Enable Language');
66  jQuery(".tr-trigger-active").attr('role', 'button');
67  jQuery(".tr-trigger-active").attr('aria-label', 'Enable Language');
68  jQuery(".tr-trigger-active").attr('title', 'Enable Language');
69  jQuery("#enable-logo").parent().attr('aria-label', 'Enable Toolbar Home');
70  jQuery(".enable-toolbar-links-section a").attr('aria-label', 'Enable Toolbar Links');
71  jQuery("#wfboxPrevious").attr('aria-label', 'Previous');
72  jQuery("#wfboxNext").attr('aria-label', 'Next');
73  jQuery("#wfboxSlideshow").attr('aria-label', 'Slideshow');
74
75  // Add warning to accessibility tool for IE users.
76  jQuery("#enable-toolbar-content").prepend('<div style="color: white; padding-left: 10px;">This tool will only display in Hebrew in Internet Explorer. In order to see English, please switch to an alternate browser like Chrome or Firefox.</div>');
77
78  /**********************************
79    FANCYBOX
80  ***********************************/
81  // Add alt tag to any image missing it
82  var $fancylink = jQuery('.fancybox:empty');
83
84  $fancylink.each(function() {
85    // If there's no aria-label already, then let's add one.
86    if ( ! (jQuery(this).attr('aria-label')))  {
87      // Fancybox adds a caption to images, so let's use that as our aria-label. First set the variable.
88      var linkName = jQuery(this).attr('caption');
89      // Now let's put the caption in as the aria-label.
90      jQuery(this).attr('aria-label', linkName );
91    }
92  });
93
94  /**********************************
95    POPUP PLATINUM PLUGIN
96  ***********************************/
97  jQuery("#sgcboxPrevious, #sgcboxNext, #sgcboxSlideshow").attr('role', 'Slideshow');
98  jQuery("#sgcboxPrevious, #sgcboxNext, #sgcboxSlideshow").each(function() {
99    if ( ! (jQuery(this).css('display') == 'none'))  {
100      jQuery(this).remove();
101    }
102  });
103
104  /**********************************
105    GLIDE SLIDER
106  ***********************************/
107  jQuery("button.rest-submit, button.glide__bullet, button.glide__arrow").attr('role', 'button');
108  jQuery("button.rest-submit, button.glide__bullet, .glide__arrow.next").attr('aria-label', 'next slide');
109  jQuery(".glide__arrow.prev").attr('aria-label', 'previous slide');
110
111  /**********************************
112    FLEXSLIDER
113  ***********************************/
114  jQuery(".flex-next, .flex-prev").attr('role', 'button');
115  jQuery(".flex-next").attr('aria-label', 'next slide');
116  jQuery(".flex-prev").attr('aria-label', 'previous slide');
117
118  /**********************************
119    GOOGLE MAPS
120  ***********************************/
121  // Google Maps images
122  jQuery(".gmnoprint img").attr('alt', 'Google Maps icon'); 
123
124  jQuery(".gmpSearchBar input").attr('title', 'Google Maps Control');
125  jQuery("#gmpCmcSearchFormPrev_1 input").attr('title', 'Google Maps Search');
126  jQuery(".gm-err-icon img").attr('alt', 'Google Maps Error');
127  jQuery(".gmpCmcCattsShell .list-group-item input").attr('title', 'Google Maps Tab');
128  jQuery(".gmpSliderTitleDescShell a").attr('aria-label', 'Open Marker in Google Map');
129  jQuery(".gmpCmcSearchFormShell form input.gmpCmcSearchText").attr('title', 'Google Maps Search');
130  jQuery(".gmpCmcSearchFormShell form input.gmpSearchRadius").attr('title', 'Google Maps Search Radius');
131
132  // Confusing "image map area missing alternative text" result
133  jQuery(".gmnoprint map area").attr('alt', 'Google Map Area');
134
135  // ready google maps button missing aria-label attribute
136
137 jQuery(document).on('DOMNodeInserted', function(e) {
138  jQuery( "#mCSB_1_container .list-group-item" ).each(function( index ) {
139      var n = index; 
140      console.log(n);
141      var selector1 = '#mCSB_1_container ul li:nth-child(' + (n + 1) + ') label span.button-checkbox.bootstrap-checkbox button';
142      var selector2 = '#mCSB_1_container ul li:nth-child(' + (n + 1) + ') label span.label-checkbox';
143    jQuery(selector1).attr('aria-label', jQuery(selector2).text()); 
144  });
145  /**********************************
146    SLICK SLIDER
147  ***********************************/
148  // Slick slider
149  jQuery('.slick-slide').removeAttr('aria-describedby'); // The plugin was entering incorrect aria data
150})
151
152  /**********************************
153    INSTAGRAM PRO
154  ***********************************/
155  jQuery(".sbi_instagram_link").attr('role', 'button');
156  jQuery(".sbi_instagram_link").attr('aria-label', 'Open Instagram Feed');
157  jQuery(".sbi_lb-next").attr('aria-label', 'next');
158  jQuery(".sbi_lb-prev").attr('aria-label', 'previous');
159  jQuery(".sbi_link_area").attr('aria-label', 'Open this image in a lightbox');
160  jQuery("#sbi_linkedin_icon").attr('aria-label', 'Linked In');
161  jQuery("#sbi_email_icon").attr('aria-label', 'Email');
162  jQuery("#sbi_pinterest_icon").attr('aria-label', 'Pinterest');
163  jQuery("#sbi_google_icon").attr('aria-label', 'Google');
164  jQuery("#sbi_twitter_icon").attr('aria-label', 'Twitter');
165  jQuery("#sbi_facebook_icon").attr('aria-label', 'Facebook');
166
167  /**********************************
168    FACEBOOK FEED
169  ***********************************/
170  jQuery(".cff-item a").attr('aria-label', 'View on Facebook');
171  jQuery(".cff-link img").attr('alt', 'Facebook Image');
172  jQuery(".cff-link a.cff-link img").attr('alt', 'Facebook Image');
173  jQuery(".cff-lightbox-next").attr('aria-label', 'next image');
174  jQuery(".cff-lightbox-prev").attr('aria-label', 'previous image');
175
176  /**********************************
177    FONT AWESOME / GENERAL SOCIAL ICONS
178  ***********************************/
179  jQuery(".fa-facebook, .sprite--facebook").parent().attr('aria-label', 'Facebook');
180  jQuery(".fa-twitter, .sprite--twitter").parent().attr('aria-label', 'Twitter');
181  jQuery(".fa-instagram, .sprite--instagram").parent().attr('aria-label', 'Instagram');
182  jQuery(".fa-tripadvisor, .sprite--tripadvisor").parent().attr('aria-label', 'Trip Advisor');
183  jQuery(".fa-pinterest, .fa-pinterest-p, .sprite--pinterest").parent().attr('aria-label', 'Pinterest');
184  jQuery(".fa-linkedin, .sprite--linkedin").parent().attr('aria-label', 'LinkedIn');
185  jQuery(".fa-google-plus, .sprite--googleplus").parent().attr('aria-label', 'Google Plus');
186  jQuery(".fa-rss").parent().attr('aria-label', 'RSS Feed');
187  jQuery(".fa-phone").parent().attr('aria-label', 'Call Us');
188  jQuery(".fa-paw").parent().attr('aria-label', 'About Pets');
189  jQuery(".fa-video-camera").parent().attr('aria-label', 'View Webcam');
190  jQuery(".fa-youtube, .sprite--youtube ").parent().attr('aria-label', 'YouTube');
191
192  jQuery(".facebook").attr('aria-label', 'Facebook');
193  jQuery(".twitter").attr('aria-label', 'Twitter');
194  jQuery(".instagram").attr('aria-label', 'Instagram');
195  jQuery(".pinterest").attr('aria-label', 'Pinterest');
196
197  /**********************************
198    GRAVITY FORMS
199  ***********************************/
200  //While some of these have more broad applications, they are generally associated with Gravity Forms
201
202  // When GF adds complex fields (like the Name field, that adds first name, last name, prefix, etc. all in one field group, or date fields), it adds a label for the entire group that references the ID of the first element in the group, throwing "Multiple form label" errors. This function finds those and replaces the wrapping LABEL with a wrapping SPAN instead.
203  jQuery(".gfield_label_before_complex").each(function() {
204    jQuery(this).replaceWith("<span class='gfield_label gfield_label_before_complex'>" + jQuery(this).text() + "</span>");
205  });
206  
207  // Add title tag to any select element missing one (helps resolve Gravity Forms issues on sites where we use placeholders instead of labels)
208  var $selectBox = jQuery('select');
209  $selectBox.each(function() {
210    if ( ! (jQuery(this).attr('title')))  {
211      jQuery(this).attr('title', 'Gravity Forms Select Box' );
212    }
213  });
214
215  // Remove empty table heads (Gravity Forms throws these sometimes) or those with just &nbsp;
216  var $formHeaders = jQuery('th');
217  $formHeaders.each(function() {
218    if ( (jQuery(this).html() == '&nbsp;') || (jQuery(this).html() == '') )  {
219      jQuery(this).remove();
220    }
221  });
222
223  // Gravity forms submit buttons that don't have text need an aria-label
224  jQuery(".gform_submit_button").attr('aria-label', 'Submit'); 
225
226  // Add title tag to any input element missing one (helps resolve Gravity Forms issues on sites where we use placeholders instead of labels)
227  var $inputField = jQuery('input');
228  $inputField.each(function() {
229    if ( ! (jQuery(this).attr('title')))  {
230      jQuery(this).attr('title', 'Form Input Box' );
231    }
232  });
233
234  // Add title tag to any textarea element missing one (helps resolve Gravity Forms issues on sites where we use placeholders instead of labels)
235  var $textBox = jQuery('textarea');
236  $textBox.each(function() {
237    if ( ! (jQuery(this).attr('title')))  {
238      jQuery(this).attr('title', 'Gravity Forms Select Box' );
239    }
240  });
241  /**********************************
242    jQuery Colorbox
243  ***********************************/
244  jQuery('#cboxNext').attr('aria-label', 'Next item');
245  jQuery('#cboxPrevious').attr('aria-label', 'Previous item');
246  jQuery('#cboxSlideshow').attr('aria-label', 'Navigation Control');
247
248  /**********************************
249    SITE SPECIFIC FIXES
250  ***********************************/
251
252  jQuery(".logo a").attr('aria-label', 'Home'); // SSR
253  jQuery(".sliding-menu-button").attr('role', 'button'); // SSR
254  jQuery(".sliding-menu-button").attr('aria-label', 'button'); // SSR
255  jQuery("p.subtitle a").attr('aria-label', 'Learn more about this special'); // SSR Special slider in footer
256  jQuery("#requestType").attr('title', 'Select special type'); // SSR Booking Widget
257  jQuery("#codebox").attr('title', 'Enter special code'); // SSR Booking Widget
258  jQuery(".select2-offscreen").attr('aria-label', 'Form control'); // SSR Booking Widget
259  jQuery(".select2-offscreen").attr('title', 'Form control'); // SSR Booking Widget
260  jQuery("#select2_autogen3_search").attr('title', 'Search box'); // SSR Booking Widget
261  jQuery("#s2id_autogen3_search").attr('title', 'Search box'); // SSR Booking Widget
262
263  jQuery('.select-container #location').attr('aria-label', 'Choose a location');
264
265  // Hotel Figueroa
266  jQuery(".uk-offcanvas-close").attr('aria-label', 'Close');
267  jQuery(".uk-navbar-toggle").attr('aria-label', 'Toggle Menu');
268  jQuery(".wk-slidenav-previous").attr('aria-label', 'Previous');
269  jQuery(".wk-slidenav-next").attr('aria-label', 'Next');
270  jQuery("a[uk-icon='icon: instagram']").attr('aria-label', 'Instagram');
271  jQuery("a[uk-icon='icon: facebook']").attr('aria-label', 'Facebook');
272  jQuery("a[uk-icon='icon: twitter']").attr('aria-label', 'Twitter');
273  jQuery("a[uk-icon='icon: google-plus']").attr('aria-label', 'Google+');
274  jQuery("a.uk-position-cover").html('This is a clickable overlay.');
275  jQuery("a.uk-position-cover").css('opacity', 0);
276  jQuery("a.wk-position-cover").html('This is a clickable overlay.');
277  jQuery("a.wk-position-cover").css('opacity', 0);
278
279  // Madrona -- MenuModo widget as an empty navigation link
280  jQuery('go-top').attr('aria-label', 'Go to the top of the page');
281  
282  // Ninja Forms honeypot error on PelicanInn.com
283  jQuery('.nf-form-hp').remove();
284  jQuery('.component-gallery-slideshow__left').attr('aria-label', 'Previous Slide');
285  jQuery('.component-gallery-slideshow__right').attr('aria-label', 'Next Slide');
286  jQuery('.component-gallery-slideshow__close').attr('aria-label', 'Close');
287
288
289  // var t1 = performance.now();
290  // console.log("Correcting common ADA mistakes took " + (t1 - t0) + " milliseconds.")    
291
292})

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.