fluentd-ui 0.3.9 → 0.3.10

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.
Files changed (69) hide show
  1. data/ChangeLog +5 -0
  2. data/Gemfile +2 -0
  3. data/Gemfile.lock +52 -40
  4. data/README.md +21 -1
  5. data/app/assets/javascripts/enable_bootstrap_tooltip.js +3 -0
  6. data/app/assets/javascripts/vue/fluent_log.js +1 -1
  7. data/app/assets/stylesheets/common.css.scss +9 -0
  8. data/app/controllers/fluentd/settings/in_forward_controller.rb +9 -0
  9. data/app/controllers/fluentd/settings/in_http_controller.rb +9 -0
  10. data/app/controllers/fluentd/settings/in_monitor_agent_controller.rb +9 -0
  11. data/app/controllers/fluentd/settings/out_stdout_controller.rb +9 -0
  12. data/app/controllers/fluentd/settings_controller.rb +2 -0
  13. data/app/helpers/application_helper.rb +10 -0
  14. data/app/models/fluent_gem.rb +1 -1
  15. data/app/models/fluentd/agent/local_common.rb +3 -2
  16. data/app/models/fluentd/setting/in_forward.rb +44 -0
  17. data/app/models/fluentd/setting/in_http.rb +45 -0
  18. data/app/models/fluentd/setting/in_monitor_agent.rb +38 -0
  19. data/app/models/fluentd/setting/out_stdout.rb +37 -0
  20. data/app/views/fluentd/settings/source_and_output.html.haml +10 -28
  21. data/app/views/layouts/application.html.erb +7 -0
  22. data/bower.json +1 -1
  23. data/config/locales/translation_en.yml +31 -1
  24. data/config/locales/translation_ja.yml +35 -1
  25. data/config/routes.rb +16 -0
  26. data/docs/screenshots/02.png +0 -0
  27. data/docs/screenshots/dashboard.gif +0 -0
  28. data/docs/screenshots/fluentd-ui.gif +0 -0
  29. data/docs/screenshots/in_tail.gif +0 -0
  30. data/docs/screenshots/plugin.gif +0 -0
  31. data/docs/screenshots/setting.gif +0 -0
  32. data/lib/file_reverse_reader.rb +2 -1
  33. data/lib/fluentd-ui/version.rb +1 -1
  34. data/public/td-logo.png +0 -0
  35. data/spec/features/dashboard_spec.rb +42 -0
  36. data/spec/features/fluentd/setting/in_forward_spec.rb +7 -0
  37. data/spec/features/fluentd/setting/in_http_spec.rb +7 -0
  38. data/spec/features/fluentd/setting/in_monitor_agent_spec.rb +7 -0
  39. data/spec/features/fluentd/setting/out_stdout_spec.rb +7 -0
  40. data/spec/features/fluentd_status_spec.rb +36 -0
  41. data/spec/features/{fluentd/setting/out_elasticsearch_spec.rb → out_elasticsearch_spec.rb} +3 -13
  42. data/spec/features/{fluentd/setting/out_forward_spec.rb → out_forward_spec.rb} +2 -12
  43. data/spec/features/{fluentd/setting/out_td_spec.rb → out_td_spec.rb} +2 -12
  44. data/spec/features/sessions_spec.rb +6 -18
  45. data/spec/features/setting_spec.rb +33 -0
  46. data/spec/features/shared_examples/configurable_daemon_settings.rb +17 -0
  47. data/spec/features/{fluentd/setting/source_and_output_spec.rb → source_and_output_spec.rb} +2 -13
  48. data/spec/lib/file_reverse_reader_spec.rb +33 -13
  49. data/spec/models/fluent_gem_spec.rb +0 -6
  50. data/spec/models/fluentd/agent/local_common_spec.rb +29 -0
  51. data/spec/spec_helper.rb +3 -0
  52. data/spec/support/login_macro.rb +2 -2
  53. data/spec/support/stub_daemon.rb +12 -0
  54. data/vendor/assets/javascripts/bower/vue/.bower.json +5 -5
  55. data/vendor/assets/javascripts/bower/vue/dist/vue.js +200 -180
  56. data/vendor/assets/javascripts/bower/vue/dist/vue.min.js +3 -3
  57. data/vendor/assets/javascripts/bower/vue/src/api/lifecycle.js +3 -75
  58. data/vendor/assets/javascripts/bower/vue/src/compiler/transclude.js +9 -26
  59. data/vendor/assets/javascripts/bower/vue/src/directive.js +8 -7
  60. data/vendor/assets/javascripts/bower/vue/src/directives/component.js +3 -21
  61. data/vendor/assets/javascripts/bower/vue/src/directives/html.js +2 -1
  62. data/vendor/assets/javascripts/bower/vue/src/directives/repeat.js +16 -10
  63. data/vendor/assets/javascripts/bower/vue/src/instance/compile.js +116 -8
  64. data/vendor/assets/javascripts/bower/vue/src/observer/object.js +5 -14
  65. data/vendor/assets/javascripts/bower/vue/src/parsers/template.js +7 -5
  66. data/vendor/assets/javascripts/bower/vue/src/util/dom.js +21 -0
  67. data/vendor/assets/javascripts/bower/vue/src/util/merge-option.js +9 -12
  68. metadata +131 -52
  69. checksums.yaml +0 -7
