raro_generator 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +34 -0
- data/lib/assets/images/animated-overlay.gif +0 -0
- data/lib/assets/images/blueimp/img/error.png +0 -0
- data/lib/assets/images/blueimp/img/error.svg +5 -0
- data/lib/assets/images/blueimp/img/loading.gif +0 -0
- data/lib/assets/images/blueimp/img/play-pause.png +0 -0
- data/lib/assets/images/blueimp/img/play-pause.svg +6 -0
- data/lib/assets/images/blueimp/img/video-play.png +0 -0
- data/lib/assets/images/blueimp/img/video-play.svg +5 -0
- data/lib/assets/images/bootstrap-colorpicker/alpha-horizontal.png +0 -0
- data/lib/assets/images/bootstrap-colorpicker/alpha.png +0 -0
- data/lib/assets/images/bootstrap-colorpicker/hue-horizontal.png +0 -0
- data/lib/assets/images/bootstrap-colorpicker/hue.png +0 -0
- data/lib/assets/images/bootstrap-colorpicker/saturation.png +0 -0
- data/lib/assets/images/chosen-sprite.png +0 -0
- data/lib/assets/images/chosen-sprite@2x.png +0 -0
- data/lib/assets/images/green.png +0 -0
- data/lib/assets/images/green@2x.png +0 -0
- data/lib/assets/images/iCheck/green.png +0 -0
- data/lib/assets/images/iCheck/green@2x.png +0 -0
- data/lib/assets/images/images/animated-overlay.gif +0 -0
- data/lib/assets/images/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/assets/images/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/assets/images/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/assets/images/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/assets/images/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/assets/images/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/assets/images/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/assets/images/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/assets/images/images/ui-icons_222222_256x240.png +0 -0
- data/lib/assets/images/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/assets/images/images/ui-icons_454545_256x240.png +0 -0
- data/lib/assets/images/images/ui-icons_888888_256x240.png +0 -0
- data/lib/assets/images/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/assets/images/sort.png +0 -0
- data/lib/assets/images/sort_asc.png +0 -0
- data/lib/assets/images/sort_desc.png +0 -0
- data/lib/assets/images/sprite-skin-flat.png +0 -0
- data/lib/assets/images/sprite-skin-flat2.png +0 -0
- data/lib/assets/images/sprite-skin-nice.png +0 -0
- data/lib/assets/images/sprite-skin-simple.png +0 -0
- data/lib/assets/images/spritemap.png +0 -0
- data/lib/assets/images/spritemap@2x.png +0 -0
- data/lib/assets/javascripts/autocomplete/autocomplete-rails.js +1 -0
- data/lib/assets/javascripts/autocomplete/jquery-ui-autocomplete.js +2610 -0
- data/lib/assets/javascripts/blueimp/jquery.blueimp-gallery.min.js +1 -0
- data/lib/assets/javascripts/chartjs/Chart.min.js +11 -0
- data/lib/assets/javascripts/chosen/chosen.jquery.js +1211 -0
- data/lib/assets/javascripts/codemirror/codemirror.js +7830 -0
- data/lib/assets/javascripts/codemirror/mode/apl/apl.js +175 -0
- data/lib/assets/javascripts/codemirror/mode/apl/index.html +72 -0
- data/lib/assets/javascripts/codemirror/mode/asterisk/asterisk.js +198 -0
- data/lib/assets/javascripts/codemirror/mode/asterisk/index.html +154 -0
- data/lib/assets/javascripts/codemirror/mode/clike/clike.js +474 -0
- data/lib/assets/javascripts/codemirror/mode/clike/index.html +225 -0
- data/lib/assets/javascripts/codemirror/mode/clike/scala.html +767 -0
- data/lib/assets/javascripts/codemirror/mode/clojure/clojure.js +243 -0
- data/lib/assets/javascripts/codemirror/mode/clojure/index.html +88 -0
- data/lib/assets/javascripts/codemirror/mode/cobol/cobol.js +255 -0
- data/lib/assets/javascripts/codemirror/mode/cobol/index.html +210 -0
- data/lib/assets/javascripts/codemirror/mode/coffeescript/coffeescript.js +369 -0
- data/lib/assets/javascripts/codemirror/mode/coffeescript/index.html +740 -0
- data/lib/assets/javascripts/codemirror/mode/commonlisp/commonlisp.js +120 -0
- data/lib/assets/javascripts/codemirror/mode/commonlisp/index.html +177 -0
- data/lib/assets/javascripts/codemirror/mode/css/css.js +717 -0
- data/lib/assets/javascripts/codemirror/mode/css/index.html +70 -0
- data/lib/assets/javascripts/codemirror/mode/css/less.html +152 -0
- data/lib/assets/javascripts/codemirror/mode/css/less_test.js +51 -0
- data/lib/assets/javascripts/codemirror/mode/css/scss.html +157 -0
- data/lib/assets/javascripts/codemirror/mode/css/scss_test.js +110 -0
- data/lib/assets/javascripts/codemirror/mode/css/test.js +135 -0
- data/lib/assets/javascripts/codemirror/mode/cypher/cypher.js +146 -0
- data/lib/assets/javascripts/codemirror/mode/cypher/index.html +63 -0
- data/lib/assets/javascripts/codemirror/mode/d/d.js +218 -0
- data/lib/assets/javascripts/codemirror/mode/d/index.html +273 -0
- data/lib/assets/javascripts/codemirror/mode/diff/diff.js +47 -0
- data/lib/assets/javascripts/codemirror/mode/diff/index.html +117 -0
- data/lib/assets/javascripts/codemirror/mode/django/django.js +67 -0
- data/lib/assets/javascripts/codemirror/mode/django/index.html +63 -0
- data/lib/assets/javascripts/codemirror/mode/dtd/dtd.js +142 -0
- data/lib/assets/javascripts/codemirror/mode/dtd/index.html +89 -0
- data/lib/assets/javascripts/codemirror/mode/dylan/dylan.js +299 -0
- data/lib/assets/javascripts/codemirror/mode/dylan/index.html +407 -0
- data/lib/assets/javascripts/codemirror/mode/ecl/ecl.js +207 -0
- data/lib/assets/javascripts/codemirror/mode/ecl/index.html +52 -0
- data/lib/assets/javascripts/codemirror/mode/eiffel/eiffel.js +162 -0
- data/lib/assets/javascripts/codemirror/mode/eiffel/index.html +429 -0
- data/lib/assets/javascripts/codemirror/mode/erlang/erlang.js +622 -0
- data/lib/assets/javascripts/codemirror/mode/erlang/index.html +76 -0
- data/lib/assets/javascripts/codemirror/mode/fortran/fortran.js +188 -0
- data/lib/assets/javascripts/codemirror/mode/fortran/index.html +81 -0
- data/lib/assets/javascripts/codemirror/mode/gas/gas.js +345 -0
- data/lib/assets/javascripts/codemirror/mode/gas/index.html +68 -0
- data/lib/assets/javascripts/codemirror/mode/gfm/gfm.js +122 -0
- data/lib/assets/javascripts/codemirror/mode/gfm/index.html +82 -0
- data/lib/assets/javascripts/codemirror/mode/gfm/test.js +164 -0
- data/lib/assets/javascripts/codemirror/mode/gherkin/gherkin.js +178 -0
- data/lib/assets/javascripts/codemirror/mode/gherkin/index.html +48 -0
- data/lib/assets/javascripts/codemirror/mode/go/go.js +184 -0
- data/lib/assets/javascripts/codemirror/mode/go/index.html +85 -0
- data/lib/assets/javascripts/codemirror/mode/groovy/groovy.js +226 -0
- data/lib/assets/javascripts/codemirror/mode/groovy/index.html +84 -0
- data/lib/assets/javascripts/codemirror/mode/haml/haml.js +159 -0
- data/lib/assets/javascripts/codemirror/mode/haml/index.html +79 -0
- data/lib/assets/javascripts/codemirror/mode/haml/test.js +97 -0
- data/lib/assets/javascripts/codemirror/mode/haskell/haskell.js +267 -0
- data/lib/assets/javascripts/codemirror/mode/haskell/index.html +73 -0
- data/lib/assets/javascripts/codemirror/mode/haxe/haxe.js +518 -0
- data/lib/assets/javascripts/codemirror/mode/haxe/index.html +124 -0
- data/lib/assets/javascripts/codemirror/mode/htmlembedded/htmlembedded.js +86 -0
- data/lib/assets/javascripts/codemirror/mode/htmlembedded/index.html +58 -0
- data/lib/assets/javascripts/codemirror/mode/htmlmixed/htmlmixed.js +121 -0
- data/lib/assets/javascripts/codemirror/mode/htmlmixed/index.html +85 -0
- data/lib/assets/javascripts/codemirror/mode/http/http.js +113 -0
- data/lib/assets/javascripts/codemirror/mode/http/index.html +45 -0
- data/lib/assets/javascripts/codemirror/mode/index.html +125 -0
- data/lib/assets/javascripts/codemirror/mode/jade/index.html +70 -0
- data/lib/assets/javascripts/codemirror/mode/jade/jade.js +590 -0
- data/lib/assets/javascripts/codemirror/mode/javascript/index.html +114 -0
- data/lib/assets/javascripts/codemirror/mode/javascript/javascript.js +684 -0
- data/lib/assets/javascripts/codemirror/mode/javascript/json-ld.html +72 -0
- data/lib/assets/javascripts/codemirror/mode/javascript/test.js +194 -0
- data/lib/assets/javascripts/codemirror/mode/javascript/typescript.html +61 -0
- data/lib/assets/javascripts/codemirror/mode/jinja2/index.html +54 -0
- data/lib/assets/javascripts/codemirror/mode/jinja2/jinja2.js +142 -0
- data/lib/assets/javascripts/codemirror/mode/julia/index.html +195 -0
- data/lib/assets/javascripts/codemirror/mode/julia/julia.js +301 -0
- data/lib/assets/javascripts/codemirror/mode/kotlin/index.html +89 -0
- data/lib/assets/javascripts/codemirror/mode/kotlin/kotlin.js +280 -0
- data/lib/assets/javascripts/codemirror/mode/livescript/index.html +459 -0
- data/lib/assets/javascripts/codemirror/mode/livescript/livescript.js +280 -0
- data/lib/assets/javascripts/codemirror/mode/lua/index.html +85 -0
- data/lib/assets/javascripts/codemirror/mode/lua/lua.js +159 -0
- data/lib/assets/javascripts/codemirror/mode/markdown/index.html +359 -0
- data/lib/assets/javascripts/codemirror/mode/markdown/markdown.js +758 -0
- data/lib/assets/javascripts/codemirror/mode/markdown/test.js +754 -0
- data/lib/assets/javascripts/codemirror/mode/meta.js +144 -0
- data/lib/assets/javascripts/codemirror/mode/mirc/index.html +160 -0
- data/lib/assets/javascripts/codemirror/mode/mirc/mirc.js +193 -0
- data/lib/assets/javascripts/codemirror/mode/mllike/index.html +179 -0
- data/lib/assets/javascripts/codemirror/mode/mllike/mllike.js +205 -0
- data/lib/assets/javascripts/codemirror/mode/modelica/index.html +67 -0
- data/lib/assets/javascripts/codemirror/mode/modelica/modelica.js +245 -0
- data/lib/assets/javascripts/codemirror/mode/nginx/index.html +181 -0
- data/lib/assets/javascripts/codemirror/mode/nginx/nginx.js +178 -0
- data/lib/assets/javascripts/codemirror/mode/ntriples/index.html +45 -0
- data/lib/assets/javascripts/codemirror/mode/ntriples/ntriples.js +186 -0
- data/lib/assets/javascripts/codemirror/mode/octave/index.html +83 -0
- data/lib/assets/javascripts/codemirror/mode/octave/octave.js +135 -0
- data/lib/assets/javascripts/codemirror/mode/pascal/index.html +61 -0
- data/lib/assets/javascripts/codemirror/mode/pascal/pascal.js +109 -0
- data/lib/assets/javascripts/codemirror/mode/pegjs/index.html +66 -0
- data/lib/assets/javascripts/codemirror/mode/pegjs/pegjs.js +114 -0
- data/lib/assets/javascripts/codemirror/mode/perl/index.html +75 -0
- data/lib/assets/javascripts/codemirror/mode/perl/perl.js +832 -0
- data/lib/assets/javascripts/codemirror/mode/php/index.html +64 -0
- data/lib/assets/javascripts/codemirror/mode/php/php.js +226 -0
- data/lib/assets/javascripts/codemirror/mode/php/test.js +154 -0
- data/lib/assets/javascripts/codemirror/mode/pig/index.html +55 -0
- data/lib/assets/javascripts/codemirror/mode/pig/pig.js +188 -0
- data/lib/assets/javascripts/codemirror/mode/properties/index.html +53 -0
- data/lib/assets/javascripts/codemirror/mode/properties/properties.js +78 -0
- data/lib/assets/javascripts/codemirror/mode/puppet/index.html +121 -0
- data/lib/assets/javascripts/codemirror/mode/puppet/puppet.js +220 -0
- data/lib/assets/javascripts/codemirror/mode/python/index.html +198 -0
- data/lib/assets/javascripts/codemirror/mode/python/python.js +359 -0
- data/lib/assets/javascripts/codemirror/mode/q/index.html +144 -0
- data/lib/assets/javascripts/codemirror/mode/q/q.js +139 -0
- data/lib/assets/javascripts/codemirror/mode/r/index.html +85 -0
- data/lib/assets/javascripts/codemirror/mode/r/r.js +162 -0
- data/lib/assets/javascripts/codemirror/mode/rpm/changes/index.html +66 -0
- data/lib/assets/javascripts/codemirror/mode/rpm/index.html +149 -0
- data/lib/assets/javascripts/codemirror/mode/rpm/rpm.js +101 -0
- data/lib/assets/javascripts/codemirror/mode/rst/index.html +535 -0
- data/lib/assets/javascripts/codemirror/mode/rst/rst.js +557 -0
- data/lib/assets/javascripts/codemirror/mode/ruby/index.html +184 -0
- data/lib/assets/javascripts/codemirror/mode/ruby/ruby.js +285 -0
- data/lib/assets/javascripts/codemirror/mode/ruby/test.js +14 -0
- data/lib/assets/javascripts/codemirror/mode/rust/index.html +60 -0
- data/lib/assets/javascripts/codemirror/mode/rust/rust.js +451 -0
- data/lib/assets/javascripts/codemirror/mode/sass/index.html +66 -0
- data/lib/assets/javascripts/codemirror/mode/sass/sass.js +327 -0
- data/lib/assets/javascripts/codemirror/mode/scheme/index.html +77 -0
- data/lib/assets/javascripts/codemirror/mode/scheme/scheme.js +248 -0
- data/lib/assets/javascripts/codemirror/mode/shell/index.html +66 -0
- data/lib/assets/javascripts/codemirror/mode/shell/shell.js +138 -0
- data/lib/assets/javascripts/codemirror/mode/shell/test.js +58 -0
- data/lib/assets/javascripts/codemirror/mode/sieve/index.html +93 -0
- data/lib/assets/javascripts/codemirror/mode/sieve/sieve.js +193 -0
- data/lib/assets/javascripts/codemirror/mode/slim/index.html +96 -0
- data/lib/assets/javascripts/codemirror/mode/slim/slim.js +575 -0
- data/lib/assets/javascripts/codemirror/mode/slim/test.js +96 -0
- data/lib/assets/javascripts/codemirror/mode/smalltalk/index.html +68 -0
- data/lib/assets/javascripts/codemirror/mode/smalltalk/smalltalk.js +168 -0
- data/lib/assets/javascripts/codemirror/mode/smarty/index.html +136 -0
- data/lib/assets/javascripts/codemirror/mode/smarty/smarty.js +221 -0
- data/lib/assets/javascripts/codemirror/mode/smartymixed/index.html +114 -0
- data/lib/assets/javascripts/codemirror/mode/smartymixed/smartymixed.js +197 -0
- data/lib/assets/javascripts/codemirror/mode/solr/index.html +57 -0
- data/lib/assets/javascripts/codemirror/mode/solr/solr.js +104 -0
- data/lib/assets/javascripts/codemirror/mode/sparql/index.html +53 -0
- data/lib/assets/javascripts/codemirror/mode/sparql/sparql.js +160 -0
- data/lib/assets/javascripts/codemirror/mode/sql/index.html +84 -0
- data/lib/assets/javascripts/codemirror/mode/sql/sql.js +393 -0
- data/lib/assets/javascripts/codemirror/mode/stex/index.html +110 -0
- data/lib/assets/javascripts/codemirror/mode/stex/stex.js +262 -0
- data/lib/assets/javascripts/codemirror/mode/stex/test.js +123 -0
- data/lib/assets/javascripts/codemirror/mode/tcl/index.html +142 -0
- data/lib/assets/javascripts/codemirror/mode/tcl/tcl.js +147 -0
- data/lib/assets/javascripts/codemirror/mode/textile/index.html +191 -0
- data/lib/assets/javascripts/codemirror/mode/textile/test.js +406 -0
- data/lib/assets/javascripts/codemirror/mode/textile/textile.js +553 -0
- data/lib/assets/javascripts/codemirror/mode/tiddlywiki/index.html +154 -0
- data/lib/assets/javascripts/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/lib/assets/javascripts/codemirror/mode/tiddlywiki/tiddlywiki.js +369 -0
- data/lib/assets/javascripts/codemirror/mode/tiki/index.html +95 -0
- data/lib/assets/javascripts/codemirror/mode/tiki/tiki.css +26 -0
- data/lib/assets/javascripts/codemirror/mode/tiki/tiki.js +323 -0
- data/lib/assets/javascripts/codemirror/mode/toml/index.html +73 -0
- data/lib/assets/javascripts/codemirror/mode/toml/toml.js +88 -0
- data/lib/assets/javascripts/codemirror/mode/tornado/index.html +63 -0
- data/lib/assets/javascripts/codemirror/mode/tornado/tornado.js +68 -0
- data/lib/assets/javascripts/codemirror/mode/turtle/index.html +50 -0
- data/lib/assets/javascripts/codemirror/mode/turtle/turtle.js +160 -0
- data/lib/assets/javascripts/codemirror/mode/vb/index.html +102 -0
- data/lib/assets/javascripts/codemirror/mode/vb/vb.js +274 -0
- data/lib/assets/javascripts/codemirror/mode/vbscript/index.html +55 -0
- data/lib/assets/javascripts/codemirror/mode/vbscript/vbscript.js +350 -0
- data/lib/assets/javascripts/codemirror/mode/velocity/index.html +118 -0
- data/lib/assets/javascripts/codemirror/mode/velocity/velocity.js +201 -0
- data/lib/assets/javascripts/codemirror/mode/verilog/index.html +120 -0
- data/lib/assets/javascripts/codemirror/mode/verilog/test.js +273 -0
- data/lib/assets/javascripts/codemirror/mode/verilog/verilog.js +364 -0
- data/lib/assets/javascripts/codemirror/mode/xml/index.html +57 -0
- data/lib/assets/javascripts/codemirror/mode/xml/test.js +51 -0
- data/lib/assets/javascripts/codemirror/mode/xml/xml.js +384 -0
- data/lib/assets/javascripts/codemirror/mode/xquery/index.html +210 -0
- data/lib/assets/javascripts/codemirror/mode/xquery/test.js +67 -0
- data/lib/assets/javascripts/codemirror/mode/xquery/xquery.js +447 -0
- data/lib/assets/javascripts/codemirror/mode/yaml/index.html +80 -0
- data/lib/assets/javascripts/codemirror/mode/yaml/yaml.js +112 -0
- data/lib/assets/javascripts/codemirror/mode/z80/index.html +52 -0
- data/lib/assets/javascripts/codemirror/mode/z80/z80.js +100 -0
- data/lib/assets/javascripts/colorpicker/bootstrap-colorpicker.min.js +1 -0
- data/lib/assets/javascripts/cropper/cropper.min.js +9 -0
- data/lib/assets/javascripts/dataTables/dataTables.bootstrap.js +245 -0
- data/lib/assets/javascripts/dataTables/dataTables.responsive.js +801 -0
- data/lib/assets/javascripts/dataTables/dataTables.tableTools.min.js +69 -0
- data/lib/assets/javascripts/dataTables/jquery.dataTables.js +14840 -0
- data/lib/assets/javascripts/dataTables/swf/copy_csv_xls.swf +0 -0
- data/lib/assets/javascripts/dataTables/swf/copy_csv_xls_pdf.swf +0 -0
- data/lib/assets/javascripts/datapicker/bootstrap-datepicker.js +1680 -0
- data/lib/assets/javascripts/datapicker/daterangepicker.min.js +868 -0
- data/lib/assets/javascripts/datapicker/moment.js +7063 -0
- data/lib/assets/javascripts/diff_match_patch/COPYING +177 -0
- data/lib/assets/javascripts/diff_match_patch/README.txt +43 -0
- data/lib/assets/javascripts/diff_match_patch/javascript/diff_match_patch.js +49 -0
- data/lib/assets/javascripts/dropzone/dropzone.js +1841 -0
- data/lib/assets/javascripts/flot/curvedLines.js +315 -0
- data/lib/assets/javascripts/flot/excanvas.min.js +1 -0
- data/lib/assets/javascripts/flot/jquery.flot.js +3168 -0
- data/lib/assets/javascripts/flot/jquery.flot.pie.js +820 -0
- data/lib/assets/javascripts/flot/jquery.flot.resize.js +59 -0
- data/lib/assets/javascripts/flot/jquery.flot.spline.js +212 -0
- data/lib/assets/javascripts/flot/jquery.flot.symbol.js +71 -0
- data/lib/assets/javascripts/flot/jquery.flot.time.js +432 -0
- data/lib/assets/javascripts/flot/jquery.flot.tooltip.min.js +12 -0
- data/lib/assets/javascripts/fullcalendar/fullcalendar.min.js +8 -0
- data/lib/assets/javascripts/fullcalendar/moment.min.js +7 -0
- data/lib/assets/javascripts/iCheck/icheck.min.js +11 -0
- data/lib/assets/javascripts/idle-timer/idle-timer.min.js +2 -0
- data/lib/assets/javascripts/ionRangeSlider/ion.rangeSlider.min.js +26 -0
- data/lib/assets/javascripts/jasny/jasny-bootstrap.min.js +6 -0
- data/lib/assets/javascripts/jeditable/jquery.jeditable.js +543 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-ar.js +128 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-bg.js +134 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-bg1251.js +132 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-cat.js +130 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-cn.js +169 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-cs.js +130 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-da.js +130 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-de.js +173 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-dk.js +129 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-el.js +128 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-en.js +170 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-es.js +130 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-fa.js +147 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-fi.js +131 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-fr.js +128 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-gl.js +128 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-he.js +129 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-hr.js +164 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-hr1250.js +164 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-hu.js +131 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-id.js +170 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-is.js +128 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-it.js +1 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-ja.js +158 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-kr.js +130 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-lt.js +130 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-mne.js +130 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-nl.js +150 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-no.js +1 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-pl.js +134 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-pt-br.js +137 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-pt.js +127 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-ro.js +141 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-ru.js +129 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-sk.js +129 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-sr-latin.js +130 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-sr.js +130 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-sv.js +129 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-th.js +130 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-tr.js +128 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-tw.js +131 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-ua.js +129 -0
- data/lib/assets/javascripts/jqGrid/i18n/grid.locale-vi.js +170 -0
- data/lib/assets/javascripts/jqGrid/jquery.jqGrid.min.js +545 -0
- data/lib/assets/javascripts/jquery/jquery-2.1.1.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery-ui-i18n.min.js +6 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-af.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ar-DZ.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ar.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-az.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-be.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-bg.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-bs.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ca.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-cs.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-cy-GB.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-da.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-de.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-el.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-en-AU.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-en-GB.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-en-NZ.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-eo.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-es.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-et.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-eu.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-fa.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-fi.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-fo.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-fr-CA.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-fr-CH.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-fr.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-gl.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-he.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-hi.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-hr.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-hu.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-hy.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-id.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-is.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-it.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ja.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ka.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-kk.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-km.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ko.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ky.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-lb.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-lt.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-lv.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-mk.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ml.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ms.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-nb.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-nl-BE.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-nl.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-nn.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-no.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-pl.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-pt-BR.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-pt.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-rm.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ro.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ru.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-sk.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-sl.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-sq.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-sr-SR.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-sr.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-sv.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ta.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-th.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-tj.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-tr.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-uk.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-vi.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-zh-CN.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-zh-HK.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-zh-TW.min.js +4 -0
- data/lib/assets/javascripts/jquery-ui/images/animated-overlay.gif +0 -0
- data/lib/assets/javascripts/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/assets/javascripts/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/assets/javascripts/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/assets/javascripts/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/assets/javascripts/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/assets/javascripts/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/assets/javascripts/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/assets/javascripts/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/assets/javascripts/jquery-ui/images/ui-icons_222222_256x240.png +0 -0
- data/lib/assets/javascripts/jquery-ui/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/assets/javascripts/jquery-ui/images/ui-icons_454545_256x240.png +0 -0
- data/lib/assets/javascripts/jquery-ui/images/ui-icons_888888_256x240.png +0 -0
- data/lib/assets/javascripts/jquery-ui/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/assets/javascripts/jquery-ui/jquery-ui-1.10.4.custom.min.css +7 -0
- data/lib/assets/javascripts/jquery-ui/jquery-ui-1.10.4.min.js +7 -0
- data/lib/assets/javascripts/jquery-ui/jquery-ui.css +1189 -0
- data/lib/assets/javascripts/jquery-ui/jquery-ui.js +15040 -0
- data/lib/assets/javascripts/jquery-ui/jquery-ui.min.css +4 -0
- data/lib/assets/javascripts/jquery-ui/jquery-ui.min.js +12 -0
- data/lib/assets/javascripts/jquery.mask/inputmask.js +7 -0
- data/lib/assets/javascripts/jquery.mask/jquery.mask.js +489 -0
- data/lib/assets/javascripts/jsKnob/jquery.knob.js +791 -0
- data/lib/assets/javascripts/jsTree/jstree.min.js +5 -0
- data/lib/assets/javascripts/jvectormap/jquery-jvectormap-1.2.2.min.js +8 -0
- data/lib/assets/javascripts/jvectormap/jquery-jvectormap-world-mill-en.js +1 -0
- data/lib/assets/javascripts/metisMenu/jquery.metisMenu.js +120 -0
- data/lib/assets/javascripts/morris/morris.js +1892 -0
- data/lib/assets/javascripts/morris/raphael-2.1.0.min.js +10 -0
- data/lib/assets/javascripts/nestable/jquery.nestable.js +484 -0
- data/lib/assets/javascripts/nouslider/jquery.nouislider.min.js +34 -0
- data/lib/assets/javascripts/pace/pace.min.js +2 -0
- data/lib/assets/javascripts/peity/jquery.peity.min.js +13 -0
- data/lib/assets/javascripts/preetyTextDiff/jquery.pretty-text-diff.min.js +76 -0
- data/lib/assets/javascripts/rickshaw/rickshaw.min.js +3 -0
- data/lib/assets/javascripts/rickshaw/vendor/d3.v3.js +5 -0
- data/lib/assets/javascripts/slimscroll/jquery.slimscroll.min.js +16 -0
- data/lib/assets/javascripts/sparkline/jquery.sparkline.min.js +5 -0
- data/lib/assets/javascripts/staps/jquery.steps.min.js +6 -0
- data/lib/assets/javascripts/summernote/summernote.min.js +2 -0
- data/lib/assets/javascripts/switchery/switchery.js +1 -0
- data/lib/assets/javascripts/timepicker/bootstrap-timepicker.js +1097 -0
- data/lib/assets/javascripts/tinycon/tinycon.min.js +8 -0
- data/lib/assets/javascripts/validate/jquery.validate.min.js +4 -0
- data/lib/assets/javascripts/video/responsible-video.js +21 -0
- data/lib/assets/stylesheets/animate/animate.css +2848 -0
- data/lib/assets/stylesheets/blueimp/css/blueimp-gallery-indicator.css +71 -0
- data/lib/assets/stylesheets/blueimp/css/blueimp-gallery-video.css +87 -0
- data/lib/assets/stylesheets/blueimp/css/blueimp-gallery.css +226 -0
- data/lib/assets/stylesheets/blueimp/css/blueimp-gallery.min.css +1 -0
- data/lib/assets/stylesheets/blueimp/css/demo.css +51 -0
- data/lib/assets/stylesheets/bootstrap-rtl/bootstrap-rtl.css +1468 -0
- data/lib/assets/stylesheets/bootstrap-rtl/bootstrap-rtl.css.map +1 -0
- data/lib/assets/stylesheets/bootstrap-rtl/bootstrap-rtl.min.css +9 -0
- data/lib/assets/stylesheets/chosen/chosen-sprite.png +0 -0
- data/lib/assets/stylesheets/chosen/chosen-sprite@2x.png +0 -0
- data/lib/assets/stylesheets/chosen/chosen.css +429 -0
- data/lib/assets/stylesheets/codemirror/ambiance.css +77 -0
- data/lib/assets/stylesheets/codemirror/codemirror.css +309 -0
- data/lib/assets/stylesheets/colorpicker/css/bootstrap-colorpicker.css.scss +217 -0
- data/lib/assets/stylesheets/colorpicker/css/bootstrap-colorpicker.min.css +9 -0
- data/lib/assets/stylesheets/colorpicker/css/images/bootstrap-colorpicker/alpha-horizontal.png +0 -0
- data/lib/assets/stylesheets/colorpicker/css/images/bootstrap-colorpicker/alpha.png +0 -0
- data/lib/assets/stylesheets/colorpicker/css/images/bootstrap-colorpicker/hue-horizontal.png +0 -0
- data/lib/assets/stylesheets/colorpicker/css/images/bootstrap-colorpicker/hue.png +0 -0
- data/lib/assets/stylesheets/colorpicker/css/images/bootstrap-colorpicker/saturation.png +0 -0
- data/lib/assets/stylesheets/cropper/cropper.min.css +9 -0
- data/lib/assets/stylesheets/dataTables/dataTables.bootstrap.css +233 -0
- data/lib/assets/stylesheets/dataTables/dataTables.responsive.css +93 -0
- data/lib/assets/stylesheets/dataTables/dataTables.tableTools.min.css +1 -0
- data/lib/assets/stylesheets/datapicker/datepicker.css +442 -0
- data/lib/assets/stylesheets/datapicker/datepicker3.css +789 -0
- data/lib/assets/stylesheets/datapicker/daterangepicker.css +195 -0
- data/lib/assets/stylesheets/dropzone/basic.css +155 -0
- data/lib/assets/stylesheets/dropzone/dropzone.css +410 -0
- data/lib/assets/stylesheets/dropzone/images/spritemap.png +0 -0
- data/lib/assets/stylesheets/dropzone/images/spritemap@2x.png +0 -0
- data/lib/assets/stylesheets/fullcalendar/fullcalendar.css +977 -0
- data/lib/assets/stylesheets/fullcalendar/fullcalendar.print.css +202 -0
- data/lib/assets/stylesheets/iCheck/custom.css.scss +59 -0
- data/lib/assets/stylesheets/images/bootstrap-colorpicker/alpha-horizontal.png +0 -0
- data/lib/assets/stylesheets/images/bootstrap-colorpicker/alpha.png +0 -0
- data/lib/assets/stylesheets/images/bootstrap-colorpicker/hue-horizontal.png +0 -0
- data/lib/assets/stylesheets/images/bootstrap-colorpicker/hue.png +0 -0
- data/lib/assets/stylesheets/images/bootstrap-colorpicker/saturation.png +0 -0
- data/lib/assets/stylesheets/images/sort.png +0 -0
- data/lib/assets/stylesheets/images/sort_asc.png +0 -0
- data/lib/assets/stylesheets/images/sort_desc.png +0 -0
- data/lib/assets/stylesheets/images/sprite-skin-flat.png +0 -0
- data/lib/assets/stylesheets/images/sprite-skin-flat2.png +0 -0
- data/lib/assets/stylesheets/images/sprite-skin-nice.png +0 -0
- data/lib/assets/stylesheets/images/sprite-skin-simple.png +0 -0
- data/lib/assets/stylesheets/images/spritemap.png +0 -0
- data/lib/assets/stylesheets/images/spritemap@2x.png +0 -0
- data/lib/assets/stylesheets/ionRangeSlider/images/sprite-skin-flat.png +0 -0
- data/lib/assets/stylesheets/ionRangeSlider/images/sprite-skin-flat2.png +0 -0
- data/lib/assets/stylesheets/ionRangeSlider/images/sprite-skin-nice.png +0 -0
- data/lib/assets/stylesheets/ionRangeSlider/images/sprite-skin-simple.png +0 -0
- data/lib/assets/stylesheets/ionRangeSlider/ion.rangeSlider.css +126 -0
- data/lib/assets/stylesheets/ionRangeSlider/ion.rangeSlider.skinFlat.css +89 -0
- data/lib/assets/stylesheets/ionRangeSlider/ion.rangeSlider.skinNice.css +85 -0
- data/lib/assets/stylesheets/ionRangeSlider/ion.rangeSlider.skinSimple.css +85 -0
- data/lib/assets/stylesheets/jQueryUI/images/animated-overlay.gif +0 -0
- data/lib/assets/stylesheets/jQueryUI/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/assets/stylesheets/jQueryUI/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/assets/stylesheets/jQueryUI/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/assets/stylesheets/jQueryUI/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/assets/stylesheets/jQueryUI/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/assets/stylesheets/jQueryUI/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/assets/stylesheets/jQueryUI/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/assets/stylesheets/jQueryUI/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/assets/stylesheets/jQueryUI/images/ui-icons_222222_256x240.png +0 -0
- data/lib/assets/stylesheets/jQueryUI/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/assets/stylesheets/jQueryUI/images/ui-icons_454545_256x240.png +0 -0
- data/lib/assets/stylesheets/jQueryUI/images/ui-icons_888888_256x240.png +0 -0
- data/lib/assets/stylesheets/jQueryUI/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/assets/stylesheets/jQueryUI/jquery-ui-1.10.4.custom.min.css +675 -0
- data/lib/assets/stylesheets/jasny/jasny-bootstrap.min.css +7 -0
- data/lib/assets/stylesheets/jqGrid/ui.jqgrid.css +171 -0
- data/lib/assets/stylesheets/jsTree/32px.png +0 -0
- data/lib/assets/stylesheets/jsTree/39px.png +0 -0
- data/lib/assets/stylesheets/jsTree/40px.png +0 -0
- data/lib/assets/stylesheets/jsTree/style.css +1050 -0
- data/lib/assets/stylesheets/jsTree/style.min.css +1 -0
- data/lib/assets/stylesheets/jsTree/throbber.gif +0 -0
- data/lib/assets/stylesheets/jvectormap/jquery-jvectormap-2.0.1.css +129 -0
- data/lib/assets/stylesheets/morris/morris-0.4.3.min.css +2 -0
- data/lib/assets/stylesheets/nouslider/jquery.nouislider.css +165 -0
- data/lib/assets/stylesheets/steps/jquery.steps.css +380 -0
- data/lib/assets/stylesheets/summernote/summernote-bs3.css +5970 -0
- data/lib/assets/stylesheets/summernote/summernote.css +446 -0
- data/lib/assets/stylesheets/switchery/switchery.css +32 -0
- data/lib/assets/stylesheets/timepicker/bootstrap-timepicker.css +126 -0
- data/lib/assets/stylesheets/toastr/toastr.min.css +222 -0
- data/lib/generators/assets/autocomplete/USAGE +8 -0
- data/lib/generators/assets/autocomplete/autocomplete_generator.rb +27 -0
- data/lib/generators/assets/precompile_local/USAGE +8 -0
- data/lib/generators/assets/precompile_local/precompile_local_generator.rb +43 -0
- data/lib/generators/deploy/homologacao/USAGE +8 -0
- data/lib/generators/deploy/homologacao/homologacao_generator.rb +38 -0
- data/lib/generators/deploy/homologacao/templates/deploy.rb +14 -0
- data/lib/generators/deploy/homologacao/templates/stage.rb +83 -0
- data/lib/generators/deploy/homologacao/templates/staging.rb +58 -0
- data/lib/generators/deploy/homologacao/templates/unicorn.rb +39 -0
- data/lib/generators/deploy/producao/USAGE +8 -0
- data/lib/generators/deploy/producao/producao_generator.rb +38 -0
- data/lib/generators/deploy/producao/templates/deploy.rb +14 -0
- data/lib/generators/deploy/producao/templates/env_production.rb +83 -0
- data/lib/generators/deploy/producao/templates/production.rb +45 -0
- data/lib/generators/deploy/producao/templates/unicorn.rb +39 -0
- data/lib/generators/raro_crud/branco/USAGE +10 -0
- data/lib/generators/raro_crud/branco/branco_generator.rb +16 -0
- data/lib/generators/raro_crud/branco/templates/action.rb +7 -0
- data/lib/generators/raro_crud/branco/templates/action_partial.rb +1 -0
- data/lib/generators/raro_crud/branco/templates/template.rb +22 -0
- data/lib/raro_generator/version.rb +3 -0
- data/lib/raro_generator.rb +2 -0
- data/lib/tasks/raro_generator_tasks.rake +4 -0
- metadata +611 -0
@@ -0,0 +1,177 @@
|
|
1
|
+
|
2
|
+
Apache License
|
3
|
+
Version 2.0, January 2004
|
4
|
+
http://www.apache.org/licenses/
|
5
|
+
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
+
|
8
|
+
1. Definitions.
|
9
|
+
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
+
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
+
the copyright owner that is granting the License.
|
15
|
+
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
+
other entities that control, are controlled by, or are under common
|
18
|
+
control with that entity. For the purposes of this definition,
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
20
|
+
direction or management of such entity, whether by contract or
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
+
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
+
exercising permissions granted by this License.
|
26
|
+
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
28
|
+
including but not limited to software source code, documentation
|
29
|
+
source, and configuration files.
|
30
|
+
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
32
|
+
transformation or translation of a Source form, including but
|
33
|
+
not limited to compiled object code, generated documentation,
|
34
|
+
and conversions to other media types.
|
35
|
+
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
37
|
+
Object form, made available under the License, as indicated by a
|
38
|
+
copyright notice that is included in or attached to the work
|
39
|
+
(an example is provided in the Appendix below).
|
40
|
+
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
+
the Work and Derivative Works thereof.
|
48
|
+
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
50
|
+
the original version of the Work and any modifications or additions
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
+
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
65
|
+
subsequently incorporated within the Work.
|
66
|
+
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
73
|
+
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
+
where such license applies only to those patent claims licensable
|
80
|
+
by such Contributor that are necessarily infringed by their
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
83
|
+
institute patent litigation against any entity (including a
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
86
|
+
or contributory patent infringement, then any patent licenses
|
87
|
+
granted to You under this License for that Work shall terminate
|
88
|
+
as of the date such litigation is filed.
|
89
|
+
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
92
|
+
modifications, and in Source or Object form, provided that You
|
93
|
+
meet the following conditions:
|
94
|
+
|
95
|
+
(a) You must give any other recipients of the Work or
|
96
|
+
Derivative Works a copy of this License; and
|
97
|
+
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
99
|
+
stating that You changed the files; and
|
100
|
+
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
103
|
+
attribution notices from the Source form of the Work,
|
104
|
+
excluding those notices that do not pertain to any part of
|
105
|
+
the Derivative Works; and
|
106
|
+
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
109
|
+
include a readable copy of the attribution notices contained
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
112
|
+
of the following places: within a NOTICE text file distributed
|
113
|
+
as part of the Derivative Works; within the Source form or
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
115
|
+
within a display generated by the Derivative Works, if and
|
116
|
+
wherever such third-party notices normally appear. The contents
|
117
|
+
of the NOTICE file are for informational purposes only and
|
118
|
+
do not modify the License. You may add Your own attribution
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
121
|
+
that such additional attribution notices cannot be construed
|
122
|
+
as modifying the License.
|
123
|
+
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
125
|
+
may provide additional or different license terms and conditions
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
129
|
+
the conditions stated in this License.
|
130
|
+
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
134
|
+
this License, without any additional terms or conditions.
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
+
the terms of any separate license agreement you may have executed
|
137
|
+
with Licensor regarding such Contributions.
|
138
|
+
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
141
|
+
except as required for reasonable and customary use in describing the
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
+
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
153
|
+
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
159
|
+
incidental, or consequential damages of any character arising as a
|
160
|
+
result of this License or out of the use or inability to use the
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
163
|
+
other commercial damages or losses), even if such Contributor
|
164
|
+
has been advised of the possibility of such damages.
|
165
|
+
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
+
or other liability obligations and/or rights consistent with this
|
170
|
+
License. However, in accepting such obligations, You may act only
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
175
|
+
of your accepting any such warranty or additional liability.
|
176
|
+
|
177
|
+
END OF TERMS AND CONDITIONS
|
@@ -0,0 +1,43 @@
|
|
1
|
+
Diff, Match and Patch Library
|
2
|
+
http://code.google.com/p/google-diff-match-patch/
|
3
|
+
Neil Fraser
|
4
|
+
|
5
|
+
This library is currently available in seven different ports, all using the same API.
|
6
|
+
Every version includes a full set of unit tests.
|
7
|
+
|
8
|
+
C++:
|
9
|
+
* Ported by Mike Slemmer.
|
10
|
+
* Currently requires the Qt library.
|
11
|
+
|
12
|
+
C#:
|
13
|
+
* Ported by Matthaeus G. Chajdas.
|
14
|
+
|
15
|
+
Dart:
|
16
|
+
* The Dart language is still growing and evolving, so this port is only as
|
17
|
+
stable as the underlying language.
|
18
|
+
|
19
|
+
Java:
|
20
|
+
* Included is both the source and a Maven package.
|
21
|
+
|
22
|
+
JavaScript:
|
23
|
+
* diff_match_patch_uncompressed.js is the human-readable version.
|
24
|
+
Users of node.js should 'require' this uncompressed version since the
|
25
|
+
compressed version is not guaranteed to work outside of a web browser.
|
26
|
+
* diff_match_patch.js has been compressed using Google's internal JavaScript compressor.
|
27
|
+
Non-Google hackers who wish to recompress the source can use:
|
28
|
+
http://dean.edwards.name/packer/
|
29
|
+
|
30
|
+
Lua:
|
31
|
+
* Ported by Duncan Cross.
|
32
|
+
* Does not support line-mode speedup.
|
33
|
+
|
34
|
+
Objective C:
|
35
|
+
* Ported by Jan Weiss.
|
36
|
+
* Includes speed test (this is a separate bundle for other languages).
|
37
|
+
|
38
|
+
Python:
|
39
|
+
* Two versions, one for Python 2.x, the other for Python 3.x.
|
40
|
+
* Runs 10x faster under PyPy than CPython.
|
41
|
+
|
42
|
+
Demos:
|
43
|
+
* Separate demos for Diff, Match and Patch in JavaScript.
|
@@ -0,0 +1,49 @@
|
|
1
|
+
(function(){function diff_match_patch(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=0.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=32}
|
2
|
+
diff_match_patch.prototype.diff_main=function(a,b,c,d){"undefined"==typeof d&&(d=0>=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1E3*this.Diff_Timeout);if(null==a||null==b)throw Error("Null input. (diff_main)");if(a==b)return a?[[0,a]]:[];"undefined"==typeof c&&(c=!0);var e=c,f=this.diff_commonPrefix(a,b);c=a.substring(0,f);a=a.substring(f);b=b.substring(f);var f=this.diff_commonSuffix(a,b),g=a.substring(a.length-f);a=a.substring(0,a.length-f);b=b.substring(0,b.length-f);a=this.diff_compute_(a,
|
3
|
+
b,e,d);c&&a.unshift([0,c]);g&&a.push([0,g]);this.diff_cleanupMerge(a);return a};
|
4
|
+
diff_match_patch.prototype.diff_compute_=function(a,b,c,d){if(!a)return[[1,b]];if(!b)return[[-1,a]];var e=a.length>b.length?a:b,f=a.length>b.length?b:a,g=e.indexOf(f);return-1!=g?(c=[[1,e.substring(0,g)],[0,f],[1,e.substring(g+f.length)]],a.length>b.length&&(c[0][0]=c[2][0]=-1),c):1==f.length?[[-1,a],[1,b]]:(e=this.diff_halfMatch_(a,b))?(f=e[0],a=e[1],g=e[2],b=e[3],e=e[4],f=this.diff_main(f,g,c,d),c=this.diff_main(a,b,c,d),f.concat([[0,e]],c)):c&&100<a.length&&100<b.length?this.diff_lineMode_(a,b,
|
5
|
+
d):this.diff_bisect_(a,b,d)};
|
6
|
+
diff_match_patch.prototype.diff_lineMode_=function(a,b,c){var d=this.diff_linesToChars_(a,b);a=d.chars1;b=d.chars2;d=d.lineArray;a=this.diff_main(a,b,!1,c);this.diff_charsToLines_(a,d);this.diff_cleanupSemantic(a);a.push([0,""]);for(var e=d=b=0,f="",g="";b<a.length;){switch(a[b][0]){case 1:e++;g+=a[b][1];break;case -1:d++;f+=a[b][1];break;case 0:if(1<=d&&1<=e){a.splice(b-d-e,d+e);b=b-d-e;d=this.diff_main(f,g,!1,c);for(e=d.length-1;0<=e;e--)a.splice(b,0,d[e]);b+=d.length}d=e=0;g=f=""}b++}a.pop();return a};
|
7
|
+
diff_match_patch.prototype.diff_bisect_=function(a,b,c){for(var d=a.length,e=b.length,f=Math.ceil((d+e)/2),g=f,h=2*f,j=Array(h),i=Array(h),k=0;k<h;k++)j[k]=-1,i[k]=-1;j[g+1]=0;i[g+1]=0;for(var k=d-e,q=0!=k%2,r=0,t=0,p=0,w=0,v=0;v<f&&!((new Date).getTime()>c);v++){for(var n=-v+r;n<=v-t;n+=2){var l=g+n,m;m=n==-v||n!=v&&j[l-1]<j[l+1]?j[l+1]:j[l-1]+1;for(var s=m-n;m<d&&s<e&&a.charAt(m)==b.charAt(s);)m++,s++;j[l]=m;if(m>d)t+=2;else if(s>e)r+=2;else if(q&&(l=g+k-n,0<=l&&l<h&&-1!=i[l])){var u=d-i[l];if(m>=
|
8
|
+
u)return this.diff_bisectSplit_(a,b,m,s,c)}}for(n=-v+p;n<=v-w;n+=2){l=g+n;u=n==-v||n!=v&&i[l-1]<i[l+1]?i[l+1]:i[l-1]+1;for(m=u-n;u<d&&m<e&&a.charAt(d-u-1)==b.charAt(e-m-1);)u++,m++;i[l]=u;if(u>d)w+=2;else if(m>e)p+=2;else if(!q&&(l=g+k-n,0<=l&&(l<h&&-1!=j[l])&&(m=j[l],s=g+m-l,u=d-u,m>=u)))return this.diff_bisectSplit_(a,b,m,s,c)}}return[[-1,a],[1,b]]};
|
9
|
+
diff_match_patch.prototype.diff_bisectSplit_=function(a,b,c,d,e){var f=a.substring(0,c),g=b.substring(0,d);a=a.substring(c);b=b.substring(d);f=this.diff_main(f,g,!1,e);e=this.diff_main(a,b,!1,e);return f.concat(e)};
|
10
|
+
diff_match_patch.prototype.diff_linesToChars_=function(a,b){function c(a){for(var b="",c=0,f=-1,g=d.length;f<a.length-1;){f=a.indexOf("\n",c);-1==f&&(f=a.length-1);var r=a.substring(c,f+1),c=f+1;(e.hasOwnProperty?e.hasOwnProperty(r):void 0!==e[r])?b+=String.fromCharCode(e[r]):(b+=String.fromCharCode(g),e[r]=g,d[g++]=r)}return b}var d=[],e={};d[0]="";var f=c(a),g=c(b);return{chars1:f,chars2:g,lineArray:d}};
|
11
|
+
diff_match_patch.prototype.diff_charsToLines_=function(a,b){for(var c=0;c<a.length;c++){for(var d=a[c][1],e=[],f=0;f<d.length;f++)e[f]=b[d.charCodeAt(f)];a[c][1]=e.join("")}};diff_match_patch.prototype.diff_commonPrefix=function(a,b){if(!a||!b||a.charAt(0)!=b.charAt(0))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(f,e)==b.substring(f,e)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
|
12
|
+
diff_match_patch.prototype.diff_commonSuffix=function(a,b){if(!a||!b||a.charAt(a.length-1)!=b.charAt(b.length-1))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(a.length-e,a.length-f)==b.substring(b.length-e,b.length-f)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
|
13
|
+
diff_match_patch.prototype.diff_commonOverlap_=function(a,b){var c=a.length,d=b.length;if(0==c||0==d)return 0;c>d?a=a.substring(c-d):c<d&&(b=b.substring(0,c));c=Math.min(c,d);if(a==b)return c;for(var d=0,e=1;;){var f=a.substring(c-e),f=b.indexOf(f);if(-1==f)return d;e+=f;if(0==f||a.substring(c-e)==b.substring(0,e))d=e,e++}};
|
14
|
+
diff_match_patch.prototype.diff_halfMatch_=function(a,b){function c(a,b,c){for(var d=a.substring(c,c+Math.floor(a.length/4)),e=-1,g="",h,j,n,l;-1!=(e=b.indexOf(d,e+1));){var m=f.diff_commonPrefix(a.substring(c),b.substring(e)),s=f.diff_commonSuffix(a.substring(0,c),b.substring(0,e));g.length<s+m&&(g=b.substring(e-s,e)+b.substring(e,e+m),h=a.substring(0,c-s),j=a.substring(c+m),n=b.substring(0,e-s),l=b.substring(e+m))}return 2*g.length>=a.length?[h,j,n,l,g]:null}if(0>=this.Diff_Timeout)return null;
|
15
|
+
var d=a.length>b.length?a:b,e=a.length>b.length?b:a;if(4>d.length||2*e.length<d.length)return null;var f=this,g=c(d,e,Math.ceil(d.length/4)),d=c(d,e,Math.ceil(d.length/2)),h;if(!g&&!d)return null;h=d?g?g[4].length>d[4].length?g:d:d:g;var j;a.length>b.length?(g=h[0],d=h[1],e=h[2],j=h[3]):(e=h[0],j=h[1],g=h[2],d=h[3]);h=h[4];return[g,d,e,j,h]};
|
16
|
+
diff_match_patch.prototype.diff_cleanupSemantic=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=0,h=0,j=0,i=0;f<a.length;)0==a[f][0]?(c[d++]=f,g=j,h=i,i=j=0,e=a[f][1]):(1==a[f][0]?j+=a[f][1].length:i+=a[f][1].length,e&&(e.length<=Math.max(g,h)&&e.length<=Math.max(j,i))&&(a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,d--,f=0<d?c[d-1]:-1,i=j=h=g=0,e=null,b=!0)),f++;b&&this.diff_cleanupMerge(a);this.diff_cleanupSemanticLossless(a);for(f=1;f<a.length;){if(-1==a[f-1][0]&&1==a[f][0]){b=a[f-1][1];c=a[f][1];
|
17
|
+
d=this.diff_commonOverlap_(b,c);e=this.diff_commonOverlap_(c,b);if(d>=e){if(d>=b.length/2||d>=c.length/2)a.splice(f,0,[0,c.substring(0,d)]),a[f-1][1]=b.substring(0,b.length-d),a[f+1][1]=c.substring(d),f++}else if(e>=b.length/2||e>=c.length/2)a.splice(f,0,[0,b.substring(0,e)]),a[f-1][0]=1,a[f-1][1]=c.substring(0,c.length-e),a[f+1][0]=-1,a[f+1][1]=b.substring(e),f++;f++}f++}};
|
18
|
+
diff_match_patch.prototype.diff_cleanupSemanticLossless=function(a){function b(a,b){if(!a||!b)return 6;var c=a.charAt(a.length-1),d=b.charAt(0),e=c.match(diff_match_patch.nonAlphaNumericRegex_),f=d.match(diff_match_patch.nonAlphaNumericRegex_),g=e&&c.match(diff_match_patch.whitespaceRegex_),h=f&&d.match(diff_match_patch.whitespaceRegex_),c=g&&c.match(diff_match_patch.linebreakRegex_),d=h&&d.match(diff_match_patch.linebreakRegex_),i=c&&a.match(diff_match_patch.blanklineEndRegex_),j=d&&b.match(diff_match_patch.blanklineStartRegex_);
|
19
|
+
return i||j?5:c||d?4:e&&!g&&h?3:g||h?2:e||f?1:0}for(var c=1;c<a.length-1;){if(0==a[c-1][0]&&0==a[c+1][0]){var d=a[c-1][1],e=a[c][1],f=a[c+1][1],g=this.diff_commonSuffix(d,e);if(g)var h=e.substring(e.length-g),d=d.substring(0,d.length-g),e=h+e.substring(0,e.length-g),f=h+f;for(var g=d,h=e,j=f,i=b(d,e)+b(e,f);e.charAt(0)===f.charAt(0);){var d=d+e.charAt(0),e=e.substring(1)+f.charAt(0),f=f.substring(1),k=b(d,e)+b(e,f);k>=i&&(i=k,g=d,h=e,j=f)}a[c-1][1]!=g&&(g?a[c-1][1]=g:(a.splice(c-1,1),c--),a[c][1]=
|
20
|
+
h,j?a[c+1][1]=j:(a.splice(c+1,1),c--))}c++}};diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;diff_match_patch.whitespaceRegex_=/\s/;diff_match_patch.linebreakRegex_=/[\r\n]/;diff_match_patch.blanklineEndRegex_=/\n\r?\n$/;diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/;
|
21
|
+
diff_match_patch.prototype.diff_cleanupEfficiency=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=!1,h=!1,j=!1,i=!1;f<a.length;){if(0==a[f][0])a[f][1].length<this.Diff_EditCost&&(j||i)?(c[d++]=f,g=j,h=i,e=a[f][1]):(d=0,e=null),j=i=!1;else if(-1==a[f][0]?i=!0:j=!0,e&&(g&&h&&j&&i||e.length<this.Diff_EditCost/2&&3==g+h+j+i))a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,e=null,g&&h?(j=i=!0,d=0):(d--,f=0<d?c[d-1]:-1,j=i=!1),b=!0;f++}b&&this.diff_cleanupMerge(a)};
|
22
|
+
diff_match_patch.prototype.diff_cleanupMerge=function(a){a.push([0,""]);for(var b=0,c=0,d=0,e="",f="",g;b<a.length;)switch(a[b][0]){case 1:d++;f+=a[b][1];b++;break;case -1:c++;e+=a[b][1];b++;break;case 0:1<c+d?(0!==c&&0!==d&&(g=this.diff_commonPrefix(f,e),0!==g&&(0<b-c-d&&0==a[b-c-d-1][0]?a[b-c-d-1][1]+=f.substring(0,g):(a.splice(0,0,[0,f.substring(0,g)]),b++),f=f.substring(g),e=e.substring(g)),g=this.diff_commonSuffix(f,e),0!==g&&(a[b][1]=f.substring(f.length-g)+a[b][1],f=f.substring(0,f.length-
|
23
|
+
g),e=e.substring(0,e.length-g))),0===c?a.splice(b-d,c+d,[1,f]):0===d?a.splice(b-c,c+d,[-1,e]):a.splice(b-c-d,c+d,[-1,e],[1,f]),b=b-c-d+(c?1:0)+(d?1:0)+1):0!==b&&0==a[b-1][0]?(a[b-1][1]+=a[b][1],a.splice(b,1)):b++,c=d=0,f=e=""}""===a[a.length-1][1]&&a.pop();c=!1;for(b=1;b<a.length-1;)0==a[b-1][0]&&0==a[b+1][0]&&(a[b][1].substring(a[b][1].length-a[b-1][1].length)==a[b-1][1]?(a[b][1]=a[b-1][1]+a[b][1].substring(0,a[b][1].length-a[b-1][1].length),a[b+1][1]=a[b-1][1]+a[b+1][1],a.splice(b-1,1),c=!0):a[b][1].substring(0,
|
24
|
+
a[b+1][1].length)==a[b+1][1]&&(a[b-1][1]+=a[b+1][1],a[b][1]=a[b][1].substring(a[b+1][1].length)+a[b+1][1],a.splice(b+1,1),c=!0)),b++;c&&this.diff_cleanupMerge(a)};diff_match_patch.prototype.diff_xIndex=function(a,b){var c=0,d=0,e=0,f=0,g;for(g=0;g<a.length;g++){1!==a[g][0]&&(c+=a[g][1].length);-1!==a[g][0]&&(d+=a[g][1].length);if(c>b)break;e=c;f=d}return a.length!=g&&-1===a[g][0]?f:f+(b-e)};
|
25
|
+
diff_match_patch.prototype.diff_prettyHtml=function(a){for(var b=[],c=/&/g,d=/</g,e=/>/g,f=/\n/g,g=0;g<a.length;g++){var h=a[g][0],j=a[g][1],j=j.replace(c,"&").replace(d,"<").replace(e,">").replace(f,"¶<br>");switch(h){case 1:b[g]='<ins style="background:#e6ffe6;">'+j+"</ins>";break;case -1:b[g]='<del style="background:#ffe6e6;">'+j+"</del>";break;case 0:b[g]="<span>"+j+"</span>"}}return b.join("")};
|
26
|
+
diff_match_patch.prototype.diff_text1=function(a){for(var b=[],c=0;c<a.length;c++)1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_text2=function(a){for(var b=[],c=0;c<a.length;c++)-1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_levenshtein=function(a){for(var b=0,c=0,d=0,e=0;e<a.length;e++){var f=a[e][0],g=a[e][1];switch(f){case 1:c+=g.length;break;case -1:d+=g.length;break;case 0:b+=Math.max(c,d),d=c=0}}return b+=Math.max(c,d)};
|
27
|
+
diff_match_patch.prototype.diff_toDelta=function(a){for(var b=[],c=0;c<a.length;c++)switch(a[c][0]){case 1:b[c]="+"+encodeURI(a[c][1]);break;case -1:b[c]="-"+a[c][1].length;break;case 0:b[c]="="+a[c][1].length}return b.join("\t").replace(/%20/g," ")};
|
28
|
+
diff_match_patch.prototype.diff_fromDelta=function(a,b){for(var c=[],d=0,e=0,f=b.split(/\t/g),g=0;g<f.length;g++){var h=f[g].substring(1);switch(f[g].charAt(0)){case "+":try{c[d++]=[1,decodeURI(h)]}catch(j){throw Error("Illegal escape in diff_fromDelta: "+h);}break;case "-":case "=":var i=parseInt(h,10);if(isNaN(i)||0>i)throw Error("Invalid number in diff_fromDelta: "+h);h=a.substring(e,e+=i);"="==f[g].charAt(0)?c[d++]=[0,h]:c[d++]=[-1,h];break;default:if(f[g])throw Error("Invalid diff operation in diff_fromDelta: "+
|
29
|
+
f[g]);}}if(e!=a.length)throw Error("Delta length ("+e+") does not equal source text length ("+a.length+").");return c};diff_match_patch.prototype.match_main=function(a,b,c){if(null==a||null==b||null==c)throw Error("Null input. (match_main)");c=Math.max(0,Math.min(c,a.length));return a==b?0:a.length?a.substring(c,c+b.length)==b?c:this.match_bitap_(a,b,c):-1};
|
30
|
+
diff_match_patch.prototype.match_bitap_=function(a,b,c){function d(a,d){var e=a/b.length,g=Math.abs(c-d);return!f.Match_Distance?g?1:e:e+g/f.Match_Distance}if(b.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var e=this.match_alphabet_(b),f=this,g=this.Match_Threshold,h=a.indexOf(b,c);-1!=h&&(g=Math.min(d(0,h),g),h=a.lastIndexOf(b,c+b.length),-1!=h&&(g=Math.min(d(0,h),g)));for(var j=1<<b.length-1,h=-1,i,k,q=b.length+a.length,r,t=0;t<b.length;t++){i=0;for(k=q;i<k;)d(t,c+
|
31
|
+
k)<=g?i=k:q=k,k=Math.floor((q-i)/2+i);q=k;i=Math.max(1,c-k+1);var p=Math.min(c+k,a.length)+b.length;k=Array(p+2);for(k[p+1]=(1<<t)-1;p>=i;p--){var w=e[a.charAt(p-1)];k[p]=0===t?(k[p+1]<<1|1)&w:(k[p+1]<<1|1)&w|((r[p+1]|r[p])<<1|1)|r[p+1];if(k[p]&j&&(w=d(t,p-1),w<=g))if(g=w,h=p-1,h>c)i=Math.max(1,2*c-h);else break}if(d(t+1,c)>g)break;r=k}return h};
|
32
|
+
diff_match_patch.prototype.match_alphabet_=function(a){for(var b={},c=0;c<a.length;c++)b[a.charAt(c)]=0;for(c=0;c<a.length;c++)b[a.charAt(c)]|=1<<a.length-c-1;return b};
|
33
|
+
diff_match_patch.prototype.patch_addContext_=function(a,b){if(0!=b.length){for(var c=b.substring(a.start2,a.start2+a.length1),d=0;b.indexOf(c)!=b.lastIndexOf(c)&&c.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)d+=this.Patch_Margin,c=b.substring(a.start2-d,a.start2+a.length1+d);d+=this.Patch_Margin;(c=b.substring(a.start2-d,a.start2))&&a.diffs.unshift([0,c]);(d=b.substring(a.start2+a.length1,a.start2+a.length1+d))&&a.diffs.push([0,d]);a.start1-=c.length;a.start2-=c.length;a.length1+=
|
34
|
+
c.length+d.length;a.length2+=c.length+d.length}};
|
35
|
+
diff_match_patch.prototype.patch_make=function(a,b,c){var d;if("string"==typeof a&&"string"==typeof b&&"undefined"==typeof c)d=a,b=this.diff_main(d,b,!0),2<b.length&&(this.diff_cleanupSemantic(b),this.diff_cleanupEfficiency(b));else if(a&&"object"==typeof a&&"undefined"==typeof b&&"undefined"==typeof c)b=a,d=this.diff_text1(b);else if("string"==typeof a&&b&&"object"==typeof b&&"undefined"==typeof c)d=a;else if("string"==typeof a&&"string"==typeof b&&c&&"object"==typeof c)d=a,b=c;else throw Error("Unknown call format to patch_make.");
|
36
|
+
if(0===b.length)return[];c=[];a=new diff_match_patch.patch_obj;for(var e=0,f=0,g=0,h=d,j=0;j<b.length;j++){var i=b[j][0],k=b[j][1];!e&&0!==i&&(a.start1=f,a.start2=g);switch(i){case 1:a.diffs[e++]=b[j];a.length2+=k.length;d=d.substring(0,g)+k+d.substring(g);break;case -1:a.length1+=k.length;a.diffs[e++]=b[j];d=d.substring(0,g)+d.substring(g+k.length);break;case 0:k.length<=2*this.Patch_Margin&&e&&b.length!=j+1?(a.diffs[e++]=b[j],a.length1+=k.length,a.length2+=k.length):k.length>=2*this.Patch_Margin&&
|
37
|
+
e&&(this.patch_addContext_(a,h),c.push(a),a=new diff_match_patch.patch_obj,e=0,h=d,f=g)}1!==i&&(f+=k.length);-1!==i&&(g+=k.length)}e&&(this.patch_addContext_(a,h),c.push(a));return c};diff_match_patch.prototype.patch_deepCopy=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=new diff_match_patch.patch_obj;e.diffs=[];for(var f=0;f<d.diffs.length;f++)e.diffs[f]=d.diffs[f].slice();e.start1=d.start1;e.start2=d.start2;e.length1=d.length1;e.length2=d.length2;b[c]=e}return b};
|
38
|
+
diff_match_patch.prototype.patch_apply=function(a,b){if(0==a.length)return[b,[]];a=this.patch_deepCopy(a);var c=this.patch_addPadding(a);b=c+b+c;this.patch_splitMax(a);for(var d=0,e=[],f=0;f<a.length;f++){var g=a[f].start2+d,h=this.diff_text1(a[f].diffs),j,i=-1;if(h.length>this.Match_MaxBits){if(j=this.match_main(b,h.substring(0,this.Match_MaxBits),g),-1!=j&&(i=this.match_main(b,h.substring(h.length-this.Match_MaxBits),g+h.length-this.Match_MaxBits),-1==i||j>=i))j=-1}else j=this.match_main(b,h,g);
|
39
|
+
if(-1==j)e[f]=!1,d-=a[f].length2-a[f].length1;else if(e[f]=!0,d=j-g,g=-1==i?b.substring(j,j+h.length):b.substring(j,i+this.Match_MaxBits),h==g)b=b.substring(0,j)+this.diff_text2(a[f].diffs)+b.substring(j+h.length);else if(g=this.diff_main(h,g,!1),h.length>this.Match_MaxBits&&this.diff_levenshtein(g)/h.length>this.Patch_DeleteThreshold)e[f]=!1;else{this.diff_cleanupSemanticLossless(g);for(var h=0,k,i=0;i<a[f].diffs.length;i++){var q=a[f].diffs[i];0!==q[0]&&(k=this.diff_xIndex(g,h));1===q[0]?b=b.substring(0,
|
40
|
+
j+k)+q[1]+b.substring(j+k):-1===q[0]&&(b=b.substring(0,j+k)+b.substring(j+this.diff_xIndex(g,h+q[1].length)));-1!==q[0]&&(h+=q[1].length)}}}b=b.substring(c.length,b.length-c.length);return[b,e]};
|
41
|
+
diff_match_patch.prototype.patch_addPadding=function(a){for(var b=this.Patch_Margin,c="",d=1;d<=b;d++)c+=String.fromCharCode(d);for(d=0;d<a.length;d++)a[d].start1+=b,a[d].start2+=b;var d=a[0],e=d.diffs;if(0==e.length||0!=e[0][0])e.unshift([0,c]),d.start1-=b,d.start2-=b,d.length1+=b,d.length2+=b;else if(b>e[0][1].length){var f=b-e[0][1].length;e[0][1]=c.substring(e[0][1].length)+e[0][1];d.start1-=f;d.start2-=f;d.length1+=f;d.length2+=f}d=a[a.length-1];e=d.diffs;0==e.length||0!=e[e.length-1][0]?(e.push([0,
|
42
|
+
c]),d.length1+=b,d.length2+=b):b>e[e.length-1][1].length&&(f=b-e[e.length-1][1].length,e[e.length-1][1]+=c.substring(0,f),d.length1+=f,d.length2+=f);return c};
|
43
|
+
diff_match_patch.prototype.patch_splitMax=function(a){for(var b=this.Match_MaxBits,c=0;c<a.length;c++)if(!(a[c].length1<=b)){var d=a[c];a.splice(c--,1);for(var e=d.start1,f=d.start2,g="";0!==d.diffs.length;){var h=new diff_match_patch.patch_obj,j=!0;h.start1=e-g.length;h.start2=f-g.length;""!==g&&(h.length1=h.length2=g.length,h.diffs.push([0,g]));for(;0!==d.diffs.length&&h.length1<b-this.Patch_Margin;){var g=d.diffs[0][0],i=d.diffs[0][1];1===g?(h.length2+=i.length,f+=i.length,h.diffs.push(d.diffs.shift()),
|
44
|
+
j=!1):-1===g&&1==h.diffs.length&&0==h.diffs[0][0]&&i.length>2*b?(h.length1+=i.length,e+=i.length,j=!1,h.diffs.push([g,i]),d.diffs.shift()):(i=i.substring(0,b-h.length1-this.Patch_Margin),h.length1+=i.length,e+=i.length,0===g?(h.length2+=i.length,f+=i.length):j=!1,h.diffs.push([g,i]),i==d.diffs[0][1]?d.diffs.shift():d.diffs[0][1]=d.diffs[0][1].substring(i.length))}g=this.diff_text2(h.diffs);g=g.substring(g.length-this.Patch_Margin);i=this.diff_text1(d.diffs).substring(0,this.Patch_Margin);""!==i&&
|
45
|
+
(h.length1+=i.length,h.length2+=i.length,0!==h.diffs.length&&0===h.diffs[h.diffs.length-1][0]?h.diffs[h.diffs.length-1][1]+=i:h.diffs.push([0,i]));j||a.splice(++c,0,h)}}};diff_match_patch.prototype.patch_toText=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=a[c];return b.join("")};
|
46
|
+
diff_match_patch.prototype.patch_fromText=function(a){var b=[];if(!a)return b;a=a.split("\n");for(var c=0,d=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;c<a.length;){var e=a[c].match(d);if(!e)throw Error("Invalid patch string: "+a[c]);var f=new diff_match_patch.patch_obj;b.push(f);f.start1=parseInt(e[1],10);""===e[2]?(f.start1--,f.length1=1):"0"==e[2]?f.length1=0:(f.start1--,f.length1=parseInt(e[2],10));f.start2=parseInt(e[3],10);""===e[4]?(f.start2--,f.length2=1):"0"==e[4]?f.length2=0:(f.start2--,f.length2=
|
47
|
+
parseInt(e[4],10));for(c++;c<a.length;){e=a[c].charAt(0);try{var g=decodeURI(a[c].substring(1))}catch(h){throw Error("Illegal escape in patch_fromText: "+g);}if("-"==e)f.diffs.push([-1,g]);else if("+"==e)f.diffs.push([1,g]);else if(" "==e)f.diffs.push([0,g]);else if("@"==e)break;else if(""!==e)throw Error('Invalid patch mode "'+e+'" in: '+g);c++}}return b};diff_match_patch.patch_obj=function(){this.diffs=[];this.start2=this.start1=null;this.length2=this.length1=0};
|
48
|
+
diff_match_patch.patch_obj.prototype.toString=function(){var a,b;a=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1;b=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2;a=["@@ -"+a+" +"+b+" @@\n"];var c;for(b=0;b<this.diffs.length;b++){switch(this.diffs[b][0]){case 1:c="+";break;case -1:c="-";break;case 0:c=" "}a[b+1]=c+encodeURI(this.diffs[b][1])+"\n"}return a.join("").replace(/%20/g," ")};
|
49
|
+
this.diff_match_patch=diff_match_patch;this.DIFF_DELETE=-1;this.DIFF_INSERT=1;this.DIFF_EQUAL=0;})()
|
@@ -0,0 +1,1841 @@
|
|
1
|
+
|
2
|
+
;(function(){
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Require the module at `name`.
|
6
|
+
*
|
7
|
+
* @param {String} name
|
8
|
+
* @return {Object} exports
|
9
|
+
* @api public
|
10
|
+
*/
|
11
|
+
|
12
|
+
function require(name) {
|
13
|
+
var module = require.modules[name];
|
14
|
+
if (!module) throw new Error('failed to require "' + name + '"');
|
15
|
+
|
16
|
+
if (!('exports' in module) && typeof module.definition === 'function') {
|
17
|
+
module.client = module.component = true;
|
18
|
+
module.definition.call(this, module.exports = {}, module);
|
19
|
+
delete module.definition;
|
20
|
+
}
|
21
|
+
|
22
|
+
return module.exports;
|
23
|
+
}
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Registered modules.
|
27
|
+
*/
|
28
|
+
|
29
|
+
require.modules = {};
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Register module at `name` with callback `definition`.
|
33
|
+
*
|
34
|
+
* @param {String} name
|
35
|
+
* @param {Function} definition
|
36
|
+
* @api private
|
37
|
+
*/
|
38
|
+
|
39
|
+
require.register = function (name, definition) {
|
40
|
+
require.modules[name] = {
|
41
|
+
definition: definition
|
42
|
+
};
|
43
|
+
};
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Define a module's exports immediately with `exports`.
|
47
|
+
*
|
48
|
+
* @param {String} name
|
49
|
+
* @param {Generic} exports
|
50
|
+
* @api private
|
51
|
+
*/
|
52
|
+
|
53
|
+
require.define = function (name, exports) {
|
54
|
+
require.modules[name] = {
|
55
|
+
exports: exports
|
56
|
+
};
|
57
|
+
};
|
58
|
+
require.register("component~emitter@1.1.2", function (exports, module) {
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Expose `Emitter`.
|
62
|
+
*/
|
63
|
+
|
64
|
+
module.exports = Emitter;
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Initialize a new `Emitter`.
|
68
|
+
*
|
69
|
+
* @api public
|
70
|
+
*/
|
71
|
+
|
72
|
+
function Emitter(obj) {
|
73
|
+
if (obj) return mixin(obj);
|
74
|
+
};
|
75
|
+
|
76
|
+
/**
|
77
|
+
* Mixin the emitter properties.
|
78
|
+
*
|
79
|
+
* @param {Object} obj
|
80
|
+
* @return {Object}
|
81
|
+
* @api private
|
82
|
+
*/
|
83
|
+
|
84
|
+
function mixin(obj) {
|
85
|
+
for (var key in Emitter.prototype) {
|
86
|
+
obj[key] = Emitter.prototype[key];
|
87
|
+
}
|
88
|
+
return obj;
|
89
|
+
}
|
90
|
+
|
91
|
+
/**
|
92
|
+
* Listen on the given `event` with `fn`.
|
93
|
+
*
|
94
|
+
* @param {String} event
|
95
|
+
* @param {Function} fn
|
96
|
+
* @return {Emitter}
|
97
|
+
* @api public
|
98
|
+
*/
|
99
|
+
|
100
|
+
Emitter.prototype.on =
|
101
|
+
Emitter.prototype.addEventListener = function(event, fn){
|
102
|
+
this._callbacks = this._callbacks || {};
|
103
|
+
(this._callbacks[event] = this._callbacks[event] || [])
|
104
|
+
.push(fn);
|
105
|
+
return this;
|
106
|
+
};
|
107
|
+
|
108
|
+
/**
|
109
|
+
* Adds an `event` listener that will be invoked a single
|
110
|
+
* time then automatically removed.
|
111
|
+
*
|
112
|
+
* @param {String} event
|
113
|
+
* @param {Function} fn
|
114
|
+
* @return {Emitter}
|
115
|
+
* @api public
|
116
|
+
*/
|
117
|
+
|
118
|
+
Emitter.prototype.once = function(event, fn){
|
119
|
+
var self = this;
|
120
|
+
this._callbacks = this._callbacks || {};
|
121
|
+
|
122
|
+
function on() {
|
123
|
+
self.off(event, on);
|
124
|
+
fn.apply(this, arguments);
|
125
|
+
}
|
126
|
+
|
127
|
+
on.fn = fn;
|
128
|
+
this.on(event, on);
|
129
|
+
return this;
|
130
|
+
};
|
131
|
+
|
132
|
+
/**
|
133
|
+
* Remove the given callback for `event` or all
|
134
|
+
* registered callbacks.
|
135
|
+
*
|
136
|
+
* @param {String} event
|
137
|
+
* @param {Function} fn
|
138
|
+
* @return {Emitter}
|
139
|
+
* @api public
|
140
|
+
*/
|
141
|
+
|
142
|
+
Emitter.prototype.off =
|
143
|
+
Emitter.prototype.removeListener =
|
144
|
+
Emitter.prototype.removeAllListeners =
|
145
|
+
Emitter.prototype.removeEventListener = function(event, fn){
|
146
|
+
this._callbacks = this._callbacks || {};
|
147
|
+
|
148
|
+
// all
|
149
|
+
if (0 == arguments.length) {
|
150
|
+
this._callbacks = {};
|
151
|
+
return this;
|
152
|
+
}
|
153
|
+
|
154
|
+
// specific event
|
155
|
+
var callbacks = this._callbacks[event];
|
156
|
+
if (!callbacks) return this;
|
157
|
+
|
158
|
+
// remove all handlers
|
159
|
+
if (1 == arguments.length) {
|
160
|
+
delete this._callbacks[event];
|
161
|
+
return this;
|
162
|
+
}
|
163
|
+
|
164
|
+
// remove specific handler
|
165
|
+
var cb;
|
166
|
+
for (var i = 0; i < callbacks.length; i++) {
|
167
|
+
cb = callbacks[i];
|
168
|
+
if (cb === fn || cb.fn === fn) {
|
169
|
+
callbacks.splice(i, 1);
|
170
|
+
break;
|
171
|
+
}
|
172
|
+
}
|
173
|
+
return this;
|
174
|
+
};
|
175
|
+
|
176
|
+
/**
|
177
|
+
* Emit `event` with the given args.
|
178
|
+
*
|
179
|
+
* @param {String} event
|
180
|
+
* @param {Mixed} ...
|
181
|
+
* @return {Emitter}
|
182
|
+
*/
|
183
|
+
|
184
|
+
Emitter.prototype.emit = function(event){
|
185
|
+
this._callbacks = this._callbacks || {};
|
186
|
+
var args = [].slice.call(arguments, 1)
|
187
|
+
, callbacks = this._callbacks[event];
|
188
|
+
|
189
|
+
if (callbacks) {
|
190
|
+
callbacks = callbacks.slice(0);
|
191
|
+
for (var i = 0, len = callbacks.length; i < len; ++i) {
|
192
|
+
callbacks[i].apply(this, args);
|
193
|
+
}
|
194
|
+
}
|
195
|
+
|
196
|
+
return this;
|
197
|
+
};
|
198
|
+
|
199
|
+
/**
|
200
|
+
* Return array of callbacks for `event`.
|
201
|
+
*
|
202
|
+
* @param {String} event
|
203
|
+
* @return {Array}
|
204
|
+
* @api public
|
205
|
+
*/
|
206
|
+
|
207
|
+
Emitter.prototype.listeners = function(event){
|
208
|
+
this._callbacks = this._callbacks || {};
|
209
|
+
return this._callbacks[event] || [];
|
210
|
+
};
|
211
|
+
|
212
|
+
/**
|
213
|
+
* Check if this emitter has `event` handlers.
|
214
|
+
*
|
215
|
+
* @param {String} event
|
216
|
+
* @return {Boolean}
|
217
|
+
* @api public
|
218
|
+
*/
|
219
|
+
|
220
|
+
Emitter.prototype.hasListeners = function(event){
|
221
|
+
return !! this.listeners(event).length;
|
222
|
+
};
|
223
|
+
|
224
|
+
});
|
225
|
+
|
226
|
+
require.register("dropzone", function (exports, module) {
|
227
|
+
|
228
|
+
|
229
|
+
/**
|
230
|
+
* Exposing dropzone
|
231
|
+
*/
|
232
|
+
module.exports = require("dropzone/lib/dropzone.js");
|
233
|
+
|
234
|
+
});
|
235
|
+
|
236
|
+
require.register("dropzone/lib/dropzone.js", function (exports, module) {
|
237
|
+
|
238
|
+
/*
|
239
|
+
*
|
240
|
+
* More info at [www.dropzonejs.com](http://www.dropzonejs.com)
|
241
|
+
*
|
242
|
+
* Copyright (c) 2012, Matias Meno
|
243
|
+
*
|
244
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
245
|
+
* of this software and associated documentation files (the "Software"), to deal
|
246
|
+
* in the Software without restriction, including without limitation the rights
|
247
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
248
|
+
* copies of the Software, and to permit persons to whom the Software is
|
249
|
+
* furnished to do so, subject to the following conditions:
|
250
|
+
*
|
251
|
+
* The above copyright notice and this permission notice shall be included in
|
252
|
+
* all copies or substantial portions of the Software.
|
253
|
+
*
|
254
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
255
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
256
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
257
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
258
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
259
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
260
|
+
* THE SOFTWARE.
|
261
|
+
*
|
262
|
+
*/
|
263
|
+
|
264
|
+
(function() {
|
265
|
+
var Dropzone, Em, camelize, contentLoaded, detectVerticalSquash, drawImageIOSFix, noop, without,
|
266
|
+
__hasProp = {}.hasOwnProperty,
|
267
|
+
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
268
|
+
__slice = [].slice;
|
269
|
+
|
270
|
+
Em = typeof Emitter !== "undefined" && Emitter !== null ? Emitter : require("component~emitter@1.1.2");
|
271
|
+
|
272
|
+
noop = function() {};
|
273
|
+
|
274
|
+
Dropzone = (function(_super) {
|
275
|
+
var extend;
|
276
|
+
|
277
|
+
__extends(Dropzone, _super);
|
278
|
+
|
279
|
+
|
280
|
+
/*
|
281
|
+
This is a list of all available events you can register on a dropzone object.
|
282
|
+
|
283
|
+
You can register an event handler like this:
|
284
|
+
|
285
|
+
dropzone.on("dragEnter", function() { });
|
286
|
+
*/
|
287
|
+
|
288
|
+
Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached"];
|
289
|
+
|
290
|
+
Dropzone.prototype.defaultOptions = {
|
291
|
+
url: null,
|
292
|
+
method: "post",
|
293
|
+
withCredentials: false,
|
294
|
+
parallelUploads: 2,
|
295
|
+
uploadMultiple: false,
|
296
|
+
maxFilesize: 256,
|
297
|
+
paramName: "file",
|
298
|
+
createImageThumbnails: true,
|
299
|
+
maxThumbnailFilesize: 10,
|
300
|
+
thumbnailWidth: 100,
|
301
|
+
thumbnailHeight: 100,
|
302
|
+
maxFiles: null,
|
303
|
+
params: {},
|
304
|
+
clickable: true,
|
305
|
+
ignoreHiddenFiles: true,
|
306
|
+
acceptedFiles: null,
|
307
|
+
acceptedMimeTypes: null,
|
308
|
+
autoProcessQueue: true,
|
309
|
+
autoQueue: true,
|
310
|
+
addRemoveLinks: false,
|
311
|
+
previewsContainer: null,
|
312
|
+
dictDefaultMessage: "Drop files here to upload",
|
313
|
+
dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.",
|
314
|
+
dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.",
|
315
|
+
dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",
|
316
|
+
dictInvalidFileType: "You can't upload files of this type.",
|
317
|
+
dictResponseError: "Server responded with {{statusCode}} code.",
|
318
|
+
dictCancelUpload: "Cancel upload",
|
319
|
+
dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?",
|
320
|
+
dictRemoveFile: "Remove file",
|
321
|
+
dictRemoveFileConfirmation: null,
|
322
|
+
dictMaxFilesExceeded: "You can not upload any more files.",
|
323
|
+
accept: function(file, done) {
|
324
|
+
return done();
|
325
|
+
},
|
326
|
+
init: function() {
|
327
|
+
return noop;
|
328
|
+
},
|
329
|
+
forceFallback: false,
|
330
|
+
fallback: function() {
|
331
|
+
var child, messageElement, span, _i, _len, _ref;
|
332
|
+
this.element.className = "" + this.element.className + " dz-browser-not-supported";
|
333
|
+
_ref = this.element.getElementsByTagName("div");
|
334
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
335
|
+
child = _ref[_i];
|
336
|
+
if (/(^| )dz-message($| )/.test(child.className)) {
|
337
|
+
messageElement = child;
|
338
|
+
child.className = "dz-message";
|
339
|
+
continue;
|
340
|
+
}
|
341
|
+
}
|
342
|
+
if (!messageElement) {
|
343
|
+
messageElement = Dropzone.createElement("<div class=\"dz-message\"><span></span></div>");
|
344
|
+
this.element.appendChild(messageElement);
|
345
|
+
}
|
346
|
+
span = messageElement.getElementsByTagName("span")[0];
|
347
|
+
if (span) {
|
348
|
+
span.textContent = this.options.dictFallbackMessage;
|
349
|
+
}
|
350
|
+
return this.element.appendChild(this.getFallbackForm());
|
351
|
+
},
|
352
|
+
resize: function(file) {
|
353
|
+
var info, srcRatio, trgRatio;
|
354
|
+
info = {
|
355
|
+
srcX: 0,
|
356
|
+
srcY: 0,
|
357
|
+
srcWidth: file.width,
|
358
|
+
srcHeight: file.height
|
359
|
+
};
|
360
|
+
srcRatio = file.width / file.height;
|
361
|
+
trgRatio = this.options.thumbnailWidth / this.options.thumbnailHeight;
|
362
|
+
if (file.height < this.options.thumbnailHeight || file.width < this.options.thumbnailWidth) {
|
363
|
+
info.trgHeight = info.srcHeight;
|
364
|
+
info.trgWidth = info.srcWidth;
|
365
|
+
} else {
|
366
|
+
if (srcRatio > trgRatio) {
|
367
|
+
info.srcHeight = file.height;
|
368
|
+
info.srcWidth = info.srcHeight * trgRatio;
|
369
|
+
} else {
|
370
|
+
info.srcWidth = file.width;
|
371
|
+
info.srcHeight = info.srcWidth / trgRatio;
|
372
|
+
}
|
373
|
+
}
|
374
|
+
info.srcX = (file.width - info.srcWidth) / 2;
|
375
|
+
info.srcY = (file.height - info.srcHeight) / 2;
|
376
|
+
return info;
|
377
|
+
},
|
378
|
+
|
379
|
+
/*
|
380
|
+
Those functions register themselves to the events on init and handle all
|
381
|
+
the user interface specific stuff. Overwriting them won't break the upload
|
382
|
+
but can break the way it's displayed.
|
383
|
+
You can overwrite them if you don't like the default behavior. If you just
|
384
|
+
want to add an additional event handler, register it on the dropzone object
|
385
|
+
and don't overwrite those options.
|
386
|
+
*/
|
387
|
+
drop: function(e) {
|
388
|
+
return this.element.classList.remove("dz-drag-hover");
|
389
|
+
},
|
390
|
+
dragstart: noop,
|
391
|
+
dragend: function(e) {
|
392
|
+
return this.element.classList.remove("dz-drag-hover");
|
393
|
+
},
|
394
|
+
dragenter: function(e) {
|
395
|
+
return this.element.classList.add("dz-drag-hover");
|
396
|
+
},
|
397
|
+
dragover: function(e) {
|
398
|
+
return this.element.classList.add("dz-drag-hover");
|
399
|
+
},
|
400
|
+
dragleave: function(e) {
|
401
|
+
return this.element.classList.remove("dz-drag-hover");
|
402
|
+
},
|
403
|
+
paste: noop,
|
404
|
+
reset: function() {
|
405
|
+
return this.element.classList.remove("dz-started");
|
406
|
+
},
|
407
|
+
addedfile: function(file) {
|
408
|
+
var node, removeFileEvent, removeLink, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _results;
|
409
|
+
if (this.element === this.previewsContainer) {
|
410
|
+
this.element.classList.add("dz-started");
|
411
|
+
}
|
412
|
+
file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim());
|
413
|
+
file.previewTemplate = file.previewElement;
|
414
|
+
this.previewsContainer.appendChild(file.previewElement);
|
415
|
+
_ref = file.previewElement.querySelectorAll("[data-dz-name]");
|
416
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
417
|
+
node = _ref[_i];
|
418
|
+
node.textContent = file.name;
|
419
|
+
}
|
420
|
+
_ref1 = file.previewElement.querySelectorAll("[data-dz-size]");
|
421
|
+
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
|
422
|
+
node = _ref1[_j];
|
423
|
+
node.innerHTML = this.filesize(file.size);
|
424
|
+
}
|
425
|
+
if (this.options.addRemoveLinks) {
|
426
|
+
file._removeLink = Dropzone.createElement("<a class=\"dz-remove\" href=\"javascript:undefined;\" data-dz-remove>" + this.options.dictRemoveFile + "</a>");
|
427
|
+
file.previewElement.appendChild(file._removeLink);
|
428
|
+
}
|
429
|
+
removeFileEvent = (function(_this) {
|
430
|
+
return function(e) {
|
431
|
+
e.preventDefault();
|
432
|
+
e.stopPropagation();
|
433
|
+
if (file.status === Dropzone.UPLOADING) {
|
434
|
+
return Dropzone.confirm(_this.options.dictCancelUploadConfirmation, function() {
|
435
|
+
return _this.removeFile(file);
|
436
|
+
});
|
437
|
+
} else {
|
438
|
+
if (_this.options.dictRemoveFileConfirmation) {
|
439
|
+
return Dropzone.confirm(_this.options.dictRemoveFileConfirmation, function() {
|
440
|
+
return _this.removeFile(file);
|
441
|
+
});
|
442
|
+
} else {
|
443
|
+
return _this.removeFile(file);
|
444
|
+
}
|
445
|
+
}
|
446
|
+
};
|
447
|
+
})(this);
|
448
|
+
_ref2 = file.previewElement.querySelectorAll("[data-dz-remove]");
|
449
|
+
_results = [];
|
450
|
+
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
|
451
|
+
removeLink = _ref2[_k];
|
452
|
+
_results.push(removeLink.addEventListener("click", removeFileEvent));
|
453
|
+
}
|
454
|
+
return _results;
|
455
|
+
},
|
456
|
+
removedfile: function(file) {
|
457
|
+
var _ref;
|
458
|
+
if ((_ref = file.previewElement) != null) {
|
459
|
+
_ref.parentNode.removeChild(file.previewElement);
|
460
|
+
}
|
461
|
+
return this._updateMaxFilesReachedClass();
|
462
|
+
},
|
463
|
+
thumbnail: function(file, dataUrl) {
|
464
|
+
var thumbnailElement, _i, _len, _ref, _results;
|
465
|
+
file.previewElement.classList.remove("dz-file-preview");
|
466
|
+
file.previewElement.classList.add("dz-image-preview");
|
467
|
+
_ref = file.previewElement.querySelectorAll("[data-dz-thumbnail]");
|
468
|
+
_results = [];
|
469
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
470
|
+
thumbnailElement = _ref[_i];
|
471
|
+
thumbnailElement.alt = file.name;
|
472
|
+
_results.push(thumbnailElement.src = dataUrl);
|
473
|
+
}
|
474
|
+
return _results;
|
475
|
+
},
|
476
|
+
error: function(file, message) {
|
477
|
+
var node, _i, _len, _ref, _results;
|
478
|
+
file.previewElement.classList.add("dz-error");
|
479
|
+
if (typeof message !== "String" && message.error) {
|
480
|
+
message = message.error;
|
481
|
+
}
|
482
|
+
_ref = file.previewElement.querySelectorAll("[data-dz-errormessage]");
|
483
|
+
_results = [];
|
484
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
485
|
+
node = _ref[_i];
|
486
|
+
_results.push(node.textContent = message);
|
487
|
+
}
|
488
|
+
return _results;
|
489
|
+
},
|
490
|
+
errormultiple: noop,
|
491
|
+
processing: function(file) {
|
492
|
+
file.previewElement.classList.add("dz-processing");
|
493
|
+
if (file._removeLink) {
|
494
|
+
return file._removeLink.textContent = this.options.dictCancelUpload;
|
495
|
+
}
|
496
|
+
},
|
497
|
+
processingmultiple: noop,
|
498
|
+
uploadprogress: function(file, progress, bytesSent) {
|
499
|
+
var node, _i, _len, _ref, _results;
|
500
|
+
_ref = file.previewElement.querySelectorAll("[data-dz-uploadprogress]");
|
501
|
+
_results = [];
|
502
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
503
|
+
node = _ref[_i];
|
504
|
+
_results.push(node.style.width = "" + progress + "%");
|
505
|
+
}
|
506
|
+
return _results;
|
507
|
+
},
|
508
|
+
totaluploadprogress: noop,
|
509
|
+
sending: noop,
|
510
|
+
sendingmultiple: noop,
|
511
|
+
success: function(file) {
|
512
|
+
return file.previewElement.classList.add("dz-success");
|
513
|
+
},
|
514
|
+
successmultiple: noop,
|
515
|
+
canceled: function(file) {
|
516
|
+
return this.emit("error", file, "Upload canceled.");
|
517
|
+
},
|
518
|
+
canceledmultiple: noop,
|
519
|
+
complete: function(file) {
|
520
|
+
if (file._removeLink) {
|
521
|
+
return file._removeLink.textContent = this.options.dictRemoveFile;
|
522
|
+
}
|
523
|
+
},
|
524
|
+
completemultiple: noop,
|
525
|
+
maxfilesexceeded: noop,
|
526
|
+
maxfilesreached: noop,
|
527
|
+
previewTemplate: "<div class=\"dz-preview dz-file-preview\">\n <div class=\"dz-details\">\n <div class=\"dz-filename\"><span data-dz-name></span></div>\n <div class=\"dz-size\" data-dz-size></div>\n <img data-dz-thumbnail />\n </div>\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress></span></div>\n <div class=\"dz-success-mark\"><span>✔</span></div>\n <div class=\"dz-error-mark\"><span>✘</span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n</div>"
|
528
|
+
};
|
529
|
+
|
530
|
+
extend = function() {
|
531
|
+
var key, object, objects, target, val, _i, _len;
|
532
|
+
target = arguments[0], objects = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
|
533
|
+
for (_i = 0, _len = objects.length; _i < _len; _i++) {
|
534
|
+
object = objects[_i];
|
535
|
+
for (key in object) {
|
536
|
+
val = object[key];
|
537
|
+
target[key] = val;
|
538
|
+
}
|
539
|
+
}
|
540
|
+
return target;
|
541
|
+
};
|
542
|
+
|
543
|
+
function Dropzone(element, options) {
|
544
|
+
var elementOptions, fallback, _ref;
|
545
|
+
this.element = element;
|
546
|
+
this.version = Dropzone.version;
|
547
|
+
this.defaultOptions.previewTemplate = this.defaultOptions.previewTemplate.replace(/\n*/g, "");
|
548
|
+
this.clickableElements = [];
|
549
|
+
this.listeners = [];
|
550
|
+
this.files = [];
|
551
|
+
if (typeof this.element === "string") {
|
552
|
+
this.element = document.querySelector(this.element);
|
553
|
+
}
|
554
|
+
if (!(this.element && (this.element.nodeType != null))) {
|
555
|
+
throw new Error("Invalid dropzone element.");
|
556
|
+
}
|
557
|
+
if (this.element.dropzone) {
|
558
|
+
throw new Error("Dropzone already attached.");
|
559
|
+
}
|
560
|
+
Dropzone.instances.push(this);
|
561
|
+
this.element.dropzone = this;
|
562
|
+
elementOptions = (_ref = Dropzone.optionsForElement(this.element)) != null ? _ref : {};
|
563
|
+
this.options = extend({}, this.defaultOptions, elementOptions, options != null ? options : {});
|
564
|
+
if (this.options.forceFallback || !Dropzone.isBrowserSupported()) {
|
565
|
+
return this.options.fallback.call(this);
|
566
|
+
}
|
567
|
+
if (this.options.url == null) {
|
568
|
+
this.options.url = this.element.getAttribute("action");
|
569
|
+
}
|
570
|
+
if (!this.options.url) {
|
571
|
+
throw new Error("No URL provided.");
|
572
|
+
}
|
573
|
+
if (this.options.acceptedFiles && this.options.acceptedMimeTypes) {
|
574
|
+
throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");
|
575
|
+
}
|
576
|
+
if (this.options.acceptedMimeTypes) {
|
577
|
+
this.options.acceptedFiles = this.options.acceptedMimeTypes;
|
578
|
+
delete this.options.acceptedMimeTypes;
|
579
|
+
}
|
580
|
+
this.options.method = this.options.method.toUpperCase();
|
581
|
+
if ((fallback = this.getExistingFallback()) && fallback.parentNode) {
|
582
|
+
fallback.parentNode.removeChild(fallback);
|
583
|
+
}
|
584
|
+
if (this.options.previewsContainer) {
|
585
|
+
this.previewsContainer = Dropzone.getElement(this.options.previewsContainer, "previewsContainer");
|
586
|
+
} else {
|
587
|
+
this.previewsContainer = this.element;
|
588
|
+
}
|
589
|
+
if (this.options.clickable) {
|
590
|
+
if (this.options.clickable === true) {
|
591
|
+
this.clickableElements = [this.element];
|
592
|
+
} else {
|
593
|
+
this.clickableElements = Dropzone.getElements(this.options.clickable, "clickable");
|
594
|
+
}
|
595
|
+
}
|
596
|
+
this.init();
|
597
|
+
}
|
598
|
+
|
599
|
+
Dropzone.prototype.getAcceptedFiles = function() {
|
600
|
+
var file, _i, _len, _ref, _results;
|
601
|
+
_ref = this.files;
|
602
|
+
_results = [];
|
603
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
604
|
+
file = _ref[_i];
|
605
|
+
if (file.accepted) {
|
606
|
+
_results.push(file);
|
607
|
+
}
|
608
|
+
}
|
609
|
+
return _results;
|
610
|
+
};
|
611
|
+
|
612
|
+
Dropzone.prototype.getRejectedFiles = function() {
|
613
|
+
var file, _i, _len, _ref, _results;
|
614
|
+
_ref = this.files;
|
615
|
+
_results = [];
|
616
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
617
|
+
file = _ref[_i];
|
618
|
+
if (!file.accepted) {
|
619
|
+
_results.push(file);
|
620
|
+
}
|
621
|
+
}
|
622
|
+
return _results;
|
623
|
+
};
|
624
|
+
|
625
|
+
Dropzone.prototype.getFilesWithStatus = function(status) {
|
626
|
+
var file, _i, _len, _ref, _results;
|
627
|
+
_ref = this.files;
|
628
|
+
_results = [];
|
629
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
630
|
+
file = _ref[_i];
|
631
|
+
if (file.status === status) {
|
632
|
+
_results.push(file);
|
633
|
+
}
|
634
|
+
}
|
635
|
+
return _results;
|
636
|
+
};
|
637
|
+
|
638
|
+
Dropzone.prototype.getQueuedFiles = function() {
|
639
|
+
return this.getFilesWithStatus(Dropzone.QUEUED);
|
640
|
+
};
|
641
|
+
|
642
|
+
Dropzone.prototype.getUploadingFiles = function() {
|
643
|
+
return this.getFilesWithStatus(Dropzone.UPLOADING);
|
644
|
+
};
|
645
|
+
|
646
|
+
Dropzone.prototype.getActiveFiles = function() {
|
647
|
+
var file, _i, _len, _ref, _results;
|
648
|
+
_ref = this.files;
|
649
|
+
_results = [];
|
650
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
651
|
+
file = _ref[_i];
|
652
|
+
if (file.status === Dropzone.UPLOADING || file.status === Dropzone.QUEUED) {
|
653
|
+
_results.push(file);
|
654
|
+
}
|
655
|
+
}
|
656
|
+
return _results;
|
657
|
+
};
|
658
|
+
|
659
|
+
Dropzone.prototype.init = function() {
|
660
|
+
var eventName, noPropagation, setupHiddenFileInput, _i, _len, _ref, _ref1;
|
661
|
+
if (this.element.tagName === "form") {
|
662
|
+
this.element.setAttribute("enctype", "multipart/form-data");
|
663
|
+
}
|
664
|
+
if (this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message")) {
|
665
|
+
this.element.appendChild(Dropzone.createElement("<div class=\"dz-default dz-message\"><span>" + this.options.dictDefaultMessage + "</span></div>"));
|
666
|
+
}
|
667
|
+
if (this.clickableElements.length) {
|
668
|
+
setupHiddenFileInput = (function(_this) {
|
669
|
+
return function() {
|
670
|
+
if (_this.hiddenFileInput) {
|
671
|
+
document.body.removeChild(_this.hiddenFileInput);
|
672
|
+
}
|
673
|
+
_this.hiddenFileInput = document.createElement("input");
|
674
|
+
_this.hiddenFileInput.setAttribute("type", "file");
|
675
|
+
if ((_this.options.maxFiles == null) || _this.options.maxFiles > 1) {
|
676
|
+
_this.hiddenFileInput.setAttribute("multiple", "multiple");
|
677
|
+
}
|
678
|
+
_this.hiddenFileInput.className = "dz-hidden-input";
|
679
|
+
if (_this.options.acceptedFiles != null) {
|
680
|
+
_this.hiddenFileInput.setAttribute("accept", _this.options.acceptedFiles);
|
681
|
+
}
|
682
|
+
_this.hiddenFileInput.style.visibility = "hidden";
|
683
|
+
_this.hiddenFileInput.style.position = "absolute";
|
684
|
+
_this.hiddenFileInput.style.top = "0";
|
685
|
+
_this.hiddenFileInput.style.left = "0";
|
686
|
+
_this.hiddenFileInput.style.height = "0";
|
687
|
+
_this.hiddenFileInput.style.width = "0";
|
688
|
+
document.body.appendChild(_this.hiddenFileInput);
|
689
|
+
return _this.hiddenFileInput.addEventListener("change", function() {
|
690
|
+
var file, files, _i, _len;
|
691
|
+
files = _this.hiddenFileInput.files;
|
692
|
+
if (files.length) {
|
693
|
+
for (_i = 0, _len = files.length; _i < _len; _i++) {
|
694
|
+
file = files[_i];
|
695
|
+
_this.addFile(file);
|
696
|
+
}
|
697
|
+
}
|
698
|
+
return setupHiddenFileInput();
|
699
|
+
});
|
700
|
+
};
|
701
|
+
})(this);
|
702
|
+
setupHiddenFileInput();
|
703
|
+
}
|
704
|
+
this.URL = (_ref = window.URL) != null ? _ref : window.webkitURL;
|
705
|
+
_ref1 = this.events;
|
706
|
+
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
707
|
+
eventName = _ref1[_i];
|
708
|
+
this.on(eventName, this.options[eventName]);
|
709
|
+
}
|
710
|
+
this.on("uploadprogress", (function(_this) {
|
711
|
+
return function() {
|
712
|
+
return _this.updateTotalUploadProgress();
|
713
|
+
};
|
714
|
+
})(this));
|
715
|
+
this.on("removedfile", (function(_this) {
|
716
|
+
return function() {
|
717
|
+
return _this.updateTotalUploadProgress();
|
718
|
+
};
|
719
|
+
})(this));
|
720
|
+
this.on("canceled", (function(_this) {
|
721
|
+
return function(file) {
|
722
|
+
return _this.emit("complete", file);
|
723
|
+
};
|
724
|
+
})(this));
|
725
|
+
this.on("complete", (function(_this) {
|
726
|
+
return function(file) {
|
727
|
+
if (_this.getUploadingFiles().length === 0 && _this.getQueuedFiles().length === 0) {
|
728
|
+
return setTimeout((function() {
|
729
|
+
return _this.emit("queuecomplete");
|
730
|
+
}), 0);
|
731
|
+
}
|
732
|
+
};
|
733
|
+
})(this));
|
734
|
+
noPropagation = function(e) {
|
735
|
+
e.stopPropagation();
|
736
|
+
if (e.preventDefault) {
|
737
|
+
return e.preventDefault();
|
738
|
+
} else {
|
739
|
+
return e.returnValue = false;
|
740
|
+
}
|
741
|
+
};
|
742
|
+
this.listeners = [
|
743
|
+
{
|
744
|
+
element: this.element,
|
745
|
+
events: {
|
746
|
+
"dragstart": (function(_this) {
|
747
|
+
return function(e) {
|
748
|
+
return _this.emit("dragstart", e);
|
749
|
+
};
|
750
|
+
})(this),
|
751
|
+
"dragenter": (function(_this) {
|
752
|
+
return function(e) {
|
753
|
+
noPropagation(e);
|
754
|
+
return _this.emit("dragenter", e);
|
755
|
+
};
|
756
|
+
})(this),
|
757
|
+
"dragover": (function(_this) {
|
758
|
+
return function(e) {
|
759
|
+
var efct;
|
760
|
+
try {
|
761
|
+
efct = e.dataTransfer.effectAllowed;
|
762
|
+
} catch (_error) {}
|
763
|
+
e.dataTransfer.dropEffect = 'move' === efct || 'linkMove' === efct ? 'move' : 'copy';
|
764
|
+
noPropagation(e);
|
765
|
+
return _this.emit("dragover", e);
|
766
|
+
};
|
767
|
+
})(this),
|
768
|
+
"dragleave": (function(_this) {
|
769
|
+
return function(e) {
|
770
|
+
return _this.emit("dragleave", e);
|
771
|
+
};
|
772
|
+
})(this),
|
773
|
+
"drop": (function(_this) {
|
774
|
+
return function(e) {
|
775
|
+
noPropagation(e);
|
776
|
+
return _this.drop(e);
|
777
|
+
};
|
778
|
+
})(this),
|
779
|
+
"dragend": (function(_this) {
|
780
|
+
return function(e) {
|
781
|
+
return _this.emit("dragend", e);
|
782
|
+
};
|
783
|
+
})(this)
|
784
|
+
}
|
785
|
+
}
|
786
|
+
];
|
787
|
+
this.clickableElements.forEach((function(_this) {
|
788
|
+
return function(clickableElement) {
|
789
|
+
return _this.listeners.push({
|
790
|
+
element: clickableElement,
|
791
|
+
events: {
|
792
|
+
"click": function(evt) {
|
793
|
+
if ((clickableElement !== _this.element) || (evt.target === _this.element || Dropzone.elementInside(evt.target, _this.element.querySelector(".dz-message")))) {
|
794
|
+
return _this.hiddenFileInput.click();
|
795
|
+
}
|
796
|
+
}
|
797
|
+
}
|
798
|
+
});
|
799
|
+
};
|
800
|
+
})(this));
|
801
|
+
this.enable();
|
802
|
+
return this.options.init.call(this);
|
803
|
+
};
|
804
|
+
|
805
|
+
Dropzone.prototype.destroy = function() {
|
806
|
+
var _ref;
|
807
|
+
this.disable();
|
808
|
+
this.removeAllFiles(true);
|
809
|
+
if ((_ref = this.hiddenFileInput) != null ? _ref.parentNode : void 0) {
|
810
|
+
this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);
|
811
|
+
this.hiddenFileInput = null;
|
812
|
+
}
|
813
|
+
delete this.element.dropzone;
|
814
|
+
return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1);
|
815
|
+
};
|
816
|
+
|
817
|
+
Dropzone.prototype.updateTotalUploadProgress = function() {
|
818
|
+
var activeFiles, file, totalBytes, totalBytesSent, totalUploadProgress, _i, _len, _ref;
|
819
|
+
totalBytesSent = 0;
|
820
|
+
totalBytes = 0;
|
821
|
+
activeFiles = this.getActiveFiles();
|
822
|
+
if (activeFiles.length) {
|
823
|
+
_ref = this.getActiveFiles();
|
824
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
825
|
+
file = _ref[_i];
|
826
|
+
totalBytesSent += file.upload.bytesSent;
|
827
|
+
totalBytes += file.upload.total;
|
828
|
+
}
|
829
|
+
totalUploadProgress = 100 * totalBytesSent / totalBytes;
|
830
|
+
} else {
|
831
|
+
totalUploadProgress = 100;
|
832
|
+
}
|
833
|
+
return this.emit("totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent);
|
834
|
+
};
|
835
|
+
|
836
|
+
Dropzone.prototype.getFallbackForm = function() {
|
837
|
+
var existingFallback, fields, fieldsString, form;
|
838
|
+
if (existingFallback = this.getExistingFallback()) {
|
839
|
+
return existingFallback;
|
840
|
+
}
|
841
|
+
fieldsString = "<div class=\"dz-fallback\">";
|
842
|
+
if (this.options.dictFallbackText) {
|
843
|
+
fieldsString += "<p>" + this.options.dictFallbackText + "</p>";
|
844
|
+
}
|
845
|
+
fieldsString += "<input type=\"file\" name=\"" + this.options.paramName + (this.options.uploadMultiple ? "[]" : "") + "\" " + (this.options.uploadMultiple ? 'multiple="multiple"' : void 0) + " /><input type=\"submit\" value=\"Upload!\"></div>";
|
846
|
+
fields = Dropzone.createElement(fieldsString);
|
847
|
+
if (this.element.tagName !== "FORM") {
|
848
|
+
form = Dropzone.createElement("<form action=\"" + this.options.url + "\" enctype=\"multipart/form-data\" method=\"" + this.options.method + "\"></form>");
|
849
|
+
form.appendChild(fields);
|
850
|
+
} else {
|
851
|
+
this.element.setAttribute("enctype", "multipart/form-data");
|
852
|
+
this.element.setAttribute("method", this.options.method);
|
853
|
+
}
|
854
|
+
return form != null ? form : fields;
|
855
|
+
};
|
856
|
+
|
857
|
+
Dropzone.prototype.getExistingFallback = function() {
|
858
|
+
var fallback, getFallback, tagName, _i, _len, _ref;
|
859
|
+
getFallback = function(elements) {
|
860
|
+
var el, _i, _len;
|
861
|
+
for (_i = 0, _len = elements.length; _i < _len; _i++) {
|
862
|
+
el = elements[_i];
|
863
|
+
if (/(^| )fallback($| )/.test(el.className)) {
|
864
|
+
return el;
|
865
|
+
}
|
866
|
+
}
|
867
|
+
};
|
868
|
+
_ref = ["div", "form"];
|
869
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
870
|
+
tagName = _ref[_i];
|
871
|
+
if (fallback = getFallback(this.element.getElementsByTagName(tagName))) {
|
872
|
+
return fallback;
|
873
|
+
}
|
874
|
+
}
|
875
|
+
};
|
876
|
+
|
877
|
+
Dropzone.prototype.setupEventListeners = function() {
|
878
|
+
var elementListeners, event, listener, _i, _len, _ref, _results;
|
879
|
+
_ref = this.listeners;
|
880
|
+
_results = [];
|
881
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
882
|
+
elementListeners = _ref[_i];
|
883
|
+
_results.push((function() {
|
884
|
+
var _ref1, _results1;
|
885
|
+
_ref1 = elementListeners.events;
|
886
|
+
_results1 = [];
|
887
|
+
for (event in _ref1) {
|
888
|
+
listener = _ref1[event];
|
889
|
+
_results1.push(elementListeners.element.addEventListener(event, listener, false));
|
890
|
+
}
|
891
|
+
return _results1;
|
892
|
+
})());
|
893
|
+
}
|
894
|
+
return _results;
|
895
|
+
};
|
896
|
+
|
897
|
+
Dropzone.prototype.removeEventListeners = function() {
|
898
|
+
var elementListeners, event, listener, _i, _len, _ref, _results;
|
899
|
+
_ref = this.listeners;
|
900
|
+
_results = [];
|
901
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
902
|
+
elementListeners = _ref[_i];
|
903
|
+
_results.push((function() {
|
904
|
+
var _ref1, _results1;
|
905
|
+
_ref1 = elementListeners.events;
|
906
|
+
_results1 = [];
|
907
|
+
for (event in _ref1) {
|
908
|
+
listener = _ref1[event];
|
909
|
+
_results1.push(elementListeners.element.removeEventListener(event, listener, false));
|
910
|
+
}
|
911
|
+
return _results1;
|
912
|
+
})());
|
913
|
+
}
|
914
|
+
return _results;
|
915
|
+
};
|
916
|
+
|
917
|
+
Dropzone.prototype.disable = function() {
|
918
|
+
var file, _i, _len, _ref, _results;
|
919
|
+
this.clickableElements.forEach(function(element) {
|
920
|
+
return element.classList.remove("dz-clickable");
|
921
|
+
});
|
922
|
+
this.removeEventListeners();
|
923
|
+
_ref = this.files;
|
924
|
+
_results = [];
|
925
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
926
|
+
file = _ref[_i];
|
927
|
+
_results.push(this.cancelUpload(file));
|
928
|
+
}
|
929
|
+
return _results;
|
930
|
+
};
|
931
|
+
|
932
|
+
Dropzone.prototype.enable = function() {
|
933
|
+
this.clickableElements.forEach(function(element) {
|
934
|
+
return element.classList.add("dz-clickable");
|
935
|
+
});
|
936
|
+
return this.setupEventListeners();
|
937
|
+
};
|
938
|
+
|
939
|
+
Dropzone.prototype.filesize = function(size) {
|
940
|
+
var string;
|
941
|
+
if (size >= 1024 * 1024 * 1024 * 1024 / 10) {
|
942
|
+
size = size / (1024 * 1024 * 1024 * 1024 / 10);
|
943
|
+
string = "TiB";
|
944
|
+
} else if (size >= 1024 * 1024 * 1024 / 10) {
|
945
|
+
size = size / (1024 * 1024 * 1024 / 10);
|
946
|
+
string = "GiB";
|
947
|
+
} else if (size >= 1024 * 1024 / 10) {
|
948
|
+
size = size / (1024 * 1024 / 10);
|
949
|
+
string = "MiB";
|
950
|
+
} else if (size >= 1024 / 10) {
|
951
|
+
size = size / (1024 / 10);
|
952
|
+
string = "KiB";
|
953
|
+
} else {
|
954
|
+
size = size * 10;
|
955
|
+
string = "b";
|
956
|
+
}
|
957
|
+
return "<strong>" + (Math.round(size) / 10) + "</strong> " + string;
|
958
|
+
};
|
959
|
+
|
960
|
+
Dropzone.prototype._updateMaxFilesReachedClass = function() {
|
961
|
+
if ((this.options.maxFiles != null) && this.getAcceptedFiles().length >= this.options.maxFiles) {
|
962
|
+
if (this.getAcceptedFiles().length === this.options.maxFiles) {
|
963
|
+
this.emit('maxfilesreached', this.files);
|
964
|
+
}
|
965
|
+
return this.element.classList.add("dz-max-files-reached");
|
966
|
+
} else {
|
967
|
+
return this.element.classList.remove("dz-max-files-reached");
|
968
|
+
}
|
969
|
+
};
|
970
|
+
|
971
|
+
Dropzone.prototype.drop = function(e) {
|
972
|
+
var files, items;
|
973
|
+
if (!e.dataTransfer) {
|
974
|
+
return;
|
975
|
+
}
|
976
|
+
this.emit("drop", e);
|
977
|
+
files = e.dataTransfer.files;
|
978
|
+
if (files.length) {
|
979
|
+
items = e.dataTransfer.items;
|
980
|
+
if (items && items.length && (items[0].webkitGetAsEntry != null)) {
|
981
|
+
this._addFilesFromItems(items);
|
982
|
+
} else {
|
983
|
+
this.handleFiles(files);
|
984
|
+
}
|
985
|
+
}
|
986
|
+
};
|
987
|
+
|
988
|
+
Dropzone.prototype.paste = function(e) {
|
989
|
+
var items, _ref;
|
990
|
+
if ((e != null ? (_ref = e.clipboardData) != null ? _ref.items : void 0 : void 0) == null) {
|
991
|
+
return;
|
992
|
+
}
|
993
|
+
this.emit("paste", e);
|
994
|
+
items = e.clipboardData.items;
|
995
|
+
if (items.length) {
|
996
|
+
return this._addFilesFromItems(items);
|
997
|
+
}
|
998
|
+
};
|
999
|
+
|
1000
|
+
Dropzone.prototype.handleFiles = function(files) {
|
1001
|
+
var file, _i, _len, _results;
|
1002
|
+
_results = [];
|
1003
|
+
for (_i = 0, _len = files.length; _i < _len; _i++) {
|
1004
|
+
file = files[_i];
|
1005
|
+
_results.push(this.addFile(file));
|
1006
|
+
}
|
1007
|
+
return _results;
|
1008
|
+
};
|
1009
|
+
|
1010
|
+
Dropzone.prototype._addFilesFromItems = function(items) {
|
1011
|
+
var entry, item, _i, _len, _results;
|
1012
|
+
_results = [];
|
1013
|
+
for (_i = 0, _len = items.length; _i < _len; _i++) {
|
1014
|
+
item = items[_i];
|
1015
|
+
if ((item.webkitGetAsEntry != null) && (entry = item.webkitGetAsEntry())) {
|
1016
|
+
if (entry.isFile) {
|
1017
|
+
_results.push(this.addFile(item.getAsFile()));
|
1018
|
+
} else if (entry.isDirectory) {
|
1019
|
+
_results.push(this._addFilesFromDirectory(entry, entry.name));
|
1020
|
+
} else {
|
1021
|
+
_results.push(void 0);
|
1022
|
+
}
|
1023
|
+
} else if (item.getAsFile != null) {
|
1024
|
+
if ((item.kind == null) || item.kind === "file") {
|
1025
|
+
_results.push(this.addFile(item.getAsFile()));
|
1026
|
+
} else {
|
1027
|
+
_results.push(void 0);
|
1028
|
+
}
|
1029
|
+
} else {
|
1030
|
+
_results.push(void 0);
|
1031
|
+
}
|
1032
|
+
}
|
1033
|
+
return _results;
|
1034
|
+
};
|
1035
|
+
|
1036
|
+
Dropzone.prototype._addFilesFromDirectory = function(directory, path) {
|
1037
|
+
var dirReader, entriesReader;
|
1038
|
+
dirReader = directory.createReader();
|
1039
|
+
entriesReader = (function(_this) {
|
1040
|
+
return function(entries) {
|
1041
|
+
var entry, _i, _len;
|
1042
|
+
for (_i = 0, _len = entries.length; _i < _len; _i++) {
|
1043
|
+
entry = entries[_i];
|
1044
|
+
if (entry.isFile) {
|
1045
|
+
entry.file(function(file) {
|
1046
|
+
if (_this.options.ignoreHiddenFiles && file.name.substring(0, 1) === '.') {
|
1047
|
+
return;
|
1048
|
+
}
|
1049
|
+
file.fullPath = "" + path + "/" + file.name;
|
1050
|
+
return _this.addFile(file);
|
1051
|
+
});
|
1052
|
+
} else if (entry.isDirectory) {
|
1053
|
+
_this._addFilesFromDirectory(entry, "" + path + "/" + entry.name);
|
1054
|
+
}
|
1055
|
+
}
|
1056
|
+
};
|
1057
|
+
})(this);
|
1058
|
+
return dirReader.readEntries(entriesReader, function(error) {
|
1059
|
+
return typeof console !== "undefined" && console !== null ? typeof console.log === "function" ? console.log(error) : void 0 : void 0;
|
1060
|
+
});
|
1061
|
+
};
|
1062
|
+
|
1063
|
+
Dropzone.prototype.accept = function(file, done) {
|
1064
|
+
if (file.size > this.options.maxFilesize * 1024 * 1024) {
|
1065
|
+
return done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize));
|
1066
|
+
} else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) {
|
1067
|
+
return done(this.options.dictInvalidFileType);
|
1068
|
+
} else if ((this.options.maxFiles != null) && this.getAcceptedFiles().length >= this.options.maxFiles) {
|
1069
|
+
done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles));
|
1070
|
+
return this.emit("maxfilesexceeded", file);
|
1071
|
+
} else {
|
1072
|
+
return this.options.accept.call(this, file, done);
|
1073
|
+
}
|
1074
|
+
};
|
1075
|
+
|
1076
|
+
Dropzone.prototype.addFile = function(file) {
|
1077
|
+
file.upload = {
|
1078
|
+
progress: 0,
|
1079
|
+
total: file.size,
|
1080
|
+
bytesSent: 0
|
1081
|
+
};
|
1082
|
+
this.files.push(file);
|
1083
|
+
file.status = Dropzone.ADDED;
|
1084
|
+
this.emit("addedfile", file);
|
1085
|
+
this._enqueueThumbnail(file);
|
1086
|
+
return this.accept(file, (function(_this) {
|
1087
|
+
return function(error) {
|
1088
|
+
if (error) {
|
1089
|
+
file.accepted = false;
|
1090
|
+
_this._errorProcessing([file], error);
|
1091
|
+
} else {
|
1092
|
+
file.accepted = true;
|
1093
|
+
if (_this.options.autoQueue) {
|
1094
|
+
_this.enqueueFile(file);
|
1095
|
+
}
|
1096
|
+
}
|
1097
|
+
return _this._updateMaxFilesReachedClass();
|
1098
|
+
};
|
1099
|
+
})(this));
|
1100
|
+
};
|
1101
|
+
|
1102
|
+
Dropzone.prototype.enqueueFiles = function(files) {
|
1103
|
+
var file, _i, _len;
|
1104
|
+
for (_i = 0, _len = files.length; _i < _len; _i++) {
|
1105
|
+
file = files[_i];
|
1106
|
+
this.enqueueFile(file);
|
1107
|
+
}
|
1108
|
+
return null;
|
1109
|
+
};
|
1110
|
+
|
1111
|
+
Dropzone.prototype.enqueueFile = function(file) {
|
1112
|
+
if (file.status === Dropzone.ADDED && file.accepted === true) {
|
1113
|
+
file.status = Dropzone.QUEUED;
|
1114
|
+
if (this.options.autoProcessQueue) {
|
1115
|
+
return setTimeout(((function(_this) {
|
1116
|
+
return function() {
|
1117
|
+
return _this.processQueue();
|
1118
|
+
};
|
1119
|
+
})(this)), 0);
|
1120
|
+
}
|
1121
|
+
} else {
|
1122
|
+
throw new Error("This file can't be queued because it has already been processed or was rejected.");
|
1123
|
+
}
|
1124
|
+
};
|
1125
|
+
|
1126
|
+
Dropzone.prototype._thumbnailQueue = [];
|
1127
|
+
|
1128
|
+
Dropzone.prototype._processingThumbnail = false;
|
1129
|
+
|
1130
|
+
Dropzone.prototype._enqueueThumbnail = function(file) {
|
1131
|
+
if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1024 * 1024) {
|
1132
|
+
this._thumbnailQueue.push(file);
|
1133
|
+
return setTimeout(((function(_this) {
|
1134
|
+
return function() {
|
1135
|
+
return _this._processThumbnailQueue();
|
1136
|
+
};
|
1137
|
+
})(this)), 0);
|
1138
|
+
}
|
1139
|
+
};
|
1140
|
+
|
1141
|
+
Dropzone.prototype._processThumbnailQueue = function() {
|
1142
|
+
if (this._processingThumbnail || this._thumbnailQueue.length === 0) {
|
1143
|
+
return;
|
1144
|
+
}
|
1145
|
+
this._processingThumbnail = true;
|
1146
|
+
return this.createThumbnail(this._thumbnailQueue.shift(), (function(_this) {
|
1147
|
+
return function() {
|
1148
|
+
_this._processingThumbnail = false;
|
1149
|
+
return _this._processThumbnailQueue();
|
1150
|
+
};
|
1151
|
+
})(this));
|
1152
|
+
};
|
1153
|
+
|
1154
|
+
Dropzone.prototype.removeFile = function(file) {
|
1155
|
+
if (file.status === Dropzone.UPLOADING) {
|
1156
|
+
this.cancelUpload(file);
|
1157
|
+
}
|
1158
|
+
this.files = without(this.files, file);
|
1159
|
+
this.emit("removedfile", file);
|
1160
|
+
if (this.files.length === 0) {
|
1161
|
+
return this.emit("reset");
|
1162
|
+
}
|
1163
|
+
};
|
1164
|
+
|
1165
|
+
Dropzone.prototype.removeAllFiles = function(cancelIfNecessary) {
|
1166
|
+
var file, _i, _len, _ref;
|
1167
|
+
if (cancelIfNecessary == null) {
|
1168
|
+
cancelIfNecessary = false;
|
1169
|
+
}
|
1170
|
+
_ref = this.files.slice();
|
1171
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
1172
|
+
file = _ref[_i];
|
1173
|
+
if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) {
|
1174
|
+
this.removeFile(file);
|
1175
|
+
}
|
1176
|
+
}
|
1177
|
+
return null;
|
1178
|
+
};
|
1179
|
+
|
1180
|
+
Dropzone.prototype.createThumbnail = function(file, callback) {
|
1181
|
+
var fileReader;
|
1182
|
+
fileReader = new FileReader;
|
1183
|
+
fileReader.onload = (function(_this) {
|
1184
|
+
return function() {
|
1185
|
+
var img;
|
1186
|
+
img = document.createElement("img");
|
1187
|
+
img.onload = function() {
|
1188
|
+
var canvas, ctx, resizeInfo, thumbnail, _ref, _ref1, _ref2, _ref3;
|
1189
|
+
file.width = img.width;
|
1190
|
+
file.height = img.height;
|
1191
|
+
resizeInfo = _this.options.resize.call(_this, file);
|
1192
|
+
if (resizeInfo.trgWidth == null) {
|
1193
|
+
resizeInfo.trgWidth = _this.options.thumbnailWidth;
|
1194
|
+
}
|
1195
|
+
if (resizeInfo.trgHeight == null) {
|
1196
|
+
resizeInfo.trgHeight = _this.options.thumbnailHeight;
|
1197
|
+
}
|
1198
|
+
canvas = document.createElement("canvas");
|
1199
|
+
ctx = canvas.getContext("2d");
|
1200
|
+
canvas.width = resizeInfo.trgWidth;
|
1201
|
+
canvas.height = resizeInfo.trgHeight;
|
1202
|
+
drawImageIOSFix(ctx, img, (_ref = resizeInfo.srcX) != null ? _ref : 0, (_ref1 = resizeInfo.srcY) != null ? _ref1 : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, (_ref2 = resizeInfo.trgX) != null ? _ref2 : 0, (_ref3 = resizeInfo.trgY) != null ? _ref3 : 0, resizeInfo.trgWidth, resizeInfo.trgHeight);
|
1203
|
+
thumbnail = canvas.toDataURL("image/png");
|
1204
|
+
_this.emit("thumbnail", file, thumbnail);
|
1205
|
+
if (callback != null) {
|
1206
|
+
return callback();
|
1207
|
+
}
|
1208
|
+
};
|
1209
|
+
return img.src = fileReader.result;
|
1210
|
+
};
|
1211
|
+
})(this);
|
1212
|
+
return fileReader.readAsDataURL(file);
|
1213
|
+
};
|
1214
|
+
|
1215
|
+
Dropzone.prototype.processQueue = function() {
|
1216
|
+
var i, parallelUploads, processingLength, queuedFiles;
|
1217
|
+
parallelUploads = this.options.parallelUploads;
|
1218
|
+
processingLength = this.getUploadingFiles().length;
|
1219
|
+
i = processingLength;
|
1220
|
+
if (processingLength >= parallelUploads) {
|
1221
|
+
return;
|
1222
|
+
}
|
1223
|
+
queuedFiles = this.getQueuedFiles();
|
1224
|
+
if (!(queuedFiles.length > 0)) {
|
1225
|
+
return;
|
1226
|
+
}
|
1227
|
+
if (this.options.uploadMultiple) {
|
1228
|
+
return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength));
|
1229
|
+
} else {
|
1230
|
+
while (i < parallelUploads) {
|
1231
|
+
if (!queuedFiles.length) {
|
1232
|
+
return;
|
1233
|
+
}
|
1234
|
+
this.processFile(queuedFiles.shift());
|
1235
|
+
i++;
|
1236
|
+
}
|
1237
|
+
}
|
1238
|
+
};
|
1239
|
+
|
1240
|
+
Dropzone.prototype.processFile = function(file) {
|
1241
|
+
return this.processFiles([file]);
|
1242
|
+
};
|
1243
|
+
|
1244
|
+
Dropzone.prototype.processFiles = function(files) {
|
1245
|
+
var file, _i, _len;
|
1246
|
+
for (_i = 0, _len = files.length; _i < _len; _i++) {
|
1247
|
+
file = files[_i];
|
1248
|
+
file.processing = true;
|
1249
|
+
file.status = Dropzone.UPLOADING;
|
1250
|
+
this.emit("processing", file);
|
1251
|
+
}
|
1252
|
+
if (this.options.uploadMultiple) {
|
1253
|
+
this.emit("processingmultiple", files);
|
1254
|
+
}
|
1255
|
+
return this.uploadFiles(files);
|
1256
|
+
};
|
1257
|
+
|
1258
|
+
Dropzone.prototype._getFilesWithXhr = function(xhr) {
|
1259
|
+
var file, files;
|
1260
|
+
return files = (function() {
|
1261
|
+
var _i, _len, _ref, _results;
|
1262
|
+
_ref = this.files;
|
1263
|
+
_results = [];
|
1264
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
1265
|
+
file = _ref[_i];
|
1266
|
+
if (file.xhr === xhr) {
|
1267
|
+
_results.push(file);
|
1268
|
+
}
|
1269
|
+
}
|
1270
|
+
return _results;
|
1271
|
+
}).call(this);
|
1272
|
+
};
|
1273
|
+
|
1274
|
+
Dropzone.prototype.cancelUpload = function(file) {
|
1275
|
+
var groupedFile, groupedFiles, _i, _j, _len, _len1, _ref;
|
1276
|
+
if (file.status === Dropzone.UPLOADING) {
|
1277
|
+
groupedFiles = this._getFilesWithXhr(file.xhr);
|
1278
|
+
for (_i = 0, _len = groupedFiles.length; _i < _len; _i++) {
|
1279
|
+
groupedFile = groupedFiles[_i];
|
1280
|
+
groupedFile.status = Dropzone.CANCELED;
|
1281
|
+
}
|
1282
|
+
file.xhr.abort();
|
1283
|
+
for (_j = 0, _len1 = groupedFiles.length; _j < _len1; _j++) {
|
1284
|
+
groupedFile = groupedFiles[_j];
|
1285
|
+
this.emit("canceled", groupedFile);
|
1286
|
+
}
|
1287
|
+
if (this.options.uploadMultiple) {
|
1288
|
+
this.emit("canceledmultiple", groupedFiles);
|
1289
|
+
}
|
1290
|
+
} else if ((_ref = file.status) === Dropzone.ADDED || _ref === Dropzone.QUEUED) {
|
1291
|
+
file.status = Dropzone.CANCELED;
|
1292
|
+
this.emit("canceled", file);
|
1293
|
+
if (this.options.uploadMultiple) {
|
1294
|
+
this.emit("canceledmultiple", [file]);
|
1295
|
+
}
|
1296
|
+
}
|
1297
|
+
if (this.options.autoProcessQueue) {
|
1298
|
+
return this.processQueue();
|
1299
|
+
}
|
1300
|
+
};
|
1301
|
+
|
1302
|
+
Dropzone.prototype.uploadFile = function(file) {
|
1303
|
+
return this.uploadFiles([file]);
|
1304
|
+
};
|
1305
|
+
|
1306
|
+
Dropzone.prototype.uploadFiles = function(files) {
|
1307
|
+
var file, formData, handleError, headerName, headerValue, headers, input, inputName, inputType, key, option, progressObj, response, updateProgress, value, xhr, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2, _ref3, _ref4;
|
1308
|
+
xhr = new XMLHttpRequest();
|
1309
|
+
for (_i = 0, _len = files.length; _i < _len; _i++) {
|
1310
|
+
file = files[_i];
|
1311
|
+
file.xhr = xhr;
|
1312
|
+
}
|
1313
|
+
xhr.open(this.options.method, this.options.url, true);
|
1314
|
+
xhr.withCredentials = !!this.options.withCredentials;
|
1315
|
+
response = null;
|
1316
|
+
handleError = (function(_this) {
|
1317
|
+
return function() {
|
1318
|
+
var _j, _len1, _results;
|
1319
|
+
_results = [];
|
1320
|
+
for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
|
1321
|
+
file = files[_j];
|
1322
|
+
_results.push(_this._errorProcessing(files, response || _this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr));
|
1323
|
+
}
|
1324
|
+
return _results;
|
1325
|
+
};
|
1326
|
+
})(this);
|
1327
|
+
updateProgress = (function(_this) {
|
1328
|
+
return function(e) {
|
1329
|
+
var allFilesFinished, progress, _j, _k, _l, _len1, _len2, _len3, _results;
|
1330
|
+
if (e != null) {
|
1331
|
+
progress = 100 * e.loaded / e.total;
|
1332
|
+
for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
|
1333
|
+
file = files[_j];
|
1334
|
+
file.upload = {
|
1335
|
+
progress: progress,
|
1336
|
+
total: e.total,
|
1337
|
+
bytesSent: e.loaded
|
1338
|
+
};
|
1339
|
+
}
|
1340
|
+
} else {
|
1341
|
+
allFilesFinished = true;
|
1342
|
+
progress = 100;
|
1343
|
+
for (_k = 0, _len2 = files.length; _k < _len2; _k++) {
|
1344
|
+
file = files[_k];
|
1345
|
+
if (!(file.upload.progress === 100 && file.upload.bytesSent === file.upload.total)) {
|
1346
|
+
allFilesFinished = false;
|
1347
|
+
}
|
1348
|
+
file.upload.progress = progress;
|
1349
|
+
file.upload.bytesSent = file.upload.total;
|
1350
|
+
}
|
1351
|
+
if (allFilesFinished) {
|
1352
|
+
return;
|
1353
|
+
}
|
1354
|
+
}
|
1355
|
+
_results = [];
|
1356
|
+
for (_l = 0, _len3 = files.length; _l < _len3; _l++) {
|
1357
|
+
file = files[_l];
|
1358
|
+
_results.push(_this.emit("uploadprogress", file, progress, file.upload.bytesSent));
|
1359
|
+
}
|
1360
|
+
return _results;
|
1361
|
+
};
|
1362
|
+
})(this);
|
1363
|
+
xhr.onload = (function(_this) {
|
1364
|
+
return function(e) {
|
1365
|
+
var _ref;
|
1366
|
+
if (files[0].status === Dropzone.CANCELED) {
|
1367
|
+
return;
|
1368
|
+
}
|
1369
|
+
if (xhr.readyState !== 4) {
|
1370
|
+
return;
|
1371
|
+
}
|
1372
|
+
response = xhr.responseText;
|
1373
|
+
if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) {
|
1374
|
+
try {
|
1375
|
+
response = JSON.parse(response);
|
1376
|
+
} catch (_error) {
|
1377
|
+
e = _error;
|
1378
|
+
response = "Invalid JSON response from server.";
|
1379
|
+
}
|
1380
|
+
}
|
1381
|
+
updateProgress();
|
1382
|
+
if (!((200 <= (_ref = xhr.status) && _ref < 300))) {
|
1383
|
+
return handleError();
|
1384
|
+
} else {
|
1385
|
+
return _this._finished(files, response, e);
|
1386
|
+
}
|
1387
|
+
};
|
1388
|
+
})(this);
|
1389
|
+
xhr.onerror = (function(_this) {
|
1390
|
+
return function() {
|
1391
|
+
if (files[0].status === Dropzone.CANCELED) {
|
1392
|
+
return;
|
1393
|
+
}
|
1394
|
+
return handleError();
|
1395
|
+
};
|
1396
|
+
})(this);
|
1397
|
+
progressObj = (_ref = xhr.upload) != null ? _ref : xhr;
|
1398
|
+
progressObj.onprogress = updateProgress;
|
1399
|
+
headers = {
|
1400
|
+
"Accept": "application/json",
|
1401
|
+
"Cache-Control": "no-cache",
|
1402
|
+
"X-Requested-With": "XMLHttpRequest"
|
1403
|
+
};
|
1404
|
+
if (this.options.headers) {
|
1405
|
+
extend(headers, this.options.headers);
|
1406
|
+
}
|
1407
|
+
for (headerName in headers) {
|
1408
|
+
headerValue = headers[headerName];
|
1409
|
+
xhr.setRequestHeader(headerName, headerValue);
|
1410
|
+
}
|
1411
|
+
formData = new FormData();
|
1412
|
+
if (this.options.params) {
|
1413
|
+
_ref1 = this.options.params;
|
1414
|
+
for (key in _ref1) {
|
1415
|
+
value = _ref1[key];
|
1416
|
+
formData.append(key, value);
|
1417
|
+
}
|
1418
|
+
}
|
1419
|
+
for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
|
1420
|
+
file = files[_j];
|
1421
|
+
this.emit("sending", file, xhr, formData);
|
1422
|
+
}
|
1423
|
+
if (this.options.uploadMultiple) {
|
1424
|
+
this.emit("sendingmultiple", files, xhr, formData);
|
1425
|
+
}
|
1426
|
+
if (this.element.tagName === "FORM") {
|
1427
|
+
_ref2 = this.element.querySelectorAll("input, textarea, select, button");
|
1428
|
+
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
|
1429
|
+
input = _ref2[_k];
|
1430
|
+
inputName = input.getAttribute("name");
|
1431
|
+
inputType = input.getAttribute("type");
|
1432
|
+
if (input.tagName === "SELECT" && input.hasAttribute("multiple")) {
|
1433
|
+
_ref3 = input.options;
|
1434
|
+
for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
|
1435
|
+
option = _ref3[_l];
|
1436
|
+
if (option.selected) {
|
1437
|
+
formData.append(inputName, option.value);
|
1438
|
+
}
|
1439
|
+
}
|
1440
|
+
} else if (!inputType || ((_ref4 = inputType.toLowerCase()) !== "checkbox" && _ref4 !== "radio") || input.checked) {
|
1441
|
+
formData.append(inputName, input.value);
|
1442
|
+
}
|
1443
|
+
}
|
1444
|
+
}
|
1445
|
+
for (_m = 0, _len4 = files.length; _m < _len4; _m++) {
|
1446
|
+
file = files[_m];
|
1447
|
+
formData.append("" + this.options.paramName + (this.options.uploadMultiple ? "[]" : ""), file, file.name);
|
1448
|
+
}
|
1449
|
+
return xhr.send(formData);
|
1450
|
+
};
|
1451
|
+
|
1452
|
+
Dropzone.prototype._finished = function(files, responseText, e) {
|
1453
|
+
var file, _i, _len;
|
1454
|
+
for (_i = 0, _len = files.length; _i < _len; _i++) {
|
1455
|
+
file = files[_i];
|
1456
|
+
file.status = Dropzone.SUCCESS;
|
1457
|
+
this.emit("success", file, responseText, e);
|
1458
|
+
this.emit("complete", file);
|
1459
|
+
}
|
1460
|
+
if (this.options.uploadMultiple) {
|
1461
|
+
this.emit("successmultiple", files, responseText, e);
|
1462
|
+
this.emit("completemultiple", files);
|
1463
|
+
}
|
1464
|
+
if (this.options.autoProcessQueue) {
|
1465
|
+
return this.processQueue();
|
1466
|
+
}
|
1467
|
+
};
|
1468
|
+
|
1469
|
+
Dropzone.prototype._errorProcessing = function(files, message, xhr) {
|
1470
|
+
var file, _i, _len;
|
1471
|
+
for (_i = 0, _len = files.length; _i < _len; _i++) {
|
1472
|
+
file = files[_i];
|
1473
|
+
file.status = Dropzone.ERROR;
|
1474
|
+
this.emit("error", file, message, xhr);
|
1475
|
+
this.emit("complete", file);
|
1476
|
+
}
|
1477
|
+
if (this.options.uploadMultiple) {
|
1478
|
+
this.emit("errormultiple", files, message, xhr);
|
1479
|
+
this.emit("completemultiple", files);
|
1480
|
+
}
|
1481
|
+
if (this.options.autoProcessQueue) {
|
1482
|
+
return this.processQueue();
|
1483
|
+
}
|
1484
|
+
};
|
1485
|
+
|
1486
|
+
return Dropzone;
|
1487
|
+
|
1488
|
+
})(Em);
|
1489
|
+
|
1490
|
+
Dropzone.version = "3.8.7";
|
1491
|
+
|
1492
|
+
Dropzone.options = {};
|
1493
|
+
|
1494
|
+
Dropzone.optionsForElement = function(element) {
|
1495
|
+
if (element.getAttribute("id")) {
|
1496
|
+
return Dropzone.options[camelize(element.getAttribute("id"))];
|
1497
|
+
} else {
|
1498
|
+
return void 0;
|
1499
|
+
}
|
1500
|
+
};
|
1501
|
+
|
1502
|
+
Dropzone.instances = [];
|
1503
|
+
|
1504
|
+
Dropzone.forElement = function(element) {
|
1505
|
+
if (typeof element === "string") {
|
1506
|
+
element = document.querySelector(element);
|
1507
|
+
}
|
1508
|
+
if ((element != null ? element.dropzone : void 0) == null) {
|
1509
|
+
throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");
|
1510
|
+
}
|
1511
|
+
return element.dropzone;
|
1512
|
+
};
|
1513
|
+
|
1514
|
+
Dropzone.autoDiscover = true;
|
1515
|
+
|
1516
|
+
Dropzone.discover = function() {
|
1517
|
+
var checkElements, dropzone, dropzones, _i, _len, _results;
|
1518
|
+
if (document.querySelectorAll) {
|
1519
|
+
dropzones = document.querySelectorAll(".dropzone");
|
1520
|
+
} else {
|
1521
|
+
dropzones = [];
|
1522
|
+
checkElements = function(elements) {
|
1523
|
+
var el, _i, _len, _results;
|
1524
|
+
_results = [];
|
1525
|
+
for (_i = 0, _len = elements.length; _i < _len; _i++) {
|
1526
|
+
el = elements[_i];
|
1527
|
+
if (/(^| )dropzone($| )/.test(el.className)) {
|
1528
|
+
_results.push(dropzones.push(el));
|
1529
|
+
} else {
|
1530
|
+
_results.push(void 0);
|
1531
|
+
}
|
1532
|
+
}
|
1533
|
+
return _results;
|
1534
|
+
};
|
1535
|
+
checkElements(document.getElementsByTagName("div"));
|
1536
|
+
checkElements(document.getElementsByTagName("form"));
|
1537
|
+
}
|
1538
|
+
_results = [];
|
1539
|
+
for (_i = 0, _len = dropzones.length; _i < _len; _i++) {
|
1540
|
+
dropzone = dropzones[_i];
|
1541
|
+
if (Dropzone.optionsForElement(dropzone) !== false) {
|
1542
|
+
_results.push(new Dropzone(dropzone));
|
1543
|
+
} else {
|
1544
|
+
_results.push(void 0);
|
1545
|
+
}
|
1546
|
+
}
|
1547
|
+
return _results;
|
1548
|
+
};
|
1549
|
+
|
1550
|
+
Dropzone.blacklistedBrowsers = [/opera.*Macintosh.*version\/12/i];
|
1551
|
+
|
1552
|
+
Dropzone.isBrowserSupported = function() {
|
1553
|
+
var capableBrowser, regex, _i, _len, _ref;
|
1554
|
+
capableBrowser = true;
|
1555
|
+
if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {
|
1556
|
+
if (!("classList" in document.createElement("a"))) {
|
1557
|
+
capableBrowser = false;
|
1558
|
+
} else {
|
1559
|
+
_ref = Dropzone.blacklistedBrowsers;
|
1560
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
1561
|
+
regex = _ref[_i];
|
1562
|
+
if (regex.test(navigator.userAgent)) {
|
1563
|
+
capableBrowser = false;
|
1564
|
+
continue;
|
1565
|
+
}
|
1566
|
+
}
|
1567
|
+
}
|
1568
|
+
} else {
|
1569
|
+
capableBrowser = false;
|
1570
|
+
}
|
1571
|
+
return capableBrowser;
|
1572
|
+
};
|
1573
|
+
|
1574
|
+
without = function(list, rejectedItem) {
|
1575
|
+
var item, _i, _len, _results;
|
1576
|
+
_results = [];
|
1577
|
+
for (_i = 0, _len = list.length; _i < _len; _i++) {
|
1578
|
+
item = list[_i];
|
1579
|
+
if (item !== rejectedItem) {
|
1580
|
+
_results.push(item);
|
1581
|
+
}
|
1582
|
+
}
|
1583
|
+
return _results;
|
1584
|
+
};
|
1585
|
+
|
1586
|
+
camelize = function(str) {
|
1587
|
+
return str.replace(/[\-_](\w)/g, function(match) {
|
1588
|
+
return match.charAt(1).toUpperCase();
|
1589
|
+
});
|
1590
|
+
};
|
1591
|
+
|
1592
|
+
Dropzone.createElement = function(string) {
|
1593
|
+
var div;
|
1594
|
+
div = document.createElement("div");
|
1595
|
+
div.innerHTML = string;
|
1596
|
+
return div.childNodes[0];
|
1597
|
+
};
|
1598
|
+
|
1599
|
+
Dropzone.elementInside = function(element, container) {
|
1600
|
+
if (element === container) {
|
1601
|
+
return true;
|
1602
|
+
}
|
1603
|
+
while (element = element.parentNode) {
|
1604
|
+
if (element === container) {
|
1605
|
+
return true;
|
1606
|
+
}
|
1607
|
+
}
|
1608
|
+
return false;
|
1609
|
+
};
|
1610
|
+
|
1611
|
+
Dropzone.getElement = function(el, name) {
|
1612
|
+
var element;
|
1613
|
+
if (typeof el === "string") {
|
1614
|
+
element = document.querySelector(el);
|
1615
|
+
} else if (el.nodeType != null) {
|
1616
|
+
element = el;
|
1617
|
+
}
|
1618
|
+
if (element == null) {
|
1619
|
+
throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector or a plain HTML element.");
|
1620
|
+
}
|
1621
|
+
return element;
|
1622
|
+
};
|
1623
|
+
|
1624
|
+
Dropzone.getElements = function(els, name) {
|
1625
|
+
var e, el, elements, _i, _j, _len, _len1, _ref;
|
1626
|
+
if (els instanceof Array) {
|
1627
|
+
elements = [];
|
1628
|
+
try {
|
1629
|
+
for (_i = 0, _len = els.length; _i < _len; _i++) {
|
1630
|
+
el = els[_i];
|
1631
|
+
elements.push(this.getElement(el, name));
|
1632
|
+
}
|
1633
|
+
} catch (_error) {
|
1634
|
+
e = _error;
|
1635
|
+
elements = null;
|
1636
|
+
}
|
1637
|
+
} else if (typeof els === "string") {
|
1638
|
+
elements = [];
|
1639
|
+
_ref = document.querySelectorAll(els);
|
1640
|
+
for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
|
1641
|
+
el = _ref[_j];
|
1642
|
+
elements.push(el);
|
1643
|
+
}
|
1644
|
+
} else if (els.nodeType != null) {
|
1645
|
+
elements = [els];
|
1646
|
+
}
|
1647
|
+
if (!((elements != null) && elements.length)) {
|
1648
|
+
throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");
|
1649
|
+
}
|
1650
|
+
return elements;
|
1651
|
+
};
|
1652
|
+
|
1653
|
+
Dropzone.confirm = function(question, accepted, rejected) {
|
1654
|
+
if (window.confirm(question)) {
|
1655
|
+
return accepted();
|
1656
|
+
} else if (rejected != null) {
|
1657
|
+
return rejected();
|
1658
|
+
}
|
1659
|
+
};
|
1660
|
+
|
1661
|
+
Dropzone.isValidFile = function(file, acceptedFiles) {
|
1662
|
+
var baseMimeType, mimeType, validType, _i, _len;
|
1663
|
+
if (!acceptedFiles) {
|
1664
|
+
return true;
|
1665
|
+
}
|
1666
|
+
acceptedFiles = acceptedFiles.split(",");
|
1667
|
+
mimeType = file.type;
|
1668
|
+
baseMimeType = mimeType.replace(/\/.*$/, "");
|
1669
|
+
for (_i = 0, _len = acceptedFiles.length; _i < _len; _i++) {
|
1670
|
+
validType = acceptedFiles[_i];
|
1671
|
+
validType = validType.trim();
|
1672
|
+
if (validType.charAt(0) === ".") {
|
1673
|
+
if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {
|
1674
|
+
return true;
|
1675
|
+
}
|
1676
|
+
} else if (/\/\*$/.test(validType)) {
|
1677
|
+
if (baseMimeType === validType.replace(/\/.*$/, "")) {
|
1678
|
+
return true;
|
1679
|
+
}
|
1680
|
+
} else {
|
1681
|
+
if (mimeType === validType) {
|
1682
|
+
return true;
|
1683
|
+
}
|
1684
|
+
}
|
1685
|
+
}
|
1686
|
+
return false;
|
1687
|
+
};
|
1688
|
+
|
1689
|
+
if (typeof jQuery !== "undefined" && jQuery !== null) {
|
1690
|
+
jQuery.fn.dropzone = function(options) {
|
1691
|
+
return this.each(function() {
|
1692
|
+
return new Dropzone(this, options);
|
1693
|
+
});
|
1694
|
+
};
|
1695
|
+
}
|
1696
|
+
|
1697
|
+
if (typeof module !== "undefined" && module !== null) {
|
1698
|
+
module.exports = Dropzone;
|
1699
|
+
} else {
|
1700
|
+
window.Dropzone = Dropzone;
|
1701
|
+
}
|
1702
|
+
|
1703
|
+
Dropzone.ADDED = "added";
|
1704
|
+
|
1705
|
+
Dropzone.QUEUED = "queued";
|
1706
|
+
|
1707
|
+
Dropzone.ACCEPTED = Dropzone.QUEUED;
|
1708
|
+
|
1709
|
+
Dropzone.UPLOADING = "uploading";
|
1710
|
+
|
1711
|
+
Dropzone.PROCESSING = Dropzone.UPLOADING;
|
1712
|
+
|
1713
|
+
Dropzone.CANCELED = "canceled";
|
1714
|
+
|
1715
|
+
Dropzone.ERROR = "error";
|
1716
|
+
|
1717
|
+
Dropzone.SUCCESS = "success";
|
1718
|
+
|
1719
|
+
|
1720
|
+
/*
|
1721
|
+
|
1722
|
+
Bugfix for iOS 6 and 7
|
1723
|
+
Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios
|
1724
|
+
based on the work of https://github.com/stomita/ios-imagefile-megapixel
|
1725
|
+
*/
|
1726
|
+
|
1727
|
+
detectVerticalSquash = function(img) {
|
1728
|
+
var alpha, canvas, ctx, data, ey, ih, iw, py, ratio, sy;
|
1729
|
+
iw = img.naturalWidth;
|
1730
|
+
ih = img.naturalHeight;
|
1731
|
+
canvas = document.createElement("canvas");
|
1732
|
+
canvas.width = 1;
|
1733
|
+
canvas.height = ih;
|
1734
|
+
ctx = canvas.getContext("2d");
|
1735
|
+
ctx.drawImage(img, 0, 0);
|
1736
|
+
data = ctx.getImageData(0, 0, 1, ih).data;
|
1737
|
+
sy = 0;
|
1738
|
+
ey = ih;
|
1739
|
+
py = ih;
|
1740
|
+
while (py > sy) {
|
1741
|
+
alpha = data[(py - 1) * 4 + 3];
|
1742
|
+
if (alpha === 0) {
|
1743
|
+
ey = py;
|
1744
|
+
} else {
|
1745
|
+
sy = py;
|
1746
|
+
}
|
1747
|
+
py = (ey + sy) >> 1;
|
1748
|
+
}
|
1749
|
+
ratio = py / ih;
|
1750
|
+
if (ratio === 0) {
|
1751
|
+
return 1;
|
1752
|
+
} else {
|
1753
|
+
return ratio;
|
1754
|
+
}
|
1755
|
+
};
|
1756
|
+
|
1757
|
+
drawImageIOSFix = function(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) {
|
1758
|
+
var vertSquashRatio;
|
1759
|
+
vertSquashRatio = detectVerticalSquash(img);
|
1760
|
+
return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio);
|
1761
|
+
};
|
1762
|
+
|
1763
|
+
|
1764
|
+
/*
|
1765
|
+
* contentloaded.js
|
1766
|
+
*
|
1767
|
+
* Author: Diego Perini (diego.perini at gmail.com)
|
1768
|
+
* Summary: cross-browser wrapper for DOMContentLoaded
|
1769
|
+
* Updated: 20101020
|
1770
|
+
* License: MIT
|
1771
|
+
* Version: 1.2
|
1772
|
+
*
|
1773
|
+
* URL:
|
1774
|
+
* http://javascript.nwbox.com/ContentLoaded/
|
1775
|
+
* http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE
|
1776
|
+
*/
|
1777
|
+
|
1778
|
+
contentLoaded = function(win, fn) {
|
1779
|
+
var add, doc, done, init, poll, pre, rem, root, top;
|
1780
|
+
done = false;
|
1781
|
+
top = true;
|
1782
|
+
doc = win.document;
|
1783
|
+
root = doc.documentElement;
|
1784
|
+
add = (doc.addEventListener ? "addEventListener" : "attachEvent");
|
1785
|
+
rem = (doc.addEventListener ? "removeEventListener" : "detachEvent");
|
1786
|
+
pre = (doc.addEventListener ? "" : "on");
|
1787
|
+
init = function(e) {
|
1788
|
+
if (e.type === "readystatechange" && doc.readyState !== "complete") {
|
1789
|
+
return;
|
1790
|
+
}
|
1791
|
+
(e.type === "load" ? win : doc)[rem](pre + e.type, init, false);
|
1792
|
+
if (!done && (done = true)) {
|
1793
|
+
return fn.call(win, e.type || e);
|
1794
|
+
}
|
1795
|
+
};
|
1796
|
+
poll = function() {
|
1797
|
+
var e;
|
1798
|
+
try {
|
1799
|
+
root.doScroll("left");
|
1800
|
+
} catch (_error) {
|
1801
|
+
e = _error;
|
1802
|
+
setTimeout(poll, 50);
|
1803
|
+
return;
|
1804
|
+
}
|
1805
|
+
return init("poll");
|
1806
|
+
};
|
1807
|
+
if (doc.readyState !== "complete") {
|
1808
|
+
if (doc.createEventObject && root.doScroll) {
|
1809
|
+
try {
|
1810
|
+
top = !win.frameElement;
|
1811
|
+
} catch (_error) {}
|
1812
|
+
if (top) {
|
1813
|
+
poll();
|
1814
|
+
}
|
1815
|
+
}
|
1816
|
+
doc[add](pre + "DOMContentLoaded", init, false);
|
1817
|
+
doc[add](pre + "readystatechange", init, false);
|
1818
|
+
return win[add](pre + "load", init, false);
|
1819
|
+
}
|
1820
|
+
};
|
1821
|
+
|
1822
|
+
Dropzone._autoDiscoverFunction = function() {
|
1823
|
+
if (Dropzone.autoDiscover) {
|
1824
|
+
return Dropzone.discover();
|
1825
|
+
}
|
1826
|
+
};
|
1827
|
+
|
1828
|
+
contentLoaded(window, Dropzone._autoDiscoverFunction);
|
1829
|
+
|
1830
|
+
}).call(this);
|
1831
|
+
|
1832
|
+
});
|
1833
|
+
|
1834
|
+
if (typeof exports == "object") {
|
1835
|
+
module.exports = require("dropzone");
|
1836
|
+
} else if (typeof define == "function" && define.amd) {
|
1837
|
+
define([], function(){ return require("dropzone"); });
|
1838
|
+
} else {
|
1839
|
+
this["Dropzone"] = require("dropzone");
|
1840
|
+
}
|
1841
|
+
})()
|