Index: plugins/attachments/js/post.js
===================================================================
--- plugins/attachments/js/post.js	(revision 1699)
+++ plugins/attachments/js/post.js	(revision 1606)
@@ -1,5 +1,5 @@
 $(function() {
 	$('h5.s-attachments').toggleWithLegend($('.s-attachments').not('h5'),{
-		user_pref: 'dcx_attachments',
+		cookie: 'dcx_attachments',
 		legend_click: true
 	});
Index: plugins/pages/_prepend.php
===================================================================
--- plugins/pages/_prepend.php	(revision 1694)
+++ plugins/pages/_prepend.php	(revision 1179)
@@ -17,5 +17,5 @@
 $core->url->register('pagespreview','pagespreview','^pagespreview/(.+)$',array('urlPages','pagespreview'));
 
-$core->setPostType('page','plugin.php?p=pages&act=page&id=%d',$core->url->getURLFor('pages','%s'),'Pages');
+$core->setPostType('page','plugin.php?p=pages&act=page&id=%d',$core->url->getURLFor('pages','%s'));
 
 # We should put this as settings later
Index: plugins/pages/_public.php
===================================================================
--- plugins/pages/_public.php	(revision 1674)
+++ plugins/pages/_public.php	(revision 1179)
@@ -181,7 +181,4 @@
 				
 				# The entry
-				if ($_ctx->posts->trackbacksActive()) {
-					header('X-Pingback: '.$core->blog->url.$core->url->getURLFor("xmlrpc",$core->blog->id));
-				}
 				$core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates');
 				self::serveDocument('page.html');
Index: plugins/pages/default-templates/page.html
===================================================================
--- plugins/pages/default-templates/page.html	(revision 1674)
+++ plugins/pages/default-templates/page.html	(revision 725)
@@ -25,5 +25,4 @@
   <link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
   <link rel="contents" href="{{tpl:BlogArchiveURL}}" title="{{tpl:lang Archives}}" />
-  <tpl:EntryIf pings_active="1"><link rel="pingback" href="{{tpl:BlogXMLRPCURL}}" /></tpl:EntryIf>
   
   <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{{tpl:BlogFeedURL type="atom"}}" />
Index: plugins/pages/page.php
===================================================================
--- plugins/pages/page.php	(revision 1668)
+++ plugins/pages/page.php	(revision 1711)
@@ -403,5 +403,5 @@
 			'items' => array(
 				'post_status' => 
-					'<p><label for="post_status" class="ib">'.__('Page status').'</label> '.
+					'<p><label for="post_status" class="ib">'.__('Page status:').'</label> '.
 					form::combo('post_status',$status_combo,$post_status,'','',!$can_publish).
 					'</p>',
@@ -411,5 +411,5 @@
 					'</p>',
 				'post_lang' =>
-					'<p><label for="post_lang" class="ib">'.__('Page lang').'</label>'.
+					'<p><label for="post_lang" class="ib">'.__('Page lang:').'</label>'.
 					form::combo('post_lang',$lang_combo,$post_lang).
 					'</p>',
@@ -426,5 +426,5 @@
 			'items' => array(
 				'post_position' => 
-					'<p><label for="post_position" class="classic">'.__('Page position').'</label> '.
+					'<p><label for="post_position" class="classic">'.__('Page position:').'</label> '.
 					form::field('post_position',3,3,(string) $post_position).
 					'</p>')),
@@ -432,5 +432,7 @@
 			'title' => __('Options'),
 			'items' => array(
-				'post_open_comment' =>
+				'post_open_comment_tb' =>
+					'<div>'.
+					'<h5 id="label_comment_tb">'.__('Commentaires et rétroliens').'</h5>'.
 					'<p><label for="post_open_comment" class="classic">'.
 					form::checkbox('post_open_comment',1,$post_open_comment).' '.
@@ -442,6 +444,5 @@
 							__('Warning: Comments are not more accepted for this entry.').'</p>') : 
 						'<p class="form-note warn">'.
-						__('Comments are not accepted on this blog so far.').'</p>'),
-				'post_open_tb' =>
+						__('Comments are not accepted on this blog so far.').'</p>').
 					'<p><label for="post_open_tb" class="classic">'.
 					form::checkbox('post_open_tb',1,$post_open_tb).' '.
@@ -452,5 +453,6 @@
 							'<p class="form-note warn">'.
 							__('Warning: Trackbacks are not more accepted for this entry.').'</p>') : 
-						'<p class="form-note warn">'.__('Trackbacks are not accepted on this blog so far.').'</p>'),
+						'<p class="form-note warn">'.__('Trackbacks are not accepted on this blog so far.').'</p>').
+					'</div>',
 				'post_hide' =>	
 					'<p><label for="post_selected" class="classic">'.form::checkbox('post_selected',1,$post_selected).' '.