@@ -0,0 +1,12 @@
1
+ module StubDaemon
2
+ shared_context 'stub daemon', stub: :daemon do
3
+ let!(:exists_user) { build(:user) }
4
+ let!(:daemon) { build(:fluentd, variant: "td-agent") }
5
+
6
+ before do
7
+ Fluentd.stub(:instance).and_return(daemon)
8
+ Fluentd::Agent::TdAgent.any_instance.stub(:detached_command).and_return(true)
9
+ daemon.agent.config_write ""
10
+ end
11
+ end
12
+ end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "main": "dist/vue.js",
5
5
  "description": "Simple, Fast & Composable MVVM for building interative interfaces",
6
6
  "authors": [
@@ -17,13 +17,13 @@
17
17
  "*.md"
18
18
  ],
19
19
  "homepage": "https://github.com/yyx990803/vue",
20
- "_release": "0.11.1",
20
+ "_release": "0.11.2",
21
21
  "_resolution": {
22
22
  "type": "version",
23
- "tag": "0.11.1",
24
- "commit": "0df318c29d7e10bfa8e5c7ca31837af91ff3174c"
23
+ "tag": "0.11.2",
24
+ "commit": "51cfffbdba03b937f0ef8efe40a87521852d601e"
25
25
  },
26
26
  "_source": "git://github.com/yyx990803/vue.git",
27
- "_target": "~0.11.1",
27
+ "_target": "~0.11.2",
28
28
  "_originalSource": "vue"
29
29
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Vue.js v0.11.1
2
+ * Vue.js v0.11.2
3
3
  * (c) 2014 Evan You
4
4
  * Released under the MIT License.
5
5
  */
