keppler 2.1.17 → 2.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/installer/core/.gitignore +88 -0
- data/installer/core/app/views/admin/layouts/_sidebar.html.haml +2 -2
- data/installer/core/rockets/keppler_frontend/app/controllers/keppler_frontend/app/frontend_controller.rb +0 -1
- data/installer/core/rockets/keppler_frontend/app/models/keppler_frontend/view.rb +1 -1
- data/installer/core/rockets/keppler_frontend/config/data/views.yml +1 -1
- data/lib/keppler/version.rb +1 -1
- data/testing-with-2.1.18/.gitignore +88 -0
- data/testing-with-2.1.18/.ruby-version +1 -0
- data/testing-with-2.1.18/Gemfile +149 -0
- data/testing-with-2.1.18/Gemfile.lock +645 -0
- data/testing-with-2.1.18/Guardfile +18 -0
- data/testing-with-2.1.18/LICENSE +674 -0
- data/testing-with-2.1.18/README.md +134 -0
- data/testing-with-2.1.18/Rakefile +6 -0
- data/testing-with-2.1.18/_config.yml +1 -0
- data/testing-with-2.1.18/app/assets/images/.keep +0 -0
- data/testing-with-2.1.18/app/assets/images/admin/astronauta_keppler.svg +123 -0
- data/testing-with-2.1.18/app/assets/images/admin/avatar_keppler.svg +100 -0
- data/testing-with-2.1.18/app/assets/images/admin/en.png +0 -0
- data/testing-with-2.1.18/app/assets/images/admin/es.png +0 -0
- data/testing-with-2.1.18/app/assets/images/admin/favicon.png +0 -0
- data/testing-with-2.1.18/app/assets/images/admin/image_default.png +0 -0
- data/testing-with-2.1.18/app/assets/images/admin/logo.png +0 -0
- data/testing-with-2.1.18/app/assets/images/admin/logo2.png +0 -0
- data/testing-with-2.1.18/app/assets/images/admin/profile-menu.jpg +0 -0
- data/testing-with-2.1.18/app/assets/images/admin/search.png +0 -0
- data/testing-with-2.1.18/app/assets/images/admin/slice-icon-orange.png +0 -0
- data/testing-with-2.1.18/app/assets/images/admin/slice-icon.png +0 -0
- data/testing-with-2.1.18/app/assets/images/admin/slice.png +0 -0
- data/testing-with-2.1.18/app/assets/images/admin/slice_white.png +0 -0
- data/testing-with-2.1.18/app/assets/images/app/Cohete_nubes_new.png +0 -0
- data/testing-with-2.1.18/app/assets/images/app/Home_Keppler.png +0 -0
- data/testing-with-2.1.18/app/assets/images/app/Home_Keppler2.png +0 -0
- data/testing-with-2.1.18/app/assets/images/app/fondo.svg +19 -0
- data/testing-with-2.1.18/app/assets/images/app/keppler-front.png +0 -0
- data/testing-with-2.1.18/app/assets/images/app/slice-front.png +0 -0
- data/testing-with-2.1.18/app/assets/images/app/slice.png +0 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/application.coffee +25 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/bootstrap-colorpicker.js +1322 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/bootstrap-file-input/fileinput.js +4463 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/bootstrap-file-input/locales/LANG.js +100 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/bootstrap-file-input/locales/es.js +100 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/bootstrap-file-input/plugins/piexif.js +2471 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/bootstrap-file-input/plugins/piexif.min.js +1 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/bootstrap-file-input/plugins/purify.js +812 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/bootstrap-file-input/plugins/purify.min.js +1 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/bootstrap-file-input/plugins/sortable.js +1590 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/bootstrap-file-input/plugins/sortable.min.js +1 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/code_editor.js +94 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/comment/comment.js +209 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/comment/continuecomment.js +78 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/dialog/dialog.css +32 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/dialog/dialog.js +161 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/display/autorefresh.js +47 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/display/fullscreen.css +6 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/display/fullscreen.js +41 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/display/panel.js +123 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/display/placeholder.js +63 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/display/rulers.js +51 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/edit/closebrackets.js +194 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/edit/closetag.js +175 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/edit/continuelist.js +89 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/edit/matchbrackets.js +145 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/edit/matchtags.js +66 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/edit/trailingspace.js +27 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/fold/brace-fold.js +105 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/fold/comment-fold.js +59 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/fold/foldcode.js +152 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/fold/foldgutter.css +20 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/fold/foldgutter.js +146 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/fold/indent-fold.js +48 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/fold/markdown-fold.js +49 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/fold/xml-fold.js +184 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/hint/anyword-hint.js +41 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/hint/css-hint.js +60 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/hint/html-hint.js +348 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/hint/javascript-hint.js +157 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/hint/show-hint.css +36 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/hint/show-hint.js +433 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/hint/sql-hint.js +299 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/hint/xml-hint.js +110 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/mode/loadmode.js +64 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/mode/multiplex.js +131 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/mode/overlay.js +90 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/mode/simple.js +216 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/scroll/annotatescrollbar.js +122 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/scroll/scrollpastend.js +48 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/scroll/simplescrollbars.css +66 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/scroll/simplescrollbars.js +152 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/search/jump-to-line.js +49 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/search/match-highlighter.js +165 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/search/matchesonscrollbar.css +8 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/search/matchesonscrollbar.js +97 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/search/search.js +252 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/addon/search/searchcursor.js +293 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/codemirror.js +9683 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/keymap/sublime.js +691 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/css/css.js +832 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/css/gss.html +103 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/css/index.html +75 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/css/less.html +152 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/css/scss.html +157 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/haml/haml.js +161 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/haml/index.html +79 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/htmlembedded/htmlembedded.js +37 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/htmlembedded/index.html +60 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/htmlmixed/htmlmixed.js +152 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/htmlmixed/index.html +100 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/javascript/index.html +114 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/javascript/javascript.js +896 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/javascript/json-ld.html +72 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/javascript/typescript.html +61 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/ruby/index.html +183 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/ruby/ruby.js +296 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/vue/index.html +69 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/vue/vue.js +77 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/xml/index.html +61 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/xml/xml.js +402 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/yaml-frontmatter/index.html +121 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js +68 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/yaml/index.html +80 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/codemirror/mode/yaml/yaml.js +119 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/file_uploader.coffee +152 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/img_preview.js +32 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/jscolor.js +1855 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/main.coffee +58 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/notification.js +14 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/ruby_console.js +14 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/sidebar.js +24 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/sort.coffee +8 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/swal.js +39 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/sweetalert2/delete-confirm.js +118 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/sweetalert2/sweetalert2.all.min.js +2 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/switch.js +6 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/tooltips.coffee +4 -0
- data/testing-with-2.1.18/app/assets/javascripts/admin/upload_records.coffee +8 -0
- data/testing-with-2.1.18/app/assets/javascripts/app/application.js.coffee +9 -0
- data/testing-with-2.1.18/app/assets/javascripts/app/google_analytics.js.coffee +5 -0
- data/testing-with-2.1.18/app/assets/javascripts/ckeditor/config.js +130 -0
- data/testing-with-2.1.18/app/assets/javascripts/errors/application.js.coffee +1 -0
- data/testing-with-2.1.18/app/assets/javascripts/errors/errors.js +113 -0
- data/testing-with-2.1.18/app/assets/javascripts/vue_admin/index.js +111 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/application.scss +48 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/bootstrap-file-input/fileinput-rtl.scss +133 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/bootstrap-file-input/fileinput.scss +760 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/bootstrap-file-input/themes/explorer-fa/theme.scss +213 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/bootstrap-file-input/themes/explorer-fas/theme.scss +213 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/bootstrap-file-input/themes/explorer/theme.scss +213 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/comment/comment.js +209 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/comment/continuecomment.js +78 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/dialog/dialog.css +32 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/dialog/dialog.js +161 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/display/autorefresh.js +47 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/display/fullscreen.css +6 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/display/fullscreen.js +41 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/display/panel.js +123 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/display/placeholder.js +63 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/display/rulers.js +51 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/edit/closebrackets.js +194 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/edit/closetag.js +175 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/edit/continuelist.js +89 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/edit/matchbrackets.js +145 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/edit/matchtags.js +66 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/edit/trailingspace.js +27 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/fold/brace-fold.js +105 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/fold/comment-fold.js +59 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/fold/foldcode.js +152 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/fold/foldgutter.css +20 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/fold/foldgutter.js +146 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/fold/indent-fold.js +48 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/fold/markdown-fold.js +49 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/fold/xml-fold.js +184 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/hint/anyword-hint.js +41 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/hint/css-hint.js +60 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/hint/html-hint.js +348 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/hint/javascript-hint.js +157 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/hint/show-hint.css +36 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/hint/show-hint.js +433 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/hint/sql-hint.js +299 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/hint/xml-hint.js +110 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/scroll/annotatescrollbar.js +122 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/scroll/scrollpastend.js +48 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/scroll/simplescrollbars.css +66 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/scroll/simplescrollbars.js +152 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/search/jump-to-line.js +49 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/search/match-highlighter.js +165 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/search/matchesonscrollbar.css +8 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/search/matchesonscrollbar.js +97 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/search/search.js +252 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/addon/search/searchcursor.js +293 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/codemirror.css +366 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/codemirror/theme/monokai.css +41 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/components/layouts/_footer.scss +5 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/components/layouts/_settings.scss +51 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/components/navigation/_navbar.scss +187 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/components/navigation/_sidebar.scss +207 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/components/navigation/_turbolinks.scss +4 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/components/paginator/_paginator.scss +53 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/fonts-and-icons/ZXuke1cDvLCKLDcimxB44_lu.woff2 +0 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/fonts-and-icons/boxicons.css +2918 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/fonts-and-icons/fonts.css +8 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/fonts-and-icons/fonts/Simple-Line-Icons.eot +0 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/fonts-and-icons/fonts/Simple-Line-Icons.ttf +0 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/fonts-and-icons/fonts/Simple-Line-Icons.woff +0 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/fonts-and-icons/fonts/Simple-Line-Icons.woff2 +0 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/fonts-and-icons/fonts/boxicons.eot +0 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/fonts-and-icons/fonts/boxicons.svg +808 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/fonts-and-icons/fonts/boxicons.ttf +0 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/fonts-and-icons/fonts/boxicons.woff +0 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/fonts-and-icons/fonts/boxicons.woff2 +0 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/fonts-and-icons/icons.css +778 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_appearance.scss +5 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_bootstrap-colorpicker.scss +269 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_customize.scss +22 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_datepicker.scss +1086 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_devise.scss +189 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_files.scss +229 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_form.scss +190 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_index.scss +466 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_listing.scss +40 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_preloader.scss +224 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_rockets.scss +13 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_roles.scss +3 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_search.scss +244 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_show.scss +23 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_switchs.scss +143 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_themes.scss +45 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_timepicker.scss +14 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/pages/_user.scss +6 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/utils/_base.scss +65 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/utils/_mixins.scss +26 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/utils/_theme.scss +124 -0
- data/testing-with-2.1.18/app/assets/stylesheets/admin/utils/_variables.scss +109 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/application.scss +30 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/base/_base_project.scss +17 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/base/_typography.scss +1 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/components/_buttons.scss +0 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/components/_inputs.scss +0 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/components/_navbar.scss +21 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/layout/_container.scss +0 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/layout/_footer.scss +15 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/layout/_header.scss +39 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/pages/_front.sass +83 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/plugins/_bootstrap_override.scss +37 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/plugins/_font_awesome.scss +2 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/plugins/_keppler.scss +161 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/plugins/_npogress.scss +2 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/utils/_mixins.scss +18 -0
- data/testing-with-2.1.18/app/assets/stylesheets/app/utils/_variables.scss +28 -0
- data/testing-with-2.1.18/app/assets/stylesheets/errors/application.scss +3 -0
- data/testing-with-2.1.18/app/assets/stylesheets/errors/errors.scss +161 -0
- data/testing-with-2.1.18/app/assets/stylesheets/vendor/admin-lte/_skin-blue.scss +141 -0
- data/testing-with-2.1.18/app/assets/stylesheets/vendor/sweetalert2/sweetalert2.scss +11 -0
- data/testing-with-2.1.18/app/controllers/admin/admin_controller.rb +95 -0
- data/testing-with-2.1.18/app/controllers/admin/meta_tags_controller.rb +118 -0
- data/testing-with-2.1.18/app/controllers/admin/permissions_controller.rb +55 -0
- data/testing-with-2.1.18/app/controllers/admin/rockets_controller.rb +95 -0
- data/testing-with-2.1.18/app/controllers/admin/roles_controller.rb +124 -0
- data/testing-with-2.1.18/app/controllers/admin/scripts_controller.rb +104 -0
- data/testing-with-2.1.18/app/controllers/admin/seos_controller.rb +31 -0
- data/testing-with-2.1.18/app/controllers/admin/settings_controller.rb +131 -0
- data/testing-with-2.1.18/app/controllers/admin/users_controller.rb +122 -0
- data/testing-with-2.1.18/app/controllers/app/app_controller.rb +38 -0
- data/testing-with-2.1.18/app/controllers/app/front_controller.rb +8 -0
- data/testing-with-2.1.18/app/controllers/application_controller.rb +151 -0
- data/testing-with-2.1.18/app/controllers/concerns/.keep +0 -0
- data/testing-with-2.1.18/app/controllers/concerns/devise_params.rb +33 -0
- data/testing-with-2.1.18/app/controllers/concerns/mailer_config.rb +37 -0
- data/testing-with-2.1.18/app/controllers/concerns/object_query.rb +50 -0
- data/testing-with-2.1.18/app/controllers/concerns/settings.rb +105 -0
- data/testing-with-2.1.18/app/controllers/devise/sessions_controller.rb +108 -0
- data/testing-with-2.1.18/app/controllers/errors_controller.rb +30 -0
- data/testing-with-2.1.18/app/helpers/admin_helper.rb +138 -0
- data/testing-with-2.1.18/app/helpers/application_helper.rb +33 -0
- data/testing-with-2.1.18/app/helpers/fronts_helper.rb +38 -0
- data/testing-with-2.1.18/app/helpers/rockets_helper.rb +8 -0
- data/testing-with-2.1.18/app/helpers/roles_helper.rb +5 -0
- data/testing-with-2.1.18/app/helpers/scaffolds_helper.rb +5 -0
- data/testing-with-2.1.18/app/inputs/keppler_boolean_input.rb +52 -0
- data/testing-with-2.1.18/app/inputs/keppler_file_input.rb +124 -0
- data/testing-with-2.1.18/app/mailers/.keep +0 -0
- data/testing-with-2.1.18/app/mailers/application_mailer.rb +42 -0
- data/testing-with-2.1.18/app/models/.keep +0 -0
- data/testing-with-2.1.18/app/models/appearance.rb +7 -0
- data/testing-with-2.1.18/app/models/application_record.rb +6 -0
- data/testing-with-2.1.18/app/models/concerns/.keep +0 -0
- data/testing-with-2.1.18/app/models/concerns/activity_history.rb +11 -0
- data/testing-with-2.1.18/app/models/concerns/clone_record.rb +14 -0
- data/testing-with-2.1.18/app/models/concerns/downloadable.rb +16 -0
- data/testing-with-2.1.18/app/models/concerns/searchable.rb +27 -0
- data/testing-with-2.1.18/app/models/concerns/sortable.rb +13 -0
- data/testing-with-2.1.18/app/models/concerns/uploadable.rb +13 -0
- data/testing-with-2.1.18/app/models/front.rb +5 -0
- data/testing-with-2.1.18/app/models/google_analytics_setting.rb +6 -0
- data/testing-with-2.1.18/app/models/meta_tag.rb +54 -0
- data/testing-with-2.1.18/app/models/permission.rb +6 -0
- data/testing-with-2.1.18/app/models/rocket.rb +105 -0
- data/testing-with-2.1.18/app/models/role.rb +134 -0
- data/testing-with-2.1.18/app/models/script.rb +21 -0
- data/testing-with-2.1.18/app/models/seo.rb +49 -0
- data/testing-with-2.1.18/app/models/setting.rb +19 -0
- data/testing-with-2.1.18/app/models/smtp_setting.rb +7 -0
- data/testing-with-2.1.18/app/models/social_account.rb +6 -0
- data/testing-with-2.1.18/app/models/user.rb +75 -0
- data/testing-with-2.1.18/app/policies/application_policy.rb +18 -0
- data/testing-with-2.1.18/app/policies/controller_policy.rb +59 -0
- data/testing-with-2.1.18/app/policies/meta_tag_policy.rb +11 -0
- data/testing-with-2.1.18/app/policies/permission_policy.rb +23 -0
- data/testing-with-2.1.18/app/policies/rocket_policy.rb +11 -0
- data/testing-with-2.1.18/app/policies/role_policy.rb +31 -0
- data/testing-with-2.1.18/app/policies/script_policy.rb +11 -0
- data/testing-with-2.1.18/app/policies/seo_policy.rb +23 -0
- data/testing-with-2.1.18/app/policies/setting_policy.rb +15 -0
- data/testing-with-2.1.18/app/policies/user_policy.rb +19 -0
- data/testing-with-2.1.18/app/services/admin/appearance_service.rb +49 -0
- data/testing-with-2.1.18/app/services/admin/git_handler.rb +28 -0
- data/testing-with-2.1.18/app/uploaders/attachment_uploader.rb +61 -0
- data/testing-with-2.1.18/app/uploaders/ckeditor_attachment_file_uploader.rb +38 -0
- data/testing-with-2.1.18/app/uploaders/ckeditor_picture_uploader.rb +49 -0
- data/testing-with-2.1.18/app/uploaders/template_uploader.rb +44 -0
- data/testing-with-2.1.18/app/views/admin/layouts/_footer.html.haml +0 -0
- data/testing-with-2.1.18/app/views/admin/layouts/_git_info.html.haml +13 -0
- data/testing-with-2.1.18/app/views/admin/layouts/_head.html.haml +7 -0
- data/testing-with-2.1.18/app/views/admin/layouts/_keppler_boolean_script.haml +12 -0
- data/testing-with-2.1.18/app/views/admin/layouts/_listing_preloader.haml +4 -0
- data/testing-with-2.1.18/app/views/admin/layouts/_messages.html.haml +4 -0
- data/testing-with-2.1.18/app/views/admin/layouts/_navigation.html.haml +59 -0
- data/testing-with-2.1.18/app/views/admin/layouts/_preloader.html.haml +14 -0
- data/testing-with-2.1.18/app/views/admin/layouts/_sidebar.html.haml +83 -0
- data/testing-with-2.1.18/app/views/admin/layouts/application.html.haml +23 -0
- data/testing-with-2.1.18/app/views/admin/layouts/index/remote_messages.js.haml +9 -0
- data/testing-with-2.1.18/app/views/admin/meta_tags/_description.html.haml +13 -0
- data/testing-with-2.1.18/app/views/admin/meta_tags/_form.html.haml +35 -0
- data/testing-with-2.1.18/app/views/admin/meta_tags/_listing.html.haml +40 -0
- data/testing-with-2.1.18/app/views/admin/meta_tags/edit.html.haml +2 -0
- data/testing-with-2.1.18/app/views/admin/meta_tags/index.html.haml +69 -0
- data/testing-with-2.1.18/app/views/admin/meta_tags/new.html.haml +2 -0
- data/testing-with-2.1.18/app/views/admin/meta_tags/reload.js.haml +5 -0
- data/testing-with-2.1.18/app/views/admin/meta_tags/show.html.haml +28 -0
- data/testing-with-2.1.18/app/views/admin/permissions/_switch.html.haml +13 -0
- data/testing-with-2.1.18/app/views/admin/permissions/add.html.haml +95 -0
- data/testing-with-2.1.18/app/views/admin/permissions/create.html.haml +0 -0
- data/testing-with-2.1.18/app/views/admin/permissions/create.js.erb +2 -0
- data/testing-with-2.1.18/app/views/admin/permissions/show.js.erb +2 -0
- data/testing-with-2.1.18/app/views/admin/permissions/toggle_permissions.js.erb +6 -0
- data/testing-with-2.1.18/app/views/admin/rockets/_create_rocket.haml +61 -0
- data/testing-with-2.1.18/app/views/admin/rockets/_install_rocket.haml +28 -0
- data/testing-with-2.1.18/app/views/admin/rockets/rockets.haml +54 -0
- data/testing-with-2.1.18/app/views/admin/roles/_description.html.haml +13 -0
- data/testing-with-2.1.18/app/views/admin/roles/_form.html.haml +27 -0
- data/testing-with-2.1.18/app/views/admin/roles/_listing.html.haml +42 -0
- data/testing-with-2.1.18/app/views/admin/roles/_switch.html.haml +24 -0
- data/testing-with-2.1.18/app/views/admin/roles/edit.html.haml +1 -0
- data/testing-with-2.1.18/app/views/admin/roles/index.html.haml +64 -0
- data/testing-with-2.1.18/app/views/admin/roles/new.html.haml +1 -0
- data/testing-with-2.1.18/app/views/admin/roles/reload.js.haml +5 -0
- data/testing-with-2.1.18/app/views/admin/roles/show.html.haml +29 -0
- data/testing-with-2.1.18/app/views/admin/scripts/_description.html.haml +13 -0
- data/testing-with-2.1.18/app/views/admin/scripts/_form.html.haml +30 -0
- data/testing-with-2.1.18/app/views/admin/scripts/_listing.html.haml +40 -0
- data/testing-with-2.1.18/app/views/admin/scripts/edit.html.haml +1 -0
- data/testing-with-2.1.18/app/views/admin/scripts/index.html.haml +70 -0
- data/testing-with-2.1.18/app/views/admin/scripts/new.html.haml +1 -0
- data/testing-with-2.1.18/app/views/admin/scripts/reload.js.haml +5 -0
- data/testing-with-2.1.18/app/views/admin/scripts/show.html.haml +28 -0
- data/testing-with-2.1.18/app/views/admin/seos/robots.html.haml +35 -0
- data/testing-with-2.1.18/app/views/admin/seos/sitemap.html.haml +36 -0
- data/testing-with-2.1.18/app/views/admin/settings/_form.html.haml +10 -0
- data/testing-with-2.1.18/app/views/admin/settings/components/_preview.html.haml +30 -0
- data/testing-with-2.1.18/app/views/admin/settings/edit.html.haml +4 -0
- data/testing-with-2.1.18/app/views/admin/settings/fields/_appearance.html.haml +64 -0
- data/testing-with-2.1.18/app/views/admin/settings/fields/_basic_information.html.haml +40 -0
- data/testing-with-2.1.18/app/views/admin/settings/fields/_email_setting.html.haml +18 -0
- data/testing-with-2.1.18/app/views/admin/settings/fields/_google_analytics_setting.html.haml +21 -0
- data/testing-with-2.1.18/app/views/admin/settings/fields/_social_accounts.html.haml +43 -0
- data/testing-with-2.1.18/app/views/admin/users/_description.html.haml +13 -0
- data/testing-with-2.1.18/app/views/admin/users/_form.html.haml +45 -0
- data/testing-with-2.1.18/app/views/admin/users/_listing.html.haml +47 -0
- data/testing-with-2.1.18/app/views/admin/users/delete_avatar.js.haml +3 -0
- data/testing-with-2.1.18/app/views/admin/users/edit.html.haml +1 -0
- data/testing-with-2.1.18/app/views/admin/users/filter_by_role.js.erb +9 -0
- data/testing-with-2.1.18/app/views/admin/users/index.html.haml +69 -0
- data/testing-with-2.1.18/app/views/admin/users/new.html.haml +1 -0
- data/testing-with-2.1.18/app/views/admin/users/reload.js.haml +5 -0
- data/testing-with-2.1.18/app/views/admin/users/show.html.haml +34 -0
- data/testing-with-2.1.18/app/views/app/front/index.html.haml +223 -0
- data/testing-with-2.1.18/app/views/app/front/message.haml +1 -0
- data/testing-with-2.1.18/app/views/app/layouts/_footer.html.haml +3 -0
- data/testing-with-2.1.18/app/views/app/layouts/_google_analytics.html.haml +13 -0
- data/testing-with-2.1.18/app/views/app/layouts/_head.html.haml +15 -0
- data/testing-with-2.1.18/app/views/app/layouts/_messages.html.haml +6 -0
- data/testing-with-2.1.18/app/views/app/layouts/_meta_tags.html.haml +40 -0
- data/testing-with-2.1.18/app/views/app/layouts/_navigation.html.haml +13 -0
- data/testing-with-2.1.18/app/views/app/layouts/_navigation_links.html.haml +6 -0
- data/testing-with-2.1.18/app/views/app/layouts/application.html.haml +10 -0
- data/testing-with-2.1.18/app/views/application_mailer/testing.html.haml +1 -0
- data/testing-with-2.1.18/app/views/devise/confirmations/new.html.erb +16 -0
- data/testing-with-2.1.18/app/views/devise/mailer/reset_password_instructions.html.haml +6 -0
- data/testing-with-2.1.18/app/views/devise/passwords/edit.html.haml +31 -0
- data/testing-with-2.1.18/app/views/devise/passwords/new.html.haml +27 -0
- data/testing-with-2.1.18/app/views/devise/registrations/edit.html.erb +48 -0
- data/testing-with-2.1.18/app/views/devise/registrations/new.html.erb +19 -0
- data/testing-with-2.1.18/app/views/devise/sessions/new.html.haml +35 -0
- data/testing-with-2.1.18/app/views/devise/shared/_links.html.erb +21 -0
- data/testing-with-2.1.18/app/views/errors/internal_server_error.html.haml +50 -0
- data/testing-with-2.1.18/app/views/errors/not_authorized.html.haml +76 -0
- data/testing-with-2.1.18/app/views/errors/not_found.html.haml +101 -0
- data/testing-with-2.1.18/app/views/errors/unprocessable.html.haml +50 -0
- data/testing-with-2.1.18/app/views/kaminari/_first_page.html.haml +11 -0
- data/testing-with-2.1.18/app/views/kaminari/_gap.html.haml +8 -0
- data/testing-with-2.1.18/app/views/kaminari/_last_page.html.haml +11 -0
- data/testing-with-2.1.18/app/views/kaminari/_next_page.html.haml +11 -0
- data/testing-with-2.1.18/app/views/kaminari/_page.html.haml +10 -0
- data/testing-with-2.1.18/app/views/kaminari/_paginator.html.haml +18 -0
- data/testing-with-2.1.18/app/views/kaminari/_prev_page.html.haml +11 -0
- data/testing-with-2.1.18/app/views/layouts/errors/_head.html.haml +3 -0
- data/testing-with-2.1.18/app/views/layouts/errors/application.html.haml +11 -0
- data/testing-with-2.1.18/app/views/layouts/mailers/mailer.html.haml +3 -0
- data/testing-with-2.1.18/app/views/layouts/mailers/mailer.text.haml +1 -0
- data/testing-with-2.1.18/app/views/layouts/templates/application.html.haml +1 -0
- data/testing-with-2.1.18/app/views/public_activity/layout/_create.html.haml +44 -0
- data/testing-with-2.1.18/app/views/public_activity/layout/_destroy.html.haml +15 -0
- data/testing-with-2.1.18/app/views/public_activity/layout/_update.html.haml +44 -0
- data/testing-with-2.1.18/app/views/public_activity/session/_create.html.haml +13 -0
- data/testing-with-2.1.18/app/views/public_activity/session/_destroy.html.haml +13 -0
- data/testing-with-2.1.18/app/views/templates/kaminari/_first_page.html.haml +9 -0
- data/testing-with-2.1.18/app/views/templates/kaminari/_gap.html.haml +8 -0
- data/testing-with-2.1.18/app/views/templates/kaminari/_last_page.html.haml +9 -0
- data/testing-with-2.1.18/app/views/templates/kaminari/_next_page.html.haml +9 -0
- data/testing-with-2.1.18/app/views/templates/kaminari/_page.html.haml +10 -0
- data/testing-with-2.1.18/app/views/templates/kaminari/_paginator.html.haml +18 -0
- data/testing-with-2.1.18/app/views/templates/kaminari/_prev_page.html.haml +9 -0
- data/testing-with-2.1.18/bin/bundle +3 -0
- data/testing-with-2.1.18/bin/rails +4 -0
- data/testing-with-2.1.18/bin/rake +4 -0
- data/testing-with-2.1.18/bin/setup +29 -0
- data/testing-with-2.1.18/bin/spring +15 -0
- data/testing-with-2.1.18/bin/update +31 -0
- data/testing-with-2.1.18/bin/yarn +11 -0
- data/testing-with-2.1.18/config.ru +4 -0
- data/testing-with-2.1.18/config/application.rb +46 -0
- data/testing-with-2.1.18/config/attachments.yml +24 -0
- data/testing-with-2.1.18/config/boot.rb +7 -0
- data/testing-with-2.1.18/config/circleci/db_config.yml +51 -0
- data/testing-with-2.1.18/config/database.yml +25 -0
- data/testing-with-2.1.18/config/environment.rb +10 -0
- data/testing-with-2.1.18/config/environments/development.rb +61 -0
- data/testing-with-2.1.18/config/environments/production.rb +109 -0
- data/testing-with-2.1.18/config/environments/test.rb +45 -0
- data/testing-with-2.1.18/config/gaAuth/gauth_key.p12 +0 -0
- data/testing-with-2.1.18/config/initializers/assets.rb +14 -0
- data/testing-with-2.1.18/config/initializers/carrierwave.rb +12 -0
- data/testing-with-2.1.18/config/initializers/compression.rb +47 -0
- data/testing-with-2.1.18/config/initializers/cookies_serializer.rb +3 -0
- data/testing-with-2.1.18/config/initializers/date_formats.rb +2 -0
- data/testing-with-2.1.18/config/initializers/devise.rb +259 -0
- data/testing-with-2.1.18/config/initializers/filter_parameter_logging.rb +5 -0
- data/testing-with-2.1.18/config/initializers/inflections.rb +16 -0
- data/testing-with-2.1.18/config/initializers/keppler_configuration.rb +9 -0
- data/testing-with-2.1.18/config/initializers/mime_types.rb +6 -0
- data/testing-with-2.1.18/config/initializers/paginate_kaminari_configuration.rb +12 -0
- data/testing-with-2.1.18/config/initializers/ransack.rb +7 -0
- data/testing-with-2.1.18/config/initializers/rolify.rb +10 -0
- data/testing-with-2.1.18/config/initializers/route_traslator.rb +3 -0
- data/testing-with-2.1.18/config/initializers/session_store.rb +5 -0
- data/testing-with-2.1.18/config/initializers/simple_form.rb +170 -0
- data/testing-with-2.1.18/config/initializers/simple_form_bootstrap.rb +174 -0
- data/testing-with-2.1.18/config/initializers/simple_form_components.rb +61 -0
- data/testing-with-2.1.18/config/initializers/time_formats.rb +2 -0
- data/testing-with-2.1.18/config/initializers/wrap_parameters.rb +15 -0
- data/testing-with-2.1.18/config/jshint.yml +21 -0
- data/testing-with-2.1.18/config/locales/devise.en.yml +61 -0
- data/testing-with-2.1.18/config/locales/devise.es.yml +62 -0
- data/testing-with-2.1.18/config/locales/en.yml +477 -0
- data/testing-with-2.1.18/config/locales/es.yml +510 -0
- data/testing-with-2.1.18/config/locales/routes.en.yml +4 -0
- data/testing-with-2.1.18/config/locales/routes.es.yml +5 -0
- data/testing-with-2.1.18/config/locales/simple_form.en.yml +46 -0
- data/testing-with-2.1.18/config/locales/simple_form.es.yml +96 -0
- data/testing-with-2.1.18/config/locales/social_share_button.es.yml +10 -0
- data/testing-with-2.1.18/config/menu.yml +58 -0
- data/testing-with-2.1.18/config/permissions.yml +39 -0
- data/testing-with-2.1.18/config/puma.rb +56 -0
- data/testing-with-2.1.18/config/roles.yml +2 -0
- data/testing-with-2.1.18/config/routes.rb +191 -0
- data/testing-with-2.1.18/config/settings.yml +30 -0
- data/testing-with-2.1.18/config/sitemap.rb +30 -0
- data/testing-with-2.1.18/config/spring.rb +6 -0
- data/testing-with-2.1.18/db/migrate/20140812203549_devise_create_users.rb +50 -0
- data/testing-with-2.1.18/db/migrate/20140812210925_rolify_create_roles.rb +21 -0
- data/testing-with-2.1.18/db/migrate/20151221173228_create_activities.rb +23 -0
- data/testing-with-2.1.18/db/migrate/20160122201215_create_settings.rb +15 -0
- data/testing-with-2.1.18/db/migrate/20160126141856_create_smtp_settings.rb +15 -0
- data/testing-with-2.1.18/db/migrate/20160128131802_create_scripts.rb +12 -0
- data/testing-with-2.1.18/db/migrate/20160128151351_create_google_analytics_settings.rb +13 -0
- data/testing-with-2.1.18/db/migrate/20160128193740_create_social_accounts.rb +26 -0
- data/testing-with-2.1.18/db/migrate/20160201134918_create_meta_tags.rb +13 -0
- data/testing-with-2.1.18/db/migrate/20160201210520_create_appearances.rb +14 -0
- data/testing-with-2.1.18/db/migrate/20171225023933_create_scaffolds.rb +10 -0
- data/testing-with-2.1.18/db/migrate/20180503174351_create_permissions.rb +11 -0
- data/testing-with-2.1.18/db/migrate/20180717160308_create_keppler_frontend_views.keppler_frontend.rb +17 -0
- data/testing-with-2.1.18/db/migrate/20180730194655_create_keppler_frontend_themes.rb +13 -0
- data/testing-with-2.1.18/db/migrate/20180802184429_create_keppler_capsules_capsules.keppler_capsules.rb +13 -0
- data/testing-with-2.1.18/db/migrate/20180802184430_create_keppler_capsules_capsule_fields.keppler_capsules.rb +12 -0
- data/testing-with-2.1.18/db/migrate/20180806192023_create_keppler_capsules_capsule_validations.keppler_capsules.rb +13 -0
- data/testing-with-2.1.18/db/migrate/20180806203410_create_keppler_frontend_partials.keppler_frontend.rb +13 -0
- data/testing-with-2.1.18/db/migrate/20180807204310_create_keppler_capsules_capsule_associations.keppler_capsules.rb +13 -0
- data/testing-with-2.1.18/db/migrate/20180813160624_create_keppler_languages_languages.keppler_languages.rb +14 -0
- data/testing-with-2.1.18/db/migrate/20180813160625_create_keppler_languages_fields.keppler_languages.rb +14 -0
- data/testing-with-2.1.18/db/migrate/20180818073305_create_active_storage_tables.active_storage.rb +26 -0
- data/testing-with-2.1.18/db/migrate/20180827120841_create_keppler_frontend_callback_functions.keppler_frontend.rb +14 -0
- data/testing-with-2.1.18/db/migrate/20180827154329_create_keppler_frontend_view_callbacks.keppler_frontend.rb +12 -0
- data/testing-with-2.1.18/db/migrate/20180827154647_add_position_to_users_table.rb +5 -0
- data/testing-with-2.1.18/db/migrate/20180830153221_create_keppler_frontend_functions.keppler_frontend.rb +14 -0
- data/testing-with-2.1.18/db/migrate/20180830153222_create_keppler_frontend_parameters.keppler_frontend.rb +13 -0
- data/testing-with-2.1.18/db/migrate/20180904144238_create_seos.rb +11 -0
- data/testing-with-2.1.18/db/seeds.rb +162 -0
- data/testing-with-2.1.18/docs/diagrams/keppler_core/config +0 -0
- data/testing-with-2.1.18/docs/diagrams/keppler_frontend/editor/resources_editor.dia +0 -0
- data/testing-with-2.1.18/docs/diagrams/keppler_frontend/views/create_view.dia +0 -0
- data/testing-with-2.1.18/docs/diagrams/keppler_frontend/views/delete_view.dia +0 -0
- data/testing-with-2.1.18/docs/diagrams/keppler_frontend/views/delete_view.dia.autosave +0 -0
- data/testing-with-2.1.18/lib/generators/install_rocket/USAGE +44 -0
- data/testing-with-2.1.18/lib/generators/install_rocket/install_rocket_generator.rb +107 -0
- data/testing-with-2.1.18/lib/generators/keppler_add_module/USAGE +5 -0
- data/testing-with-2.1.18/lib/generators/keppler_add_module/keppler_add_module_generator.rb +324 -0
- data/testing-with-2.1.18/lib/generators/keppler_add_module/templates/controllers/controller.rb +106 -0
- data/testing-with-2.1.18/lib/generators/keppler_add_module/templates/models/model.rb +29 -0
- data/testing-with-2.1.18/lib/generators/keppler_add_module/templates/policies/policy.rb +11 -0
- data/testing-with-2.1.18/lib/generators/keppler_add_module/templates/views/_description.haml +13 -0
- data/testing-with-2.1.18/lib/generators/keppler_add_module/templates/views/_form.haml +49 -0
- data/testing-with-2.1.18/lib/generators/keppler_add_module/templates/views/_listing.haml +58 -0
- data/testing-with-2.1.18/lib/generators/keppler_add_module/templates/views/edit.haml +1 -0
- data/testing-with-2.1.18/lib/generators/keppler_add_module/templates/views/index.haml +70 -0
- data/testing-with-2.1.18/lib/generators/keppler_add_module/templates/views/new.haml +1 -0
- data/testing-with-2.1.18/lib/generators/keppler_add_module/templates/views/reload.js.haml +5 -0
- data/testing-with-2.1.18/lib/generators/keppler_add_module/templates/views/show.haml +35 -0
- data/testing-with-2.1.18/lib/generators/keppler_delete_module/USAGE +5 -0
- data/testing-with-2.1.18/lib/generators/keppler_delete_module/keppler_delete_module_generator.rb +305 -0
- data/testing-with-2.1.18/lib/generators/keppler_front/keppler_front_generator.rb +139 -0
- data/testing-with-2.1.18/lib/generators/keppler_front/templates/controllers/controller.rb +17 -0
- data/testing-with-2.1.18/lib/generators/keppler_front/templates/views/template.html.haml +225 -0
- data/testing-with-2.1.18/lib/generators/keppler_relation/keppler_relation_generator.rb +219 -0
- data/testing-with-2.1.18/lib/generators/new_rocket/USAGE +44 -0
- data/testing-with-2.1.18/lib/generators/new_rocket/new_rocket_generator.rb +258 -0
- data/testing-with-2.1.18/lib/generators/uninstall_rocket/USAGE +32 -0
- data/testing-with-2.1.18/lib/generators/uninstall_rocket/uninstall_rocket_generator.rb +140 -0
- data/testing-with-2.1.18/lib/keppler_configuration.rb +12 -0
- data/testing-with-2.1.18/lib/plugins/config/locales/en.yml +16 -0
- data/testing-with-2.1.18/lib/plugins/config/locales/es.yml +16 -0
- data/testing-with-2.1.18/lib/plugins/config/menu.yml +16 -0
- data/testing-with-2.1.18/lib/plugins/config/permissions.yml +1 -0
- data/testing-with-2.1.18/lib/plugins/generators/keppler_scaffold/keppler_scaffold_generator.rb +223 -0
- data/testing-with-2.1.18/lib/plugins/generators/keppler_scaffold/templates/controllers/controller.rb +107 -0
- data/testing-with-2.1.18/lib/plugins/generators/keppler_scaffold/templates/models/model.rb +29 -0
- data/testing-with-2.1.18/lib/plugins/generators/keppler_scaffold/templates/policies/policy.rb +14 -0
- data/testing-with-2.1.18/lib/plugins/generators/keppler_scaffold/templates/views/_description.haml +13 -0
- data/testing-with-2.1.18/lib/plugins/generators/keppler_scaffold/templates/views/_form.haml +49 -0
- data/testing-with-2.1.18/lib/plugins/generators/keppler_scaffold/templates/views/_listing.haml +58 -0
- data/testing-with-2.1.18/lib/plugins/generators/keppler_scaffold/templates/views/edit.haml +1 -0
- data/testing-with-2.1.18/lib/plugins/generators/keppler_scaffold/templates/views/index.haml +69 -0
- data/testing-with-2.1.18/lib/plugins/generators/keppler_scaffold/templates/views/new.haml +1 -0
- data/testing-with-2.1.18/lib/plugins/generators/keppler_scaffold/templates/views/reload.js.haml +5 -0
- data/testing-with-2.1.18/lib/plugins/generators/keppler_scaffold/templates/views/show.haml +35 -0
- data/testing-with-2.1.18/lib/plugins/install.rb +151 -0
- data/testing-with-2.1.18/lib/plugins/layouts/application.html.haml +23 -0
- data/testing-with-2.1.18/lib/templates/haml/scaffold/_form.html.haml +10 -0
- metadata +564 -3
- data/installer/core/.sass-cache/c3e12133096533fa0f5c2d91446553934f6099d2/(__TEMPLATE__)c +0 -0
data/testing-with-2.1.18/app/assets/javascripts/admin/bootstrap-file-input/plugins/purify.min.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
(function(e){"use strict";var t=typeof window==="undefined"?null:window;if(typeof define==="function"&&define.amd){define(function(){return e(t)})}else if(typeof module!=="undefined"){module.exports=e(t)}else{t.DOMPurify=e(t)}})(function e(t){"use strict";var r=function(t){return e(t)};r.version="0.7.4";if(!t||!t.document||t.document.nodeType!==9){r.isSupported=false;return r}var n=t.document;var a=n;var i=t.DocumentFragment;var o=t.HTMLTemplateElement;var l=t.NodeFilter;var s=t.NamedNodeMap||t.MozNamedAttrMap;var f=t.Text;var c=t.Comment;var u=t.DOMParser;if(typeof o==="function"){var d=n.createElement("template");if(d.content&&d.content.ownerDocument){n=d.content.ownerDocument}}var m=n.implementation;var p=n.createNodeIterator;var h=n.getElementsByTagName;var v=n.createDocumentFragment;var g=a.importNode;var y={};r.isSupported=typeof m.createHTMLDocument!=="undefined"&&n.documentMode!==9;var b=function(e,t){var r=t.length;while(r--){if(typeof t[r]==="string"){t[r]=t[r].toLowerCase()}e[t[r]]=true}return e};var T=function(e){var t={};var r;for(r in e){if(e.hasOwnProperty(r)){t[r]=e[r]}}return t};var x=null;var k=b({},["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr","svg","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","switch","symbol","text","textpath","title","tref","tspan","view","vkern","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmuliscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mpspace","msqrt","mystyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","#text"]);var A=null;var w=b({},["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","coords","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","rows","rowspan","spellcheck","scope","selected","shape","size","span","srclang","start","src","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns","accent-height","accumulate","additivive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mode","min","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","surfacescale","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","u1","u2","unicode","values","viewbox","visibility","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","y","y1","y2","z","zoomandpan","accent","accentunder","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","display","displaystyle","fence","frame","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]);var E=null;var S=null;var M=true;var O=false;var L=false;var D=false;var N=/\{\{[\s\S]*|[\s\S]*\}\}/gm;var _=/<%[\s\S]*|[\s\S]*%>/gm;var C=false;var z=false;var R=false;var F=false;var H=true;var B=true;var W=b({},["audio","head","math","script","style","svg","video"]);var j=b({},["audio","video","img","source"]);var G=b({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]);var I=null;var q=n.createElement("form");var P=function(e){if(typeof e!=="object"){e={}}x="ALLOWED_TAGS"in e?b({},e.ALLOWED_TAGS):k;A="ALLOWED_ATTR"in e?b({},e.ALLOWED_ATTR):w;E="FORBID_TAGS"in e?b({},e.FORBID_TAGS):{};S="FORBID_ATTR"in e?b({},e.FORBID_ATTR):{};M=e.ALLOW_DATA_ATTR!==false;O=e.ALLOW_UNKNOWN_PROTOCOLS||false;L=e.SAFE_FOR_JQUERY||false;D=e.SAFE_FOR_TEMPLATES||false;C=e.WHOLE_DOCUMENT||false;z=e.RETURN_DOM||false;R=e.RETURN_DOM_FRAGMENT||false;F=e.RETURN_DOM_IMPORT||false;H=e.SANITIZE_DOM!==false;B=e.KEEP_CONTENT!==false;if(D){M=false}if(R){z=true}if(e.ADD_TAGS){if(x===k){x=T(x)}b(x,e.ADD_TAGS)}if(e.ADD_ATTR){if(A===w){A=T(A)}b(A,e.ADD_ATTR)}if(B){x["#text"]=true}if(Object&&"freeze"in Object){Object.freeze(e)}I=e};var U=function(e){try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=""}};var V=function(e){var t,r;try{t=(new u).parseFromString(e,"text/html")}catch(n){}if(!t){t=m.createHTMLDocument("");r=t.body;r.parentNode.removeChild(r.parentNode.firstElementChild);r.outerHTML=e}if(typeof t.getElementsByTagName==="function"){return t.getElementsByTagName(C?"html":"body")[0]}return h.call(t,C?"html":"body")[0]};var K=function(e){return p.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,function(){return l.FILTER_ACCEPT},false)};var J=function(e){if(e instanceof f||e instanceof c){return false}if(typeof e.nodeName!=="string"||typeof e.textContent!=="string"||typeof e.removeChild!=="function"||!(e.attributes instanceof s)||typeof e.removeAttribute!=="function"||typeof e.setAttribute!=="function"){return true}return false};var Q=function(e){var t,r;re("beforeSanitizeElements",e,null);if(J(e)){U(e);return true}t=e.nodeName.toLowerCase();re("uponSanitizeElement",e,{tagName:t});if(!x[t]||E[t]){if(B&&!W[t]&&typeof e.insertAdjacentHTML==="function"){try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(n){}}U(e);return true}if(L&&!e.firstElementChild&&(!e.content||!e.content.firstElementChild)){e.innerHTML=e.textContent.replace(/</g,"<")}if(D&&e.nodeType===3){r=e.textContent;r=r.replace(N," ");r=r.replace(_," ");e.textContent=r}re("afterSanitizeElements",e,null);return false};var X=/^data-[\w.\u00B7-\uFFFF-]/;var Y=/^(?:(?:(?:f|ht)tps?|mailto|tel):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;var Z=/^(?:\w+script|data):/i;var $=/[\x00-\x20\xA0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;var ee=function(e){var r,a,i,o,l,s,f,c;re("beforeSanitizeAttributes",e,null);s=e.attributes;if(!s){return}f={attrName:"",attrValue:"",keepAttr:true};c=s.length;while(c--){r=s[c];a=r.name;i=r.value;o=a.toLowerCase();f.attrName=o;f.attrValue=i;f.keepAttr=true;re("uponSanitizeAttribute",e,f);i=f.attrValue;if(o==="name"&&e.nodeName==="IMG"&&s.id){l=s.id;s=Array.prototype.slice.apply(s);e.removeAttribute("id");e.removeAttribute(a);if(s.indexOf(l)>c){e.setAttribute("id",l.value)}}else{if(a==="id"){e.setAttribute(a,"")}e.removeAttribute(a)}if(!f.keepAttr){continue}if(H&&(o==="id"||o==="name")&&(i in t||i in n||i in q)){continue}if(D){i=i.replace(N," ");i=i.replace(_," ")}if(A[o]&&!S[o]&&(G[o]||Y.test(i.replace($,""))||o==="src"&&i.indexOf("data:")===0&&j[e.nodeName.toLowerCase()])||M&&X.test(o)||O&&!Z.test(i.replace($,""))){try{e.setAttribute(a,i)}catch(u){}}}re("afterSanitizeAttributes",e,null)};var te=function(e){var t;var r=K(e);re("beforeSanitizeShadowDOM",e,null);while(t=r.nextNode()){re("uponSanitizeShadowNode",t,null);if(Q(t)){continue}if(t.content instanceof i){te(t.content)}ee(t)}re("afterSanitizeShadowDOM",e,null)};var re=function(e,t,n){if(!y[e]){return}y[e].forEach(function(e){e.call(r,t,n,I)})};r.sanitize=function(e,n){var o,l,s,f,c;if(!e){e=""}if(typeof e!=="string"){if(typeof e.toString!=="function"){throw new TypeError("toString is not a function")}else{e=e.toString()}}if(!r.isSupported){if(typeof t.toStaticHTML==="object"||typeof t.toStaticHTML==="function"){return t.toStaticHTML(e)}return e}P(n);if(!z&&!C&&e.indexOf("<")===-1){return e}o=V(e);if(!o){return z?null:""}f=K(o);while(l=f.nextNode()){if(l.nodeType===3&&l===s){continue}if(Q(l)){continue}if(l.content instanceof i){te(l.content)}ee(l);s=l}if(z){if(R){c=v.call(o.ownerDocument);while(o.firstChild){c.appendChild(o.firstChild)}}else{c=o}if(F){c=g.call(a,c,true)}return c}return C?o.outerHTML:o.innerHTML};r.addHook=function(e,t){if(typeof t!=="function"){return}y[e]=y[e]||[];y[e].push(t)};r.removeHook=function(e){if(y[e]){y[e].pop()}};r.removeHooks=function(e){if(y[e]){y[e]=[]}};r.removeAllHooks=function(){y=[]};return r});
|
data/testing-with-2.1.18/app/assets/javascripts/admin/bootstrap-file-input/plugins/sortable.js
ADDED
@@ -0,0 +1,1590 @@
|
|
1
|
+
/**!
|
2
|
+
* KvSortable
|
3
|
+
* @author RubaXa <trash@rubaxa.org>
|
4
|
+
* @license MIT
|
5
|
+
*
|
6
|
+
* Changed kvsortable plugin naming to prevent conflict with JQuery UI Sortable
|
7
|
+
* @author Kartik Visweswaran
|
8
|
+
*/
|
9
|
+
|
10
|
+
(function kvsortableModule(factory) {
|
11
|
+
"use strict";
|
12
|
+
|
13
|
+
if (typeof define === "function" && define.amd) {
|
14
|
+
define(factory);
|
15
|
+
}
|
16
|
+
else if (typeof module != "undefined" && typeof module.exports != "undefined") {
|
17
|
+
module.exports = factory();
|
18
|
+
}
|
19
|
+
else {
|
20
|
+
/* jshint sub:true */
|
21
|
+
window["KvSortable"] = factory();
|
22
|
+
}
|
23
|
+
})(function kvsortableFactory() {
|
24
|
+
"use strict";
|
25
|
+
|
26
|
+
if (typeof window === "undefined" || !window.document) {
|
27
|
+
return function kvsortableError() {
|
28
|
+
throw new Error("KvSortable.js requires a window with a document");
|
29
|
+
};
|
30
|
+
}
|
31
|
+
|
32
|
+
var dragEl,
|
33
|
+
parentEl,
|
34
|
+
ghostEl,
|
35
|
+
cloneEl,
|
36
|
+
rootEl,
|
37
|
+
nextEl,
|
38
|
+
lastDownEl,
|
39
|
+
|
40
|
+
scrollEl,
|
41
|
+
scrollParentEl,
|
42
|
+
scrollCustomFn,
|
43
|
+
|
44
|
+
lastEl,
|
45
|
+
lastCSS,
|
46
|
+
lastParentCSS,
|
47
|
+
|
48
|
+
oldIndex,
|
49
|
+
newIndex,
|
50
|
+
|
51
|
+
activeGroup,
|
52
|
+
putKvSortable,
|
53
|
+
|
54
|
+
autoScroll = {},
|
55
|
+
|
56
|
+
tapEvt,
|
57
|
+
touchEvt,
|
58
|
+
|
59
|
+
moved,
|
60
|
+
|
61
|
+
/** @const */
|
62
|
+
R_SPACE = /\s+/g,
|
63
|
+
R_FLOAT = /left|right|inline/,
|
64
|
+
|
65
|
+
expando = 'KvSortable' + (new Date).getTime(),
|
66
|
+
|
67
|
+
win = window,
|
68
|
+
document = win.document,
|
69
|
+
parseInt = win.parseInt,
|
70
|
+
setTimeout = win.setTimeout,
|
71
|
+
|
72
|
+
$ = win.jQuery || win.Zepto,
|
73
|
+
Polymer = win.Polymer,
|
74
|
+
|
75
|
+
captureMode = false,
|
76
|
+
passiveMode = false,
|
77
|
+
|
78
|
+
supportDraggable = ('draggable' in document.createElement('div')),
|
79
|
+
supportCssPointerEvents = (function (el) {
|
80
|
+
// false when IE11
|
81
|
+
if (!!navigator.userAgent.match(/(?:Trident.*rv[ :]?11\.|msie)/i)) {
|
82
|
+
return false;
|
83
|
+
}
|
84
|
+
el = document.createElement('x');
|
85
|
+
el.style.cssText = 'pointer-events:auto';
|
86
|
+
return el.style.pointerEvents === 'auto';
|
87
|
+
})(),
|
88
|
+
|
89
|
+
_silent = false,
|
90
|
+
|
91
|
+
abs = Math.abs,
|
92
|
+
min = Math.min,
|
93
|
+
|
94
|
+
savedInputChecked = [],
|
95
|
+
touchDragOverListeners = [],
|
96
|
+
|
97
|
+
_autoScroll = _throttle(function (/**Event*/evt, /**Object*/options, /**HTMLElement*/rootEl) {
|
98
|
+
// Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
|
99
|
+
if (rootEl && options.scroll) {
|
100
|
+
var _this = rootEl[expando],
|
101
|
+
el,
|
102
|
+
rect,
|
103
|
+
sens = options.scrollSensitivity,
|
104
|
+
speed = options.scrollSpeed,
|
105
|
+
|
106
|
+
x = evt.clientX,
|
107
|
+
y = evt.clientY,
|
108
|
+
|
109
|
+
winWidth = window.innerWidth,
|
110
|
+
winHeight = window.innerHeight,
|
111
|
+
|
112
|
+
vx,
|
113
|
+
vy,
|
114
|
+
|
115
|
+
scrollOffsetX,
|
116
|
+
scrollOffsetY
|
117
|
+
;
|
118
|
+
|
119
|
+
// Delect scrollEl
|
120
|
+
if (scrollParentEl !== rootEl) {
|
121
|
+
scrollEl = options.scroll;
|
122
|
+
scrollParentEl = rootEl;
|
123
|
+
scrollCustomFn = options.scrollFn;
|
124
|
+
|
125
|
+
if (scrollEl === true) {
|
126
|
+
scrollEl = rootEl;
|
127
|
+
|
128
|
+
do {
|
129
|
+
if ((scrollEl.offsetWidth < scrollEl.scrollWidth) ||
|
130
|
+
(scrollEl.offsetHeight < scrollEl.scrollHeight)
|
131
|
+
) {
|
132
|
+
break;
|
133
|
+
}
|
134
|
+
/* jshint boss:true */
|
135
|
+
} while (scrollEl = scrollEl.parentNode);
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
if (scrollEl) {
|
140
|
+
el = scrollEl;
|
141
|
+
rect = scrollEl.getBoundingClientRect();
|
142
|
+
vx = (abs(rect.right - x) <= sens) - (abs(rect.left - x) <= sens);
|
143
|
+
vy = (abs(rect.bottom - y) <= sens) - (abs(rect.top - y) <= sens);
|
144
|
+
}
|
145
|
+
|
146
|
+
|
147
|
+
if (!(vx || vy)) {
|
148
|
+
vx = (winWidth - x <= sens) - (x <= sens);
|
149
|
+
vy = (winHeight - y <= sens) - (y <= sens);
|
150
|
+
|
151
|
+
/* jshint expr:true */
|
152
|
+
(vx || vy) && (el = win);
|
153
|
+
}
|
154
|
+
|
155
|
+
|
156
|
+
if (autoScroll.vx !== vx || autoScroll.vy !== vy || autoScroll.el !== el) {
|
157
|
+
autoScroll.el = el;
|
158
|
+
autoScroll.vx = vx;
|
159
|
+
autoScroll.vy = vy;
|
160
|
+
|
161
|
+
clearInterval(autoScroll.pid);
|
162
|
+
|
163
|
+
if (el) {
|
164
|
+
autoScroll.pid = setInterval(function () {
|
165
|
+
scrollOffsetY = vy ? vy * speed : 0;
|
166
|
+
scrollOffsetX = vx ? vx * speed : 0;
|
167
|
+
|
168
|
+
if ('function' === typeof(scrollCustomFn)) {
|
169
|
+
return scrollCustomFn.call(_this, scrollOffsetX, scrollOffsetY, evt);
|
170
|
+
}
|
171
|
+
|
172
|
+
if (el === win) {
|
173
|
+
win.scrollTo(win.pageXOffset + scrollOffsetX, win.pageYOffset + scrollOffsetY);
|
174
|
+
} else {
|
175
|
+
el.scrollTop += scrollOffsetY;
|
176
|
+
el.scrollLeft += scrollOffsetX;
|
177
|
+
}
|
178
|
+
}, 24);
|
179
|
+
}
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}, 30),
|
183
|
+
|
184
|
+
_prepareGroup = function (options) {
|
185
|
+
function toFn(value, pull) {
|
186
|
+
if (value === void 0 || value === true) {
|
187
|
+
value = group.name;
|
188
|
+
}
|
189
|
+
|
190
|
+
if (typeof value === 'function') {
|
191
|
+
return value;
|
192
|
+
} else {
|
193
|
+
return function (to, from) {
|
194
|
+
var fromGroup = from.options.group.name;
|
195
|
+
|
196
|
+
return pull
|
197
|
+
? value
|
198
|
+
: value && (value.join
|
199
|
+
? value.indexOf(fromGroup) > -1
|
200
|
+
: (fromGroup == value)
|
201
|
+
);
|
202
|
+
};
|
203
|
+
}
|
204
|
+
}
|
205
|
+
|
206
|
+
var group = {};
|
207
|
+
var originalGroup = options.group;
|
208
|
+
|
209
|
+
if (!originalGroup || typeof originalGroup != 'object') {
|
210
|
+
originalGroup = {name: originalGroup};
|
211
|
+
}
|
212
|
+
|
213
|
+
group.name = originalGroup.name;
|
214
|
+
group.checkPull = toFn(originalGroup.pull, true);
|
215
|
+
group.checkPut = toFn(originalGroup.put);
|
216
|
+
group.revertClone = originalGroup.revertClone;
|
217
|
+
|
218
|
+
options.group = group;
|
219
|
+
}
|
220
|
+
;
|
221
|
+
|
222
|
+
// Detect support a passive mode
|
223
|
+
try {
|
224
|
+
window.addEventListener('test', null, Object.defineProperty({}, 'passive', {
|
225
|
+
get: function () {
|
226
|
+
// `false`, because everything starts to work incorrectly and instead of d'n'd,
|
227
|
+
// begins the page has scrolled.
|
228
|
+
passiveMode = false;
|
229
|
+
captureMode = {
|
230
|
+
capture: false,
|
231
|
+
passive: passiveMode
|
232
|
+
};
|
233
|
+
}
|
234
|
+
}));
|
235
|
+
} catch (err) {}
|
236
|
+
|
237
|
+
/**
|
238
|
+
* @class KvSortable
|
239
|
+
* @param {HTMLElement} el
|
240
|
+
* @param {Object} [options]
|
241
|
+
*/
|
242
|
+
function KvSortable(el, options) {
|
243
|
+
if (!(el && el.nodeType && el.nodeType === 1)) {
|
244
|
+
throw 'KvSortable: `el` must be HTMLElement, and not ' + {}.toString.call(el);
|
245
|
+
}
|
246
|
+
|
247
|
+
this.el = el; // root element
|
248
|
+
this.options = options = _extend({}, options);
|
249
|
+
|
250
|
+
|
251
|
+
// Export instance
|
252
|
+
el[expando] = this;
|
253
|
+
|
254
|
+
// Default options
|
255
|
+
var defaults = {
|
256
|
+
group: Math.random(),
|
257
|
+
sort: true,
|
258
|
+
disabled: false,
|
259
|
+
store: null,
|
260
|
+
handle: null,
|
261
|
+
scroll: true,
|
262
|
+
scrollSensitivity: 30,
|
263
|
+
scrollSpeed: 10,
|
264
|
+
draggable: /[uo]l/i.test(el.nodeName) ? 'li' : '>*',
|
265
|
+
ghostClass: 'kvsortable-ghost',
|
266
|
+
chosenClass: 'kvsortable-chosen',
|
267
|
+
dragClass: 'kvsortable-drag',
|
268
|
+
ignore: 'a, img',
|
269
|
+
filter: null,
|
270
|
+
preventOnFilter: true,
|
271
|
+
animation: 0,
|
272
|
+
setData: function (dataTransfer, dragEl) {
|
273
|
+
dataTransfer.setData('Text', dragEl.textContent);
|
274
|
+
},
|
275
|
+
dropBubble: false,
|
276
|
+
dragoverBubble: false,
|
277
|
+
dataIdAttr: 'data-id',
|
278
|
+
delay: 0,
|
279
|
+
forceFallback: false,
|
280
|
+
fallbackClass: 'kvsortable-fallback',
|
281
|
+
fallbackOnBody: false,
|
282
|
+
fallbackTolerance: 0,
|
283
|
+
fallbackOffset: {x: 0, y: 0},
|
284
|
+
supportPointer: KvSortable.supportPointer !== false
|
285
|
+
};
|
286
|
+
|
287
|
+
|
288
|
+
// Set default options
|
289
|
+
for (var name in defaults) {
|
290
|
+
!(name in options) && (options[name] = defaults[name]);
|
291
|
+
}
|
292
|
+
|
293
|
+
_prepareGroup(options);
|
294
|
+
|
295
|
+
// Bind all private methods
|
296
|
+
for (var fn in this) {
|
297
|
+
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
298
|
+
this[fn] = this[fn].bind(this);
|
299
|
+
}
|
300
|
+
}
|
301
|
+
|
302
|
+
// Setup drag mode
|
303
|
+
this.nativeDraggable = options.forceFallback ? false : supportDraggable;
|
304
|
+
|
305
|
+
// Bind events
|
306
|
+
_on(el, 'mousedown', this._onTapStart);
|
307
|
+
_on(el, 'touchstart', this._onTapStart);
|
308
|
+
options.supportPointer && _on(el, 'pointerdown', this._onTapStart);
|
309
|
+
|
310
|
+
if (this.nativeDraggable) {
|
311
|
+
_on(el, 'dragover', this);
|
312
|
+
_on(el, 'dragenter', this);
|
313
|
+
}
|
314
|
+
|
315
|
+
touchDragOverListeners.push(this._onDragOver);
|
316
|
+
|
317
|
+
// Restore sorting
|
318
|
+
options.store && this.sort(options.store.get(this));
|
319
|
+
}
|
320
|
+
|
321
|
+
|
322
|
+
KvSortable.prototype = /** @lends KvSortable.prototype */ {
|
323
|
+
constructor: KvSortable,
|
324
|
+
|
325
|
+
_onTapStart: function (/** Event|TouchEvent */evt) {
|
326
|
+
var _this = this,
|
327
|
+
el = this.el,
|
328
|
+
options = this.options,
|
329
|
+
preventOnFilter = options.preventOnFilter,
|
330
|
+
type = evt.type,
|
331
|
+
touch = evt.touches && evt.touches[0],
|
332
|
+
target = (touch || evt).target,
|
333
|
+
originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0]) || target,
|
334
|
+
filter = options.filter,
|
335
|
+
startIndex;
|
336
|
+
|
337
|
+
_saveInputCheckedState(el);
|
338
|
+
|
339
|
+
|
340
|
+
// Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
|
341
|
+
if (dragEl) {
|
342
|
+
return;
|
343
|
+
}
|
344
|
+
|
345
|
+
if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
|
346
|
+
return; // only left button or enabled
|
347
|
+
}
|
348
|
+
|
349
|
+
// cancel dnd if original target is content editable
|
350
|
+
if (originalTarget.isContentEditable) {
|
351
|
+
return;
|
352
|
+
}
|
353
|
+
|
354
|
+
target = _closest(target, options.draggable, el);
|
355
|
+
|
356
|
+
if (!target) {
|
357
|
+
return;
|
358
|
+
}
|
359
|
+
|
360
|
+
if (lastDownEl === target) {
|
361
|
+
// Ignoring duplicate `down`
|
362
|
+
return;
|
363
|
+
}
|
364
|
+
|
365
|
+
// Get the index of the dragged element within its parent
|
366
|
+
startIndex = _index(target, options.draggable);
|
367
|
+
|
368
|
+
// Check filter
|
369
|
+
if (typeof filter === 'function') {
|
370
|
+
if (filter.call(this, evt, target, this)) {
|
371
|
+
_dispatchEvent(_this, originalTarget, 'filter', target, el, el, startIndex);
|
372
|
+
preventOnFilter && evt.preventDefault();
|
373
|
+
return; // cancel dnd
|
374
|
+
}
|
375
|
+
}
|
376
|
+
else if (filter) {
|
377
|
+
filter = filter.split(',').some(function (criteria) {
|
378
|
+
criteria = _closest(originalTarget, criteria.trim(), el);
|
379
|
+
|
380
|
+
if (criteria) {
|
381
|
+
_dispatchEvent(_this, criteria, 'filter', target, el, el, startIndex);
|
382
|
+
return true;
|
383
|
+
}
|
384
|
+
});
|
385
|
+
|
386
|
+
if (filter) {
|
387
|
+
preventOnFilter && evt.preventDefault();
|
388
|
+
return; // cancel dnd
|
389
|
+
}
|
390
|
+
}
|
391
|
+
|
392
|
+
if (options.handle && !_closest(originalTarget, options.handle, el)) {
|
393
|
+
return;
|
394
|
+
}
|
395
|
+
|
396
|
+
// Prepare `dragstart`
|
397
|
+
this._prepareDragStart(evt, touch, target, startIndex);
|
398
|
+
},
|
399
|
+
|
400
|
+
_prepareDragStart: function (/** Event */evt, /** Touch */touch, /** HTMLElement */target, /** Number */startIndex) {
|
401
|
+
var _this = this,
|
402
|
+
el = _this.el,
|
403
|
+
options = _this.options,
|
404
|
+
ownerDocument = el.ownerDocument,
|
405
|
+
dragStartFn;
|
406
|
+
|
407
|
+
if (target && !dragEl && (target.parentNode === el)) {
|
408
|
+
tapEvt = evt;
|
409
|
+
|
410
|
+
rootEl = el;
|
411
|
+
dragEl = target;
|
412
|
+
parentEl = dragEl.parentNode;
|
413
|
+
nextEl = dragEl.nextSibling;
|
414
|
+
lastDownEl = target;
|
415
|
+
activeGroup = options.group;
|
416
|
+
oldIndex = startIndex;
|
417
|
+
|
418
|
+
this._lastX = (touch || evt).clientX;
|
419
|
+
this._lastY = (touch || evt).clientY;
|
420
|
+
|
421
|
+
dragEl.style['will-change'] = 'all';
|
422
|
+
|
423
|
+
dragStartFn = function () {
|
424
|
+
// Delayed drag has been triggered
|
425
|
+
// we can re-enable the events: touchmove/mousemove
|
426
|
+
_this._disableDelayedDrag();
|
427
|
+
|
428
|
+
// Make the element draggable
|
429
|
+
dragEl.draggable = _this.nativeDraggable;
|
430
|
+
|
431
|
+
// Chosen item
|
432
|
+
_toggleClass(dragEl, options.chosenClass, true);
|
433
|
+
|
434
|
+
// Bind the events: dragstart/dragend
|
435
|
+
_this._triggerDragStart(evt, touch);
|
436
|
+
|
437
|
+
// Drag start event
|
438
|
+
_dispatchEvent(_this, rootEl, 'choose', dragEl, rootEl, rootEl, oldIndex);
|
439
|
+
};
|
440
|
+
|
441
|
+
// Disable "draggable"
|
442
|
+
options.ignore.split(',').forEach(function (criteria) {
|
443
|
+
_find(dragEl, criteria.trim(), _disableDraggable);
|
444
|
+
});
|
445
|
+
|
446
|
+
_on(ownerDocument, 'mouseup', _this._onDrop);
|
447
|
+
_on(ownerDocument, 'touchend', _this._onDrop);
|
448
|
+
_on(ownerDocument, 'touchcancel', _this._onDrop);
|
449
|
+
_on(ownerDocument, 'selectstart', _this);
|
450
|
+
options.supportPointer && _on(ownerDocument, 'pointercancel', _this._onDrop);
|
451
|
+
|
452
|
+
if (options.delay) {
|
453
|
+
// If the user moves the pointer or let go the click or touch
|
454
|
+
// before the delay has been reached:
|
455
|
+
// disable the delayed drag
|
456
|
+
_on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
|
457
|
+
_on(ownerDocument, 'touchend', _this._disableDelayedDrag);
|
458
|
+
_on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
|
459
|
+
_on(ownerDocument, 'mousemove', _this._disableDelayedDrag);
|
460
|
+
_on(ownerDocument, 'touchmove', _this._disableDelayedDrag);
|
461
|
+
options.supportPointer && _on(ownerDocument, 'pointermove', _this._disableDelayedDrag);
|
462
|
+
|
463
|
+
_this._dragStartTimer = setTimeout(dragStartFn, options.delay);
|
464
|
+
} else {
|
465
|
+
dragStartFn();
|
466
|
+
}
|
467
|
+
|
468
|
+
|
469
|
+
}
|
470
|
+
},
|
471
|
+
|
472
|
+
_disableDelayedDrag: function () {
|
473
|
+
var ownerDocument = this.el.ownerDocument;
|
474
|
+
|
475
|
+
clearTimeout(this._dragStartTimer);
|
476
|
+
_off(ownerDocument, 'mouseup', this._disableDelayedDrag);
|
477
|
+
_off(ownerDocument, 'touchend', this._disableDelayedDrag);
|
478
|
+
_off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
|
479
|
+
_off(ownerDocument, 'mousemove', this._disableDelayedDrag);
|
480
|
+
_off(ownerDocument, 'touchmove', this._disableDelayedDrag);
|
481
|
+
_off(ownerDocument, 'pointermove', this._disableDelayedDrag);
|
482
|
+
},
|
483
|
+
|
484
|
+
_triggerDragStart: function (/** Event */evt, /** Touch */touch) {
|
485
|
+
touch = touch || (evt.pointerType == 'touch' ? evt : null);
|
486
|
+
|
487
|
+
if (touch) {
|
488
|
+
// Touch device support
|
489
|
+
tapEvt = {
|
490
|
+
target: dragEl,
|
491
|
+
clientX: touch.clientX,
|
492
|
+
clientY: touch.clientY
|
493
|
+
};
|
494
|
+
|
495
|
+
this._onDragStart(tapEvt, 'touch');
|
496
|
+
}
|
497
|
+
else if (!this.nativeDraggable) {
|
498
|
+
this._onDragStart(tapEvt, true);
|
499
|
+
}
|
500
|
+
else {
|
501
|
+
_on(dragEl, 'dragend', this);
|
502
|
+
_on(rootEl, 'dragstart', this._onDragStart);
|
503
|
+
}
|
504
|
+
|
505
|
+
try {
|
506
|
+
if (document.selection) {
|
507
|
+
// Timeout neccessary for IE9
|
508
|
+
_nextTick(function () {
|
509
|
+
document.selection.empty();
|
510
|
+
});
|
511
|
+
} else {
|
512
|
+
window.getSelection().removeAllRanges();
|
513
|
+
}
|
514
|
+
} catch (err) {
|
515
|
+
}
|
516
|
+
},
|
517
|
+
|
518
|
+
_dragStarted: function () {
|
519
|
+
if (rootEl && dragEl) {
|
520
|
+
var options = this.options;
|
521
|
+
|
522
|
+
// Apply effect
|
523
|
+
_toggleClass(dragEl, options.ghostClass, true);
|
524
|
+
_toggleClass(dragEl, options.dragClass, false);
|
525
|
+
|
526
|
+
KvSortable.active = this;
|
527
|
+
|
528
|
+
// Drag start event
|
529
|
+
_dispatchEvent(this, rootEl, 'start', dragEl, rootEl, rootEl, oldIndex);
|
530
|
+
} else {
|
531
|
+
this._nulling();
|
532
|
+
}
|
533
|
+
},
|
534
|
+
|
535
|
+
_emulateDragOver: function () {
|
536
|
+
if (touchEvt) {
|
537
|
+
if (this._lastX === touchEvt.clientX && this._lastY === touchEvt.clientY) {
|
538
|
+
return;
|
539
|
+
}
|
540
|
+
|
541
|
+
this._lastX = touchEvt.clientX;
|
542
|
+
this._lastY = touchEvt.clientY;
|
543
|
+
|
544
|
+
if (!supportCssPointerEvents) {
|
545
|
+
_css(ghostEl, 'display', 'none');
|
546
|
+
}
|
547
|
+
|
548
|
+
var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
549
|
+
var parent = target;
|
550
|
+
var i = touchDragOverListeners.length;
|
551
|
+
|
552
|
+
if (target && target.shadowRoot) {
|
553
|
+
target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
554
|
+
parent = target;
|
555
|
+
}
|
556
|
+
|
557
|
+
if (parent) {
|
558
|
+
do {
|
559
|
+
if (parent[expando]) {
|
560
|
+
while (i--) {
|
561
|
+
touchDragOverListeners[i]({
|
562
|
+
clientX: touchEvt.clientX,
|
563
|
+
clientY: touchEvt.clientY,
|
564
|
+
target: target,
|
565
|
+
rootEl: parent
|
566
|
+
});
|
567
|
+
}
|
568
|
+
|
569
|
+
break;
|
570
|
+
}
|
571
|
+
|
572
|
+
target = parent; // store last element
|
573
|
+
}
|
574
|
+
/* jshint boss:true */
|
575
|
+
while (parent = parent.parentNode);
|
576
|
+
}
|
577
|
+
|
578
|
+
if (!supportCssPointerEvents) {
|
579
|
+
_css(ghostEl, 'display', '');
|
580
|
+
}
|
581
|
+
}
|
582
|
+
},
|
583
|
+
|
584
|
+
|
585
|
+
_onTouchMove: function (/**TouchEvent*/evt) {
|
586
|
+
if (tapEvt) {
|
587
|
+
var options = this.options,
|
588
|
+
fallbackTolerance = options.fallbackTolerance,
|
589
|
+
fallbackOffset = options.fallbackOffset,
|
590
|
+
touch = evt.touches ? evt.touches[0] : evt,
|
591
|
+
dx = (touch.clientX - tapEvt.clientX) + fallbackOffset.x,
|
592
|
+
dy = (touch.clientY - tapEvt.clientY) + fallbackOffset.y,
|
593
|
+
translate3d = evt.touches ? 'translate3d(' + dx + 'px,' + dy + 'px,0)' : 'translate(' + dx + 'px,' + dy + 'px)';
|
594
|
+
|
595
|
+
// only set the status to dragging, when we are actually dragging
|
596
|
+
if (!KvSortable.active) {
|
597
|
+
if (fallbackTolerance &&
|
598
|
+
min(abs(touch.clientX - this._lastX), abs(touch.clientY - this._lastY)) < fallbackTolerance
|
599
|
+
) {
|
600
|
+
return;
|
601
|
+
}
|
602
|
+
|
603
|
+
this._dragStarted();
|
604
|
+
}
|
605
|
+
|
606
|
+
// as well as creating the ghost element on the document body
|
607
|
+
this._appendGhost();
|
608
|
+
|
609
|
+
moved = true;
|
610
|
+
touchEvt = touch;
|
611
|
+
|
612
|
+
_css(ghostEl, 'webkitTransform', translate3d);
|
613
|
+
_css(ghostEl, 'mozTransform', translate3d);
|
614
|
+
_css(ghostEl, 'msTransform', translate3d);
|
615
|
+
_css(ghostEl, 'transform', translate3d);
|
616
|
+
|
617
|
+
evt.preventDefault();
|
618
|
+
}
|
619
|
+
},
|
620
|
+
|
621
|
+
_appendGhost: function () {
|
622
|
+
if (!ghostEl) {
|
623
|
+
var rect = dragEl.getBoundingClientRect(),
|
624
|
+
css = _css(dragEl),
|
625
|
+
options = this.options,
|
626
|
+
ghostRect;
|
627
|
+
|
628
|
+
ghostEl = dragEl.cloneNode(true);
|
629
|
+
|
630
|
+
_toggleClass(ghostEl, options.ghostClass, false);
|
631
|
+
_toggleClass(ghostEl, options.fallbackClass, true);
|
632
|
+
_toggleClass(ghostEl, options.dragClass, true);
|
633
|
+
|
634
|
+
_css(ghostEl, 'top', rect.top - parseInt(css.marginTop, 10));
|
635
|
+
_css(ghostEl, 'left', rect.left - parseInt(css.marginLeft, 10));
|
636
|
+
_css(ghostEl, 'width', rect.width);
|
637
|
+
_css(ghostEl, 'height', rect.height);
|
638
|
+
_css(ghostEl, 'opacity', '0.8');
|
639
|
+
_css(ghostEl, 'position', 'fixed');
|
640
|
+
_css(ghostEl, 'zIndex', '100000');
|
641
|
+
_css(ghostEl, 'pointerEvents', 'none');
|
642
|
+
|
643
|
+
options.fallbackOnBody && document.body.appendChild(ghostEl) || rootEl.appendChild(ghostEl);
|
644
|
+
|
645
|
+
// Fixing dimensions.
|
646
|
+
ghostRect = ghostEl.getBoundingClientRect();
|
647
|
+
_css(ghostEl, 'width', rect.width * 2 - ghostRect.width);
|
648
|
+
_css(ghostEl, 'height', rect.height * 2 - ghostRect.height);
|
649
|
+
}
|
650
|
+
},
|
651
|
+
|
652
|
+
_onDragStart: function (/**Event*/evt, /**boolean*/useFallback) {
|
653
|
+
var _this = this;
|
654
|
+
var dataTransfer = evt.dataTransfer;
|
655
|
+
var options = _this.options;
|
656
|
+
|
657
|
+
_this._offUpEvents();
|
658
|
+
|
659
|
+
if (activeGroup.checkPull(_this, _this, dragEl, evt)) {
|
660
|
+
cloneEl = _clone(dragEl);
|
661
|
+
|
662
|
+
cloneEl.draggable = false;
|
663
|
+
cloneEl.style['will-change'] = '';
|
664
|
+
|
665
|
+
_css(cloneEl, 'display', 'none');
|
666
|
+
_toggleClass(cloneEl, _this.options.chosenClass, false);
|
667
|
+
|
668
|
+
// #1143: IFrame support workaround
|
669
|
+
_this._cloneId = _nextTick(function () {
|
670
|
+
rootEl.insertBefore(cloneEl, dragEl);
|
671
|
+
_dispatchEvent(_this, rootEl, 'clone', dragEl);
|
672
|
+
});
|
673
|
+
}
|
674
|
+
|
675
|
+
_toggleClass(dragEl, options.dragClass, true);
|
676
|
+
|
677
|
+
if (useFallback) {
|
678
|
+
if (useFallback === 'touch') {
|
679
|
+
// Bind touch events
|
680
|
+
_on(document, 'touchmove', _this._onTouchMove);
|
681
|
+
_on(document, 'touchend', _this._onDrop);
|
682
|
+
_on(document, 'touchcancel', _this._onDrop);
|
683
|
+
|
684
|
+
if (options.supportPointer) {
|
685
|
+
_on(document, 'pointermove', _this._onTouchMove);
|
686
|
+
_on(document, 'pointerup', _this._onDrop);
|
687
|
+
}
|
688
|
+
} else {
|
689
|
+
// Old brwoser
|
690
|
+
_on(document, 'mousemove', _this._onTouchMove);
|
691
|
+
_on(document, 'mouseup', _this._onDrop);
|
692
|
+
}
|
693
|
+
|
694
|
+
_this._loopId = setInterval(_this._emulateDragOver, 50);
|
695
|
+
}
|
696
|
+
else {
|
697
|
+
if (dataTransfer) {
|
698
|
+
dataTransfer.effectAllowed = 'move';
|
699
|
+
options.setData && options.setData.call(_this, dataTransfer, dragEl);
|
700
|
+
}
|
701
|
+
|
702
|
+
_on(document, 'drop', _this);
|
703
|
+
|
704
|
+
// #1143: Бывает элемент с IFrame внутри блокирует `drop`,
|
705
|
+
// поэтому если вызвался `mouseover`, значит надо отменять весь d'n'd.
|
706
|
+
// Breaking Chrome 62+
|
707
|
+
// _on(document, 'mouseover', _this);
|
708
|
+
|
709
|
+
_this._dragStartId = _nextTick(_this._dragStarted);
|
710
|
+
}
|
711
|
+
},
|
712
|
+
|
713
|
+
_onDragOver: function (/**Event*/evt) {
|
714
|
+
var el = this.el,
|
715
|
+
target,
|
716
|
+
dragRect,
|
717
|
+
targetRect,
|
718
|
+
revert,
|
719
|
+
options = this.options,
|
720
|
+
group = options.group,
|
721
|
+
activeKvSortable = KvSortable.active,
|
722
|
+
isOwner = (activeGroup === group),
|
723
|
+
isMovingBetweenKvSortable = false,
|
724
|
+
canSort = options.sort;
|
725
|
+
|
726
|
+
if (evt.preventDefault !== void 0) {
|
727
|
+
evt.preventDefault();
|
728
|
+
!options.dragoverBubble && evt.stopPropagation();
|
729
|
+
}
|
730
|
+
|
731
|
+
if (dragEl.animated) {
|
732
|
+
return;
|
733
|
+
}
|
734
|
+
|
735
|
+
moved = true;
|
736
|
+
|
737
|
+
if (activeKvSortable && !options.disabled &&
|
738
|
+
(isOwner
|
739
|
+
? canSort || (revert = !rootEl.contains(dragEl)) // Reverting item into the original list
|
740
|
+
: (
|
741
|
+
putKvSortable === this ||
|
742
|
+
(
|
743
|
+
(activeKvSortable.lastPullMode = activeGroup.checkPull(this, activeKvSortable, dragEl, evt)) &&
|
744
|
+
group.checkPut(this, activeKvSortable, dragEl, evt)
|
745
|
+
)
|
746
|
+
)
|
747
|
+
) &&
|
748
|
+
(evt.rootEl === void 0 || evt.rootEl === this.el) // touch fallback
|
749
|
+
) {
|
750
|
+
// Smart auto-scrolling
|
751
|
+
_autoScroll(evt, options, this.el);
|
752
|
+
|
753
|
+
if (_silent) {
|
754
|
+
return;
|
755
|
+
}
|
756
|
+
|
757
|
+
target = _closest(evt.target, options.draggable, el);
|
758
|
+
dragRect = dragEl.getBoundingClientRect();
|
759
|
+
|
760
|
+
if (putKvSortable !== this) {
|
761
|
+
putKvSortable = this;
|
762
|
+
isMovingBetweenKvSortable = true;
|
763
|
+
}
|
764
|
+
|
765
|
+
if (revert) {
|
766
|
+
_cloneHide(activeKvSortable, true);
|
767
|
+
parentEl = rootEl; // actualization
|
768
|
+
|
769
|
+
if (cloneEl || nextEl) {
|
770
|
+
rootEl.insertBefore(dragEl, cloneEl || nextEl);
|
771
|
+
}
|
772
|
+
else if (!canSort) {
|
773
|
+
rootEl.appendChild(dragEl);
|
774
|
+
}
|
775
|
+
|
776
|
+
return;
|
777
|
+
}
|
778
|
+
|
779
|
+
|
780
|
+
if ((el.children.length === 0) || (el.children[0] === ghostEl) ||
|
781
|
+
(el === evt.target) && (_ghostIsLast(el, evt))
|
782
|
+
) {
|
783
|
+
//assign target only if condition is true
|
784
|
+
if (el.children.length !== 0 && el.children[0] !== ghostEl && el === evt.target) {
|
785
|
+
target = el.lastElementChild;
|
786
|
+
}
|
787
|
+
|
788
|
+
if (target) {
|
789
|
+
if (target.animated) {
|
790
|
+
return;
|
791
|
+
}
|
792
|
+
|
793
|
+
targetRect = target.getBoundingClientRect();
|
794
|
+
}
|
795
|
+
|
796
|
+
_cloneHide(activeKvSortable, isOwner);
|
797
|
+
|
798
|
+
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt) !== false) {
|
799
|
+
if (!dragEl.contains(el)) {
|
800
|
+
el.appendChild(dragEl);
|
801
|
+
parentEl = el; // actualization
|
802
|
+
}
|
803
|
+
|
804
|
+
this._animate(dragRect, dragEl);
|
805
|
+
target && this._animate(targetRect, target);
|
806
|
+
}
|
807
|
+
}
|
808
|
+
else if (target && !target.animated && target !== dragEl && (target.parentNode[expando] !== void 0)) {
|
809
|
+
if (lastEl !== target) {
|
810
|
+
lastEl = target;
|
811
|
+
lastCSS = _css(target);
|
812
|
+
lastParentCSS = _css(target.parentNode);
|
813
|
+
}
|
814
|
+
|
815
|
+
targetRect = target.getBoundingClientRect();
|
816
|
+
|
817
|
+
var width = targetRect.right - targetRect.left,
|
818
|
+
height = targetRect.bottom - targetRect.top,
|
819
|
+
floating = R_FLOAT.test(lastCSS.cssFloat + lastCSS.display)
|
820
|
+
|| (lastParentCSS.display == 'flex' && lastParentCSS['flex-direction'].indexOf('row') === 0),
|
821
|
+
isWide = (target.offsetWidth > dragEl.offsetWidth),
|
822
|
+
isLong = (target.offsetHeight > dragEl.offsetHeight),
|
823
|
+
halfway = (floating ? (evt.clientX - targetRect.left) / width : (evt.clientY - targetRect.top) / height) > 0.5,
|
824
|
+
nextSibling = target.nextElementSibling,
|
825
|
+
after = false
|
826
|
+
;
|
827
|
+
|
828
|
+
if (floating) {
|
829
|
+
var elTop = dragEl.offsetTop,
|
830
|
+
tgTop = target.offsetTop;
|
831
|
+
|
832
|
+
if (elTop === tgTop) {
|
833
|
+
after = (target.previousElementSibling === dragEl) && !isWide || halfway && isWide;
|
834
|
+
}
|
835
|
+
else if (target.previousElementSibling === dragEl || dragEl.previousElementSibling === target) {
|
836
|
+
after = (evt.clientY - targetRect.top) / height > 0.5;
|
837
|
+
} else {
|
838
|
+
after = tgTop > elTop;
|
839
|
+
}
|
840
|
+
} else if (!isMovingBetweenKvSortable) {
|
841
|
+
after = (nextSibling !== dragEl) && !isLong || halfway && isLong;
|
842
|
+
}
|
843
|
+
|
844
|
+
var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
|
845
|
+
|
846
|
+
if (moveVector !== false) {
|
847
|
+
if (moveVector === 1 || moveVector === -1) {
|
848
|
+
after = (moveVector === 1);
|
849
|
+
}
|
850
|
+
|
851
|
+
_silent = true;
|
852
|
+
setTimeout(_unsilent, 30);
|
853
|
+
|
854
|
+
_cloneHide(activeKvSortable, isOwner);
|
855
|
+
|
856
|
+
if (!dragEl.contains(el)) {
|
857
|
+
if (after && !nextSibling) {
|
858
|
+
el.appendChild(dragEl);
|
859
|
+
} else {
|
860
|
+
target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
|
861
|
+
}
|
862
|
+
}
|
863
|
+
|
864
|
+
parentEl = dragEl.parentNode; // actualization
|
865
|
+
|
866
|
+
this._animate(dragRect, dragEl);
|
867
|
+
this._animate(targetRect, target);
|
868
|
+
}
|
869
|
+
}
|
870
|
+
}
|
871
|
+
},
|
872
|
+
|
873
|
+
_animate: function (prevRect, target) {
|
874
|
+
var ms = this.options.animation;
|
875
|
+
|
876
|
+
if (ms) {
|
877
|
+
var currentRect = target.getBoundingClientRect();
|
878
|
+
|
879
|
+
if (prevRect.nodeType === 1) {
|
880
|
+
prevRect = prevRect.getBoundingClientRect();
|
881
|
+
}
|
882
|
+
|
883
|
+
_css(target, 'transition', 'none');
|
884
|
+
_css(target, 'transform', 'translate3d('
|
885
|
+
+ (prevRect.left - currentRect.left) + 'px,'
|
886
|
+
+ (prevRect.top - currentRect.top) + 'px,0)'
|
887
|
+
);
|
888
|
+
|
889
|
+
target.offsetWidth; // repaint
|
890
|
+
|
891
|
+
_css(target, 'transition', 'all ' + ms + 'ms');
|
892
|
+
_css(target, 'transform', 'translate3d(0,0,0)');
|
893
|
+
|
894
|
+
clearTimeout(target.animated);
|
895
|
+
target.animated = setTimeout(function () {
|
896
|
+
_css(target, 'transition', '');
|
897
|
+
_css(target, 'transform', '');
|
898
|
+
target.animated = false;
|
899
|
+
}, ms);
|
900
|
+
}
|
901
|
+
},
|
902
|
+
|
903
|
+
_offUpEvents: function () {
|
904
|
+
var ownerDocument = this.el.ownerDocument;
|
905
|
+
|
906
|
+
_off(document, 'touchmove', this._onTouchMove);
|
907
|
+
_off(document, 'pointermove', this._onTouchMove);
|
908
|
+
_off(ownerDocument, 'mouseup', this._onDrop);
|
909
|
+
_off(ownerDocument, 'touchend', this._onDrop);
|
910
|
+
_off(ownerDocument, 'pointerup', this._onDrop);
|
911
|
+
_off(ownerDocument, 'touchcancel', this._onDrop);
|
912
|
+
_off(ownerDocument, 'pointercancel', this._onDrop);
|
913
|
+
_off(ownerDocument, 'selectstart', this);
|
914
|
+
},
|
915
|
+
|
916
|
+
_onDrop: function (/**Event*/evt) {
|
917
|
+
var el = this.el,
|
918
|
+
options = this.options;
|
919
|
+
|
920
|
+
clearInterval(this._loopId);
|
921
|
+
clearInterval(autoScroll.pid);
|
922
|
+
clearTimeout(this._dragStartTimer);
|
923
|
+
|
924
|
+
_cancelNextTick(this._cloneId);
|
925
|
+
_cancelNextTick(this._dragStartId);
|
926
|
+
|
927
|
+
// Unbind events
|
928
|
+
_off(document, 'mouseover', this);
|
929
|
+
_off(document, 'mousemove', this._onTouchMove);
|
930
|
+
|
931
|
+
if (this.nativeDraggable) {
|
932
|
+
_off(document, 'drop', this);
|
933
|
+
_off(el, 'dragstart', this._onDragStart);
|
934
|
+
}
|
935
|
+
|
936
|
+
this._offUpEvents();
|
937
|
+
|
938
|
+
if (evt) {
|
939
|
+
if (moved) {
|
940
|
+
evt.preventDefault();
|
941
|
+
!options.dropBubble && evt.stopPropagation();
|
942
|
+
}
|
943
|
+
|
944
|
+
ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
|
945
|
+
|
946
|
+
if (rootEl === parentEl || KvSortable.active.lastPullMode !== 'clone') {
|
947
|
+
// Remove clone
|
948
|
+
cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
|
949
|
+
}
|
950
|
+
|
951
|
+
if (dragEl) {
|
952
|
+
if (this.nativeDraggable) {
|
953
|
+
_off(dragEl, 'dragend', this);
|
954
|
+
}
|
955
|
+
|
956
|
+
_disableDraggable(dragEl);
|
957
|
+
dragEl.style['will-change'] = '';
|
958
|
+
|
959
|
+
// Remove class's
|
960
|
+
_toggleClass(dragEl, this.options.ghostClass, false);
|
961
|
+
_toggleClass(dragEl, this.options.chosenClass, false);
|
962
|
+
|
963
|
+
// Drag stop event
|
964
|
+
_dispatchEvent(this, rootEl, 'unchoose', dragEl, parentEl, rootEl, oldIndex);
|
965
|
+
|
966
|
+
if (rootEl !== parentEl) {
|
967
|
+
newIndex = _index(dragEl, options.draggable);
|
968
|
+
|
969
|
+
if (newIndex >= 0) {
|
970
|
+
// Add event
|
971
|
+
_dispatchEvent(null, parentEl, 'add', dragEl, parentEl, rootEl, oldIndex, newIndex);
|
972
|
+
|
973
|
+
// Remove event
|
974
|
+
_dispatchEvent(this, rootEl, 'remove', dragEl, parentEl, rootEl, oldIndex, newIndex);
|
975
|
+
|
976
|
+
// drag from one list and drop into another
|
977
|
+
_dispatchEvent(null, parentEl, 'sort', dragEl, parentEl, rootEl, oldIndex, newIndex);
|
978
|
+
_dispatchEvent(this, rootEl, 'sort', dragEl, parentEl, rootEl, oldIndex, newIndex);
|
979
|
+
}
|
980
|
+
}
|
981
|
+
else {
|
982
|
+
if (dragEl.nextSibling !== nextEl) {
|
983
|
+
// Get the index of the dragged element within its parent
|
984
|
+
newIndex = _index(dragEl, options.draggable);
|
985
|
+
|
986
|
+
if (newIndex >= 0) {
|
987
|
+
// drag & drop within the same list
|
988
|
+
_dispatchEvent(this, rootEl, 'update', dragEl, parentEl, rootEl, oldIndex, newIndex);
|
989
|
+
_dispatchEvent(this, rootEl, 'sort', dragEl, parentEl, rootEl, oldIndex, newIndex);
|
990
|
+
}
|
991
|
+
}
|
992
|
+
}
|
993
|
+
|
994
|
+
if (KvSortable.active) {
|
995
|
+
/* jshint eqnull:true */
|
996
|
+
if (newIndex == null || newIndex === -1) {
|
997
|
+
newIndex = oldIndex;
|
998
|
+
}
|
999
|
+
|
1000
|
+
_dispatchEvent(this, rootEl, 'end', dragEl, parentEl, rootEl, oldIndex, newIndex);
|
1001
|
+
|
1002
|
+
// Save sorting
|
1003
|
+
this.save();
|
1004
|
+
}
|
1005
|
+
}
|
1006
|
+
|
1007
|
+
}
|
1008
|
+
|
1009
|
+
this._nulling();
|
1010
|
+
},
|
1011
|
+
|
1012
|
+
_nulling: function() {
|
1013
|
+
rootEl =
|
1014
|
+
dragEl =
|
1015
|
+
parentEl =
|
1016
|
+
ghostEl =
|
1017
|
+
nextEl =
|
1018
|
+
cloneEl =
|
1019
|
+
lastDownEl =
|
1020
|
+
|
1021
|
+
scrollEl =
|
1022
|
+
scrollParentEl =
|
1023
|
+
|
1024
|
+
tapEvt =
|
1025
|
+
touchEvt =
|
1026
|
+
|
1027
|
+
moved =
|
1028
|
+
newIndex =
|
1029
|
+
|
1030
|
+
lastEl =
|
1031
|
+
lastCSS =
|
1032
|
+
|
1033
|
+
putKvSortable =
|
1034
|
+
activeGroup =
|
1035
|
+
KvSortable.active = null;
|
1036
|
+
|
1037
|
+
savedInputChecked.forEach(function (el) {
|
1038
|
+
el.checked = true;
|
1039
|
+
});
|
1040
|
+
savedInputChecked.length = 0;
|
1041
|
+
},
|
1042
|
+
|
1043
|
+
handleEvent: function (/**Event*/evt) {
|
1044
|
+
switch (evt.type) {
|
1045
|
+
case 'drop':
|
1046
|
+
case 'dragend':
|
1047
|
+
this._onDrop(evt);
|
1048
|
+
break;
|
1049
|
+
|
1050
|
+
case 'dragover':
|
1051
|
+
case 'dragenter':
|
1052
|
+
if (dragEl) {
|
1053
|
+
this._onDragOver(evt);
|
1054
|
+
_globalDragOver(evt);
|
1055
|
+
}
|
1056
|
+
break;
|
1057
|
+
|
1058
|
+
case 'mouseover':
|
1059
|
+
this._onDrop(evt);
|
1060
|
+
break;
|
1061
|
+
|
1062
|
+
case 'selectstart':
|
1063
|
+
evt.preventDefault();
|
1064
|
+
break;
|
1065
|
+
}
|
1066
|
+
},
|
1067
|
+
|
1068
|
+
|
1069
|
+
/**
|
1070
|
+
* Serializes the item into an array of string.
|
1071
|
+
* @returns {String[]}
|
1072
|
+
*/
|
1073
|
+
toArray: function () {
|
1074
|
+
var order = [],
|
1075
|
+
el,
|
1076
|
+
children = this.el.children,
|
1077
|
+
i = 0,
|
1078
|
+
n = children.length,
|
1079
|
+
options = this.options;
|
1080
|
+
|
1081
|
+
for (; i < n; i++) {
|
1082
|
+
el = children[i];
|
1083
|
+
if (_closest(el, options.draggable, this.el)) {
|
1084
|
+
order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
|
1085
|
+
}
|
1086
|
+
}
|
1087
|
+
|
1088
|
+
return order;
|
1089
|
+
},
|
1090
|
+
|
1091
|
+
|
1092
|
+
/**
|
1093
|
+
* Sorts the elements according to the array.
|
1094
|
+
* @param {String[]} order order of the items
|
1095
|
+
*/
|
1096
|
+
sort: function (order) {
|
1097
|
+
var items = {}, rootEl = this.el;
|
1098
|
+
|
1099
|
+
this.toArray().forEach(function (id, i) {
|
1100
|
+
var el = rootEl.children[i];
|
1101
|
+
|
1102
|
+
if (_closest(el, this.options.draggable, rootEl)) {
|
1103
|
+
items[id] = el;
|
1104
|
+
}
|
1105
|
+
}, this);
|
1106
|
+
|
1107
|
+
order.forEach(function (id) {
|
1108
|
+
if (items[id]) {
|
1109
|
+
rootEl.removeChild(items[id]);
|
1110
|
+
rootEl.appendChild(items[id]);
|
1111
|
+
}
|
1112
|
+
});
|
1113
|
+
},
|
1114
|
+
|
1115
|
+
|
1116
|
+
/**
|
1117
|
+
* Save the current sorting
|
1118
|
+
*/
|
1119
|
+
save: function () {
|
1120
|
+
var store = this.options.store;
|
1121
|
+
store && store.set(this);
|
1122
|
+
},
|
1123
|
+
|
1124
|
+
|
1125
|
+
/**
|
1126
|
+
* For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
|
1127
|
+
* @param {HTMLElement} el
|
1128
|
+
* @param {String} [selector] default: `options.draggable`
|
1129
|
+
* @returns {HTMLElement|null}
|
1130
|
+
*/
|
1131
|
+
closest: function (el, selector) {
|
1132
|
+
return _closest(el, selector || this.options.draggable, this.el);
|
1133
|
+
},
|
1134
|
+
|
1135
|
+
|
1136
|
+
/**
|
1137
|
+
* Set/get option
|
1138
|
+
* @param {string} name
|
1139
|
+
* @param {*} [value]
|
1140
|
+
* @returns {*}
|
1141
|
+
*/
|
1142
|
+
option: function (name, value) {
|
1143
|
+
var options = this.options;
|
1144
|
+
|
1145
|
+
if (value === void 0) {
|
1146
|
+
return options[name];
|
1147
|
+
} else {
|
1148
|
+
options[name] = value;
|
1149
|
+
|
1150
|
+
if (name === 'group') {
|
1151
|
+
_prepareGroup(options);
|
1152
|
+
}
|
1153
|
+
}
|
1154
|
+
},
|
1155
|
+
|
1156
|
+
|
1157
|
+
/**
|
1158
|
+
* Destroy
|
1159
|
+
*/
|
1160
|
+
destroy: function () {
|
1161
|
+
var el = this.el;
|
1162
|
+
|
1163
|
+
el[expando] = null;
|
1164
|
+
|
1165
|
+
_off(el, 'mousedown', this._onTapStart);
|
1166
|
+
_off(el, 'touchstart', this._onTapStart);
|
1167
|
+
_off(el, 'pointerdown', this._onTapStart);
|
1168
|
+
|
1169
|
+
if (this.nativeDraggable) {
|
1170
|
+
_off(el, 'dragover', this);
|
1171
|
+
_off(el, 'dragenter', this);
|
1172
|
+
}
|
1173
|
+
|
1174
|
+
// Remove draggable attributes
|
1175
|
+
Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
|
1176
|
+
el.removeAttribute('draggable');
|
1177
|
+
});
|
1178
|
+
|
1179
|
+
touchDragOverListeners.splice(touchDragOverListeners.indexOf(this._onDragOver), 1);
|
1180
|
+
|
1181
|
+
this._onDrop();
|
1182
|
+
|
1183
|
+
this.el = el = null;
|
1184
|
+
}
|
1185
|
+
};
|
1186
|
+
|
1187
|
+
|
1188
|
+
function _cloneHide(kvsortable, state) {
|
1189
|
+
if (kvsortable.lastPullMode !== 'clone') {
|
1190
|
+
state = true;
|
1191
|
+
}
|
1192
|
+
|
1193
|
+
if (cloneEl && (cloneEl.state !== state)) {
|
1194
|
+
_css(cloneEl, 'display', state ? 'none' : '');
|
1195
|
+
|
1196
|
+
if (!state) {
|
1197
|
+
if (cloneEl.state) {
|
1198
|
+
if (kvsortable.options.group.revertClone) {
|
1199
|
+
rootEl.insertBefore(cloneEl, nextEl);
|
1200
|
+
kvsortable._animate(dragEl, cloneEl);
|
1201
|
+
} else {
|
1202
|
+
rootEl.insertBefore(cloneEl, dragEl);
|
1203
|
+
}
|
1204
|
+
}
|
1205
|
+
}
|
1206
|
+
|
1207
|
+
cloneEl.state = state;
|
1208
|
+
}
|
1209
|
+
}
|
1210
|
+
|
1211
|
+
|
1212
|
+
function _closest(/**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx) {
|
1213
|
+
if (el) {
|
1214
|
+
ctx = ctx || document;
|
1215
|
+
|
1216
|
+
do {
|
1217
|
+
if ((selector === '>*' && el.parentNode === ctx) || _matches(el, selector)) {
|
1218
|
+
return el;
|
1219
|
+
}
|
1220
|
+
/* jshint boss:true */
|
1221
|
+
} while (el = _getParentOrHost(el));
|
1222
|
+
}
|
1223
|
+
|
1224
|
+
return null;
|
1225
|
+
}
|
1226
|
+
|
1227
|
+
|
1228
|
+
function _getParentOrHost(el) {
|
1229
|
+
var parent = el.host;
|
1230
|
+
|
1231
|
+
return (parent && parent.nodeType) ? parent : el.parentNode;
|
1232
|
+
}
|
1233
|
+
|
1234
|
+
|
1235
|
+
function _globalDragOver(/**Event*/evt) {
|
1236
|
+
if (evt.dataTransfer) {
|
1237
|
+
evt.dataTransfer.dropEffect = 'move';
|
1238
|
+
}
|
1239
|
+
evt.preventDefault();
|
1240
|
+
}
|
1241
|
+
|
1242
|
+
|
1243
|
+
function _on(el, event, fn) {
|
1244
|
+
el.addEventListener(event, fn, captureMode);
|
1245
|
+
}
|
1246
|
+
|
1247
|
+
|
1248
|
+
function _off(el, event, fn) {
|
1249
|
+
el.removeEventListener(event, fn, captureMode);
|
1250
|
+
}
|
1251
|
+
|
1252
|
+
|
1253
|
+
function _toggleClass(el, name, state) {
|
1254
|
+
if (el) {
|
1255
|
+
if (el.classList) {
|
1256
|
+
el.classList[state ? 'add' : 'remove'](name);
|
1257
|
+
}
|
1258
|
+
else {
|
1259
|
+
var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
|
1260
|
+
el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
|
1261
|
+
}
|
1262
|
+
}
|
1263
|
+
}
|
1264
|
+
|
1265
|
+
|
1266
|
+
function _css(el, prop, val) {
|
1267
|
+
var style = el && el.style;
|
1268
|
+
|
1269
|
+
if (style) {
|
1270
|
+
if (val === void 0) {
|
1271
|
+
if (document.defaultView && document.defaultView.getComputedStyle) {
|
1272
|
+
val = document.defaultView.getComputedStyle(el, '');
|
1273
|
+
}
|
1274
|
+
else if (el.currentStyle) {
|
1275
|
+
val = el.currentStyle;
|
1276
|
+
}
|
1277
|
+
|
1278
|
+
return prop === void 0 ? val : val[prop];
|
1279
|
+
}
|
1280
|
+
else {
|
1281
|
+
if (!(prop in style)) {
|
1282
|
+
prop = '-webkit-' + prop;
|
1283
|
+
}
|
1284
|
+
|
1285
|
+
style[prop] = val + (typeof val === 'string' ? '' : 'px');
|
1286
|
+
}
|
1287
|
+
}
|
1288
|
+
}
|
1289
|
+
|
1290
|
+
|
1291
|
+
function _find(ctx, tagName, iterator) {
|
1292
|
+
if (ctx) {
|
1293
|
+
var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length;
|
1294
|
+
|
1295
|
+
if (iterator) {
|
1296
|
+
for (; i < n; i++) {
|
1297
|
+
iterator(list[i], i);
|
1298
|
+
}
|
1299
|
+
}
|
1300
|
+
|
1301
|
+
return list;
|
1302
|
+
}
|
1303
|
+
|
1304
|
+
return [];
|
1305
|
+
}
|
1306
|
+
|
1307
|
+
|
1308
|
+
|
1309
|
+
function _dispatchEvent(kvsortable, rootEl, name, targetEl, toEl, fromEl, startIndex, newIndex) {
|
1310
|
+
kvsortable = (kvsortable || rootEl[expando]);
|
1311
|
+
|
1312
|
+
var evt = document.createEvent('Event'),
|
1313
|
+
options = kvsortable.options,
|
1314
|
+
onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
|
1315
|
+
|
1316
|
+
evt.initEvent(name, true, true);
|
1317
|
+
|
1318
|
+
evt.to = toEl || rootEl;
|
1319
|
+
evt.from = fromEl || rootEl;
|
1320
|
+
evt.item = targetEl || rootEl;
|
1321
|
+
evt.clone = cloneEl;
|
1322
|
+
|
1323
|
+
evt.oldIndex = startIndex;
|
1324
|
+
evt.newIndex = newIndex;
|
1325
|
+
|
1326
|
+
rootEl.dispatchEvent(evt);
|
1327
|
+
|
1328
|
+
if (options[onName]) {
|
1329
|
+
options[onName].call(kvsortable, evt);
|
1330
|
+
}
|
1331
|
+
}
|
1332
|
+
|
1333
|
+
|
1334
|
+
function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvt, willInsertAfter) {
|
1335
|
+
var evt,
|
1336
|
+
kvsortable = fromEl[expando],
|
1337
|
+
onMoveFn = kvsortable.options.onMove,
|
1338
|
+
retVal;
|
1339
|
+
|
1340
|
+
evt = document.createEvent('Event');
|
1341
|
+
evt.initEvent('move', true, true);
|
1342
|
+
|
1343
|
+
evt.to = toEl;
|
1344
|
+
evt.from = fromEl;
|
1345
|
+
evt.dragged = dragEl;
|
1346
|
+
evt.draggedRect = dragRect;
|
1347
|
+
evt.related = targetEl || toEl;
|
1348
|
+
evt.relatedRect = targetRect || toEl.getBoundingClientRect();
|
1349
|
+
evt.willInsertAfter = willInsertAfter;
|
1350
|
+
|
1351
|
+
fromEl.dispatchEvent(evt);
|
1352
|
+
|
1353
|
+
if (onMoveFn) {
|
1354
|
+
retVal = onMoveFn.call(kvsortable, evt, originalEvt);
|
1355
|
+
}
|
1356
|
+
|
1357
|
+
return retVal;
|
1358
|
+
}
|
1359
|
+
|
1360
|
+
|
1361
|
+
function _disableDraggable(el) {
|
1362
|
+
el.draggable = false;
|
1363
|
+
}
|
1364
|
+
|
1365
|
+
|
1366
|
+
function _unsilent() {
|
1367
|
+
_silent = false;
|
1368
|
+
}
|
1369
|
+
|
1370
|
+
|
1371
|
+
/** @returns {HTMLElement|false} */
|
1372
|
+
function _ghostIsLast(el, evt) {
|
1373
|
+
var lastEl = el.lastElementChild,
|
1374
|
+
rect = lastEl.getBoundingClientRect();
|
1375
|
+
|
1376
|
+
// 5 — min delta
|
1377
|
+
// abs — нельзя добавлять, а то глюки при наведении сверху
|
1378
|
+
return (evt.clientY - (rect.top + rect.height) > 5) ||
|
1379
|
+
(evt.clientX - (rect.left + rect.width) > 5);
|
1380
|
+
}
|
1381
|
+
|
1382
|
+
|
1383
|
+
/**
|
1384
|
+
* Generate id
|
1385
|
+
* @param {HTMLElement} el
|
1386
|
+
* @returns {String}
|
1387
|
+
* @private
|
1388
|
+
*/
|
1389
|
+
function _generateId(el) {
|
1390
|
+
var str = el.tagName + el.className + el.src + el.href + el.textContent,
|
1391
|
+
i = str.length,
|
1392
|
+
sum = 0;
|
1393
|
+
|
1394
|
+
while (i--) {
|
1395
|
+
sum += str.charCodeAt(i);
|
1396
|
+
}
|
1397
|
+
|
1398
|
+
return sum.toString(36);
|
1399
|
+
}
|
1400
|
+
|
1401
|
+
/**
|
1402
|
+
* Returns the index of an element within its parent for a selected set of
|
1403
|
+
* elements
|
1404
|
+
* @param {HTMLElement} el
|
1405
|
+
* @param {selector} selector
|
1406
|
+
* @return {number}
|
1407
|
+
*/
|
1408
|
+
function _index(el, selector) {
|
1409
|
+
var index = 0;
|
1410
|
+
|
1411
|
+
if (!el || !el.parentNode) {
|
1412
|
+
return -1;
|
1413
|
+
}
|
1414
|
+
|
1415
|
+
while (el && (el = el.previousElementSibling)) {
|
1416
|
+
if ((el.nodeName.toUpperCase() !== 'TEMPLATE') && (selector === '>*' || _matches(el, selector))) {
|
1417
|
+
index++;
|
1418
|
+
}
|
1419
|
+
}
|
1420
|
+
|
1421
|
+
return index;
|
1422
|
+
}
|
1423
|
+
|
1424
|
+
function _matches(/**HTMLElement*/el, /**String*/selector) {
|
1425
|
+
if (el) {
|
1426
|
+
selector = selector.split('.');
|
1427
|
+
|
1428
|
+
var tag = selector.shift().toUpperCase(),
|
1429
|
+
re = new RegExp('\\s(' + selector.join('|') + ')(?=\\s)', 'g');
|
1430
|
+
|
1431
|
+
return (
|
1432
|
+
(tag === '' || el.nodeName.toUpperCase() == tag) &&
|
1433
|
+
(!selector.length || ((' ' + el.className + ' ').match(re) || []).length == selector.length)
|
1434
|
+
);
|
1435
|
+
}
|
1436
|
+
|
1437
|
+
return false;
|
1438
|
+
}
|
1439
|
+
|
1440
|
+
function _throttle(callback, ms) {
|
1441
|
+
var args, _this;
|
1442
|
+
|
1443
|
+
return function () {
|
1444
|
+
if (args === void 0) {
|
1445
|
+
args = arguments;
|
1446
|
+
_this = this;
|
1447
|
+
|
1448
|
+
setTimeout(function () {
|
1449
|
+
if (args.length === 1) {
|
1450
|
+
callback.call(_this, args[0]);
|
1451
|
+
} else {
|
1452
|
+
callback.apply(_this, args);
|
1453
|
+
}
|
1454
|
+
|
1455
|
+
args = void 0;
|
1456
|
+
}, ms);
|
1457
|
+
}
|
1458
|
+
};
|
1459
|
+
}
|
1460
|
+
|
1461
|
+
function _extend(dst, src) {
|
1462
|
+
if (dst && src) {
|
1463
|
+
for (var key in src) {
|
1464
|
+
if (src.hasOwnProperty(key)) {
|
1465
|
+
dst[key] = src[key];
|
1466
|
+
}
|
1467
|
+
}
|
1468
|
+
}
|
1469
|
+
|
1470
|
+
return dst;
|
1471
|
+
}
|
1472
|
+
|
1473
|
+
function _clone(el) {
|
1474
|
+
if (Polymer && Polymer.dom) {
|
1475
|
+
return Polymer.dom(el).cloneNode(true);
|
1476
|
+
}
|
1477
|
+
else if ($) {
|
1478
|
+
return $(el).clone(true)[0];
|
1479
|
+
}
|
1480
|
+
else {
|
1481
|
+
return el.cloneNode(true);
|
1482
|
+
}
|
1483
|
+
}
|
1484
|
+
|
1485
|
+
function _saveInputCheckedState(root) {
|
1486
|
+
var inputs = root.getElementsByTagName('input');
|
1487
|
+
var idx = inputs.length;
|
1488
|
+
|
1489
|
+
while (idx--) {
|
1490
|
+
var el = inputs[idx];
|
1491
|
+
el.checked && savedInputChecked.push(el);
|
1492
|
+
}
|
1493
|
+
}
|
1494
|
+
|
1495
|
+
function _nextTick(fn) {
|
1496
|
+
return setTimeout(fn, 0);
|
1497
|
+
}
|
1498
|
+
|
1499
|
+
function _cancelNextTick(id) {
|
1500
|
+
return clearTimeout(id);
|
1501
|
+
}
|
1502
|
+
|
1503
|
+
// Fixed #973:
|
1504
|
+
_on(document, 'touchmove', function (evt) {
|
1505
|
+
if (KvSortable.active) {
|
1506
|
+
evt.preventDefault();
|
1507
|
+
}
|
1508
|
+
});
|
1509
|
+
|
1510
|
+
// Export utils
|
1511
|
+
KvSortable.utils = {
|
1512
|
+
on: _on,
|
1513
|
+
off: _off,
|
1514
|
+
css: _css,
|
1515
|
+
find: _find,
|
1516
|
+
is: function (el, selector) {
|
1517
|
+
return !!_closest(el, selector, el);
|
1518
|
+
},
|
1519
|
+
extend: _extend,
|
1520
|
+
throttle: _throttle,
|
1521
|
+
closest: _closest,
|
1522
|
+
toggleClass: _toggleClass,
|
1523
|
+
clone: _clone,
|
1524
|
+
index: _index,
|
1525
|
+
nextTick: _nextTick,
|
1526
|
+
cancelNextTick: _cancelNextTick
|
1527
|
+
};
|
1528
|
+
|
1529
|
+
|
1530
|
+
/**
|
1531
|
+
* Create kvsortable instance
|
1532
|
+
* @param {HTMLElement} el
|
1533
|
+
* @param {Object} [options]
|
1534
|
+
*/
|
1535
|
+
KvSortable.create = function (el, options) {
|
1536
|
+
return new KvSortable(el, options);
|
1537
|
+
};
|
1538
|
+
|
1539
|
+
|
1540
|
+
// Export
|
1541
|
+
KvSortable.version = '1.7.0';
|
1542
|
+
return KvSortable;
|
1543
|
+
});
|
1544
|
+
/**
|
1545
|
+
* jQuery plugin for KvSortable
|
1546
|
+
*/
|
1547
|
+
(function (factory) {
|
1548
|
+
"use strict";
|
1549
|
+
|
1550
|
+
if (typeof define === "function" && define.amd) {
|
1551
|
+
define(["jquery"], factory);
|
1552
|
+
}
|
1553
|
+
else {
|
1554
|
+
/* jshint sub:true */
|
1555
|
+
factory(jQuery);
|
1556
|
+
}
|
1557
|
+
})(function ($) {
|
1558
|
+
"use strict";
|
1559
|
+
$.fn.kvsortable = function (options) {
|
1560
|
+
var retVal,
|
1561
|
+
args = arguments;
|
1562
|
+
|
1563
|
+
this.each(function () {
|
1564
|
+
var $el = $(this), kvsortable = $el.data('kvsortable');
|
1565
|
+
|
1566
|
+
if (!kvsortable && (options instanceof Object || !options)) {
|
1567
|
+
kvsortable = new KvSortable(this, options);
|
1568
|
+
$el.data('kvsortable', kvsortable);
|
1569
|
+
}
|
1570
|
+
|
1571
|
+
if (kvsortable) {
|
1572
|
+
if (options === 'widget') {
|
1573
|
+
retVal = kvsortable;
|
1574
|
+
}
|
1575
|
+
else if (options === 'destroy') {
|
1576
|
+
kvsortable.destroy();
|
1577
|
+
$el.removeData('kvsortable');
|
1578
|
+
}
|
1579
|
+
else if (typeof kvsortable[options] === 'function') {
|
1580
|
+
retVal = kvsortable[options].apply(kvsortable, [].slice.call(args, 1));
|
1581
|
+
}
|
1582
|
+
else if (options in kvsortable.options) {
|
1583
|
+
retVal = kvsortable.option.apply(kvsortable, args);
|
1584
|
+
}
|
1585
|
+
}
|
1586
|
+
});
|
1587
|
+
|
1588
|
+
return (retVal === void 0) ? this : retVal;
|
1589
|
+
};
|
1590
|
+
});
|