<NME> jquery.htmltable.js
<BEF> (function($) {
    var HtmlTable = function(element, options) {
        this.initialize(element, options);
    };

    HtmlTable.prototype = {
        constructor: HtmlTable,

        initialize: function(element, options) {
            this.$element = $(element);
            this.options = $.extend({}, $.fn.htmltable.defaults, options);
            this.shift_pressed = false;
            this.last_selection = null;
            this.prev_dir = null;
            this.listen();
            this.$element.css({
                "-moz-user-select": "-moz-none",
                "-khtml-user-select": "none",
                "-webkit-user-select": "none",
                "-ms-user-select": "none",
                "user-select": "none"
            });
            this.$element.attr("unselectable", "on");
        },


        listen: function() {
            $(document)
                .off("click", "tbody>tr")
                .on("click", "tbody>tr",
                    $.proxy(this.toggle_select, this));
            $(document).on("keydown", "body", $.proxy(this.keydown, this));
            $(document).on("keyup", "body", $.proxy(this.keyup, this));

        /**
        _toggle_select: function($tr) {
            this.last_selection = $tr;
            if ($tr.hasClass(this.options.tr_selected_class)) {
                $tr.removeClass(this.options.tr_selected_class);
                if (this.options.tr_unselected_event != undefined) {
                    this.options.tr_unselected_event($tr);
                }
            } else {
                $tr.addClass(this.options.tr_selected_class);
                if (this.options.tr_selected_event != undefined) {
                    this.options.tr_selected_event($tr);
                $row.addClass(this.options.row_selected_class);
                if (this.options.row_selected_event !== undefined) {
        },

        toggle_select: function(e) {
            e.preventDefault();
            var $tr = $(e.target).parent();

            if (this.shift_pressed && this.last_selection) {
                var itfunc = ($tr.index() >= this.last_selection.index())
                    ? "next" : "prev";
                var $curtr = null;
		return; 
	    $input.prop('checked', selected);
	    if (selected) {
		$row.addClass(this.options.row_selected_class);
                if (this.options.row_unselected_event !== undefined) {
                    this.options.row_unselected_event($row);
		}
	    } else {
		$row.removeClass(this.options.row_selected_class);
                if (this.options.row_selected_event !== undefined) {
                    this.options.row_selected_event($row);
                }
                this.prev_dir = itfunc;
                return;
            }
            this._toggle_select($tr);
        },
         * select all rows between those two locations.
         *
         * Holding the ctrl key between two selections let users make
         * an additive selection.
         */
        toggle_select: function(e) {
            var $row = $(e.target).parents(this.options.row_selector);

            if (this.shift_pressed && this.last_selection) {
		var select = !this.is_selected($row);
         * Cancel the current selection
         */
        clear_selection: function() {
            this.current_selection().removeClass(this.options.tr_selected_class);
        },

        /*
                        break;
         */
        select_row: function($row) {
            $row.addClass(this.options.tr_selected_class);
        },

        keydown: function(e) {
            }
            this.last_selection = $row;
                e.preventDefault();
                this.shift_pressed = true;
                break;
            }
        },


        /**
         * Return the current selection. (jQuery object)
                e.preventDefault();
                this.shift_pressed = false;
                break;
            }
        }
    };
            this.last_selection = null;
            this.current_selection().removeClass(this.options.row_selected_class);
            this.$element.find(this.options.input_selector).prop('checked', false);
            if (this.options.row_unselected_event !== undefined) {
                this.options.row_unselected_event();
            }
        },

        /**
         * Manually select a row.
         */
        select_row: function($row) {
            if (!this.last_selection) {
                this.last_selection = $row;
            }
            $row.addClass(this.options.row_selected_class);
            if (this.options.row_selected_event !== undefined) {
                this.options.row_selected_event($row);
            }
        },

        keydown: function(e) {
            switch (e.which) {
            case 16:
                e.preventDefault();
                this.shift_pressed = true;
                break;
            case 17:
                this.ctrl_pressed = true;
                break;
            }
        },

        keyup: function(e) {
            switch (e.which) {
            case 16:
                e.preventDefault();
                this.shift_pressed = false;
                break;
            case 17:
                this.ctrl_pressed = false;
                break;
            }
        }
    };

    $.fn.htmltable = function(method) {
        var args = arguments;

        return this.each(function() {
            var $this = $(this),
                data = $this.data('htmltable'),
                options = typeof method === "object" && method;

            if (!data) {
                $this.data('htmltable', new HtmlTable(this, options));
                data = $this.data('htmltable');
            }
            if (typeof method === "string") {
                data[method].apply(data, Array.prototype.slice.call(args, 1));
            }
        });
    };

    $.fn.htmltable.defaults = {
        row_selector: 'tr',
        input_selector: "input[type=checkbox]",
        row_selected_class: 'tr-selected',
        keep_selection: false
    };
})(jQuery);

<MSG> Changing the way multiple selection works.

* Applies to quarantine and webmail
* Messages are opened on a 'click' event now

see #303
see #321
see #322
see #325

<DFF> @@ -10,6 +10,7 @@
             this.$element = $(element);
             this.options = $.extend({}, $.fn.htmltable.defaults, options);
             this.shift_pressed = false;
+            this.ctrl_pressed = false;
             this.last_selection = null;
             this.prev_dir = null;
             this.listen();
@@ -26,8 +27,8 @@
 
         listen: function() {
             $(document)
-                .off("click", "tbody>tr")
-                .on("click", "tbody>tr",
+                .off("change", "tbody input[type=checkbox]")
+                .on("change", "tbody input[type=checkbox]",
                     $.proxy(this.toggle_select, this));
             $(document).on("keydown", "body", $.proxy(this.keydown, this));
             $(document).on("keyup", "body", $.proxy(this.keyup, this));
@@ -36,11 +37,13 @@
         _toggle_select: function($tr) {
             this.last_selection = $tr;
             if ($tr.hasClass(this.options.tr_selected_class)) {
+                $tr.children('td[name=selection]').children('input').prop('checked', false);
                 $tr.removeClass(this.options.tr_selected_class);
                 if (this.options.tr_unselected_event != undefined) {
                     this.options.tr_unselected_event($tr);
                 }
             } else {
+                $tr.children('td[name=selection]').children('input').prop('checked', true);
                 $tr.addClass(this.options.tr_selected_class);
                 if (this.options.tr_selected_event != undefined) {
                     this.options.tr_selected_event($tr);
@@ -49,10 +52,13 @@
         },
 
         toggle_select: function(e) {
-            e.preventDefault();
-            var $tr = $(e.target).parent();
+            var $tr = $(e.target).parents('tr');
 
             if (this.shift_pressed && this.last_selection) {
+                if ($tr.is(this.last_selection)) {
+                    $tr.children('td[name=selection]').children('input').prop('checked', true);
+                    return;
+                }
                 var itfunc = ($tr.index() >= this.last_selection.index())
                     ? "next" : "prev";
                 var $curtr = null;
@@ -70,6 +76,8 @@
                 }
                 this.prev_dir = itfunc;
                 return;
+            } else if (!this.ctrl_pressed && (!this.last_selection || !this.last_selection.is($tr))) {
+                this.clear_selection();
             }
             this._toggle_select($tr);
         },
@@ -86,7 +94,9 @@
          * Cancel the current selection
          */
         clear_selection: function() {
+            this.last_selection = null;
             this.current_selection().removeClass(this.options.tr_selected_class);
+            $("tbody input[type=checkbox]").prop('checked', false);
         },
 
         /*
@@ -94,6 +104,7 @@
          */
         select_row: function($row) {
             $row.addClass(this.options.tr_selected_class);
+
         },
 
         keydown: function(e) {
@@ -102,6 +113,9 @@
                 e.preventDefault();
                 this.shift_pressed = true;
                 break;
+            case 17:
+                this.ctrl_pressed = true;
+                break;
             }
         },
 
@@ -111,6 +125,9 @@
                 e.preventDefault();
                 this.shift_pressed = false;
                 break;
+            case 17:
+                this.ctrl_pressed = false;
+                break;
             }
         }
     };

Changing the way multiple selection works.