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
@@ -0,0 +1,1322 @@
|
|
1
|
+
/*!
|
2
|
+
* Bootstrap Colorpicker v2.5.2
|
3
|
+
* https://itsjavi.com/bootstrap-colorpicker/
|
4
|
+
*
|
5
|
+
* Originally written by (c) 2012 Stefan Petre
|
6
|
+
* Licensed under the Apache License v2.0
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0.txt
|
8
|
+
*
|
9
|
+
*/
|
10
|
+
|
11
|
+
(function(root, factory) {
|
12
|
+
if (typeof define === 'function' && define.amd) {
|
13
|
+
// AMD. Register as an anonymous module unless amdModuleId is set
|
14
|
+
define(["jquery"], function(jq) {
|
15
|
+
return (factory(jq));
|
16
|
+
});
|
17
|
+
} else if (typeof exports === 'object') {
|
18
|
+
// Node. Does not work with strict CommonJS, but
|
19
|
+
// only CommonJS-like environments that support module.exports,
|
20
|
+
// like Node.
|
21
|
+
module.exports = factory(require("jquery"));
|
22
|
+
} else if (jQuery && !jQuery.fn.colorpicker) {
|
23
|
+
factory(jQuery);
|
24
|
+
}
|
25
|
+
}(this, function($) {
|
26
|
+
'use strict';
|
27
|
+
/**
|
28
|
+
* Color manipulation helper class
|
29
|
+
*
|
30
|
+
* @param {Object|String} [val]
|
31
|
+
* @param {Object} [predefinedColors]
|
32
|
+
* @param {String|null} [fallbackColor]
|
33
|
+
* @param {String|null} [fallbackFormat]
|
34
|
+
* @param {Boolean} [hexNumberSignPrefix]
|
35
|
+
* @constructor
|
36
|
+
*/
|
37
|
+
var Color = function(
|
38
|
+
val, predefinedColors, fallbackColor, fallbackFormat, hexNumberSignPrefix) {
|
39
|
+
this.fallbackValue = fallbackColor ?
|
40
|
+
(
|
41
|
+
(typeof fallbackColor === 'string') ?
|
42
|
+
this.parse(fallbackColor) :
|
43
|
+
fallbackColor
|
44
|
+
) :
|
45
|
+
null;
|
46
|
+
|
47
|
+
this.fallbackFormat = fallbackFormat ? fallbackFormat : 'rgba';
|
48
|
+
|
49
|
+
this.hexNumberSignPrefix = hexNumberSignPrefix === true;
|
50
|
+
|
51
|
+
this.value = this.fallbackValue;
|
52
|
+
|
53
|
+
this.origFormat = null; // original string format
|
54
|
+
|
55
|
+
this.predefinedColors = predefinedColors ? predefinedColors : {};
|
56
|
+
|
57
|
+
// We don't want to share aliases across instances so we extend new object
|
58
|
+
this.colors = $.extend({}, Color.webColors, this.predefinedColors);
|
59
|
+
|
60
|
+
if (val) {
|
61
|
+
if (typeof val.h !== 'undefined') {
|
62
|
+
this.value = val;
|
63
|
+
} else {
|
64
|
+
this.setColor(String(val));
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
if (!this.value) {
|
69
|
+
// Initial value is always black if no arguments are passed or val is empty
|
70
|
+
this.value = {
|
71
|
+
h: 0,
|
72
|
+
s: 0,
|
73
|
+
b: 0,
|
74
|
+
a: 1
|
75
|
+
};
|
76
|
+
}
|
77
|
+
};
|
78
|
+
|
79
|
+
Color.webColors = { // 140 predefined colors from the HTML Colors spec
|
80
|
+
"aliceblue": "f0f8ff",
|
81
|
+
"antiquewhite": "faebd7",
|
82
|
+
"aqua": "00ffff",
|
83
|
+
"aquamarine": "7fffd4",
|
84
|
+
"azure": "f0ffff",
|
85
|
+
"beige": "f5f5dc",
|
86
|
+
"bisque": "ffe4c4",
|
87
|
+
"black": "000000",
|
88
|
+
"blanchedalmond": "ffebcd",
|
89
|
+
"blue": "0000ff",
|
90
|
+
"blueviolet": "8a2be2",
|
91
|
+
"brown": "a52a2a",
|
92
|
+
"burlywood": "deb887",
|
93
|
+
"cadetblue": "5f9ea0",
|
94
|
+
"chartreuse": "7fff00",
|
95
|
+
"chocolate": "d2691e",
|
96
|
+
"coral": "ff7f50",
|
97
|
+
"cornflowerblue": "6495ed",
|
98
|
+
"cornsilk": "fff8dc",
|
99
|
+
"crimson": "dc143c",
|
100
|
+
"cyan": "00ffff",
|
101
|
+
"darkblue": "00008b",
|
102
|
+
"darkcyan": "008b8b",
|
103
|
+
"darkgoldenrod": "b8860b",
|
104
|
+
"darkgray": "a9a9a9",
|
105
|
+
"darkgreen": "006400",
|
106
|
+
"darkkhaki": "bdb76b",
|
107
|
+
"darkmagenta": "8b008b",
|
108
|
+
"darkolivegreen": "556b2f",
|
109
|
+
"darkorange": "ff8c00",
|
110
|
+
"darkorchid": "9932cc",
|
111
|
+
"darkred": "8b0000",
|
112
|
+
"darksalmon": "e9967a",
|
113
|
+
"darkseagreen": "8fbc8f",
|
114
|
+
"darkslateblue": "483d8b",
|
115
|
+
"darkslategray": "2f4f4f",
|
116
|
+
"darkturquoise": "00ced1",
|
117
|
+
"darkviolet": "9400d3",
|
118
|
+
"deeppink": "ff1493",
|
119
|
+
"deepskyblue": "00bfff",
|
120
|
+
"dimgray": "696969",
|
121
|
+
"dodgerblue": "1e90ff",
|
122
|
+
"firebrick": "b22222",
|
123
|
+
"floralwhite": "fffaf0",
|
124
|
+
"forestgreen": "228b22",
|
125
|
+
"fuchsia": "ff00ff",
|
126
|
+
"gainsboro": "dcdcdc",
|
127
|
+
"ghostwhite": "f8f8ff",
|
128
|
+
"gold": "ffd700",
|
129
|
+
"goldenrod": "daa520",
|
130
|
+
"gray": "808080",
|
131
|
+
"green": "008000",
|
132
|
+
"greenyellow": "adff2f",
|
133
|
+
"honeydew": "f0fff0",
|
134
|
+
"hotpink": "ff69b4",
|
135
|
+
"indianred": "cd5c5c",
|
136
|
+
"indigo": "4b0082",
|
137
|
+
"ivory": "fffff0",
|
138
|
+
"khaki": "f0e68c",
|
139
|
+
"lavender": "e6e6fa",
|
140
|
+
"lavenderblush": "fff0f5",
|
141
|
+
"lawngreen": "7cfc00",
|
142
|
+
"lemonchiffon": "fffacd",
|
143
|
+
"lightblue": "add8e6",
|
144
|
+
"lightcoral": "f08080",
|
145
|
+
"lightcyan": "e0ffff",
|
146
|
+
"lightgoldenrodyellow": "fafad2",
|
147
|
+
"lightgrey": "d3d3d3",
|
148
|
+
"lightgreen": "90ee90",
|
149
|
+
"lightpink": "ffb6c1",
|
150
|
+
"lightsalmon": "ffa07a",
|
151
|
+
"lightseagreen": "20b2aa",
|
152
|
+
"lightskyblue": "87cefa",
|
153
|
+
"lightslategray": "778899",
|
154
|
+
"lightsteelblue": "b0c4de",
|
155
|
+
"lightyellow": "ffffe0",
|
156
|
+
"lime": "00ff00",
|
157
|
+
"limegreen": "32cd32",
|
158
|
+
"linen": "faf0e6",
|
159
|
+
"magenta": "ff00ff",
|
160
|
+
"maroon": "800000",
|
161
|
+
"mediumaquamarine": "66cdaa",
|
162
|
+
"mediumblue": "0000cd",
|
163
|
+
"mediumorchid": "ba55d3",
|
164
|
+
"mediumpurple": "9370d8",
|
165
|
+
"mediumseagreen": "3cb371",
|
166
|
+
"mediumslateblue": "7b68ee",
|
167
|
+
"mediumspringgreen": "00fa9a",
|
168
|
+
"mediumturquoise": "48d1cc",
|
169
|
+
"mediumvioletred": "c71585",
|
170
|
+
"midnightblue": "191970",
|
171
|
+
"mintcream": "f5fffa",
|
172
|
+
"mistyrose": "ffe4e1",
|
173
|
+
"moccasin": "ffe4b5",
|
174
|
+
"navajowhite": "ffdead",
|
175
|
+
"navy": "000080",
|
176
|
+
"oldlace": "fdf5e6",
|
177
|
+
"olive": "808000",
|
178
|
+
"olivedrab": "6b8e23",
|
179
|
+
"orange": "ffa500",
|
180
|
+
"orangered": "ff4500",
|
181
|
+
"orchid": "da70d6",
|
182
|
+
"palegoldenrod": "eee8aa",
|
183
|
+
"palegreen": "98fb98",
|
184
|
+
"paleturquoise": "afeeee",
|
185
|
+
"palevioletred": "d87093",
|
186
|
+
"papayawhip": "ffefd5",
|
187
|
+
"peachpuff": "ffdab9",
|
188
|
+
"peru": "cd853f",
|
189
|
+
"pink": "ffc0cb",
|
190
|
+
"plum": "dda0dd",
|
191
|
+
"powderblue": "b0e0e6",
|
192
|
+
"purple": "800080",
|
193
|
+
"red": "ff0000",
|
194
|
+
"rosybrown": "bc8f8f",
|
195
|
+
"royalblue": "4169e1",
|
196
|
+
"saddlebrown": "8b4513",
|
197
|
+
"salmon": "fa8072",
|
198
|
+
"sandybrown": "f4a460",
|
199
|
+
"seagreen": "2e8b57",
|
200
|
+
"seashell": "fff5ee",
|
201
|
+
"sienna": "a0522d",
|
202
|
+
"silver": "c0c0c0",
|
203
|
+
"skyblue": "87ceeb",
|
204
|
+
"slateblue": "6a5acd",
|
205
|
+
"slategray": "708090",
|
206
|
+
"snow": "fffafa",
|
207
|
+
"springgreen": "00ff7f",
|
208
|
+
"steelblue": "4682b4",
|
209
|
+
"tan": "d2b48c",
|
210
|
+
"teal": "008080",
|
211
|
+
"thistle": "d8bfd8",
|
212
|
+
"tomato": "ff6347",
|
213
|
+
"turquoise": "40e0d0",
|
214
|
+
"violet": "ee82ee",
|
215
|
+
"wheat": "f5deb3",
|
216
|
+
"white": "ffffff",
|
217
|
+
"whitesmoke": "f5f5f5",
|
218
|
+
"yellow": "ffff00",
|
219
|
+
"yellowgreen": "9acd32",
|
220
|
+
"transparent": "transparent"
|
221
|
+
};
|
222
|
+
|
223
|
+
Color.prototype = {
|
224
|
+
constructor: Color,
|
225
|
+
colors: {}, // merged web and predefined colors
|
226
|
+
predefinedColors: {},
|
227
|
+
/**
|
228
|
+
* @return {Object}
|
229
|
+
*/
|
230
|
+
getValue: function() {
|
231
|
+
return this.value;
|
232
|
+
},
|
233
|
+
/**
|
234
|
+
* @param {Object} val
|
235
|
+
*/
|
236
|
+
setValue: function(val) {
|
237
|
+
this.value = val;
|
238
|
+
},
|
239
|
+
_sanitizeNumber: function(val) {
|
240
|
+
if (typeof val === 'number') {
|
241
|
+
return val;
|
242
|
+
}
|
243
|
+
if (isNaN(val) || (val === null) || (val === '') || (val === undefined)) {
|
244
|
+
return 1;
|
245
|
+
}
|
246
|
+
if (val === '') {
|
247
|
+
return 0;
|
248
|
+
}
|
249
|
+
if (typeof val.toLowerCase !== 'undefined') {
|
250
|
+
if (val.match(/^\./)) {
|
251
|
+
val = "0" + val;
|
252
|
+
}
|
253
|
+
return Math.ceil(parseFloat(val) * 100) / 100;
|
254
|
+
}
|
255
|
+
return 1;
|
256
|
+
},
|
257
|
+
isTransparent: function(strVal) {
|
258
|
+
if (!strVal || !(typeof strVal === 'string' || strVal instanceof String)) {
|
259
|
+
return false;
|
260
|
+
}
|
261
|
+
strVal = strVal.toLowerCase().trim();
|
262
|
+
return (strVal === 'transparent') || (strVal.match(/#?00000000/)) || (strVal.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/));
|
263
|
+
},
|
264
|
+
rgbaIsTransparent: function(rgba) {
|
265
|
+
return ((rgba.r === 0) && (rgba.g === 0) && (rgba.b === 0) && (rgba.a === 0));
|
266
|
+
},
|
267
|
+
// parse a string to HSB
|
268
|
+
/**
|
269
|
+
* @protected
|
270
|
+
* @param {String} strVal
|
271
|
+
* @returns {boolean} Returns true if it could be parsed, false otherwise
|
272
|
+
*/
|
273
|
+
setColor: function(strVal) {
|
274
|
+
strVal = strVal.toLowerCase().trim();
|
275
|
+
if (strVal) {
|
276
|
+
if (this.isTransparent(strVal)) {
|
277
|
+
this.value = {
|
278
|
+
h: 0,
|
279
|
+
s: 0,
|
280
|
+
b: 0,
|
281
|
+
a: 0
|
282
|
+
};
|
283
|
+
return true;
|
284
|
+
} else {
|
285
|
+
var parsedColor = this.parse(strVal);
|
286
|
+
if (parsedColor) {
|
287
|
+
this.value = this.value = {
|
288
|
+
h: parsedColor.h,
|
289
|
+
s: parsedColor.s,
|
290
|
+
b: parsedColor.b,
|
291
|
+
a: parsedColor.a
|
292
|
+
};
|
293
|
+
if (!this.origFormat) {
|
294
|
+
this.origFormat = parsedColor.format;
|
295
|
+
}
|
296
|
+
} else if (this.fallbackValue) {
|
297
|
+
// if parser fails, defaults to fallbackValue if defined, otherwise the value won't be changed
|
298
|
+
this.value = this.fallbackValue;
|
299
|
+
}
|
300
|
+
}
|
301
|
+
}
|
302
|
+
return false;
|
303
|
+
},
|
304
|
+
setHue: function(h) {
|
305
|
+
this.value.h = 1 - h;
|
306
|
+
},
|
307
|
+
setSaturation: function(s) {
|
308
|
+
this.value.s = s;
|
309
|
+
},
|
310
|
+
setBrightness: function(b) {
|
311
|
+
this.value.b = 1 - b;
|
312
|
+
},
|
313
|
+
setAlpha: function(a) {
|
314
|
+
this.value.a = Math.round((parseInt((1 - a) * 100, 10) / 100) * 100) / 100;
|
315
|
+
},
|
316
|
+
toRGB: function(h, s, b, a) {
|
317
|
+
if (arguments.length === 0) {
|
318
|
+
h = this.value.h;
|
319
|
+
s = this.value.s;
|
320
|
+
b = this.value.b;
|
321
|
+
a = this.value.a;
|
322
|
+
}
|
323
|
+
|
324
|
+
h *= 360;
|
325
|
+
var R, G, B, X, C;
|
326
|
+
h = (h % 360) / 60;
|
327
|
+
C = b * s;
|
328
|
+
X = C * (1 - Math.abs(h % 2 - 1));
|
329
|
+
R = G = B = b - C;
|
330
|
+
|
331
|
+
h = ~~h;
|
332
|
+
R += [C, X, 0, 0, X, C][h];
|
333
|
+
G += [X, C, C, X, 0, 0][h];
|
334
|
+
B += [0, 0, X, C, C, X][h];
|
335
|
+
|
336
|
+
return {
|
337
|
+
r: Math.round(R * 255),
|
338
|
+
g: Math.round(G * 255),
|
339
|
+
b: Math.round(B * 255),
|
340
|
+
a: a
|
341
|
+
};
|
342
|
+
},
|
343
|
+
toHex: function(ignoreFormat, h, s, b, a) {
|
344
|
+
if (arguments.length <= 1) {
|
345
|
+
h = this.value.h;
|
346
|
+
s = this.value.s;
|
347
|
+
b = this.value.b;
|
348
|
+
a = this.value.a;
|
349
|
+
}
|
350
|
+
|
351
|
+
var prefix = '#';
|
352
|
+
var rgb = this.toRGB(h, s, b, a);
|
353
|
+
|
354
|
+
if (this.rgbaIsTransparent(rgb)) {
|
355
|
+
return 'transparent';
|
356
|
+
}
|
357
|
+
|
358
|
+
if (!ignoreFormat) {
|
359
|
+
prefix = (this.hexNumberSignPrefix ? '#' : '');
|
360
|
+
}
|
361
|
+
|
362
|
+
var hexStr = prefix + (
|
363
|
+
(1 << 24) +
|
364
|
+
(parseInt(rgb.r) << 16) +
|
365
|
+
(parseInt(rgb.g) << 8) +
|
366
|
+
parseInt(rgb.b))
|
367
|
+
.toString(16)
|
368
|
+
.slice(1);
|
369
|
+
|
370
|
+
return hexStr;
|
371
|
+
},
|
372
|
+
toHSL: function(h, s, b, a) {
|
373
|
+
if (arguments.length === 0) {
|
374
|
+
h = this.value.h;
|
375
|
+
s = this.value.s;
|
376
|
+
b = this.value.b;
|
377
|
+
a = this.value.a;
|
378
|
+
}
|
379
|
+
|
380
|
+
var H = h,
|
381
|
+
L = (2 - s) * b,
|
382
|
+
S = s * b;
|
383
|
+
if (L > 0 && L <= 1) {
|
384
|
+
S /= L;
|
385
|
+
} else {
|
386
|
+
S /= 2 - L;
|
387
|
+
}
|
388
|
+
L /= 2;
|
389
|
+
if (S > 1) {
|
390
|
+
S = 1;
|
391
|
+
}
|
392
|
+
return {
|
393
|
+
h: isNaN(H) ? 0 : H,
|
394
|
+
s: isNaN(S) ? 0 : S,
|
395
|
+
l: isNaN(L) ? 0 : L,
|
396
|
+
a: isNaN(a) ? 0 : a
|
397
|
+
};
|
398
|
+
},
|
399
|
+
toAlias: function(r, g, b, a) {
|
400
|
+
var c, rgb = (arguments.length === 0) ? this.toHex(true) : this.toHex(true, r, g, b, a);
|
401
|
+
|
402
|
+
// support predef. colors in non-hex format too, as defined in the alias itself
|
403
|
+
var original = this.origFormat === 'alias' ? rgb : this.toString(false, this.origFormat);
|
404
|
+
|
405
|
+
for (var alias in this.colors) {
|
406
|
+
c = this.colors[alias].toLowerCase().trim();
|
407
|
+
if ((c === rgb) || (c === original)) {
|
408
|
+
return alias;
|
409
|
+
}
|
410
|
+
}
|
411
|
+
return false;
|
412
|
+
},
|
413
|
+
RGBtoHSB: function(r, g, b, a) {
|
414
|
+
r /= 255;
|
415
|
+
g /= 255;
|
416
|
+
b /= 255;
|
417
|
+
|
418
|
+
var H, S, V, C;
|
419
|
+
V = Math.max(r, g, b);
|
420
|
+
C = V - Math.min(r, g, b);
|
421
|
+
H = (C === 0 ? null :
|
422
|
+
V === r ? (g - b) / C :
|
423
|
+
V === g ? (b - r) / C + 2 :
|
424
|
+
(r - g) / C + 4
|
425
|
+
);
|
426
|
+
H = ((H + 360) % 6) * 60 / 360;
|
427
|
+
S = C === 0 ? 0 : C / V;
|
428
|
+
return {
|
429
|
+
h: this._sanitizeNumber(H),
|
430
|
+
s: S,
|
431
|
+
b: V,
|
432
|
+
a: this._sanitizeNumber(a)
|
433
|
+
};
|
434
|
+
},
|
435
|
+
HueToRGB: function(p, q, h) {
|
436
|
+
if (h < 0) {
|
437
|
+
h += 1;
|
438
|
+
} else if (h > 1) {
|
439
|
+
h -= 1;
|
440
|
+
}
|
441
|
+
if ((h * 6) < 1) {
|
442
|
+
return p + (q - p) * h * 6;
|
443
|
+
} else if ((h * 2) < 1) {
|
444
|
+
return q;
|
445
|
+
} else if ((h * 3) < 2) {
|
446
|
+
return p + (q - p) * ((2 / 3) - h) * 6;
|
447
|
+
} else {
|
448
|
+
return p;
|
449
|
+
}
|
450
|
+
},
|
451
|
+
HSLtoRGB: function(h, s, l, a) {
|
452
|
+
if (s < 0) {
|
453
|
+
s = 0;
|
454
|
+
}
|
455
|
+
var q;
|
456
|
+
if (l <= 0.5) {
|
457
|
+
q = l * (1 + s);
|
458
|
+
} else {
|
459
|
+
q = l + s - (l * s);
|
460
|
+
}
|
461
|
+
|
462
|
+
var p = 2 * l - q;
|
463
|
+
|
464
|
+
var tr = h + (1 / 3);
|
465
|
+
var tg = h;
|
466
|
+
var tb = h - (1 / 3);
|
467
|
+
|
468
|
+
var r = Math.round(this.HueToRGB(p, q, tr) * 255);
|
469
|
+
var g = Math.round(this.HueToRGB(p, q, tg) * 255);
|
470
|
+
var b = Math.round(this.HueToRGB(p, q, tb) * 255);
|
471
|
+
return [r, g, b, this._sanitizeNumber(a)];
|
472
|
+
},
|
473
|
+
/**
|
474
|
+
* @param {String} strVal
|
475
|
+
* @returns {Object} Object containing h,s,b,a,format properties or FALSE if failed to parse
|
476
|
+
*/
|
477
|
+
parse: function(strVal) {
|
478
|
+
if (typeof strVal !== 'string') {
|
479
|
+
return this.fallbackValue;
|
480
|
+
}
|
481
|
+
if (arguments.length === 0) {
|
482
|
+
return false;
|
483
|
+
}
|
484
|
+
|
485
|
+
var that = this,
|
486
|
+
result = false,
|
487
|
+
isAlias = (typeof this.colors[strVal] !== 'undefined'),
|
488
|
+
values, format;
|
489
|
+
|
490
|
+
if (isAlias) {
|
491
|
+
strVal = this.colors[strVal].toLowerCase().trim();
|
492
|
+
}
|
493
|
+
|
494
|
+
$.each(this.stringParsers, function(i, parser) {
|
495
|
+
var match = parser.re.exec(strVal);
|
496
|
+
values = match && parser.parse.apply(that, [match]);
|
497
|
+
if (values) {
|
498
|
+
result = {};
|
499
|
+
format = (isAlias ? 'alias' : (parser.format ? parser.format : that.getValidFallbackFormat()));
|
500
|
+
if (format.match(/hsla?/)) {
|
501
|
+
result = that.RGBtoHSB.apply(that, that.HSLtoRGB.apply(that, values));
|
502
|
+
} else {
|
503
|
+
result = that.RGBtoHSB.apply(that, values);
|
504
|
+
}
|
505
|
+
if (result instanceof Object) {
|
506
|
+
result.format = format;
|
507
|
+
}
|
508
|
+
return false; // stop iterating
|
509
|
+
}
|
510
|
+
return true;
|
511
|
+
});
|
512
|
+
return result;
|
513
|
+
},
|
514
|
+
getValidFallbackFormat: function() {
|
515
|
+
var formats = [
|
516
|
+
'rgba', 'rgb', 'hex', 'hsla', 'hsl'
|
517
|
+
];
|
518
|
+
if (this.origFormat && (formats.indexOf(this.origFormat) !== -1)) {
|
519
|
+
return this.origFormat;
|
520
|
+
}
|
521
|
+
if (this.fallbackFormat && (formats.indexOf(this.fallbackFormat) !== -1)) {
|
522
|
+
return this.fallbackFormat;
|
523
|
+
}
|
524
|
+
|
525
|
+
return 'rgba'; // By default, return a format that will not lose the alpha info
|
526
|
+
},
|
527
|
+
/**
|
528
|
+
*
|
529
|
+
* @param {string} [format] (default: rgba)
|
530
|
+
* @param {boolean} [translateAlias] Return real color for pre-defined (non-standard) aliases (default: false)
|
531
|
+
* @param {boolean} [forceRawValue] Forces hashtag prefix when getting hex color (default: false)
|
532
|
+
* @returns {String}
|
533
|
+
*/
|
534
|
+
toString: function(forceRawValue, format, translateAlias) {
|
535
|
+
format = format || this.origFormat || this.fallbackFormat;
|
536
|
+
translateAlias = translateAlias || false;
|
537
|
+
|
538
|
+
var c = false;
|
539
|
+
|
540
|
+
switch (format) {
|
541
|
+
case 'rgb':
|
542
|
+
{
|
543
|
+
c = this.toRGB();
|
544
|
+
if (this.rgbaIsTransparent(c)) {
|
545
|
+
return 'transparent';
|
546
|
+
}
|
547
|
+
return 'rgb(' + c.r + ',' + c.g + ',' + c.b + ')';
|
548
|
+
}
|
549
|
+
break;
|
550
|
+
case 'rgba':
|
551
|
+
{
|
552
|
+
c = this.toRGB();
|
553
|
+
return 'rgba(' + c.r + ',' + c.g + ',' + c.b + ',' + c.a + ')';
|
554
|
+
}
|
555
|
+
break;
|
556
|
+
case 'hsl':
|
557
|
+
{
|
558
|
+
c = this.toHSL();
|
559
|
+
return 'hsl(' + Math.round(c.h * 360) + ',' + Math.round(c.s * 100) + '%,' + Math.round(c.l * 100) + '%)';
|
560
|
+
}
|
561
|
+
break;
|
562
|
+
case 'hsla':
|
563
|
+
{
|
564
|
+
c = this.toHSL();
|
565
|
+
return 'hsla(' + Math.round(c.h * 360) + ',' + Math.round(c.s * 100) + '%,' + Math.round(c.l * 100) + '%,' + c.a + ')';
|
566
|
+
}
|
567
|
+
break;
|
568
|
+
case 'hex':
|
569
|
+
{
|
570
|
+
return this.toHex(forceRawValue);
|
571
|
+
}
|
572
|
+
break;
|
573
|
+
case 'alias':
|
574
|
+
{
|
575
|
+
c = this.toAlias();
|
576
|
+
|
577
|
+
if (c === false) {
|
578
|
+
return this.toString(forceRawValue, this.getValidFallbackFormat());
|
579
|
+
}
|
580
|
+
|
581
|
+
if (translateAlias && !(c in Color.webColors) && (c in this.predefinedColors)) {
|
582
|
+
return this.predefinedColors[c];
|
583
|
+
}
|
584
|
+
|
585
|
+
return c;
|
586
|
+
}
|
587
|
+
default:
|
588
|
+
{
|
589
|
+
return c;
|
590
|
+
}
|
591
|
+
break;
|
592
|
+
}
|
593
|
+
},
|
594
|
+
// a set of RE's that can match strings and generate color tuples.
|
595
|
+
// from John Resig color plugin
|
596
|
+
// https://github.com/jquery/jquery-color/
|
597
|
+
stringParsers: [{
|
598
|
+
re: /rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/,
|
599
|
+
format: 'rgb',
|
600
|
+
parse: function(execResult) {
|
601
|
+
return [
|
602
|
+
execResult[1],
|
603
|
+
execResult[2],
|
604
|
+
execResult[3],
|
605
|
+
1
|
606
|
+
];
|
607
|
+
}
|
608
|
+
}, {
|
609
|
+
re: /rgb\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,
|
610
|
+
format: 'rgb',
|
611
|
+
parse: function(execResult) {
|
612
|
+
return [
|
613
|
+
2.55 * execResult[1],
|
614
|
+
2.55 * execResult[2],
|
615
|
+
2.55 * execResult[3],
|
616
|
+
1
|
617
|
+
];
|
618
|
+
}
|
619
|
+
}, {
|
620
|
+
re: /rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,
|
621
|
+
format: 'rgba',
|
622
|
+
parse: function(execResult) {
|
623
|
+
return [
|
624
|
+
execResult[1],
|
625
|
+
execResult[2],
|
626
|
+
execResult[3],
|
627
|
+
execResult[4]
|
628
|
+
];
|
629
|
+
}
|
630
|
+
}, {
|
631
|
+
re: /rgba\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,
|
632
|
+
format: 'rgba',
|
633
|
+
parse: function(execResult) {
|
634
|
+
return [
|
635
|
+
2.55 * execResult[1],
|
636
|
+
2.55 * execResult[2],
|
637
|
+
2.55 * execResult[3],
|
638
|
+
execResult[4]
|
639
|
+
];
|
640
|
+
}
|
641
|
+
}, {
|
642
|
+
re: /hsl\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,
|
643
|
+
format: 'hsl',
|
644
|
+
parse: function(execResult) {
|
645
|
+
return [
|
646
|
+
execResult[1] / 360,
|
647
|
+
execResult[2] / 100,
|
648
|
+
execResult[3] / 100,
|
649
|
+
execResult[4]
|
650
|
+
];
|
651
|
+
}
|
652
|
+
}, {
|
653
|
+
re: /hsla\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,
|
654
|
+
format: 'hsla',
|
655
|
+
parse: function(execResult) {
|
656
|
+
return [
|
657
|
+
execResult[1] / 360,
|
658
|
+
execResult[2] / 100,
|
659
|
+
execResult[3] / 100,
|
660
|
+
execResult[4]
|
661
|
+
];
|
662
|
+
}
|
663
|
+
}, {
|
664
|
+
re: /#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,
|
665
|
+
format: 'hex',
|
666
|
+
parse: function(execResult) {
|
667
|
+
return [
|
668
|
+
parseInt(execResult[1], 16),
|
669
|
+
parseInt(execResult[2], 16),
|
670
|
+
parseInt(execResult[3], 16),
|
671
|
+
1
|
672
|
+
];
|
673
|
+
}
|
674
|
+
}, {
|
675
|
+
re: /#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,
|
676
|
+
format: 'hex',
|
677
|
+
parse: function(execResult) {
|
678
|
+
return [
|
679
|
+
parseInt(execResult[1] + execResult[1], 16),
|
680
|
+
parseInt(execResult[2] + execResult[2], 16),
|
681
|
+
parseInt(execResult[3] + execResult[3], 16),
|
682
|
+
1
|
683
|
+
];
|
684
|
+
}
|
685
|
+
}],
|
686
|
+
colorNameToHex: function(name) {
|
687
|
+
if (typeof this.colors[name.toLowerCase()] !== 'undefined') {
|
688
|
+
return this.colors[name.toLowerCase()];
|
689
|
+
}
|
690
|
+
return false;
|
691
|
+
}
|
692
|
+
};
|
693
|
+
|
694
|
+
/*
|
695
|
+
* Default plugin options
|
696
|
+
*/
|
697
|
+
var defaults = {
|
698
|
+
horizontal: false, // horizontal mode layout ?
|
699
|
+
inline: false, //forces to show the colorpicker as an inline element
|
700
|
+
color: false, //forces a color
|
701
|
+
format: false, //forces a format
|
702
|
+
input: 'input', // children input selector
|
703
|
+
container: false, // container selector
|
704
|
+
component: '.add-on, .input-group-addon', // children component selector
|
705
|
+
fallbackColor: false, // fallback color value. null = keeps current color.
|
706
|
+
fallbackFormat: 'hex', // fallback color format
|
707
|
+
hexNumberSignPrefix: true, // put a '#' (number sign) before hex strings
|
708
|
+
sliders: {
|
709
|
+
saturation: {
|
710
|
+
maxLeft: 100,
|
711
|
+
maxTop: 100,
|
712
|
+
callLeft: 'setSaturation',
|
713
|
+
callTop: 'setBrightness'
|
714
|
+
},
|
715
|
+
hue: {
|
716
|
+
maxLeft: 0,
|
717
|
+
maxTop: 100,
|
718
|
+
callLeft: false,
|
719
|
+
callTop: 'setHue'
|
720
|
+
},
|
721
|
+
alpha: {
|
722
|
+
maxLeft: 0,
|
723
|
+
maxTop: 100,
|
724
|
+
callLeft: false,
|
725
|
+
callTop: 'setAlpha'
|
726
|
+
}
|
727
|
+
},
|
728
|
+
slidersHorz: {
|
729
|
+
saturation: {
|
730
|
+
maxLeft: 100,
|
731
|
+
maxTop: 100,
|
732
|
+
callLeft: 'setSaturation',
|
733
|
+
callTop: 'setBrightness'
|
734
|
+
},
|
735
|
+
hue: {
|
736
|
+
maxLeft: 100,
|
737
|
+
maxTop: 0,
|
738
|
+
callLeft: 'setHue',
|
739
|
+
callTop: false
|
740
|
+
},
|
741
|
+
alpha: {
|
742
|
+
maxLeft: 100,
|
743
|
+
maxTop: 0,
|
744
|
+
callLeft: 'setAlpha',
|
745
|
+
callTop: false
|
746
|
+
}
|
747
|
+
},
|
748
|
+
template: '<div class="colorpicker dropdown-menu">' +
|
749
|
+
'<div class="colorpicker-saturation"><i><b></b></i></div>' +
|
750
|
+
'<div class="colorpicker-hue"><i></i></div>' +
|
751
|
+
'<div class="colorpicker-alpha"><i></i></div>' +
|
752
|
+
'<div class="colorpicker-color"><div /></div>' +
|
753
|
+
'<div class="colorpicker-selectors"></div>' +
|
754
|
+
'</div>',
|
755
|
+
align: 'right',
|
756
|
+
customClass: null, // custom class added to the colorpicker element
|
757
|
+
colorSelectors: null // custom color aliases
|
758
|
+
};
|
759
|
+
|
760
|
+
/**
|
761
|
+
* Colorpicker component class
|
762
|
+
*
|
763
|
+
* @param {Object|String} element
|
764
|
+
* @param {Object} options
|
765
|
+
* @constructor
|
766
|
+
*/
|
767
|
+
var Colorpicker = function(element, options) {
|
768
|
+
this.element = $(element).addClass('colorpicker-element');
|
769
|
+
this.options = $.extend(true, {}, defaults, this.element.data(), options);
|
770
|
+
this.component = this.options.component;
|
771
|
+
this.component = (this.component !== false) ? this.element.find(this.component) : false;
|
772
|
+
if (this.component && (this.component.length === 0)) {
|
773
|
+
this.component = false;
|
774
|
+
}
|
775
|
+
this.container = (this.options.container === true) ? this.element : this.options.container;
|
776
|
+
this.container = (this.container !== false) ? $(this.container) : false;
|
777
|
+
|
778
|
+
// Is the element an input? Should we search inside for any input?
|
779
|
+
this.input = this.element.is('input') ? this.element : (this.options.input ?
|
780
|
+
this.element.find(this.options.input) : false);
|
781
|
+
if (this.input && (this.input.length === 0)) {
|
782
|
+
this.input = false;
|
783
|
+
}
|
784
|
+
// Set HSB color
|
785
|
+
this.color = this.createColor(this.options.color !== false ? this.options.color : this.getValue());
|
786
|
+
|
787
|
+
this.format = this.options.format !== false ? this.options.format : this.color.origFormat;
|
788
|
+
|
789
|
+
if (this.options.color !== false) {
|
790
|
+
this.updateInput(this.color);
|
791
|
+
this.updateData(this.color);
|
792
|
+
}
|
793
|
+
|
794
|
+
this.disabled = false;
|
795
|
+
|
796
|
+
// Setup picker
|
797
|
+
var $picker = this.picker = $(this.options.template);
|
798
|
+
if (this.options.customClass) {
|
799
|
+
$picker.addClass(this.options.customClass);
|
800
|
+
}
|
801
|
+
if (this.options.inline) {
|
802
|
+
$picker.addClass('colorpicker-inline colorpicker-visible');
|
803
|
+
} else {
|
804
|
+
$picker.addClass('colorpicker-hidden');
|
805
|
+
}
|
806
|
+
if (this.options.horizontal) {
|
807
|
+
$picker.addClass('colorpicker-horizontal');
|
808
|
+
}
|
809
|
+
if (
|
810
|
+
(['rgba', 'hsla', 'alias'].indexOf(this.format) !== -1) ||
|
811
|
+
this.options.format === false ||
|
812
|
+
this.getValue() === 'transparent'
|
813
|
+
) {
|
814
|
+
$picker.addClass('colorpicker-with-alpha');
|
815
|
+
}
|
816
|
+
if (this.options.align === 'right') {
|
817
|
+
$picker.addClass('colorpicker-right');
|
818
|
+
}
|
819
|
+
if (this.options.inline === true) {
|
820
|
+
$picker.addClass('colorpicker-no-arrow');
|
821
|
+
}
|
822
|
+
if (this.options.colorSelectors) {
|
823
|
+
var colorpicker = this,
|
824
|
+
selectorsContainer = colorpicker.picker.find('.colorpicker-selectors');
|
825
|
+
|
826
|
+
if (selectorsContainer.length > 0) {
|
827
|
+
$.each(this.options.colorSelectors, function(name, color) {
|
828
|
+
var $btn = $('<i />')
|
829
|
+
.addClass('colorpicker-selectors-color')
|
830
|
+
.css('background-color', color)
|
831
|
+
.data('class', name).data('alias', name);
|
832
|
+
|
833
|
+
$btn.on('mousedown.colorpicker touchstart.colorpicker', function(event) {
|
834
|
+
event.preventDefault();
|
835
|
+
colorpicker.setValue(
|
836
|
+
colorpicker.format === 'alias' ? $(this).data('alias') : $(this).css('background-color')
|
837
|
+
);
|
838
|
+
});
|
839
|
+
selectorsContainer.append($btn);
|
840
|
+
});
|
841
|
+
selectorsContainer.show().addClass('colorpicker-visible');
|
842
|
+
}
|
843
|
+
}
|
844
|
+
|
845
|
+
// Prevent closing the colorpicker when clicking on itself
|
846
|
+
$picker.on('mousedown.colorpicker touchstart.colorpicker', $.proxy(function(e) {
|
847
|
+
if (e.target === e.currentTarget) {
|
848
|
+
e.preventDefault();
|
849
|
+
}
|
850
|
+
}, this));
|
851
|
+
|
852
|
+
// Bind click/tap events on the sliders
|
853
|
+
$picker.find('.colorpicker-saturation, .colorpicker-hue, .colorpicker-alpha')
|
854
|
+
.on('mousedown.colorpicker touchstart.colorpicker', $.proxy(this.mousedown, this));
|
855
|
+
|
856
|
+
$picker.appendTo(this.container ? this.container : $('body'));
|
857
|
+
|
858
|
+
// Bind other events
|
859
|
+
if (this.input !== false) {
|
860
|
+
this.input.on({
|
861
|
+
'keyup.colorpicker': $.proxy(this.keyup, this)
|
862
|
+
});
|
863
|
+
this.input.on({
|
864
|
+
'change.colorpicker': $.proxy(this.change, this)
|
865
|
+
});
|
866
|
+
if (this.component === false) {
|
867
|
+
this.element.on({
|
868
|
+
'focus.colorpicker': $.proxy(this.show, this)
|
869
|
+
});
|
870
|
+
}
|
871
|
+
if (this.options.inline === false) {
|
872
|
+
this.element.on({
|
873
|
+
'focusout.colorpicker': $.proxy(this.hide, this)
|
874
|
+
});
|
875
|
+
}
|
876
|
+
}
|
877
|
+
|
878
|
+
if (this.component !== false) {
|
879
|
+
this.component.on({
|
880
|
+
'click.colorpicker': $.proxy(this.show, this)
|
881
|
+
});
|
882
|
+
}
|
883
|
+
|
884
|
+
if ((this.input === false) && (this.component === false)) {
|
885
|
+
this.element.on({
|
886
|
+
'click.colorpicker': $.proxy(this.show, this)
|
887
|
+
});
|
888
|
+
}
|
889
|
+
|
890
|
+
// for HTML5 input[type='color']
|
891
|
+
if ((this.input !== false) && (this.component !== false) && (this.input.attr('type') === 'color')) {
|
892
|
+
|
893
|
+
this.input.on({
|
894
|
+
'click.colorpicker': $.proxy(this.show, this),
|
895
|
+
'focus.colorpicker': $.proxy(this.show, this)
|
896
|
+
});
|
897
|
+
}
|
898
|
+
this.update();
|
899
|
+
|
900
|
+
$($.proxy(function() {
|
901
|
+
this.element.trigger('create');
|
902
|
+
}, this));
|
903
|
+
};
|
904
|
+
|
905
|
+
Colorpicker.Color = Color;
|
906
|
+
|
907
|
+
Colorpicker.prototype = {
|
908
|
+
constructor: Colorpicker,
|
909
|
+
destroy: function() {
|
910
|
+
this.picker.remove();
|
911
|
+
this.element.removeData('colorpicker', 'color').off('.colorpicker');
|
912
|
+
if (this.input !== false) {
|
913
|
+
this.input.off('.colorpicker');
|
914
|
+
}
|
915
|
+
if (this.component !== false) {
|
916
|
+
this.component.off('.colorpicker');
|
917
|
+
}
|
918
|
+
this.element.removeClass('colorpicker-element');
|
919
|
+
this.element.trigger({
|
920
|
+
type: 'destroy'
|
921
|
+
});
|
922
|
+
},
|
923
|
+
reposition: function() {
|
924
|
+
if (this.options.inline !== false || this.options.container) {
|
925
|
+
return false;
|
926
|
+
}
|
927
|
+
var type = this.container && this.container[0] !== window.document.body ? 'position' : 'offset';
|
928
|
+
var element = this.component || this.element;
|
929
|
+
var offset = element[type]();
|
930
|
+
if (this.options.align === 'right') {
|
931
|
+
offset.left -= this.picker.outerWidth() - element.outerWidth();
|
932
|
+
}
|
933
|
+
this.picker.css({
|
934
|
+
top: offset.top + element.outerHeight(),
|
935
|
+
left: offset.left
|
936
|
+
});
|
937
|
+
},
|
938
|
+
show: function(e) {
|
939
|
+
if (this.isDisabled()) {
|
940
|
+
// Don't show the widget if it's disabled (the input)
|
941
|
+
return;
|
942
|
+
}
|
943
|
+
this.picker.addClass('colorpicker-visible').removeClass('colorpicker-hidden');
|
944
|
+
this.reposition();
|
945
|
+
$(window).on('resize.colorpicker', $.proxy(this.reposition, this));
|
946
|
+
if (e && (!this.hasInput() || this.input.attr('type') === 'color')) {
|
947
|
+
if (e.stopPropagation && e.preventDefault) {
|
948
|
+
e.stopPropagation();
|
949
|
+
e.preventDefault();
|
950
|
+
}
|
951
|
+
}
|
952
|
+
if ((this.component || !this.input) && (this.options.inline === false)) {
|
953
|
+
$(window.document).on({
|
954
|
+
'mousedown.colorpicker': $.proxy(this.hide, this)
|
955
|
+
});
|
956
|
+
}
|
957
|
+
this.element.trigger({
|
958
|
+
type: 'showPicker',
|
959
|
+
color: this.color
|
960
|
+
});
|
961
|
+
},
|
962
|
+
hide: function(e) {
|
963
|
+
if ((typeof e !== 'undefined') && e.target) {
|
964
|
+
// Prevent hide if triggered by an event and an element inside the colorpicker has been clicked/touched
|
965
|
+
if (
|
966
|
+
$(e.currentTarget).parents('.colorpicker').length > 0 ||
|
967
|
+
$(e.target).parents('.colorpicker').length > 0
|
968
|
+
) {
|
969
|
+
return false;
|
970
|
+
}
|
971
|
+
}
|
972
|
+
this.picker.addClass('colorpicker-hidden').removeClass('colorpicker-visible');
|
973
|
+
$(window).off('resize.colorpicker', this.reposition);
|
974
|
+
$(window.document).off({
|
975
|
+
'mousedown.colorpicker': this.hide
|
976
|
+
});
|
977
|
+
this.update();
|
978
|
+
this.element.trigger({
|
979
|
+
type: 'hidePicker',
|
980
|
+
color: this.color
|
981
|
+
});
|
982
|
+
},
|
983
|
+
updateData: function(val) {
|
984
|
+
val = val || this.color.toString(false, this.format);
|
985
|
+
this.element.data('color', val);
|
986
|
+
return val;
|
987
|
+
},
|
988
|
+
updateInput: function(val) {
|
989
|
+
val = val || this.color.toString(false, this.format);
|
990
|
+
if (this.input !== false) {
|
991
|
+
this.input.prop('value', val);
|
992
|
+
this.input.trigger('change');
|
993
|
+
}
|
994
|
+
return val;
|
995
|
+
},
|
996
|
+
updatePicker: function(val) {
|
997
|
+
if (typeof val !== 'undefined') {
|
998
|
+
this.color = this.createColor(val);
|
999
|
+
}
|
1000
|
+
var sl = (this.options.horizontal === false) ? this.options.sliders : this.options.slidersHorz;
|
1001
|
+
var icns = this.picker.find('i');
|
1002
|
+
if (icns.length === 0) {
|
1003
|
+
return;
|
1004
|
+
}
|
1005
|
+
if (this.options.horizontal === false) {
|
1006
|
+
sl = this.options.sliders;
|
1007
|
+
icns.eq(1).css('top', sl.hue.maxTop * (1 - this.color.value.h)).end()
|
1008
|
+
.eq(2).css('top', sl.alpha.maxTop * (1 - this.color.value.a));
|
1009
|
+
} else {
|
1010
|
+
sl = this.options.slidersHorz;
|
1011
|
+
icns.eq(1).css('left', sl.hue.maxLeft * (1 - this.color.value.h)).end()
|
1012
|
+
.eq(2).css('left', sl.alpha.maxLeft * (1 - this.color.value.a));
|
1013
|
+
}
|
1014
|
+
icns.eq(0).css({
|
1015
|
+
'top': sl.saturation.maxTop - this.color.value.b * sl.saturation.maxTop,
|
1016
|
+
'left': this.color.value.s * sl.saturation.maxLeft
|
1017
|
+
});
|
1018
|
+
|
1019
|
+
this.picker.find('.colorpicker-saturation')
|
1020
|
+
.css('backgroundColor', this.color.toHex(true, this.color.value.h, 1, 1, 1));
|
1021
|
+
|
1022
|
+
this.picker.find('.colorpicker-alpha')
|
1023
|
+
.css('backgroundColor', this.color.toHex(true));
|
1024
|
+
|
1025
|
+
this.picker.find('.colorpicker-color, .colorpicker-color div')
|
1026
|
+
.css('backgroundColor', this.color.toString(true, this.format));
|
1027
|
+
|
1028
|
+
return val;
|
1029
|
+
},
|
1030
|
+
updateComponent: function(val) {
|
1031
|
+
var color;
|
1032
|
+
|
1033
|
+
if (typeof val !== 'undefined') {
|
1034
|
+
color = this.createColor(val);
|
1035
|
+
} else {
|
1036
|
+
color = this.color;
|
1037
|
+
}
|
1038
|
+
|
1039
|
+
if (this.component !== false) {
|
1040
|
+
var icn = this.component.find('i').eq(0);
|
1041
|
+
if (icn.length > 0) {
|
1042
|
+
icn.css({
|
1043
|
+
'backgroundColor': color.toString(true, this.format)
|
1044
|
+
});
|
1045
|
+
} else {
|
1046
|
+
this.component.css({
|
1047
|
+
'backgroundColor': color.toString(true, this.format)
|
1048
|
+
});
|
1049
|
+
}
|
1050
|
+
}
|
1051
|
+
|
1052
|
+
return color.toString(false, this.format);
|
1053
|
+
},
|
1054
|
+
update: function(force) {
|
1055
|
+
var val;
|
1056
|
+
if ((this.getValue(false) !== false) || (force === true)) {
|
1057
|
+
// Update input/data only if the current value is not empty
|
1058
|
+
val = this.updateComponent();
|
1059
|
+
this.updateInput(val);
|
1060
|
+
this.updateData(val);
|
1061
|
+
this.updatePicker(); // only update picker if value is not empty
|
1062
|
+
}
|
1063
|
+
return val;
|
1064
|
+
|
1065
|
+
},
|
1066
|
+
setValue: function(val) { // set color manually
|
1067
|
+
this.color = this.createColor(val);
|
1068
|
+
this.update(true);
|
1069
|
+
this.element.trigger({
|
1070
|
+
type: 'changeColor',
|
1071
|
+
color: this.color,
|
1072
|
+
value: val
|
1073
|
+
});
|
1074
|
+
},
|
1075
|
+
/**
|
1076
|
+
* Creates a new color using the instance options
|
1077
|
+
* @protected
|
1078
|
+
* @param {String} val
|
1079
|
+
* @returns {Color}
|
1080
|
+
*/
|
1081
|
+
createColor: function(val) {
|
1082
|
+
return new Color(
|
1083
|
+
val ? val : null,
|
1084
|
+
this.options.colorSelectors,
|
1085
|
+
this.options.fallbackColor ? this.options.fallbackColor : this.color,
|
1086
|
+
this.options.fallbackFormat,
|
1087
|
+
this.options.hexNumberSignPrefix
|
1088
|
+
);
|
1089
|
+
},
|
1090
|
+
getValue: function(defaultValue) {
|
1091
|
+
defaultValue = (typeof defaultValue === 'undefined') ? this.options.fallbackColor : defaultValue;
|
1092
|
+
var val;
|
1093
|
+
if (this.hasInput()) {
|
1094
|
+
val = this.input.val();
|
1095
|
+
} else {
|
1096
|
+
val = this.element.data('color');
|
1097
|
+
}
|
1098
|
+
if ((val === undefined) || (val === '') || (val === null)) {
|
1099
|
+
// if not defined or empty, return default
|
1100
|
+
val = defaultValue;
|
1101
|
+
}
|
1102
|
+
return val;
|
1103
|
+
},
|
1104
|
+
hasInput: function() {
|
1105
|
+
return (this.input !== false);
|
1106
|
+
},
|
1107
|
+
isDisabled: function() {
|
1108
|
+
return this.disabled;
|
1109
|
+
},
|
1110
|
+
disable: function() {
|
1111
|
+
if (this.hasInput()) {
|
1112
|
+
this.input.prop('disabled', true);
|
1113
|
+
}
|
1114
|
+
this.disabled = true;
|
1115
|
+
this.element.trigger({
|
1116
|
+
type: 'disable',
|
1117
|
+
color: this.color,
|
1118
|
+
value: this.getValue()
|
1119
|
+
});
|
1120
|
+
return true;
|
1121
|
+
},
|
1122
|
+
enable: function() {
|
1123
|
+
if (this.hasInput()) {
|
1124
|
+
this.input.prop('disabled', false);
|
1125
|
+
}
|
1126
|
+
this.disabled = false;
|
1127
|
+
this.element.trigger({
|
1128
|
+
type: 'enable',
|
1129
|
+
color: this.color,
|
1130
|
+
value: this.getValue()
|
1131
|
+
});
|
1132
|
+
return true;
|
1133
|
+
},
|
1134
|
+
currentSlider: null,
|
1135
|
+
mousePointer: {
|
1136
|
+
left: 0,
|
1137
|
+
top: 0
|
1138
|
+
},
|
1139
|
+
mousedown: function(e) {
|
1140
|
+
if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {
|
1141
|
+
e.pageX = e.originalEvent.touches[0].pageX;
|
1142
|
+
e.pageY = e.originalEvent.touches[0].pageY;
|
1143
|
+
}
|
1144
|
+
e.stopPropagation();
|
1145
|
+
e.preventDefault();
|
1146
|
+
|
1147
|
+
var target = $(e.target);
|
1148
|
+
|
1149
|
+
//detect the slider and set the limits and callbacks
|
1150
|
+
var zone = target.closest('div');
|
1151
|
+
var sl = this.options.horizontal ? this.options.slidersHorz : this.options.sliders;
|
1152
|
+
if (!zone.is('.colorpicker')) {
|
1153
|
+
if (zone.is('.colorpicker-saturation')) {
|
1154
|
+
this.currentSlider = $.extend({}, sl.saturation);
|
1155
|
+
} else if (zone.is('.colorpicker-hue')) {
|
1156
|
+
this.currentSlider = $.extend({}, sl.hue);
|
1157
|
+
} else if (zone.is('.colorpicker-alpha')) {
|
1158
|
+
this.currentSlider = $.extend({}, sl.alpha);
|
1159
|
+
} else {
|
1160
|
+
return false;
|
1161
|
+
}
|
1162
|
+
var offset = zone.offset();
|
1163
|
+
//reference to guide's style
|
1164
|
+
this.currentSlider.guide = zone.find('i')[0].style;
|
1165
|
+
this.currentSlider.left = e.pageX - offset.left;
|
1166
|
+
this.currentSlider.top = e.pageY - offset.top;
|
1167
|
+
this.mousePointer = {
|
1168
|
+
left: e.pageX,
|
1169
|
+
top: e.pageY
|
1170
|
+
};
|
1171
|
+
//trigger mousemove to move the guide to the current position
|
1172
|
+
$(window.document).on({
|
1173
|
+
'mousemove.colorpicker': $.proxy(this.mousemove, this),
|
1174
|
+
'touchmove.colorpicker': $.proxy(this.mousemove, this),
|
1175
|
+
'mouseup.colorpicker': $.proxy(this.mouseup, this),
|
1176
|
+
'touchend.colorpicker': $.proxy(this.mouseup, this)
|
1177
|
+
}).trigger('mousemove');
|
1178
|
+
}
|
1179
|
+
return false;
|
1180
|
+
},
|
1181
|
+
mousemove: function(e) {
|
1182
|
+
if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {
|
1183
|
+
e.pageX = e.originalEvent.touches[0].pageX;
|
1184
|
+
e.pageY = e.originalEvent.touches[0].pageY;
|
1185
|
+
}
|
1186
|
+
e.stopPropagation();
|
1187
|
+
e.preventDefault();
|
1188
|
+
var left = Math.max(
|
1189
|
+
0,
|
1190
|
+
Math.min(
|
1191
|
+
this.currentSlider.maxLeft,
|
1192
|
+
this.currentSlider.left + ((e.pageX || this.mousePointer.left) - this.mousePointer.left)
|
1193
|
+
)
|
1194
|
+
);
|
1195
|
+
var top = Math.max(
|
1196
|
+
0,
|
1197
|
+
Math.min(
|
1198
|
+
this.currentSlider.maxTop,
|
1199
|
+
this.currentSlider.top + ((e.pageY || this.mousePointer.top) - this.mousePointer.top)
|
1200
|
+
)
|
1201
|
+
);
|
1202
|
+
this.currentSlider.guide.left = left + 'px';
|
1203
|
+
this.currentSlider.guide.top = top + 'px';
|
1204
|
+
if (this.currentSlider.callLeft) {
|
1205
|
+
this.color[this.currentSlider.callLeft].call(this.color, left / this.currentSlider.maxLeft);
|
1206
|
+
}
|
1207
|
+
if (this.currentSlider.callTop) {
|
1208
|
+
this.color[this.currentSlider.callTop].call(this.color, top / this.currentSlider.maxTop);
|
1209
|
+
}
|
1210
|
+
// Change format dynamically
|
1211
|
+
// Only occurs if user choose the dynamic format by
|
1212
|
+
// setting option format to false
|
1213
|
+
if (
|
1214
|
+
this.options.format === false &&
|
1215
|
+
(this.currentSlider.callTop === 'setAlpha' ||
|
1216
|
+
this.currentSlider.callLeft === 'setAlpha')
|
1217
|
+
) {
|
1218
|
+
|
1219
|
+
// Converting from hex / rgb to rgba
|
1220
|
+
if (this.color.value.a !== 1) {
|
1221
|
+
this.format = 'rgba';
|
1222
|
+
this.color.origFormat = 'rgba';
|
1223
|
+
}
|
1224
|
+
|
1225
|
+
// Converting from rgba to hex
|
1226
|
+
else {
|
1227
|
+
this.format = 'hex';
|
1228
|
+
this.color.origFormat = 'hex';
|
1229
|
+
}
|
1230
|
+
}
|
1231
|
+
this.update(true);
|
1232
|
+
|
1233
|
+
this.element.trigger({
|
1234
|
+
type: 'changeColor',
|
1235
|
+
color: this.color
|
1236
|
+
});
|
1237
|
+
return false;
|
1238
|
+
},
|
1239
|
+
mouseup: function(e) {
|
1240
|
+
e.stopPropagation();
|
1241
|
+
e.preventDefault();
|
1242
|
+
$(window.document).off({
|
1243
|
+
'mousemove.colorpicker': this.mousemove,
|
1244
|
+
'touchmove.colorpicker': this.mousemove,
|
1245
|
+
'mouseup.colorpicker': this.mouseup,
|
1246
|
+
'touchend.colorpicker': this.mouseup
|
1247
|
+
});
|
1248
|
+
return false;
|
1249
|
+
},
|
1250
|
+
change: function(e) {
|
1251
|
+
this.keyup(e);
|
1252
|
+
},
|
1253
|
+
keyup: function(e) {
|
1254
|
+
if ((e.keyCode === 38)) {
|
1255
|
+
if (this.color.value.a < 1) {
|
1256
|
+
this.color.value.a = Math.round((this.color.value.a + 0.01) * 100) / 100;
|
1257
|
+
}
|
1258
|
+
this.update(true);
|
1259
|
+
} else if ((e.keyCode === 40)) {
|
1260
|
+
if (this.color.value.a > 0) {
|
1261
|
+
this.color.value.a = Math.round((this.color.value.a - 0.01) * 100) / 100;
|
1262
|
+
}
|
1263
|
+
this.update(true);
|
1264
|
+
} else {
|
1265
|
+
this.color = this.createColor(this.input.val());
|
1266
|
+
// Change format dynamically
|
1267
|
+
// Only occurs if user choose the dynamic format by
|
1268
|
+
// setting option format to false
|
1269
|
+
if (this.color.origFormat && this.options.format === false) {
|
1270
|
+
this.format = this.color.origFormat;
|
1271
|
+
}
|
1272
|
+
if (this.getValue(false) !== false) {
|
1273
|
+
this.updateData();
|
1274
|
+
this.updateComponent();
|
1275
|
+
this.updatePicker();
|
1276
|
+
}
|
1277
|
+
}
|
1278
|
+
this.element.trigger({
|
1279
|
+
type: 'changeColor',
|
1280
|
+
color: this.color,
|
1281
|
+
value: this.input.val()
|
1282
|
+
});
|
1283
|
+
}
|
1284
|
+
};
|
1285
|
+
|
1286
|
+
$.colorpicker = Colorpicker;
|
1287
|
+
|
1288
|
+
$.fn.colorpicker = function(option) {
|
1289
|
+
var apiArgs = Array.prototype.slice.call(arguments, 1),
|
1290
|
+
isSingleElement = (this.length === 1),
|
1291
|
+
returnValue = null;
|
1292
|
+
|
1293
|
+
var $jq = this.each(function() {
|
1294
|
+
var $this = $(this),
|
1295
|
+
inst = $this.data('colorpicker'),
|
1296
|
+
options = ((typeof option === 'object') ? option : {});
|
1297
|
+
|
1298
|
+
if (!inst) {
|
1299
|
+
inst = new Colorpicker(this, options);
|
1300
|
+
$this.data('colorpicker', inst);
|
1301
|
+
}
|
1302
|
+
|
1303
|
+
if (typeof option === 'string') {
|
1304
|
+
if ($.isFunction(inst[option])) {
|
1305
|
+
returnValue = inst[option].apply(inst, apiArgs);
|
1306
|
+
} else { // its a property ?
|
1307
|
+
if (apiArgs.length) {
|
1308
|
+
// set property
|
1309
|
+
inst[option] = apiArgs[0];
|
1310
|
+
}
|
1311
|
+
returnValue = inst[option];
|
1312
|
+
}
|
1313
|
+
} else {
|
1314
|
+
returnValue = $this;
|
1315
|
+
}
|
1316
|
+
});
|
1317
|
+
return isSingleElement ? returnValue : $jq;
|
1318
|
+
};
|
1319
|
+
|
1320
|
+
$.fn.colorpicker.constructor = Colorpicker;
|
1321
|
+
|
1322
|
+
}));
|