diff --git a/css/suitcase.css b/css/suitcase.css index 6bf8f60..b4d3396 100644 --- a/css/suitcase.css +++ b/css/suitcase.css @@ -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 */ diff --git a/js/suitcase_external_links.js b/js/suitcase_external_links.js new file mode 100644 index 0000000..56e556e --- /dev/null +++ b/js/suitcase_external_links.js @@ -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); diff --git a/suitcase_interim.info b/suitcase_interim.info index bedb9d5..ada37c3 100644 --- a/suitcase_interim.info +++ b/suitcase_interim.info @@ -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' @@ -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'