Index: plugins/pings/post.js
===================================================================
--- plugins/pings/post.js	(revision 1699)
+++ plugins/pings/post.js	(revision 1606)
@@ -13,5 +13,5 @@
 		}
 		$('h5.ping-services').toggleWithLegend($('p.ping-services'),{
-			user_pref: 'dcx_ping_services',
+			cookie: 'dcx_ping_services',
 			legend_click: true
 		});
Index: plugins/tags/js/post.js
===================================================================
--- plugins/tags/js/post.js	(revision 1699)
+++ plugins/tags/js/post.js	(revision 1606)
@@ -60,5 +60,5 @@
 
 	$('h5 .s-tags').toggleWithLegend($('.s-tags').not('label'),{
-		user_pref: 'post_tags',
+		cookie: 'post_tags',
 		legend_clik: true
 	});
Index: plugins/widgets/dragdrop.js
===================================================================
--- plugins/widgets/dragdrop.js	(revision 1659)
+++ plugins/widgets/dragdrop.js	(revision 0)
@@ -1,98 +1,211 @@
-/*
-# -- BEGIN LICENSE BLOCK ---------------------------------------
-#
-# This file is part of Dotclear 2.
-#
-# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
-# Licensed under the GPL version 2.0 license.
-# See LICENSE file or
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-#
-# -- END LICENSE BLOCK -----------------------------------------
-*/
+ToolMan._coordinatesFactory.inside = function(item,container) {
+	var iTL = this.topLeftOffset(item);
+	var iBR = this.bottomRightOffset(item);
+	var cTL = this.topLeftOffset(container);
+	var cBR = this.bottomRightOffset(container);
+	
+	return (iTL.x >= cTL.x && iTL.x <= cBR.x && iTL.y >= cTL.y && iTL.y <= cBR.y)
+	|| (iBR.x >= cTL.x && iBR.x <= cBR.x && iBR.y >= cTL.y && iBR.y <= cBR.y);
+}
 
