       # remove event
       successArgs.shift()
     # arrange arguments
-    if $.isString successArgs[0]
+    if _.isString successArgs[0]
       # from jQuery.ajax().success()
       [data, _textStatus, jqXHR] = successArgs
     else
-      #from. jQuery.ajaxSuccess()
+      # from jQuery.ajaxSuccess()
       [jqXHR, _ajaxSettings, data] = successArgs
     # prevent recall
     return false  if jqXHR.breakFlash
     jqXHR.breakFlash = true
     # detect notice
-    if $.isString data
+    if _.isString data
       # catch plain text message
       data = $.trim data
       return @notice data  if data.length <= @settings.detectPlainTextMaxLength and not $.isHTML data

   * updateSettings  .ultimateFlash({Object} options)                       ~ {Object} settings
   * auto            .ultimateFlash('auto', {ArrayOrObject} obj)            ~ {Array} ajFlashes | {Boolean} false
   * ajaxSuccess     .ultimateFlash('ajaxSuccess'[, Arguments successArgs = []])
   * ajaxError       .ultimateFlash('ajaxError'[, String text = settings.defaultErrorText][, Arguments errorArgs = []])
  ###
  $.fn.ultimateFlash = ->
    return @  unless @length
    jContainer = @eq 0
    widget = jContainer.data UltimateFlashWidget.defaults.constants.widgetDataKey
    argsLength = arguments.length
    _returnWidget = argsLength && arguments[argsLength - 1] == true
    if widget and widget.jContainer[0] == jContainer[0]
      a = args arguments
      if argsLength and typeof a[0] == 'string'
        command = a.shift()
      else
        return widget  if _returnWidget
        return jContainer  unless argsLength
        command = 'updateSettings'
      if $.isFunction widget[command]
        return widget[command].apply widget, a
      else
        $.error "Command [#{command}] does not exist on jQuery.ultimateFlash()"
    else
      options = if argsLength then arguments[0] else {}
      widget = new UltimateFlashWidget jContainer, options
      jContainer.data UltimateFlashWidget.defaults.constants.widgetDataKey, widget
    if _returnWidget then widget else jContainer

)( jQuery )

      regExpLastWordWithoutDot: /[\wа-яёА-ЯЁ]{3,}$/
      regExpLastWordWithDot: /([\wа-яёА-ЯЁ]{3,})\.$/
      locale: 'en'
      translations: {}

  jContainer: null
  settings: {}

  constructor: (@jContainer, options = {}) ->
    # if global compatible I18n
    if I18n? and I18n.locale and I18n.t
      # can set locale
      options['locale'] ||= I18n.locale
      # try read localized strings
      if _localesFromI18n = I18n.t 'ultimate_flash'
        # pointing to default UF locales of language specified in I18n
        _defaultLocales = @constructor.defaults.locales[I18n.locale]
        # fill it from I18n
        for key, value of _localesFromI18n
          _defaultLocales[_.camelize key] = value
    _locale = options['locale'] or @constructor.defaults.options['locale']
    $.error "Locale [#{_locale}] not exists in UltimateFlash default locales."  unless @constructor.defaults.locales[_locale]
    @settings = $.extend true, {}, @constructor.defaults.options, translations: @constructor.defaults.locales[_locale], options
    @jContainer.data @constructor.defaults.constants.widgetDataKey, @
    _self = @
    # delegate event for hide on click
    @jContainer.on 'click.ultimate_flash_close', '.flash:not(:animated)', (event) =>
      if @settings.hideOnClick
        @_hide $ event.currentTarget
        false
    # init flashes from server
    @jFlashes().each (index, flash) =>
      jFlash = $ flash
      jFlash.html @_prepareText jFlash.html()
      @_setTimeout jFlash
    # binding hook ajaxError handler
    @jContainer.ajaxError =>
      @ajaxError arguments  if @settings.showAjaxErrors
