Issue #3238995 by cola: remove jquery dependency
Related #3238995
Merge request reports
Activity
- Resolved by Nikolay Grachev
added 3 commits
-
f0f791d5...03ab9dfb - 2 commits from branch
project:2.0.x
- af2f3d23 - Merge branch '2.0.x' of https://git.drupalcode.org/project/extlink into...
-
f0f791d5...03ab9dfb - 2 commits from branch
added 3 commits
-
1cb7a8ee - 1 commit from branch
project:2.0.x
- 62c33bb1 - Merge branch '2.0.x' of https://git.drupalcode.org/project/extlink into...
- 6d78feb0 - Cspell update
-
1cb7a8ee - 1 commit from branch
added 1 commit
- 4094606f - Replace broken jQuery-isms with JS. Move some JS to do fewer loops.
142 return !(drupalSettings.data.extlink.extTargetNoOverride && link.matches('a[target]')); 143 }); 144 145 // Add target attr to open link in a new tab. 146 external_links.forEach(function(link, i) { 147 external_links[i].setAttribute('target', '_blank'); 148 }); 144 149 145 150 // Add noopener rel attribute to combat phishing. 146 $(external_links).attr('rel', function (i, val) { 151 external_links.forEach(function (link, i) { 152 var val = link.getAttribute('rel'); 147 153 // If no rel attribute is present, create one with the value noopener. 148 154 if (val === null || typeof val === 'undefined') { 149 return 'noopener'; 155 external_links[i].setAttribute('rel','noopener'); changed this line in version 9 of the diff
145 150 // Add noopener rel attribute to combat phishing. 146 $(external_links).attr('rel', function (i, val) { 151 external_links.forEach(function (link, i) { 152 var val = link.getAttribute('rel'); 147 153 // If no rel attribute is present, create one with the value noopener. 148 154 if (val === null || typeof val === 'undefined') { 149 return 'noopener'; 155 external_links[i].setAttribute('rel','noopener'); 156 return; 150 157 } 151 158 // Check to see if rel contains noopener. Add what doesn't exist. 152 159 if (val.indexOf('noopener') > -1) { 153 160 if (val.indexOf('noopener') === -1) { 154 return val + ' noopener'; 161 // Add noopener. 162 external_links[i].setAttribute('rel',val + ' noopener'); changed this line in version 9 of the diff
177 188 target = 'follow'; 178 189 } 179 190 if (val.indexOf(target) === -1) { 180 return val + ' nofollow'; 191 // Add nofollow. 192 external_links[i].setAttribute('rel',val + ' nofollow'); changed this line in version 9 of the diff
181 193 } 182 return val; 183 194 }); 184 195 } 185 196 186 197 if (drupalSettings.data.extlink.extNoreferrer) { 187 $(external_links).attr('rel', function (i, val) { 198 external_links.forEach(function (link, i) { 199 var val = link.getAttribute('rel'); 188 200 // When the link does not have a rel attribute set it to 'noreferrer'. 189 201 if (val === null || typeof val === 'undefined') { 190 return 'noreferrer'; 191 } 192 if (val.indexOf('noreferrer') === -1) { 193 return val + ' noreferrer'; 202 external_links[i].setAttribute('rel','noreferrer'); changed this line in version 9 of the diff
added 8 commits
-
c2e30083...4598433b - 7 commits from branch
project:2.0.x
- 8de1fd1b - Merge branch '2.0.x' into 3238995-remove-jquery-dependency
-
c2e30083...4598433b - 7 commits from branch
273 if (class_name !== '0') { 274 $links_to_process[i].classList.add(class_name); 275 } 276 277 // Add data-extlink attribute. 278 $links_to_process[i].setAttribute('data-extlink', ''); 279 280 var $link = $links_to_process[i]; 281 // Create an icon element. 282 var iconElement; 256 283 if (drupalSettings.data.extlink.extUseFontAwesome) { 284 iconElement = document.createElement('span'); 285 iconElement.setAttribute('class', 'fa-' + class_name + ' extlink'); 257 286 if (class_name === drupalSettings.data.extlink.mailtoClass) { 258 $link[icon_placement]('<span class="fa-' + class_name + ' extlink"><span class="' + drupalSettings.data.extlink.extFaMailtoClasses + '" aria-label="' + drupalSettings.data.extlink.mailtoLabel + '"></span></span>'); 287 iconElement.innerHTML = '<span class="' + drupalSettings.data.extlink.extFaMailtoClasses + '" aria-label="' + drupalSettings.data.extlink.mailtoLabel + '"></span>'; changed this line in version 11 of the diff
added 6 commits
Toggle commit list
Please register or sign in to reply