-$(function() {
-	
-	// clean
-	$('.remove-if-drag').remove();
-	$('.hidden-if-drag').hide();
-	$('.widgets, .sortable-delete').addClass('if-drag');
-	
-	// move
-	$( ".connected, .sortable-delete" ).sortable({
-		tolerance: "move",
-		cursor: "move",
-		axis: "y",
-		dropOnEmpty: true,
-		handle: ".widget-name",
-		placeholder: "ui-sortable-placeholder",
-		items: "li:not(.sortable-delete-placeholder)",
-		connectWith: ".connected, .sortable-delete",
-		start: function( event, ui ) {
-			// petit décalage éstétique
-			ui.item.css('left', ui.item.position().left + 20);
-		},
-		update: function(event, ui) {
+ToolMan._dragdropFactory = {
+	firstContainer: null,
+	lastContainer: null,
+	
+	makeDragable: function(item) {
+		var group = ToolMan.drag().createSimpleGroup(item);
+		group.register('dragstart',this._onDragStart);
+		group.register('dragmove', this._onDragMove);
+		group.register('dragend', this._onDragEnd);
+		
+		item.isOutside = false;
+		item.started = false;
+		
+		return group;
+	},
+	
+	makeListContainer: function(list,name) {
+		// each container becomes a linked list node
+		if (this.firstContainer == null) {
+			this.firstContainer = this.lastContainer = list;
+			list.previousContainer = null;
+			list.nextContainer = null;
+		} else {
+			list.previousContainer = this.lastContainer;
+			list.nextContainer = null;
+			this.lastContainer.nextContainer = list;
+			this.lastContainer = list;
+		}
+		
+		var helpers = ToolMan.helpers();
+		var coordinates = ToolMan.coordinates();
+		
+		//var children = list.childNodes;
+		var items = new Array();
+		for (var i=0; i<list.childNodes.length; i++) {
+			if (list.childNodes[i].nodeType == 1 &&
+			list.childNodes[i].nodeName.toLowerCase() == name.toLowerCase()) {
+				items.push(list.childNodes[i]);
+			}
+		}
+		
+		// these functions are called when an item is draged over
+		// a container or out of a container bounds.  onDragOut
+		// is also called when the drag ends with an item having
+		// been added to the container
+		list.onDragOver = new Function();
+		list.onDragOut = new Function();
+		list.onDragEnd = new Function();
+		
+		if (list.factory == undefined) {
+			list.factory = false;
+		}
+		
+		var This = this;
+		helpers.map(items, function(item) {
+			var dragGroup = This.makeDragable(item);
+			dragGroup.setThreshold(4);
+		});
+		for (var i = 2, n = arguments.length; i < n; i++) {
+			helpers.map(items, arguments[i]);
+		}
+	},
+	
+	_onDragStart: function(dragEvent) {
+		var container = ToolMan._dragdropFactory.firstContainer;
+		var item = dragEvent.group.element;
+		var coordinates = ToolMan.coordinates();
+		
+		// Factory is a sort of assembly pieces, we want to keep them
+		if (item.parentNode.factory) {
+			var origin = item.cloneNode(true);
+			item.parentNode.insertBefore(origin,item.nextSibling);
+			ToolMan._dragdropFactory.makeDragable(origin);
+		}
+		
+		while (container != null) {
+			container.topLeft = coordinates.topLeftOffset(container);
+			container.bottomRight = coordinates.bottomRightOffset(container);
+			container = container.nextContainer;
+		}
+		
+		// item starts out over current parent
+		item.started = true;
+		item.parentNode.onDragOver();
+	},
+	
+	_onDragMove: function(dragEvent) {
+		var helpers = ToolMan.helpers();
+		var coordinates = ToolMan.coordinates();
+		
+		var item = dragEvent.group.element;
+		var xmouse = dragEvent.transformedMouseOffset;
+		var moveTo = null;
+		
+		// Check if we are nowhere
+		if (item.isOutside) {
+			var container = ToolMan._dragdropFactory.firstContainer;
+			while (container != null) {
+				if (coordinates.inside(item,container) && !container.factory) {
+					container.onDragOver();
+					item.isOutside = false;
+					
+					// since isOutside was true, the current parent is a
+					// temporary clone of some previous container node and
+					// it needs to be removed from the document
+					var tempParent = item.parentNode;
+					tempParent.removeChild(item);
+					container.appendChild(item);
+					//tempParent.parentNode.removeChild(tempParent);
+					
+					break;
+				}
+				container = container.nextContainer;
+			}
 			
-			ul = $(this);
-			widget = ui.item;
-			field = ul.parents('.widgets');
-			
-			// met a zéro le décalage
-			ui.item.css('left', 'auto');
-			
-			// signale les zone vide
-			if( ul.find('li').length == 0 )
-				 field.find('.empty-widgets').show();
-			else field.find('.empty-widgets').hide();
-			
-			// remove
-			if( widget.parents('ul').is('.sortable-delete') ) {
-				widget.hide('slow', function() {
-					$(this).remove();
-				});
-			}
-			
-			// réordonne
-			if( ul.attr('id') ) {
-				ul.find('li').each(function(i) {
-					
-					// trouve la zone de récéption
-					var name = ul.attr('id').split('dnd').join('');
-					
-					// modifie le name en conséquence
-					$(this).find('*[name^=w]').each(function(){
-						tab = $(this).attr('name').split('][');
-						tab[0] = "w["+name;
-						tab[1] = i;
-						$(this).attr('name', tab.join(']['));
-					});
-					
-					// ainssi que le champ d'ordre sans js (au cas ou)
-					$(this).find('input[title=ordre]').val(i);
-					
-				});
-			}
-			
-			// expand
-			if(widget.find('img.expand').length == 0) {
-				dotclear.postExpander(widget);
-				dotclear.viewPostContent(widget, 'close');
-			}
-			
-		}
-	});
-	
-	// add
-	$( "#widgets-ref > li" ).draggable({
-		tolerance: "move",
-		cursor: "move",
-		connectToSortable: ".connected",
-		helper: "clone",
-		revert: "invalid",
-		start: function( event, ui ) {
-			ui.helper.css({'width': $('#widgets-ref > li').css('width')});
-		}
-	});
-	
-});
+			if (this.isOutside) {
+				return;
+			}
+		}
+		// Outside the parent node
+		else if (!coordinates.inside(item,item.parentNode)) {
+			item.parentNode.onDragOut();
+			item.isOutside = true;
+			var container = ToolMan._dragdropFactory.firstContainer;
+			while (container != null) {
+				if (coordinates.inside(item,container) && !container.factory) {
+					container.onDragOver();
+					item.isOutside = false;
+					container.appendChild(item);
+					break;
+				}
+				container = container.nextContainer;
+			}
+			// if we're not in any container now, make a temporary clone of
+			// the previous container node and add it to the document
+			if (this.isOutside) {
+				var tempParent = item.parentNode.cloneNode(false);
+				item.parentNode.removeChild(item);
+				tempParent.appendChild(item);
+				document.body.appendChild(tempParent);
+				return;
+			}
+		}
+		
+		// if we get here, we're inside some container bounds, so we do
+		// everything the original dragsort script did to swap us into the
+		// correct position
+		
+		if (item.parentNode.factory) {
+			return;
+		}
+		
+		var moveTo = null
+		
+		var previous = helpers.previousItem(item, item.nodeName)
+		while (previous != null) {
+			var bottomRight = coordinates.bottomRightOffset(previous)
+			if (xmouse.y <= bottomRight.y && xmouse.x <= bottomRight.x) {
+				moveTo = previous
+			}
+			previous = helpers.previousItem(previous, item.nodeName)
+		}
+		if (moveTo != null) {
+			helpers.moveBefore(item, moveTo)
+			return
+		}
+		
+		var next = helpers.nextItem(item, item.nodeName)
+		while (next != null) {
+			var topLeft = coordinates.topLeftOffset(next)
+			if (topLeft.y <= xmouse.y && topLeft.x <= xmouse.x) {
+				moveTo = next
+			}
+			next = helpers.nextItem(next, item.nodeName)
+		}
+		if (moveTo != null) {
+			helpers.moveBefore(item, helpers.nextItem(moveTo, item.nodeName))
+			return
+		}
+	},
+	
+	_onDragEnd: function(dragEvent) {
+		var item = dragEvent.group.element;
+		
+		if (!item.started) {
+			return;
+		}
+		
+		if (item.isOutside || item.parentNode.factory) {
+			item.parentNode.removeChild(item);
+			return;
+		}
+		
+		item.parentNode.onDragEnd.call(item);
+		ToolMan.coordinates().create(0, 0).reposition(dragEvent.group.element);
+	}
+};
+
+ToolMan.dragdrop = function() {
+	return ToolMan._dragdropFactory;
+};
Index: plugins/widgets/index.php
===================================================================
--- plugins/widgets/index.php	(revision 1669)
+++ plugins/widgets/index.php	(revision 1518)
@@ -165,9 +165,9 @@
   <?php echo file_get_contents(dirname(__FILE__).'/style.css'); ?>
   </style>
