fluentd-ui 0.3.13 → 0.3.14
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fluentd-ui might be problematic. Click here for more details.
- data/ChangeLog +9 -0
- data/Gemfile.lock +47 -44
- data/README.md +4 -4
- data/app/assets/javascripts/vue/in_tail_format.js +7 -2
- data/app/assets/stylesheets/common.css.scss +16 -0
- data/app/controllers/concerns/setting_history_concern.rb +6 -0
- data/app/controllers/fluentd/settings_controller.rb +37 -8
- data/app/models/fluent_gem.rb +6 -3
- data/app/models/fluentd/agent.rb +1 -0
- data/app/models/fluentd/agent/common.rb +4 -0
- data/app/models/fluentd/agent/fluentd_gem.rb +9 -13
- data/app/models/fluentd/agent/local_common.rb +23 -0
- data/app/models/fluentd/agent/td_agent.rb +4 -0
- data/app/models/fluentd/agent/td_agent/macosx.rb +0 -4
- data/app/models/fluentd/agent/td_agent/unix.rb +0 -4
- data/app/views/fluentd/settings/edit.html.haml +1 -3
- data/app/views/fluentd/settings/histories/show.html.haml +10 -0
- data/app/views/fluentd/settings/running_backup/show.html.haml +11 -0
- data/app/views/shared/settings/_diff.html.erb +21 -0
- data/circle.yml +5 -0
- data/config/application.rb +1 -0
- data/config/locales/translation_en.yml +7 -0
- data/config/locales/translation_ja.yml +7 -0
- data/fluentd-ui.gemspec +1 -0
- data/lib/fluentd-ui.rb +5 -1
- data/lib/fluentd-ui/version.rb +1 -1
- data/spec/features/fluentd/setting/histories_spec.rb +23 -1
- data/spec/features/fluentd/setting/running_backup_spec.rb +22 -1
- data/spec/models/fluentd/agent/local_common_spec.rb +4 -2
- data/spec/models/fluentd/agent_spec.rb +1 -48
- data/spec/models/plugin_spec.rb +2 -2
- data/spec/spec_helper.rb +10 -0
- data/spec/support/fluentd_agent_common_behavior.rb +53 -0
- data/vendor/assets/javascripts/bower/.gitignore +10 -0
- data/vendor/assets/javascripts/bower/vue/.bower.json +4 -4
- data/vendor/assets/javascripts/bower/vue/bower.json +17 -0
- data/vendor/assets/javascripts/bower/vue/dist/vue.js +329 -198
- data/vendor/assets/javascripts/bower/vue/dist/vue.min.js +3 -3
- metadata +107 -291
- checksums.yaml +0 -7
- data/vendor/assets/javascripts/bower/codemirror/AUTHORS +0 -423
- data/vendor/assets/javascripts/bower/codemirror/CONTRIBUTING.md +0 -76
- data/vendor/assets/javascripts/bower/codemirror/LICENSE +0 -19
- data/vendor/assets/javascripts/bower/codemirror/README.md +0 -11
- data/vendor/assets/javascripts/bower/codemirror/addon/comment/comment.js +0 -183
- data/vendor/assets/javascripts/bower/codemirror/addon/comment/continuecomment.js +0 -85
- data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.css +0 -32
- data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.js +0 -155
- data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.css +0 -6
- data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.js +0 -41
- data/vendor/assets/javascripts/bower/codemirror/addon/display/panel.js +0 -94
- data/vendor/assets/javascripts/bower/codemirror/addon/display/placeholder.js +0 -58
- data/vendor/assets/javascripts/bower/codemirror/addon/display/rulers.js +0 -64
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/closebrackets.js +0 -159
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/closetag.js +0 -159
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/continuelist.js +0 -51
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchbrackets.js +0 -120
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchtags.js +0 -66
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/trailingspace.js +0 -27
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/brace-fold.js +0 -105
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/comment-fold.js +0 -57
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldcode.js +0 -145
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.css +0 -20
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.js +0 -134
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/indent-fold.js +0 -44
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/markdown-fold.js +0 -49
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/xml-fold.js +0 -182
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/anyword-hint.js +0 -41
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/css-hint.js +0 -56
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/html-hint.js +0 -348
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/javascript-hint.js +0 -146
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.css +0 -38
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.js +0 -389
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/sql-hint.js +0 -197
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/xml-hint.js +0 -110
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/coffeescript-lint.js +0 -41
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/css-lint.js +0 -35
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/javascript-lint.js +0 -136
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/json-lint.js +0 -31
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.css +0 -73
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.js +0 -204
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/yaml-lint.js +0 -28
- data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.css +0 -112
- data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.js +0 -643
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/loadmode.js +0 -64
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex.js +0 -118
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex_test.js +0 -33
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/overlay.js +0 -85
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/simple.js +0 -213
- data/vendor/assets/javascripts/bower/codemirror/addon/runmode/colorize.js +0 -40
- data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode-standalone.js +0 -157
- data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.js +0 -72
- data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.node.js +0 -120
- data/vendor/assets/javascripts/bower/codemirror/addon/scroll/annotatescrollbar.js +0 -76
- data/vendor/assets/javascripts/bower/codemirror/addon/scroll/scrollpastend.js +0 -46
- data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.css +0 -66
- data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.js +0 -139
- data/vendor/assets/javascripts/bower/codemirror/addon/search/match-highlighter.js +0 -128
- data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.css +0 -8
- data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.js +0 -90
- data/vendor/assets/javascripts/bower/codemirror/addon/search/search.js +0 -164
- data/vendor/assets/javascripts/bower/codemirror/addon/search/searchcursor.js +0 -189
- data/vendor/assets/javascripts/bower/codemirror/addon/selection/active-line.js +0 -71
- data/vendor/assets/javascripts/bower/codemirror/addon/selection/mark-selection.js +0 -118
- data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.css +0 -86
- data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.js +0 -670
- data/vendor/assets/javascripts/bower/codemirror/addon/tern/worker.js +0 -44
- data/vendor/assets/javascripts/bower/codemirror/addon/wrap/hardwrap.js +0 -139
- data/vendor/assets/javascripts/bower/codemirror/keymap/emacs.js +0 -411
- data/vendor/assets/javascripts/bower/codemirror/keymap/sublime.js +0 -540
- data/vendor/assets/javascripts/bower/codemirror/keymap/vim.js +0 -4901
- data/vendor/assets/javascripts/bower/codemirror/mode/apl/apl.js +0 -175
- data/vendor/assets/javascripts/bower/codemirror/mode/asterisk/asterisk.js +0 -198
- data/vendor/assets/javascripts/bower/codemirror/mode/clike/clike.js +0 -489
- data/vendor/assets/javascripts/bower/codemirror/mode/clike/scala.html +0 -767
- data/vendor/assets/javascripts/bower/codemirror/mode/clojure/clojure.js +0 -243
- data/vendor/assets/javascripts/bower/codemirror/mode/cobol/cobol.js +0 -255
- data/vendor/assets/javascripts/bower/codemirror/mode/coffeescript/coffeescript.js +0 -369
- data/vendor/assets/javascripts/bower/codemirror/mode/commonlisp/commonlisp.js +0 -122
- data/vendor/assets/javascripts/bower/codemirror/mode/css/css.js +0 -717
- data/vendor/assets/javascripts/bower/codemirror/mode/css/less.html +0 -152
- data/vendor/assets/javascripts/bower/codemirror/mode/css/less_test.js +0 -51
- data/vendor/assets/javascripts/bower/codemirror/mode/css/scss.html +0 -157
- data/vendor/assets/javascripts/bower/codemirror/mode/css/scss_test.js +0 -110
- data/vendor/assets/javascripts/bower/codemirror/mode/css/test.js +0 -135
- data/vendor/assets/javascripts/bower/codemirror/mode/cypher/cypher.js +0 -146
- data/vendor/assets/javascripts/bower/codemirror/mode/d/d.js +0 -218
- data/vendor/assets/javascripts/bower/codemirror/mode/dart/dart.js +0 -50
- data/vendor/assets/javascripts/bower/codemirror/mode/diff/diff.js +0 -47
- data/vendor/assets/javascripts/bower/codemirror/mode/django/django.js +0 -67
- data/vendor/assets/javascripts/bower/codemirror/mode/dockerfile/dockerfile.js +0 -76
- data/vendor/assets/javascripts/bower/codemirror/mode/dtd/dtd.js +0 -142
- data/vendor/assets/javascripts/bower/codemirror/mode/dylan/dylan.js +0 -299
- data/vendor/assets/javascripts/bower/codemirror/mode/ebnf/ebnf.js +0 -195
- data/vendor/assets/javascripts/bower/codemirror/mode/ecl/ecl.js +0 -207
- data/vendor/assets/javascripts/bower/codemirror/mode/eiffel/eiffel.js +0 -162
- data/vendor/assets/javascripts/bower/codemirror/mode/erlang/erlang.js +0 -622
- data/vendor/assets/javascripts/bower/codemirror/mode/fortran/fortran.js +0 -188
- data/vendor/assets/javascripts/bower/codemirror/mode/gas/gas.js +0 -345
- data/vendor/assets/javascripts/bower/codemirror/mode/gfm/gfm.js +0 -123
- data/vendor/assets/javascripts/bower/codemirror/mode/gfm/test.js +0 -213
- data/vendor/assets/javascripts/bower/codemirror/mode/gherkin/gherkin.js +0 -178
- data/vendor/assets/javascripts/bower/codemirror/mode/go/go.js +0 -184
- data/vendor/assets/javascripts/bower/codemirror/mode/groovy/groovy.js +0 -226
- data/vendor/assets/javascripts/bower/codemirror/mode/haml/haml.js +0 -159
- data/vendor/assets/javascripts/bower/codemirror/mode/haml/test.js +0 -97
- data/vendor/assets/javascripts/bower/codemirror/mode/haskell/haskell.js +0 -267
- data/vendor/assets/javascripts/bower/codemirror/mode/haxe/haxe.js +0 -518
- data/vendor/assets/javascripts/bower/codemirror/mode/htmlembedded/htmlembedded.js +0 -86
- data/vendor/assets/javascripts/bower/codemirror/mode/htmlmixed/htmlmixed.js +0 -121
- data/vendor/assets/javascripts/bower/codemirror/mode/http/http.js +0 -113
- data/vendor/assets/javascripts/bower/codemirror/mode/idl/idl.js +0 -290
- data/vendor/assets/javascripts/bower/codemirror/mode/jade/jade.js +0 -590
- data/vendor/assets/javascripts/bower/codemirror/mode/javascript/javascript.js +0 -686
- data/vendor/assets/javascripts/bower/codemirror/mode/javascript/json-ld.html +0 -72
- data/vendor/assets/javascripts/bower/codemirror/mode/javascript/test.js +0 -200
- data/vendor/assets/javascripts/bower/codemirror/mode/javascript/typescript.html +0 -61
- data/vendor/assets/javascripts/bower/codemirror/mode/jinja2/jinja2.js +0 -142
- data/vendor/assets/javascripts/bower/codemirror/mode/julia/julia.js +0 -301
- data/vendor/assets/javascripts/bower/codemirror/mode/kotlin/kotlin.js +0 -280
- data/vendor/assets/javascripts/bower/codemirror/mode/livescript/livescript.js +0 -280
- data/vendor/assets/javascripts/bower/codemirror/mode/lua/lua.js +0 -159
- data/vendor/assets/javascripts/bower/codemirror/mode/markdown/markdown.js +0 -765
- data/vendor/assets/javascripts/bower/codemirror/mode/markdown/test.js +0 -754
- data/vendor/assets/javascripts/bower/codemirror/mode/meta.js +0 -165
- data/vendor/assets/javascripts/bower/codemirror/mode/mirc/mirc.js +0 -193
- data/vendor/assets/javascripts/bower/codemirror/mode/mllike/mllike.js +0 -205
- data/vendor/assets/javascripts/bower/codemirror/mode/modelica/modelica.js +0 -245
- data/vendor/assets/javascripts/bower/codemirror/mode/nginx/nginx.js +0 -178
- data/vendor/assets/javascripts/bower/codemirror/mode/ntriples/ntriples.js +0 -186
- data/vendor/assets/javascripts/bower/codemirror/mode/octave/octave.js +0 -135
- data/vendor/assets/javascripts/bower/codemirror/mode/pascal/pascal.js +0 -109
- data/vendor/assets/javascripts/bower/codemirror/mode/pegjs/pegjs.js +0 -114
- data/vendor/assets/javascripts/bower/codemirror/mode/perl/perl.js +0 -832
- data/vendor/assets/javascripts/bower/codemirror/mode/php/php.js +0 -226
- data/vendor/assets/javascripts/bower/codemirror/mode/php/test.js +0 -154
- data/vendor/assets/javascripts/bower/codemirror/mode/pig/pig.js +0 -188
- data/vendor/assets/javascripts/bower/codemirror/mode/properties/properties.js +0 -78
- data/vendor/assets/javascripts/bower/codemirror/mode/puppet/puppet.js +0 -220
- data/vendor/assets/javascripts/bower/codemirror/mode/python/python.js +0 -359
- data/vendor/assets/javascripts/bower/codemirror/mode/q/q.js +0 -139
- data/vendor/assets/javascripts/bower/codemirror/mode/r/r.js +0 -162
- data/vendor/assets/javascripts/bower/codemirror/mode/rpm/rpm.js +0 -101
- data/vendor/assets/javascripts/bower/codemirror/mode/rst/rst.js +0 -557
- data/vendor/assets/javascripts/bower/codemirror/mode/ruby/ruby.js +0 -285
- data/vendor/assets/javascripts/bower/codemirror/mode/ruby/test.js +0 -14
- data/vendor/assets/javascripts/bower/codemirror/mode/rust/rust.js +0 -451
- data/vendor/assets/javascripts/bower/codemirror/mode/sass/sass.js +0 -327
- data/vendor/assets/javascripts/bower/codemirror/mode/scheme/scheme.js +0 -248
- data/vendor/assets/javascripts/bower/codemirror/mode/shell/shell.js +0 -139
- data/vendor/assets/javascripts/bower/codemirror/mode/shell/test.js +0 -58
- data/vendor/assets/javascripts/bower/codemirror/mode/sieve/sieve.js +0 -193
- data/vendor/assets/javascripts/bower/codemirror/mode/slim/slim.js +0 -575
- data/vendor/assets/javascripts/bower/codemirror/mode/slim/test.js +0 -96
- data/vendor/assets/javascripts/bower/codemirror/mode/smalltalk/smalltalk.js +0 -168
- data/vendor/assets/javascripts/bower/codemirror/mode/smarty/smarty.js +0 -221
- data/vendor/assets/javascripts/bower/codemirror/mode/smartymixed/smartymixed.js +0 -197
- data/vendor/assets/javascripts/bower/codemirror/mode/solr/solr.js +0 -104
- data/vendor/assets/javascripts/bower/codemirror/mode/soy/soy.js +0 -198
- data/vendor/assets/javascripts/bower/codemirror/mode/sparql/sparql.js +0 -174
- data/vendor/assets/javascripts/bower/codemirror/mode/spreadsheet/spreadsheet.js +0 -109
- data/vendor/assets/javascripts/bower/codemirror/mode/sql/sql.js +0 -391
- data/vendor/assets/javascripts/bower/codemirror/mode/stex/stex.js +0 -251
- data/vendor/assets/javascripts/bower/codemirror/mode/stex/test.js +0 -123
- data/vendor/assets/javascripts/bower/codemirror/mode/tcl/tcl.js +0 -147
- data/vendor/assets/javascripts/bower/codemirror/mode/textile/test.js +0 -417
- data/vendor/assets/javascripts/bower/codemirror/mode/textile/textile.js +0 -469
- data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.css +0 -14
- data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.js +0 -369
- data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.css +0 -26
- data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.js +0 -323
- data/vendor/assets/javascripts/bower/codemirror/mode/toml/toml.js +0 -88
- data/vendor/assets/javascripts/bower/codemirror/mode/tornado/tornado.js +0 -68
- data/vendor/assets/javascripts/bower/codemirror/mode/turtle/turtle.js +0 -162
- data/vendor/assets/javascripts/bower/codemirror/mode/vb/vb.js +0 -274
- data/vendor/assets/javascripts/bower/codemirror/mode/vbscript/vbscript.js +0 -350
- data/vendor/assets/javascripts/bower/codemirror/mode/velocity/velocity.js +0 -201
- data/vendor/assets/javascripts/bower/codemirror/mode/verilog/test.js +0 -273
- data/vendor/assets/javascripts/bower/codemirror/mode/verilog/verilog.js +0 -364
- data/vendor/assets/javascripts/bower/codemirror/mode/xml/test.js +0 -51
- data/vendor/assets/javascripts/bower/codemirror/mode/xml/xml.js +0 -384
- data/vendor/assets/javascripts/bower/codemirror/mode/xquery/test.js +0 -67
- data/vendor/assets/javascripts/bower/codemirror/mode/xquery/xquery.js +0 -447
- data/vendor/assets/javascripts/bower/codemirror/mode/yaml/yaml.js +0 -117
- data/vendor/assets/javascripts/bower/codemirror/mode/z80/z80.js +0 -100
- data/vendor/assets/javascripts/bower/vue/LICENSE +0 -21
- data/vendor/assets/javascripts/bower/vue/src/api/child.js +0 -53
- data/vendor/assets/javascripts/bower/vue/src/api/data.js +0 -161
- data/vendor/assets/javascripts/bower/vue/src/api/dom.js +0 -211
- data/vendor/assets/javascripts/bower/vue/src/api/events.js +0 -176
- data/vendor/assets/javascripts/bower/vue/src/api/global.js +0 -146
- data/vendor/assets/javascripts/bower/vue/src/api/lifecycle.js +0 -72
- data/vendor/assets/javascripts/bower/vue/src/batcher.js +0 -65
- data/vendor/assets/javascripts/bower/vue/src/cache.js +0 -112
- data/vendor/assets/javascripts/bower/vue/src/compiler/compile.js +0 -549
- data/vendor/assets/javascripts/bower/vue/src/compiler/transclude.js +0 -146
- data/vendor/assets/javascripts/bower/vue/src/config.js +0 -79
- data/vendor/assets/javascripts/bower/vue/src/directive.js +0 -219
- data/vendor/assets/javascripts/bower/vue/src/directives/attr.js +0 -32
- data/vendor/assets/javascripts/bower/vue/src/directives/class.js +0 -18
- data/vendor/assets/javascripts/bower/vue/src/directives/cloak.js +0 -12
- data/vendor/assets/javascripts/bower/vue/src/directives/component.js +0 -196
- data/vendor/assets/javascripts/bower/vue/src/directives/el.js +0 -13
- data/vendor/assets/javascripts/bower/vue/src/directives/html.js +0 -38
- data/vendor/assets/javascripts/bower/vue/src/directives/if.js +0 -87
- data/vendor/assets/javascripts/bower/vue/src/directives/index.js +0 -22
- data/vendor/assets/javascripts/bower/vue/src/directives/model/checkbox.js +0 -25
- data/vendor/assets/javascripts/bower/vue/src/directives/model/default.js +0 -123
- data/vendor/assets/javascripts/bower/vue/src/directives/model/index.js +0 -56
- data/vendor/assets/javascripts/bower/vue/src/directives/model/radio.js +0 -26
- data/vendor/assets/javascripts/bower/vue/src/directives/model/select.js +0 -166
- data/vendor/assets/javascripts/bower/vue/src/directives/on.js +0 -59
- data/vendor/assets/javascripts/bower/vue/src/directives/partial.js +0 -44
- data/vendor/assets/javascripts/bower/vue/src/directives/ref.js +0 -24
- data/vendor/assets/javascripts/bower/vue/src/directives/repeat.js +0 -503
- data/vendor/assets/javascripts/bower/vue/src/directives/show.js +0 -8
- data/vendor/assets/javascripts/bower/vue/src/directives/style.js +0 -58
- data/vendor/assets/javascripts/bower/vue/src/directives/text.js +0 -15
- data/vendor/assets/javascripts/bower/vue/src/directives/transition.js +0 -12
- data/vendor/assets/javascripts/bower/vue/src/directives/with.js +0 -47
- data/vendor/assets/javascripts/bower/vue/src/filters/array-filters.js +0 -87
- data/vendor/assets/javascripts/bower/vue/src/filters/index.js +0 -135
- data/vendor/assets/javascripts/bower/vue/src/instance/compile.js +0 -179
- data/vendor/assets/javascripts/bower/vue/src/instance/events.js +0 -122
- data/vendor/assets/javascripts/bower/vue/src/instance/init.js +0 -76
- data/vendor/assets/javascripts/bower/vue/src/instance/scope.js +0 -217
- data/vendor/assets/javascripts/bower/vue/src/observer/array.js +0 -90
- data/vendor/assets/javascripts/bower/vue/src/observer/dep.js +0 -50
- data/vendor/assets/javascripts/bower/vue/src/observer/index.js +0 -235
- data/vendor/assets/javascripts/bower/vue/src/observer/object.js +0 -66
- data/vendor/assets/javascripts/bower/vue/src/parsers/directive.js +0 -159
- data/vendor/assets/javascripts/bower/vue/src/parsers/expression.js +0 -226
- data/vendor/assets/javascripts/bower/vue/src/parsers/path.js +0 -300
- data/vendor/assets/javascripts/bower/vue/src/parsers/template.js +0 -248
- data/vendor/assets/javascripts/bower/vue/src/parsers/text.js +0 -178
- data/vendor/assets/javascripts/bower/vue/src/transition/css.js +0 -189
- data/vendor/assets/javascripts/bower/vue/src/transition/index.js +0 -151
- data/vendor/assets/javascripts/bower/vue/src/transition/js.js +0 -43
- data/vendor/assets/javascripts/bower/vue/src/util/debug.js +0 -50
- data/vendor/assets/javascripts/bower/vue/src/util/dom.js +0 -197
- data/vendor/assets/javascripts/bower/vue/src/util/env.js +0 -74
- data/vendor/assets/javascripts/bower/vue/src/util/filter.js +0 -72
- data/vendor/assets/javascripts/bower/vue/src/util/index.js +0 -8
- data/vendor/assets/javascripts/bower/vue/src/util/lang.js +0 -175
- data/vendor/assets/javascripts/bower/vue/src/util/merge-option.js +0 -255
- data/vendor/assets/javascripts/bower/vue/src/vue.js +0 -84
- data/vendor/assets/javascripts/bower/vue/src/watcher.js +0 -240
@@ -1,248 +0,0 @@
|
|
1
|
-
var _ = require('../util')
|
2
|
-
var Cache = require('../cache')
|
3
|
-
var templateCache = new Cache(1000)
|
4
|
-
var idSelectorCache = new Cache(1000)
|
5
|
-
|
6
|
-
var map = {
|
7
|
-
_default : [0, '', ''],
|
8
|
-
legend : [1, '<fieldset>', '</fieldset>'],
|
9
|
-
tr : [2, '<table><tbody>', '</tbody></table>'],
|
10
|
-
col : [
|
11
|
-
2,
|
12
|
-
'<table><tbody></tbody><colgroup>',
|
13
|
-
'</colgroup></table>'
|
14
|
-
]
|
15
|
-
}
|
16
|
-
|
17
|
-
map.td =
|
18
|
-
map.th = [
|
19
|
-
3,
|
20
|
-
'<table><tbody><tr>',
|
21
|
-
'</tr></tbody></table>'
|
22
|
-
]
|
23
|
-
|
24
|
-
map.option =
|
25
|
-
map.optgroup = [
|
26
|
-
1,
|
27
|
-
'<select multiple="multiple">',
|
28
|
-
'</select>'
|
29
|
-
]
|
30
|
-
|
31
|
-
map.thead =
|
32
|
-
map.tbody =
|
33
|
-
map.colgroup =
|
34
|
-
map.caption =
|
35
|
-
map.tfoot = [1, '<table>', '</table>']
|
36
|
-
|
37
|
-
map.g =
|
38
|
-
map.defs =
|
39
|
-
map.symbol =
|
40
|
-
map.use =
|
41
|
-
map.image =
|
42
|
-
map.text =
|
43
|
-
map.circle =
|
44
|
-
map.ellipse =
|
45
|
-
map.line =
|
46
|
-
map.path =
|
47
|
-
map.polygon =
|
48
|
-
map.polyline =
|
49
|
-
map.rect = [
|
50
|
-
1,
|
51
|
-
'<svg ' +
|
52
|
-
'xmlns="http://www.w3.org/2000/svg" ' +
|
53
|
-
'xmlns:xlink="http://www.w3.org/1999/xlink" ' +
|
54
|
-
'xmlns:ev="http://www.w3.org/2001/xml-events"' +
|
55
|
-
'version="1.1">',
|
56
|
-
'</svg>'
|
57
|
-
]
|
58
|
-
|
59
|
-
var TAG_RE = /<([\w:]+)/
|
60
|
-
|
61
|
-
/**
|
62
|
-
* Convert a string template to a DocumentFragment.
|
63
|
-
* Determines correct wrapping by tag types. Wrapping
|
64
|
-
* strategy found in jQuery & component/domify.
|
65
|
-
*
|
66
|
-
* @param {String} templateString
|
67
|
-
* @return {DocumentFragment}
|
68
|
-
*/
|
69
|
-
|
70
|
-
function stringToFragment (templateString) {
|
71
|
-
// try a cache hit first
|
72
|
-
var hit = templateCache.get(templateString)
|
73
|
-
if (hit) {
|
74
|
-
return hit
|
75
|
-
}
|
76
|
-
|
77
|
-
var frag = document.createDocumentFragment()
|
78
|
-
var tagMatch = TAG_RE.exec(templateString)
|
79
|
-
|
80
|
-
if (!tagMatch) {
|
81
|
-
// text only, return a single text node.
|
82
|
-
frag.appendChild(
|
83
|
-
document.createTextNode(templateString)
|
84
|
-
)
|
85
|
-
} else {
|
86
|
-
|
87
|
-
var tag = tagMatch[1]
|
88
|
-
var wrap = map[tag] || map._default
|
89
|
-
var depth = wrap[0]
|
90
|
-
var prefix = wrap[1]
|
91
|
-
var suffix = wrap[2]
|
92
|
-
var node = document.createElement('div')
|
93
|
-
|
94
|
-
node.innerHTML = prefix + templateString.trim() + suffix
|
95
|
-
while (depth--) {
|
96
|
-
node = node.lastChild
|
97
|
-
}
|
98
|
-
|
99
|
-
var child
|
100
|
-
/* jshint boss:true */
|
101
|
-
while (child = node.firstChild) {
|
102
|
-
frag.appendChild(child)
|
103
|
-
}
|
104
|
-
}
|
105
|
-
|
106
|
-
templateCache.put(templateString, frag)
|
107
|
-
return frag
|
108
|
-
}
|
109
|
-
|
110
|
-
/**
|
111
|
-
* Convert a template node to a DocumentFragment.
|
112
|
-
*
|
113
|
-
* @param {Node} node
|
114
|
-
* @return {DocumentFragment}
|
115
|
-
*/
|
116
|
-
|
117
|
-
function nodeToFragment (node) {
|
118
|
-
var tag = node.tagName
|
119
|
-
// if its a template tag and the browser supports it,
|
120
|
-
// its content is already a document fragment.
|
121
|
-
if (
|
122
|
-
tag === 'TEMPLATE' &&
|
123
|
-
node.content instanceof DocumentFragment
|
124
|
-
) {
|
125
|
-
return node.content
|
126
|
-
}
|
127
|
-
return tag === 'SCRIPT'
|
128
|
-
? stringToFragment(node.textContent)
|
129
|
-
: stringToFragment(node.innerHTML)
|
130
|
-
}
|
131
|
-
|
132
|
-
// Test for the presence of the Safari template cloning bug
|
133
|
-
// https://bugs.webkit.org/show_bug.cgi?id=137755
|
134
|
-
var hasBrokenTemplate = _.inBrowser
|
135
|
-
? (function () {
|
136
|
-
var a = document.createElement('div')
|
137
|
-
a.innerHTML = '<template>1</template>'
|
138
|
-
return !a.cloneNode(true).firstChild.innerHTML
|
139
|
-
})()
|
140
|
-
: false
|
141
|
-
|
142
|
-
// Test for IE10/11 textarea placeholder clone bug
|
143
|
-
var hasTextareaCloneBug = _.inBrowser
|
144
|
-
? (function () {
|
145
|
-
var t = document.createElement('textarea')
|
146
|
-
t.placeholder = 't'
|
147
|
-
return t.cloneNode(true).value === 't'
|
148
|
-
})()
|
149
|
-
: false
|
150
|
-
|
151
|
-
/**
|
152
|
-
* 1. Deal with Safari cloning nested <template> bug by
|
153
|
-
* manually cloning all template instances.
|
154
|
-
* 2. Deal with IE10/11 textarea placeholder bug by setting
|
155
|
-
* the correct value after cloning.
|
156
|
-
*
|
157
|
-
* @param {Element|DocumentFragment} node
|
158
|
-
* @return {Element|DocumentFragment}
|
159
|
-
*/
|
160
|
-
|
161
|
-
exports.clone = function (node) {
|
162
|
-
var res = node.cloneNode(true)
|
163
|
-
var i, original, cloned
|
164
|
-
/* istanbul ignore if */
|
165
|
-
if (hasBrokenTemplate) {
|
166
|
-
original = node.querySelectorAll('template')
|
167
|
-
if (original.length) {
|
168
|
-
cloned = res.querySelectorAll('template')
|
169
|
-
i = cloned.length
|
170
|
-
while (i--) {
|
171
|
-
cloned[i].parentNode.replaceChild(
|
172
|
-
original[i].cloneNode(true),
|
173
|
-
cloned[i]
|
174
|
-
)
|
175
|
-
}
|
176
|
-
}
|
177
|
-
}
|
178
|
-
/* istanbul ignore if */
|
179
|
-
if (hasTextareaCloneBug) {
|
180
|
-
if (node.tagName === 'TEXTAREA') {
|
181
|
-
res.value = node.value
|
182
|
-
} else {
|
183
|
-
original = node.querySelectorAll('textarea')
|
184
|
-
if (original.length) {
|
185
|
-
cloned = res.querySelectorAll('textarea')
|
186
|
-
i = cloned.length
|
187
|
-
while (i--) {
|
188
|
-
cloned[i].value = original[i].value
|
189
|
-
}
|
190
|
-
}
|
191
|
-
}
|
192
|
-
}
|
193
|
-
return res
|
194
|
-
}
|
195
|
-
|
196
|
-
/**
|
197
|
-
* Process the template option and normalizes it into a
|
198
|
-
* a DocumentFragment that can be used as a partial or a
|
199
|
-
* instance template.
|
200
|
-
*
|
201
|
-
* @param {*} template
|
202
|
-
* Possible values include:
|
203
|
-
* - DocumentFragment object
|
204
|
-
* - Node object of type Template
|
205
|
-
* - id selector: '#some-template-id'
|
206
|
-
* - template string: '<div><span>{{msg}}</span></div>'
|
207
|
-
* @param {Boolean} clone
|
208
|
-
* @param {Boolean} noSelector
|
209
|
-
* @return {DocumentFragment|undefined}
|
210
|
-
*/
|
211
|
-
|
212
|
-
exports.parse = function (template, clone, noSelector) {
|
213
|
-
var node, frag
|
214
|
-
|
215
|
-
// if the template is already a document fragment,
|
216
|
-
// do nothing
|
217
|
-
if (template instanceof DocumentFragment) {
|
218
|
-
return clone
|
219
|
-
? template.cloneNode(true)
|
220
|
-
: template
|
221
|
-
}
|
222
|
-
|
223
|
-
if (typeof template === 'string') {
|
224
|
-
// id selector
|
225
|
-
if (!noSelector && template.charAt(0) === '#') {
|
226
|
-
// id selector can be cached too
|
227
|
-
frag = idSelectorCache.get(template)
|
228
|
-
if (!frag) {
|
229
|
-
node = document.getElementById(template.slice(1))
|
230
|
-
if (node) {
|
231
|
-
frag = nodeToFragment(node)
|
232
|
-
// save selector to cache
|
233
|
-
idSelectorCache.put(template, frag)
|
234
|
-
}
|
235
|
-
}
|
236
|
-
} else {
|
237
|
-
// normal string template
|
238
|
-
frag = stringToFragment(template)
|
239
|
-
}
|
240
|
-
} else if (template.nodeType) {
|
241
|
-
// a direct node
|
242
|
-
frag = nodeToFragment(template)
|
243
|
-
}
|
244
|
-
|
245
|
-
return frag && clone
|
246
|
-
? exports.clone(frag)
|
247
|
-
: frag
|
248
|
-
}
|
@@ -1,178 +0,0 @@
|
|
1
|
-
var Cache = require('../cache')
|
2
|
-
var config = require('../config')
|
3
|
-
var dirParser = require('./directive')
|
4
|
-
var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g
|
5
|
-
var cache, tagRE, htmlRE, firstChar, lastChar
|
6
|
-
|
7
|
-
/**
|
8
|
-
* Escape a string so it can be used in a RegExp
|
9
|
-
* constructor.
|
10
|
-
*
|
11
|
-
* @param {String} str
|
12
|
-
*/
|
13
|
-
|
14
|
-
function escapeRegex (str) {
|
15
|
-
return str.replace(regexEscapeRE, '\\$&')
|
16
|
-
}
|
17
|
-
|
18
|
-
/**
|
19
|
-
* Compile the interpolation tag regex.
|
20
|
-
*
|
21
|
-
* @return {RegExp}
|
22
|
-
*/
|
23
|
-
|
24
|
-
function compileRegex () {
|
25
|
-
config._delimitersChanged = false
|
26
|
-
var open = config.delimiters[0]
|
27
|
-
var close = config.delimiters[1]
|
28
|
-
firstChar = open.charAt(0)
|
29
|
-
lastChar = close.charAt(close.length - 1)
|
30
|
-
var firstCharRE = escapeRegex(firstChar)
|
31
|
-
var lastCharRE = escapeRegex(lastChar)
|
32
|
-
var openRE = escapeRegex(open)
|
33
|
-
var closeRE = escapeRegex(close)
|
34
|
-
tagRE = new RegExp(
|
35
|
-
firstCharRE + '?' + openRE +
|
36
|
-
'(.+?)' +
|
37
|
-
closeRE + lastCharRE + '?',
|
38
|
-
'g'
|
39
|
-
)
|
40
|
-
htmlRE = new RegExp(
|
41
|
-
'^' + firstCharRE + openRE +
|
42
|
-
'.*' +
|
43
|
-
closeRE + lastCharRE + '$'
|
44
|
-
)
|
45
|
-
// reset cache
|
46
|
-
cache = new Cache(1000)
|
47
|
-
}
|
48
|
-
|
49
|
-
/**
|
50
|
-
* Parse a template text string into an array of tokens.
|
51
|
-
*
|
52
|
-
* @param {String} text
|
53
|
-
* @return {Array<Object> | null}
|
54
|
-
* - {String} type
|
55
|
-
* - {String} value
|
56
|
-
* - {Boolean} [html]
|
57
|
-
* - {Boolean} [oneTime]
|
58
|
-
*/
|
59
|
-
|
60
|
-
exports.parse = function (text) {
|
61
|
-
if (config._delimitersChanged) {
|
62
|
-
compileRegex()
|
63
|
-
}
|
64
|
-
var hit = cache.get(text)
|
65
|
-
if (hit) {
|
66
|
-
return hit
|
67
|
-
}
|
68
|
-
if (!tagRE.test(text)) {
|
69
|
-
return null
|
70
|
-
}
|
71
|
-
var tokens = []
|
72
|
-
var lastIndex = tagRE.lastIndex = 0
|
73
|
-
var match, index, value, first, oneTime, partial
|
74
|
-
/* jshint boss:true */
|
75
|
-
while (match = tagRE.exec(text)) {
|
76
|
-
index = match.index
|
77
|
-
// push text token
|
78
|
-
if (index > lastIndex) {
|
79
|
-
tokens.push({
|
80
|
-
value: text.slice(lastIndex, index)
|
81
|
-
})
|
82
|
-
}
|
83
|
-
// tag token
|
84
|
-
first = match[1].charCodeAt(0)
|
85
|
-
oneTime = first === 0x2A // *
|
86
|
-
partial = first === 0x3E // >
|
87
|
-
value = (oneTime || partial)
|
88
|
-
? match[1].slice(1)
|
89
|
-
: match[1]
|
90
|
-
tokens.push({
|
91
|
-
tag: true,
|
92
|
-
value: value.trim(),
|
93
|
-
html: htmlRE.test(match[0]),
|
94
|
-
oneTime: oneTime,
|
95
|
-
partial: partial
|
96
|
-
})
|
97
|
-
lastIndex = index + match[0].length
|
98
|
-
}
|
99
|
-
if (lastIndex < text.length) {
|
100
|
-
tokens.push({
|
101
|
-
value: text.slice(lastIndex)
|
102
|
-
})
|
103
|
-
}
|
104
|
-
cache.put(text, tokens)
|
105
|
-
return tokens
|
106
|
-
}
|
107
|
-
|
108
|
-
/**
|
109
|
-
* Format a list of tokens into an expression.
|
110
|
-
* e.g. tokens parsed from 'a {{b}} c' can be serialized
|
111
|
-
* into one single expression as '"a " + b + " c"'.
|
112
|
-
*
|
113
|
-
* @param {Array} tokens
|
114
|
-
* @param {Vue} [vm]
|
115
|
-
* @return {String}
|
116
|
-
*/
|
117
|
-
|
118
|
-
exports.tokensToExp = function (tokens, vm) {
|
119
|
-
return tokens.length > 1
|
120
|
-
? tokens.map(function (token) {
|
121
|
-
return formatToken(token, vm)
|
122
|
-
}).join('+')
|
123
|
-
: formatToken(tokens[0], vm, true)
|
124
|
-
}
|
125
|
-
|
126
|
-
/**
|
127
|
-
* Format a single token.
|
128
|
-
*
|
129
|
-
* @param {Object} token
|
130
|
-
* @param {Vue} [vm]
|
131
|
-
* @param {Boolean} single
|
132
|
-
* @return {String}
|
133
|
-
*/
|
134
|
-
|
135
|
-
function formatToken (token, vm, single) {
|
136
|
-
return token.tag
|
137
|
-
? vm && token.oneTime
|
138
|
-
? '"' + vm.$eval(token.value) + '"'
|
139
|
-
: single
|
140
|
-
? token.value
|
141
|
-
: inlineFilters(token.value)
|
142
|
-
: '"' + token.value + '"'
|
143
|
-
}
|
144
|
-
|
145
|
-
/**
|
146
|
-
* For an attribute with multiple interpolation tags,
|
147
|
-
* e.g. attr="some-{{thing | filter}}", in order to combine
|
148
|
-
* the whole thing into a single watchable expression, we
|
149
|
-
* have to inline those filters. This function does exactly
|
150
|
-
* that. This is a bit hacky but it avoids heavy changes
|
151
|
-
* to directive parser and watcher mechanism.
|
152
|
-
*
|
153
|
-
* @param {String} exp
|
154
|
-
* @return {String}
|
155
|
-
*/
|
156
|
-
|
157
|
-
var filterRE = /[^|]\|[^|]/
|
158
|
-
function inlineFilters (exp) {
|
159
|
-
if (!filterRE.test(exp)) {
|
160
|
-
return '(' + exp + ')'
|
161
|
-
} else {
|
162
|
-
var dir = dirParser.parse(exp)[0]
|
163
|
-
if (!dir.filters) {
|
164
|
-
return '(' + exp + ')'
|
165
|
-
} else {
|
166
|
-
exp = dir.expression
|
167
|
-
for (var i = 0, l = dir.filters.length; i < l; i++) {
|
168
|
-
var filter = dir.filters[i]
|
169
|
-
var args = filter.args
|
170
|
-
? ',"' + filter.args.join('","') + '"'
|
171
|
-
: ''
|
172
|
-
exp = 'this.$options.filters["' + filter.name + '"]' +
|
173
|
-
'.apply(this,[' + exp + args + '])'
|
174
|
-
}
|
175
|
-
return exp
|
176
|
-
}
|
177
|
-
}
|
178
|
-
}
|
@@ -1,189 +0,0 @@
|
|
1
|
-
var _ = require('../util')
|
2
|
-
var addClass = _.addClass
|
3
|
-
var removeClass = _.removeClass
|
4
|
-
var transDurationProp = _.transitionProp + 'Duration'
|
5
|
-
var animDurationProp = _.animationProp + 'Duration'
|
6
|
-
|
7
|
-
var queue = []
|
8
|
-
var queued = false
|
9
|
-
|
10
|
-
/**
|
11
|
-
* Push a job into the transition queue, which is to be
|
12
|
-
* executed on next frame.
|
13
|
-
*
|
14
|
-
* @param {Element} el - target element
|
15
|
-
* @param {Number} dir - 1: enter, -1: leave
|
16
|
-
* @param {Function} op - the actual dom operation
|
17
|
-
* @param {String} cls - the className to remove when the
|
18
|
-
* transition is done.
|
19
|
-
* @param {Function} [cb] - user supplied callback.
|
20
|
-
*/
|
21
|
-
|
22
|
-
function push (el, dir, op, cls, cb) {
|
23
|
-
queue.push({
|
24
|
-
el : el,
|
25
|
-
dir : dir,
|
26
|
-
cb : cb,
|
27
|
-
cls : cls,
|
28
|
-
op : op
|
29
|
-
})
|
30
|
-
if (!queued) {
|
31
|
-
queued = true
|
32
|
-
_.nextTick(flush)
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
/**
|
37
|
-
* Flush the queue, and do one forced reflow before
|
38
|
-
* triggering transitions.
|
39
|
-
*/
|
40
|
-
|
41
|
-
function flush () {
|
42
|
-
/* jshint unused: false */
|
43
|
-
var f = document.documentElement.offsetHeight
|
44
|
-
queue.forEach(run)
|
45
|
-
queue = []
|
46
|
-
queued = false
|
47
|
-
}
|
48
|
-
|
49
|
-
/**
|
50
|
-
* Run a transition job.
|
51
|
-
*
|
52
|
-
* @param {Object} job
|
53
|
-
*/
|
54
|
-
|
55
|
-
function run (job) {
|
56
|
-
|
57
|
-
var el = job.el
|
58
|
-
var data = el.__v_trans
|
59
|
-
var cls = job.cls
|
60
|
-
var cb = job.cb
|
61
|
-
var op = job.op
|
62
|
-
var transitionType = getTransitionType(el, data, cls)
|
63
|
-
|
64
|
-
if (job.dir > 0) { // ENTER
|
65
|
-
if (transitionType === 1) {
|
66
|
-
// trigger transition by removing enter class
|
67
|
-
removeClass(el, cls)
|
68
|
-
// only need to listen for transitionend if there's
|
69
|
-
// a user callback
|
70
|
-
if (cb) setupTransitionCb(_.transitionEndEvent)
|
71
|
-
} else if (transitionType === 2) {
|
72
|
-
// animations are triggered when class is added
|
73
|
-
// so we just listen for animationend to remove it.
|
74
|
-
setupTransitionCb(_.animationEndEvent, function () {
|
75
|
-
removeClass(el, cls)
|
76
|
-
})
|
77
|
-
} else {
|
78
|
-
// no transition applicable
|
79
|
-
removeClass(el, cls)
|
80
|
-
if (cb) cb()
|
81
|
-
}
|
82
|
-
} else { // LEAVE
|
83
|
-
if (transitionType) {
|
84
|
-
// leave transitions/animations are both triggered
|
85
|
-
// by adding the class, just remove it on end event.
|
86
|
-
var event = transitionType === 1
|
87
|
-
? _.transitionEndEvent
|
88
|
-
: _.animationEndEvent
|
89
|
-
setupTransitionCb(event, function () {
|
90
|
-
op()
|
91
|
-
removeClass(el, cls)
|
92
|
-
})
|
93
|
-
} else {
|
94
|
-
op()
|
95
|
-
removeClass(el, cls)
|
96
|
-
if (cb) cb()
|
97
|
-
}
|
98
|
-
}
|
99
|
-
|
100
|
-
/**
|
101
|
-
* Set up a transition end callback, store the callback
|
102
|
-
* on the element's __v_trans data object, so we can
|
103
|
-
* clean it up if another transition is triggered before
|
104
|
-
* the callback is fired.
|
105
|
-
*
|
106
|
-
* @param {String} event
|
107
|
-
* @param {Function} [cleanupFn]
|
108
|
-
*/
|
109
|
-
|
110
|
-
function setupTransitionCb (event, cleanupFn) {
|
111
|
-
data.event = event
|
112
|
-
var onEnd = data.callback = function transitionCb (e) {
|
113
|
-
if (e.target === el) {
|
114
|
-
_.off(el, event, onEnd)
|
115
|
-
data.event = data.callback = null
|
116
|
-
if (cleanupFn) cleanupFn()
|
117
|
-
if (cb) cb()
|
118
|
-
}
|
119
|
-
}
|
120
|
-
_.on(el, event, onEnd)
|
121
|
-
}
|
122
|
-
}
|
123
|
-
|
124
|
-
/**
|
125
|
-
* Get an element's transition type based on the
|
126
|
-
* calculated styles
|
127
|
-
*
|
128
|
-
* @param {Element} el
|
129
|
-
* @param {Object} data
|
130
|
-
* @param {String} className
|
131
|
-
* @return {Number}
|
132
|
-
* 1 - transition
|
133
|
-
* 2 - animation
|
134
|
-
*/
|
135
|
-
|
136
|
-
function getTransitionType (el, data, className) {
|
137
|
-
var type = data.cache && data.cache[className]
|
138
|
-
if (type) return type
|
139
|
-
var inlineStyles = el.style
|
140
|
-
var computedStyles = window.getComputedStyle(el)
|
141
|
-
var transDuration =
|
142
|
-
inlineStyles[transDurationProp] ||
|
143
|
-
computedStyles[transDurationProp]
|
144
|
-
if (transDuration && transDuration !== '0s') {
|
145
|
-
type = 1
|
146
|
-
} else {
|
147
|
-
var animDuration =
|
148
|
-
inlineStyles[animDurationProp] ||
|
149
|
-
computedStyles[animDurationProp]
|
150
|
-
if (animDuration && animDuration !== '0s') {
|
151
|
-
type = 2
|
152
|
-
}
|
153
|
-
}
|
154
|
-
if (type) {
|
155
|
-
if (!data.cache) data.cache = {}
|
156
|
-
data.cache[className] = type
|
157
|
-
}
|
158
|
-
return type
|
159
|
-
}
|
160
|
-
|
161
|
-
/**
|
162
|
-
* Apply CSS transition to an element.
|
163
|
-
*
|
164
|
-
* @param {Element} el
|
165
|
-
* @param {Number} direction - 1: enter, -1: leave
|
166
|
-
* @param {Function} op - the actual DOM operation
|
167
|
-
* @param {Object} data - target element's transition data
|
168
|
-
*/
|
169
|
-
|
170
|
-
module.exports = function (el, direction, op, data, cb) {
|
171
|
-
var prefix = data.id || 'v'
|
172
|
-
var enterClass = prefix + '-enter'
|
173
|
-
var leaveClass = prefix + '-leave'
|
174
|
-
// clean up potential previous unfinished transition
|
175
|
-
if (data.callback) {
|
176
|
-
_.off(el, data.event, data.callback)
|
177
|
-
removeClass(el, enterClass)
|
178
|
-
removeClass(el, leaveClass)
|
179
|
-
data.event = data.callback = null
|
180
|
-
}
|
181
|
-
if (direction > 0) { // enter
|
182
|
-
addClass(el, enterClass)
|
183
|
-
op()
|
184
|
-
push(el, direction, null, enterClass, cb)
|
185
|
-
} else { // leave
|
186
|
-
addClass(el, leaveClass)
|
187
|
-
push(el, direction, op, leaveClass, cb)
|
188
|
-
}
|
189
|
-
}
|