js_stack 1.9.0 → 1.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 822252d6fc7115f77aa8408d0d801424ed28d0ae
4
- data.tar.gz: e5eccdfcdf0e81a9fb4b2441a1f8b409b22babea
3
+ metadata.gz: dab01493b6605c66a203da726a2a7f172656e0dd
4
+ data.tar.gz: a3a2aa62de4638d7452d28584e0ef3abf53aa13d
5
5
  SHA512:
6
- metadata.gz: fc16fc01d3a4f82271149cadbceba2a9a81189d23580978657f1d2c331ca0d9b94cf331e08cf0fdb22fcba945ec477b6eba83c8c1b68015b74cab1e933c9c532
7
- data.tar.gz: c66133ecd3f2034dd673d8b1e6fbf24e30784f602802925e31e4be7f13b1d1af19d647a499634130d57c3b1097c926f48efab6f5c01377fda3abc77b56c80ed6
6
+ metadata.gz: 65aaf6de301128c20b2013efcec91b85e56fa54884becc75c23681b2fc3e8f322c2e43cf86a585f308094c4e945cc683c6167837cc6a8e214a215697255c6728
7
+ data.tar.gz: 0ef538fa3b8a798931b97f3ac5b982303a376d3f19b650d35d8a36aa10fe0f620688281d828a37d87e545de33ae88deb3974ccebe3500334c44db0b781f4c1c8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ # 1.10.0
4
+
5
+ * update underscore 1.8.2 -> 1.8.3 [@gvl]
6
+ * update backbone.mutators 0.4.4 -> 0.4.5 [@gvl]
7
+ * update backbone.validation 0.11.3 -> 0.11.5 [@gvl]
8
+ * update backbone.virtualcollection 0.6.3 -> 0.6.6 [@gvl]
9
+
3
10
  # 1.9.0
4
11
 
5
12
  * update underscore 1.7.0 -> 1.8.2 [@gvl]
data/README.md CHANGED
@@ -49,9 +49,9 @@ Examples:
49
49
  | :-----: | :------: | :-------: | :------: |
