2.3.1 • Published 1 year ago

@regru/jquery-multifile v2.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

#jQuery Multiple File Upload

##Fixes

  • adds Multifile.block object for main block carry
  • adds Multifile.errors object for errors, contains DOM
  • multiple="multiple" attribute fix (disappear on input original change)
  • BEM classes naming
  • restore default .submit() event handler for forms
  • .disableEmpty() strongly changed
  • adds .reset() method to Multifile object
  • adds russian language for basic messages
  • adds showError/removeError methods

##Options

multifileName: 'b-file'     // Custom DOM elements name prefix
                            // also className for entire plugin DOM-block

DOM will be:

b-file
  b-file__list
    b-file__list-item
    b-file__list-item
  b-file__wrap
wrapper: '.className' // specify wrapper className instead of generating DOM
lang: 'en' || 'ru'  // messages language

// and extend it with your own
STRING: {
    ru: {
        remove: 'x',
        denied: 'Нельзя выбрать $ext файл.',
        file: '$file',
        selected: 'Файл выбран: $file',
        duplicate: 'Этот файл уже выбран:\n$file',
        toomuch: 'Общий размер файлов выше допустимого ($size)',
        toolittle: 'Слишком маленький размер файлов ($size)',
        toomany: 'Максимальное кол-во файлов: $max',
        toofew: 'Минимальное кол-во файлов: $max',
        toobig: 'Превышен размер файла ($size)',
        toosmall: 'Слишком маленький размер файла ($size)'
    }
}
showErrors: true // append errors in html, false - calls 'error' function