Skip to content

Releases: danielm/uploader

v1.0.2

16 Jan 18:38
Compare
Choose a tag to compare

Make sure you read README.md for more details about each change. There is a ALOT

  • The big change on this version is that now we have different modes.

    • Depending on the new options: auto and queue is how the plugin handles the uploads.
    • Uploads may or may not start automatically depending on those settings.
    • The plugin behaves the same way (as in previous versions) if using the default settings
    • Check the online demos to see the different modes: https://danielmg.org/demo/java-script/uploader
  • Plugin API

    After initialization now we have a few public Methods to interact with the plugin.

    • start
    • cancel
    • reset
    • destroy

See methods section for details on each.

  • New options

    • auto, queue, dnd, hookDocument, multiple, headers
  • Options changed

    • fieldName Renamed. Previously known as fileName (was removed)
    • extFilter Now is an Array: Example ['png','jpg','gif','jpeg']
    • extraData Now it can ALSO be a function, useful for example you need dynamic values.
  • Options removed

    • fileName renamed to fileName

    • maxFiles Functionality removed.

      Users expected diferent things from it (completed uploads, or files added, or some more dynamic stuff)

      Good news is that NOW you can implement your own validation checks now on the onNewFile callback.

See options section for details

  • Callbacks changed

    • onNewFile If a return value is provided and is === false the file will be ignored by the widget.

      Use this to implement your own validators.

    • onBeforeUpload The return value is now ignored. Use onNewFile instead.

    • onUploadError New paramters xhr and status: (id, xhr, status, message)

    • onFallbackMode - Parameter message was removed

  • New callbacks

    • onUploadComplete This triggers right after onUploadSuccess or onUploadError. In both cases.
    • onUploadCanceled Triggers after a pending or uploading file is canceled (by using one of the API (README.md#methods))
    • onDragEnter
    • onDragLeave
    • onDocumentDragEnter
    • onDocumentDragLeave
  • Callbacks removed

    • onFilesMaxError Functionality removed. Check the options cheanges for the reasons behind this change.

See callbacks section for details