50
50
  | backbone | **1.1.2**, 1.0.0 | [changelog](http://backbonejs.org/#changelog) | [homepage](http://backbonejs.org/) |
51
51
  | marionette | **2.4.1**, 2.3.2, 2.2.2, 2.1.0, 2.0.3, 1.8.8, 1.7.4, 1.6.4, 1.5.1, 1.4.1, 1.1.0 | [changelog](https://github.com/marionettejs/backbone.marionette/blob/master/changelog.md) | [homepage](http://marionettejs.com/) |
52
- | underscore | **1.8.2**, 1.7.0, 1.6.0, 1.5.2 | [changelog](http://underscorejs.org/#changelog) | [homepage](http://underscorejs.org/) |
52
+ | underscore | **1.8.3**, 1.7.0, 1.6.0, 1.5.2 | [changelog](http://underscorejs.org/#changelog) | [homepage](http://underscorejs.org/) |
53
53
  | hamlcoffee | **1.16** | [changelog](https://github.com/netzpirat/haml_coffee_assets/blob/master/CHANGELOG.md) | [homepage](https://github.com/netzpirat/haml_coffee_assets) |
54
- | js-routes | **1.0.0** | [changelog](https://github.com/railsware/js-routes/blob/master/CHANGELOG.md) | [homepage](https://github.com/railsware/js-routes) |
54
+ | js-routes | **1.0.1** | [changelog](https://github.com/railsware/js-routes/blob/master/CHANGELOG.md) | [homepage](https://github.com/railsware/js-routes) |
55
55
 
56
56
  ### Plugins
57
57
 
@@ -59,15 +59,15 @@ Examples:
59
59
  | :-----: | :------: | :-------: | :------: |
60
60
  | backbone associations | **0.6.2**, 0.5.5 | [changelog](https://github.com/dhruvaray/backbone-associations/blob/master/CHANGELOG.md) | [homepage](http://dhruvaray.github.io/backbone-associations/) |
61
61
  | backbone deepmodel | **0.10.4** | [changelog](https://github.com/powmedia/backbone-deep-model#changelog) | [homepage](https://github.com/powmedia/backbone-deep-model) |
62
- | backbone mutators | **0.4.4** | [changelog](https://github.com/asciidisco/Backbone.Mutators#changelog) | [homepage](https://github.com/asciidisco/Backbone.Mutators) |
62
+ | backbone mutators | **0.4.5** | [changelog](https://github.com/asciidisco/Backbone.Mutators#changelog) | [homepage](https://github.com/asciidisco/Backbone.Mutators) |
63
63
  | backbone pageable | **1.4.8**, 1.3.2 | [changelog](https://github.com/backbone-paginator/backbone-pageable#change-log) | [homepage](https://github.com/wyuenho/backbone-pageable) |
64
64
  | backbone paginator | **2.0.2** | [changelog](https://github.com/backbone-paginator/backbone.paginator/wiki/Changelog) | [homepage](https://github.com/backbone-paginator/backbone.paginator) |
65
65
  | backbone routefilter | **0.2.1** | [changelog](https://github.com/boazsender/backbone.routefilter#release-history) | [homepage](https://github.com/boazsender/backbone.routefilter) |
66
66
  | backbone stickit | **0.9.0**, 0.8.0, 0.7.0, 0.6.3 | [changelog](http://nytimes.github.io/backbone.stickit/#change-log) | [homepage](http://nytimes.github.io/backbone.stickit/) |
67
- | backbone validation | **0.11.3**, 0.9.2, 0.8.1 | [changelog](https://github.com/thedersen/backbone.validation#release-notes) | [homepage](https://github.com/thedersen/backbone.validation) |
68
- | backbone virtualcollection | **0.6.3**, 0.5.3, 0.4.15 | [changelog](https://github.com/p3drosola/Backbone.VirtualCollection/wiki/Changelog) | [homepage](https://github.com/p3drosola/Backbone.VirtualCollection) |
67
+ | backbone validation | **0.11.5**, 0.9.2, 0.8.1 | [changelog](https://github.com/thedersen/backbone.validation#release-notes) | [homepage](https://github.com/thedersen/backbone.validation) |
68
+ | backbone virtualcollection | **0.6.6**, 0.5.3, 0.4.15 | [changelog](https://github.com/p3drosola/Backbone.VirtualCollection/wiki/Changelog) | [homepage](https://github.com/p3drosola/Backbone.VirtualCollection) |
69
69
  | cocktail | **0.5.10** | None | [homepage](https://github.com/onsi/cocktail) |
70
- | momentjs | **2.9.0** | [changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) | [homepage](https://github.com/derekprior/momentjs-rails) |
70
+ | momentjs | **2.10.2** | [changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) | [homepage](https://github.com/derekprior/momentjs-rails) |
71
71
  | underscore inflections | **0.2.1** | None | [homepage](https://github.com/geetarista/underscore.inflections) |
72
72
  | underscore string | **3.0.3**, 2.4.0, 2.3.2 | [changelog](https://github.com/epeli/underscore.string/blob/master/CHANGELOG.markdown) | [homepage](http://epeli.github.io/underscore.string/) |
73
73
 
@@ -1,3 +1,3 @@
1
1
  module JsStack
2
- VERSION = '1.9.0'
2
+ VERSION = '1.10.0'
3
3
  end
@@ -1,4 +1,4 @@
1
- // Underscore.js 1.8.2
1
+ // Underscore.js 1.8.3
2
2
  // http://underscorejs.org
3
3
  // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
4
4
  // Underscore may be freely distributed under the MIT license.
@@ -55,7 +55,7 @@
55
55
  }
56
56
 
57
57
  // Current version.
58
- _.VERSION = '1.8.2';
58
+ _.VERSION = '1.8.3';
59
59
 
60
60
  // Internal function that returns an efficient (for current engines) version
61
61
  // of the passed-in callback, to be repeatedly applied in other Underscore
@@ -122,12 +122,20 @@
122
122
  return result;
123
123
  };
124
124
 
125
+ var property = function(key) {
126
+ return function(obj) {
127
+ return obj == null ? void 0 : obj[key];
128
+ };
129
+ };
130
+
125
131
  // Helper for collection methods to determine whether a collection
126
132
  // should be iterated as an array or as an object
127
133
  // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
134
+ // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
128
135
  var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
136
+ var getLength = property('length');
129
137
  var isArrayLike = function(collection) {
130
- var length = collection != null && collection.length;
138
+ var length = getLength(collection);
131
139
  return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
132
140
  };
133
141
 
@@ -481,7 +489,7 @@
481
489
  // Internal implementation of a recursive `flatten` function.
482
490
  var flatten = function(input, shallow, strict, startIndex) {
483
491
  var output = [], idx = 0;
484
- for (var i = startIndex || 0, length = input && input.length; i < length; i++) {
492
+ for (var i = startIndex || 0, length = getLength(input); i < length; i++) {
485
493
  var value = input[i];
486
494
  if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {
487
495
  //flatten current level of array or arguments object
@@ -512,7 +520,6 @@
512
520
  // been sorted, you have the option of using a faster algorithm.
513
521
  // Aliased as `unique`.
514
522
  _.uniq = _.unique = function(array, isSorted, iteratee, context) {
515
- if (array == null) return [];
516
523
  if (!_.isBoolean(isSorted)) {
517
524
  context = iteratee;
518
525
  iteratee = isSorted;
@@ -521,7 +528,7 @@
521
528
  if (iteratee != null) iteratee = cb(iteratee, context);
522
529
  var result = [];
523
530
  var seen = [];
524
- for (var i = 0, length = array.length; i < length; i++) {
531
+ for (var i = 0, length = getLength(array); i < length; i++) {
525
532
  var value = array[i],
526
533
  computed = iteratee ? iteratee(value, i, array) : value;
527
534
  if (isSorted) {
@@ -548,10 +555,9 @@
548
555
  // Produce an array that contains every item shared between all the
549
556
  // passed-in arrays.
550
557
  _.intersection = function(array) {
551
- if (array == null) return [];
552
558
  var result = [];
553
559
  var argsLength = arguments.length;
554
- for (var i = 0, length = array.length; i < length; i++) {
560
+ for (var i = 0, length = getLength(array); i < length; i++) {
555
561
  var item = array[i];
556
562
  if (_.contains(result, item)) continue;
557
563
  for (var j = 1; j < argsLength; j++) {
@@ -580,7 +586,7 @@
580
586
  // Complement of _.zip. Unzip accepts an array of arrays and groups
581
587
  // each array's elements on shared indices
582
588
  _.unzip = function(array) {
583
- var length = array && _.max(array, 'length').length || 0;
589
+ var length = array && _.max(array, getLength).length || 0;
584
590
  var result = Array(length);
585
591
 
586
592
  for (var index = 0; index < length; index++) {
@@ -594,7 +600,7 @@
594
600
  // the corresponding values.
595
601
  _.object = function(list, values) {
596
602
  var result = {};
597
- for (var i = 0, length = list && list.length; i < length; i++) {
603
+ for (var i = 0, length = getLength(list); i < length; i++) {
598
604
  if (values) {
599
605
  result[list[i]] = values[i];
600
606
  } else {
@@ -608,7 +614,7 @@
608
614
  function createPredicateIndexFinder(dir) {
609
615
  return function(array, predicate, context) {
610
616
  predicate = cb(predicate, context);
611
- var length = array != null && array.length;
617
+ var length = getLength(array);
612
618
  var index = dir > 0 ? 0 : length - 1;
613
619
  for (; index >= 0 && index < length; index += dir) {
614
620
  if (predicate(array[index], index, array)) return index;
@@ -626,7 +632,7 @@
626
632
  _.sortedIndex = function(array, obj, iteratee, context) {
627
633
  iteratee = cb(iteratee, context, 1);
628
634
  var value = iteratee(obj);
629
- var low = 0, high = array.length;
635
+ var low = 0, high = getLength(array);
630
636
  while (low < high) {
631
637
  var mid = Math.floor((low + high) / 2);
632
638
  if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
@@ -637,7 +643,7 @@
637
643
  // Generator function to create the indexOf and lastIndexOf functions
638
644
  function createIndexFinder(dir, predicateFind, sortedIndex) {
639
645
  return function(array, item, idx) {
640
- var i = 0, length = array ? array.length : -1;
646
+ var i = 0, length = getLength(array);
641
647
  if (typeof idx == 'number') {
642
648
  if (dir > 0) {
643
649
  i = idx >= 0 ? idx : Math.max(idx + length, i);
@@ -1286,11 +1292,7 @@
1286
1292
 
1287
1293
  _.noop = function(){};
1288
1294
 
1289
- _.property = function(key) {
1290
- return function(obj) {
1291
- return obj == null ? void 0 : obj[key];
1292
- };
1293
- };
1295
+ _.property = property;
1294
1296
 
1295
1297
  // Generates a function for a given object that returns a given property.
1296
1298
  _.propertyOf = function(obj) {
@@ -1 +1 @@
1
- //= require js_stack/base/underscore/1.8.2
1
+ //= require js_stack/base/underscore/1.8.3
@@ -1,10 +1,10 @@
1
- /*! Backbone.Mutators - v0.4.4
1
+ /*! Backbone.Mutators - v0.4.5
2
2
  ------------------------------
3
- Build @ 2014-12-02
3
+ Build @ 2015-04-23
4
4
  Documentation and Full License Available at:
5
5
  http://asciidisco.github.com/Backbone.Mutators/index.html
6
6
  git://github.com/asciidisco/Backbone.Mutators.git
7
- Copyright (c) 2014 Sebastian Golasch <public@asciidisco.com>
7
+ Copyright (c) 2015 Sebastian Golasch <public@asciidisco.com>
8
8
 
9
9
  Permission is hereby granted, free of charge, to any person obtaining a
10
10
  copy of this software and associated documentation files (the "Software"),
@@ -135,7 +135,7 @@ IN THE SOFTWARE.*/
135
135
  }
136
136
 
137
137
  // check if we have a deeper nested setter mutation
138
- if (isMutator === true && _.isObject(this.mutators[key]) === true) {
138
+ if (isMutator === true && !_.isObject(key) && _.isObject(this.mutators[key]) === true) {
139
139
 
140
140
  // check if we need to set a single value
141
141
  if (_.isFunction(this.mutators[key].set) === true) {
@@ -179,7 +179,7 @@ IN THE SOFTWARE.*/
179
179
  _.each(this.mutators, _.bind(function (mutator, name) {
180
180
  // check if we have some getter mutations
181
181
  if (_.isObject(this.mutators[name]) === true && _.isFunction(this.mutators[name].get)) {
182
- isSaving = _.has(options || {}, 'emulateHTTP');
182
+ isSaving = (this.isSaving) ? this.isSaving(options, mutator, name) : _.has(options || {}, 'emulateHTTP');
183
183
  isTransient = this.mutators[name].transient;
184
184
  if (!isSaving || !isTransient) {
185
185
  attr[name] = _.bind(this.mutators[name].get, this)();
@@ -1,4 +1,4 @@
1
- // Backbone.Validation v0.11.3
1
+ // Backbone.Validation v0.11.5
2
2
  //
3
3
  // Copyright (c) 2011-2015 Thomas Pedersen
4
4
  // Distributed under MIT License
@@ -81,7 +81,12 @@ Backbone.Validation = (function(_){
81
81
 
82
82
  _.each(obj, function(val, key) {
83
83
  if(obj.hasOwnProperty(key)) {
84
- if (!!val && typeof val === 'object' && val.constructor === Object) {
84
+ if (!!val && _.isArray(val)) {
85
+ _.forEach(val, function(v, k) {
86
+ flatten(v, into, prefix + key + '.' + k + '.');
87
+ into[prefix + key + '.' + k] = v;
88
+ });
89
+ } else if (!!val && typeof val === 'object' && val.constructor === Object) {
85
90
  flatten(val, into, prefix + key + '.');
86
91
  }
87
92
 
@@ -332,7 +337,7 @@ Backbone.Validation = (function(_){
332
337
  // Removes view from associated views of the model or the methods
333
338
  // added to a model if no view or single view provided
334
339
  var unbindModel = function(model, view) {
335
- if (view && model.associatedViews.length > 1){
340
+ if (view && model.associatedViews && model.associatedViews.length > 1){
336
341
  model.associatedViews = _.without(model.associatedViews, view);
337
342
  } else {
338
343
  delete model.validate;
@@ -105,6 +105,9 @@ var VirtualCollection = Backbone.VirtualCollection = Backbone.Collection.extend(
105
105
 
106
106
  if (this.accepts(model, options.index)) {
107
107
  if (already_here) {
108
+ if (!this._byId[model.id] && model.id) {
109
+ this._byId[model.id] = model;
110
+ }
108
111
  this.trigger('change', model, this, options);
109
112
  } else {
110
113
  this._indexAdd(model);
@@ -173,6 +176,10 @@ var VirtualCollection = Backbone.VirtualCollection = Backbone.Collection.extend(
173
176
  if (!_.contains(explicitlyHandledEvents, eventName)) {
174
177
  this.trigger.apply(this, arguments);
175
178
  }
179
+ },
180
+
181
+ clone: function () {
182
+ return new this.collection.constructor(this.models);
176
183
  }
177
184
 
178
185
  }, { // static props
@@ -1 +1 @@
1
- //= require js_stack/plugins/backbone/mutators/0.4.4
1
+ //= require js_stack/plugins/backbone/mutators/0.4.5
@@ -1 +1 @@
1
- //= require js_stack/plugins/backbone/validation/0.11.3
1
+ //= require js_stack/plugins/backbone/validation/0.11.5
@@ -1 +1 @@
1
- //= require js_stack/plugins/backbone/virtualcollection/0.6.3
1
+ //= require js_stack/plugins/backbone/virtualcollection/0.6.6
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: js_stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Pewiński
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-01 00:00:00.000000000 Z
12
+ date: 2015-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: haml_coffee_assets
@@ -121,7 +121,7 @@ files:
121
121
  - vendor/assets/javascripts/js_stack/base/underscore/1.5.2.js
122
122
  - vendor/assets/javascripts/js_stack/base/underscore/1.6.0.js
123
123
  - vendor/assets/javascripts/js_stack/base/underscore/1.7.0.js
124
- - vendor/assets/javascripts/js_stack/base/underscore/1.8.2.js
124
+ - vendor/assets/javascripts/js_stack/base/underscore/1.8.3.js
125
125
  - vendor/assets/javascripts/js_stack/plugins/backbone.associations.js
126
126
  - vendor/assets/javascripts/js_stack/plugins/backbone.deepmodel.js
127
127
  - vendor/assets/javascripts/js_stack/plugins/backbone.mutators.js
@@ -134,7 +134,7 @@ files:
134
134
  - vendor/assets/javascripts/js_stack/plugins/backbone/associations/0.5.5.js
135
135
  - vendor/assets/javascripts/js_stack/plugins/backbone/associations/0.6.2.js
136
136
  - vendor/assets/javascripts/js_stack/plugins/backbone/deepmodel/0.10.4.js
137
- - vendor/assets/javascripts/js_stack/plugins/backbone/mutators/0.4.4.js
137
+ - vendor/assets/javascripts/js_stack/plugins/backbone/mutators/0.4.5.js
138
138
  - vendor/assets/javascripts/js_stack/plugins/backbone/pageable/1.3.2.js
139
139
  - vendor/assets/javascripts/js_stack/plugins/backbone/pageable/1.4.8.js
140
140
  - vendor/assets/javascripts/js_stack/plugins/backbone/paginator/2.0.2.js
@@ -143,12 +143,12 @@ files:
143
143
  - vendor/assets/javascripts/js_stack/plugins/backbone/stickit/0.7.0.js
144
144
  - vendor/assets/javascripts/js_stack/plugins/backbone/stickit/0.8.0.js
145
145
  - vendor/assets/javascripts/js_stack/plugins/backbone/stickit/0.9.0.js
146
- - vendor/assets/javascripts/js_stack/plugins/backbone/validation/0.11.3.js
146
+ - vendor/assets/javascripts/js_stack/plugins/backbone/validation/0.11.5.js
147
147
  - vendor/assets/javascripts/js_stack/plugins/backbone/validation/0.8.1.js
148
148
  - vendor/assets/javascripts/js_stack/plugins/backbone/validation/0.9.2.js
149
149
  - vendor/assets/javascripts/js_stack/plugins/backbone/virtualcollection/0.4.15.js
150
150
  - vendor/assets/javascripts/js_stack/plugins/backbone/virtualcollection/0.5.3.js
151
- - vendor/assets/javascripts/js_stack/plugins/backbone/virtualcollection/0.6.3.js
151
+ - vendor/assets/javascripts/js_stack/plugins/backbone/virtualcollection/0.6.6.js
152
152
  - vendor/assets/javascripts/js_stack/plugins/cocktail.js
153
153
  - vendor/assets/javascripts/js_stack/plugins/cocktail/0.5.10.js
154
154
  - vendor/assets/javascripts/js_stack/plugins/moment.js
@@ -183,3 +183,4 @@ signing_key:
183
183
  specification_version: 4
184
184
  summary: standard SPA stack used at netguru.co
185
185
  test_files: []
186
+ has_rdoc: