/*!
 * jQuery Notify Plugin
 *
 * Copyright (c) 2012-2014 David Persson
 *
 * Licensed under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 */
(function($) {

  // Global configuration.
  var config = {
    // Selector of the container in which messages will be added.
    container: '#messages',

    // HTML Element used for messages.
    element: '<div class="message hide"></div>',

    // Number of maximum pending messages, all other messages
    // will be discarded to prevent flooding.
    maxPending: 2,

    // Base timeout until a message will be removed after it's shown.
    timeout: 2100
  };

  // Our own personal queue.
  var queue = $({});

  // Show/hide function used when a message should dis-/appear; must return
  // a promise which should be resolved when i.e. the show animation
  // finished.
  var toggle = function($m) {
    var dfr = new $.Deferred();

    // Determines if CSS transitions should/can be used.
    if (typeof Modernizr !== 'undefined' && Modernizr.csstransitions) {
      $m.one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', dfr.resolve);
    } else {
      dfr.resolve();
    }
    $m.toggleClass('hide');

    return dfr.promise();
  };

  // Renders a message and calls complete callback after doing that.
  var render = function(html, options, complete) {
    var $m = $(config.element).html(html);

    if (options.level) {
      $m.addClass(level);
    }
    if (options.sticky) {
      $m.addClass('sticky');
    }
    $(config.container).append($m);

    if (options.sticky) {
      $m.click(function(ev) {
        toggle($m).done(function() {
          $m.remove();
          complete();
        });
      });
      return; // Do not continue and probably show next message.
    }

    // Multiply the timeout for complex messages, giving comprehension time.
    // Give 1s per 30 chars over the first 25 chars.
    options.timeout += 1000 * (($($.parseHTML(html)).text().length - 25) / 30);

    // Workaround to enable CSS transitions on dynamically inserted elements.
    // Reading random property to force recalculating styles. Has no effect
    // when transitions aren't used.
    $m.css('top');

    toggle($m).done(function() {
      setTimeout(function() {
        toggle($m).done(function() {
          $m.remove();
          complete(); // Show next message in queue.
        });
      }, options.timeout);
    });
  };

  // Main plugin function. Allows for adding a notification and
  // configuring the plugin globally.
  $.notify = function(html, options) {
    // Allow setting global configuration for this plugin.
    if (typeof html === 'object') {
      config = $.extend(html, config);
      return;
    }
    options = $.extend(options || {}, {
      level: null,
      sticky: false,
      timeout: config.timeout
    });

    // Prevent flooding; no more than 2 pending messages. We start at
    // zero as this is called before the first item is queued.
    if (queue.queue().length >= config.maxPending) {
      return;
    }
    // Currently only one message at the time. Allowing showing multiple
    // message here will might need a more sophisticated method of managment.
    queue.queue(function(next) {
      render(html, options, next);
    });
  };

})(jQuery);

@@ -326,13 +326,8 @@
   //
- HTML
  Ele
@@ -340,24 +340,25 @@
 sed for 
+a 
 message
-s
 .%0A    el
@@ -683,542 +683,788 @@
  // 
-Show/hide function used when a message should dis-/appear; must return%0A  // a promise which should be resolved when i.e. the show animation%0A  // finished.%0A  var toggle = function($m) %7B%0A    var dfr = new $.Deferred(
+Main plugin function. Allows for adding a notification and%0A  // configuring the plugin globally.%0A  $.notify = function(html, options) %7B%0A    if (typeof html === 'object') %7B%0A      config = $.extend(html, config
 );%0A
-%0A
     
-// Determines if CSS transitions should/can be used.%0A    if (typeof Modernizr !== 'undefined' && Modernizr.csstransitions) %7B%0A      $m.one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', dfr.resolve);%0A    %7D else %7B%0A      dfr.
+  return;%0A    %7D%0A    options = $.extend(options %7C%7C %7B%7D, %7B%0A      level: null,%0A      sticky: false,%0A      timeout: config.timeout%0A    %7D);%0A%0A    // Prevent flooding; no more than 2 pending messages. We start at%0A    // zero as this is called before the first item is queued.%0A    if (queue.queue().length %3E= config.maxPending) %7B%0A      return;%0A    %7D%0A    // Currently only one message at the time. Allowing showing multiple%0A    // message here will might need a mo
 re
+ 
 so
-lve();%0A    %7D%0A    $m.toggleClass('hide');%0A%0A    return dfr.promise(
+phisticated method of managment.%0A    queue.queue(function(next) %7B%0A      render(html, options, next);%0A    %7D
 );%0A 
@@ -1542,21 +1542,8 @@
 t.%0A 
- var render =
  fun
@@ -1539,32 +1539,39 @@
 that.%0A  function
+ render
 (html, options, 
@@ -2665,862 +2665,549 @@
 %0A  %7D
-;
 %0A%0A  // 
-Main plugin function. Allows for adding a notification and%0A  // configuring the plugin globally.%0A  $.notify = function(html, options) %7B%0A 
+Show/hide function used when a message should dis-/appear; must return%0A  // a promise which should be resolved when i.e. the show animation%0A
   
- 
 // 
-Allow setting global configuration for this plugin.%0A    if (typeof html === 'object') %7B%0A      config = $.extend(html, config
+finished.%0A  function toggle($m) %7B%0A    var dfr = new $.Deferred(
 );%0A
+%0A
     
-  return;%0A    %7D%0A    options = $.extend(options %7C%7C %7B%7D, %7B%0A      level: null,%0A      sticky: false,%0A      timeout: config.timeout%0A    %7D);%0A%0A    // Prevent flooding; no more than 2 pending messages. We start at%0A    // zero as this is called before the first item is queued.%0A    if (queue.queue().length %3E= config.maxPending) %7B%0A      return;%0A    %7D%0A    // Currently only one message at the time. Allowing showing multiple%0A    // message here will might need a mo
+// Determines if CSS transitions should/can be used.%0A    if (typeof Modernizr !== 'undefined' && Modernizr.csstransitions) %7B%0A      $m.one('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', dfr.resolve);%0A    %7D else %7B%0A      dfr.
 re
- 
 so
-phisticated method of managment.%0A    queue.queue(function(next) %7B%0A      render(html, options, next);%0A    %7D);%0A  %7D;
+lve();%0A    %7D%0A    $m.toggleClass('hide');%0A%0A    return dfr.promise();%0A  %7D
 %0A%0A%7D)

Move functions around.