-  <?php
-		echo
-			dcPage::jsLoad('js/jquery/jquery-ui.custom.js').
-			dcPage::jsLoad('index.php?pf=widgets/widgets.js');
-  ?>
+  <script type="text/javascript" src="js/tool-man/core.js"></script>
+  <script type="text/javascript" src="js/tool-man/events.js"></script>
+  <script type="text/javascript" src="js/tool-man/css.js"></script>
+  <script type="text/javascript" src="js/tool-man/coordinates.js"></script>
+  <script type="text/javascript" src="js/tool-man/drag.js"></script>
   <?php 
 	$core->auth->user_prefs->addWorkspace('accessibility'); 
@@ -177,4 +177,5 @@
   <script type="text/javascript" src="index.php?pf=widgets/dragdrop.js"></script>
   <?php endif; ?>
+  <script type="text/javascript" src="index.php?pf=widgets/widgets.js"></script>
   <script type="text/javascript">
   //<![CDATA[
@@ -198,23 +199,23 @@
 '<h3>'.__('Available widgets').'</h3>'.
 '<p>'.__('Move widgets from this list to one of the sidebars.').'</p>'.
-'<ul id="widgets-ref">';
+'<div id="widgets">';
 
 $j = 0;
 foreach ($__widgets->elements(true) as $w) {
 	echo
-	'<li>'.form::hidden(array('w[void][0][id]'),html::escapeHTML($w->id())).
-	'<p class="widget-name">'.form::field(array('w[void][0][order]'),2,3,0,'hide','',0,'title="'.__('order').'"').' '.$w->name().
-	($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').'</p>'.
-	'<p class="manual-move remove-if-drag"><label class="classic">'.__('Append to:').'</label> '.
+	'<div>'.form::hidden(array('w[void][0][id]'),html::escapeHTML($w->id())).
+	'<p class="widget-name">'.form::field(array('w[void][0][order]'),2,3,0,'hideControl').' '.
+	$w->name().($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').'</p>'.
+	'<p class="js-remove"><label class="classic">'.__('Append to:').'</label> '.
 	form::combo(array('addw['.$w->id().']'),$append_combo).'</p>'.
-	'<div class="widgetSettings hidden-if-drag">'.$w->formSettings('w[void][0]',$j).'</div>'.
-	'</li>';
+	'<div class="widgetSettings">'.$w->formSettings('w[void][0]',$j).'</div>'.
+	'</div>';
 	$j++;
 }
 
 echo
-'</ul>'.
-$core->formNonce().
-'<p class="remove-if-drag"><input type="submit" name="append" value="'.__('Add widgets to sidebars').'" /></p>'.
+'</div>'.
+'<p><input type="submit" class="js-remove" name="append" value="'.__('Add widgets to sidebars').'" />'.
+$core->formNonce().'</p>'.
 '</form>';
 
@@ -223,18 +224,18 @@
 echo
 '<div id="sidebarNav" class="widgets fieldset">'.
-sidebarWidgets('dndnav',__('Navigation sidebar'),$widgets_nav,'nav',$__default_widgets['nav'],$j);
-echo '</div>';
+sidebarWidgets('dndnav',__('Navigation sidebar'),$widgets_nav,'nav',$__default_widgets['nav'],$j).
+'</div>';
 
 # Extra sidebar
 echo
 '<div id="sidebarExtra" class="widgets fieldset">'.
-sidebarWidgets('dndextra',__('Extra sidebar'),$widgets_extra,'extra',$__default_widgets['extra'],$j);
-echo '</div>';
+sidebarWidgets('dndextra',__('Extra sidebar'),$widgets_extra,'extra',$__default_widgets['extra'],$j).
+'</div>';
 
 # Custom sidebar
 echo
 '<div id="sidebarCustom" class="widgets fieldset">'.
-sidebarWidgets('dndcustom',__('Custom sidebar'),$widgets_custom,'custom',$__default_widgets['custom'],$j);
-echo '</div>';
+sidebarWidgets('dndcustom',__('Custom sidebar'),$widgets_custom,'custom',$__default_widgets['custom'],$j).
+'</div>';
 
 echo
@@ -315,5 +316,5 @@
 function sidebarWidgets($id,$title,$widgets,$pr,$default_widgets,&$j)
 {
-	$res = '<h3>'.$title.'</h3>';
+	$res = '<h3>'.$title.'</h3><div id="'.$id.'">';
 	
 	if (!($widgets instanceof dcWidgets))
@@ -322,7 +323,7 @@
 	}
 	
-	$res .= '<p class="empty-widgets" '.(!$widgets->isEmpty() ? 'style="display: none;"' : '').'>'.__('No widget.').'</p>';
-	
-	$res .= '<ul id="'.$id.'" class="connected">';
+	if ($widgets->isEmpty()) {
+		$res .= '<p class="empty-widgets">'.__('No widget.').'</p>';
+	}
 	
 	$i = 0;
@@ -332,12 +333,12 @@
 		
 		$res .=
-		'<li>'.form::hidden(array($iname.'[id]'),html::escapeHTML($w->id())).
-		'<p class="widget-name">'.form::field(array($iname.'[order]'),2,3,(string) $i,'hidden-if-drag','',0,'title="'.__('order').'"').' '.$w->name().
-		($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').'</p>'.
-		'<p class="removeWidget remove-if-drag"><label class="classic">'.
+		'<div>'.form::hidden(array($iname.'[id]'),html::escapeHTML($w->id())).
+		'<p class="widget-name">'.form::field(array($iname.'[order]'),2,3,(string) $i,'js-hide','',0,'title="'.__('order').'"').' '.
+		$w->name().($w->desc() != '' ? ' <!-- <span class="form-note">'.__($w->desc()).'</span> -->' : '').'</p>'.
+		'<p class="removeWidget js-remove"><label class="classic">'.
 		form::checkbox(array($iname.'[_rem]'),'1',0).' '.__('Remove widget').
 		'</label></p>'.
-		'<div class="widgetSettings hidden-if-drag">'.$w->formSettings($iname,$j).'</div>'.
-		'</li>';
+		'<div class="widgetSettings">'.$w->formSettings($iname,$j).'</div>'.
+		'</div>';
 		
 		$i++;
@@ -345,10 +346,5 @@
 	}
 	
-	$res .= '</ul>';
-
-	if ($i > 0) {
-		$res .= '<ul class="sortable-delete"><li class="sortable-delete-placeholder">'.
-			__('Drag widgets here to remove them from this sidebar.').'</li></ul>';
-	}
+	$res .= '</div>';
 	
 	return $res;
Index: plugins/widgets/style.css
===================================================================
--- plugins/widgets/style.css	(revision 1669)
+++ plugins/widgets/style.css	(revision 1629)
@@ -1,17 +1,29 @@
-/*
-# -- BEGIN LICENSE BLOCK ---------------------------------------
-#
-# This file is part of Dotclear 2.
-#
-# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
-# Licensed under the GPL version 2.0 license.
-# See LICENSE file or
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-#
-# -- END LICENSE BLOCK -----------------------------------------
-*/
+#listWidgets {
+	float: left;
+	width: 46%;
+	background: #eee;
+	padding: 1.5em 1% 0; 
+	margin: 0 1% 0 0;
+}
+#widgets > div {
+	border: 1px solid #ccc;
+	margin-bottom: .5em;
+	background: #fff;
+	min-height: 3em;
+	padding: 0 0 4px 0;
+}
+#widgets .widget-name, #widgets .js-remove {
+	background: #fff;
+	margin-bottom: 0;
+	padding: 4px 8px; 
+}
+#widgets .widget-name {
+	min-height: 3em;
+	padding-bottom: 0;
+}
+#listWidgets h3 {
+	color: #333;
+}
 
