oxymoron 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/oxymoron/directives/fileupload.js +12 -1
- data/lib/oxymoron/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fbc4c336e8de9b479a1806785b5ddf48ca750b5
|
4
|
+
data.tar.gz: ceb6bef73f8302c62bdf4aad33f63fb0a99da13c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf36d5e9086ba202ccfb491e949d78852b5e056c44aa6af42e2f3bd9d2ea9b17586c2228f5a80a9eceedb4f5e422db23e712161e0eea47163c70e5786b9e67d9
|
7
|
+
data.tar.gz: 2f80ddceb686f3cfa480257a336fa2a0c9f8e03b9d2530dbbec56b8eff10a7970d713e73f919a09c4bca40a1e27aafac6392f5543e5439f1658fa8855b111b53
|
@@ -5,21 +5,32 @@ angular.module("oxymoron.directives.fileupload", [])
|
|
5
5
|
fileupload: "=",
|
6
6
|
ngModel: "=",
|
7
7
|
hash: "=",
|
8
|
-
percentCompleted: "="
|
8
|
+
percentCompleted: "=",
|
9
|
+
maxSize: "="
|
9
10
|
},
|
10
11
|
restrict: 'A',
|
11
12
|
link: function($scope, element, attrs) {
|
12
13
|
$scope.percentCompleted = undefined;
|
13
14
|
|
14
15
|
element.bind('change', function(){
|
16
|
+
var valid = true;
|
15
17
|
if ($scope.xhr) $scope.xhr.abort();
|
16
18
|
|
17
19
|
var fd = new FormData();
|
18
20
|
|
19
21
|
angular.forEach(element[0].files, function (file) {
|
22
|
+
if ($scope.maxSize && file.size/1024/1024 > $scope.maxSize) {
|
23
|
+
valid = false;
|
24
|
+
return
|
25
|
+
}
|
20
26
|
fd.append("attachments[]", file);
|
21
27
|
})
|
22
28
|
|
29
|
+
if (!valid) {
|
30
|
+
ngNotify.set("File size is more then " + $scope.maxSize + " Mb", "error")
|
31
|
+
return false;
|
32
|
+
}
|
33
|
+
|
23
34
|
$scope.xhr = new XMLHttpRequest;
|
24
35
|
|
25
36
|
$scope.percentCompleted = 0;
|
data/lib/oxymoron/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oxymoron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kononenko Paul
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -960,7 +960,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
960
960
|
version: '0'
|
961
961
|
requirements: []
|
962
962
|
rubyforge_project:
|
963
|
-
rubygems_version: 2.
|
963
|
+
rubygems_version: 2.6.1
|
964
964
|
signing_key:
|
965
965
|
specification_version: 4
|
966
966
|
summary: It's using AngularJS and Rails >= 4.2
|