1function updateAlts(){ 2 var ol = document.getElementById('openlayers-map'); 3 if(!ol) 4 ol = document.getElementById('openlayers-views-map'); 5 if(!ol && document.getElementsByClassName('openlayers-views-map').length > 0) 6 ol = document.getElementsByClassName('openlayers-views-map').item(0); 7 if(!ol && document.getElementsByClassName('views-field-field-google-map').length > 0) 8 ol = document.getElementsByClassName('views-field-field-google-map').item(0); 9 10 img_childs = ol.getElementsByTagName('img'); 11 for(i = 0; i < img_childs.length; i++){ 12 alt = img_childs.item(i).getAttribute('alt'); 13 if(!alt || alt === null){ 14 if(img_childs.item(i).getAttribute('id') !== null) 15 img_childs.item(i).setAttribute('alt', img_childs.item(i).id); 16 else 17 img_childs.item(i).setAttribute('alt', "map_marker_" + i); 18 } 19 if(img_childs.item(i).hasAttribute('role') === true) 20 img_childs.item(i).removeAttribute('role'); 21 } 22 var unselected = ol.querySelectorAll('div[unselectable="on"]'); 23 for(t = 0; t < unselected.length; t++){ 24 if(unselected.item(t).hasAttribute('unselectable') === true) 25 unselected.item(t).removeAttribute('unselectable'); 26 } 27 28} 29 30var callback = function(mutationsList, observer) { 31 updateAlts(); 32} 33 34function addALts(c){ 35 updateAlts(); 36 var config = { attributes: true, childList: true, subtree: true }; 37 var observer = new MutationObserver(callback); 38 observer.observe(c, config); 39} 40 41function cleanOpenLayer(){ 42 var ol = document.getElementById('openlayers-map'); 43 var olv = document.getElementById('openlayers-views-map'); 44 var olvc = document.getElementsByClassName('openlayers-views-map'); 45 var vfgm = document.getElementsByClassName('views-field-field-google-map'); 46 var frames = document.getElementsByTagName('iframe'); 47 var calendars = document.getElementsByClassName('hasDatepicker'); 48 if(ol || olv || olvc.length > 0 || vfgm.length > 0){ 49 if(ol) 50 var c = ol; 51 else if(olv) 52 var c = olv; 53 else if(olvc.length > 0) 54 var c = olvc.item(0); 55 else if(vfgm. length > 0) 56 var c = vfgm.item(0); 57 addALts(c); 58 } 59 if(frames.length > 0){ 60 for(i = 0; i < frames.length; i++){ 61 frames.item(i).removeAttribute('frameborder'); 62 frames.item(i).removeAttribute('webkitallowfullscreen'); 63 frames.item(i).removeAttribute('mozallowfullscreen'); 64 frames.item(i).setAttribute('title', 'open layers map'); 65 } 66 } 67} 68 69 70function cleanGoogleTag(){ 71 var googleTag = document.getElementsByClassName('region-page-top')[0]; 72 if(googleTag){ 73 var noScript = googleTag.getElementsByTagName('noscript')[0]; 74 noScript.removeAttribute('aria-hidden'); 75 noScript.innerHTML = noScript.innerHTML.replace('height="0" width="0"', ''); 76 } 77} 78 79 80document.addEventListener("DOMContentLoaded", function(){ 81 cleanOpenLayer(); 82 cleanGoogleTag(); 83});; 84; 85jQuery(function() { // onReady() 86 //jQuery('#edit-field-txnmy-microsite .form-select option:disabled').hide(); 87 var txnmy_microsite; 88 var microsite; 89 txnmy_microsite = jQuery('#edit-field-txnmy-microsite .form-select option:disabled'); 90 microsite = jQuery('#edit-field-microsite .form-select option:disabled'); 91 if (typeof txnmy_microsite != 'undefined') { 92 txnmy_microsite.remove(); 93 } 94 if (typeof microsite != 'undefined') { 95 microsite.remove(); 96 } 97 98} ); // end onReady() 99; 100(function ($) { 101 102Drupal.extlink = Drupal.extlink || {}; 103 104Drupal.extlink.attach = function (context, settings) { 105 if (!settings.hasOwnProperty('extlink')) { 106 return; 107 } 108 109 // Strip the host name down, removing ports, subdomains, or www. 110 var pattern = /^(([^\/:]+?\.)*)([^\.:]{4,})((\.[a-z]{1,4})*)(:[0-9]{1,5})?$/; 111 var host = window.location.host.replace(pattern, '$3$4'); 112 var subdomain = window.location.host.replace(pattern, '$1'); 113 114 // Determine what subdomains are considered internal. 115 var subdomains; 116 if (settings.extlink.extSubdomains) { 117 subdomains = "([^/]*\\.)?"; 118 } 119 else if (subdomain == 'www.' || subdomain == '') { 120 subdomains = "(www\\.)?"; 121 } 122 else { 123 subdomains = subdomain.replace(".", "\\."); 124 } 125 126 // Build regular expressions that define an internal link. 127 var internal_link = new RegExp("^https?://" + subdomains + host, "i"); 128 129 // Extra internal link matching. 130 var extInclude = false;
131 if (settings.extlink.extInclude) { 132 extInclude = new RegExp(settings.extlink.extInclude.replace(/\\/, '\\'), "i"); 133 } 134 135 // Extra external link matching. 136 var extExclude = false; 137 if (settings.extlink.extExclude) { 138 extExclude = new RegExp(settings.extlink.extExclude.replace(/\\/, '\\'), "i"); 139 } 140 141 // Extra external link CSS selector exclusion. 142 var extCssExclude = false; 143 if (settings.extlink.extCssExclude) { 144 extCssExclude = settings.extlink.extCssExclude; 145 } 146 147 // Extra external link CSS selector explicit. 148 var extCssExplicit = false; 149 if (settings.extlink.extCssExplicit) { 150 extCssExplicit = settings.extlink.extCssExplicit; 151 } 152 153 // Find all links which are NOT internal and begin with http as opposed 154 // to ftp://, javascript:, etc. other kinds of links. 155 // When operating on the 'this' variable, the host has been appended to 156 // all links by the browser, even local ones. 157 // In jQuery 1.1 and higher, we'd use a filter method here, but it is not 158 // available in jQuery 1.0 (Drupal 5 default). 159 var external_links = new Array(); 160 var mailto_links = new Array(); 161 $("a:not(." + settings.extlink.extClass + ", ." + settings.extlink.mailtoClass + "), area:not(." + settings.extlink.extClass + ", ." + settings.extlink.mailtoClass + ")", context).each(function(el) { 162 try { 163 var url = this.href.toLowerCase(); 164 if (url.indexOf('http') == 0 165 && ((!url.match(internal_link) && !(extExclude && url.match(extExclude))) || (extInclude && url.match(extInclude))) 166 && !(extCssExclude && $(this).parents(extCssExclude).length > 0) 167 && !(extCssExplicit && $(this).parents(extCssExplicit).length < 1)) { 168 external_links.push(this); 169 } 170 // Do not include area tags with begin with mailto: (this prohibits 171 // icons from being added to image-maps). 172 else if (this.tagName != 'AREA' 173 && url.indexOf('mailto:') == 0 174 && !(extCssExclude && $(this).parents(extCssExclude).length > 0) 175 && !(extCssExplicit && $(this).parents(extCssExplicit).length < 1)) { 176 mailto_links.push(this); 177 } 178 } 179 // IE7 throws errors often when dealing with irregular links, such as: 180 // <a href="node/10"></a> Empty tags. 181 // <a href="http://user:[email protected]">example</a> User:pass syntax. 182 catch (error) { 183 return false; 184 } 185 }); 186 187 if (settings.extlink.extClass) { 188 Drupal.extlink.applyClassAndSpan(external_links, settings.extlink.extClass); 189 } 190 191 if (settings.extlink.mailtoClass) { 192 Drupal.extlink.applyClassAndSpan(mailto_links, settings.extlink.mailtoClass); 193 } 194 195 if (settings.extlink.extTarget) { 196 // Apply the target attribute to all links. 197 $(external_links).attr('target', settings.extlink.extTarget); 198 } 199 200 Drupal.extlink = Drupal.extlink || {}; 201 202 // Set up default click function for the external links popup. This should be 203 // overridden by modules wanting to alter the popup. 204 Drupal.extlink.popupClickHandler = Drupal.extlink.popupClickHandler || function() { 205 if (settings.extlink.extAlert) { 206 return confirm(settings.extlink.extAlertText); 207 } 208 } 209 210 $(external_links).click(function(e) { 211 return Drupal.extlink.popupClickHandler(e); 212 }); 213}; 214 215/** 216 * Apply a class and a trailing <span> to all links not containing images. 217 * 218 * @param links 219 * An array of DOM elements representing the links. 220 * @param class_name 221 * The class to apply to the links. 222 */ 223Drupal.extlink.applyClassAndSpan = function (links, class_name) { 224 var $links_to_process; 225 if (Drupal.settings.extlink.extImgClass){ 226 $links_to_process = $(links); 227 } 228 else { 229 var links_with_images = $(links).find('img').parents('a'); 230 $links_to_process = $(links).not(links_with_images); 231 } 232 $links_to_process.addClass(class_name); 233 var i; 234 var length = $links_to_process.length; 235 for (i = 0; i < length; i++) { 236 var $link = $($links_to_process[i]); 237 if ($link.css('display') == 'inline' || $link.css('display') == 'inline-block') { 238 if (class_name == Drupal.settings.extlink.mailtoClass) { 239 $link.append('<span class="' + class_name + '"><span class="element-invisible"> ' + Drupal.settings.extlink.mailtoLabel + '</span></span>'); 240 } 241 else { 242 $link.append('<span class="' + class_name + '"><span class="element-invisible"> ' + Drupal.settings.extlink.extLabel + '</span></span>'); 243 } 244 } 245 } 246}; 247 248Drupal.behaviors.extlink = Drupal.behaviors.extlink || {}; 249Drupal.behaviors.extlink.attach = function (context, settings) { 250 // Backwards compatibility, for the benefit of modules overriding extlink 251 // functionality by defining an "extlinkAttach" global function. 252 if (typeof extlinkAttach === 'function') { 253 extlinkAttach(context); 254 } 255 else { 256 Drupal.extlink.attach(context, settings); 257 } 258}; 259 260})(jQuery); 261;
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.