-
-/* ------------------------------------------------------------- side bars */
 #sidebarsWidgets {
 	float: left;
@@ -20,58 +32,19 @@
 	padding: 0 1%;
 }
+#sidebarsControl {
+	clear: left;
+}
 .widgets.fieldset {
 	margin-bottom: 2em;
 }
-.widgets.fieldset.if-drag {
-	padding-bottom: 0;
-	border-radius: .5em;
+#widgets, #dndnav, #dndextra, #dndcustom {
+	padding: 1em 0;
 }
-#dndnav, #dndextra, #dndcustom {
-	padding: 1em 0;
-	margin: 1em 0 0;
-}
-#dndnav > li,
-#dndextra > li,
-#dndcustom > li {
-	padding: 0;
+#dndnav > div, #dndextra > div, #dndcustom > div {
+	padding: O;
 	border: 1px solid #999;
 	margin-bottom: 1em;
-	list-style: none;
 }
-#dndnav > li.ui-sortable-placeholder,
-#dndextra > li.ui-sortable-placeholder,
-#dndcustom > li.ui-sortable-placeholder,
-.sortable-delete > li.ui-sortable-placeholder {
-	border: 1px dashed #999;
-	height: 2em;
-	padding: .3em;
-}
-.sortable-delete > li.ui-sortable-placeholder {
-	border-width: 2px;
-	border-color: red;
-}
-.sortable-delete {
-	display: none;
-}
-.sortable-delete.if-drag {
-    border: 1px dotted #999;
-    color: #000;
-    font-weight: bold;
-    list-style-type: none;
-    margin: 0 0 1em;
-    padding: .5em 1em;
-    display: block;
-    background: #fafafa;
-}
-.sortable-delete > li {
-	margin-bottom: 3px;
-}
-.sortable-delete > li.sortable-delete-placeholder {
-    border: 0 none;
-    color: #aaa;
-    font-size: 1em;
-    font-weight: bold;
-    text-align: center;
-}
+
 .widget-name {
 	background: #eef;
@@ -81,19 +54,17 @@
 	font-weight: bold;
 }
