browser_extension/js/main.js
/** Adds a message element to the messages and scrolls to the bottom
         *  @param el - The element to add as a message
         *  @param options.fade - If the element should fade-in (default = true)
         *  @param options.prepend - If the element should prepend
         *   all other messages (default = false)
         */
Adds a message element to the messages and scrolls to the bottom
@param el - The element to add as a message
@param options.fade - If the element should fade-in (default = true)
@param options.prepend - If the element should prepend
all other messages (default = false)
Adds a message element to the messages and scrolls to the bottom @param el - The element to add as a message @param options . fade - If the element should fade - in ( default = true ) @param options . prepend - If the element should prepend all other messages ( default = false )
function addMessageElement(el, options) {
          var $el = $(el);
          if (!options) {
            options = {};
          }
          if (typeof options.fade === 'undefined') {
            options.fade = true;
          }
          if (typeof options.prepend === 'undefined') {
            options.prepend = false;
          }
          if (options.fade) {
            $el.hide().fadeIn(FADE_TIME);
          }
          if (options.prepend) {
            $messages.prepend($el);
          } else {
            $messages.append($el);
          }
          $messages[0].scrollTop = $messages[0].scrollHeight;
        }
function addMessageElement ( el , options ) { var $el = $ ( el ) ; if ( ! options ) { options = { } ; } if ( typeof options . fade === 'undefined' ) { options . fade = true ; } if ( typeof options . prepend === 'undefined' ) { options . prepend = false ; } if ( options . fade ) { $el . hide ( ) . fadeIn ( FADE_TIME ) ; } if ( options . prepend ) { $messages . prepend ( $el ) ; } else { $messages . append ( $el ) ; } $messages [ 0 ] . scrollTop = $messages [ 0 ] . scrollHeight ; }
Adds a message element to the messages and scrolls to the bottom
  @param el - The element to add as a message
  @param options.fade - If the element should fade-in (default = true)
  @param options.prepend - If the element should prepend
   all other messages (default = false)
Adds a message element to the messages and scrolls to the bottom @param el - The element to add as a message @param options . fade - If the element should fade - in ( default = true ) @param options . prepend - If the element should prepend all other messages ( default = false )
// Setup default options // Apply options