bastion 3.2.2 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/bastion/bastion.module.js +10 -3
- data/app/assets/javascripts/bastion/components/components.module.js +1 -1
- data/app/assets/javascripts/bastion/components/views/autocomplete-scoped-search.html +2 -2
- data/app/assets/javascripts/bastion/layouts/panel.html +5 -0
- data/bower.json +9 -9
- data/lib/bastion/version.rb +1 -1
- data/package.json +13 -12
- data/test/components/bst-bookmark.directive.test.js +2 -2
- data/test/components/bst-dropdown.directive.test.js +2 -2
- data/test/components/bst-edit.directive.test.js +5 -6
- data/test/components/bst-menu.directive.test.js +1 -1
- data/test/components/bst-modal.directive.test.js +3 -3
- data/test/components/nutupane.factory.test.js +4 -4
- data/test/i18n/translate.service.test.js +1 -1
- data/test/utils/urlencode.filter.test.js +2 -0
- data/vendor/assets/javascripts/bastion/angular/angular.js +22616 -12308
- data/vendor/assets/javascripts/bastion/angular-animate/angular-animate.js +3940 -1019
- data/vendor/assets/javascripts/bastion/angular-blocks/angular-blocks.js +7 -2
- data/vendor/assets/javascripts/bastion/angular-resource/angular-resource.js +471 -297
- data/vendor/assets/javascripts/bastion/angular-route/angular-route.js +369 -264
- data/vendor/assets/javascripts/bastion/angular-sanitize/angular-sanitize.js +412 -317
- data/vendor/assets/javascripts/bastion/ngUpload/ng-upload.js +63 -24
- metadata +3 -2
@@ -6,11 +6,11 @@
|
|
6
6
|
//
|
7
7
|
// <div ng-app="app">
|
8
8
|
// <div ng-controller="mainCtrl">
|
9
|
-
// <form ng-attr-action="/uploads"
|
10
|
-
// ng-upload="completed(content)">
|
9
|
+
// <form ng-attr-action="/uploads"
|
10
|
+
// ng-upload="completed(content)">
|
11
11
|
// ng-upload-loading="loading()"
|
12
12
|
// <input type="file" name="avatar"></input>
|
13
|
-
// <input type="submit" value="Upload"
|
13
|
+
// <input type="submit" value="Upload"
|
14
14
|
// ng-disabled="$isUploading"></input>
|
15
15
|
// </form>
|
16
16
|
// </div>
|
@@ -92,7 +92,8 @@ angular.module('ngUpload', [])
|
|
92
92
|
// // add the Rails CSRF hidden input to form
|
93
93
|
// enableRailsCsrf: bool
|
94
94
|
// }
|
95
|
-
var fn = attrs.ngUpload ? $parse(attrs.ngUpload) :
|
95
|
+
var fn = attrs.ngUpload ? $parse(attrs.ngUpload) : null;
|
96
|
+
var errorCatcher = attrs.errorCatcher ? $parse(attrs.errorCatcher) : null;
|
96
97
|
var loading = attrs.ngUploadLoading ? $parse(attrs.ngUploadLoading) : null;
|
97
98
|
|
98
99
|
if ( attrs.hasOwnProperty( "uploadOptionsConvertHidden" ) ) {
|
@@ -136,12 +137,21 @@ angular.module('ngUpload', [])
|
|
136
137
|
|
137
138
|
setLoadingState(false);
|
138
139
|
// Start upload
|
139
|
-
element.bind('submit', function uploadStart() {
|
140
|
+
element.bind('submit', function uploadStart($event) {
|
140
141
|
var formController = scope[attrs.name];
|
141
142
|
// if form is invalid don't submit (e.g. keypress 13)
|
142
|
-
if(formController && formController.$invalid)
|
143
|
+
if(formController && formController.$invalid) {
|
144
|
+
$event.preventDefault();
|
145
|
+
return false;
|
146
|
+
}
|
143
147
|
// perform check before submit file
|
144
|
-
if (options.beforeSubmit && options.beforeSubmit(scope, {})
|
148
|
+
if (options.beforeSubmit && options.beforeSubmit(scope, {}) === false) {
|
149
|
+
if(!scope.$$phase){
|
150
|
+
scope.$apply();
|
151
|
+
}
|
152
|
+
$event.preventDefault();
|
153
|
+
return false;
|
154
|
+
}
|
145
155
|
|
146
156
|
// bind load after submit to prevent initial load triggering uploadEnd
|
147
157
|
iframe.bind('load', uploadEnd);
|
@@ -181,24 +191,53 @@ angular.module('ngUpload', [])
|
|
181
191
|
setLoadingState(false);
|
182
192
|
}
|
183
193
|
// Get iframe body contents
|
184
|
-
var bodyContent = (iframe[0].contentDocument ||
|
185
|
-
iframe[0].contentWindow.document).body;
|
186
|
-
var content;
|
187
194
|
try {
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
195
|
+
var bodyContent = (iframe[0].contentDocument ||
|
196
|
+
iframe[0].contentWindow.document).body;
|
197
|
+
|
198
|
+
var content;
|
199
|
+
try {
|
200
|
+
content = angular.fromJson(bodyContent.innerText || bodyContent.textContent);
|
201
|
+
if (!scope.$$phase) {
|
202
|
+
scope.$apply(function () {
|
203
|
+
fn(scope, { content: content});
|
204
|
+
});
|
205
|
+
} else {
|
206
|
+
fn(scope, { content: content});
|
207
|
+
}
|
208
|
+
} catch (e) {
|
209
|
+
// Fall back to html if json parse failed
|
210
|
+
content = bodyContent.innerHTML;
|
211
|
+
var error = 'ng-upload: Response is not valid JSON';
|
212
|
+
$log.warn(error);
|
213
|
+
|
214
|
+
if ( errorCatcher ){
|
215
|
+
if (!scope.$$phase) {
|
216
|
+
scope.$apply(function () {
|
217
|
+
errorCatcher(scope, { error: error});
|
218
|
+
});
|
219
|
+
} else {
|
220
|
+
errorCatcher(scope, { error: error});
|
221
|
+
}
|
222
|
+
}
|
223
|
+
|
224
|
+
}
|
225
|
+
// if outside a digest cycle, execute the upload response function in the active scope
|
226
|
+
// else execute the upload response function in the current digest
|
227
|
+
|
228
|
+
} catch (error) {
|
229
|
+
$log.warn('ng-upload: Server error');
|
230
|
+
|
231
|
+
if ( errorCatcher ){
|
232
|
+
if (!scope.$$phase) {
|
233
|
+
scope.$apply(function () {
|
234
|
+
errorCatcher(scope, { error: error});
|
235
|
+
});
|
236
|
+
} else {
|
237
|
+
errorCatcher(scope, { error: error});
|
238
|
+
}
|
239
|
+
}
|
240
|
+
|
202
241
|
}
|
203
242
|
}
|
204
243
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bastion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric D Helms
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: angular-rails-templates
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- app/assets/javascripts/bastion/i18n/zanata.xml
|
141
141
|
- app/assets/javascripts/bastion/layouts/details-nutupane.html
|
142
142
|
- app/assets/javascripts/bastion/layouts/nutupane.html
|
143
|
+
- app/assets/javascripts/bastion/layouts/panel.html
|
143
144
|
- app/assets/javascripts/bastion/layouts/select-all-results.html
|
144
145
|
- app/assets/javascripts/bastion/menu/menu-expander.service.js
|
145
146
|
- app/assets/javascripts/bastion/menu/menu.module.js
|