+.widget-name span {
+	display: block;
+	font-style: normal;
+	font-size: 1.1rem;
+}
 .widget-name img {
 	cursor: pointer;
 	margin-bottom: -1px;
 }
-.widget-name a.aexpand,
-.widget-name a.aexpand:link,
-.widget-name a.aexpand:visited {
+.widget-name a.aexpand, .widget-name a.aexpand:link, .widget-name a.aexpand:visited {
     border: 0 none;
-    color: #000;
+    color: #000000;
     text-decoration: none;
-}
-#dndnav .form-note,
-#dndextra .form-note,
-#dndcustom .form-note {
-	display: none;
 }
 .removeWidget {
@@ -101,4 +72,5 @@
 	margin: 0;
 }
+
 .widgetSettings {
 	border-top: 1px solid #ddd;
@@ -106,52 +78,14 @@
 	background: #f5f5f5;
 }
-
-#sidebarsControl {
-	clear: left;
+#widgets .widgetSettings {
+	display: none;
 }
-
-/* ------------------------------------------------------------- list Widgets ref */
-#listWidgets {
-	float: left;
-	width: 46%;
-	background: #eee;
-	padding: 1.5em 1% 0; 
-	margin: 0 1% 0 0;
+.hideControls .widgetSettings {
+	display: none;
 }
-#listWidgets h3 {
-	color: #333;
-}
-
-#widgets-ref {
-	padding: 1em 0;
-	margin: 1em 0 0;
-}
-#widgets-ref > li {
-	border: 1px solid #ccc;
-	margin-bottom: .5em;
-	background: #fff;
-	min-height: 3em;
-	padding: 0 0 4px 0;
-	list-style: none;
-}
-#widgets-ref .widget-name,
-#widgets-ref .manual-move {
-	background: #fff;
-	margin-bottom: 0;
-	padding: 4px 8px 0;
-}
-#widgets-ref .widget-name {
-	min-height: 3em;
-}
-#widgets-ref .widget-name .form-note {
-	display: block;
-	font-style: normal;
-	font-size: 1.1rem;
-}
-#widgets-ref .widgetSettings {
+.hideControl {
 	display: none;
 }
 
-/* ------------------------------------------------------------- help */
 #widgets-tpl dt {
 	margin: 1em 0 0 0;
