diff --git a/css/on_the_web.admin.css b/css/on_the_web.admin.css
index 5c01576..9b5dedd 100644
--- a/css/on_the_web.admin.css
+++ b/css/on_the_web.admin.css
@@ -7,7 +7,8 @@
clear: both;
}
-#on-the-web-settings-form .form-item-type .form-type-radio {
+#on-the-web-settings-form .form-item-type .form-type-radio,
+#on-the-web-settings-form .form-item-size .form-type-radio {
float: left;
margin-right: 15px;
}
diff --git a/images/lg/delicious.png b/images/lg/delicious.png
deleted file mode 100755
index 36360b5..0000000
Binary files a/images/lg/delicious.png and /dev/null differ
diff --git a/images/lg/facebook.png b/images/lg/facebook.png
deleted file mode 100755
index a68a413..0000000
Binary files a/images/lg/facebook.png and /dev/null differ
diff --git a/images/lg/flickr.png b/images/lg/flickr.png
deleted file mode 100755
index 350b130..0000000
Binary files a/images/lg/flickr.png and /dev/null differ
diff --git a/images/lg/friendfeed.png b/images/lg/friendfeed.png
deleted file mode 100755
index 1356d82..0000000
Binary files a/images/lg/friendfeed.png and /dev/null differ
diff --git a/images/lg/google.png b/images/lg/google.png
deleted file mode 100755
index 77f971e..0000000
Binary files a/images/lg/google.png and /dev/null differ
diff --git a/images/lg/instagram.png b/images/lg/instagram.png
deleted file mode 100644
index 5d181f9..0000000
Binary files a/images/lg/instagram.png and /dev/null differ
diff --git a/images/lg/itunes.png b/images/lg/itunes.png
deleted file mode 100644
index 7730e21..0000000
Binary files a/images/lg/itunes.png and /dev/null differ
diff --git a/images/lg/linkedin.png b/images/lg/linkedin.png
deleted file mode 100755
index 94b9155..0000000
Binary files a/images/lg/linkedin.png and /dev/null differ
diff --git a/images/lg/myspace.png b/images/lg/myspace.png
deleted file mode 100755
index 32181b3..0000000
Binary files a/images/lg/myspace.png and /dev/null differ
diff --git a/images/lg/pinterest.png b/images/lg/pinterest.png
deleted file mode 100644
index 0255ab2..0000000
Binary files a/images/lg/pinterest.png and /dev/null differ
diff --git a/images/lg/rss.png b/images/lg/rss.png
deleted file mode 100755
index 301e343..0000000
Binary files a/images/lg/rss.png and /dev/null differ
diff --git a/images/lg/soundcloud.png b/images/lg/soundcloud.png
deleted file mode 100644
index f426f05..0000000
Binary files a/images/lg/soundcloud.png and /dev/null differ
diff --git a/images/lg/twitter.png b/images/lg/twitter.png
deleted file mode 100755
index 9f683ab..0000000
Binary files a/images/lg/twitter.png and /dev/null differ
diff --git a/images/lg/youtube.png b/images/lg/youtube.png
deleted file mode 100755
index 0db38cd..0000000
Binary files a/images/lg/youtube.png and /dev/null differ
diff --git a/images/sm/delicious.png b/images/sm/delicious.png
deleted file mode 100755
index 5e1faa1..0000000
Binary files a/images/sm/delicious.png and /dev/null differ
diff --git a/images/sm/facebook.png b/images/sm/facebook.png
deleted file mode 100755
index ed716d3..0000000
Binary files a/images/sm/facebook.png and /dev/null differ
diff --git a/images/sm/flickr.png b/images/sm/flickr.png
deleted file mode 100755
index 7c17475..0000000
Binary files a/images/sm/flickr.png and /dev/null differ
diff --git a/images/sm/friendfeed.png b/images/sm/friendfeed.png
deleted file mode 100755
index fbe98a3..0000000
Binary files a/images/sm/friendfeed.png and /dev/null differ
diff --git a/images/sm/google.png b/images/sm/google.png
deleted file mode 100755
index f4d89c3..0000000
Binary files a/images/sm/google.png and /dev/null differ
diff --git a/images/sm/instagram.png b/images/sm/instagram.png
deleted file mode 100644
index f90d51b..0000000
Binary files a/images/sm/instagram.png and /dev/null differ
diff --git a/images/sm/itunes.png b/images/sm/itunes.png
deleted file mode 100644
index a84bffd..0000000
Binary files a/images/sm/itunes.png and /dev/null differ
diff --git a/images/sm/linkedin.png b/images/sm/linkedin.png
deleted file mode 100755
index 2566e26..0000000
Binary files a/images/sm/linkedin.png and /dev/null differ
diff --git a/images/sm/myspace.png b/images/sm/myspace.png
deleted file mode 100755
index 3851e68..0000000
Binary files a/images/sm/myspace.png and /dev/null differ
diff --git a/images/sm/pinterest.png b/images/sm/pinterest.png
deleted file mode 100644
index 183ede3..0000000
Binary files a/images/sm/pinterest.png and /dev/null differ
diff --git a/images/sm/rss.png b/images/sm/rss.png
deleted file mode 100755
index 595609c..0000000
Binary files a/images/sm/rss.png and /dev/null differ
diff --git a/images/sm/soundcloud.png b/images/sm/soundcloud.png
deleted file mode 100644
index bf4d125..0000000
Binary files a/images/sm/soundcloud.png and /dev/null differ
diff --git a/images/sm/twitter.png b/images/sm/twitter.png
deleted file mode 100755
index 0ff373b..0000000
Binary files a/images/sm/twitter.png and /dev/null differ
diff --git a/images/sm/youtube.png b/images/sm/youtube.png
deleted file mode 100755
index 0723305..0000000
Binary files a/images/sm/youtube.png and /dev/null differ
diff --git a/on_the_web.admin.inc b/on_the_web.admin.inc
index b4ac5c5..05883d0 100644
--- a/on_the_web.admin.inc
+++ b/on_the_web.admin.inc
@@ -25,17 +25,11 @@ function on_the_web_settings_form($form, &$form_state) {
'#type' => 'radios',
'#title' => t('Icon size'),
'#options' => array(
- 'sm' => t('Small: 32px square'),
- 'lg' => t('Large: 64px square'),
+ 'sm' => t('Small: ~32px square'),
+ 'lg' => t('Large: ~64px square'),
),
'#default_value' => $config->get('size'),
);
- $form['target'] = array(
- '#type' => 'checkbox',
- '#title' => t('Open links in new windows'),
- '#default_value' => $config->get('target'),
- '#description' => t('Unchecking this box his will remove the target="_blank" attribute from each link.'),
- );
$form['sitename'] = array(
'#type' => 'radios',
'#title' => 'Hover text selection',
@@ -47,6 +41,12 @@ function on_the_web_settings_form($form, &$form_state) {
2 => t('Use me, for example: Find me on Facebook'),
),
);
+ $form['target'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Open links in new windows'),
+ '#default_value' => $config->get('target'),
+ '#description' => t('Unchecking this box his will remove the target="_blank" attribute from each link.'),
+ );
// Get all the services.
$services = on_the_web_get_services();
diff --git a/on_the_web.api.php b/on_the_web.api.php
index 53901d2..702a357 100644
--- a/on_the_web.api.php
+++ b/on_the_web.api.php
@@ -22,5 +22,8 @@ function hook_on_the_web_get_services_alter(&$services) {
$services = array('facebook' => $face)+$services;
// Add an additional service.
- $services['github'] = array('name' => 'GitHub');
+ $services['github'] = array(
+ 'name' => 'GitHub'
+ 'icon' => 'fa-github',
+ );
}
diff --git a/on_the_web.module b/on_the_web.module
index d97bd54..f531ca3 100755
--- a/on_the_web.module
+++ b/on_the_web.module
@@ -145,6 +145,7 @@ function on_the_web_block_view($delta = 'social_links', $settings = array(), $co
*/
function on_the_web_display_block($delta, $settings = array(), $contexts = array()) {
$config = config('on_the_web.settings');
+ $type = $config->get('type');
$output = '';
// Get the appropriate name to use in links.
@@ -182,30 +183,33 @@ function on_the_web_display_block($delta, $settings = array(), $contexts = array
$size = $config->get('size');
$classes = array('on-the-web', 'otw-' . $size, 'otw-' . $service);
- $weight = $config->get($service . '_weight');
$links[] = array(
'#theme' => 'on_the_web_item',
'#service' => $service,
'#link' => $link,
- '#icon' => $info['fa'],
+ '#icon' => $info['fa-icon'],
'#size' => $size,
'#title' => $title,
'#classes' => $classes,
- '#weight' => $weight,
+ '#weight' => $config->get($service . '_weight'),
);
}
- $type = $config->get('type');
if ($type == 'anchor') {
- $links['#attached'] = array(
- 'css' => array(backdrop_get_path('module', 'on_the_web') . '/css/on_the_web.css'),
- );
+ $links['#attached']['css'][] = backdrop_get_path('module', 'on_the_web') . '/css/on_the_web.css';
}
elseif ($type == 'font') {
- $links['#attached'] = array(
- 'css' => array('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array('external' => TRUE)),
- );
+ if (!module_exists('font-awesome')) {
+ $links['#attached']['css']['https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'] = array(
+ 'type' => 'external',
+ );
+ }
+ else {
+ $links['#attached'] = array(
+ 'css' => array('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array('external' => TRUE)),
+ );
+ }
}
}
@@ -249,20 +253,62 @@ function on_the_web_theme($existing, $type, $theme, $path) {
*/
function on_the_web_get_services() {
$services = array(
- 'twitter' => array('name' => 'Twitter', 'fa' => 'fa-twitter-square'),
- 'facebook' => array('name' => 'Facebook', 'fa' => 'fa-facebook-square'),
- 'pinterest' => array('name' => 'Pinterest', 'fa' => 'fa-pinterest-square'),
- 'instagram' => array('name' => 'Instagram', 'fa' => 'fa-instagram'),
- 'google' => array('name' => 'Google+', 'fa' => 'fa-google-plus-square'),
- 'youtube' => array('name' => 'YouTube', 'fa' => 'fa-youtube-square'),
- 'flickr' => array('name' => 'Flickr', 'fa' => 'fa-flickr'),
- 'linkedin' => array('name' => 'LinkedIn', 'fa' => 'fa-linkedin-square'),
- 'myspace' => array('name' => 'MySpace', 'fa' => 'fa-user'),
- 'itunes' => array('name' => 'iTunes', 'fa' => 'fa-apple'),
- 'delicious' => array('name' => 'Delicious', 'fa' => 'fa-delicious'),
- 'soundcloud' => array('name' => 'Soundcloud', 'fa' => 'fa-soundcloud'),
- 'github' => array('name' => 'GitHub', 'fa' => 'fa-github-square'),
- 'rss' => array('name' => 'RSS', 'fa' => 'fa-rss-square'),
+ 'twitter' => array(
+ 'name' => 'Twitter',
+ 'fa-icon' => 'fa-twitter-square',
+ ),
+ 'facebook' => array(
+ 'name' => 'Facebook',
+ 'fa-icon' => 'fa-facebook-square',
+ ),
+ 'pinterest' => array(
+ 'name' => 'Pinterest',
+ 'fa-icon' => 'fa-pinterest-square',
+ ),
+ 'instagram' => array(
+ 'name' => 'Instagram',
+ 'fa-icon' => 'fa-instagram',
+ ),
+ 'google' => array(
+ 'name' => 'Google+',
+ 'fa-icon' => 'fa-google-plus-square',
+ ),
+ 'youtube' => array(
+ 'name' => 'YouTube',
+ 'fa-icon' => 'fa-youtube-square',
+ ),
+ 'flickr' => array(
+ 'name' => 'Flickr',
+ 'fa-icon' => 'fa-flickr',
+ ),
+ 'linkedin' => array(
+ 'name' => 'LinkedIn',
+ 'fa-icon' => 'fa-linkedin-square',
+ ),
+ 'myspace' => array(
+ 'name' => 'MySpace',
+ 'fa-icon' => 'fa-user',
+ ),
+ 'itunes' => array(
+ 'name' => 'iTunes',
+ 'fa-icon' => 'fa-apple',
+ ),
+ 'delicious' => array(
+ 'name' => 'Delicious',
+ 'fa-icon' => 'fa-delicious',
+ ),
+ 'soundcloud' => array(
+ 'name' => 'Soundcloud',
+ 'fa-icon' => 'fa-soundcloud',
+ ),
+ 'github' => array(
+ 'name' => 'GitHub',
+ 'fa-icon' => 'fa-github-square',
+ ),
+ 'rss' => array(
+ 'name' => 'RSS',
+ 'fa-icon' => 'fa-rss-square',
+ ),
);
backdrop_alter('on_the_web_get_services', $services);
diff --git a/on_the_web.theme.inc b/on_the_web.theme.inc
index d5c4eb3..cbc3dd8 100644
--- a/on_the_web.theme.inc
+++ b/on_the_web.theme.inc
@@ -42,21 +42,15 @@ function theme_on_the_web_item($variables) {
$icon_classes = array('fa', $icon, 'fa-fw');
if ($size == 'lg') {
+ $icon_classes[] = 'fa-3x';
+ }
+ else {
$icon_classes[] = 'fa-2x';
}
$text = '';
- // Special hack for myspace, three user icons instead.
- if ($service == 'myspace') {
- $text .= '';
- $text .= '';
- }
-
- // Link the image and wrap it in a span.
- $linked_image = l($text, $link, $options);
-
- return $linked_image;
+ return l($text, $link, $options);
}
/**