0.9.0 • Published 10 years ago

file-loader-x v0.9.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

file-loader-x

NPM version Clean Code Dependency Status devDependency Status License

A component that load files. ( Currently only support image loading. The js files are in es6 syntax.)

( If you are reading this page on npmjs.org, I recommend you read it on Github file-loader-x, because on Github it is more readable.)

Browser support

Desktop browsers support : Chrome, Safari, Firefox, Opera, IE10+

Installation

    jspm install npm:file-loader-x

Dependencies

Usage

    var FileLoader = require('FileLoader');

    this._imgLoader = new FileLoader(document.querySelector('#img-loader-wrapper'));
    this._imgLoader.setType('image/*')
                   .events.bind('load', this._imgLoaded.bind(this));

    /**
    * `load` event listener will get noticed when a file is successfully 
    * loaded.
    * 
    * @param FileLoader {FileLoader}
    */
    _imgLoaded: function (FileLoader, image) {
        // Now you have the image.
    }
    
  • Public interface in this component.
    constructor: FileLoader


    /**
     * Destroy the instance.
     * @return <em>undefined</em>
     */
    destroy: function ()


    /**
    * @param classNames {String}
    * @returns {FileLoader} A pointer to this instance, allowing call chaining.
    */
    setCssClass: function (classNames)


    /**
    * Set upload file type.
    *
    * @param type {String}
    * @returns {FileLoader} A pointer to this instance, allowing call chaining.
    */
    setType: function (type)
0.9.0

10 years ago

0.8.9

10 years ago

0.8.8

10 years ago

0.8.7

10 years ago

0.8.6

10 years ago

0.8.5

10 years ago

0.8.4

10 years ago

0.8.3

10 years ago

0.8.2

10 years ago

0.8.1

10 years ago

0.8.0

10 years ago