Index: plugins/widgets/widgets.js
===================================================================
--- plugins/widgets/widgets.js	(revision 1661)
+++ plugins/widgets/widgets.js	(revision 1629)
@@ -1,71 +1,234 @@
-/*
-# -- BEGIN LICENSE BLOCK ---------------------------------------
-#
-# This file is part of Dotclear 2.
-#
-# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
-# Licensed under the GPL version 2.0 license.
-# See LICENSE file or
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-#
-# -- END LICENSE BLOCK -----------------------------------------
-*/
-
-dotclear.postExpander = function(line) {
-	var title = $(line).find('.widget-name');
-	title.find('.form-note').remove();
-	order = title.find('input[name*=order]');
-	link = $('<a href="#" alt="expand" class="aexpand"/>').append(title.text());
-	title.empty().append(order).append(link);
-	
-	var img = document.createElement('img');
-	img.src = dotclear.img_plus_src;
-	img.alt = dotclear.img_plus_alt;
-	img.className = 'expand';
-	$(img).css('cursor','pointer');
-	img.onclick = function() { dotclear.viewPostContent($(this).parents('li')); };
-	link.click(function(e) {
-		e.preventDefault();
-		dotclear.viewPostContent($(this).parents('li'));
-	});
-	
-	title.prepend(img);
-};
-
-dotclear.viewPostContent = function(line,action) {
-	var action = action || 'toogle';
-	var img = line.find('.expand');
-	var isopen = img.attr('alt') == dotclear.img_plus_alt;
-	
-	if( action == 'close' || ( action == 'toogle' && !isopen ) ) {
-		line.find('.widgetSettings').hide();
-		img.attr('src', dotclear.img_plus_src);
-		img.attr('alt', dotclear.img_plus_alt);
-	} else if ( action == 'open' || ( action == 'toogle' && isopen ) ) {
-		line.find('.widgetSettings').show();
-		img.attr('src', dotclear.img_minus_src);
-		img.attr('alt', dotclear.img_minus_alt);
-	}
-	
-};
-
-$(function() {	
-	// reset
+var dragdrop = ToolMan.dragdrop();
+$(function() {
 	$('input[name="wreset"]').click(function() {
 		return window.confirm(dotclear.msg.confirm_widgets_reset);
 	});
-	
-	// plier/déplier
-	$('#dndnav > li, #dndextra > li, #dndcustom > li').each(function() {
-		dotclear.postExpander(this);
-		dotclear.viewPostContent($(this), 'close');
+});
+
+$(function() {
+	var widgets = document.getElementById('widgets');
+	var w_nav = document.getElementById('dndnav');
+	var w_ext = document.getElementById('dndextra');
+	var w_custom = document.getElementById('dndcustom');
+	
+	w_nav.className = 'hideControls';
+	w_ext.className = 'hideControls';
+	w_custom.className = 'hideControls';
+	
+	removeElements(document.getElementById('listWidgets'),'input');
+	removeElements(widgets,'p');
+	removeElements(w_nav,'p');
+	removeElements(w_ext,'p');
+	removeElements(w_custom,'p');
+	hideElements(w_nav,'input');
+	hideElements(w_ext,'input');
+	hideElements(w_custom,'input');
+	
+	configControls(w_nav);
+	configControls(w_ext);
+	configControls(w_custom);
+	
+	dragdrop.makeListContainer(widgets,'div',setHandle);
+	if (!document.all) { widgets.factory = true; }
+	dragdrop.makeListContainer(w_nav,'div',setHandle);
+	w_nav.onDragEnd = navDragEnd;
+	dragdrop.makeListContainer(w_ext,'div',setHandle);
+	w_ext.onDragEnd = extraDragEnd;
+	dragdrop.makeListContainer(w_custom,'div',setHandle);
+	w_custom.onDragEnd = customDragEnd;
+	
+	// Helper to remove some elements
+	function removeElements(p,name) {
+		name = name || 'div';
+		$(p).find(name+'.js-remove').each(function() {
+			this.parentNode.removeChild(this);
+		});
+	}
+	
+	// Helper to hide elements (but keep them)
+	function hideElements(p,name) {
+		name = name || 'div';
+		$(p).find(name+'.js-hide').each(function() {
+			$(this).toggle();
+		});
+	}	
+	
+	function removeEmptyMsg(p) {
+		$(p).find('p.empty-widgets').each(function() {
+			this.parentNode.removeChild(this);
+		});
+	}
+	
+	// Events on dragEnd
+	function navDragEnd() {
+		formControls(this.parentNode,'nav');
+		configControls(this.parentNode);
+		removeEmptyMsg(this.parentNode);
+	}
+	function extraDragEnd() {
+		formControls(this.parentNode,'extra');
+		configControls(this.parentNode);
+		removeEmptyMsg(this.parentNode);
+	}
+	function customDragEnd() {
+		formControls(this.parentNode,'custom');
+		configControls(this.parentNode);
+		removeEmptyMsg(this.parentNode);
+	}
+	
+	// dragEnd helper
+	function formControls(e,pr) {
+		var items = new Array();
+		for (var i=0; i<e.childNodes.length; i++) {
+			if (e.childNodes[i].nodeType == 1 && e.childNodes[i].nodeName.toLowerCase() == 'div') {
+				items.push(e.childNodes[i]);
+			}
+		}
+		
+		var fields, itype;
+		var r = new RegExp('^w\[[a-z]+]\[[0-9]+][[](.+?)]$','');
+		for (i=0; i<items.length; i++) {
+			// Change field names
+			fields = getFormControls(items[i]);
+			var j;
+			var f;
+			for (j=0; j<fields.length; j++) {
+				if (r.test(fields[j].name)) {
+					itype = fields[j].name.replace(r,'$1');
+					
+					$(fields[j]).attr('name','w['+pr+']['+i+']['+itype+']');
+					
+					if (itype == 'order') {
+						fields[j].value = i;
+					}
+				}
+			}
+		}
+	}
+	
+	function getFormControls(e) {
+		var input = e.getElementsByTagName('input');
+		var textarea = e.getElementsByTagName('textarea');
+		var select = e.getElementsByTagName('select');
+		var items = new Array();
+		var i;
+		for (i=0; i<input.length; i++) { items.push(input[i]); }
+		for (i=0; i<select.length; i++) { items.push(select[i]); }
+		for (i=0; i<textarea.length; i++) { items.push(textarea[i]); }
+		
+		return items;
+	}
+	
+	function configControls(e) {
+		var items = new Array();
+		for (var i=0; i<e.childNodes.length; i++) {
+			if (e.childNodes[i].nodeType == 1 && e.childNodes[i].nodeName.toLowerCase() == 'div') {
+				items.push(e.childNodes[i]);
+			}
+		}
+		
+		var title, img_ctrl, img, space;
+		for (i in items) {
+			// Append config control
+			title = $('p.widget-name',items[i]).get(0);
+			order = $(title).find('input[name*=order]');
+			link = $('<a href="#" alt="expand" class="aexpand"/>').append($(title).text());
+			$(title).empty().append(order).append(link);
+			img_ctrl = title.firstChild;
+			
+			// There already an image
+			if (img_ctrl.nodeName.toLowerCase() == 'img') {
+				continue;
+			}
+			
+			// Nothing to configure
+			if (title.nextSibling.childNodes.length == 0) {
+				continue;
+			}
+			
+			img = document.createElement('img');
+			img.src = dotclear.img_plus_src;
+			img.alt = dotclear.img_plus_alt;
+			img.control = title.nextSibling;
+			img.onclick = function() { widgetConfig.call(this); };
+			link.click(function(e) {
+				e.preventDefault();
+				widgetConfig.call($(this).prevAll('img').get(0));
+			});
+			space = document.createTextNode(' ');
+			title.insertBefore(img,img_ctrl);
+			title.insertBefore(space,img_ctrl);
+		}
+	}
+	
+	function widgetConfig() {
+		if (this.control.style.display == 'block') {
+			this.control.style.display = 'none';
+			this.src = dotclear.img_plus_src;
+			this.alt = dotclear.img_plus_alt;
+		} else {
+			this.control.style.display = 'block';
+			this.src = dotclear.img_minus_src;
+			this.alt = dotclear.img_minus_alt;
+		}
+	}
+	
+	function setHandle(item) {
+		//var handle = item.getElementsByTagName('h4').item(0);
+		var handle = $('p.widget-name',item).get(0);
+		$(handle).addClass('handler');
+		item.toolManDragGroup.setHandle(handle);
+	}
+});
+
+//
+// For Safari, we need to make a hard copy of the form and submit copy.
+// Yeah, a simple clone of the form is not enough
+// I hate this browser!
+//
+if (document.childNodes && !document.all && !navigator.taintEnabled)
+{
+	$(function() {
+		$('#sidebarsWidgets').submit(function() {
+			// Create a new form and copy each element inside
+			var f = document.createElement('form');
+			f.action = this.action;
+			f.method = this.method;
+			$(f).hide();
+			var fset = document.createElement('fieldset');
+			f.appendChild(fset);
+			
+			document.body.appendChild(f);
+			
+			$(this).find('input').each(function() {
+				var i = document.createElement('input');
+				i.type = this.type;
+				i.name = this.name;
+				i.value = this.value;
+				if (this.type == 'checkbox') {
+					i.checked = this.checked;
+				}
+				fset.appendChild(i);
+			});
+			
+			$(this).find('textarea').each(function() {
+				var i = document.createElement('textarea');
+				i.name = this.name;
+				i.value = this.value;
+				fset.appendChild(i);
+			});
+			
+			$(this).find('select').each(function() {
+				var i = document.createElement('input');
+				i.name = this.name;
+				i.value = this.value;
+				fset.appendChild(i);
+			});
+			
+			$(fset).append('<input type="hidden" name="wup" value="1"/>');
+			f.submit();
+			
+			return false;
+		});
 	});
-	
-	// remove
-	$('input[name*=rem]').change(function () {
-	    if ($(this).attr("checked")) {
-	        $(this).parents('li').remove();
-	    }
-	});
-	
-});
+}
