Index: admin/js/_blog_pref.js
===================================================================
--- admin/js/_blog_pref.js	(revision 3524)
+++ admin/js/_blog_pref.js	(revision 3706)
@@ -1,6 +1,8 @@
+/*global $, dotclear, jsToolBar */
+'use strict';
 function checkQueryString() {
 	var blogUrl = $('#blog_url')[0].value;
 	var urlScan = $('#url_scan')[0].value;
-	errorMsg = '';
+	var errorMsg = '';
 	if (/.*[^\/]$/.exec(blogUrl) && urlScan=='path_info') {
 		errorMsg = dotclear.msg.warning_path_info;
@@ -8,7 +10,7 @@
 		errorMsg = dotclear.msg.warning_query_string;
 	}
-	$("p#urlwarning").remove();
+	$('p#urlwarning').remove();
 	if (errorMsg != '') {
-		$("#blog_url").parents('p').after('<p id="urlwarning" class="warning">'+errorMsg+'</p>');
+		$('#blog_url').parents('p').after('<p id="urlwarning" class="warning">'+errorMsg+'</p>');
 	}
 }
Index: admin/js/_blog_theme.js
===================================================================
--- admin/js/_blog_theme.js	(revision 2566)
+++ admin/js/_blog_theme.js	(revision 3706)
@@ -1,78 +1,85 @@
+/*global $, dotclear */
+'use strict';
+
 $(function() {
-	// expend theme info
-	$('.module-sshot').not('.current-theme .module-sshot').each(function(){
-		var bar = $('<div>').addClass('bloc-toggler');
-		$(this).after(
-		$(bar).toggleWithLegend($(this).parent().children('.toggle-bloc'),{
-			img_on_src: dotclear.img_plus_theme_src,
-			img_on_alt: dotclear.img_plus_theme_alt,
-			img_off_src: dotclear.img_minus_theme_src,
-			img_off_alt: dotclear.img_minus_theme_alt,
-			legend_click: true
-		}));
-		$(this).children('img').click(function(){
-			$(this).parent().parent().children('.bloc-toggler').click();
-		});
-	});
+  // expend theme info
+  $('.module-sshot').not('.current-theme .module-sshot').each(function() {
+    var bar = $('<div>').addClass('bloc-toggler');
+    $(this).after(
+      $(bar).toggleWithLegend($(this).parent().children('.toggle-bloc'), {
+        img_on_src: dotclear.img_plus_theme_src,
+        img_on_alt: dotclear.img_plus_theme_alt,
+        img_off_src: dotclear.img_minus_theme_src,
+        img_off_alt: dotclear.img_minus_theme_alt,
+        legend_click: true
+      }));
+    $(this).children('img').click(function() {
+      $(this).parent().parent().children('.bloc-toggler').click();
+    });
+  });
 
-	// dirty short search blocker
-	$('div.modules-search form input[type=submit]').click(function(){
-		var mlen = $('input[name=m_search]',$(this).parent()).val();
-		if (mlen.length > 2){return true;}else{return false;}
-	});
+  // dirty short search blocker
+  $('div.modules-search form input[type=submit]').click(function() {
+    var mlen = $('input[name=m_search]', $(this).parent()).val();
+    if (mlen.length > 2) {
+      return true;
+    } else {
+      return false;
+    }
+  });
 
-	// checkboxes selection
-	$('.checkboxes-helpers').each(function() {
-		dotclear.checkboxesHelpers(this);
-	});
+  // checkboxes selection
+  $('.checkboxes-helpers').each(function() {
+    dotclear.checkboxesHelpers(this);
+  });
 
-	// actions tests
-	$('.modules-form-actions').each(function(){
-		var rxActionType = /^[^\[]+/;
-		var rxActionValue = /([^\[]+)\]$/;
-		var checkboxes = $(this).find('input[type=checkbox]');
+  // actions tests
+  $('.modules-form-actions').each(function() {
+    var rxActionType = /^[^\[]+/;
+    var rxActionValue = /([^\[]+)\]$/;
+    var checkboxes = $(this).find('input[type=checkbox]');
 
-		// check if submit is a global action or one line action
-		$("input[type=submit]",this).click(function() {
-			var keyword = $(this).attr('name');
-			var maction = keyword.match(rxActionType);
-			var action = maction[0];
-			var mvalues = keyword.match(rxActionValue);
+    // check if submit is a global action or one line action
+    $('input[type=submit]', this).click(function() {
+      var keyword = $(this).attr('name');
+      var maction = keyword.match(rxActionType);
+      var action = maction[0];
+      var mvalues = keyword.match(rxActionValue);
 
-			// action on multiple modules
-			if (!mvalues) {
-				var checked = false;
+      // action on multiple modules
+      if (!mvalues) {
+        var checked = false;
 
-				// check if there is checkboxes in form
-				if(checkboxes.length > 0) {
-					// check if there is at least one checkbox checked
-					$(checkboxes).each(function() {
-						if (this.checked) {
-							checked = true;
-						}
-					});
-					if (!checked) {
-						//alert(dotclear.msg.no_selection);
-						return false;
-					}
-				}
+        // check if there is checkboxes in form
+        if (checkboxes.length > 0) {
+          // check if there is at least one checkbox checked
+          $(checkboxes).each(function() {
+            if (this.checked) {
+              checked = true;
+            }
+          });
+          if (!checked) {
+            //alert(dotclear.msg.no_selection);
+            return false;
+          }
+        }
 
-				// confirm delete
-				if (action == 'delete') {
-					return window.confirm(dotclear.msg.confirm_delete_themes);
-				}
+        // confirm delete
+        if (action == 'delete') {
+          return window.confirm(dotclear.msg.confirm_delete_themes);
+        }
 
-			// action on one module
-			}else {
-				var module = mvalues[1];
+        // action on one module
+      } else {
+        var module = mvalues[1];
 
-				// confirm delete
-				if (action == 'delete') {
-					return window.confirm(dotclear.msg.confirm_delete_theme.replace('%s',module));
-				}
-			}
+        // confirm delete
+        if (action == 'delete') {
+          return window.confirm(dotclear.msg.confirm_delete_theme.replace('%s', module));
+        }
+      }
 
-			return true;
-		});
-	});
+      return true;
+    });
+  });
 });
Index: admin/js/_blogs.js
===================================================================
--- admin/js/_blogs.js	(revision 3403)
+++ admin/js/_blogs.js	(revision 3706)
@@ -1,13 +1,16 @@
+/*global $, dotclear */
+'use strict';
+
 $(function() {
-	$('.checkboxes-helpers').each(function() {
-		dotclear.checkboxesHelpers(this,undefined,'#form-blogs td input[type=checkbox]','#form-blogs #do-action');
-	});
-	$('#form-blogs td input[type=checkbox]').enableShiftClick();
-	dotclear.condSubmit('#form-blogs td input[type=checkbox]','#form-blogs #do-action');
-	$('#form-blogs').submit(function() {
-		var action = $(this).find('select[name="action"]').val();
-		if (action == 'delete') {
-			return window.confirm(dotclear.msg.confirm_delete_blog.replace('%s',$('input[name="blogs[]"]:checked').size()));
-		}
-	});
+  $('.checkboxes-helpers').each(function() {
+    dotclear.checkboxesHelpers(this, undefined, '#form-blogs td input[type=checkbox]', '#form-blogs #do-action');
+  });
+  $('#form-blogs td input[type=checkbox]').enableShiftClick();
+  dotclear.condSubmit('#form-blogs td input[type=checkbox]', '#form-blogs #do-action');
+  $('#form-blogs').submit(function() {
+    var action = $(this).find('select[name="action"]').val();
+    if (action == 'delete') {
+      return window.confirm(dotclear.msg.confirm_delete_blog.replace('%s', $('input[name="blogs[]"]:checked').size()));
+    }
+  });
 });
Index: admin/js/_blogs_actions.js
===================================================================
--- admin/js/_blogs_actions.js	(revision 3403)
+++ admin/js/_blogs_actions.js	(revision 3706)
@@ -1,3 +1,6 @@
+/*global $, dotclear */
+'use strict';
+
 $(function() {
-	dotclear.condSubmit('table.blogs-list td input[type=checkbox]','input[type=submit]');
+  dotclear.condSubmit('table.blogs-list td input[type=checkbox]', 'input[type=submit]');
 });
Index: admin/js/_categories.js
===================================================================
--- admin/js/_categories.js	(revision 2190)
+++ admin/js/_categories.js	(revision 3706)
@@ -1,23 +1,26 @@
+/*global $, dotclear */
+'use strict';
+
 $(function() {
-	if ($.fn['nestedSortable']!==undefined) {
-		$('#categories ul li').css('cursor','move');
-		$('#save-set-order').prop('disabled',true).addClass('disabled');
-		$('#categories ul').nestedSortable({
-			listType: 'ul',
-			items: 'li',
-			placeholder: 'placeholder',
-			update: function() {
-				$('#categories_order').attr('value',JSON.stringify($('#categories ul').nestedSortable('toArray')));
-				$('#save-set-order').prop('disabled',false).removeClass('disabled');
-			}
-		});
-	}
+  if ($.fn.nestedSortable !== undefined) {
+    $('#categories ul li').css('cursor', 'move');
+    $('#save-set-order').prop('disabled', true).addClass('disabled');
+    $('#categories ul').nestedSortable({
+      listType: 'ul',
+      items: 'li',
+      placeholder: 'placeholder',
+      update: function() {
+        $('#categories_order').attr('value', JSON.stringify($('#categories ul').nestedSortable('toArray')));
+        $('#save-set-order').prop('disabled', false).removeClass('disabled');
+      }
+    });
+  }
 
-	$('input[name^="delete"]').click(function() {
-		return window.confirm(dotclear.msg.confirm_delete_category.replace('%s',$(this).parents('li').first().find('.cat-title label a').text()));
-	});
+  $('input[name^="delete"]').click(function() {
+    return window.confirm(dotclear.msg.confirm_delete_category.replace('%s', $(this).parents('li').first().find('.cat-title label a').text()));
+  });
 
-	$('input[name="reset"]').click(function() {
-		return window.confirm(dotclear.msg.confirm_reorder_categories);
-	});
+  $('input[name="reset"]').click(function() {
+    return window.confirm(dotclear.msg.confirm_reorder_categories);
+  });
 });
Index: admin/js/_category.js
===================================================================
--- admin/js/_category.js	(revision 2891)
+++ admin/js/_category.js	(revision 3706)
@@ -1,8 +1,11 @@
+/*global $, dotclear, jsToolBar */
+'use strict';
+
 $(function() {
-	dotclear.hideLockable();
+  dotclear.hideLockable();
 
-	if ($.isFunction(jsToolBar)) {
-		var tbCategory = new jsToolBar(document.getElementById('cat_desc'));
-		tbCategory.draw('xhtml');
-	}
+  if ($.isFunction(jsToolBar)) {
+    var tbCategory = new jsToolBar(document.getElementById('cat_desc'));
+    tbCategory.draw('xhtml');
+  }
 });
Index: admin/js/_comment.js
===================================================================
--- admin/js/_comment.js	(revision 2860)
+++ admin/js/_comment.js	(revision 3706)
@@ -1,2 +1,5 @@
+/*global $, dotclear, jsToolBar */
+'use strict';
+
 $(function() {
 	if ($.isFunction(jsToolBar)) {
Index: admin/js/_comments.js
===================================================================
--- admin/js/_comments.js	(revision 3182)
+++ admin/js/_comments.js	(revision 3706)
@@ -1,70 +1,72 @@
-dotclear.viewCommentContent = function(line,action) {
-	var action = action || 'toggle';
-	var commentId = $(line).attr('id').substr(1);
-	var tr = document.getElementById('ce'+commentId);
+/*global $, dotclear */
+'use strict';
 
-	if ( !tr && ( action == 'toggle' || action == 'open' ) ) {
-		tr = document.createElement('tr');
-		tr.id = 'ce'+commentId;
-		var td = document.createElement('td');
-		td.colSpan = 6;
-		td.className = 'expand';
-		tr.appendChild(td);
+dotclear.viewCommentContent = function(line, action) {
+  action = action || 'toggle';
+  var commentId = $(line).attr('id').substr(1);
+  var tr = document.getElementById('ce' + commentId);
 
-		// Get comment content
-		$.get('services.php',{f:'getCommentById',id: commentId},function(data) {
-			var rsp = $(data).children('rsp')[0];
+  if (!tr && (action == 'toggle' || action == 'open')) {
+    tr = document.createElement('tr');
+    tr.id = 'ce' + commentId;
+    var td = document.createElement('td');
+    td.colSpan = 6;
+    td.className = 'expand';
+    tr.appendChild(td);
 
-			if (rsp.attributes[0].value == 'ok') {
-				var comment = $(rsp).find('comment_display_content').text();
+    // Get comment content
+    $.get('services.php', {
+      f: 'getCommentById',
+      id: commentId
+    }, function(data) {
+      var rsp = $(data).children('rsp')[0];
 
-				if (comment) {
-					$(td).append(comment);
-					var comment_email = $(rsp).find('comment_email').text();
-					var comment_site = $(rsp).find('comment_site').text();
-					var comment_ip = $(rsp).find('comment_ip').text();
-					var comment_spam_disp = $(rsp).find('comment_spam_disp').text();
+      if (rsp.attributes[0].value == 'ok') {
+        var comment = $(rsp).find('comment_display_content').text();
 
-					$(td).append('<p><strong>' + dotclear.msg.website +
-					'</strong> ' + comment_site + '<br />' +
-					'<strong>' + dotclear.msg.email + '</strong> ' + comment_email + '<br />' +
-					'<strong>' + dotclear.msg.ip_address +
-					'</strong> <a href="comments.php?ip=' + comment_ip + '">' + comment_ip + '</a>' +
-					'<br />' + comment_spam_disp + '</p>');
-				}
-			} else {
-				alert($(rsp).find('message').text());
-			}
-		});
+        if (comment) {
+          $(td).append(comment);
+          var comment_email = $(rsp).find('comment_email').text();
+          var comment_site = $(rsp).find('comment_site').text();
+          var comment_ip = $(rsp).find('comment_ip').text();
+          var comment_spam_disp = $(rsp).find('comment_spam_disp').text();
 
-		$(line).toggleClass('expand');
-		line.parentNode.insertBefore(tr,line.nextSibling);
-	}
-	else if (tr && tr.style.display == 'none' && ( action == 'toggle' || action == 'open' ) )
-	{
-		$(tr).css('display', 'table-row');
-		$(line).addClass('expand');
-	}
-	else if (tr && tr.style.display != 'none' && ( action == 'toggle' || action == 'close' ) )
-	{
-		$(tr).css('display', 'none');
-		$(line).removeClass('expand');
-	}
+          $(td).append('<p><strong>' + dotclear.msg.website +
+            '</strong> ' + comment_site + '<br />' +
+            '<strong>' + dotclear.msg.email + '</strong> ' + comment_email + '<br />' +
+            '<strong>' + dotclear.msg.ip_address +
+            '</strong> <a href="comments.php?ip=' + comment_ip + '">' + comment_ip + '</a>' +
+            '<br />' + comment_spam_disp + '</p>');
+        }
+      } else {
+        window.alert($(rsp).find('message').text());
+      }
+    });
+
+    $(line).toggleClass('expand');
+    line.parentNode.insertBefore(tr, line.nextSibling);
+  } else if (tr && tr.style.display == 'none' && (action == 'toggle' || action == 'open')) {
+    $(tr).css('display', 'table-row');
+    $(line).addClass('expand');
+  } else if (tr && tr.style.display != 'none' && (action == 'toggle' || action == 'close')) {
+    $(tr).css('display', 'none');
+    $(line).removeClass('expand');
+  }
 };
 
 $(function() {
-	$.expandContent({
-		line:$('#form-comments tr:not(.line)'),
-		lines:$('#form-comments tr.line'),
-		callback:dotclear.viewCommentContent
-	});
-	$('.checkboxes-helpers').each(function() {
-		dotclear.checkboxesHelpers(this,undefined,'#form-comments td input[type=checkbox]','#form-comments #do-action');
-	});
-	$('#form-comments td input[type=checkbox]').enableShiftClick();
-	dotclear.commentsActionsHelper();
-	dotclear.condSubmit('#form-comments td input[type=checkbox]','#form-comments #do-action');
-	$('form input[type=submit][name=delete_all_spam]').click(function(){
-		return window.confirm(dotclear.msg.confirm_spam_delete);
-	});
+  $.expandContent({
+    line: $('#form-comments tr:not(.line)'),
+    lines: $('#form-comments tr.line'),
+    callback: dotclear.viewCommentContent
+  });
+  $('.checkboxes-helpers').each(function() {
+    dotclear.checkboxesHelpers(this, undefined, '#form-comments td input[type=checkbox]', '#form-comments #do-action');
+  });
+  $('#form-comments td input[type=checkbox]').enableShiftClick();
+  dotclear.commentsActionsHelper();
+  dotclear.condSubmit('#form-comments td input[type=checkbox]', '#form-comments #do-action');
+  $('form input[type=submit][name=delete_all_spam]').click(function() {
+    return window.confirm(dotclear.msg.confirm_spam_delete);
+  });
 });
Index: admin/js/_comments_actions.js
===================================================================
--- admin/js/_comments_actions.js	(revision 3184)
+++ admin/js/_comments_actions.js	(revision 3706)
@@ -1,2 +1,5 @@
+/*global $, dotclear */
+'use strict';
+
 $(function() {
 	dotclear.condSubmit('table.posts-list td input[type=checkbox]','input[type=submit]');
Index: admin/js/_index.js
===================================================================
--- admin/js/_index.js	(revision 3614)
+++ admin/js/_index.js	(revision 3706)
@@ -1,124 +1,129 @@
+/*global $, dotclear, jsToolBar */
+'use strict';
+
 $(function() {
-	var f = $('#quick-entry');
-	if (f.length > 0) {
-		if ($.isFunction(jsToolBar)) {
-			var contentTb = new jsToolBar($('#post_content',f)[0]);
-			contentTb.switchMode($('#post_format',f).val());
-		}
+  function quickPost(f, status) {
+    if ($.isFunction('jsToolBar') && (contentTb.getMode() == 'wysiwyg')) {
+      contentTb.syncContents('iframe');
+    }
 
-		$('input[name=save]',f).click(function() {
-			quickPost(f,-2);
-			return false;
-		});
+    var params = {
+      f: 'quickPost',
+      xd_check: dotclear.nonce,
+      post_title: $('#post_title', f).val(),
+      post_content: $('#post_content', f).val(),
+      cat_id: $('#cat_id', f).val(),
+      post_status: status,
+      post_format: $('#post_format', f).val(),
+      post_lang: $('#post_lang', f).val(),
+      new_cat_title: $('#new_cat_title', f).val(),
+      new_cat_parent: $('#new_cat_parent', f).val()
+    };
 
-		if ($('input[name=save-publish]',f).length > 0) {
-			var btn = $('<input type="submit" value="' + $('input[name=save-publish]',f).val() + '" />');
-			$('input[name=save-publish]',f).remove();
-			$('input[name=save]',f).after(btn).after(' ');
-			btn.click(function() {
-				quickPost(f,1);
-				return false;
-			});
-		}
+    $('p.qinfo', f).remove();
 
-		function quickPost(f,status) {
-			if ($.isFunction('jsToolBar') && (contentTb.getMode() == 'wysiwyg')) {
-				contentTb.syncContents('iframe');
-			}
+    $.post('services.php', params, function(data) {
+      var msg;
+      if ($('rsp[status=failed]', data).length > 0) {
+        msg = '<p class="qinfo"><strong>' + dotclear.msg.error +
+          '</strong> ' + $('rsp', data).text() + '</p>';
+      } else {
+        msg = '<p class="qinfo">' + dotclear.msg.entry_created +
+          ' - <a href="post.php?id=' + $('rsp>post', data).attr('id') + '">' +
+          dotclear.msg.edit_entry + '</a>';
+        if ($('rsp>post', data).attr('post_status') == 1) {
+          msg += ' - <a href="' + $('rsp>post', data).attr('post_url') + '">' +
+            dotclear.msg.view_entry + '</a>';
+        }
+        msg += '</p>';
+        $('#post_title', f).val('');
+        $('#post_content', f).val('');
+        $('#post_content', f).change();
+        if ($.isFunction('jsToolBar') && (contentTb.getMode() == 'wysiwyg')) {
+          contentTb.syncContents('textarea');
+        }
+        $('#cat_id', f).val('0');
+        $('#new_cat_title', f).val('');
+        $('#new_cat_parent', f).val('0');
+      }
 
-			var params = {
-				f: 'quickPost',
-				xd_check: dotclear.nonce,
-				post_title: $('#post_title',f).val(),
-				post_content: $('#post_content',f).val(),
-				cat_id: $('#cat_id',f).val(),
-				post_status: status,
-				post_format: $('#post_format',f).val(),
-				post_lang: $('#post_lang',f).val(),
-				new_cat_title: $('#new_cat_title',f).val(),
-				new_cat_parent: $('#new_cat_parent',f).val()
-			}
+      $('fieldset', f).prepend(msg);
+    });
+  }
 
-			$('p.qinfo',f).remove();
+  var f = $('#quick-entry');
+  if (f.length > 0) {
+    if ($.isFunction(jsToolBar)) {
+      var contentTb = new jsToolBar($('#post_content', f)[0]);
+      contentTb.switchMode($('#post_format', f).val());
+    }
 
-			$.post('services.php',params,function(data) {
-				if ($('rsp[status=failed]',data).length > 0) {
-					var msg = '<p class="qinfo"><strong>' + dotclear.msg.error +
-					'</strong> ' + $('rsp',data).text() + '</p>';
-				} else {
-					var msg = '<p class="qinfo">' + dotclear.msg.entry_created +
-					' - <a href="post.php?id=' + $('rsp>post',data).attr('id') + '">' +
-					dotclear.msg.edit_entry + '</a>';
-					if ($('rsp>post',data).attr('post_status') == 1) {
-						msg += ' - <a href="' + $('rsp>post',data).attr('post_url') + '">' +
-						dotclear.msg.view_entry + '</a>';
-					}
-					msg += '</p>';
-					$('#post_title',f).val('');
-					$('#post_content',f).val('');
-					$('#post_content',f).change();
-					if ($.isFunction('jsToolBar') &&  (contentTb.getMode() == 'wysiwyg')) {
-						contentTb.syncContents('textarea');
-					}
-					$('#cat_id',f).val('0');
-					$('#new_cat_title',f).val('');
-					$('#new_cat_parent',f).val('0');
-				}
+    $('input[name=save]', f).click(function() {
+      quickPost(f, -2);
+      return false;
+    });
 
-				$('fieldset',f).prepend(msg);
-			});
-		}
-		$('#new_cat').toggleWithLegend($('#new_cat').parent().children().not('#new_cat'), {
-			// no cookie on new category as we don't use this every day
-			legend_click: true
-		});
-	}
+    if ($('input[name=save-publish]', f).length > 0) {
+      var btn = $('<input type="submit" value="' + $('input[name=save-publish]', f).val() + '" />');
+      $('input[name=save-publish]', f).remove();
+      $('input[name=save]', f).after(btn).after(' ');
+      btn.click(function() {
+        quickPost(f, 1);
+        return false;
+      });
+    }
 
-	// allow to hide quick entry div, and remember choice
-	$('#quick h3').toggleWithLegend($('#quick').children().not('h3'),{
-		legend_click: true,
-		user_pref: 'dcx_quick_entry'
-	});
+    $('#new_cat').toggleWithLegend($('#new_cat').parent().children().not('#new_cat'), {
+      // no cookie on new category as we don't use this every day
+      legend_click: true
+    });
+  }
 
-	// check if core update available
-	var params = {
-		f: 'checkCoreUpdate',
-		xd_check: dotclear.nonce
-	};
-	$.post('services.php',params,function(data) {
-		if ($('rsp[status=failed]',data).length > 0) {
-			// Silently fail as a forced checked my be done with admin update page
-		} else {
-			if ($('rsp>update',data).attr('check') == 1) {
-				// Something has to be displayed
-				xml = $('rsp>update',data).attr('ret');
-				$('#content h2').after(xml);
-			}
-		}
-	});
+  // allow to hide quick entry div, and remember choice
+  $('#quick h3').toggleWithLegend($('#quick').children().not('h3'), {
+    legend_click: true,
+    user_pref: 'dcx_quick_entry'
+  });
 
-	// check if some news are available
-	var params = {
-		f: 'checkNewsUpdate',
-		xd_check: dotclear.nonce
-	};
-	$.post('services.php',params,function(data) {
-		if ($('rsp[status=failed]',data).length > 0) {
-			// Silently fail
-		} else {
-			if ($('rsp>news',data).attr('check') == 1) {
-				// Something has to be displayed
-				xml = $('rsp>news',data).attr('ret');
-				if ($('#dashboard-boxes').length == 0) {
-					// Create the #dashboard-boxes container
-					$('#dashboard-main').append('<div id="dashboard-boxes"></div>');
-				}
-				if ($('#dashboard-boxes div.db-items').length == 0) {
-					// Create the #dashboard-boxes div.db-items container
-					$('#dashboard-boxes').prepend('<div class="db-items"></div>');
-				}
-				$('#dashboard-boxes div.db-items').prepend(xml);
-			}
-		}
-	});
+  // check if core update available
+  var params = {
+    f: 'checkCoreUpdate',
+    xd_check: dotclear.nonce
+  };
+  $.post('services.php', params, function(data) {
+    if ($('rsp[status=failed]', data).length > 0) {
+      // Silently fail as a forced checked my be done with admin update page
+    } else {
+      if ($('rsp>update', data).attr('check') == 1) {
+        // Something has to be displayed
+        var xml = $('rsp>update', data).attr('ret');
+        $('#content h2').after(xml);
+      }
+    }
+  });
+
+  // check if some news are available
+  params = {
+    f: 'checkNewsUpdate',
+    xd_check: dotclear.nonce
+  };
+  $.post('services.php', params, function(data) {
+    if ($('rsp[status=failed]', data).length > 0) {
+      // Silently fail
+    } else {
+      if ($('rsp>news', data).attr('check') == 1) {
+        // Something has to be displayed
+        var xml = $('rsp>news', data).attr('ret');
+        if ($('#dashboard-boxes').length == 0) {
+          // Create the #dashboard-boxes container
+          $('#dashboard-main').append('<div id="dashboard-boxes"></div>');
+        }
+        if ($('#dashboard-boxes div.db-items').length == 0) {
+          // Create the #dashboard-boxes div.db-items container
+          $('#dashboard-boxes').prepend('<div class="db-items"></div>');
+        }
+        $('#dashboard-boxes div.db-items').prepend(xml);
+      }
+    }
+  });
 });
Index: admin/js/_langs.js
===================================================================
--- admin/js/_langs.js	(revision 2566)
+++ admin/js/_langs.js	(revision 3706)
@@ -1,2 +1,5 @@
+/*global $, dotclear */
+'use strict';
+
 $(function() {
 	$('table.plugins form input[type=submit][name=delete]').click(function() {
Index: admin/js/_media.js
===================================================================
--- admin/js/_media.js	(revision 3445)
+++ admin/js/_media.js	(revision 3706)
@@ -1,200 +1,210 @@
+/*global $, jQuery, dotclear, template_upload, template_download */
+'use strict';
+
 (function($) {
-	$.fn.enhancedUploader = function() {
-		return this.each(function() {
-			var me = $(this);
-			var $container = $(me).parent();
-
-			function enableButton(button) {
-				button.prop('disabled',false).removeClass('disabled');
-			}
-
-			function disableButton(button) {
-				button.prop('disabled',true).addClass('disabled');
-			}
-
-			function displayMessageInQueue(n) {
-				var msg = '';
-				if (n==1) {
-					msg = dotclear.jsUpload.msg.file_in_queue;
-				} else if (n>1) {
-					msg = dotclear.jsUpload.msg.files_in_queue;
-					msg = msg.replace(/%d/,n);
-				} else {
-					msg = dotclear.jsUpload.msg.no_file_in_queue;
-				}
-				$('.queue-message',me).html(msg);
-			}
-
-			$('.button.choose_files').click(function(e) {
-				if ($container.hasClass('enhanced_uploader')) {
-					// Use the native click() of the file input.
-					$('#upfile').click();
-					e.preventDefault();
-				}
-			});
-
-			$('.button.cancel', '#fileupload .fileupload-buttonbar').click(function(e) {
-				$('.button.cancel','#fileupload .fileupload-buttonbar').hide();
-				disableButton($('.button.start','#fileupload .fileupload-buttonbar'));
-				displayMessageInQueue(0);
-			});
-
-			$(me).on('click','.cancel',function(e) {
-				if ($('.fileupload-ctrl .files .template-upload', me).length==0) {
-					$('.button.cancel','#fileupload .fileupload-buttonbar').hide();
-					disableButton($('.button.start','#fileupload .fileupload-buttonbar'));
-				}
-				displayMessageInQueue($('.files .template-upload',me).length);
-			});
-
-			$('.button.clean', me).click(function(e) {
-				$('.fileupload-ctrl .files .template-download', me).slideUp(500, function() {
-					$(this).remove();
-				});
-				$(this).hide();
-				e.preventDefault();
-			});
-
-			$(me).fileupload({
-				url: $(me).attr('action'),
-				autoUpload: false,
-				sequentialUploads: true,
-				uploadTemplateId: null,
-				downloadTemplateId: null,
-				uploadTemplate: template_upload,
-				downloadTemplate: template_download
-			}).bind('fileuploadadd', function(e, data) {
-				$('.button.cancel').css('display','inline-block');
-				$('#fileupload .fileupload-buttonbar').show();
-				enableButton($('.button.start','#fileupload .fileupload-buttonbar'));
-			}).bind('fileuploadadded', function(e, data) {
-				displayMessageInQueue($('.files .template-upload',me).length);
-			}).bind('fileuploaddone', function(e, data) {
-				if (data.result.files[0].html !==undefined) {
-					$('.media-list .files-group').append(data.result.files[0].html);
-					$('#form-medias .hide').removeClass('hide');
-				}
-				$('.button.clean').css('display','inline-block');
-				$(me).show();
-			}).bind('fileuploadalways', function(e, data) {
-				displayMessageInQueue($('.files .template-upload',me).length);
-				if ($('.fileupload-ctrl .files .template-upload',me).length==0) {
-					$('.button.cancel','#fileupload .fileupload-buttonbar').hide();
-					disableButton($('.button.start','#fileupload .fileupload-buttonbar'));
-				}
-			});
-
-			var $msg,label;
-
-			if ($container.hasClass('enhanced_uploader')) {
-				$msg = dotclear.msg.enhanced_uploader_disable;
-				label = dotclear.jsUpload.msg.choose_files;
-				$(me).fileupload({disabled:false});
-				displayMessageInQueue(0);
-				disableButton($('.button.start','#fileupload .fileupload-buttonbar'));
-			} else {
-				$msg = dotclear.msg.enhanced_uploader_activate;
-				label = dotclear.jsUpload.msg.choose_file;
-			}
-
-			$('<p class="clear"><button type="button" class="enhanced-toggle">' + $msg + '</button></p>').click(function(e) {
-				if ($container.hasClass('enhanced_uploader')) {
-					$msg = dotclear.msg.enhanced_uploader_activate;
-					label = dotclear.jsUpload.msg.choose_file;
-					$('#upfile').attr('multiple', false);
-					enableButton($('.button.start','#fileupload .fileupload-buttonbar'));
-
-					// when a user has clicked enhanced_uploader, and has added files
-					// We must remove files in table
-					$('.files .upload-file', me).remove();
-					$('.button.cancel,.button.clean','#fileupload .fileupload-buttonbar').hide();
-					$(me).fileupload({disabled:true});
-					$('.queue-message',me).html('').hide();
-				} else {
-					$msg = dotclear.msg.enhanced_uploader_disable;
-					label = dotclear.jsUpload.msg.choose_files;
-					$('#upfile').attr('multiple', true);
-					var startButton = $('.button.start');
-					var buttonBar = $('#fileupload .fileupload-buttonbar');
-					disableButton(startButton);
-					disableButton(buttonBar);
-					startButton.css('display','inline-block');
-					buttonBar.show();
-					$(me).fileupload({disabled:false});
-					$('.queue-message',me).show();
-					displayMessageInQueue(0);
-				}
-				$(this).find('button').text($msg);
-				$('.add-label', me).text(label);
-
-				$container.toggleClass('enhanced_uploader');
-				e.preventDefault();
-			}).appendTo(me);
-		});
-	};
+  $.fn.enhancedUploader = function() {
+    return this.each(function() {
+      var me = $(this);
+      var $container = $(me).parent();
+
+      function enableButton(button) {
+        button.prop('disabled', false).removeClass('disabled');
+      }
+
+      function disableButton(button) {
+        button.prop('disabled', true).addClass('disabled');
+      }
+
+      function displayMessageInQueue(n) {
+        var msg = '';
+        if (n == 1) {
+          msg = dotclear.jsUpload.msg.file_in_queue;
+        } else if (n > 1) {
+          msg = dotclear.jsUpload.msg.files_in_queue;
+          msg = msg.replace(/%d/, n);
+        } else {
+          msg = dotclear.jsUpload.msg.no_file_in_queue;
+        }
+        $('.queue-message', me).html(msg);
+      }
+
+      $('.button.choose_files').click(function(e) {
+        if ($container.hasClass('enhanced_uploader')) {
+          // Use the native click() of the file input.
+          $('#upfile').click();
+          e.preventDefault();
+        }
+      });
+
+      $('.button.cancel', '#fileupload .fileupload-buttonbar').click(function() {
+        $('.button.cancel', '#fileupload .fileupload-buttonbar').hide();
+        disableButton($('.button.start', '#fileupload .fileupload-buttonbar'));
+        displayMessageInQueue(0);
+      });
+
+      $(me).on('click', '.cancel', function() {
+        if ($('.fileupload-ctrl .files .template-upload', me).length == 0) {
+          $('.button.cancel', '#fileupload .fileupload-buttonbar').hide();
+          disableButton($('.button.start', '#fileupload .fileupload-buttonbar'));
+        }
+        displayMessageInQueue($('.files .template-upload', me).length);
+      });
+
+      $('.button.clean', me).click(function(e) {
+        $('.fileupload-ctrl .files .template-download', me).slideUp(500, function() {
+          $(this).remove();
+        });
+        $(this).hide();
+        e.preventDefault();
+      });
+
+      $(me).fileupload({
+        url: $(me).attr('action'),
+        autoUpload: false,
+        sequentialUploads: true,
+        uploadTemplateId: null,
+        downloadTemplateId: null,
+        uploadTemplate: template_upload,
+        downloadTemplate: template_download
+      }).bind('fileuploadadd', function() {
+        $('.button.cancel').css('display', 'inline-block');
+        $('#fileupload .fileupload-buttonbar').show();
+        enableButton($('.button.start', '#fileupload .fileupload-buttonbar'));
+      }).bind('fileuploadadded', function() {
+        displayMessageInQueue($('.files .template-upload', me).length);
+      }).bind('fileuploaddone', function(e, data) {
+        if (data.result.files[0].html !== undefined) {
+          $('.media-list .files-group').append(data.result.files[0].html);
+          $('#form-medias .hide').removeClass('hide');
+        }
+        $('.button.clean').css('display', 'inline-block');
+        $(me).show();
+      }).bind('fileuploadalways', function() {
+        displayMessageInQueue($('.files .template-upload', me).length);
+        if ($('.fileupload-ctrl .files .template-upload', me).length == 0) {
+          $('.button.cancel', '#fileupload .fileupload-buttonbar').hide();
+          disableButton($('.button.start', '#fileupload .fileupload-buttonbar'));
+        }
+      });
+
+      var $msg, label;
+
+      if ($container.hasClass('enhanced_uploader')) {
+        $msg = dotclear.msg.enhanced_uploader_disable;
+        label = dotclear.jsUpload.msg.choose_files;
+        $(me).fileupload({
+          disabled: false
+        });
+        displayMessageInQueue(0);
+        disableButton($('.button.start', '#fileupload .fileupload-buttonbar'));
+      } else {
+        $msg = dotclear.msg.enhanced_uploader_activate;
+        label = dotclear.jsUpload.msg.choose_file;
+      }
+
+      $('<p class="clear"><button type="button" class="enhanced-toggle">' + $msg + '</button></p>').click(function(e) {
+        if ($container.hasClass('enhanced_uploader')) {
+          $msg = dotclear.msg.enhanced_uploader_activate;
+          label = dotclear.jsUpload.msg.choose_file;
+          $('#upfile').attr('multiple', false);
+          enableButton($('.button.start', '#fileupload .fileupload-buttonbar'));
+
+          // when a user has clicked enhanced_uploader, and has added files
+          // We must remove files in table
+          $('.files .upload-file', me).remove();
+          $('.button.cancel,.button.clean', '#fileupload .fileupload-buttonbar').hide();
+          $(me).fileupload({
+            disabled: true
+          });
+          $('.queue-message', me).html('').hide();
+        } else {
+          $msg = dotclear.msg.enhanced_uploader_disable;
+          label = dotclear.jsUpload.msg.choose_files;
+          $('#upfile').attr('multiple', true);
+          var startButton = $('.button.start');
+          var buttonBar = $('#fileupload .fileupload-buttonbar');
+          disableButton(startButton);
+          disableButton(buttonBar);
+          startButton.css('display', 'inline-block');
+          buttonBar.show();
+          $(me).fileupload({
+            disabled: false
+          });
+          $('.queue-message', me).show();
+          displayMessageInQueue(0);
+        }
+        $(this).find('button').text($msg);
+        $('.add-label', me).text(label);
+
+        $container.toggleClass('enhanced_uploader');
+        e.preventDefault();
+      }).appendTo(me);
+    });
+  };
 })(jQuery);
 
-
 $(function() {
-	$('#fileupload').enhancedUploader();
-
-	$('.checkboxes-helpers').each(function() {
-		dotclear.checkboxesHelpers(this,undefined,'#form-medias input[type="checkbox"]','#form-medias #delete_medias');
-	});
-	dotclear.condSubmit('#form-medias input[type="checkbox"]','#form-medias #delete_medias');
-
-	$('#form-medias #delete_medias').click(function(e) {
-		var count_checked = $('input[name="medias[]"]:checked', $('#form-medias')).length;
-		if (count_checked == 0) {
-			e.preventDefault();
-			return false;
-		}
-		return window.confirm(dotclear.msg.confirm_delete_medias.replace('%d',count_checked));
-	});
-
-	// Preview media
-	$('.modal-image').magnificPopup({ type:'image' });
-
-	// attach media
-	$('#form-medias').on('click', '.media-item .attach-media', function(e) {
-		var parts = $(this).prop('href').split('?');
-		var str_params = parts[1].split('&');
-		var postData = {};
-
-		for (var n=0;n<str_params.length;n++) {
-			kv = str_params[n].split('=');
-			postData[kv[0]] = kv[1];
-		}
-		postData.xd_check = dotclear.nonce;
-
-		$.post(parts[0], postData, function(data) {
-			if (data.url !== undefined) {
-				document.location = data.url;
-			}
-		});
-
-		e.preventDefault();
-	});
-
-	// Replace remove links by a POST on hidden form
-	fileRemoveAct();
-
-	function fileRemoveAct() {
-		$('body').on('click','a.media-remove',function() {
-			var m_name = $(this).parents('.media-item').find('a.media-link').text();
-			var m_text='';
-			if ($(this).parents('div.media-folder').length == 0) {
-				m_text = dotclear.msg.confirm_delete_media.replace('%s',m_name);
-			} else {
-				m_text = dotclear.msg.confirm_delete_directory.replace('%s',m_name);
-			}
-			if (window.confirm(m_text)) {
-				var f = $('#media-remove-hide').get(0);
-				f.elements['remove'].value = this.href.replace(/^(.*)&remove=(.*?)(&|$)/,'$2');
-				this.href = '';
-				f.submit();
-			}
-			return false;
-		});
-	}
+  $('#fileupload').enhancedUploader();
+
+  $('.checkboxes-helpers').each(function() {
+    dotclear.checkboxesHelpers(this, undefined, '#form-medias input[type="checkbox"]', '#form-medias #delete_medias');
+  });
+  dotclear.condSubmit('#form-medias input[type="checkbox"]', '#form-medias #delete_medias');
+
+  $('#form-medias #delete_medias').click(function(e) {
+    var count_checked = $('input[name="medias[]"]:checked', $('#form-medias')).length;
+    if (count_checked == 0) {
+      e.preventDefault();
+      return false;
+    }
+    return window.confirm(dotclear.msg.confirm_delete_medias.replace('%d', count_checked));
+  });
+
+  // Preview media
+  $('.modal-image').magnificPopup({
+    type: 'image'
+  });
+
+  // attach media
+  $('#form-medias').on('click', '.media-item .attach-media', function(e) {
+    var parts = $(this).prop('href').split('?');
+    var str_params = parts[1].split('&');
+    var postData = {};
+
+    for (var n = 0; n < str_params.length; n++) {
+      var kv = str_params[n].split('=');
+      postData[kv[0]] = kv[1];
+    }
+    postData.xd_check = dotclear.nonce;
+
+    $.post(parts[0], postData, function(data) {
+      if (data.url !== undefined) {
+        document.location = data.url;
+      }
+    });
+
+    e.preventDefault();
+  });
+
+  // Replace remove links by a POST on hidden form
+  fileRemoveAct();
+
+  function fileRemoveAct() {
+    $('body').on('click', 'a.media-remove', function() {
+      var m_name = $(this).parents('.media-item').find('a.media-link').text();
+      var m_text = '';
+      if ($(this).parents('div.media-folder').length == 0) {
+        m_text = dotclear.msg.confirm_delete_media.replace('%s', m_name);
+      } else {
+        m_text = dotclear.msg.confirm_delete_directory.replace('%s', m_name);
+      }
+      if (window.confirm(m_text)) {
+        var f = $('#media-remove-hide').get(0);
+        f.elements.remove.value = this.href.replace(/^(.*)&remove=(.*?)(&|$)/, '$2');
+        this.href = '';
+        f.submit();
+      }
+      return false;
+    });
+  }
 });
Index: admin/js/_media_item.js
===================================================================
--- admin/js/_media_item.js	(revision 3702)
+++ admin/js/_media_item.js	(revision 3706)
@@ -1,2 +1,5 @@
+/*global $, dotclear, datePicker */
+'use strict';
+
 $(function() {
   // Add datePicker if possible
@@ -57,5 +60,5 @@
           });
         } else {
-          alert($(rsp).find('message').text());
+          window.alert($(rsp).find('message').text());
         }
       });
Index: admin/js/_plugins.js
===================================================================
--- admin/js/_plugins.js	(revision 2566)
+++ admin/js/_plugins.js	(revision 3706)
@@ -1,67 +1,70 @@
+/*global $, dotclear */
+'use strict';
+
 $(function() {
-	// expand a module line
-	$('table.modules.expandable tr.line').each(function(){
-		$('td.module-name',this).toggleWithLegend($(this).next('.module-more'),{
-			img_on_src: dotclear.img_plus_src,
-			img_on_alt: dotclear.img_plus_alt,
-			img_off_src: dotclear.img_minus_src,
-			img_off_alt: dotclear.img_minus_alt,
-			legend_click: true
-		});
-	});
+  // expand a module line
+  $('table.modules.expandable tr.line').each(function() {
+    $('td.module-name', this).toggleWithLegend($(this).next('.module-more'), {
+      img_on_src: dotclear.img_plus_src,
+      img_on_alt: dotclear.img_plus_alt,
+      img_off_src: dotclear.img_minus_src,
+      img_off_alt: dotclear.img_minus_alt,
+      legend_click: true
+    });
+  });
 
-	// checkboxes selection
-	$('.checkboxes-helpers').each(function() {
-		dotclear.checkboxesHelpers(this);
-	});
+  // checkboxes selection
+  $('.checkboxes-helpers').each(function() {
+    dotclear.checkboxesHelpers(this);
+  });
 
-	// actions tests
-	$('.modules-form-actions').each(function(){
-		var rxActionType = /^[^\[]+/;
-		var rxActionValue = /([^\[]+)\]$/;
-		var checkboxes = $(this).find('input[type=checkbox]');
+  // actions tests
+  $('.modules-form-actions').each(function() {
+    var rxActionType = /^[^\[]+/;
+    var rxActionValue = /([^\[]+)\]$/;
+    var checkboxes = $(this).find('input[type=checkbox]');
 
-		// check if submit is a global action or one line action
-		$("input[type=submit]",this).click(function() {
-			var keyword = $(this).attr('name');
-			var maction = keyword.match(rxActionType);
-			var action = maction[0];
-			var mvalues = keyword.match(rxActionValue);
+    // check if submit is a global action or one line action
+    $('input[type=submit]', this).click(function() {
+      var keyword = $(this).attr('name');
+      var maction = keyword.match(rxActionType);
+      var action = maction[0];
+      var mvalues = keyword.match(rxActionValue);
 
-			// action on multiple modules
-			if (!mvalues) {
-				var checked = false;
+      // action on multiple modules
+      if (!mvalues) {
+        var checked = false;
 
-				// check if there is checkboxes in form
-				if(checkboxes.length > 0) {
-					// check if there is at least one checkbox checked
-					$(checkboxes).each(function() {
-						if (this.checked) {
-							checked = true;
-						}
-					});
-					if (!checked) {
-						//alert(dotclear.msg.no_selection);
-						return false;
-					}
-				}
+        // check if there is checkboxes in form
+        if (checkboxes.length > 0) {
+          // check if there is at least one checkbox checked
+          $(checkboxes).each(function() {
+            if (this.checked) {
+              checked = true;
+            }
+          });
+          if (!checked) {
+            //alert(dotclear.msg.no_selection);
+            return false;
+          }
+        }
 
-				// confirm delete
-				if (action == 'delete') {
-					return window.confirm(dotclear.msg.confirm_delete_plugins);
-				}
+        // confirm delete
+        if (action == 'delete') {
+          return window.confirm(dotclear.msg.confirm_delete_plugins);
+        }
 
-			// action on one module
-			}else {
-				var module = mvalues[1];
+        // action on one module
+      } else {
+        var module = mvalues[1];
 
-				// confirm delete
-				if (action == 'delete') {
-					return window.confirm(dotclear.msg.confirm_delete_plugin.replace('%s',module));
-				}
-			}
+        // confirm delete
+        if (action == 'delete') {
+          return window.confirm(dotclear.msg.confirm_delete_plugin.replace('%s', module));
+        }
+      }
 
-			return true;
-		});
-	});
+      return true;
+    });
+  });
 });
Index: admin/js/_popup_link.js
===================================================================
--- admin/js/_popup_link.js	(revision 3701)
+++ admin/js/_popup_link.js	(revision 3706)
@@ -1,2 +1,5 @@
+/*global $, dotclear */
+'use strict';
+
 $(function() {
   // Set focus on #href input
Index: admin/js/_popup_posts.js
===================================================================
--- admin/js/_popup_posts.js	(revision 3701)
+++ admin/js/_popup_posts.js	(revision 3706)
@@ -1,2 +1,5 @@
+/*global $ */
+'use strict';
+
 $(function() {
   // Set focus on #type input
Index: admin/js/_post.js
===================================================================
--- admin/js/_post.js	(revision 3483)
+++ admin/js/_post.js	(revision 3706)
@@ -1,189 +1,191 @@
-dotclear.viewCommentContent = function(line,action) {
-	var commentId = $(line).attr('id').substr(1);
-	var tr = document.getElementById('ce'+commentId);
+/*global $, dotclear, datePicker, commentTb */
+'use strict';
 
-	if (!tr) {
-		tr = document.createElement('tr');
-		tr.id = 'ce'+commentId;
-		var td = document.createElement('td');
-		td.colSpan = 6;
-		td.className = 'expand';
-		tr.appendChild(td);
+dotclear.viewCommentContent = function(line) {
+  var commentId = $(line).attr('id').substr(1);
+  var tr = document.getElementById('ce' + commentId);
 
-		// Get comment content
-		$.get('services.php',{f:'getCommentById',id: commentId},function(data) {
-			var rsp = $(data).children('rsp')[0];
+  if (!tr) {
+    tr = document.createElement('tr');
+    tr.id = 'ce' + commentId;
+    var td = document.createElement('td');
+    td.colSpan = 6;
+    td.className = 'expand';
+    tr.appendChild(td);
 
-			if (rsp.attributes[0].value == 'ok') {
-				var comment = $(rsp).find('comment_display_content').text();
+    // Get comment content
+    $.get('services.php', {
+      f: 'getCommentById',
+      id: commentId
+    }, function(data) {
+      var rsp = $(data).children('rsp')[0];
 
-				if (comment) {
-					$(td).append(comment);
-					var comment_email = $(rsp).find('comment_email').text();
-					var comment_site = $(rsp).find('comment_site').text();
-					var comment_ip = $(rsp).find('comment_ip').text();
-					var comment_spam_disp = $(rsp).find('comment_spam_disp').text();
+      if (rsp.attributes[0].value == 'ok') {
+        var comment = $(rsp).find('comment_display_content').text();
 
-					$(td).append('<p><strong>' + dotclear.msg.website +
-					'</strong> ' + comment_site + '<br />' +
-					'<strong>' + dotclear.msg.email + '</strong> ' +
-					comment_email + '<br />' + comment_spam_disp + '</p>');
-				}
-			} else {
-				alert($(rsp).find('message').text());
-			}
-		});
+        if (comment) {
+          $(td).append(comment);
+          var comment_email = $(rsp).find('comment_email').text();
+          var comment_site = $(rsp).find('comment_site').text();
+          //          var comment_ip = $(rsp).find('comment_ip').text();
+          var comment_spam_disp = $(rsp).find('comment_spam_disp').text();
 
-		$(line).toggleClass('expand');
-		line.parentNode.insertBefore(tr,line.nextSibling);
-	}
-	else if (tr.style.display == 'none')
-	{
-		$(tr).toggle();
-		$(line).toggleClass('expand');
-	}
-	else
-	{
-		$(tr).toggle();
-		$(line).toggleClass('expand');
-	}
+          $(td).append('<p><strong>' + dotclear.msg.website +
+            '</strong> ' + comment_site + '<br />' +
+            '<strong>' + dotclear.msg.email + '</strong> ' +
+            comment_email + '<br />' + comment_spam_disp + '</p>');
+        }
+      } else {
+        window.alert($(rsp).find('message').text());
+      }
+    });
+
+    $(line).toggleClass('expand');
+    line.parentNode.insertBefore(tr, line.nextSibling);
+  } else if (tr.style.display == 'none') {
+    $(tr).toggle();
+    $(line).toggleClass('expand');
+  } else {
+    $(tr).toggle();
+    $(line).toggleClass('expand');
+  }
 };
 
 $(function() {
-	// Post preview
-	$preview_url = $('#post-preview').attr('href');
-	if ($preview_url) {
+  // Post preview
+  var $preview_url = $('#post-preview').attr('href');
+  if ($preview_url) {
 
-		// Make $preview_url absolute
-		$a = document.createElement('a');
-		$a.href = $('#post-preview').attr('href');
-		$preview_url = $a.href;
+    // Make $preview_url absolute
+    var $a = document.createElement('a');
+    $a.href = $('#post-preview').attr('href');
+    $preview_url = $a.href;
 
-		// Check if admin and blog have same protocol (ie not mixed-content)
-		if (window.location.protocol == $preview_url.substring(0,window.location.protocol.length)) {
-			// Open preview in a modal iframe
-			$('#post-preview').magnificPopup({
-				type:'iframe',
-				iframe: {
-					patterns: {
-						dotclear_preview: {
-							index: $preview_url,
-							src: $preview_url
-						}
-					}
-				}
-			});
-		} else {
-			// Open preview on antother window
-			$('#post-preview').click(function(e) {
-				e.preventDefault();
-				window.open($(this).attr('href'));
-			});
-		}
-	}
+    // Check if admin and blog have same protocol (ie not mixed-content)
+    if (window.location.protocol == $preview_url.substring(0, window.location.protocol.length)) {
+      // Open preview in a modal iframe
+      $('#post-preview').magnificPopup({
+        type: 'iframe',
+        iframe: {
+          patterns: {
+            dotclear_preview: {
+              index: $preview_url,
+              src: $preview_url
+            }
+          }
+        }
+      });
+    } else {
+      // Open preview on antother window
+      $('#post-preview').click(function(e) {
+        e.preventDefault();
+        window.open($(this).attr('href'));
+      });
+    }
+  }
 
-	// Tabs events
-	$('#edit-entry').onetabload(function() {
-		dotclear.hideLockable();
+  // Tabs events
+  $('#edit-entry').onetabload(function() {
+    dotclear.hideLockable();
 
-		// Add date picker
-		var post_dtPick = new datePicker($('#post_dt').get(0));
-		post_dtPick.img_top = '1.5em';
-		post_dtPick.draw();
+    // Add date picker
+    var post_dtPick = new datePicker($('#post_dt').get(0));
+    post_dtPick.img_top = '1.5em';
+    post_dtPick.draw();
 
-		// Confirm post deletion
-		$('input[name="delete"]').click(function() {
-			return window.confirm(dotclear.msg.confirm_delete_post);
-		});
+    // Confirm post deletion
+    $('input[name="delete"]').click(function() {
+      return window.confirm(dotclear.msg.confirm_delete_post);
+    });
 
-		// Hide some fields
-		$('#notes-area label').toggleWithLegend($('#notes-area').children().not('label'),{
-			user_pref: 'dcx_post_notes',
-			legend_click:true,
-			hide: $('#post_notes').val() == ''
-		});
-		$('#post_lang').parent().children('label').toggleWithLegend($('#post_lang'),{
-			user_pref: 'dcx_post_lang',
-			legend_click: true
-		});
-		$('#post_password').parent().children('label').toggleWithLegend($('#post_password'),{
-			user_pref: 'dcx_post_password',
-			legend_click: true,
-			hide: $('#post_password').val() == ''
-		});
-		$('#post_status').parent().children('label').toggleWithLegend($('#post_status'),{
-			user_pref: 'dcx_post_status',
-			legend_click: true
-		});
-		$('#post_dt').parent().children('label').toggleWithLegend($('#post_dt').parent().children().not('label'),{
-			user_pref: 'dcx_post_dt',
-			legend_click: true
-		});
-		$('#label_format').toggleWithLegend($('#label_format').parent().children().not('#label_format'),{
-			user_pref: 'dcx_post_format',
-			legend_click: true
-		});
-		$('#label_cat_id').toggleWithLegend($('#label_cat_id').parent().children().not('#label_cat_id'),{
-			user_pref: 'dcx_cat_id',
-			legend_click: true
-		});
-		$('#create_cat').toggleWithLegend($('#create_cat').parent().children().not('#create_cat'),{
-			// no cookie on new category as we don't use this every day
-			legend_click: true
-		});
-		$('#label_comment_tb').toggleWithLegend($('#label_comment_tb').parent().children().not('#label_comment_tb'),{
-			user_pref: 'dcx_comment_tb',
-			legend_click: true
-		});
-		$('#post_url').parent().children('label').toggleWithLegend($('#post_url').parent().children().not('label'),{
-			user_pref: 'post_url',
-			legend_click: true
-		});
-		// We load toolbar on excerpt only when it's ready
-		$('#excerpt-area label').toggleWithLegend($('#excerpt-area').children().not('label'),{
-			user_pref: 'dcx_post_excerpt',
-			legend_click: true,
-			hide: $('#post_excerpt').val() == ''
-		});
+    // Hide some fields
+    $('#notes-area label').toggleWithLegend($('#notes-area').children().not('label'), {
+      user_pref: 'dcx_post_notes',
+      legend_click: true,
+      hide: $('#post_notes').val() == ''
+    });
+    $('#post_lang').parent().children('label').toggleWithLegend($('#post_lang'), {
+      user_pref: 'dcx_post_lang',
+      legend_click: true
+    });
+    $('#post_password').parent().children('label').toggleWithLegend($('#post_password'), {
+      user_pref: 'dcx_post_password',
+      legend_click: true,
+      hide: $('#post_password').val() == ''
+    });
+    $('#post_status').parent().children('label').toggleWithLegend($('#post_status'), {
+      user_pref: 'dcx_post_status',
+      legend_click: true
+    });
+    $('#post_dt').parent().children('label').toggleWithLegend($('#post_dt').parent().children().not('label'), {
+      user_pref: 'dcx_post_dt',
+      legend_click: true
+    });
+    $('#label_format').toggleWithLegend($('#label_format').parent().children().not('#label_format'), {
+      user_pref: 'dcx_post_format',
+      legend_click: true
+    });
+    $('#label_cat_id').toggleWithLegend($('#label_cat_id').parent().children().not('#label_cat_id'), {
+      user_pref: 'dcx_cat_id',
+      legend_click: true
+    });
+    $('#create_cat').toggleWithLegend($('#create_cat').parent().children().not('#create_cat'), {
+      // no cookie on new category as we don't use this every day
+      legend_click: true
+    });
+    $('#label_comment_tb').toggleWithLegend($('#label_comment_tb').parent().children().not('#label_comment_tb'), {
+      user_pref: 'dcx_comment_tb',
+      legend_click: true
+    });
+    $('#post_url').parent().children('label').toggleWithLegend($('#post_url').parent().children().not('label'), {
+      user_pref: 'post_url',
+      legend_click: true
+    });
+    // We load toolbar on excerpt only when it's ready
+    $('#excerpt-area label').toggleWithLegend($('#excerpt-area').children().not('label'), {
+      user_pref: 'dcx_post_excerpt',
+      legend_click: true,
+      hide: $('#post_excerpt').val() == ''
+    });
 
-		// Replace attachment remove links by a POST form submit
-		$('a.attachment-remove').click(function() {
-			this.href = '';
-			var m_name = $(this).parents('ul').find('li:first>a').attr('title');
-			if (window.confirm(dotclear.msg.confirm_remove_attachment.replace('%s',m_name))) {
-				var f = $('#attachment-remove-hide').get(0);
-				f.elements['media_id'].value = this.id.substring(11);
-				f.submit();
-			}
-			return false;
-		});
-	});
+    // Replace attachment remove links by a POST form submit
+    $('a.attachment-remove').click(function() {
+      this.href = '';
+      var m_name = $(this).parents('ul').find('li:first>a').attr('title');
+      if (window.confirm(dotclear.msg.confirm_remove_attachment.replace('%s', m_name))) {
+        var f = $('#attachment-remove-hide').get(0);
+        f.elements.media_id.value = this.id.substring(11);
+        f.submit();
+      }
+      return false;
+    });
+  });
 
-	$('#comments').onetabload(function() {
-		$.expandContent({
-			lines:$('#form-comments .comments-list tr.line'),
-			callback:dotclear.viewCommentContent
-		});
-		$('#form-comments .checkboxes-helpers').each(function() {
-			dotclear.checkboxesHelpers(this);
-		});
+  $('#comments').onetabload(function() {
+    $.expandContent({
+      lines: $('#form-comments .comments-list tr.line'),
+      callback: dotclear.viewCommentContent
+    });
+    $('#form-comments .checkboxes-helpers').each(function() {
+      dotclear.checkboxesHelpers(this);
+    });
 
-		dotclear.commentsActionsHelper();
-	});
+    dotclear.commentsActionsHelper();
+  });
 
-	$('#trackbacks').onetabload(function() {
-		$.expandContent({
-			lines:$('#form-trackbacks .comments-list tr.line'),
-			callback:dotclear.viewCommentContent
-		});
-		$('#form-trackbacks .checkboxes-helpers').each(function() {
-			dotclear.checkboxesHelpers(this);
-		});
+  $('#trackbacks').onetabload(function() {
+    $.expandContent({
+      lines: $('#form-trackbacks .comments-list tr.line'),
+      callback: dotclear.viewCommentContent
+    });
+    $('#form-trackbacks .checkboxes-helpers').each(function() {
+      dotclear.checkboxesHelpers(this);
+    });
 
-		dotclear.commentsActionsHelper();
-	});
+    dotclear.commentsActionsHelper();
+  });
 
-	$('#add-comment').onetabload(function() {
-		commentTb.draw('xhtml');
-	});
+  $('#add-comment').onetabload(function() {
+    commentTb.draw('xhtml');
+  });
 });
Index: admin/js/_posts_actions.js
===================================================================
--- admin/js/_posts_actions.js	(revision 3182)
+++ admin/js/_posts_actions.js	(revision 3706)
@@ -1,16 +1,18 @@
+/*global $, dotclear, usersList */
+'use strict';
+
 $(function() {
-	new_auth_id = $('#new_auth_id');
-	if (new_auth_id.length) {
-		new_auth_id.autocomplete(usersList,
-		{
-			delay: 1000,
-			matchSubset: true,
-			matchContains: true
-		});
-	}
-	$('#new_cat').toggleWithLegend($('#new_cat').parent().children().not('#new_cat'), {
-		// no cookie on new category as we don't use this every day
-		legend_click: true
-	});
-	dotclear.condSubmit('table.posts-list td input[type=checkbox]','input[type=submit]');
+  var new_auth_id = $('#new_auth_id');
+  if (new_auth_id.length) {
+    new_auth_id.autocomplete(usersList, {
+      delay: 1000,
+      matchSubset: true,
+      matchContains: true
+    });
+  }
+  $('#new_cat').toggleWithLegend($('#new_cat').parent().children().not('#new_cat'), {
+    // no cookie on new category as we don't use this every day
+    legend_click: true
+  });
+  dotclear.condSubmit('table.posts-list td input[type=checkbox]', 'input[type=submit]');
 });
Index: admin/js/_posts_list.js
===================================================================
--- admin/js/_posts_list.js	(revision 3182)
+++ admin/js/_posts_list.js	(revision 3706)
@@ -1,67 +1,70 @@
-dotclear.viewPostContent = function(line,action) {
-	var action = action || 'toggle';
-	var postId = $(line).attr('id').substr(1);
-	var tr = document.getElementById('pe'+postId);
+/*global $, dotclear */
+'use strict';
 
-	if ( !tr && ( action == 'toggle' || action == 'open' ) ) {
-		tr = document.createElement('tr');
-		tr.id = 'pe'+postId;
-		var td = document.createElement('td');
-		td.colSpan = 8;
-		td.className = 'expand';
-		tr.appendChild(td);
+dotclear.viewPostContent = function(line, action) {
+  action = action || 'toggle';
+  var postId = $(line).attr('id').substr(1);
+  var tr = document.getElementById('pe' + postId);
 
-		// Get post content
-		$.get('services.php',{f:'getPostById', id: postId, post_type: ''},function(data) {
-			var rsp = $(data).children('rsp')[0];
+  if (!tr && (action == 'toggle' || action == 'open')) {
+    tr = document.createElement('tr');
+    tr.id = 'pe' + postId;
+    var td = document.createElement('td');
+    td.colSpan = 8;
+    td.className = 'expand';
+    tr.appendChild(td);
 
-			if (rsp.attributes[0].value == 'ok') {
-				var post = $(rsp).find('post_display_content').text();
-				var post_excerpt = $(rsp).find('post_display_excerpt').text();
-				var res = '';
+    // Get post content
+    $.get('services.php', {
+      f: 'getPostById',
+      id: postId,
+      post_type: ''
+    }, function(data) {
+      var rsp = $(data).children('rsp')[0];
 
-				if (post) {
-					if (post_excerpt) {
-						res += post_excerpt + '<hr />';
-					}
-					res += post;
-					$(td).append(res);
-				}
-			} else {
-				alert($(rsp).find('message').text());
-			}
-		});
+      if (rsp.attributes[0].value == 'ok') {
+        var post = $(rsp).find('post_display_content').text();
+        var post_excerpt = $(rsp).find('post_display_excerpt').text();
+        var res = '';
 
-		$(line).addClass('expand');
-		line.parentNode.insertBefore(tr,line.nextSibling);
-	}
-	else if (tr && tr.style.display == 'none' && ( action == 'toggle' || action == 'open' ) )
-	{
-		$(tr).css('display', 'table-row');
-		$(line).addClass('expand');
-	}
-	else if (tr && tr.style.display != 'none' && ( action == 'toggle' || action == 'close' ) )
-	{
-		$(tr).css('display', 'none');
-		$(line).removeClass('expand');
-	}
+        if (post) {
+          if (post_excerpt) {
+            res += post_excerpt + '<hr />';
+          }
+          res += post;
+          $(td).append(res);
+        }
+      } else {
+        window.alert($(rsp).find('message').text());
+      }
+    });
+
+    $(line).addClass('expand');
+    line.parentNode.insertBefore(tr, line.nextSibling);
+  } else if (tr && tr.style.display == 'none' && (action == 'toggle' || action == 'open')) {
+    $(tr).css('display', 'table-row');
+    $(line).addClass('expand');
+  } else if (tr && tr.style.display != 'none' && (action == 'toggle' || action == 'close')) {
+    $(tr).css('display', 'none');
+    $(line).removeClass('expand');
+  }
 };
 
 $(function() {
-	// Entry type switcher
-	$('#type').change(function() {
-		this.form.submit();
-	});
+  // Entry type switcher
+  $('#type').change(function() {
+    this.form.submit();
+  });
 
-	$.expandContent({
-		line:$('#form-entries tr:not(.line)'),
-		lines:$('#form-entries tr.line'),
-		callback:dotclear.viewPostContent
-	});
-	$('.checkboxes-helpers').each(function() {
-		dotclear.checkboxesHelpers(this,undefined,'#form-entries td input[type=checkbox]','#form-entries #do-action');
-	});
-	$('#form-entries td input[type=checkbox]').enableShiftClick();
-	dotclear.condSubmit('#form-entries td input[type=checkbox]','#form-entries #do-action');
-	dotclear.postsActionsHelper();
+  $.expandContent({
+    line: $('#form-entries tr:not(.line)'),
+    lines: $('#form-entries tr.line'),
+    callback: dotclear.viewPostContent
+  });
+  $('.checkboxes-helpers').each(function() {
+    dotclear.checkboxesHelpers(this, undefined, '#form-entries td input[type=checkbox]', '#form-entries #do-action');
+  });
+  $('#form-entries td input[type=checkbox]').enableShiftClick();
+  dotclear.condSubmit('#form-entries td input[type=checkbox]', '#form-entries #do-action');
+  dotclear.postsActionsHelper();
 });
Index: admin/js/_preferences-dragdrop.js
===================================================================
--- admin/js/_preferences-dragdrop.js	(revision 2566)
+++ admin/js/_preferences-dragdrop.js	(revision 3706)
@@ -1,14 +1,23 @@
+/*global $ */
+'use strict';
+
 $(function() {
-	$("#my-favs ul").sortable({'cursor':'move'});
-	$("#my-favs ul, #my-favs ul *").css({'cursor':'move'});
-	$("#my-favs ul input").css({'cursor':'auto'});
-	$('#favs-form').submit(function() {
-		var order=[];
-		$("#my-favs ul li input.position").each(function() {
-			order.push(this.name.replace(/^order\[([^\]]+)\]$/,'$1'));
-		});
-		$("input[name=favs_order]")[0].value = order.join(',');
-		return true;
-	});
-	$("#my-favs ul li input.position").hide();
+  $('#my-favs ul').sortable({
+    'cursor': 'move'
+  });
+  $('#my-favs ul, #my-favs ul *').css({
+    'cursor': 'move'
+  });
+  $('#my-favs ul input').css({
+    'cursor': 'auto'
+  });
+  $('#favs-form').submit(function() {
+    var order = [];
+    $('#my-favs ul li input.position').each(function() {
+      order.push(this.name.replace(/^order\[([^\]]+)\]$/, '$1'));
+    });
+    $('input[name=favs_order]')[0].value = order.join(',');
+    return true;
+  });
+  $('#my-favs ul li input.position').hide();
 });
Index: admin/js/_preferences.js
===================================================================
--- admin/js/_preferences.js	(revision 3685)
+++ admin/js/_preferences.js	(revision 3706)
@@ -1,2 +1,5 @@
+/*global $ */
+'use strict';
+
 $(function() {
   if ($('#new_pwd').length == 0) {
@@ -5,5 +8,5 @@
   var user_email = $('#user_email').val();
   $('#user-form').submit(function() {
-    var e = this.elements['cur_pwd'];
+    var e = this.elements.cur_pwd;
     if (e.value != '') {
       return true;
@@ -11,5 +14,5 @@
     if ($('#user_email').val() != user_email || $('#new_pwd').val() != '') {
       $(e).addClass('missing').focusout(function() {
-        $(this).removeClass('missing')
+        $(this).removeClass('missing');
       });
       e.focus();
Index: admin/js/_trackbacks.js
===================================================================
--- admin/js/_trackbacks.js	(revision 2566)
+++ admin/js/_trackbacks.js	(revision 3706)
@@ -1,7 +1,10 @@
+/*global $ */
+'use strict';
+
 $(function() {
-	$('#tb_excerpt').keypress(function() {
-		if (this.value.length > 255) {
-			this.value = this.value.substring(0,255);
-		}
-	});
+  $('#tb_excerpt').keypress(function() {
+    if (this.value.length > 255) {
+      this.value = this.value.substring(0, 255);
+    }
+  });
 });
Index: admin/js/_update.js
===================================================================
--- admin/js/_update.js	(revision 2503)
+++ admin/js/_update.js	(revision 3706)
@@ -1,8 +1,11 @@
+/*global $, dotclear */
+'use strict';
+
 $(function() {
-	$('form input[type=submit][name=b_del]').click(function(){
- 		return window.confirm(dotclear.msg.confirm_delete_backup);
- 	});
-	$('form input[type=submit][name=b_revert]').click(function(){
- 		return window.confirm(dotclear.msg.confirm_revert_backup);
- 	});
+  $('form input[type=submit][name=b_del]').click(function() {
+    return window.confirm(dotclear.msg.confirm_delete_backup);
+  });
+  $('form input[type=submit][name=b_revert]').click(function() {
+    return window.confirm(dotclear.msg.confirm_revert_backup);
+  });
 });
Index: admin/js/_users.js
===================================================================
--- admin/js/_users.js	(revision 3182)
+++ admin/js/_users.js	(revision 3706)
@@ -1,49 +1,52 @@
+/*global $, dotclear */
+'use strict';
+
 $(function() {
-	$('.checkboxes-helpers').each(function() {
-		dotclear.checkboxesHelpers(this,undefined,'#form-users input[type="checkbox"]','#form-users #do-action');
-	});
-	dotclear.condSubmit('#form-users input[type="checkbox"]','#form-users #do-action');
-	$('#form-users').submit(function() {
-		var action = $(this).find('select[name="action"]').val();
-		var user_ids = new Array();
-		var nb_posts = new Array();
-		var i;
-		var msg_cannot_delete = false;
+  $('.checkboxes-helpers').each(function() {
+    dotclear.checkboxesHelpers(this, undefined, '#form-users input[type="checkbox"]', '#form-users #do-action');
+  });
+  dotclear.condSubmit('#form-users input[type="checkbox"]', '#form-users #do-action');
+  $('#form-users').submit(function() {
+    var action = $(this).find('select[name="action"]').val();
+    var user_ids = [];
+    var nb_posts = [];
+    var i;
+    var msg_cannot_delete = false;
 
-		$(this).find('input[name="users[]"]').each(function() {
-			user_ids.push(this);
-		});
-		$(this).find('input[name="nb_post[]"]').each(function() {
-			nb_posts.push(this.value);
-		});
+    $(this).find('input[name="users[]"]').each(function() {
+      user_ids.push(this);
+    });
+    $(this).find('input[name="nb_post[]"]').each(function() {
+      nb_posts.push(this.value);
+    });
 
-		if (action == 'deleteuser') {
-			for (i=0; i<user_ids.length; i++) {
-				if (nb_posts[i] > 0) {
-					if (user_ids[i].checked == true) {
-						msg_cannot_delete = true;
-						user_ids[i].checked = false;
-					}
-				}
-			}
-			if (msg_cannot_delete == true) {
-				alert(dotclear.msg.cannot_delete_users);
-			}
-		}
+    if (action == 'deleteuser') {
+      for (i = 0; i < user_ids.length; i++) {
+        if (nb_posts[i] > 0) {
+          if (user_ids[i].checked == true) {
+            msg_cannot_delete = true;
+            user_ids[i].checked = false;
+          }
+        }
+      }
+      if (msg_cannot_delete == true) {
+        window.alert(dotclear.msg.cannot_delete_users);
+      }
+    }
 
-		var selectfields = 0;
-		for (i=0; i<user_ids.length; i++) {
-			selectfields += user_ids[i].checked;
-		}
+    var selectfields = 0;
+    for (i = 0; i < user_ids.length; i++) {
+      selectfields += user_ids[i].checked;
+    }
 
-		if (selectfields == 0) {
-			return false;
-		}
+    if (selectfields == 0) {
+      return false;
+    }
 
-		if (action == 'deleteuser') {
-			return window.confirm(dotclear.msg.confirm_delete_user.replace('%s',$('input[name="users[]"]:checked').size()));
-		}
+    if (action == 'deleteuser') {
+      return window.confirm(dotclear.msg.confirm_delete_user.replace('%s', $('input[name="users[]"]:checked').size()));
+    }
 
-		return true;
-	});
+    return true;
+  });
 });
Index: admin/js/_users_actions.js
===================================================================
--- admin/js/_users_actions.js	(revision 3182)
+++ admin/js/_users_actions.js	(revision 3706)
@@ -1,99 +1,109 @@
+/*global $, jQuery, dotclear */
+'use strict';
+
 jQuery.fn.updatePermissionsForm = function() {
-	return this.each(function() {
+  return this.each(function() {
 
-		var perms = {};
-		var re = /^perm\[(.+?)\]\[(.+?)\]$/;
-		var e,prop;
+    var perms = {};
+    var re = /^perm\[(.+?)\]\[(.+?)\]$/;
+    var e, prop;
 
-		// Building a nice object of form elements
-		for (var i=0; i<this.elements.length; i++) {
-			e = this.elements[i];
+    var admin = function(E, perms, re) {
+      var P = E.name.match(re);
 
-			if (e.name == undefined) {
-				continue;
-			}
-			var prop;
-			prop = e.name.match(re);
-			if (!prop) {
-				continue;
-			}
-			if (perms[prop[1]] == undefined) {
-				perms[prop[1]] = {};
-			}
-			perms[prop[1]][prop[2]] = e;
+      perms[P[1]].usage.checked = E.checked;
+      perms[P[1]].publish.checked = E.checked;
+      perms[P[1]].delete.checked = E.checked;
+      perms[P[1]].contentadmin.checked = E.checked;
+      perms[P[1]].categories.checked = E.checked;
+      perms[P[1]].media.checked = E.checked;
+      perms[P[1]].media_admin.checked = E.checked;
 
-			// select related permissions for admin
-			if (prop[2] == 'admin') {
-				if (e.checked) {
-					admin(e,perms,re);
-				}
-				$(e).click(function(){
-					admin(this,perms,re);
-				});
-			// select related permissions for content admin
-			} else if (prop[2] == 'contentadmin') {
-				if (e.checked) {
-					contentadmin(e,perms,re);
-				}
-				$(e).click(function(){
-					contentadmin(this,perms,re);
-				});
-			// select related permissions for media admin
-			} else if (prop[2] == 'media_admin') {
-				if (e.checked) {
-					mediaadmin(e,perms,re);
-				}
-				$(e).click(function(){
-					mediaadmin(this,perms,re);
-				});
-			}
-		}
+      perms[P[1]].usage.disabled = E.checked;
+      perms[P[1]].publish.disabled = E.checked;
+      perms[P[1]].delete.disabled = E.checked;
+      perms[P[1]].contentadmin.disabled = E.checked;
+      perms[P[1]].categories.disabled = E.checked;
+      perms[P[1]].media.disabled = E.checked;
+      perms[P[1]].media_admin.disabled = E.checked;
+    };
 
-		function admin(E,perms,re) {
-					P = E.name.match(re);
+    var contentadmin = function(E, perms, re) {
+      var P = E.name.match(re);
 
-					perms[P[1]]['usage'].checked = E.checked;
-					perms[P[1]]['publish'].checked = E.checked;
-					perms[P[1]]['delete'].checked = E.checked;
-					perms[P[1]]['contentadmin'].checked = E.checked;
-					perms[P[1]]['categories'].checked = E.checked;
-					perms[P[1]]['media'].checked = E.checked;
-					perms[P[1]]['media_admin'].checked = E.checked;
-					perms[P[1]]['usage'].disabled = E.checked;
-					perms[P[1]]['publish'].disabled = E.checked;
-					perms[P[1]]['delete'].disabled = E.checked;
-					perms[P[1]]['contentadmin'].disabled = E.checked;
-					perms[P[1]]['categories'].disabled = E.checked;
-					perms[P[1]]['media'].disabled = E.checked;
-					perms[P[1]]['media_admin'].disabled = E.checked;
-		}
+      perms[P[1]].usage.checked = E.checked;
+      perms[P[1]].publish.checked = E.checked;
+      perms[P[1]].delete.checked = E.checked;
 
-		function contentadmin(E,perms,re) {
-					P = E.name.match(re);
+      perms[P[1]].usage.disabled = E.checked;
+      perms[P[1]].publish.disabled = E.checked;
+      perms[P[1]].delete.disabled = E.checked;
+    };
 
-					perms[P[1]]['usage'].checked = E.checked;
-					perms[P[1]]['publish'].checked = E.checked;
-					perms[P[1]]['delete'].checked = E.checked;
-					perms[P[1]]['usage'].disabled = E.checked;
-					perms[P[1]]['publish'].disabled = E.checked;
-					perms[P[1]]['delete'].disabled = E.checked;
-		}
+    var mediaadmin = function(E, perms, re) {
+      var P = E.name.match(re);
 
-		function mediaadmin(E,perms,re) {
-					P = E.name.match(re);
+      perms[P[1]].media.checked = E.checked;
 
-					perms[P[1]]['media'].checked = E.checked;
-					perms[P[1]]['media'].disabled = E.checked;
-		}
+      perms[P[1]].media.disabled = E.checked;
+    };
 
-
-	});
+    // Building a nice object of form elements
+    for (var i = 0; i < this.elements.length; i++) {
+      e = this.elements[i];
+      if (e.name == undefined) {
+        continue;
+      }
+      prop = e.name.match(re);
+      if (!prop) {
+        continue;
+      }
+      if (perms[prop[1]] == undefined) {
+        perms[prop[1]] = {};
+      }
+      perms[prop[1]][prop[2]] = e;
+    }
+    // Populate states
+    for (var blog in perms) {
+      // Loop on blog
+      for (var element in perms[blog]) {
+        // Loop on permission
+        e = perms[blog][element];
+        prop = e.name.match(re);
+        if (prop[2] == 'admin') {
+          // select related permissions for admin
+          if (e.checked) {
+            admin(e, perms, re);
+          }
+          $(e).click(function() {
+            admin(this, perms, re);
+          });
+        } else if (prop[2] == 'contentadmin') {
+          // select related permissions for content admin
+          if (e.checked) {
+            contentadmin(e, perms, re);
+          }
+          $(e).click(function() {
+            contentadmin(this, perms, re);
+          });
+        } else if (prop[2] == 'media_admin') {
+          // select related permissions for media admin
+          if (e.checked) {
+            mediaadmin(e, perms, re);
+          }
+          $(e).click(function() {
+            mediaadmin(this, perms, re);
+          });
+        }
+      }
+    }
+  });
 };
 
 $(function() {
-	$('.checkboxes-helpers').each(function() {
-		dotclear.checkboxesHelpers(this,undefined,'#form-blogs input[type="checkbox"]','#form-blogs #do-action');
-	});
-	dotclear.condSubmit('#form-blogs input[type="checkbox"]','#form-blogs #do-action');
-	$('#permissions-form').updatePermissionsForm();
+  $('.checkboxes-helpers').each(function() {
+    dotclear.checkboxesHelpers(this, undefined, '#form-blogs input[type="checkbox"]', '#form-blogs #do-action');
+  });
+  dotclear.condSubmit('#form-blogs input[type="checkbox"]', '#form-blogs #do-action');
+  $('#permissions-form').updatePermissionsForm();
 });
Index: admin/js/color-picker.js
===================================================================
--- admin/js/color-picker.js	(revision 2566)
+++ admin/js/color-picker.js	(revision 3706)
@@ -1,83 +1,89 @@
+/*global $, jQuery */
+'use strict';
+
 $(function() {
-	$('.colorpicker').colorPicker();
+  $('.colorpicker').colorPicker();
 });
 
 jQuery.fn.colorPicker = function() {
-	$(this).each(function() {
-		var colbox, f;
-		var colbox = $('#jquery-colorpicker')[0];
+  $(this).each(function() {
+    var colbox, f;
+    colbox = $('#jquery-colorpicker')[0];
 
-		if (colbox == undefined) {
-			colbox = document.createElement('div');
-			colbox.id = 'jquery-colorpicker';
-			colbox.linkedto = null;
+    if (colbox == undefined) {
+      colbox = document.createElement('div');
+      colbox.id = 'jquery-colorpicker';
+      colbox.linkedto = null;
 
-			$(colbox).addClass('color-color-picker');
-			$(colbox).css({display: 'none', position: 'absolute'});
-			$('body').append(colbox);
-		}
-		f = $.farbtastic(colbox);
-		f.linkTo(this);
+      $(colbox).addClass('color-color-picker');
+      $(colbox).css({
+        display: 'none',
+        position: 'absolute'
+      });
+      $('body').append(colbox);
+    }
+    f = $.farbtastic(colbox);
+    f.linkTo(this);
 
-		var handler = $(document.createElement('img'));
-		handler.attr('src','images/picker.png');
-		handler.attr('alt','');
+    var handler = $(document.createElement('img'));
+    handler.attr('src', 'images/picker.png');
+    handler.attr('alt', '');
 
-		var span = $(document.createElement('span'));
+    var span = $(document.createElement('span'));
 
-		if ($(this).css('position') == 'absolute') {
-			span.css('position','absolute');
-			span.css('top',$(this).css('top'));
-			span.css('left',$(this).css('left'));
-			$(this).css('position','static');
-		} else {
-			span.css('position','relative');
-		}
-		span.css('display','inline-block');
+    if ($(this).css('position') == 'absolute') {
+      span.css('position', 'absolute');
+      span.css('top', $(this).css('top'));
+      span.css('left', $(this).css('left'));
+      $(this).css('position', 'static');
+    } else {
+      span.css('position', 'relative');
+    }
+    span.css('display', 'inline-block');
+    span.css('padding', '0 5px 0 0');
+    $(this).wrap(span);
+    $(this).after(handler);
 
-		/*ligne supprimée car elle ne fait pas le calcul
-		du width de l'input et ça fout la merde */
-		//span.css('width',($(this).width()+12)+'px');
-		span.css('padding','0 5px 0 0');
-		$(this).wrap(span);
-		$(this).after(handler);
+    handler.css({
+      position: 'absolute',
+      top: 3,
+    });
 
-		var offset = $(this).offset();
-		handler.css({
-			position: 'absolute',
-			top: 3,
-			/* la largeur du span n'étant pas calculée
-			right: 0 crée un affichage pourri. On vire. */
-			//right: 0
-		});
+    handler.css({
+      cursor: 'default'
+    });
 
-		handler.css({cursor: 'default'});
+    var This = this;
+    handler.click(function() {
+      if ($(colbox).css('display') == 'none' || this != colbox.linkedto) {
+        f.linkTo(This);
+        This.focus();
+        var offset = $(This).offset();
+        $(colbox).css({
+          zIndex: 1000,
+          top: offset.top + $(this).height() + 5,
+          left: offset.left
+        });
+        if (document.all) {
+          $('select').hide();
+        }
+        $(colbox).show();
+        colbox.linkedto = this;
 
-		var This = this;
-		handler.click(function() {
-			if ($(colbox).css('display') == 'none' || this != colbox.linkedto) {
-				f.linkTo(This);
-				This.focus();
-				var offset = $(This).offset();
-				$(colbox).css({
-					zIndex: 1000,
-					top: offset.top + $(this).height() + 5,
-					left: offset.left
-				});
-				if (document.all) { $('select').hide(); }
-				$(colbox).show();
-				colbox.linkedto = this;
-
-			} else {
-				$(colbox).hide();
-				if (document.all) { $('select').show(); }
-				colbox.linkedto = null;
-			}
-		});
-		$(this).blur(function() {
-			$(colbox).hide();
-			if (document.all) { $('select').show(); }
-		});
-	});
-	return this;
+      } else {
+        $(colbox).hide();
+        if (document.all) {
+          $('select').show();
+        }
+        colbox.linkedto = null;
+      }
+    });
+    $(this).blur(function() {
+      $(colbox).hide();
+      if (document.all) {
+        $('select').show();
+      }
+    });
+  });
+  return this;
 };
Index: admin/js/common.js
===================================================================
--- admin/js/common.js	(revision 3701)
+++ admin/js/common.js	(revision 3706)
@@ -1,2 +1,6 @@
+/*global $, jQuery, dotclear_htmlFontSize */
+/*exported chainHandler */
+'use strict';
+
 /* Set some CSS variables here
 -------------------------------------------------------- */
@@ -14,5 +18,5 @@
     };
   })(handlerName in obj ? obj[handlerName] : null);
-};
+}
 /* jQuery extensions
 -------------------------------------------------------- */
@@ -62,5 +66,5 @@
     return true;
   });
-}
+};
 jQuery.fn.toggleWithLegend = function(target, s) {
   var defaults = {
@@ -141,5 +145,5 @@
             'value': 1,
             xd_check: dotclear.nonce
-          }, function(data) {});
+          }, function() {});
         } else {
           jQuery.post('services.php', {
@@ -148,5 +152,5 @@
             'value': 0,
             xd_check: dotclear.nonce
-          }, function(data) {});
+          }, function() {});
         }
         jQuery.cookie(p.user_pref, '', {
@@ -162,5 +166,4 @@
 };
 (function($) {
-  'use strict';
   $.expandContent = function(opts) {
     var defaults = {};
@@ -175,5 +178,5 @@
       singleExpander(this);
     });
-  }
+  };
   var singleExpander = function singleExpander(line) {
     $('<input type="image" src="' + dotclear.img_plus_src + '" alt="' + dotclear.img_plus_alt + '"/>').click(function(e) {
@@ -211,5 +214,5 @@
     }
     return action;
-  }
+  };
 })(jQuery);
 jQuery.fn.helpViewer = function() {
@@ -281,12 +284,12 @@
   // listen for scroll
   var peInPage = $('#help-button').offset().top;
-  $('#help-button').addClass("floatable");
+  $('#help-button').addClass('floatable');
   var peInFloat = $('#help-button').offset().top - $(window).scrollTop();
-  $('#help-button').removeClass("floatable");
+  $('#help-button').removeClass('floatable');
   $(window).scroll(function() {
     if ($(window).scrollTop() >= peInPage - peInFloat) {
-      $('#help-button').addClass("floatable");
-    } else {
-      $('#help-button').removeClass("floatable");
+      $('#help-button').addClass('floatable');
+    } else {
+      $('#help-button').removeClass('floatable');
     }
   });
@@ -313,6 +316,6 @@
     }
     // Set initial state
-    submitButt.attr("disabled", !checkboxes.is(":checked"));
-    if (!checkboxes.is(":checked")) {
+    submitButt.attr('disabled', !checkboxes.is(':checked'));
+    if (!checkboxes.is(':checked')) {
       submitButt.addClass('disabled');
     } else {
@@ -321,6 +324,6 @@
     checkboxes.click(function() {
       // Update target state
-      submitButt.attr("disabled", !checkboxes.is(":checked"));
-      if (!checkboxes.is(":checked")) {
+      submitButt.attr('disabled', !checkboxes.is(':checked'));
+      if (!checkboxes.is(':checked')) {
         submitButt.addClass('disabled');
       } else {
@@ -476,5 +479,5 @@
     legend_click: true,
     speed: 100
-  }
+  };
   $('#blog-menu h3:first').toggleWithLegend($('#blog-menu ul:first'), $.extend({
     user_pref: 'dc_blog_menu'
@@ -503,8 +506,8 @@
   // Password
   $('form:has(input[type=password][name=your_pwd])').submit(function() {
-    var e = this.elements['your_pwd'];
+    var e = this.elements.your_pwd;
     if (e.value == '') {
       $(e).addClass('missing').focusout(function() {
-        $(this).removeClass('missing')
+        $(this).removeClass('missing');
       });
       e.focus();
@@ -526,5 +529,5 @@
       this.title = this.innerText;
     }
-  })
+  });
   // Advanced users
   if (dotclear.hideMoreInfo) {
Index: admin/js/confirm-close.js
===================================================================
--- admin/js/confirm-close.js	(revision 3449)
+++ admin/js/confirm-close.js	(revision 3706)
@@ -1,144 +1,146 @@
+/*global chainHandler */
+'use strict';
+
 function confirmClose() {
-
-	if (arguments.length > 0) {
-		for (var i = 0; i < arguments.length; i++) {
-			this.forms_id.push(arguments[i]);
-		}
-	}
-};
+  if (arguments.length > 0) {
+    for (var i = 0; i < arguments.length; i++) {
+      this.forms_id.push(arguments[i]);
+    }
+  }
+}
 
 confirmClose.prototype = {
-	prompt: 'You have unsaved changes.',
-	forms_id: new Array(),
-	forms: new Array(),
-	formSubmit: false,
+  prompt: 'You have unsaved changes.',
+  forms_id: [],
+  forms: [],
+  formSubmit: false,
 
-	getCurrentForms: function() {
-		// Store current form's element's values
+  getCurrentForms: function() {
+    // Store current form's element's values
 
-		var formsInPage = this.getForms();
-		var f, e;
-		var This = this;
-		this.forms = new Array();
-		for (var i = 0; i < formsInPage.length; i++) {
-			f = formsInPage[i];
-			var tmpForm = new Array();
-			for (var j = 0; j < f.elements.length; j++) {
-				e = this.getFormElementValue(f[j]);
-				if (e != undefined) {
-					tmpForm.push(e);
-				}
-			}
-			this.forms.push(tmpForm);
+    var formsInPage = this.getForms();
+    var f, e;
+    var This = this;
+    this.forms = [];
+    for (var i = 0; i < formsInPage.length; i++) {
+      f = formsInPage[i];
+      var tmpForm = [];
+      for (var j = 0; j < f.elements.length; j++) {
+        e = this.getFormElementValue(f[j]);
+        if (e != undefined) {
+          tmpForm.push(e);
+        }
+      }
+      this.forms.push(tmpForm);
 
-			chainHandler(f, 'onsubmit', function() {
-				This.formSubmit = true;
-			});
-		}
-	},
+      chainHandler(f, 'onsubmit', function() {
+        This.formSubmit = true;
+      });
+    }
+  },
 
-	compareForms: function() {
-		// Compare current form's element's values to their original values
-		// Return false if any difference, else true
+  compareForms: function() {
+    // Compare current form's element's values to their original values
+    // Return false if any difference, else true
 
-		if (this.forms.length == 0) {
-			return true;
-		}
+    if (this.forms.length == 0) {
+      return true;
+    }
 
-		var formsInPage = this.getForms();
-		var f, e;
-		for (var i = 0; i < formsInPage.length; i++) {
-			f = formsInPage[i];
-			var tmpForm = new Array();
-			for (var j = 0; j < f.elements.length; j++) {
-				e = this.getFormElementValue(f[j]);
-				if (e != undefined) {
-					tmpForm.push(e);
-				}
-			}
-			for (var j = 0; j < this.forms[i].length; j++) {
-				if (this.forms[i][j] != tmpForm[j]) {
-					return false;
-				}
-			}
-		}
+    var formsInPage = this.getForms();
+    var f, e, i, j;
+    for (i = 0; i < formsInPage.length; i++) {
+      f = formsInPage[i];
+      var tmpForm = [];
+      for (j = 0; j < f.elements.length; j++) {
+        e = this.getFormElementValue(f[j]);
+        if (e != undefined) {
+          tmpForm.push(e);
+        }
+      }
+      for (j = 0; j < this.forms[i].length; j++) {
+        if (this.forms[i][j] != tmpForm[j]) {
+          return false;
+        }
+      }
+    }
 
-		return true;
-	},
+    return true;
+  },
 
-	getForms: function() {
-		// Get current list of forms as HTMLCollection(s)
+  getForms: function() {
+    // Get current list of forms as HTMLCollection(s)
 
-		if (!document.getElementsByTagName || !document.getElementById) {
-			return new Array();
-		}
+    if (!document.getElementsByTagName || !document.getElementById) {
+      return [];
+    }
 
-		if (this.forms_id.length > 0) {
-			var res = new Array();
-			var f;
-			for (var i = 0; i < this.forms_id.length; i++) {
-				f = document.getElementById(this.forms_id[i]);
-				if (f != undefined) {
-					res.push(f);
-				}
-			}
-			return res;
-		} else {
-			return document.getElementsByTagName('form');
-		}
+    if (this.forms_id.length > 0) {
+      var res = [];
+      var f;
+      for (var i = 0; i < this.forms_id.length; i++) {
+        f = document.getElementById(this.forms_id[i]);
+        if (f != undefined) {
+          res.push(f);
+        }
+      }
+      return res;
+    } else {
+      return document.getElementsByTagName('form');
+    }
 
-		return new Array();
-	},
+    return [];
+  },
 
-	getFormElementValue: function(e) {
-		// Return current value of an form element
+  getFormElementValue: function(e) {
+    // Return current value of an form element
 
-		if (e == undefined) {
-			// Unknown object
-			return undefined;
-		}
-		if (e.type != undefined && e.type == 'button') {
-			// Ignore button element
-			return undefined;
-		}
-		if (e.classList.contains('meta-helper') || e.classList.contains('checkbox-helper')) {
-			// Ignore some application helper element
-			return undefined;
-		}
-		if (e.type != undefined && e.type == 'radio') {
-			// Return actual radio button value if selected, else null
-			return this.getFormRadioValue(e);
-		} else if (e.type != undefined && e.type == 'checkbox') {
-			// Return actual checkbox button value if checked, else null
-			return this.getFormCheckValue(e);
-		} else if (e.type != undefined && e.type == 'password') {
-			// Ignore password element
-			return null;
-		} else if (e.value != undefined) {
-			// Return element value if not undefined
-			return e.value;
-		} else {
-			// Every other case, return null
-			return null;
-		}
-	},
+    if (e == undefined) {
+      // Unknown object
+      return undefined;
+    }
+    if (e.type != undefined && e.type == 'button') {
+      // Ignore button element
+      return undefined;
+    }
+    if (e.classList.contains('meta-helper') || e.classList.contains('checkbox-helper')) {
+      // Ignore some application helper element
+      return undefined;
+    }
+    if (e.type != undefined && e.type == 'radio') {
+      // Return actual radio button value if selected, else null
+      return this.getFormRadioValue(e);
+    } else if (e.type != undefined && e.type == 'checkbox') {
+      // Return actual checkbox button value if checked, else null
+      return this.getFormCheckValue(e);
+    } else if (e.type != undefined && e.type == 'password') {
+      // Ignore password element
+      return null;
+    } else if (e.value != undefined) {
+      // Return element value if not undefined
+      return e.value;
+    } else {
+      // Every other case, return null
+      return null;
+    }
+  },
 
-	getFormCheckValue: function(e) {
-		if (e.checked) {
-			return e.value;
-		}
-		return null;
-	},
+  getFormCheckValue: function(e) {
+    if (e.checked) {
+      return e.value;
+    }
+    return null;
+  },
 
-	getFormRadioValue: function(e) {
-		for (var i = 0; i < e.length; i++) {
-			if (e[i].checked) {
-				return e[i].value;
-			} else {
-				return null;
-			}
-		}
-		return null;
-	}
+  getFormRadioValue: function(e) {
+    for (var i = 0; i < e.length; i++) {
+      if (e[i].checked) {
+        return e[i].value;
+      } else {
+        return null;
+      }
+    }
+    return null;
+  }
 };
 
@@ -146,16 +148,16 @@
 
 chainHandler(window, 'onload', function() {
-	confirmClosePage.getCurrentForms();
+  confirmClosePage.getCurrentForms();
 });
 
 chainHandler(window, 'onbeforeunload', function(event_) {
-	if (event_ == undefined && window.event) {
-		event_ = window.event;
-	}
+  if (event_ == undefined && window.event) {
+    event_ = window.event;
+  }
 
-	if (!confirmClosePage.formSubmit && !confirmClosePage.compareForms()) {
-		event_.returnValue = confirmClosePage.prompt;
-		return confirmClosePage.prompt;
-	}
-	return false;
+  if (!confirmClosePage.formSubmit && !confirmClosePage.compareForms()) {
+    event_.returnValue = confirmClosePage.prompt;
+    return confirmClosePage.prompt;
+  }
+  return false;
 });
Index: admin/js/date-picker.js
===================================================================
--- admin/js/date-picker.js	(revision 3525)
+++ admin/js/date-picker.js	(revision 3706)
@@ -1,453 +1,516 @@
-function datePicker(target)
-{
-	if (!document.getElementById) { return; }
-
-	if (!target || target.nodeName.toLowerCase() != 'input') {
-		return;
-	}
-
-	this.target = target;
-	this.oTable = document.createElement('table');
-	this.oBody = document.createElement('tbody');
-	this.oDates = new Array();
-	this.oMonth = document.createElement('span');
-	this.oYear = document.createElement('span');
-	this.oHour = document.createElement('input');
-	this.oMinute = document.createElement('input');
-	this.oTable.id = 'dc_datepicker_'+target.id;
-	this.oTable.className = 'date-picker';
-
-	var cur = 1;
-	var oRow, oHeading, oSpan;
-
-	// Set title
-	oRow = document.createElement('tr');
-
-	// Month block
-	oHeading = document.createElement('th');
-	oHeading.colSpan = 4;
-	oHeading.className = 'date-picker-month';
-
-	var nav = document.createElement('span');
-	nav.appendChild(document.createTextNode(String.fromCharCode(171)));
-	nav.fn = this.changeMonth;
-	nav.obj = this;
-	nav.onclick = function() { this.fn.call(this.obj,-1); };
-	nav.className = 'date-picker-control';
-	oHeading.appendChild(nav);
-
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-
-	nav = document.createElement('span');
-	nav.appendChild(document.createTextNode(String.fromCharCode(187)));
-	nav.fn = this.changeMonth;
-	nav.obj = this;
-	nav.onclick = function() { this.fn.call(this.obj,+1); };
-	nav.className = 'date-picker-control';
-	oHeading.appendChild(nav);
-
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-
-	oHeading.appendChild(this.oMonth);
-
-	oRow.appendChild(oHeading);
-
-	// Year block
-	oHeading = document.createElement('th');
-	oHeading.colSpan = 3;
-	oHeading.className = 'date-picker-year';
-
-	oHeading.appendChild(this.oYear);
-
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-
-	nav = document.createElement('span');
-	nav.appendChild(document.createTextNode(String.fromCharCode(171)));
-	nav.fn = this.changeYear;
-	nav.obj = this;
-	nav.onclick = function() { this.fn.call(this.obj,-1); };
-	nav.className = 'date-picker-control';
-	oHeading.appendChild(nav);
-
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-
-	nav = document.createElement('span');
-	nav.appendChild(document.createTextNode(String.fromCharCode(187)));
-	nav.fn = this.changeYear;
-	nav.obj = this;
-	nav.onclick = function() { this.fn.call(this.obj,+1); };
-	nav.className = 'date-picker-control';
-	oHeading.appendChild(nav);
-
-	oRow.appendChild(oHeading);
-
-	this.oBody.appendChild(oRow);
-
-	// Create legend
-	oRow = document.createElement('tr');
-	var cday;
-	for (i=0; i<this.days.length; i++) {
-		cday = this.days[i].substring(0,1).toUpperCase();
-		oHeading = document.createElement('th');
-		oHeading.appendChild(document.createTextNode(cday));
-		oHeading.setAttribute('title',this.days[i]);
-		oRow.appendChild(oHeading);
-	}
-	this.oBody.appendChild(oRow);
-
-	// Create 6 rows of 7 cols for days
-	for (var i=0; i<6; i++) {
-		oRow = document.createElement('tr');
-
-		for (var j=0; j<7; j++) {
-			this.oDates[cur] = document.createElement('td');
-			this.oDates[cur].appendChild(document.createTextNode(
-				String.fromCharCode(160)));
-			oRow.appendChild(this.oDates[cur]);
-			cur++;
-		}
-
-		this.oBody.appendChild(oRow);
-	}
-
-	// Time controls
-	oRow = document.createElement('tr');
-
-	oHeading = document.createElement('th');
-	oHeading.className = 'date-picker-control';
-	oHeading.appendChild(document.createTextNode('!'));
-	oHeading.setAttribute('title',this.now_msg);
-	oHeading.fn = this.sendNow;
-	oHeading.obj = this;
-	oHeading.onclick = function() { this.fn.call(this.obj); };
-
-	oRow.appendChild(oHeading);
-
-	oHeading = document.createElement('th');
-	oHeading.colSpan = 5;
-
-	oSpan = document.createElement('span');
-	oSpan.className = 'date-picker-control';
-	oSpan.appendChild(document.createTextNode('-'));
-	oSpan.fn = this.changeHour;
-	oSpan.obj = this;
-	oSpan.onclick = function() { this.fn.call(this.obj,-1); };
-	oHeading.appendChild(oSpan);
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-	oSpan = document.createElement('span');
-	oSpan.className = 'date-picker-control';
-	oSpan.appendChild(document.createTextNode('+'));
-	oSpan.fn = this.changeHour;
-	oSpan.obj = this;
-	oSpan.onclick = function() { this.fn.call(this.obj,+1); };
-	oHeading.appendChild(oSpan);
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-
-	this.oHour.size = 2;
-	oHeading.appendChild(this.oHour);
-
-	oHeading.appendChild(document.createTextNode(' : '));
-
-	this.oMinute.size = 2;
-	oHeading.appendChild(this.oMinute);
-
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-	oSpan = document.createElement('span');
-	oSpan.className = 'date-picker-control';
-	oSpan.appendChild(document.createTextNode('-'));
-	oSpan.fn = this.changeMinute;
-	oSpan.obj = this;
-	oSpan.onclick = function() { this.fn.call(this.obj,-1); };
-	oHeading.appendChild(oSpan);
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-	oSpan = document.createElement('span');
-	oSpan.className = 'date-picker-control';
-	oSpan.appendChild(document.createTextNode('+'));
-	oSpan.fn = this.changeMinute;
-	oSpan.obj = this;
-	oSpan.onclick = function() { this.fn.call(this.obj,+1); };
-
-	oHeading.appendChild(oSpan);
-
-	oRow.appendChild(oHeading);
-
-	// Close control
-	oHeading = document.createElement('th');
-	oHeading.className = 'date-picker-control';
-	oHeading.appendChild(document.createTextNode('x'));
-	oHeading.setAttribute('title',this.close_msg);
-	oHeading.fn = this.close;
-	oHeading.obj = this;
-	oHeading.onclick = function() { this.fn.call(this.obj); };
-
-	oRow.appendChild(oHeading);
-
-	this.oBody.appendChild(oRow);
+'use strict';
+
+function datePicker(target) {
+  if (!document.getElementById) {
+    return;
+  }
+
+  if (!target || target.nodeName.toLowerCase() != 'input') {
+    return;
+  }
+
+  this.target = target;
+  this.oTable = document.createElement('table');
+  this.oBody = document.createElement('tbody');
+  this.oDates = [];
+  this.oMonth = document.createElement('span');
+  this.oYear = document.createElement('span');
+  this.oHour = document.createElement('input');
+  this.oMinute = document.createElement('input');
+  this.oTable.id = 'dc_datepicker_' + target.id;
+  this.oTable.className = 'date-picker';
+
+  var cur = 1;
+  var oRow, oHeading, oSpan;
+
+  // Set title
+  oRow = document.createElement('tr');
+
+  // Month block
+  oHeading = document.createElement('th');
+  oHeading.colSpan = 4;
+  oHeading.className = 'date-picker-month';
+
+  var nav = document.createElement('span');
+  nav.appendChild(document.createTextNode(String.fromCharCode(171)));
+  nav.fn = this.changeMonth;
+  nav.obj = this;
+  nav.onclick = function() {
+    this.fn.call(this.obj, -1);
+  };
+  nav.className = 'date-picker-control';
+  oHeading.appendChild(nav);
+
+  oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
+
+  nav = document.createElement('span');
+  nav.appendChild(document.createTextNode(String.fromCharCode(187)));
+  nav.fn = this.changeMonth;
+  nav.obj = this;
+  nav.onclick = function() {
+    this.fn.call(this.obj, +1);
+  };
+  nav.className = 'date-picker-control';
+  oHeading.appendChild(nav);
+
+  oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
+
+  oHeading.appendChild(this.oMonth);
+
+  oRow.appendChild(oHeading);
+
+  // Year block
+  oHeading = document.createElement('th');
+  oHeading.colSpan = 3;
+  oHeading.className = 'date-picker-year';
+
+  oHeading.appendChild(this.oYear);
+
+  oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
+
+  nav = document.createElement('span');
+  nav.appendChild(document.createTextNode(String.fromCharCode(171)));
+  nav.fn = this.changeYear;
+  nav.obj = this;
+  nav.onclick = function() {
+    this.fn.call(this.obj, -1);
+  };
+  nav.className = 'date-picker-control';
+  oHeading.appendChild(nav);
+
+  oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
+
+  nav = document.createElement('span');
+  nav.appendChild(document.createTextNode(String.fromCharCode(187)));
+  nav.fn = this.changeYear;
+  nav.obj = this;
+  nav.onclick = function() {
+    this.fn.call(this.obj, +1);
+  };
+  nav.className = 'date-picker-control';
+  oHeading.appendChild(nav);
+
+  oRow.appendChild(oHeading);
+
+  this.oBody.appendChild(oRow);
+
+  // Create legend
+  oRow = document.createElement('tr');
+  var cday;
+  for (i = 0; i < this.days.length; i++) {
+    cday = this.days[i].substring(0, 1).toUpperCase();
+    oHeading = document.createElement('th');
+    oHeading.appendChild(document.createTextNode(cday));
+    oHeading.setAttribute('title', this.days[i]);
+    oRow.appendChild(oHeading);
+  }
+  this.oBody.appendChild(oRow);
+
+  // Create 6 rows of 7 cols for days
+  for (var i = 0; i < 6; i++) {
+    oRow = document.createElement('tr');
+
+    for (var j = 0; j < 7; j++) {
+      this.oDates[cur] = document.createElement('td');
+      this.oDates[cur].appendChild(document.createTextNode(
+        String.fromCharCode(160)));
+      oRow.appendChild(this.oDates[cur]);
+      cur++;
+    }
+
+    this.oBody.appendChild(oRow);
+  }
+
+  // Time controls
+  oRow = document.createElement('tr');
+
+  oHeading = document.createElement('th');
+  oHeading.className = 'date-picker-control';
+  oHeading.appendChild(document.createTextNode('!'));
+  oHeading.setAttribute('title', this.now_msg);
+  oHeading.fn = this.sendNow;
+  oHeading.obj = this;
+  oHeading.onclick = function() {
+    this.fn.call(this.obj);
+  };
+
+  oRow.appendChild(oHeading);
+
+  oHeading = document.createElement('th');
+  oHeading.colSpan = 5;
+
+  oSpan = document.createElement('span');
+  oSpan.className = 'date-picker-control';
+  oSpan.appendChild(document.createTextNode('-'));
+  oSpan.fn = this.changeHour;
+  oSpan.obj = this;
+  oSpan.onclick = function() {
+    this.fn.call(this.obj, -1);
+  };
+  oHeading.appendChild(oSpan);
+  oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
+  oSpan = document.createElement('span');
+  oSpan.className = 'date-picker-control';
+  oSpan.appendChild(document.createTextNode('+'));
+  oSpan.fn = this.changeHour;
+  oSpan.obj = this;
+  oSpan.onclick = function() {
+    this.fn.call(this.obj, +1);
+  };
+  oHeading.appendChild(oSpan);
+  oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
+
+  this.oHour.size = 2;
+  oHeading.appendChild(this.oHour);
+
+  oHeading.appendChild(document.createTextNode(' : '));
+
+  this.oMinute.size = 2;
+  oHeading.appendChild(this.oMinute);
+
+  oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
+  oSpan = document.createElement('span');
+  oSpan.className = 'date-picker-control';
+  oSpan.appendChild(document.createTextNode('-'));
+  oSpan.fn = this.changeMinute;
+  oSpan.obj = this;
+  oSpan.onclick = function() {
+    this.fn.call(this.obj, -1);
+  };
+  oHeading.appendChild(oSpan);
+  oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
+  oSpan = document.createElement('span');
+  oSpan.className = 'date-picker-control';
+  oSpan.appendChild(document.createTextNode('+'));
+  oSpan.fn = this.changeMinute;
+  oSpan.obj = this;
+  oSpan.onclick = function() {
+    this.fn.call(this.obj, +1);
+  };
+
+  oHeading.appendChild(oSpan);
+
+  oRow.appendChild(oHeading);
+
+  // Close control
+  oHeading = document.createElement('th');
+  oHeading.className = 'date-picker-control';
+  oHeading.appendChild(document.createTextNode('x'));
+  oHeading.setAttribute('title', this.close_msg);
+  oHeading.fn = this.close;
+  oHeading.obj = this;
+  oHeading.onclick = function() {
+    this.fn.call(this.obj);
+  };
+
+  oRow.appendChild(oHeading);
+
+  this.oBody.appendChild(oRow);
+}
+
+datePicker.prototype = {
+  year: 0,
+  month: 0,
+  day: 0,
+  hour: 0,
+  minute: 0,
+
+  img_src: '',
+  img_top: '0.2em',
+  now_msg: 'now',
+  close_msg: 'close',
+
+  days: new Array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday',
+    'Saturday', 'Sunday'),
+
+  months: new Array('January', 'February', 'March', 'April', 'May', 'June',
+    'July', 'August', 'September', 'October', 'November', 'December'),
+
+  setDate: function() {
+    if (this.numberOfDays() < this.day) {
+      this.day = this.numberOfDays();
+    }
+
+    while (this.oYear.hasChildNodes()) {
+      this.oYear.removeChild(this.oYear.firstChild);
+    }
+    this.oYear.appendChild(document.createTextNode(this.year));
+
+    while (this.oMonth.hasChildNodes()) {
+      this.oMonth.removeChild(this.oMonth.firstChild);
+    }
+    this.oMonth.appendChild(document.createTextNode(
+      this.months[this.month - 1]));
+
+    var firstDay = this.firstDay();
+    var nbDays = this.numberOfDays();
+
+    // Empty days
+    for (var i = 1; i <= 42; i++) {
+      while (this.oDates[i].hasChildNodes()) {
+        this.oDates[i].removeChild(this.oDates[i].firstChild);
+      }
+      this.oDates[i].appendChild(document.createTextNode('-'));
+      this.oDates[i].className = '';
+      this.oDates[i].onclick = function() {
+        return;
+      };
+    }
+
+    // Insert days from the first day to the last
+    for (i = 1; i <= nbDays; i++) {
+      var j = firstDay + i - 1;
+
+      while (this.oDates[j].hasChildNodes()) {
+        this.oDates[j].removeChild(this.oDates[j].firstChild);
+      }
+
+      this.oDates[j].appendChild(document.createTextNode(i));
+      this.oDates[j].index = i;
+      this.oDates[j].fn = this.sendDate;
+      this.oDates[j].obj = this;
+      this.oDates[j].onclick = function() {
+        this.fn.call(this.obj, this.index);
+      };
+      if (i == this.day) {
+        this.oDates[j].className = 'date-picker-today';
+      } else {
+        this.oDates[j].className = 'date-picker-day';
+      }
+    }
+
+    // Set time
+    this.setHour(this.hour);
+    this.setMinute(this.minute);
+  },
+
+  setHour: function(h) {
+    if (h < 0) {
+      h = 23;
+    }
+    if (h > 23) {
+      h = 0;
+    }
+    if (h < 10) {
+      h = '0' + h;
+    }
+
+    this.hour = h * 1;
+    this.oHour.value = h;
+  },
+
+  setMinute: function(m) {
+    if (m < 0) {
+      m = 59;
+    }
+    if (m > 59) {
+      m = 0;
+    }
+    if (m < 10) {
+      m = '0' + m;
+    }
+
+    this.minute = m * 1;
+    this.oMinute.value = m;
+  },
+
+  changeMonth: function(dir) {
+    var m = this.month;
+    m = m + dir;
+
+    if (m > 12) {
+      this.month = 1;
+      this.year++;
+    } else if (m < 1) {
+      this.month = 12;
+      this.year--;
+    } else {
+      this.month = m;
+    }
+
+    this.setDate();
+  },
+
+  changeYear: function(dir) {
+    this.year = this.year + dir;
+    this.setDate();
+  },
+
+  changeHour: function(dir) {
+    this.setHour(this.hour * 1 + dir);
+  },
+
+  changeMinute: function(dir) {
+    this.setMinute(this.minute * 1 + dir);
+  },
+
+  sendDate: function(d) {
+    var m = this.month;
+    var hour = this.oHour.value * 1;
+    var minute = this.oMinute.value * 1;
+
+    if (hour < 0 || hour > 23 || isNaN(hour)) {
+      hour = 0;
+    }
+    if (minute < 0 || minute > 59 || isNaN(minute)) {
+      minute = 0;
+    }
+
+    if (m < 10) {
+      m = '0' + m;
+    }
+    if (d < 10) {
+      d = '0' + d;
+    }
+    if (hour < 10) {
+      hour = '0' + hour;
+    }
+    if (minute < 10) {
+      minute = '0' + minute;
+    }
+
+    this.target.value = this.year + '-' + m + '-' + d + ' ' + hour + ':' + minute;
+    this.close();
+  },
+
+  sendNow: function() {
+    var dt = new Date();
+    var y = dt.getFullYear();
+    var m = dt.getMonth() + 1;
+    var d = dt.getDate();
+    var h = dt.getHours();
+    var i = dt.getMinutes();
+
+    if (m < 10) {
+      m = '0' + m;
+    }
+    if (d < 10) {
+      d = '0' + d;
+    }
+    if (h < 10) {
+      h = '0' + h;
+    }
+    if (i < 10) {
+      i = '0' + i;
+    }
+
+    this.target.value = y + '-' + m + '-' + d + ' ' + h + ':' + i;
+    this.close();
+  },
+
+  close: function() {
+    document.body.removeChild(this.oTable);
+  },
+
+  numberOfDays: function() {
+    var res = 31;
+    if (this.month == 4 || this.month == 6 || this.month == 9 ||
+      this.month == 11) {
+      res = 30;
+    } else if (this.month == 2) {
+      res = 28;
+      if (this.year % 4 == 0 && (this.year % 100 != 0 ||
+          this.year % 400 == 0)) {
+        res = 29;
+      }
+    }
+
+    return res;
+  },
+
+  firstDay: function() {
+    var dt = new Date(this.year, this.month - 1, 1);
+    var res = dt.getDay();
+
+    if (res == 0) {
+      res = 7;
+    }
+
+    return res;
+  },
+
+  show: function() {
+    // Parsing target value
+    var re = /(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2})/;
+    var match = re.exec(this.target.value);
+    if (match) {
+      this.year = match[1] * 1;
+      this.month = match[2] * 1;
+      this.day = match[3] * 1;
+      this.hour = match[4] * 1;
+      this.minute = match[5] * 1;
+    } else {
+      var dt = new Date();
+      this.year = dt.getFullYear();
+      this.month = dt.getMonth() + 1;
+      this.day = dt.getDate();
+      this.hour = dt.getHours();
+      this.minute = dt.getMinutes();
+    }
+
+    this.oTable.appendChild(this.oBody);
+    this.setDate();
+    this.setPosition();
+    document.body.appendChild(this.oTable);
+    this.oHour.focus();
+  },
+
+  setPosition: function() {
+    var t_x = this.findPosX(this.target);
+    var t_y = this.findPosY(this.target);
+
+    this.oTable.style.position = 'absolute';
+    this.oTable.style.zIndex = '100';
+    this.oTable.style.top = t_y + 'px';
+    this.oTable.style.left = t_x + 'px';
+  },
+
+  findPosX: function(obj) {
+    var curleft = 0;
+    if (obj.offsetParent) {
+      while (1) {
+        curleft += obj.offsetLeft;
+        if (!obj.offsetParent) {
+          break;
+        }
+        obj = obj.offsetParent;
+      }
+    } else if (obj.x) {
+      curleft += obj.x;
+    }
+    return curleft;
+  },
+
+  findPosY: function(obj) {
+    var curtop = 0;
+    if (obj.offsetParent) {
+      while (1) {
+        curtop += obj.offsetTop;
+        if (!obj.offsetParent) {
+          break;
+        }
+        obj = obj.offsetParent;
+      }
+    } else if (obj.y) {
+      curtop += obj.y;
+    }
+    return curtop;
+  },
+
+  draw: function() {
+    var imgE = document.createElement('img');
+    imgE.src = this.img_src;
+    imgE.alt = this.img_alt;
+    imgE.style.position = 'absolute';
+    imgE.style.top = this.img_top;
+    imgE.style.left = (this.target.clientWidth + 4) + 'px';
+    imgE.obj = this;
+    imgE.fn = this.show;
+    imgE.onclick = function() {
+      this.fn.apply(this.obj);
+    };
+
+    this.target.parentNode.style.position = 'relative';
+    this.target.parentNode.insertBefore(imgE, this.target.nextSibling);
+  }
 };
-
-datePicker.prototype = {
-	year: 0,
-	month: 0,
-	day: 0,
-	hour: 0,
-	minute: 0,
-
-	img_src: '',
-	img_top: '0.2em',
-	now_msg: 'now',
-	close_msg: 'close',
-
-	days: new Array('Monday','Tuesday','Wednesday','Thursday','Friday',
-	'Saturday','Sunday'),
-
-	months: new Array('January','February','March','April','May','June',
-	'July','August','September','October','November','December'),
-
-
-	setDate: function() {
-		if (this.numberOfDays() < this.day) {
-			this.day = this.numberOfDays();
-		}
-
-		while (this.oYear.hasChildNodes()) {
-			this.oYear.removeChild(this.oYear.firstChild)
-		}
-		this.oYear.appendChild(document.createTextNode(this.year));
-
-		while (this.oMonth.hasChildNodes()) {
-			this.oMonth.removeChild(this.oMonth.firstChild)
-		}
-		this.oMonth.appendChild(document.createTextNode(
-			this.months[this.month-1]));
-
-		var firstDay = this.firstDay();
-		var nbDays = this.numberOfDays();
-
-		// Empty days
-		for (var i=1; i<=42; i++) {
-			while (this.oDates[i].hasChildNodes()) {
-				this.oDates[i].removeChild(this.oDates[i].firstChild)
-			}
-			this.oDates[i].appendChild(document.createTextNode('-'));
-			this.oDates[i].className = '';
-			this.oDates[i].onclick = function() { return; };
-		}
-
-		// Insert days from the first day to the last
-		for (i=1; i<=nbDays; i++) {
-			var j=firstDay+i-1;
-
-			while (this.oDates[j].hasChildNodes()) {
-				this.oDates[j].removeChild(this.oDates[j].firstChild)
-			}
-
-			this.oDates[j].appendChild(document.createTextNode(i));
-			this.oDates[j].index = i;
-			this.oDates[j].fn = this.sendDate;
-			this.oDates[j].obj = this;
-			this.oDates[j].onclick = function() { this.fn.call(this.obj,this.index); };
-			if (i == this.day) {
-				this.oDates[j].className = 'date-picker-today';
-			} else {
-				this.oDates[j].className = 'date-picker-day';
-			}
-		}
-
-		// Set time
-		this.setHour(this.hour);
-		this.setMinute(this.minute);
-	},
-
-	setHour: function(h) {
-		if (h < 0) { h = 23; }
-		if (h > 23) { h = 0; }
-		if (h < 10) { h = '0'+h; }
-
-		this.hour = h*1;
-		this.oHour.value = h;
-	},
-
-	setMinute: function(m) {
-		if (m < 0) { m = 59; }
-		if (m > 59) { m = 0; }
-		if (m < 10) { m = '0'+m; }
-
-		this.minute = m*1;
-		this.oMinute.value = m;
-	},
-
-	changeMonth: function(dir) {
-		var y = this.year;
-		var m = this.month;
-		m = m+dir;
-
-		if (m > 12) { this.month = 1; this.year++; }
-		else if ( m < 1) { this.month = 12; this.year--; }
-		else { this.month = m; }
-
-		this.setDate();
-	},
-
-	changeYear: function(dir) {
-		this.year = this.year + dir;
-		this.setDate();
-	},
-
-	changeHour: function(dir) {
-		this.setHour(this.hour*1+dir);
-	},
-
-	changeMinute: function(dir) {
-		this.setMinute(this.minute*1+dir);
-	},
-
-	sendDate: function(d) {
-		var m = this.month;
-		var hour = this.oHour.value*1;
-		var minute = this.oMinute.value*1;
-
-		if (hour < 0 || hour > 23 || isNaN(hour)) { hour = 0; }
-		if (minute < 0 || minute > 59 || isNaN(minute)) { minute = 0; }
-
-		if (m < 10) { m = '0'+m; }
-		if (d < 10) { d = '0'+d; }
-		if (hour < 10) { hour = '0'+hour; }
-		if (minute < 10) { minute = '0'+minute; }
-
-		this.target.value = this.year+'-'+m+'-'+d+' '+hour+':'+minute;
-		this.close();
-	},
-
-	sendNow: function() {
-		var dt = new Date();
-		var y = dt.getFullYear();
-		var m = dt.getMonth() + 1;
-		var d = dt.getDate();
-		var h = dt.getHours();
-		var i = dt.getMinutes();
-
-		if (m < 10) { m = '0'+m; }
-		if (d < 10) { d = '0'+d; }
-		if (h < 10) { h = '0'+h; }
-		if (i < 10) { i = '0'+i; }
-
-		this.target.value = y+'-'+m+'-'+d+' '+h+':'+i;
-		this.close();
-	},
-
-	close: function() {
-		document.body.removeChild(this.oTable);
-	},
-
-	numberOfDays: function() {
-		var res = 31;
-		if (this.month == 4 || this.month == 6 || this.month == 9 ||
-		this.month == 11) {
-			res = 30;
-		} else if (this.month == 2) {
-			res = 28;
-			if (this.year%4 == 0 && (this.year%100 != 0 ||
-			this.year%400 == 0)) {
-				res = 29;
-			}
-		}
-
-		return res;
-	},
-
-	firstDay: function() {
-		var dt = new Date(this.year,this.month-1,1);
-		var res = dt.getDay();
-
-		if (res == 0) {
-			res = 7;
-		}
-
-		return res;
-	},
-
-	show: function() {
-		// Parsing target value
-		var re = /(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2})/;
-		var match = re.exec(this.target.value);
-		if (match) {
-			this.year = match[1]*1;
-			this.month = match[2]*1;
-			this.day = match[3]*1;
-			this.hour = match[4]*1;
-			this.minute = match[5]*1;
-		} else {
-			var dt = new Date();
-			this.year = dt.getFullYear();
-			this.month = dt.getMonth() + 1;
-			this.day = dt.getDate();
-			this.hour = dt.getHours();
-			this.minute = dt.getMinutes();
-		}
-
-		this.oTable.appendChild(this.oBody);
-		this.setDate();
-		this.setPosition();
-		document.body.appendChild(this.oTable);
-		this.oHour.focus();
-	},
-
-	setPosition: function() {
-		var t_x = this.findPosX(this.target);
-		var t_y = this.findPosY(this.target);
-		var o_h = this.oTable.offsetHeight;
-		var o_w = this.oTable.offsetWidth;
-
-		this.oTable.style.position = 'absolute';
-		this.oTable.style.zIndex = '100';
-		this.oTable.style.top = t_y+'px';
-		this.oTable.style.left = t_x+'px';
-	},
-
-	findPosX: function(obj) {
-		var curleft = 0;
-		if(obj.offsetParent) {
-			while(1) {
-				curleft += obj.offsetLeft;
-				if(!obj.offsetParent) {
-					break;
-				}
-				obj = obj.offsetParent;
-			}
-		} else if(obj.x) {
-			curleft += obj.x;
-		}
-		return curleft;
-	},
-
-	findPosY: function(obj) {
-		var curtop = 0;
-		if(obj.offsetParent) {
-			while(1) {
-				curtop += obj.offsetTop;
-				if(!obj.offsetParent) {
-					break;
-				}
-				obj = obj.offsetParent;
-			}
-		} else if(obj.y) {
-			curtop += obj.y;
-		}
-		return curtop;
-	},
-
-	draw: function() {
-		var imgE = document.createElement('img');
-		imgE.src = this.img_src;
-		imgE.alt = this.img_alt;
-		imgE.style.position = 'absolute';
-		imgE.style.top = this.img_top;
-		imgE.style.left = (this.target.clientWidth+4)+'px';
-		imgE.obj = this;
-		imgE.fn = this.show;
-		imgE.onclick = function() { this.fn.apply(this.obj); };
-
-		this.target.parentNode.style.position = 'relative';
-		this.target.parentNode.insertBefore(imgE,this.target.nextSibling);
-	}
-};
Index: admin/js/filter-controls.js
===================================================================
--- admin/js/filter-controls.js	(revision 3026)
+++ admin/js/filter-controls.js	(revision 3706)
@@ -1,34 +1,37 @@
+/*global $, dotclear */
+'use strict';
+
 $(function() {
-	var reset_url = '?';
-	if (dotclear.filter_reset_url != undefined) {
-		reset_url = dotclear.filter_reset_url;
-	}
+  var reset_url = '?';
+  if (dotclear.filter_reset_url != undefined) {
+    reset_url = dotclear.filter_reset_url;
+  }
 
-	$filtersform = $('#filters-form');
-	$filtersform.before('<p><a id="filter-control" class="form-control" href="'+reset_url+'" style="display:inline">'+dotclear.msg.filter_posts_list+'</a></p>')
+  var $filtersform = $('#filters-form');
+  $filtersform.before('<p><a id="filter-control" class="form-control" href="' + reset_url + '" style="display:inline">' + dotclear.msg.filter_posts_list + '</a></p>');
 
-	if( dotclear.msg.show_filters == 'false' ) {
-		$filtersform.hide();
-	} else {
-		$('#filter-control')
-			.addClass('open')
-			.text(dotclear.msg.cancel_the_filter);
-	}
+  if (dotclear.msg.show_filters == 'false') {
+    $filtersform.hide();
+  } else {
+    $('#filter-control')
+      .addClass('open')
+      .text(dotclear.msg.cancel_the_filter);
+  }
 
-	$('#filter-control').click(function() {
-		if( $(this).hasClass('open') ) {
-			if( dotclear.msg.show_filters == 'true' ) {
-				return true;
-			} else {
-				$filtersform.hide();
-				$(this).removeClass('open')
-					   .text(dotclear.msg.filter_posts_list);
-			}
-		} else {
-			$filtersform.show();
-			$(this).addClass('open')
-				   .text(dotclear.msg.cancel_the_filter);
-		}
-		return false;
-	});
+  $('#filter-control').click(function() {
+    if ($(this).hasClass('open')) {
+      if (dotclear.msg.show_filters == 'true') {
+        return true;
+      } else {
+        $filtersform.hide();
+        $(this).removeClass('open')
+          .text(dotclear.msg.filter_posts_list);
+      }
+    } else {
+      $filtersform.show();
+      $(this).addClass('open')
+        .text(dotclear.msg.cancel_the_filter);
+    }
+    return false;
+  });
 });
Index: admin/js/jsUpload/template-download.js
===================================================================
--- admin/js/jsUpload/template-download.js	(revision 1461)
+++ admin/js/jsUpload/template-download.js	(revision 3706)
@@ -1,1 +1,5 @@
-var template_download = tmpl('{% for (var i=0, file; file=o.files[i]; i++) { %}<li class="template-download fade"><div class="upload-file"><div class="upload-fileinfo"><span class="upload-filename">{%=file.name%}</span><span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span><span class="upload-filemsg{% if (file.error) { %} upload-error{% } %}">{% if (file.error) { %}'+dotclear.jsUpload.msg.error+' {%=file.error%}{% } else { %}'+dotclear.jsUpload.msg.file_successfully_uploaded+'{% } %}</span></div><div class="upload-progress">{% if (!file.error) { %}<div class="bar" style="width:100%;">100%</div>{% } %}</div></li>{% } %}');
+/*global tmpl, dotclear */
+/*exported template_download */
+'use strict';
+
+var template_download = tmpl('{% for (var i=0, file; file=o.files[i]; i++) { %}<li class="template-download fade"><div class="upload-file"><div class="upload-fileinfo"><span class="upload-filename">{%=file.name%}</span><span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span><span class="upload-filemsg{% if (file.error) { %} upload-error{% } %}">{% if (file.error) { %}' + dotclear.jsUpload.msg.error + ' {%=file.error%}{% } else { %}' + dotclear.jsUpload.msg.file_successfully_uploaded + '{% } %}</span></div><div class="upload-progress">{% if (!file.error) { %}<div class="bar" style="width:100%;">100%</div>{% } %}</div></li>{% } %}');
Index: admin/js/jsUpload/template-upload.js
===================================================================
--- admin/js/jsUpload/template-upload.js	(revision 1461)
+++ admin/js/jsUpload/template-upload.js	(revision 3706)
@@ -1,1 +1,5 @@
-var template_upload = tmpl('{% for (var i=0, file; file=o.files[i]; i++) { %}<li class="template-upload fade"><div class="upload-file"><div class="upload-fileinfo"><span class="upload-filename">{%=file.name%}</span><span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span><span class="upload-filecancel cancel">'+dotclear.jsUpload.msg.cancel+'</span>{% if (!o.files.error && !i && !o.options.autoUpload) { %}<input type="submit" class="button start"  value="'+dotclear.jsUpload.msg.send+'"/>{% } %}<span class="upload-filemsg"></span></div>{% if (!o.files.error) { %}<div class="upload-progress progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>{% } %}</li>{% } %}');
+/*global tmpl, dotclear */
+/*exported template_upload */
+'use strict';
+
+var template_upload = tmpl('{% for (var i=0, file; file=o.files[i]; i++) { %}<li class="template-upload fade"><div class="upload-file"><div class="upload-fileinfo"><span class="upload-filename">{%=file.name%}</span><span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span><span class="upload-filecancel cancel">' + dotclear.jsUpload.msg.cancel + '</span>{% if (!o.files.error && !i && !o.options.autoUpload) { %}<input type="submit" class="button start"  value="' + dotclear.jsUpload.msg.send + '"/>{% } %}<span class="upload-filemsg"></span></div>{% if (!o.files.error) { %}<div class="upload-progress progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>{% } %}</li>{% } %}');
Index: admin/js/meta-editor.js
===================================================================
--- admin/js/meta-editor.js	(revision 3449)
+++ admin/js/meta-editor.js	(revision 3706)
@@ -1,299 +1,304 @@
+/*global $, dotclear */
+'use strict';
+
 //~ metaEditor & metaEditor.prototype should go to the core.
-function metaEditor(target,meta_field,meta_type,meta_options) {
-	this.target = target;
-	this.meta_field = meta_field;
-	this.meta_type = meta_type;
-
-	// options
-	meta_options = meta_options || {};
-	this.meta_url = meta_options.meta_url || this.meta_url;
-	this.list_type = meta_options.list_type || this.list_type;
-	this.text_confirm_remove = meta_options.text_confirm_remove || this.text_confirm_remove;
-	this.text_add_meta = meta_options.text_add_meta || this.text_add_meta;
-	this.text_choose = meta_options.text_choose || this.text_choose;
-	this.text_all = meta_options.text_all || this.text_all;
-	this.text_separation = meta_options.text_separation || this.text_separation;
+function metaEditor(target, meta_field, meta_type, meta_options) {
+  this.target = target;
+  this.meta_field = meta_field;
+  this.meta_type = meta_type;
+
+  // options
+  meta_options = meta_options || {};
+  this.meta_url = meta_options.meta_url || this.meta_url;
+  this.list_type = meta_options.list_type || this.list_type;
+  this.text_confirm_remove = meta_options.text_confirm_remove || this.text_confirm_remove;
+  this.text_add_meta = meta_options.text_add_meta || this.text_add_meta;
+  this.text_choose = meta_options.text_choose || this.text_choose;
+  this.text_all = meta_options.text_all || this.text_all;
+  this.text_separation = meta_options.text_separation || this.text_separation;
+}
+
+metaEditor.prototype = {
+  meta_url: '',
+  text_confirm_remove: 'Are you sure you want to remove this %s?',
+  text_add_meta: 'Add a %s to this entry',
+  text_choose: 'Choose from list',
+  text_all: 'all',
+  text_separation: 'Separate each %s by comas',
+  list_type: 'more',
+
+  target: null,
+  meta_type: null,
+  meta_dialog: null,
+  meta_field: null,
+  submit_button: null,
+  post_id: false,
+
+  service_uri: 'services.php',
+
+  displayMeta: function(type, post_id) {
+    this.meta_type = type;
+    this.post_id = post_id;
+    this.target.empty();
+
+    this.meta_dialog = $('<input type="text" class="ib" />');
+    this.meta_dialog.attr('title', this.text_add_meta.replace(/%s/, this.meta_type));
+    this.meta_dialog.attr('id', 'post_meta_input');
+    // Meta dialog input
+    this.meta_dialog.keypress(function(evt) { // We don't want to submit form!
+      if (evt.keyCode == 13) {
+        This.addMeta(this.value);
+        return false;
+      }
+      return true;
+    });
+
+    var This = this;
+
+    this.submit_button = $('<input type="button" value="ok" class="ib meta-helper" />');
+    this.submit_button.click(function() {
+      var v = This.meta_dialog.val();
+      This.addMeta(v);
+      return false;
+    });
+
+    this.addMetaDialog();
+
+    if (this.post_id == false) {
+      this.target.append(this.meta_field);
+    }
+    this.displayMetaList();
+  },
+
+  displayMetaList: function() {
+    var li;
+    if (this.meta_list == undefined) {
+      this.meta_list = $('<ul class="metaList"></ul>');
+      this.target.prepend(this.meta_list);
+    }
+
+    if (this.post_id == false) {
+      var meta = this.splitMetaValues(this.meta_field.val());
+
+      this.meta_list.empty();
+      for (var i = 0; i < meta.length; i++) {
+        li = $('<li>' + meta[i] + '</li>');
+        var a_remove = $('<button type="button" class="metaRemove meta-helper"><img src="images/trash.png" alt="remove" /></button>');
+        a_remove.get(0).caller = this;
+        a_remove.get(0).meta_id = meta[i];
+        a_remove.click(function() {
+          this.caller.removeMeta(this.meta_id);
+          return false;
+        });
+        li.prepend('&nbsp;').prepend(a_remove);
+        this.meta_list.append(li);
+      }
+    } else {
+      var This = this;
+      var params = {
+        f: 'getMeta',
+        metaType: this.meta_type,
+        sortby: 'metaId,asc',
+        postId: this.post_id
+      };
+
+      $.get(this.service_uri, params, function(data) {
+        data = $(data);
+
+        if (data.find('rsp').attr('status') != 'ok') {
+          return;
+        }
+
+        This.meta_list.empty();
+        data.find('meta').each(function() {
+          var meta_id = $(this).text();
+          li = $('<li><a href="' + This.meta_url + $(this).attr('uri') + '">' + meta_id + '</a></li>');
+          a_remove = $('<button type="button" class="metaRemove meta-helper"><img src="images/trash.png" alt="remove" /></button>');
+          a_remove.get(0).caller = This;
+          a_remove.get(0).meta_id = meta_id;
+          a_remove.click(function() {
+            this.caller.removeMeta(this.meta_id);
+            return false;
+          });
+          li.prepend('&nbsp;').prepend(a_remove);
+          This.meta_list.append(li);
+        });
+      });
+    }
+  },
+
+  addMetaDialog: function() {
+
+    if (this.submit_button == null) {
+      this.target.append($('<p></p>').append(this.meta_dialog));
+    } else {
+      this.target.append($('<p></p>').append(this.meta_dialog).append(' ').append(this.submit_button));
+    }
+
+    if (this.text_separation != '') {
+      this.target.append($('<p></p>').addClass('form-note').append(this.text_separation.replace(/%s/, this.meta_type)));
+    }
+
+    this.showMetaList(this.list_type, this.target);
+
+  },
+
+  showMetaList: function(list_type, target) {
+    var params = {
+      f: 'getMeta',
+      metaType: this.meta_type,
+      sortby: 'metaId,asc'
+    };
+
+    if (list_type == 'more') {
+      params.limit = '30';
+    }
+
+    var This = this;
+
+    $.get(this.service_uri, params, function(data) {
+
+      var pl = $('<p class="addMeta"></p>');
+
+      $(target).find('.addMeta').remove();
+
+      if ($(data).find('meta').length > 0) {
+        pl.empty();
+        var meta_link;
+
+        $(data).find('meta').each(function(i) {
+          meta_link = $('<button type="button" class="metaItem meta-helper">' + $(this).text() + '</button>');
+          meta_link.get(0).meta_id = $(this).text();
+          meta_link.click(function() {
+            var v = This.splitMetaValues(This.meta_dialog.val() + ',' + this.meta_id);
+            This.meta_dialog.val(v.join(','));
+            return false;
+          });
+
+          if (i > 0) {
+            pl.append(', ');
+          }
+          pl.append(meta_link);
+        });
+
+        if (list_type == 'more') {
+          var a_more = $('<button type="button" class="button metaGetMore meta-helper"></button>');
+          a_more.append(This.text_all + String.fromCharCode(160) + String.fromCharCode(187));
+          a_more.click(function() {
+            This.showMetaList('more-all', target);
+            return false;
+          });
+          pl.append(', ').append(a_more);
+        }
+
+        if (list_type != 'more-all') {
+          pl.addClass('hide');
+
+          var pa = $('<p></p>');
+          target.append(pa);
+
+          var a = $('<button type="button" class="button metaGetList meta-helper">' + This.text_choose + '</button>');
+          a.click(function() {
+            $(this).parent().next().removeClass('hide');
+            $(this).remove();
+            return false;
+          });
+
+          pa.append(a);
+        }
+
+        target.append(pl);
+
+      } else {
+        pl.empty();
+      }
+    });
+  },
+
+  addMeta: function(str) {
+    str = this.splitMetaValues(str).join(',');
+    if (this.post_id == false) {
+      str = this.splitMetaValues(this.meta_field.val() + ',' + str);
+      this.meta_field.val(str);
+
+      this.meta_dialog.val('');
+      this.displayMetaList();
+    } else {
+      var params = {
+        xd_check: dotclear.nonce,
+        f: 'setPostMeta',
+        postId: this.post_id,
+        metaType: this.meta_type,
+        meta: str
+      };
+
+      var This = this;
+      $.post(this.service_uri, params, function(data) {
+        if ($(data).find('rsp').attr('status') == 'ok') {
+          This.meta_dialog.val('');
+          This.displayMetaList();
+        } else {
+          window.alert($(data).find('message').text());
+        }
+      });
+    }
+  },
+
+  removeMeta: function(meta_id) {
+    if (this.post_id == false) {
+      var meta = this.splitMetaValues(this.meta_field.val());
+      for (var i = 0; i < meta.length; i++) {
+        if (meta[i] == meta_id) {
+          meta.splice(i, 1);
+          break;
+        }
+      }
+      this.meta_field.val(meta.join(','));
+      this.displayMetaList();
+    } else {
+      var text_confirm_msg = this.text_confirm_remove.replace(/%s/, this.meta_type);
+
+      if (window.confirm(text_confirm_msg)) {
+        var This = this;
+        var params = {
+          xd_check: dotclear.nonce,
+          f: 'delMeta',
+          postId: this.post_id,
+          metaId: meta_id,
+          metaType: this.meta_type
+        };
+
+        $.post(this.service_uri, params, function(data) {
+          if ($(data).find('rsp').attr('status') == 'ok') {
+            This.displayMetaList();
+          } else {
+            window.alert($(data).find('message').text());
+          }
+        });
+      }
+    }
+  },
+
+  splitMetaValues: function(str) {
+    function inArray(needle, stack) {
+      for (var i = 0; i < stack.length; i++) {
+        if (stack[i] == needle) {
+          return true;
+        }
+      }
+      return false;
+    }
+
+    var res = [];
+    var v = str.split(',');
+    v.sort();
+    for (var i = 0; i < v.length; i++) {
+      v[i] = v[i].replace(/^\s*/, '').replace(/\s*$/, '');
+      if (v[i] != '' && !inArray(v[i], res)) {
+        res.push(v[i]);
+      }
+    }
+    res.sort();
+    return res;
+  }
 };
-
-metaEditor.prototype = {
-	meta_url: '',
-	text_confirm_remove: 'Are you sure you want to remove this %s?',
-	text_add_meta: 'Add a %s to this entry',
-	text_choose: 'Choose from list',
-	text_all: 'all',
-	text_separation: 'Separate each %s by comas',
-	list_type: 'more',
-
-	target: null,
-	meta_type: null,
-	meta_dialog: null,
-	meta_field: null,
-	submit_button: null,
-	post_id: false,
-
-	service_uri: 'services.php',
-
-	displayMeta: function(type,post_id) {
-		this.meta_type = type;
-		this.post_id = post_id;
-		this.target.empty();
-
-		this.meta_dialog = $('<input type="text" class="ib" />');
-		this.meta_dialog.attr('title',this.text_add_meta.replace(/%s/,this.meta_type));
-		this.meta_dialog.attr('id','post_meta_input');
-		// Meta dialog input
-		this.meta_dialog.keypress(function(evt) { // We don't want to submit form!
-			if (evt.keyCode == 13) {
-				This.addMeta(this.value);
-				return false;
-			}
-			return true;
-		});
-
-		var This = this;
-
-		this.submit_button = $('<input type="button" value="ok" class="ib meta-helper" />');
-		this.submit_button.click(function() {
-			var v = This.meta_dialog.val();
-			This.addMeta(v);
-			return false;
-		});
-
-		this.addMetaDialog();
-
-		if (this.post_id == false) {
-			this.target.append(this.meta_field);
-		}
-		this.displayMetaList();
-	},
-
-	displayMetaList: function() {
-		var li;
-		if (this.meta_list == undefined) {
-			this.meta_list = $('<ul class="metaList"></ul>');
-			this.target.prepend(this.meta_list);
-		}
-
-		if (this.post_id == false) {
-			var meta = this.splitMetaValues(this.meta_field.val());
-
-			this.meta_list.empty();
-			for (var i=0; i < meta.length; i++) {
-				li = $('<li>'+meta[i]+'</li>');
-				a_remove = $('<button type="button" class="metaRemove meta-helper"><img src="images/trash.png" alt="remove" /></button>');
-				a_remove.get(0).caller = this;
-				a_remove.get(0).meta_id = meta[i];
-				a_remove.click(function() {
-					this.caller.removeMeta(this.meta_id);
-					return false;
-				});
-				li.prepend('&nbsp;').prepend(a_remove);
-				this.meta_list.append(li);
-			}
-		} else {
-			var This = this;
-			var params = {
-				f: 'getMeta',
-				metaType: this.meta_type,
-				sortby: 'metaId,asc',
-				postId: this.post_id
-			};
-
-			$.get(this.service_uri,params,function(data) {
-				data = $(data);
-
-				if (data.find('rsp').attr('status') != 'ok') { return; }
-
-				This.meta_list.empty();
-				data.find('meta').each(function() {
-					var meta_id = $(this).text();
-					li = $('<li><a href="' + This.meta_url + $(this).attr('uri') + '">'+meta_id+'</a></li>');
-					a_remove = $('<button type="button" class="metaRemove meta-helper"><img src="images/trash.png" alt="remove" /></button>');
-					a_remove.get(0).caller = This;
-					a_remove.get(0).meta_id = meta_id;
-					a_remove.click(function() {
-						this.caller.removeMeta(this.meta_id);
-						return false;
-					});
-					li.prepend('&nbsp;').prepend(a_remove);
-					This.meta_list.append(li);
-				});
-			});
-		}
-	},
-
-	addMetaDialog: function() {
-
-		if (this.submit_button == null) {
-			this.target.append($('<p></p>').append(this.meta_dialog));
-		} else {
-			this.target.append($('<p></p>').append(this.meta_dialog).append(' ').append(this.submit_button));
-		}
-
-		if (this.text_separation != '') {
-			this.target.append($('<p></p>').addClass('form-note').append(this.text_separation.replace(/%s/,this.meta_type)));
-		}
-
-		this.showMetaList(this.list_type,this.target);
-
-	},
-
-	showMetaList: function(list_type,target) {
-		var params = {
-			f: 'getMeta',
-			metaType: this.meta_type,
-			sortby: 'metaId,asc'
-		};
-
-		if (list_type == 'more') {
-			params.limit = '30';
-		}
-
-		var This = this;
-
-		$.get(this.service_uri,params,function(data) {
-
-			var pl = $('<p class="addMeta"></p>');
-
-			$(target).find('.addMeta').remove();
-
-			if ($(data).find('meta').length > 0) {
-				pl.empty();
-				var meta_link;
-
-				$(data).find('meta').each(function(i) {
-					meta_link = $('<button type="button" class="metaItem meta-helper">' + $(this).text() + '</button>');
-					meta_link.get(0).meta_id = $(this).text();
-					meta_link.click(function() {
-						var v = This.splitMetaValues(This.meta_dialog.val() + ',' + this.meta_id);
-						This.meta_dialog.val(v.join(','));
-						return false;
-					});
-
-					if (i>0) {
-						pl.append(', ');
-					}
-					pl.append(meta_link);
-				});
-
-				if (list_type == 'more') {
-					var a_more = $('<button type="button" class="button metaGetMore meta-helper"></button>');
-					a_more.append(This.text_all + String.fromCharCode(160)+String.fromCharCode(187));
-					a_more.click(function() {
-						This.showMetaList('more-all',target);
-						return false;
-					});
-					pl.append(', ').append(a_more);
-				}
-
-				if (list_type != 'more-all') {
-					pl.addClass('hide');
-
-					var pa = $('<p></p>');
-					target.append(pa);
-
-					var a = $('<button type="button" class="button metaGetList meta-helper">' + This.text_choose + '</button>');
-					a.click(function() {
-						$(this).parent().next().removeClass('hide');
-						$(this).remove();
-						return false;
-					});
-
-					pa.append(a);
-				}
-
-				target.append(pl);
-
-			} else {
-				pl.empty();
-			}
-		});
-	},
-
-	addMeta: function(str) {
-		str = this.splitMetaValues(str).join(',');
-		if (this.post_id == false) {
-			str = this.splitMetaValues(this.meta_field.val() + ',' + str);
-			this.meta_field.val(str);
-
-			this.meta_dialog.val('');
-			this.displayMetaList();
-		} else {
-			var params = {
-				xd_check: dotclear.nonce,
-				f: 'setPostMeta',
-				postId: this.post_id,
-				metaType: this.meta_type,
-				meta: str
-			};
-
-			var This = this;
-			$.post(this.service_uri,params,function(data) {
-				if ($(data).find('rsp').attr('status') == 'ok') {
-					This.meta_dialog.val('');
-					This.displayMetaList();
-				} else {
-					alert($(data).find('message').text());
-				}
-			});
-		}
-	},
-
-	removeMeta: function(meta_id) {
-		if (this.post_id == false) {
-			var meta = this.splitMetaValues(this.meta_field.val());
-			for (var i=0; i<meta.length; i++) {
-				if (meta[i] == meta_id) {
-					meta.splice(i,1);
-					break;
-				}
-			}
-			this.meta_field.val(meta.join(','));
-			this.displayMetaList();
-		} else {
-			var text_confirm_msg = this.text_confirm_remove.replace(/%s/,this.meta_type);
-
-			if (window.confirm(text_confirm_msg)) {
-				var This = this;
-				var params = {
-					xd_check: dotclear.nonce,
-					f: 'delMeta',
-					postId: this.post_id,
-					metaId: meta_id,
-					metaType: this.meta_type
-				};
-
-				$.post(this.service_uri,params,function(data) {
-					if ($(data).find('rsp').attr('status') == 'ok') {
-						This.displayMetaList();
-					} else {
-						alert($(data).find('message').text());
-					}
-				});
-			}
-		}
-	},
-
-	splitMetaValues: function(str) {
-		function inArray(needle,stack) {
-			for (var i=0; i<stack.length; i++) {
-				if (stack[i] == needle) {
-					return true;
-				}
-			}
-			return false;
-		}
-
-		var res = new Array();
-		var v = str.split(',');
-		v.sort();
-		for (var i=0; i<v.length; i++) {
-			v[i] = v[i].replace(/^\s*/,'').replace(/\s*$/,'');
-			if (v[i] != '' && !inArray(v[i],res)) {
-				res.push(v[i]);
-			}
-		}
-		res.sort();
-		return res;
-	}
-};
Index: admin/js/prelude.js
===================================================================
--- admin/js/prelude.js	(revision 2566)
+++ admin/js/prelude.js	(revision 3706)
@@ -1,15 +1,18 @@
+/*global $ */
+'use strict';
+
 $(function() {
-	if ($('#prelude').length > 0) {
-		$('#prelude a')
-			.addClass('hidden')
-			.focus(function() {
-				$('#prelude a').removeClass('hidden');
-				$('#wrapper, #help-button, #collapser').addClass('with-prelude');
-			});
+  if ($('#prelude').length > 0) {
+    $('#prelude a')
+      .addClass('hidden')
+      .focus(function() {
+        $('#prelude a').removeClass('hidden');
+        $('#wrapper, #help-button, #collapser').addClass('with-prelude');
+      });
 
-		$('body').on('click', '#prelude a[href="#help"]', function(e) {
-			e.preventDefault();
-			$('#help-button a').focus();
-		});
-	}
+    $('body').on('click', '#prelude a[href="#help"]', function(e) {
+      e.preventDefault();
+      $('#help-button a').focus();
+    });
+  }
 });
