Index: /extensions/SmiliesSupport/admin.php
===================================================================
--- /extensions/SmiliesSupport/admin.php	(revision 23235)
+++ /extensions/SmiliesSupport/admin.php	(revision 23236)
@@ -66,13 +66,8 @@
     }
   }
-
-  if (file_exists(SMILIES_DIR.$_POST['folder'].'/smilies.txt'))
-  {
-    @copy(SMILIES_DIR.$_POST['folder'].'/smilies.txt', SMILIES_DIR.$_POST['folder'].'/smilies.bak');
-  }
   
-  if (@!file_put_contents(SMILIES_DIR.$_POST['folder'].'/smilies.txt', $content))
+  if (@!file_put_contents(SMILIES_DIR.$_POST['folder'].'/smilies-custom.txt', $content))
   {  
-    $page['errors'][] = l10n('File/directory read error').' : '.SMILIES_DIR.$_POST['folder'].'/smilies.txt';
+    $page['errors'][] = l10n('File/directory read error').' : '.SMILIES_DIR.$_POST['folder'].'/smilies-custom.txt';
   }
 }
Index: /extensions/SmiliesSupport/include/functions.inc.php
===================================================================
--- /extensions/SmiliesSupport/include/functions.inc.php	(revision 23235)
+++ /extensions/SmiliesSupport/include/functions.inc.php	(revision 23236)
@@ -20,7 +20,8 @@
 }
 
-function smiliessupport_get_list()
+function smiliessupport_action()
 {
-  if (!isset($_GET['action']) || $_GET['action']!='ss_preview') return;
+  if (!isset($_GET['action'])) return;
+  if (strpos($_GET['action'], 'ss_') !== 0) return;
   
   global $conf;
@@ -28,28 +29,46 @@
   $folder = SMILIES_DIR . ltrim($_GET['folder'], '/') . '/';
   
-  $short = array();
-  if (file_exists($folder.'smilies.txt'))
+  if ($_GET['action'] == 'ss_reset')
   {
-    foreach (file($folder.'smilies.txt', FILE_IGNORE_NEW_LINES) as $v)
+    @unlink($folder.'smilies-custom.txt');
+    $_GET['action'] = 'ss_list';
+  }
+  
+  if ($_GET['action'] == 'ss_list')
+  {
+    $short = array();
+    if (file_exists($folder.'smilies-custom.txt'))
     {
-      if (preg_match('#^([^\s]+)[\s]+(.+)$#', trim($v), $matches)) 
+      $file = file($folder.'smilies-custom.txt', FILE_IGNORE_NEW_LINES);
+    }
+    else if (file_exists($folder.'smilies.txt'))
+    {
+      $file = file($folder.'smilies.txt', FILE_IGNORE_NEW_LINES);
+    }
+    if (!empty($file))
+    {
+      foreach ($file as $v)
       {
-        $short[ $matches[2] ][] = $matches[1];
+        if (preg_match('#^([^\s]+)[\s]+(.+)$#', trim($v), $matches)) 
+        {
+          $short[ $matches[2] ][] = $matches[1];
+        }
       }
     }
+
+    $smilies = array();
+    $handle = opendir($folder);
+    while (false !== ($file = readdir($handle)))
+    {
+      if ( $file != '.' && $file != '..' && in_array(get_extension($file), $conf['smiliessupport']['ext']) )
+      {
+        $smilies[$file] = array('title'=>':'.get_filename_wo_extension($file).':', 'file'=>$file, 'short'=>@$short[$file]);
+      }
+    }
+    closedir($handle);
+    
+    echo json_encode(array('path'=>$folder, 'smilies'=>$smilies));
   }
-
-  $smilies = array();
-  $handle = opendir($folder);
-  while (false !== ($file = readdir($handle)))
-  {
-    if ( $file != '.' && $file != '..' && in_array(get_extension($file), $conf['smiliessupport']['ext']) )
-    {
-      $smilies[$file] = array('title'=>':'.get_filename_wo_extension($file).':', 'file'=>$file, 'short'=>@$short[$file]);
-    }
-  }
-  closedir($handle);
   
-  echo json_encode(array('path'=>$folder, 'smilies'=>$smilies));
   exit;
 }
Index: /extensions/SmiliesSupport/include/smiliessupport.inc.php
===================================================================
--- /extensions/SmiliesSupport/include/smiliessupport.inc.php	(revision 23235)
+++ /extensions/SmiliesSupport/include/smiliessupport.inc.php	(revision 23236)
@@ -79,7 +79,15 @@
   }
   
