seo_checklist.js 734 B

1234567891011121314151617181920212223
  1. (function ($) {
  2. "use strict";
  3. Drupal.behaviors.seo_checklist = {
  4. attach: function (context) {
  5. // Open external links in a new window.
  6. $('#checklistapi-checklist-form fieldset a', context).filter(function () {
  7. // Ignore non-HTTP (e.g. mailto:) link.
  8. return this.href.indexOf('http') === 0;
  9. }).filter(function () {
  10. // Filter out links to the same domain.
  11. return this.hostname && this.hostname !== location.hostname;
  12. }).each(function () {
  13. // Send all links to drupal.org to the same window. Open others in their
  14. // own windows.
  15. $(this).attr('target', (this.hostname === 'drupal.org') ? 'drupal_org' : '_blank');
  16. });
  17. }
  18. };
  19. })(jQuery);