Index: extensions/SocialButtons/admin.php
===================================================================
--- extensions/SocialButtons/admin.php	(revision 24230)
+++ extensions/SocialButtons/admin.php	(revision 24757)
@@ -12,4 +12,5 @@
     'position' => $_POST['position'],
     'on_index' => get_boolean($_POST['on_index']),
+    'light' => isset($_POST['light']),
     'twitter' => array(
       'enabled' => isset($_POST['twitter']['enabled']),
Index: extensions/SocialButtons/include/install.inc.php
===================================================================
--- extensions/SocialButtons/include/install.inc.php	(revision 24230)
+++ extensions/SocialButtons/include/install.inc.php	(revision 24757)
@@ -11,4 +11,5 @@
       'position' => 'toolbar',
       'on_index' => true,
+      'light' => false,
       'twitter' => array(
         'enabled' => true,
@@ -42,19 +43,19 @@
     {
       $temp = is_string($conf['TumblrShare']) ? unserialize($conf['TumblrShare']) : $conf['TumblrShare'];
-      $default_config['tumblr']['type'] = $temp['type'];
-      $default_config['tumblr']['img_size'] = $temp['img_size'];
+      if (!empty($temp['type']))      $default_config['tumblr']['type'] =     $temp['type'];
+      if (!empty($temp['img_size']))  $default_config['tumblr']['img_size'] = $temp['img_size'];
     }
     if (isset($conf['TweetThis']))
     {
       $temp = is_string($conf['TweetThis']) ? unserialize($conf['TweetThis']) : $conf['TweetThis'];
-      $default_config['twitter']['size'] = $temp['size'];
-      $default_config['twitter']['count'] = $temp['count'] ? 'bubble' : 'none';
-      $default_config['twitter']['via'] = $temp['via'];
+      if (!empty($temp['type']))  $default_config['twitter']['size'] =  $temp['size'];
+      if (!empty($temp['count'])) $default_config['twitter']['count'] = $temp['count'] ? 'bubble' : 'none';
+      if (!empty($temp['via']))   $default_config['twitter']['via'] =   $temp['via'];
     }
     if (isset($conf['GooglePlusOne']))
     {
       $temp = is_string($conf['GooglePlusOne']) ? unserialize($conf['GooglePlusOne']) : $conf['GooglePlusOne'];
-      $default_config['google']['size'] = $temp['size'];
-      $default_config['google']['annotation'] = $temp['annotation'];
+      if (!empty($temp['size']))        $default_config['google']['size'] =       $temp['size'];
+      if (!empty($temp['annotation']))  $default_config['google']['annotation'] = $temp['annotation'];
     }
     
@@ -64,5 +65,5 @@
   else
   {
-    $new_conf = unserialize($conf['SocialButtons']);
+    $new_conf = is_string($conf['SocialButtons']) ? unserialize($conf['SocialButtons']) : $conf['SocialButtons'];
     
     if (empty($new_conf['pinterest']))
@@ -74,4 +75,5 @@
         );
     }
+    
     if (!isset($new_conf['on_index']))
     {
@@ -84,4 +86,9 @@
     }
     
+    if (!isset($new_conf['light']))
+    {
+      $new_conf['light'] = false;
+    }
+    
     $conf['SocialButtons'] = serialize($new_conf);
     conf_update_param('SocialButtons', $conf['SocialButtons']);
Index: extensions/SocialButtons/include/pinterest.inc.php
===================================================================
--- extensions/SocialButtons/include/pinterest.inc.php	(revision 24230)
+++ extensions/SocialButtons/include/pinterest.inc.php	(revision 24757)
@@ -4,5 +4,5 @@
 function socialbutt_pinterest($basename, $root_url, &$tpl_vars, &$buttons)
 {
-  // only on piture page
+  // only on picture page
   if ($basename != 'picture')
   {
Index: extensions/SocialButtons/include/twitter.inc.php
===================================================================
--- extensions/SocialButtons/include/twitter.inc.php	(revision 24230)
+++ extensions/SocialButtons/include/twitter.inc.php	(revision 24757)
@@ -6,5 +6,5 @@
   global $conf, $template, $user;
   
- $twitter_langs = array(
+  $twitter_langs = array(
     'fr','en','ar','ja','es','de','it','id','pt','ko','tr','ru','nl','fil','msa','zh-tw',
     'zh-cn','hi','no','sv','fi','da','pl','hu','fa','he','ur','th','uk','ca','el','eu','cs'
Index: extensions/SocialButtons/language/en_UK/plugin.lang.php
===================================================================
--- extensions/SocialButtons/language/en_UK/plugin.lang.php	(revision 24230)
+++ extensions/SocialButtons/language/en_UK/plugin.lang.php	(revision 24757)
@@ -13,3 +13,5 @@
 $lang['on photo and album'] = 'on photo and album';
 $lang['only on photo'] = 'only on photo';
+$lang['Light mode'] = 'Light mode';
+$lang['When light mode is activated no external script is loaded, it <b>speeds up the load of the page and disables user tracking</b> but also disables annotations and in-page popups.'] = 'When light mode is activated no external script is loaded, it <b>speeds up the load of the page and disables user tracking</b> but also disables annotations and in-page popups.';
 ?>
Index: extensions/SocialButtons/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/SocialButtons/language/fr_FR/plugin.lang.php	(revision 24230)
+++ extensions/SocialButtons/language/fr_FR/plugin.lang.php	(revision 24757)
@@ -15,3 +15,5 @@
 $lang['on photo and album'] = 'sur les photos et les albums';
 $lang['only on photo'] = 'uniquement sur les photos';
+$lang['Light mode'] = 'Mode léger';
+$lang['When light mode is activated no external script is loaded, it <b>speeds up the load of the page and disables user tracking</b> but also disables annotations and in-page popups.'] = 'Quand le mode léger est activé aucun script externe n\'est chargé, celà <b>accélère le chargement de la page est désactive le tracking des utilisateurs</b> mais désactive aussi les annotations et les popups détaillés.';
 ?>
Index: extensions/SocialButtons/main.inc.php
===================================================================
--- extensions/SocialButtons/main.inc.php	(revision 24230)
+++ extensions/SocialButtons/main.inc.php	(revision 24757)
@@ -119,8 +119,8 @@
   
   
-  define('SOCIALBUTT_POSITION', $conf['SocialButtons']['position']);
   $tpl_vars = array(
     'share_url' => $share_url,
     'position' => $conf['SocialButtons']['position'],
+    'light' => $conf['SocialButtons']['light'],
     'copyright' => '(from <a href="'.$share_url.'">'.$conf['gallery_title'].'</a>)',
     );
@@ -177,14 +177,17 @@
   {
     case 'index':
-      foreach ($buttons as $button) {
-        $template->add_index_button('<li>'.$button.'</li>', 100);
+      foreach ($buttons as $button)
+      {
+        $template->add_index_button($button, 100);
       }
       break;
     case 'toolbar':
-      foreach ($buttons as $button) {
+      foreach ($buttons as $button)
+      {
         $template->add_picture_button($button, 100);
       }
       break;
     default;
+      define('SOCIALBUTT_POSITION', $conf['SocialButtons']['position']);
       $template->assign('SOCIALBUTT_BUTTONS', $buttons);
       $template->set_prefilter('picture', 'socialbutt_add_button_prefilter');
@@ -198,10 +201,10 @@
     case 'top':
       $search = '<div id="theImage">';
-      $add = '<div>{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON} {/foreach}</div>';
+      $add = '<div id="socialButtons">{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON} {/foreach}</div>';
       break;
       
     case 'bottom':
       $search = '{$ELEMENT_CONTENT}';
-      $add = '<div>{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON} {/foreach}</div>';
+      $add = '<div id="socialButtons">{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON} {/foreach}</div>';
       break;
   }
Index: extensions/SocialButtons/maintain.inc.php
===================================================================
--- extensions/SocialButtons/maintain.inc.php	(revision 24230)
+++ extensions/SocialButtons/maintain.inc.php	(revision 24757)
@@ -24,5 +24,8 @@
 function plugin_uninstall() 
 {
-  pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "SocialButtons" LIMIT 1;');
+  global $conf;
+  
+  pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "SocialButtons";');
+  unset($conf['SocialButtons']);
 }
 
Index: extensions/SocialButtons/template/admin.tpl
===================================================================
--- extensions/SocialButtons/template/admin.tpl	(revision 24230)
+++ extensions/SocialButtons/template/admin.tpl	(revision 24757)
@@ -3,9 +3,13 @@
 {html_style}{literal}
 .socialbutt.disabled thead img {
+  -webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */
   filter: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='grayscale'><feColorMatrix type='saturate' values='0'/></filter></svg>#grayscale"); /* Firefox 10+ */
   filter: gray; /* IE6-9 */
-  -webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */
 }
-{/literal}{/html_style}
+{/literal}
+{if $light}
+.not-light {ldelim} display:none; }
+{/if}
+{/html_style}
 
 {footer_script}{literal}
@@ -23,4 +27,21 @@
   }
 });
+
+jQuery("input#light_mode").on('change', function() {
+  if ($(this).is(":checked")) {
+    $('.not-light').hide();
+  }
+  else {
+    $('.not-light').show();
+  }
+});
+
+jQuery(".showInfo").tipTip({
+  delay: 0,
+  fadeIn: 200,
+  fadeOut: 200,
+  maxWidth: '300px',
+  defaultPosition: 'bottom'
+});
 {/literal}{/footer_script}
 
@@ -54,4 +75,13 @@
     </td>
   </tr>
+  <tr class="property">
+    <td>
+      <label for="light_mode">{'Light mode'|@translate}</label>
+    </td>
+    <td>
+      <input type="checkbox" id="light_mode" name="light" {if $light}checked="checked"{/if}/>
+      <a class="showInfo" title="{'When light mode is activated no external script is loaded, it <b>speeds up the load of the page and disables user tracking</b> but also disables annotations and in-page popups.'|@translate}">i</a>
+    </td>
+  </tr>
 </table>
 </div>
@@ -87,5 +117,5 @@
       </label></td>
     </tr>
-    <tr class="property">
+    <tr class="property not-light">
       <td>
         {'Annotation'|@translate}
@@ -145,5 +175,5 @@
       </label></td>
     </tr>
-    <tr class="property">
+    <tr class="property not-light">
       <td>
         {'Annotation'|@translate}
@@ -180,5 +210,5 @@
       </td>
     </tr>
-    <tr class="property">
+    <tr class="property not-light">
       <td>
         {'Annotation'|@translate}
@@ -221,5 +251,5 @@
       </label></td>
     </tr>
-    <tr class="property">
+    <tr class="property not-light">
       <td>
         {'Annotation'|@translate}
Index: extensions/SocialButtons/template/facebook.tpl
===================================================================
--- extensions/SocialButtons/template/facebook.tpl	(revision 24230)
+++ extensions/SocialButtons/template/facebook.tpl	(revision 24757)
@@ -1,7 +1,12 @@
 {strip}
+{if $SOCIALBUTT.light}
+<a href="https://www.facebook.com/sharer.php?u={$SOCIALBUTT.share_url|urlencode}&t={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}" rel="nofollow"
+  onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=500');return false;" target="_blank">
+  <img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/facebook_{$SOCIALBUTT.FACEBOOK.color}.png" alt="Share on Facebook"></a>
+{else}
 {footer_script}jQuery('body').prepend('<div id="fb-root"></div>');{/footer_script}
 {combine_script id='facebook_jssdk' load='footer' path='https://connect.facebook.net/'|cat:$SOCIALBUTT.FACEBOOK.lang|cat:'/all.js#xfbml=1'}
-
 <div style="display:inline-block;" class="fb-like" data-send="false" data-show-faces="false" 
   data-href="{$SOCIALBUTT.share_url}" data-layout="{$SOCIALBUTT.FACEBOOK.layout}" data-colorscheme="{$SOCIALBUTT.FACEBOOK.color}"></div>
+{/if}
 {/strip}
Index: extensions/SocialButtons/template/google.tpl
===================================================================
--- extensions/SocialButtons/template/google.tpl	(revision 24230)
+++ extensions/SocialButtons/template/google.tpl	(revision 24757)
@@ -1,6 +1,11 @@
 {strip}
+{if $SOCIALBUTT.light}
+<a title="Google +" href="https://plus.google.com/share?url={$SOCIALBUTT.share_url|urlencode}&hl={$SOCIALBUTT.GOOGLE.lang}" rel="nofollow" 
+  onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=390,width=480');return false;" target="_blank">
+  <img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/google_{$SOCIALBUTT.GOOGLE.size}.png" alt="Share on Google+"></a>
+{else}
 {combine_script id='google_plusone' load='footer' path='https://apis.google.com/js/plusone.js'}
-
 <script type="text/javascript">window.___gcfg = {ldelim}lang: '{$SOCIALBUTT.GOOGLE.lang}'};</script>
 <div style="display:inline-block;" class="g-plusone" data-size="{$SOCIALBUTT.GOOGLE.size}" data-annotation="{$SOCIALBUTT.GOOGLE.annotation}" data-href="{$SOCIALBUTT.share_url}" data-recommendations="false"></div>
+{/if}
 {/strip}
Index: extensions/SocialButtons/template/pinterest.tpl
===================================================================
--- extensions/SocialButtons/template/pinterest.tpl	(revision 24230)
+++ extensions/SocialButtons/template/pinterest.tpl	(revision 24757)
@@ -1,6 +1,10 @@
 {strip}
-{combine_script id='pinterest_pinit' load='footer' path='https://assets.pinterest.com/js/pinit.js'}
-
-<a href="http://pinterest.com/pin/create/button/?url={$SOCIALBUTT.share_url|urlencode}&media={$SOCIALBUTT.PINTEREST.source|urlencode}&description={$SOCIALBUTT.PINTEREST.title|cat:' '|cat:$SOCIALBUTT.copyright|urlencode}" 
-  class="pin-it-button" count-layout="{$SOCIALBUTT.PINTEREST.layout}"><img border="0" src="http://assets.pinterest.com/images/PinExt.png" title="Pin It"/></a>
+<a href="http://pinterest.com/pin/create/button/?url={$SOCIALBUTT.share_url|urlencode}&media={$SOCIALBUTT.PINTEREST.source|urlencode}&description={$SOCIALBUTT.PINTEREST.title|cat:' '|cat:$SOCIALBUTT.copyright|urlencode}" rel="nofollow"
+{if $SOCIALBUTT.light}
+  onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=470,width=600');return false;" target="_blank"
+{else}
+  class="pin-it-button" count-layout="{$SOCIALBUTT.PINTEREST.layout}"
+  {combine_script id='pinterest_pinit' load='footer' path='https://assets.pinterest.com/js/pinit.js'}
+{/if}
+><img border="0" src="http://assets.pinterest.com/images/PinExt.png" title="Pin It"/></a>
 {/strip}
Index: extensions/SocialButtons/template/style.css
===================================================================
--- extensions/SocialButtons/template/style.css	(revision 24230)
+++ extensions/SocialButtons/template/style.css	(revision 24757)
@@ -117,2 +117,13 @@
   content:"\2611";
 }
+
+
+.showInfo {
+  position:static;
+  display:inline-block;
+  padding:1px 6px;
+  width:4px;
+  height:14px;
+  line-height:14px;
+  font-size:0.8em;
+}
Index: extensions/SocialButtons/template/tumblr.tpl
===================================================================
--- extensions/SocialButtons/template/tumblr.tpl	(revision 24230)
+++ extensions/SocialButtons/template/tumblr.tpl	(revision 24757)
@@ -1,10 +1,13 @@
 {strip}
-{combine_script id='tumblr_share' load='footer' path='http://platform.tumblr.com/v1/share.js'}
-
 {if $SOCIALBUTT.TUMBLR.mode=='photo'}
 {capture assign="inline_tags"}{foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first},{/if}{$tag.name}{/foreach}{/capture}
-<a href="http://www.tumblr.com/share/photo?source={$SOCIALBUTT.TUMBLR.source|urlencode}&caption={$SOCIALBUTT.TUMBLR.title|cat:' '|cat:$SOCIALBUTT.copyright|urlencode}&clickthru={$SOCIALBUTT.share_url|urlencode}&tags={$inline_tags|urlencode}"
+<a href="http://www.tumblr.com/share/photo?source={$SOCIALBUTT.TUMBLR.source|urlencode}&caption={$SOCIALBUTT.TUMBLR.title|cat:' '|cat:$SOCIALBUTT.copyright|urlencode}&clickthru={$SOCIALBUTT.share_url|urlencode}&tags={$inline_tags|urlencode}" rel="nofollow" 
 {else}
-<a href="http://www.tumblr.com/share/link?url={$SOCIALBUTT.share_url|urlencode}&name={$SOCIALBUTT.TUMBLR.title|cat:' | '|cat:$GALLERY_TITLE|urlencode}&description={$CONTENT_DESCRIPTION|cat:$SOCIALBUTT.copyright|urlencode}"
+<a href="http://www.tumblr.com/share/link?url={$SOCIALBUTT.share_url|urlencode}&name={$SOCIALBUTT.TUMBLR.title|cat:' | '|cat:$GALLERY_TITLE|urlencode}&description={$CONTENT_DESCRIPTION|cat:$SOCIALBUTT.copyright|urlencode}" rel="nofollow" 
+{/if}
+{if $SOCIALBUTT.light}
+  onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=430,width=500');return false;" target="_blank"
+{else}
+  {combine_script id='tumblr_share' load='footer' path='http://platform.tumblr.com/v1/share.js'}
 {/if}
 ><img src="http://platform.tumblr.com/v1/{$SOCIALBUTT.TUMBLR.type}.png" alt="Share on Tumblr"></a>
Index: extensions/SocialButtons/template/twitter.tpl
===================================================================
--- extensions/SocialButtons/template/twitter.tpl	(revision 24230)
+++ extensions/SocialButtons/template/twitter.tpl	(revision 24757)
@@ -1,8 +1,11 @@
 {strip}
-{combine_script id='twitter_widgets' load='footer' path='https://platform.twitter.com/widgets.js'}
-
-<a href="https://twitter.com/share?url={$SOCIALBUTT.share_url|urlencode}&text={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}{if $SOCIALBUTT.TWITTER.via}&via={$SOCIALBUTT.TWITTER.via}{/if}" 
+<a href="https://twitter.com/share?url={$SOCIALBUTT.share_url|urlencode}&text={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}{if $SOCIALBUTT.TWITTER.via}&via={$SOCIALBUTT.TWITTER.via}{/if}" rel="nofollow"
+{if $SOCIALBUTT.light}
+  onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=470,width=600');return false;" target="_blank"
+{else}
   data-url="{$SOCIALBUTT.share_url}" data-lang="{$SOCIALBUTT.TWITTER.lang}" data-via="{$SOCIALBUTT.TWITTER.via}"
-  data-size="{$SOCIALBUTT.TWITTER.size}" data-count="{$SOCIALBUTT.TWITTER.count}" class="twitter-share-button">
-  <img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/twitter_{$SOCIALBUTT.TWITTER.size}.png" alt="Share on Twitter"></a>
+  data-size="{$SOCIALBUTT.TWITTER.size}" data-count="{$SOCIALBUTT.TWITTER.count}" class="twitter-share-button"
+  {combine_script id='twitter_widgets' load='footer' path='https://platform.twitter.com/widgets.js'}
+{/if}
+><img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/twitter_{$SOCIALBUTT.TWITTER.size}.png" alt="Share on Twitter"></a>
 {/strip}