-  if (file_exists($folder.'smilies.txt'))
+  if (file_exists($folder.'smilies-custom.txt'))
   {
-    foreach (file($folder.'smilies.txt', FILE_IGNORE_NEW_LINES) as $v)
+    $file = file($folder.'smilies-custom.txt', FILE_IGNORE_NEW_LINES);
+  }
+  else if (file_exists($folder.'smilies.txt'))
+  {
+    $file = file($folder.'smilies.txt', FILE_IGNORE_NEW_LINES);
+  }
+  if (!empty($file))
+  {
+    foreach ($file as $v)
     {
       $v = trim($v);
Index: /extensions/SmiliesSupport/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/SmiliesSupport/language/en_UK/plugin.lang.php	(revision 23235)
+++ /extensions/SmiliesSupport/language/en_UK/plugin.lang.php	(revision 23236)
@@ -2,9 +2,9 @@
 
 $lang['Smilies set'] = 'Smilies set';
-$lang['Smiley'] = 'Smiley';
 $lang['Shortcuts'] = 'Shortcuts';
 $lang['Columns'] = 'Columns';
 $lang['Smilies'] = 'Smilies';
 $lang['Edit shorcuts'] = 'Edit shorcuts';
+$lang['Reset defaults'] = 'Reset defaults';
 $lang['If you change current set you will lost every shortcuts changes.'] = 'If you change current set you will lost every shortcuts changes.';
 
Index: /extensions/SmiliesSupport/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/SmiliesSupport/language/fr_FR/plugin.lang.php	(revision 23235)
+++ /extensions/SmiliesSupport/language/fr_FR/plugin.lang.php	(revision 23236)
@@ -2,9 +2,9 @@
 
 $lang['Smilies set'] = 'Set de smileys';
-$lang['Smiley'] = 'Smiley';
 $lang['Shortcuts'] = 'Raccourcis';
 $lang['Columns'] = 'Colonnes';
 $lang['Smilies'] = 'Smileys';
 $lang['Edit shorcuts'] = 'Modifier les raccouris';
+$lang['Reset defaults'] = 'Réinitialiser';
 $lang['If you change current set you will lost every shortcuts changes.'] = 'Si vous changez de set, vous perdrez les modifications des raccourcis.';
 
Index: /extensions/SmiliesSupport/main.inc.php
===================================================================
--- /extensions/SmiliesSupport/main.inc.php	(revision 23235)
+++ /extensions/SmiliesSupport/main.inc.php	(revision 23236)
@@ -73,5 +73,5 @@
 {
   add_event_handler('get_admin_plugin_menu_links', 'smiliessupport_admin_menu');
-  add_event_handler('init', 'smiliessupport_get_list');
+  add_event_handler('init', 'smiliessupport_action');
   
   function smiliessupport_admin_menu($menu) 
Index: /extensions/SmiliesSupport/smilies/pidgin/index.php
===================================================================
--- /extensions/SmiliesSupport/smilies/pidgin/index.php	(revision 23236)
+++ /extensions/SmiliesSupport/smilies/pidgin/index.php	(revision 23236)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/SmiliesSupport/smilies/pidgin/smilies-custom.txt
===================================================================
--- /extensions/SmiliesSupport/smilies/pidgin/smilies-custom.txt	(revision 23236)
+++ /extensions/SmiliesSupport/smilies/pidgin/smilies-custom.txt	(revision 23236)
@@ -0,0 +1,34 @@
+oO		bulgy-eyes.png
+Oo		bulgy-eyes.png
+OO		bulgy-eyes.png
+:s		confused.png
+:S		confused.png
+:-s		confused.png
+:-S		confused.png
+;(		crying.png
+;-(		crying.png
+^^		cute.png
+:D		excited.png
+:-D		excited.png
+:)		happy.png
+:-)		happy.png
+<3		in-love.png
+:|		neutral.png
+:-|		neutral.png
+:?		question.png
+:(		sad.png
+:-(		sad.png
+:o		shocked.png
+:-o		shocked.png
+:O		shocked.png
+:-O		shocked.png
+:x		shut-mouth.png
+:-x		shut-mouth.png
+:\		thinking.png
+:-\		thinking.png
+:p		tongue.png
+:-p		tongue.png
+:P		tongue.png
+:-P		tongue.png
+;)		wink.png
+;-)		wink.png
Index: /extensions/SmiliesSupport/smilies/pidgin/smilies.txt
===================================================================
--- /extensions/SmiliesSupport/smilies/pidgin/smilies.txt	(revision 23235)
+++ /extensions/SmiliesSupport/smilies/pidgin/smilies.txt	(revision 23236)
@@ -13,5 +13,5 @@
 :)		happy.png
 :-)		happy.png
-<3		in_love.png
+<3		in-love.png
 :|		neutral.png
 :-|		neutral.png
Index: /extensions/SmiliesSupport/template/smiliessupport_admin.tpl
===================================================================
--- /extensions/SmiliesSupport/template/smiliessupport_admin.tpl	(revision 23235)
+++ /extensions/SmiliesSupport/template/smiliessupport_admin.tpl	(revision 23236)
@@ -44,4 +44,27 @@
 });
 
