ela 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/.gitlab-ci.yml +23 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +139 -0
- data/Guardfile +25 -0
- data/LICENSE.txt +205 -0
- data/README.de.md +195 -0
- data/README.md +66 -0
- data/Rakefile +96 -0
- data/app/css/screen.styl +425 -0
- data/app/css/vendor/stackedit.styl +140 -0
- data/app/fonts/Roboto-Italic-webfont.eot +0 -0
- data/app/fonts/Roboto-Italic-webfont.svg +642 -0
- data/app/fonts/Roboto-Italic-webfont.ttf +0 -0
- data/app/fonts/Roboto-Italic-webfont.woff +0 -0
- data/app/fonts/Roboto-Light-webfont.eot +0 -0
- data/app/fonts/Roboto-Light-webfont.svg +641 -0
- data/app/fonts/Roboto-Light-webfont.ttf +0 -0
- data/app/fonts/Roboto-Light-webfont.woff +0 -0
- data/app/fonts/Roboto-LightItalic-webfont.eot +0 -0
- data/app/fonts/Roboto-LightItalic-webfont.svg +641 -0
- data/app/fonts/Roboto-LightItalic-webfont.ttf +0 -0
- data/app/fonts/Roboto-LightItalic-webfont.woff +0 -0
- data/app/fonts/Roboto-Medium-webfont.eot +0 -0
- data/app/fonts/Roboto-Medium-webfont.svg +593 -0
- data/app/fonts/Roboto-Medium-webfont.ttf +0 -0
- data/app/fonts/Roboto-Medium-webfont.woff +0 -0
- data/app/fonts/Roboto-MediumItalic-webfont.eot +0 -0
- data/app/fonts/Roboto-MediumItalic-webfont.svg +642 -0
- data/app/fonts/Roboto-MediumItalic-webfont.ttf +0 -0
- data/app/fonts/Roboto-MediumItalic-webfont.woff +0 -0
- data/app/fonts/Roboto-Regular-webfont.eot +0 -0
- data/app/fonts/Roboto-Regular-webfont.svg +621 -0
- data/app/fonts/Roboto-Regular-webfont.ttf +0 -0
- data/app/fonts/Roboto-Regular-webfont.woff +0 -0
- data/app/fonts/Roboto-Thin-webfont.eot +0 -0
- data/app/fonts/Roboto-Thin-webfont.svg +631 -0
- data/app/fonts/Roboto-Thin-webfont.ttf +0 -0
- data/app/fonts/Roboto-Thin-webfont.woff +0 -0
- data/app/fonts/Roboto-ThinItalic-webfont.eot +0 -0
- data/app/fonts/Roboto-ThinItalic-webfont.svg +631 -0
- data/app/fonts/Roboto-ThinItalic-webfont.ttf +0 -0
- data/app/fonts/Roboto-ThinItalic-webfont.woff +0 -0
- data/app/fonts/droid_sans_regular.typeface.svg +1 -0
- data/app/fonts/fontawesome-webfont.eot +0 -0
- data/app/fonts/fontawesome-webfont.svg +2671 -0
- data/app/fonts/fontawesome-webfont.ttf +0 -0
- data/app/fonts/fontawesome-webfont.woff +0 -0
- data/app/fonts/fontawesome-webfont.woff2 +0 -0
- data/app/js/lib/application.coffee +83 -0
- data/app/js/lib/bootstrap_data.coffee +70 -0
- data/app/js/lib/collections/00_limited_collection.coffee +85 -0
- data/app/js/lib/collections/curves.coffee +3 -0
- data/app/js/lib/collections/named_object_collection.coffee +7 -0
- data/app/js/lib/mathjaxConfig.coffee +241 -0
- data/app/js/lib/models/app.coffee +58 -0
- data/app/js/lib/models/base_app.coffee +62 -0
- data/app/js/lib/models/base_app_model.coffee +61 -0
- data/app/js/lib/models/base_calculator.coffee +212 -0
- data/app/js/lib/models/base_subapp_container.coffee +35 -0
- data/app/js/lib/models/curve.coffee +179 -0
- data/app/js/lib/router.coffee +26 -0
- data/app/js/lib/views/app.coffee +56 -0
- data/app/js/lib/views/base_app.coffee +274 -0
- data/app/js/lib/views/base_aside.coffee +9 -0
- data/app/js/lib/views/base_graph.coffee +477 -0
- data/app/js/lib/views/base_subapp_container.coffee +44 -0
- data/app/js/lib/views/canvas.coffee +73 -0
- data/app/js/lib/views/curve_graph.coffee +163 -0
- data/app/js/lib/views/curves_aside.coffee +21 -0
- data/app/js/lib/views/curves_list_item.coffee +8 -0
- data/app/js/lib/views/grouped_parameters_aside.coffee +14 -0
- data/app/js/lib/views/headup.coffee +15 -0
- data/app/js/lib/views/help.coffee +86 -0
- data/app/js/lib/views/interpolated_graph.coffee +281 -0
- data/app/js/lib/views/legend.coffee +138 -0
- data/app/js/lib/views/legend_handler.coffee +51 -0
- data/app/js/lib/views/overview.coffee +85 -0
- data/app/js/lib/views/overview_tile.coffee +18 -0
- data/app/js/lib/views/parameters_aside.coffee +12 -0
- data/app/js/lib/views/three_graph.coffee +92 -0
- data/app/js/vendor/Markdown.Converter.js +1519 -0
- data/app/js/vendor/Markdown.Extra.js +874 -0
- data/app/js/vendor/Markdown.Toc.coffee +79 -0
- data/app/js/vendor/backbone-1.3.3.min.js +2 -0
- data/app/js/vendor/backbone-validation-0.11.5.js +8 -0
- data/app/js/vendor/backbone.poised/form.coffee +156 -0
- data/app/js/vendor/backbone.poised/form/anchor.coffee +26 -0
- data/app/js/vendor/backbone.poised/form/base_control.coffee +42 -0
- data/app/js/vendor/backbone.poised/form/linked_control.coffee +79 -0
- data/app/js/vendor/backbone.poised/form/linked_number_control.coffee +27 -0
- data/app/js/vendor/backbone.poised/form/linked_range_control.coffee +53 -0
- data/app/js/vendor/backbone.poised/form/linked_select_control.coffee +18 -0
- data/app/js/vendor/backbone.poised/form/linked_string_control.coffee +27 -0
- data/app/js/vendor/backbone.poised/form/number_control.coffee +25 -0
- data/app/js/vendor/backbone.poised/form/range_control.coffee +48 -0
- data/app/js/vendor/backbone.poised/form/select_control.coffee +16 -0
- data/app/js/vendor/backbone.poised/form/selectbox.coffee +78 -0
- data/app/js/vendor/backbone.poised/form/slider.coffee +109 -0
- data/app/js/vendor/backbone.poised/form/string_control.coffee +23 -0
- data/app/js/vendor/backbone.poised/form/submit_control.coffee +39 -0
- data/app/js/vendor/backbone.poised/form/textarea.coffee +36 -0
- data/app/js/vendor/backbone.poised/form/textfield.coffee +86 -0
- data/app/js/vendor/backbone.poised/form/value.coffee +33 -0
- data/app/js/vendor/backbone.poised/form/value_control.coffee +15 -0
- data/app/js/vendor/backbone.poised/linked_form.coffee +43 -0
- data/app/js/vendor/backbone.poised/list.coffee +97 -0
- data/app/js/vendor/backbone.poised/list/add_button.coffee +16 -0
- data/app/js/vendor/backbone.poised/list/anchor.coffee +32 -0
- data/app/js/vendor/backbone.poised/list/item.coffee +68 -0
- data/app/js/vendor/backbone.poised/list/searchfield.coffee +26 -0
- data/app/js/vendor/backbone.poised/list/selectable_item.coffee +65 -0
- data/app/js/vendor/backbone.poised/patches.coffee +6 -0
- data/app/js/vendor/backbone.poised/string_mixin.coffee +23 -0
- data/app/js/vendor/backbone.poised/underscore_ext.coffee +2 -0
- data/app/js/vendor/backbone.poised/view.coffee +59 -0
- data/app/js/vendor/gaussianElimination.coffee +40 -0
- data/app/js/vendor/hammer-2.0.8.min.js +7 -0
- data/app/js/vendor/jquery-3.1.1.min.js +4 -0
- data/app/js/vendor/jquery.after-transition.coffee +20 -0
- data/app/js/vendor/jquery.backbone-hammer.coffee +28 -0
- data/app/js/vendor/jquery.keyboard-modifiers.coffee +22 -0
- data/app/js/vendor/jquery.mark-5.2.3.min.js +7 -0
- data/app/js/vendor/jquery.scrollTo-2.1.2.min.js +7 -0
- data/app/js/vendor/js-yaml-3.4.3.min.js +3 -0
- data/app/js/vendor/markup_text.coffee +95 -0
- data/app/js/vendor/mathjax/MathJax.js +19 -0
- data/app/js/vendor/mathjax/extensions/MathEvents.js +19 -0
- data/app/js/vendor/mathjax/extensions/tex2jax.js +19 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_AMS-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Caligraphic-Bold.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Caligraphic-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Fraktur-Bold.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Fraktur-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Main-Bold.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Main-Italic.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Main-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Math-BoldItalic.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Math-Italic.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Math-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_SansSerif-Bold.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_SansSerif-Italic.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_SansSerif-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Script-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Size1-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Size2-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Size3-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Size4-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Typewriter-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_WinIE6-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_AMS-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Caligraphic-Bold.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Caligraphic-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Fraktur-Bold.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Fraktur-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Main-Bold.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Main-Italic.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Main-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Math-BoldItalic.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Math-Italic.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Math-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_SansSerif-Bold.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_SansSerif-Italic.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_SansSerif-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Script-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Size1-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Size2-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Size3-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Size4-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Typewriter-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_WinChrome-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_WinIE6-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_AMS-Regular.svg +765 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Caligraphic-Bold.svg +136 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Caligraphic-Regular.svg +134 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Fraktur-Bold.svg +319 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Fraktur-Regular.svg +309 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Main-Bold.svg +656 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Main-Italic.svg +374 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Main-Regular.svg +659 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Math-BoldItalic.svg +331 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Math-Italic.svg +331 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Math-Regular.svg +330 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_SansSerif-Bold.svg +280 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_SansSerif-Italic.svg +245 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_SansSerif-Regular.svg +211 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Script-Regular.svg +160 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Size1-Regular.svg +110 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Size2-Regular.svg +109 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Size3-Regular.svg +49 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Size4-Regular.svg +102 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Typewriter-Regular.svg +322 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_WinChrome-Regular.svg +39 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_AMS-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Bold.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Fraktur-Bold.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Fraktur-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Bold.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Italic.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Math-BoldItalic.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Math-Italic.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Math-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_SansSerif-Bold.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_SansSerif-Italic.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_SansSerif-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Script-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Size1-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Size2-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Size3-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Size4-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Typewriter-Regular.woff +0 -0
- data/app/js/vendor/mathjax/jax/element/mml/jax.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/Arrows.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/BasicLatin.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/CombDiacritMarks.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/CombDiactForSymbols.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/Dingbats.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/GeneralPunctuation.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/GeometricShapes.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/GreekAndCoptic.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/Latin1Supplement.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/LetterlikeSymbols.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/MathOperators.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/MiscMathSymbolsA.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/MiscMathSymbolsB.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/MiscSymbolsAndArrows.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/MiscTechnical.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/SpacingModLetters.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/SuppMathOperators.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/SupplementalArrowsA.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/SupplementalArrowsB.js +19 -0
- data/app/js/vendor/mathjax/jax/input/TeX/config.js +19 -0
- data/app/js/vendor/mathjax/jax/input/TeX/jax.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/annotation-xml.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/maction.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/menclose.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/mglyph.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/mmultiscripts.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/ms.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/mtable.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/multiline.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/config.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/AMS-Regular.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Caligraphic-Bold.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Fraktur-Bold.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Fraktur-Regular.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Main-Bold.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Math-BoldItalic.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/SansSerif-Bold.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/SansSerif-Italic.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/SansSerif-Regular.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Script-Regular.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Typewriter-Regular.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/fontdata-extra.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/fontdata.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/jax.js +19 -0
- data/app/js/vendor/modernizr-custom-3.3.1.min.js +3 -0
- data/app/js/vendor/persistjs-git.js +1136 -0
- data/app/js/vendor/poised/poised.general.coffee +21 -0
- data/app/js/vendor/poised/poised.tabs.coffee +31 -0
- data/app/js/vendor/poised/utils.coffee +11 -0
- data/app/js/vendor/request_animation_frame.coffee +19 -0
- data/app/js/vendor/three-82.min.js +15 -0
- data/app/js/vendor/three-CanvasRenderer-82.js +1118 -0
- data/app/js/vendor/three-Projector-82.js +929 -0
- data/app/js/vendor/underscore-1.8.3.min.js +6 -0
- data/app/js/vendor/webfontloader-1.6.26.min.js +33 -0
- data/app/views/aliasing/legend.jst.hamlc +6 -0
- data/app/views/composites/composites_list_item_label.jst.hamlc +3 -0
- data/app/views/composites/import_composites_aside.jst.hamlc +6 -0
- data/app/views/composites/mix_preset_list_item_label.jst.hamlc +8 -0
- data/app/views/composites/share_aside.jst.hamlc +7 -0
- data/app/views/doc/airplanes_list_item_label.jst.hamlc +3 -0
- data/app/views/doc/import_airplanes_aside.jst.hamlc +6 -0
- data/app/views/doc/share_aside.jst.hamlc +7 -0
- data/app/views/general/app.jst.hamlc +42 -0
- data/app/views/general/curves_list_item_label.jst.hamlc +5 -0
- data/app/views/general/help.jst.hamlc +7 -0
- data/app/views/general/tabs.jst.hamlc +6 -0
- data/app/views/index.haml +24 -0
- data/app/views/overview/app.jst.hamlc +7 -0
- data/app/views/overview/tile.jst.hamlc +4 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/ela.gemspec +50 -0
- data/exe/ela +59 -0
- data/lib/ela.rb +8 -0
- data/lib/ela/jasmine.rb +87 -0
- data/lib/ela/server.rb +136 -0
- data/lib/ela/utils.rb +131 -0
- data/lib/ela/version.rb +3 -0
- data/package-lock.json +899 -0
- data/package.json +11 -0
- data/support/project/Guardfile +64 -0
- data/support/project/jasmine.yml +3 -0
- data/support/server.ru +5 -0
- metadata +4365 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
class Backbone.Poised.LinkedSelectControl extends Backbone.Poised.LinkedControl
|
2
|
+
initialize: (options = {}) =>
|
3
|
+
super
|
4
|
+
|
5
|
+
@options = _.chain(options)
|
6
|
+
.pick('attribute', 'placeholder', 'options', 'multiselect', 'locale', 'localePrefix')
|
7
|
+
.defaults(parentView: this)
|
8
|
+
.value()
|
9
|
+
|
10
|
+
render: =>
|
11
|
+
super
|
12
|
+
|
13
|
+
@subviews.spinner1 = new Backbone.Poised.Selectbox(_.defaults(model: @model1, @options))
|
14
|
+
@$control1.append(@subviews.spinner1.render().el)
|
15
|
+
@subviews.spinner2 = new Backbone.Poised.Selectbox(_.defaults(model: @model2, @options))
|
16
|
+
@$control2.append(@subviews.spinner2.render().el)
|
17
|
+
|
18
|
+
this
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class Backbone.Poised.LinkedStringControl extends Backbone.Poised.LinkedControl
|
2
|
+
initialize: (options = {}) =>
|
3
|
+
super
|
4
|
+
|
5
|
+
@options = _.chain(options)
|
6
|
+
.pick('attribute', 'rows', 'placeholder')
|
7
|
+
.defaults
|
8
|
+
type: 'text'
|
9
|
+
placeholder: null
|
10
|
+
rows: 1
|
11
|
+
.value()
|
12
|
+
|
13
|
+
render: =>
|
14
|
+
super
|
15
|
+
|
16
|
+
if @options.rows > 1
|
17
|
+
@subviews.textarea1 = new Backbone.Poised.Textarea(_.defaults(model: @model1, @options))
|
18
|
+
@$control1.append(@subviews.textarea1.render().el)
|
19
|
+
@subviews.textarea2 = new Backbone.Poised.Textarea(_.defaults(model: @model2, @options))
|
20
|
+
@$control2.append(@subviews.textarea2.render().el)
|
21
|
+
else
|
22
|
+
@subviews.textfield1 = new Backbone.Poised.Textfield(_.defaults(model: @model1, @options))
|
23
|
+
@$control1.append(@subviews.textfield1.render().el)
|
24
|
+
@subviews.textfield2 = new Backbone.Poised.Textfield(_.defaults(model: @model2, @options))
|
25
|
+
@$control2.append(@subviews.textfield2.render().el)
|
26
|
+
|
27
|
+
this
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class Backbone.Poised.NumberControl extends Backbone.Poised.BaseControl
|
2
|
+
initialize: (options = {}) ->
|
3
|
+
super
|
4
|
+
|
5
|
+
@options = _.chain(options)
|
6
|
+
.pick('model', 'clearOnFocus', 'stepSize', 'precision', 'range', 'attribute', 'unit', 'minValue', 'maxValue')
|
7
|
+
.defaults
|
8
|
+
clearOnFocus: true
|
9
|
+
type: 'number'
|
10
|
+
minValue: _.firstDefined(options.minValue, options.range?[0])
|
11
|
+
maxValue: _.firstDefined(options.maxValue, options.range?[1])
|
12
|
+
parentView: this
|
13
|
+
.value()
|
14
|
+
|
15
|
+
if @options.stepSize? and not @options.precision?
|
16
|
+
@options.precision = _.find([0..3], (i) =>
|
17
|
+
@options.stepSize * Math.pow(10, i) >= 1)
|
18
|
+
|
19
|
+
render: =>
|
20
|
+
super
|
21
|
+
|
22
|
+
@subviews.spinner = new Backbone.Poised.Textfield(@options)
|
23
|
+
@$info.append(@subviews.spinner.render().el)
|
24
|
+
|
25
|
+
this
|
@@ -0,0 +1,48 @@
|
|
1
|
+
class Backbone.Poised.RangeControl extends Backbone.Poised.BaseControl
|
2
|
+
initialize: (options) =>
|
3
|
+
super
|
4
|
+
|
5
|
+
@options = _.chain(@options)
|
6
|
+
.pick('model', 'renderSpinner', 'clearOnFocus', 'stepSize', 'precision', 'range', 'attribute', 'unit', 'sliderMinValue', 'sliderMaxValue', 'spinnerMinValue', 'spinnerMaxValue')
|
7
|
+
.defaults
|
8
|
+
renderSpinner: true
|
9
|
+
clearOnFocus: true
|
10
|
+
type: 'number'
|
11
|
+
.value()
|
12
|
+
|
13
|
+
if @options.stepSize? and not @options.precision?
|
14
|
+
@options.precision = _.find([0..3], (i) =>
|
15
|
+
@options.stepSize * Math.pow(10, i) >= 1)
|
16
|
+
|
17
|
+
# A spinner field is a textfield of type number.
|
18
|
+
if @options.renderSpinner
|
19
|
+
@spinnerOptions = _.chain(@options)
|
20
|
+
.pick('model', 'attribute', 'type', 'clearOnFocus', 'unit', 'precision', 'stepSize')
|
21
|
+
.defaults
|
22
|
+
minValue: _.firstDefined(@options.spinnerMinValue, @options.range?[0], @options.range?.spinner?[0])
|
23
|
+
maxValue: _.firstDefined(@options.spinnerMaxValue, @options.range?[1], @options.range?.spinner?[1])
|
24
|
+
parentView: this
|
25
|
+
.value()
|
26
|
+
|
27
|
+
@sliderOptions = _.chain(@options)
|
28
|
+
.pick('model', 'attribute', 'stepSize')
|
29
|
+
.defaults
|
30
|
+
minValue: _.firstDefined(@options.sliderMinValue, @options.range?[0], @options.range?.slider?[0])
|
31
|
+
maxValue: _.firstDefined(@options.sliderMaxValue, @options.range?[1], @options.range?.slider?[1])
|
32
|
+
parentView: this
|
33
|
+
.value()
|
34
|
+
|
35
|
+
render: =>
|
36
|
+
super
|
37
|
+
|
38
|
+
if @options.renderSpinner
|
39
|
+
@subviews.spinner = new Backbone.Poised.Textfield(@spinnerOptions)
|
40
|
+
@$info.append(@subviews.spinner.render().el)
|
41
|
+
else
|
42
|
+
@subviews.value = new Backbone.Poised.Value(@options)
|
43
|
+
@$info.append(@subviews.value.render().el)
|
44
|
+
|
45
|
+
@subviews.slider = new Backbone.Poised.Slider(@sliderOptions)
|
46
|
+
@$el.append(@subviews.slider.render().el)
|
47
|
+
|
48
|
+
this
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class Backbone.Poised.SelectControl extends Backbone.Poised.BaseControl
|
2
|
+
initialize: (options = {}) ->
|
3
|
+
super
|
4
|
+
|
5
|
+
@options = _.chain(options)
|
6
|
+
.pick('model', 'attribute', 'placeholder', 'options', 'multiselect', 'locale', 'localePrefix')
|
7
|
+
.defaults(parentView: this)
|
8
|
+
.value()
|
9
|
+
|
10
|
+
render: =>
|
11
|
+
super
|
12
|
+
|
13
|
+
@subviews.selectbox = new Backbone.Poised.Selectbox(@options)
|
14
|
+
@$info.append(@subviews.selectbox.render().el)
|
15
|
+
|
16
|
+
this
|
@@ -0,0 +1,78 @@
|
|
1
|
+
class Backbone.Poised.Selectbox extends Backbone.Poised.View
|
2
|
+
className: 'poised selectbox'
|
3
|
+
|
4
|
+
events:
|
5
|
+
'change select': 'changeAttributeValue'
|
6
|
+
|
7
|
+
initialize: (options = {}) =>
|
8
|
+
throw new Error('Missing `model` option') unless options.model?
|
9
|
+
throw new Error('Missing `attribute` option') unless options.attribute?
|
10
|
+
|
11
|
+
@attribute = options.attribute
|
12
|
+
|
13
|
+
@options = _.chain(options)
|
14
|
+
.pick('placeholder', 'options', 'multiselect', 'validate')
|
15
|
+
.defaults
|
16
|
+
options: []
|
17
|
+
multiselect: false
|
18
|
+
validate: true
|
19
|
+
.value()
|
20
|
+
unless @options.placeholder?
|
21
|
+
@options.placeholder = not @options.multiselect and not @model.get(@attribute)?
|
22
|
+
@options.placeholder = 'Please select ...' if @options.placeholder is true
|
23
|
+
|
24
|
+
@model.on("change:#{@attribute}", @updateSelectedOption)
|
25
|
+
|
26
|
+
changeAttributeValue: =>
|
27
|
+
if @options.multiselect
|
28
|
+
options = for option in @$select.find('option:selected')
|
29
|
+
$(option).data('value')
|
30
|
+
else
|
31
|
+
options = @$select.find('option:selected').data('value')
|
32
|
+
@model.set(@attribute, options)
|
33
|
+
|
34
|
+
updateSelectedOption: (model, value) =>
|
35
|
+
selectedValues = _.compact(_.flatten(
|
36
|
+
[value or @model.get(@attribute)]
|
37
|
+
))
|
38
|
+
for option, idx in @$select.find('option')
|
39
|
+
$option = $(option)
|
40
|
+
if @options.placeholder and _.isEmpty(selectedValues)
|
41
|
+
isSelected = idx is 0
|
42
|
+
else
|
43
|
+
isSelected = _.contains(selectedValues, $option.data('value'))
|
44
|
+
$option.attr(selected: isSelected)
|
45
|
+
|
46
|
+
render: =>
|
47
|
+
@$select = $ '<select />',
|
48
|
+
class: 'poised'
|
49
|
+
name: @attribute
|
50
|
+
multiple: @options.multiselect
|
51
|
+
|
52
|
+
if @options.placeholder
|
53
|
+
@$select.append $ '<option>',
|
54
|
+
text: @loadLocale(
|
55
|
+
"formFields.#{@attribute}.options.placeholder"
|
56
|
+
"formFields.selectPlaceholder"
|
57
|
+
"generic.selectPlaceholder"
|
58
|
+
defaultValue: @options.placeholder
|
59
|
+
)
|
60
|
+
disabled: true
|
61
|
+
|
62
|
+
if _.isFunction(@options.options)
|
63
|
+
options = @options.options.apply(@model)
|
64
|
+
else
|
65
|
+
options = @options.options
|
66
|
+
if _.isArray(options)
|
67
|
+
options = _.object(options, options)
|
68
|
+
for label, option of options
|
69
|
+
@$select.append $ '<option>',
|
70
|
+
data:
|
71
|
+
value: option
|
72
|
+
text: @loadLocale "formFields.#{@attribute}.options.#{label}",
|
73
|
+
defaultValue: label
|
74
|
+
|
75
|
+
@$el.html(@$select)
|
76
|
+
|
77
|
+
@updateSelectedOption()
|
78
|
+
this
|
@@ -0,0 +1,109 @@
|
|
1
|
+
window.poisedCurrentSlider = null
|
2
|
+
|
3
|
+
class Backbone.Poised.Slider extends Backbone.Poised.View
|
4
|
+
template: _.template('<div class="bar"></div><div class="handle"></div>')
|
5
|
+
|
6
|
+
className: 'poised slider'
|
7
|
+
|
8
|
+
startValue: 0
|
9
|
+
range: 100
|
10
|
+
|
11
|
+
events:
|
12
|
+
'tap': 'handleTap'
|
13
|
+
'panstart': 'handlePanStart'
|
14
|
+
'press': 'handlePress'
|
15
|
+
'pan': 'handlePan'
|
16
|
+
'panend': 'handlePanEnd'
|
17
|
+
'pressup': 'handlePanEnd'
|
18
|
+
|
19
|
+
hammerjs:
|
20
|
+
recognizers: [
|
21
|
+
[Hammer.Rotate, { enable: false }],
|
22
|
+
[Hammer.Pinch, { enable: false }, ['rotate']],
|
23
|
+
[Hammer.Swipe, { enable: false }],
|
24
|
+
[Hammer.Pan, { direction: Hammer.DIRECTION_HORIZONTAL, threshold: 1 }, ['swipe']],
|
25
|
+
[Hammer.Tap, { threshold: 5 }],
|
26
|
+
[Hammer.Press]
|
27
|
+
]
|
28
|
+
|
29
|
+
initialize: (options = {}) =>
|
30
|
+
throw new Error('Missing `model` option') unless options.model?
|
31
|
+
throw new Error('Missing `attribute` option') unless options.attribute?
|
32
|
+
|
33
|
+
@attribute = options.attribute
|
34
|
+
|
35
|
+
options = _.chain(options)
|
36
|
+
.pick('maxValue', 'minValue', 'stepSize')
|
37
|
+
.defaults
|
38
|
+
minValue: 0
|
39
|
+
maxValue: 100
|
40
|
+
stepSize: 1
|
41
|
+
.value()
|
42
|
+
|
43
|
+
@range = options.maxValue if options.maxValue?
|
44
|
+
|
45
|
+
if options.minValue?
|
46
|
+
@startValue = options.minValue
|
47
|
+
@range -= options.minValue
|
48
|
+
|
49
|
+
@stepSize = options.stepSize
|
50
|
+
|
51
|
+
@model.on "change:#{@attribute}", @updateHandlePosition
|
52
|
+
|
53
|
+
# TODO: Save previously focused element and resore focus after
|
54
|
+
# slider action finished.
|
55
|
+
clearFocus: ->
|
56
|
+
$('input').blur()
|
57
|
+
|
58
|
+
handleTap: (e) ->
|
59
|
+
touchPosition = e.gesture.center.x - @$bar.offset().left
|
60
|
+
@model.set @attribute, @calculateAttributeValue(touchPosition)
|
61
|
+
@trigger('tapChange', this)
|
62
|
+
|
63
|
+
isPanning: false
|
64
|
+
|
65
|
+
startLiveChange: =>
|
66
|
+
@isPanning = true
|
67
|
+
@clearFocus()
|
68
|
+
@trigger('liveChangeStart', this)
|
69
|
+
|
70
|
+
handlePanStart: (e) =>
|
71
|
+
if Math.abs(e.gesture.deltaX) > Math.abs(e.gesture.deltaY) and not @isPanning
|
72
|
+
@startLiveChange()
|
73
|
+
|
74
|
+
handlePress: (e) =>
|
75
|
+
@startLiveChange()
|
76
|
+
@handlePan(e)
|
77
|
+
|
78
|
+
handlePan: (e) =>
|
79
|
+
if @isPanning
|
80
|
+
touchPosition = e.gesture.center.x - @$el.offset().left
|
81
|
+
@model.set @attribute, @calculateAttributeValue(touchPosition)
|
82
|
+
@trigger('liveChange', this)
|
83
|
+
|
84
|
+
handlePanEnd: (e) =>
|
85
|
+
if @isPanning
|
86
|
+
@trigger('liveChangeEnd', this)
|
87
|
+
@isPanning = false
|
88
|
+
|
89
|
+
calculateAttributeValue: (position) ->
|
90
|
+
barWidth = @$bar.width()
|
91
|
+
position = Math.max(position, 0)
|
92
|
+
position = Math.min(position, barWidth)
|
93
|
+
@startValue + Math.round((@range * position / barWidth) / @stepSize) * @stepSize
|
94
|
+
|
95
|
+
calculateHandlePosition: (val) ->
|
96
|
+
val = Math.max(val, @startValue)
|
97
|
+
val = Math.min(val, @startValue+@range)
|
98
|
+
(val - @startValue)/ @range * 100
|
99
|
+
|
100
|
+
updateHandlePosition: (model, value) =>
|
101
|
+
position = @calculateHandlePosition(value)
|
102
|
+
@$handle.css 'left', "#{position.toFixed(2)}%"
|
103
|
+
|
104
|
+
render: =>
|
105
|
+
@$el.html @template()
|
106
|
+
@$handle = @$el.find('.handle')
|
107
|
+
@$bar = @$el.find('.bar')
|
108
|
+
@updateHandlePosition(@model, @model.get(@attribute))
|
109
|
+
this
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class Backbone.Poised.StringControl extends Backbone.Poised.BaseControl
|
2
|
+
initialize: (options = {}) ->
|
3
|
+
super
|
4
|
+
|
5
|
+
@options = _.chain(options)
|
6
|
+
.pick('model', 'attribute', 'rows', 'placeholder')
|
7
|
+
.defaults
|
8
|
+
type: 'text'
|
9
|
+
placeholder: null
|
10
|
+
rows: 1
|
11
|
+
.value()
|
12
|
+
|
13
|
+
render: =>
|
14
|
+
super
|
15
|
+
|
16
|
+
if @options.rows > 1
|
17
|
+
@subviews.textarea = new Backbone.Poised.Textarea(@options)
|
18
|
+
@$el.append(@subviews.textarea.render().el)
|
19
|
+
else
|
20
|
+
@subviews.textfield = new Backbone.Poised.Textfield(@options)
|
21
|
+
@$info.append(@subviews.textfield.render().el)
|
22
|
+
|
23
|
+
this
|
@@ -0,0 +1,39 @@
|
|
1
|
+
class Backbone.Poised.SubmitControl extends Backbone.Poised.View
|
2
|
+
tagName: 'ul'
|
3
|
+
className: 'poised button-group'
|
4
|
+
|
5
|
+
events:
|
6
|
+
'tap input.submit': 'submitTapped'
|
7
|
+
'tap input.cancel': 'cancelTapped'
|
8
|
+
'tap input.reset': 'resetTapped'
|
9
|
+
|
10
|
+
initialize: (options = {}) ->
|
11
|
+
super
|
12
|
+
|
13
|
+
@options = _.chain(options)
|
14
|
+
.pick('cancelable', 'resetable')
|
15
|
+
.defaults
|
16
|
+
cancelable: false
|
17
|
+
resetable: false
|
18
|
+
.value()
|
19
|
+
|
20
|
+
submitTapped: (e) =>
|
21
|
+
@trigger('submit')
|
22
|
+
e.preventDefault()
|
23
|
+
|
24
|
+
cancelTapped: (e) =>
|
25
|
+
@trigger('cancel')
|
26
|
+
e.preventDefault()
|
27
|
+
|
28
|
+
resetTapped: (e) =>
|
29
|
+
@trigger('reset')
|
30
|
+
e.preventDefault()
|
31
|
+
|
32
|
+
render: =>
|
33
|
+
@$el.html()
|
34
|
+
@$el.append('<li><input class="poised button primary submit" type="submit" value="Save"></li>')
|
35
|
+
if @options.cancelable
|
36
|
+
@$el.append('<li><input class="poised button secondary cancel" type="submit" value="Cancel"></li>')
|
37
|
+
if @options.resetable
|
38
|
+
@$el.append('<li><input class="poised button secondary reset" type="submit" value="Reset"></li>')
|
39
|
+
this
|
@@ -0,0 +1,36 @@
|
|
1
|
+
class Backbone.Poised.Textarea extends Backbone.Poised.View
|
2
|
+
tagName: 'span'
|
3
|
+
className: 'poised textarea'
|
4
|
+
|
5
|
+
events:
|
6
|
+
'input textarea': 'updateAttributeValue'
|
7
|
+
|
8
|
+
initialize: (options = {}) =>
|
9
|
+
throw new Error('Missing `model` option') unless options.model?
|
10
|
+
throw new Error('Missing `attribute` option') unless options.attribute?
|
11
|
+
|
12
|
+
@options = _.chain(options)
|
13
|
+
.pick('rows', 'placeholder')
|
14
|
+
.defaults
|
15
|
+
rows: 3
|
16
|
+
placeholder: null
|
17
|
+
.value()
|
18
|
+
|
19
|
+
@attribute = options.attribute
|
20
|
+
|
21
|
+
@model.on "change:#{@attribute}", @render
|
22
|
+
|
23
|
+
updateAttributeValue: =>
|
24
|
+
@model.set(@attribute, @$textarea.val())
|
25
|
+
|
26
|
+
updateTextareaValue: (model, value) =>
|
27
|
+
val = value or @model.get(@attribute)
|
28
|
+
@$textarea.val(val)
|
29
|
+
|
30
|
+
render: =>
|
31
|
+
@$textarea = $ '<textarea>', @options
|
32
|
+
@$el.html(@$textarea)
|
33
|
+
|
34
|
+
@updateTextareaValue()
|
35
|
+
|
36
|
+
this
|
@@ -0,0 +1,86 @@
|
|
1
|
+
class Backbone.Poised.Textfield extends Backbone.View
|
2
|
+
className: 'poised textfield'
|
3
|
+
|
4
|
+
events:
|
5
|
+
'focusin input': 'clearInputValue'
|
6
|
+
'focusout input': 'readInput'
|
7
|
+
|
8
|
+
initialize: (options = {}) =>
|
9
|
+
throw new Error('Missing `model` option') unless options.model?
|
10
|
+
throw new Error('Missing `attribute` option') unless options.attribute?
|
11
|
+
|
12
|
+
@attribute = options.attribute
|
13
|
+
|
14
|
+
@options = _.chain(options)
|
15
|
+
.pick('type', 'placeholder', 'autofocus', 'clearOnFocus', 'stepSize', 'precision', 'minValue', 'maxValue', 'unit', 'validate')
|
16
|
+
.defaults
|
17
|
+
type: 'text'
|
18
|
+
autofocus: false
|
19
|
+
clearOnFocus: false
|
20
|
+
minValue: null
|
21
|
+
maxValue: null
|
22
|
+
validate: true
|
23
|
+
.value()
|
24
|
+
|
25
|
+
if @options.stepSize? and not @options.precision?
|
26
|
+
@options.precision = _.find([0..3], (i) =>
|
27
|
+
@options.stepSize * Math.pow(10, i) >= 1)
|
28
|
+
|
29
|
+
if _.isArray(options.range)
|
30
|
+
[@options.minValue, @options.maxValue] = options.range
|
31
|
+
|
32
|
+
@model.on "change:#{@attribute}", @setValue
|
33
|
+
|
34
|
+
limit: (val) ->
|
35
|
+
val = Math.max(val, @options.minValue) if @options.minValue?
|
36
|
+
val = Math.min(val, @options.maxValue) if @options.maxValue?
|
37
|
+
val
|
38
|
+
|
39
|
+
_updateValue: (value = @model.get(@attribute)) =>
|
40
|
+
if @options.type is 'number'
|
41
|
+
if typeof value is 'string'
|
42
|
+
if value.match(/^[+\-]?\d+(\.\d+)?$/i)?
|
43
|
+
value = @limit(parseFloat(value))
|
44
|
+
else
|
45
|
+
value = @model.get(@attribute)
|
46
|
+
|
47
|
+
if @options.precision
|
48
|
+
valueString = value.toFixed(@options.precision)
|
49
|
+
|
50
|
+
@model.set(@attribute, value)
|
51
|
+
@$input.val(valueString or value)
|
52
|
+
|
53
|
+
if @model.validate? and @options.validate
|
54
|
+
@model.validate(@attribute)
|
55
|
+
|
56
|
+
setValue: (_, value) =>
|
57
|
+
return if @$input.is(':focus')
|
58
|
+
@_updateValue(value)
|
59
|
+
|
60
|
+
readInput: =>
|
61
|
+
@_updateValue(@$input.val())
|
62
|
+
|
63
|
+
clearInputValue: =>
|
64
|
+
@$input.val('') if @options.clearOnFocus
|
65
|
+
|
66
|
+
render: =>
|
67
|
+
@$el.empty()
|
68
|
+
|
69
|
+
inputAttributes =
|
70
|
+
class: 'poised'
|
71
|
+
name: @attribute
|
72
|
+
type: @options.type
|
73
|
+
placeholder: @options.placeholder
|
74
|
+
autofocus: @options.autofocus
|
75
|
+
|
76
|
+
if @options.type is 'number'
|
77
|
+
inputAttributes.min = @options.minValue
|
78
|
+
inputAttributes.max = @options.maxValue
|
79
|
+
inputAttributes.step = @options.stepSize or 'any'
|
80
|
+
|
81
|
+
@$input = $('<input />', inputAttributes).appendTo(@$el)
|
82
|
+
|
83
|
+
@$el.append($('<abbr/>', text: @options.unit)) if @options.unit
|
84
|
+
|
85
|
+
@_updateValue()
|
86
|
+
this
|