Skip to content

Commit

Permalink
Merge pull request #97 from isubit/INTERIM-12
Browse files Browse the repository at this point in the history
INTERIM 12 - External link styling
  • Loading branch information
angelamnr authored Mar 29, 2017
2 parents a574213 + 55ee73d commit 2ae5eaf
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
17 changes: 17 additions & 0 deletions css/suitcase.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,23 @@ a > .fa { margin-right: 10px; }
background: #333333;
}

/* External Links */

#section-content a.external:after {
content: '\f08e';
font-family: 'FontAwesome';
font-size: 0.75em;
display: inline-block;
margin-left: 4px;
vertical-align: text-top;
}

#section-content .pane-menu-menu-social a.external:after,
#section-content .view-resources a.external:after,
#section-content .biblio-entry a.external:after {
content: '';
}

/* --------------------- */
/* Lists */

Expand Down
15 changes: 15 additions & 0 deletions js/suitcase_external_links.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Function for adding a class to external links
* so they can be styled.
*/

(function ($) {

$(document).ready(function() {

$('a').filter(function() {
return this.hostname && this.hostname !== location.hostname;
}).not('a:has(img)').addClass('external');
});

})(jQuery);
5 changes: 5 additions & 0 deletions suitcase_interim.info
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ settings[alpha_libraries][suitcase_jquery_smart_menu] = 'suitcase_jquery_smart_m
settings[alpha_libraries][suitcase_smart_menu_init] = 'suitcase_smart_menu_init'
settings[alpha_libraries][suitcase_image_floats] = 'suitcase_image_floats'
settings[alpha_libraries][suitcase_responsive_tables] = 'suitcase_responsive_tables'
settings[alpha_libraries][suitcase_external_links] = 'suitcase_external_links'
settings[alpha_css][alpha-reset.css] = 'alpha-reset.css'
settings[alpha_css][alpha-mobile.css] = 'alpha-mobile.css'
settings[alpha_css][alpha-alpha.css] = 'alpha-alpha.css'
Expand Down Expand Up @@ -417,3 +418,7 @@ libraries[suitcase_responsive_tables][name] = 'Suitcase Responsive Tables'
libraries[suitcase_responsive_tables][description] = 'Support for table display on mobile devices'
libraries[suitcase_responsive_tables][js][0][file] = 'suitcase_responsive_tables.js'
libraries[suitcase_responsive_tables][js][0][options][weight] = '30'
libraries[suitcase_external_links][name] = 'Suitcase External Links'
libraries[suitcase_external_links][description] = 'Add a class to style external links'
libraries[suitcase_external_links][js][0][file] = 'suitcase_external_links.js'
libraries[suitcase_external_links][js][0][options][weight] = '30'

0 comments on commit 2ae5eaf

Please sign in to comment.