+// reset defaults
+jQuery(".reset").click(function() {
+    var ok = confirm("{/literal}{'Are you sure?'|@translate}{literal}");
+    if (!ok) return false;
+    
+    jQuery.ajax({
+        url: 'admin.php',
+        type: 'GET',
+        dataType: 'json',
+        data: {
+            action: 'ss_reset',
+            folder: jQuery("select[name='folder']").val(),
+        },
+        success: function(result) {
+            data = result;
+            edited = false;
+            update();
+        }
+    });
+    
+    return false;
+});
+
 // display edit form before submit
 jQuery("#smiliesupport").submit(function() {
@@ -57,5 +80,5 @@
         dataType: 'json',
         data: {
-            action: 'ss_preview',
+            action: 'ss_list',
             folder: jQuery("select[name='folder']").val(),
         },
@@ -74,4 +97,5 @@
     if (!edit) {
         html+= '<tr>';
+        
         var cols = parseInt(jQuery("input[name='cols']").val());
         var i=0;
@@ -80,35 +104,53 @@
             var smiley = data.smilies[file];
             html+= '<td><a href="#" title="'+ smiley.title +'"><img src="'+ data.path + smiley.file +'"/></a></td>';
-            if ((parseInt(i)+1)%cols == 0) html+= '</tr><tr>';
+            html+= (i+1)%cols==0 ? '</tr><tr>' : '';
             i++;
         }
         
         html+= '</tr>';
+        
+        jQuery(".reset").hide();
     }
     else {
     {/literal}
         html+= '<tr>'
-            +'<th>{'Smiley'|@translate}</th>'
+            +'<th></th>'
             +'<th>{'Name'|@translate}</th>'
             +'<th>{'Shortcuts'|@translate}</th>'
-          +'</tr>';
+            +'<th class="spacer"></th>'
+            +'<th></th>'
+            +'<th>{'Name'|@translate}</th>'
+            +'<th>{'Shortcuts'|@translate}</th>'
+          +'</tr>'
+          
+          +'<tr>';
      {literal}
+     
+        var i=0;
      
         for (var file in data.smilies) {
             var smiley = data.smilies[file];
-            html+= '<tr data-file="'+ smiley.file +'">'
-                +'<td><img src="'+ data.path + smiley.file +'"/></td>'
-                +'<td>'+ smiley.title +'</td>'
-                +'<td>'
-                  +'<select name="shortcuts['+ smiley.file +']" class="shortcuts">';
+            
+            html+= 
+              '<td><img src="'+ data.path + smiley.file +'"/></td>'
+              +'<td>'+ smiley.title +'</td>'
+              +'<td data-file="'+ smiley.file +'">'
+                +'<select name="shortcuts['+ smiley.file +']" class="shortcuts">';
+              
+              for (var j in smiley.short) {
+                  html+= '<option value="'+ smiley.short[j] +'" selected>'+ smiley.short[j] +'</option>';
+              }
                 
-                for (var j in smiley.short) {
-                    html+= '<option value="'+ smiley.short[j] +'" selected>'+ smiley.short[j] +'</option>';
-                }
-                  
-                html+= '</select>'
-                +'</td>'
-              +'</tr>';
-        }
+            html+= 
+                '</select>'
+              +'</td>';
+            
+            html+= (i+1)%2==0 ? '</tr><tr>' : '<td></td>';
+            i++;
+        }
+        
+        html+= '</tr>';
+        
+        jQuery(".reset").show();
     }
     
@@ -128,5 +170,5 @@
         onAdd: function(item) {
             edited = true;
-            var file = $(this).parents("tr").data("file");
+            var file = $(this).parent("td").data("file");
             
             if (data.smilies[file].short == null) {
@@ -139,5 +181,5 @@
         onDelete: function(item) {
           edited = true;
-          var file = $(this).parents("tr").data("file");
+          var file = $(this).parent("td").data("file");
           
           for (var i in data.smilies[file].short) {
@@ -191,4 +233,5 @@
   <a href="#" class="edit buttonLike">{'Edit shorcuts'|@translate}</a>
   <table id="preview"></table>
+  <a href="#" class="reset buttonLike" style="display:none;">{'Reset defaults'|@translate}</a>
 </fieldset>
   
Index: /extensions/SmiliesSupport/template/style.css
===================================================================
--- /extensions/SmiliesSupport/template/style.css	(revision 23235)
+++ /extensions/SmiliesSupport/template/style.css	(revision 23236)
@@ -6,15 +6,21 @@
 }
 
-.token-input-list li {
-  clear:none !important;
-  padding: 1px 3px !important;
-  margin-bottom: 3px !important;
+.token-input-list {
+  width:250px !important;
 }
+  .token-input-list li {
+    clear:none !important;
+    padding: 1px 3px !important;
+    margin-bottom: 3px !important;
+  }
 
 table#preview {
-  margin:10px 0 0 0;
+  margin:10px 0;
 }
+  table#preview .spacer {
+    width:30px;
+  }
 
-input, select {
+input[type=text], select, .token-input-list {
   border-radius:3px;
 }