@@ -987,84 +987,12 @@ return /******/ (function(modules) { // webpackBootstrap
987
987
  }
988
988
 
989
989
  /**
990
- * Teardown an instance, unobserves the data, unbind all the
991
- * directives, turn off all the event listeners, etc.
992
- *
993
- * @param {Boolean} remove - whether to remove the DOM node.
994
- * @param {Boolean} deferCleanup - if true, defer cleanup to
995
- * be called later
996
- * @public
990
+ * Teardown the instance, simply delegate to the internal
991
+ * _destroy.
997
992
  */
998
993
 
999
994
  exports.$destroy = function (remove, deferCleanup) {
1000
- if (this._isBeingDestroyed) {
1001
- return
1002
- }
1003
- this._callHook('beforeDestroy')
1004
- this._isBeingDestroyed = true
1005
- var i
1006
- // remove self from parent. only necessary
1007
- // if parent is not being destroyed as well.
1008
- var parent = this.$parent
1009
- if (parent && !parent._isBeingDestroyed) {
1010
- i = parent._children.indexOf(this)
1011
- parent._children.splice(i, 1)
1012
- }
1013
- // destroy all children.
1014
- if (this._children) {
1015
- i = this._children.length
1016
- while (i--) {
1017
- this._children[i].$destroy()
1018
- }
1019
- }
1020
- // teardown all directives. this also tearsdown all
1021
- // directive-owned watchers.
1022
- i = this._directives.length
1023
- while (i--) {
1024
- this._directives[i]._teardown()
1025
- }
1026
- // teardown all user watchers.
1027
- for (i in this._userWatchers) {
1028
- this._userWatchers[i].teardown()
1029
- }
1030
- // remove reference to self on $el
1031
- if (this.$el) {
1032
- this.$el.__vue__ = null
1033
- }
1034
- // remove DOM element
1035
- var self = this
1036
- if (remove && this.$el) {
1037
- this.$remove(function () {
1038
- self._cleanup()
1039
- })
1040
- } else if (!deferCleanup) {
1041
- this._cleanup()
1042
- }
1043
- }
1044
-
1045
- /**
1046
- * Clean up to ensure garbage collection.
1047
- * This is called after the leave transition if there
1048
- * is any.
1049
- */
1050
-
1051
- exports._cleanup = function () {
1052
- // remove reference from data ob
1053
- this._data.__ob__.removeVm(this)
1054
- this._data =
1055
- this._watchers =
1056
- this._userWatchers =
1057
- this._watcherList =
1058
- this.$el =
1059
- this.$parent =
1060
- this.$root =
1061
- this._children =
1062
- this._directives = null
1063
- // call the last hook...
1064
- this._isDestroyed = true
1065
- this._callHook('destroyed')
1066
- // turn off all instance listeners.
1067
- this.$off()
995
+ this._destroy(remove, deferCleanup)
1068
996
  }
1069
997
 
1070
998
  /**
@@ -1700,15 +1628,36 @@ return /******/ (function(modules) { // webpackBootstrap
1700
1628
 
1701
1629
  exports._compile = function (el) {
1702
1630
  var options = this.$options
1703
- if (options._linker) {
1631
+ if (options._linkFn) {
1704
1632
  this._initElement(el)
1705
- options._linker(this, el)
1633
+ options._linkFn(this, el)
1706
1634
  } else {
1707
1635
  var raw = el
1708
- el = transclude(el, options)
1636
+ if (options._asComponent) {
1637
+ // separate container element and content
1638
+ var content = options._content = _.extractContent(raw)
1639
+ // create two separate linekrs for container and content
1640
+ var containerLinkFn =
1641
+ compile(raw, options, true, true)
1642
+ if (content) {
1643
+ var contentLinkFn =
1644
+ compile(content, options, true, true)
1645
+ // call content linker now, before transclusion
1646
+ this._contentUnlinkFn =
1647
+ contentLinkFn(options._parent, content)
1648
+ }
1649
+ // tranclude, this possibly replaces original
1650
+ el = transclude(el, options)
1651
+ // now call the container linker on the resolved el
1652
+ this._containerUnlinkFn =
1653
+ containerLinkFn(options._parent, el)
1654
+ } else {
1655
+ // simply transclude
1656
+ el = transclude(el, options)
1657
+ }
1709
1658
  this._initElement(el)
1710
- var linker = compile(el, options)
1711
- linker(this, el)
1659
+ var linkFn = compile(el, options)
1660
+ linkFn(this, el)
1712
1661
  if (options.replace) {
1713
1662
  _.replace(raw, el)
1714
1663
  }
@@ -1743,15 +1692,102 @@ return /******/ (function(modules) { // webpackBootstrap
1743
1692
  * @param {Node} node - target node
1744
1693
  * @param {Object} desc - parsed directive descriptor
1745
1694
  * @param {Object} def - directive definition object
1746
- * @param {Function} [linker] - pre-compiled linker fn
1747
1695
  */
1748
1696
 
1749
- exports._bindDir = function (name, node, desc, def, linker) {
1697
+ exports._bindDir = function (name, node, desc, def) {
1750
1698
  this._directives.push(
1751
- new Directive(name, node, this, desc, def, linker)
1699
+ new Directive(name, node, this, desc, def)
1752
1700
  )
1753
1701
  }
1754
1702
 
1703
+ /**
1704
+ * Teardown an instance, unobserves the data, unbind all the
1705
+ * directives, turn off all the event listeners, etc.
1706
+ *
1707
+ * @param {Boolean} remove - whether to remove the DOM node.
1708
+ * @param {Boolean} deferCleanup - if true, defer cleanup to
1709
+ * be called later
1710
+ */
1711
+
1712
+ exports._destroy = function (remove, deferCleanup) {
1713
+ if (this._isBeingDestroyed) {
1714
+ return
1715
+ }
1716
+ this._callHook('beforeDestroy')
1717
+ this._isBeingDestroyed = true
1718
+ var i
1719
+ // remove self from parent. only necessary
1720
+ // if parent is not being destroyed as well.
1721
+ var parent = this.$parent
1722
+ if (parent && !parent._isBeingDestroyed) {
1723
+ i = parent._children.indexOf(this)
1724
+ parent._children.splice(i, 1)
1725
+ }
1726
+ // destroy all children.
1727
+ if (this._children) {
1728
+ i = this._children.length
1729
+ while (i--) {
1730
+ this._children[i].$destroy()
1731
+ }
1732
+ }
1733
+ // teardown parent linkers
1734
+ if (this._containerUnlinkFn) {
1735
+ this._containerUnlinkFn()
1736
+ }
1737
+ if (this._contentUnlinkFn) {
1738
+ this._contentUnlinkFn()
1739
+ }
1740
+ // teardown all directives. this also tearsdown all
1741
+ // directive-owned watchers. intentionally check for
1742
+ // directives array length on every loop since directives
1743
+ // that manages partial compilation can splice ones out
1744
+ for (i = 0; i < this._directives.length; i++) {
1745
+ this._directives[i]._teardown()
1746
+ }
1747
+ // teardown all user watchers.
1748
+ for (i in this._userWatchers) {
1749
+ this._userWatchers[i].teardown()
1750
+ }
1751
+ // remove reference to self on $el
1752
+ if (this.$el) {
1753
+ this.$el.__vue__ = null
1754
+ }
1755
+ // remove DOM element
1756
+ var self = this
1757
+ if (remove && this.$el) {
1758
+ this.$remove(function () {
1759
+ self._cleanup()
1760
+ })
1761
+ } else if (!deferCleanup) {
1762
+ this._cleanup()
1763
+ }
1764
+ }
1765
+
1766
+ /**
1767
+ * Clean up to ensure garbage collection.
1768
+ * This is called after the leave transition if there
1769
+ * is any.
1770
+ */
1771
+
1772
+ exports._cleanup = function () {
1773
+ // remove reference from data ob
1774
+ this._data.__ob__.removeVm(this)
1775
+ this._data =
1776
+ this._watchers =
1777
+ this._userWatchers =
1778
+ this._watcherList =
1779
+ this.$el =
1780
+ this.$parent =
1781
+ this.$root =
1782
+ this._children =
1783
+ this._directives = null
1784
+ // call the last hook...
1785
+ this._isDestroyed = true
1786
+ this._callHook('destroyed')
1787
+ // turn off all instance listeners.
1788
+ this.$off()
1789
+ }
1790
+
1755
1791
  /***/ },
1756
1792
  /* 14 */
1757
1793
  /***/ function(module, exports, __webpack_require__) {
@@ -2192,6 +2228,27 @@ return /******/ (function(modules) { // webpackBootstrap
2192
2228
  }
2193
2229
  }
2194
2230
 
2231
+ /**
2232
+ * Extract raw content inside an element into a temporary
2233
+ * container div
2234
+ *
2235
+ * @param {Element} el
2236
+ * @return {Element}
2237
+ */
2238
+
2239
+ exports.extractContent = function (el) {
2240
+ var child
2241
+ var rawContent
2242
+ if (el.hasChildNodes()) {
2243
+ rawContent = document.createElement('div')
2244
+ /* jshint boss:true */
2245
+ while (child = el.firstChild) {
2246
+ rawContent.appendChild(child)
2247
+ }
2248
+ }
2249
+ return rawContent
2250
+ }
2251
+
2195
2252
  /***/ },
2196
2253
  /* 17 */
2197
2254
  /***/ function(module, exports, __webpack_require__) {
@@ -2564,25 +2621,22 @@ return /******/ (function(modules) { // webpackBootstrap
2564
2621
  guardComponents(child.components)
2565
2622
  var options = {}
2566
2623
  var key
2624
+ if (child.mixins) {
2625
+ for (var i = 0, l = child.mixins.length; i < l; i++) {
2626
+ parent = mergeOptions(parent, child.mixins[i], vm)
2627
+ }
2628
+ }
2567
2629
  for (key in parent) {
2568
- merge(parent[key], child[key], key)
2630
+ merge(key)
2569
2631
  }
2570
2632
  for (key in child) {
2571
2633
  if (!(parent.hasOwnProperty(key))) {
2572
- merge(parent[key], child[key], key)
2634
+ merge(key)
2573
2635
  }
2574
2636
  }
2575
- var mixins = child.mixins
2576
- if (mixins) {
2577
- for (var i = 0, l = mixins.length; i < l; i++) {
2578
- for (key in mixins[i]) {
2579
- merge(options[key], mixins[i][key], key)
2580
- }
2581
- }
2582
- }
2583
- function merge (parentVal, childVal, key) {
2637
+ function merge (key) {
2584
2638
  var strat = strats[key] || defaultStrat
2585
- options[key] = strat(parentVal, childVal, vm, key)
2639
+ options[key] = strat(parent[key], child[key], vm, key)
2586
2640
  }
2587
2641
  return options
2588
2642
  }
@@ -2970,7 +3024,8 @@ return /******/ (function(modules) { // webpackBootstrap
2970
3024
  _.remove(this.nodes[i])
2971
3025
  }
2972
3026
  // convert new value to a fragment
2973
- var frag = templateParser.parse(value, true)
3027
+ // do not attempt to retrieve from id selector
3028
+ var frag = templateParser.parse(value, true, true)
2974
3029
  // save a reference to these nodes so we can remove later
2975
3030
  this.nodes = _.toArray(frag.childNodes)
2976
3031
  _.before(frag, this.el)
@@ -3313,7 +3368,6 @@ return /******/ (function(modules) { // webpackBootstrap
3313
3368
  /***/ function(module, exports, __webpack_require__) {
3314
3369
 
3315
3370
  var _ = __webpack_require__(1)
3316
- var compile = __webpack_require__(41)
3317
3371
  var templateParser = __webpack_require__(45)
3318
3372
 
3319
3373
  module.exports = {
@@ -3344,12 +3398,6 @@ return /******/ (function(modules) { // webpackBootstrap
3344
3398
  if (this.keepAlive) {
3345
3399
  this.cache = {}
3346
3400
  }
3347
- // compile parent scope content
3348
- this.parentLinkFn = compile(
3349
- this.el, this.vm.$options,
3350
- true, // partial
3351
- true // asParent
3352
- )
3353
3401
  // if static, build right now.
3354
3402
  if (!this._isDynamicLiteral) {
3355
3403
  this.resolveCtor(this.expression)
@@ -3397,14 +3445,10 @@ return /******/ (function(modules) { // webpackBootstrap
3397
3445
  var vm = this.vm
3398
3446
  var el = templateParser.clone(this.el)
3399
3447
  if (this.Ctor) {
3400
- var parentUnlinkFn
3401
- if (this.parentLinkFn) {
3402
- parentUnlinkFn = this.parentLinkFn(vm, el)
3403
- }
3404
3448
  var child = vm.$addChild({
3405
- el: el
3449
+ el: el,
3450
+ _asComponent: true
3406
3451
  }, this.Ctor)
3407
- child._parentUnlinkFn = parentUnlinkFn
3408
3452
  if (this.keepAlive) {
3409
3453
  this.cache[this.ctorId] = child
3410
3454
  }
@@ -3422,9 +3466,6 @@ return /******/ (function(modules) { // webpackBootstrap
3422
3466
  if (!child || this.keepAlive) {
3423
3467
  return
3424
3468
  }
3425
- if (child._parentUnlinkFn) {
3426
- child._parentUnlinkFn()
3427
- }
3428
3469
  // the sole purpose of `deferCleanup` is so that we can
3429
3470
  // "deactivate" the vm right now and perform DOM removal
3430
3471
  // later.
@@ -3515,11 +3556,7 @@ return /******/ (function(modules) { // webpackBootstrap
3515
3556
  // destroy all keep-alive cached instances
3516
3557
  if (this.cache) {
3517
3558
  for (var key in this.cache) {
3518
- var child = this.cache[key]
3519
- if (child._parentUnlinkFn) {
3520
- child._parentUnlinkFn()
3521
- }
3522
- child.$destroy()
3559
+ this.cache[key].$destroy()
3523
3560
  }
3524
3561
  this.cache = null
3525
3562
  }
@@ -3551,7 +3588,8 @@ return /******/ (function(modules) { // webpackBootstrap
3551
3588
  // uid as a cache identifier
3552
3589
  this.id = '__v_repeat_' + (++uid)
3553
3590
  // we need to insert the objToArray converter
3554
- // as the first read filter.
3591
+ // as the first read filter, because it has to be invoked
3592
+ // before any user filters. (can't do it in `update`)
3555
3593
  if (!this.filters) {
3556
3594
  this.filters = {}
3557
3595
  }
@@ -3625,22 +3663,26 @@ return /******/ (function(modules) { // webpackBootstrap
3625
3663
  // important: transclude with no options, just
3626
3664
  // to ensure block start and block end
3627
3665
  this.template = transclude(this.template)
3628
- this._linker = compile(this.template, options)
3666
+ this._linkFn = compile(this.template, options)
3629
3667
  } else {
3668
+ this._asComponent = true
3630
3669
  var tokens = textParser.parse(id)
3631
3670
  if (!tokens) { // static component
3632
3671
  var Ctor = this.Ctor = options.components[id]
3633
3672
  _.assertAsset(Ctor, 'component', id)
3634
- if (Ctor) {
3673
+ // If there's no parent scope directives and no
3674
+ // content to be transcluded, we can optimize the
3675
+ // rendering by pre-transcluding + compiling here
3676
+ // and provide a link function to every instance.
3677
+ if (!this.el.hasChildNodes() &&
3678
+ !this.el.hasAttributes()) {
3635
3679
  // merge an empty object with owner vm as parent
3636
3680
  // so child vms can access parent assets.
3637
- var merged = mergeOptions(
3638
- Ctor.options,
3639
- {},
3640
- { $parent: this.vm }
3641
- )
3681
+ var merged = mergeOptions(Ctor.options, {}, {
3682
+ $parent: this.vm
3683
+ })
3642
3684
  this.template = transclude(this.template, merged)
3643
- this._linker = compile(this.template, merged)
3685
+ this._linkFn = compile(this.template, merged)
3644
3686
  }
3645
3687
  } else {
3646
3688
  // to be resolved later
@@ -3807,7 +3849,8 @@ return /******/ (function(modules) { // webpackBootstrap
3807
3849
  var Ctor = this.Ctor || this.resolveCtor(data, meta)
3808
3850
  var vm = this.vm.$addChild({
3809
3851
  el: templateParser.clone(this.template),
3810
- _linker: this._linker,
3852
+ _asComponent: this._asComponent,
3853
+ _linkFn: this._linkFn,
3811
3854
  _meta: meta,
3812
3855
  data: data,
3813
3856
  inherit: this.inherit
@@ -4344,11 +4387,10 @@ return /******/ (function(modules) { // webpackBootstrap
4344
4387
  * - {String} [arg]
4345
4388
  * - {Array<Object>} [filters]
4346
4389
  * @param {Object} def - directive definition object
4347
- * @param {Function} [linker] - pre-compiled linker function
4348
4390
  * @constructor
4349
4391
  */
4350
4392
 
4351
- function Directive (name, el, vm, descriptor, def, linker) {
4393
+ function Directive (name, el, vm, descriptor, def) {
4352
4394
  // public
4353
4395
  this.name = name
4354
4396
  this.el = el
@@ -4359,7 +4401,6 @@ return /******/ (function(modules) { // webpackBootstrap
4359
4401
  this.arg = descriptor.arg
4360
4402
  this.filters = _.resolveFilters(vm, descriptor.filters)
4361
4403
  // private
4362
- this._linker = linker
4363
4404
  this._locked = false
4364
4405
  this._bound = false
4365
4406
  // init
@@ -4395,9 +4436,6 @@ return /******/ (function(modules) { // webpackBootstrap
4395
4436
  (!this.isLiteral || this._isDynamicLiteral) &&
4396
4437
  !this._checkStatement()
4397
4438
  ) {
4398
- // use raw expression as identifier because filters
4399
- // make them different watchers
4400
- var watcher = this.vm._watchers[this.raw]
4401
4439
  // wrapped updater for context
4402
4440
  var dir = this
4403
4441
  var update = this._update = function (val, oldVal) {
@@ -4405,7 +4443,13 @@ return /******/ (function(modules) { // webpackBootstrap
4405
4443
  dir.update(val, oldVal)
4406
4444
  }
4407
4445
  }
4408
- if (!watcher) {
4446
+ // use raw expression as identifier because filters
4447
+ // make them different watchers
4448
+ var watcher = this.vm._watchers[this.raw]
4449
+ // v-repeat always creates a new watcher because it has
4450
+ // a special filter that's bound to its directive
4451
+ // instance.
4452
+ if (!watcher || this.name === 'repeat') {
4409
4453
  watcher = this.vm._watchers[this.raw] = new Watcher(
4410
4454
  this.vm,
4411
4455
  this._watcherExp,
@@ -5147,43 +5191,25 @@ return /******/ (function(modules) { // webpackBootstrap
5147
5191
  if (!frag) {
5148
5192
  _.warn('Invalid template option: ' + template)
5149
5193
  } else {
5150
- collectRawContent(el)
5194
+ var rawContent = options._content || _.extractContent(el)
5151
5195
  if (options.replace) {
5152
5196
  if (frag.childNodes.length > 1) {
5153
- transcludeContent(frag)
5197
+ transcludeContent(frag, rawContent)
5154
5198
  return frag
5155
5199
  } else {
5156
5200
  var replacer = frag.firstChild
5157
5201
  _.copyAttributes(el, replacer)
5158
- transcludeContent(replacer)
5202
+ transcludeContent(replacer, rawContent)
5159
5203
  return replacer
5160
5204
  }
5161
5205
  } else {
5162
5206
  el.appendChild(frag)
5163
- transcludeContent(el)
5207
+ transcludeContent(el, rawContent)
5164
5208
  return el
5165
5209
  }
5166
5210
  }
5167
5211
  }
5168
5212
 
5169
- /**
5170
- * Collect raw content inside $el before they are
5171
- * replaced by template content.
5172
- */
5173
-
5174
- var rawContent
5175
- function collectRawContent (el) {
5176
- var child
5177
- rawContent = null
5178
- if (el.hasChildNodes()) {
5179
- rawContent = document.createElement('div')
5180
- /* jshint boss:true */
5181
- while (child = el.firstChild) {
5182
- rawContent.appendChild(child)
5183
- }
5184
- }
5185
- }
5186
-
5187
5213
  /**
5188
5214
  * Resolve <content> insertion points mimicking the behavior
5189
5215
  * of the Shadow DOM spec:
@@ -5191,9 +5217,10 @@ return /******/ (function(modules) { // webpackBootstrap
5191
5217
  * http://w3c.github.io/webcomponents/spec/shadow/#insertion-points
5192
5218
  *
5193
5219
  * @param {Element|DocumentFragment} el
5220
+ * @param {Element} raw
5194
5221
  */
5195
5222
 
5196
- function transcludeContent (el) {
5223
+ function transcludeContent (el, raw) {
5197
5224
  var outlets = getOutlets(el)
5198
5225
  var i = outlets.length
5199
5226
  if (!i) return
@@ -5202,10 +5229,10 @@ return /******/ (function(modules) { // webpackBootstrap
5202
5229
  // for each outlet.
5203
5230
  while (i--) {
5204
5231
  outlet = outlets[i]
5205
- if (rawContent) {
5232
+ if (raw) {
5206
5233
  select = outlet.getAttribute('select')
5207
5234
  if (select) { // select content
5208
- selected = rawContent.querySelectorAll(select)
5235
+ selected = raw.querySelectorAll(select)
5209
5236
  outlet.content = _.toArray(
5210
5237
  selected.length
5211
5238
  ? selected
@@ -5227,7 +5254,7 @@ return /******/ (function(modules) { // webpackBootstrap
5227
5254
  }
5228
5255
  // finally insert the main content
5229
5256
  if (main) {
5230
- insertContentAt(main, _.toArray(rawContent.childNodes))
5257
+ insertContentAt(main, _.toArray(raw.childNodes))
5231
5258
  }
5232
5259
  }
5233
5260
 
@@ -5759,7 +5786,8 @@ return /******/ (function(modules) { // webpackBootstrap
5759
5786
 
5760
5787
  var _ = __webpack_require__(1)
5761
5788
  var Cache = __webpack_require__(52)
5762
- var templateCache = new Cache(100)
5789
+ var templateCache = new Cache(1000)
5790
+ var idSelectorCache = new Cache(1000)
5763
5791
 
5764
5792
  var map = {
5765
5793
  _default : [0, '', ''],
@@ -5963,10 +5991,11 @@ return /******/ (function(modules) { // webpackBootstrap
5963
5991
  * - id selector: '#some-template-id'
5964
5992
  * - template string: '<div><span>{{msg}}</span></div>'
5965
5993
  * @param {Boolean} clone
5994
+ * @param {Boolean} noSelector
5966
5995
  * @return {DocumentFragment|undefined}
5967
5996
  */
5968
5997
 
5969
- exports.parse = function (template, clone) {
5998
+ exports.parse = function (template, clone, noSelector) {
5970
5999
  var node, frag
5971
6000
 
5972
6001
  // if the template is already a document fragment,
@@ -5979,15 +6008,15 @@ return /******/ (function(modules) { // webpackBootstrap
5979
6008
 
5980
6009
  if (typeof template === 'string') {
5981
6010
  // id selector
5982
- if (template.charAt(0) === '#') {
6011
+ if (!noSelector && template.charAt(0) === '#') {
5983
6012
  // id selector can be cached too
5984
- frag = templateCache.get(template)
6013
+ frag = idSelectorCache.get(template)
5985
6014
  if (!frag) {
5986
6015
  node = document.getElementById(template.slice(1))
5987
6016
  if (node) {
5988
6017
  frag = nodeToFragment(node)
5989
6018
  // save selector to cache
5990
- templateCache.put(template, frag)
6019
+ idSelectorCache.put(template, frag)
5991
6020
  }
5992
6021
  }
5993
6022
  } else {
@@ -7761,16 +7790,12 @@ return /******/ (function(modules) { // webpackBootstrap
7761
7790
  objProto,
7762
7791
  '$add',
7763
7792
  function $add (key, val) {
7793
+ if (this.hasOwnProperty(key)) return
7764
7794
  var ob = this.__ob__
7765
- if (!ob) {
7795
+ if (!ob || _.isReserved(key)) {
7766
7796
  this[key] = val
7767
7797
  return
7768
7798
  }
7769
- if (_.isReserved(key)) {
7770
- _.warn('Refused to $add reserved key: ' + key)
7771
- return
7772
- }
7773
- if (this.hasOwnProperty(key)) return
7774
7799
  ob.convert(key, val)
7775
7800
  if (ob.vms) {
7776
7801
  var i = ob.vms.length
@@ -7797,17 +7822,12 @@ return /******/ (function(modules) { // webpackBootstrap
7797
7822
  objProto,
7798
7823
  '$delete',
7799
7824
  function $delete (key) {
7825
+ if (!this.hasOwnProperty(key)) return
7826
+ delete this[key]
7800
7827
  var ob = this.__ob__
7801
- if (!ob) {
7802
- delete this[key]
7803
- return
7804
- }
7805
- if (_.isReserved(key)) {
7806
- _.warn('Refused to $add reserved key: ' + key)
7828
+ if (!ob || _.isReserved(key)) {
7807
7829
  return
7808
7830
  }
7809
- if (!this.hasOwnProperty(key)) return
7810
- delete this[key]
7811
7831
  if (ob.vms) {
7812
7832
  var i = ob.vms.length
7813
7833
  while (i--) {