Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Commit

Permalink
feat(base-wrapper.js): expose entire qq namespace
Browse files Browse the repository at this point in the history
...so properties such as qq.status can be easily accessed on a wrapper uploader instance.
  • Loading branch information
Ray Nicholus committed Mar 25, 2017
1 parent 5c78b8f commit c61dd93
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 28 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@ These wrap a Fine Uploader instance as ES6 classes and provide additional featur

### Installing

If you requrie support for IE11, you'll need to install an A+/Promise spec compliant polyfill. To install this wrapper classes package, simply `npm install fine-uploader-wrappers` and see the documentation below for your specific integration instructions (based on your needs).
If you require support for IE11, you'll need to install an A+/Promise spec compliant polyfill. To install this wrapper classes package, simply `npm install fine-uploader-wrappers` and see the documentation below for your specific integration instructions (based on your needs).

### Wrapper Classes

Note: You can access the entire `qq` namespace on any uploader instance. For example, if you are using Fine Uploader S3, and want to access the `status` object, your code may look something like this:

```js
const uploader = new FineUploaderS3({ ... })
const queuedFileStatus = uploader.qq.status.QUEUED
```

#### Azure

This enables you to upload to Azure directly. Your server must provide signature and done endpoints. The Azure uploading workflow is documented on the [Azure feature page](http://docs.fineuploader.com/branch/master/features/azure.html). Some examples servers can be found in the [server-examples repository](https://github.com/FineUploader/server-examples).
Expand Down
2 changes: 1 addition & 1 deletion config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var path = require('path'),
}
}

webpackConfig.module.loaders[0].query = { plugins: ['rewire'] }
webpackConfig.module.rules[0].query = { plugins: ['rewire'] }
webpackConfig.devtool = 'inline-source-map'

module.exports = function (config) {
Expand Down
6 changes: 3 additions & 3 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ module.exports = {
src: path.resolve('src'),
test: path.resolve('src/test/unit')
},
extensions: ['', '.js']
extensions: ['.js']
},
module: {
loaders: [
rules: [
{
test: /\.js/,
loader: 'babel',
loader: 'babel-loader',
exclude: /node_modules/
}
]
Expand Down
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fine-uploader-wrappers",
"version": "0.1.1",
"version": "0.2.0",
"license": "MIT",
"description": "Fine Uploader core ES6 class wrappers that provide additional features.",
"author": {
Expand All @@ -22,28 +22,28 @@
"object-assign": "4.1.0"
},
"devDependencies": {
"babel-cli": "latest",
"babel-core": "latest",
"babel-eslint": "latest",
"babel-loader": "latest",
"babel-plugin-rewire": "latest",
"babel-preset-es2015": "latest",
"babel-plugin-syntax-class-properties": "latest",
"babel-plugin-transform-class-properties": "latest",
"babel-plugin-transform-object-rest-spread": "latest",
"es6-promise": "latest",
"eslint": "latest",
"jasmine": "latest",
"jasmine-core": "latest",
"karma": "latest",
"karma-firefox-launcher": "latest",
"karma-jasmine": "latest",
"karma-sauce-launcher": "latest",
"karma-sourcemap-loader": "latest",
"karma-spec-reporter": "latest",
"karma-webpack": "latest",
"webpack": "1.14.0",
"webpack-node-externals": "latest"
"babel-cli": "6.23.0",
"babel-core": "6.24.0",
"babel-eslint": "7.2.0",
"babel-loader": "6.4.1",
"babel-plugin-rewire": "1.0.0",
"babel-preset-es2015": "6.24.0",
"babel-plugin-syntax-class-properties": "6.13.0",
"babel-plugin-transform-class-properties": "6.23.0",
"babel-plugin-transform-object-rest-spread": "6.23.0",
"es6-promise": "4.1.0",
"eslint": "3.18.0",
"jasmine": "2.5.3",
"jasmine-core": "2.5.2",
"karma": "1.5.0",
"karma-firefox-launcher": "1.0.1",
"karma-jasmine": "1.1.0",
"karma-sauce-launcher": "1.1.0",
"karma-sourcemap-loader": "0.3.7",
"karma-spec-reporter": "0.0.30",
"karma-webpack": "2.0.3",
"webpack": "2.3.2",
"webpack-node-externals": "1.5.4"
},
"engines": {
"node": ">=5.0.0"
Expand Down
2 changes: 2 additions & 0 deletions src/base-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export default class BaseWrapper {
qq,
type
})

this.qq = qq
}

off(name, callback) {
Expand Down
7 changes: 7 additions & 0 deletions src/test/unit/base-wrapper.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,5 +216,12 @@ describe('Fine Uploader wrapper classes', () => {
}, 100)
}, 100)
})

it('provides access to the entire qq namespace', () => {
const wrapper = new FineUploaderTraditional({ options: {} })

expect(wrapper.qq).toBeTruthy()
expect(wrapper.qq.status.QUEUED).toBe('queued')
})
})
})

0 comments on commit c61dd93

Please sign in to comment.