attache-rails 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d102ed58a94d38425b805352694aa5011340006
4
- data.tar.gz: 62d859eb1f12efe92f25f4a3ef2da1a28d00ed87
3
+ metadata.gz: bf05ea191eac5903beb60084f35239899dff4983
4
+ data.tar.gz: eae78b0b3baa0f967ed37bf2a79bfa46702fc2a1
5
5
  SHA512:
6
- metadata.gz: f2977a0f4f997292c63d7aa824209dc113c655385c50f23ca64007bbdca8b7ed38e2e1f674bd7bceb6140191003d2c1b76f162879fc6ac41b8f0185d4b1d6865
7
- data.tar.gz: eeddf1577a1f8824800cdddb005a686748eec36f8784612e836fa125362b2ce5ef2f8d11ec5cf3844a3bcc8e8e34768289dda8504904a4a5fb34f61226ff922d
6
+ metadata.gz: 0a30c32b95cba43d215d607dcf6d75a2e818a970aa2ce522aaa629d379f5b9575336d965f75f92ec5186fb5d866f8b45f25d16631539b9e7960fa0fc46b0e62a
7
+ data.tar.gz: 020ac46d7cf5c339458d545efd1dc0ed7f1e8f29ec5318ad2af4aee54b6657248cdabe32f42da3a39b459c50fc07682c0d31c45a5ee485c1cd5e50d59ba75eae
@@ -0,0 +1,119 @@
1
+ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.attache_cors_upload = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2
+ 'use strict';
3
+
4
+ var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
5
+
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+
10
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
+
12
+ /*global $*/
13
+ /*global alert*/
14
+ /*global XMLHttpRequest*/
15
+ /*global XDomainRequest*/
16
+
17
+ var counter = 0;
18
+
19
+ var CORSUpload = exports.CORSUpload = (function () {
20
+ function CORSUpload(options) {
21
+ _classCallCheck(this, CORSUpload);
22
+
23
+ if (options == null) options = {};
24
+ var option;
25
+ for (option in options) {
26
+ this[option] = options[option];
27
+ }
28
+ }
29
+
30
+ // for overwriting
31
+
32
+ _createClass(CORSUpload, [{
33
+ key: 'createLocalThumbnail',
34
+ value: function createLocalThumbnail() {}
35
+ }, {
36
+ key: 'onComplete',
37
+ value: function onComplete(uid, json) {}
38
+ }, {
39
+ key: 'onProgress',
40
+ value: function onProgress(uid, json) {}
41
+ }, {
42
+ key: 'onError',
43
+ value: function onError(uid, status) {
44
+ alert(status);
45
+ }
46
+ }, {
47
+ key: 'handleFileSelect',
48
+ value: function handleFileSelect() {
49
+ var f, _i, _len, _results, url, $ele, prefix;
50
+ $ele = $(this.file_element);
51
+ url = $ele.data('uploadurl');
52
+ if ($ele.data('hmac')) {
53
+ url = url + '?hmac=' + encodeURIComponent($ele.data('hmac')) + '&uuid=' + encodeURIComponent($ele.data('uuid')) + '&expiration=' + encodeURIComponent($ele.data('expiration')) + '';
54
+ }
55
+
56
+ prefix = Date.now() + '_';
57
+ _results = [];
58
+ for (_i = 0, _len = this.files.length; _i < _len; _i++) {
59
+ f = this.files[_i];
60
+ this.createLocalThumbnail(f); // if any
61
+ f.uid = prefix + counter++;
62
+ this.onProgress(f.uid, { src: f.src, filename: f.name, percentLoaded: 0, bytesLoaded: 0, bytesTotal: f.size });
63
+ _results.push(this.performUpload(f, url));
64
+ }
65
+ return _results;
66
+ }
67
+ }, {
68
+ key: 'createCORSRequest',
69
+ value: function createCORSRequest(method, url) {
70
+ var xhr;
71
+ xhr = new XMLHttpRequest();
72
+ if (xhr.withCredentials != null) {
73
+ xhr.open(method, url, true);
74
+ } else if (typeof XDomainRequest !== 'undefined') {
75
+ xhr = new XDomainRequest();
76
+ xhr.open(method, url);
77
+ } else {
78
+ xhr = null;
79
+ }
80
+ return xhr;
81
+ }
82
+ }, {
83
+ key: 'performUpload',
84
+ value: function performUpload(file, url) {
85
+ var this_s3upload, xhr;
86
+ this_s3upload = this;
87
+ url = url + (url.indexOf('?') === -1 ? '?' : '&') + 'file=' + encodeURIComponent(file.name);
88
+ xhr = this.createCORSRequest('PUT', url);
89
+ if (!xhr) {
90
+ this.onError(file.uid, 'CORS not supported');
91
+ } else {
92
+ xhr.onload = function (e) {
93
+ if (xhr.status === 200) {
94
+ this_s3upload.onComplete(file.uid, JSON.parse(e.target.responseText));
95
+ } else {
96
+ return this_s3upload.onError(file.uid, xhr.status + ' ' + xhr.statusText);
97
+ }
98
+ };
99
+ xhr.onerror = function () {
100
+ return this_s3upload.onError(file.uid, 'Unable to reach server');
101
+ };
102
+ xhr.upload.onprogress = function (e) {
103
+ var percentLoaded;
104
+ if (e.lengthComputable) {
105
+ percentLoaded = Math.round(e.loaded / e.total * 100);
106
+ return this_s3upload.onProgress(file.uid, { src: file.src, filename: file.name, percentLoaded: percentLoaded, bytesLoaded: e.loaded, bytesTotal: e.total });
107
+ }
108
+ };
109
+ }
110
+ return xhr.send(file);
111
+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7XG4gICAgICAgIHZhciBwZXJjZW50TG9hZGVkXG4gICAgICAgIGlmIChlLmxlbmd0aENvbXB1dGFibGUpIHtcbiAgICAgICAgICBwZXJjZW50TG9hZGVkID0gTWF0aC5yb3VuZCgoZS5sb2FkZWQgLyBlLnRvdGFsKSAqIDEwMClcbiAgICAgICAgICByZXR1cm4gdGhpc19zM3VwbG9hZC5vblByb2dyZXNzKGZpbGUudWlkLCB7IHNyYzogZmlsZS5zcmMsIGZpbGVuYW1lOiBmaWxlLm5hbWUsIHBlcmNlbnRMb2FkZWQ6IHBlcmNlbnRMb2FkZWQsIGJ5dGVzTG9hZGVkOiBlLmxvYWRlZCwgYnl0ZXNUb3RhbDogZS50b3RhbCB9KVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiB4aHIuc2VuZChmaWxlKVxuICB9XG59XG4iXX0=
@@ -1,4 +1,4 @@
1
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
1
+ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.attache = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2
2
  'use strict';
3
3
 
4
4
  var _file_input = require('./attache/file_input');
@@ -419,5 +419,6 @@ var AttacheFileInput = exports.AttacheFileInput = React.createClass({
419
419
  }
420
420
  });
421
421
 
422
- },{"./bootstrap3":2,"./cors_upload":3}]},{},[1])
422
+ },{"./bootstrap3":2,"./cors_upload":3}]},{},[1])(1)
423
+ });
423
424
  //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy5udm0vdjQuMS4wL2xpYi9ub2RlX21vZHVsZXMvYnJvd3NlcmlmeS9ub2RlX21vZHVsZXMvYnJvd3Nlci1wYWNrL19wcmVsdWRlLmpzIiwic3JjL2phdmFzY3JpcHRzL2F0dGFjaGUuanMiLCJzcmMvamF2YXNjcmlwdHMvYXR0YWNoZS9ib290c3RyYXAzLmpzIiwic3JjL2phdmFzY3JpcHRzL2F0dGFjaGUvY29yc191cGxvYWQuanMiLCJzcmMvamF2YXNjcmlwdHMvYXR0YWNoZS9maWxlX2lucHV0LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7OztBQ01BLElBQUksZ0JBQWdCLEdBQUcsU0FBbkIsZ0JBQWdCLEdBQWU7QUFDakMsTUFBSSxTQUFTLEdBQUcsRUFBRSxPQUFPLEVBQUUsV0FBVyxFQUFFLEtBQUssRUFBRSxTQUFTLEVBQUUsQ0FBQTtBQUMxRCxNQUFJLEdBQUcsR0FBRyxRQUFRLENBQUMsc0JBQXNCLENBQUMsZ0JBQWdCLENBQUMsQ0FBQTtBQUMzRCxNQUFJLEdBQUcsRUFBRSxLQUFLLEVBQUUsSUFBSSxFQUFFLEtBQUssQ0FBQTtBQUMzQixPQUFLLElBQUksQ0FBQyxHQUFHLEdBQUcsQ0F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Wx1ZT17ZGlzY2FyZC5wYXRofSAvPlxuICAgICAgKVxuICAgIH0pXG5cbiAgICB2YXIgY2xhc3NOYW1lID0gWydhdHRhY2hlLWZpbGUtc2VsZWN0b3InLCAnYXR0YWNoZS1wbGFjZWhvbGRlcnMtY291bnQtJyArIHBsYWNlaG9sZGVycy5sZW5ndGgsICdhdHRhY2hlLXByZXZpZXdzLWNvdW50LScgKyBwcmV2aWV3cy5sZW5ndGgsIHRoaXMucHJvcHNbJ2RhdGEtY2xhc3NuYW1lJ11dLmpvaW4oJyAnKS50cmltKClcbiAgICByZXR1cm4gKFxuICAgIDxsYWJlbFxuICAgICAgaHRtbEZvcj17dGhhdC5wcm9wcy5pZH1cbiAgICAgIGNsYXNzTmFtZT17Y2xhc3NOYW1lfVxuICAgICAgb25EcmFnT3Zlcj17dGhpcy5vbkRyYWdPdmVyfVxuICAgICAgb25EcmFnTGVhdmU9e3RoaXMub25EcmFnTGVhdmV9XG4gICAgICBvbkRyb3A9e3RoaXMub25Ecm9wfT5cbiAgICAgIDxpbnB1dCB0eXBlPVwiZmlsZVwiIHsuLi50aGF0LnByb3BzfSBvbkNoYW5nZT17dGhpcy5vbkNoYW5nZX0gLz5cbiAgICAgIDxpbnB1dCB0eXBlPVwiaGlkZGVuXCIgbmFtZT17dGhhdC5wcm9wcy5uYW1lfSB2YWx1ZT1cIlwiIC8+XG4gICAgICA8SGVhZGVyIHsuLi50aGF0LnByb3BzfSAvPlxuICAgICAge3ByZXZpZXdzfVxuICAgICAge3BsYWNlaG9sZGVyc31cbiAgICAgIHtkaXNjYXJkc31cbiAgICA8L2xhYmVsPlxuICAgIClcbiAgfVxufSlcbiJdfQ==
@@ -1,5 +1,5 @@
1
1
  module Attache
2
2
  module Rails
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attache-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - choonkeat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-16 00:00:00.000000000 Z
11
+ date: 2016-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -119,6 +119,7 @@ files:
119
119
  - README.md
120
120
  - Rakefile
121
121
  - app/assets/javascripts/attache.js
122
+ - app/assets/javascripts/attache/cors_upload.js
122
123
  - app/index.html
123
124
  - lib/attache/rails.rb
124
125
  - lib/attache/rails/engine.rb