integral 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +105 -0
- data/Rakefile +22 -0
- data/app/assets/images/integral/backend/data-unavailable.png +0 -0
- data/app/assets/images/integral/backend/logo.png +0 -0
- data/app/assets/images/integral/defaults/no_image_available.jpg +0 -0
- data/app/assets/images/integral/defaults/user_avatar.jpg +0 -0
- data/app/assets/images/integral/image-not-set.png +0 -0
- data/app/assets/images/integral/posts-hero-banner.jpg +0 -0
- data/app/assets/javascripts/ckeditor/loader.js.erb +6 -0
- data/app/assets/javascripts/ckeditor/my_config.js.erb +154 -0
- data/app/assets/javascripts/ckeditor/my_contents.sass +22 -0
- data/app/assets/javascripts/ckeditor/my_javascript.js +12 -0
- data/app/assets/javascripts/ckeditor/my_styles.js +5 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/az.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/bg.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ca.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/cs.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/da.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/de-ch.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/de.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/el.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/en-au.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/en.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/eo.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/es-mx.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/es.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/eu.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/fr.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/gl.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/hr.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/hu.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/it.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ja.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/km.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ko.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ku.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/mk.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/nb.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/nl.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/oc.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/pl.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/pt-br.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/pt.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ro.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ru.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/sk.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/sq.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/sv.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/tr.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ug.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/uk.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/vi.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/zh-cn.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/zh.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/plugin.js +218 -0
- data/app/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +232 -0
- data/app/assets/javascripts/ckeditor/plugins/autogrow/samples/autogrow.html +102 -0
- data/app/assets/javascripts/ckeditor/plugins/autolink/plugin.js +69 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/autocomplete.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/autoformat.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/commentselectedrange.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/searchcode.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/uncommentselectedrange.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +6 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcode.min.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/af.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ar.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/bg.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/bn.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/bs.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ca.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/cs.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/cy.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/da.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/de.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/el.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/en-au.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/en-ca.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/en-gb.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/en.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/eo.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/es.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/et.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/eu.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fa.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fi.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fo.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fr-ca.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fr.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/gl.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/gu.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/he.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/hi.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/hr.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/hu.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/is.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/it.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ja.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ka.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/km.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ko.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ku.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/lt.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/lv.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/mk.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/mn.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ms.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/nb.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/nl.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/no.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/pl.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/pt-br.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/pt.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ro.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ru.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sk.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sl.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sr-latn.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sr.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sv.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/th.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/tr.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ug.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/uk.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/vi.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/zh-cn.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/zh.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +1311 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-day.css +41 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-night.css +39 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/abcdef.css +32 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance-mobile.css +5 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +74 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-dark.css +38 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-light.css +38 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/bespin.css +34 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/blackboard.css +32 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +25 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/colorforth.css +33 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/dracula.css +40 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-dark.css +35 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-light.css +36 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +23 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/elegant.css +13 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +34 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/hopscotch.css +34 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/icecoder.css +43 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/isotope.css +34 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +47 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/liquibyte.css +95 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/material.css +53 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/mbo.css +37 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/mdn-like.css +46 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/midnight.css +43 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +36 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/neat.css +12 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/neo.css +43 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +27 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/panda-syntax.css +85 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-dark.css +38 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-light.css +38 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +52 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/railscasts.css +34 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +25 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/seti.css +44 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +168 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/the-matrix.css +30 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-bright.css +35 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-eighties.css +38 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/ttcn.css +64 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +32 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +34 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +53 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +43 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/yeti.css +44 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/zenburn.css +37 -0
- data/app/assets/javascripts/ckeditor/plugins/embed/icons/embed.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/embed/icons/hidpi/embed.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/embed/plugin.js +105 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/dialogs/embedbase.js +99 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/az.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/bg.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ca.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/cs.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/da.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/de-ch.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/de.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/en-au.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/en.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/eo.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/es-mx.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/es.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/eu.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/fr.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/gl.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/hr.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/hu.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/id.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/it.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ja.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ko.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ku.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/nb.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/nl.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/oc.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/pl.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/pt-br.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/pt.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ro.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ru.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/sk.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/sq.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/sv.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/tr.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ug.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/uk.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/zh-cn.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/zh.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/plugin.js +652 -0
- data/app/assets/javascripts/ckeditor/plugins/embedjs/plugin.js +110 -0
- data/app/assets/javascripts/ckeditor/plugins/lineutils/dev/dnd.html +172 -0
- data/app/assets/javascripts/ckeditor/plugins/lineutils/dev/magicfinger.html +285 -0
- data/app/assets/javascripts/ckeditor/plugins/lineutils/plugin.js +1018 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/cs.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/da.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/de-ch.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/de.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/en.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/eo.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/eu.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/fr.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/gl.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/id.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/it.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/km.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/ko.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/ku.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/nb.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/nl.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/pl.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/pt-br.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/pt.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/sv.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/tr.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/ug.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/uk.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/zh-cn.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/zh.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/plugin.js +923 -0
- data/app/assets/javascripts/ckeditor/plugins/notificationaggregator/plugin.js +548 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/dev/placeholder.html +60 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/dialogs/placeholder.js +49 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/icons/hidpi/placeholder.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/icons/placeholder.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/af.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ar.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/az.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/bg.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ca.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/cs.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/cy.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/da.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/de-ch.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/de.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/el.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/en-gb.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/en.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/eo.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/es-mx.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/es.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/et.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/eu.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fa.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fi.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fr-ca.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fr.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/gl.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/he.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/hr.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/hu.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/id.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/it.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ja.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/km.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ko.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ku.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/lv.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/nb.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/nl.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/no.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/oc.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pl.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pt-br.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pt.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ru.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/si.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sk.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sl.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sq.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sv.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/th.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/tr.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/tt.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ug.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/uk.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/vi.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/zh-cn.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/zh.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +99 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/samples/placeholder.html +75 -0
- data/app/assets/javascripts/ckeditor/plugins/strinsert/README.md +76 -0
- data/app/assets/javascripts/ckeditor/plugins/strinsert/bower.json +16 -0
- data/app/assets/javascripts/ckeditor/plugins/strinsert/plugin.js +107 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/contents.css +23 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/sample.jpg +0 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/contents.css +36 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/dialogs/simplebox.js +51 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/icons/simplebox.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/plugin.js +114 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/console.js +131 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/nestedwidgets.html +134 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/widgetstyles.html +144 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/images/handle.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/af.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ar.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/az.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/bg.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ca.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/cs.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/cy.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/da.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/de-ch.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/de.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/el.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/en-gb.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/en.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/eo.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/es-mx.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/es.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/eu.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/fa.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/fi.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/fr.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/gl.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/he.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/hr.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/hu.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/id.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/it.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ja.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/km.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ko.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ku.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/lv.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/nb.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/nl.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/no.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/oc.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/pl.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/pt-br.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/pt.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ru.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/sk.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/sl.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/sq.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/sv.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/tr.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/tt.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ug.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/uk.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/vi.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/zh-cn.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/zh.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/plugin.js +4147 -0
- data/app/assets/javascripts/ckeditor/plugins/widgetselection/plugin.js +366 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/css/wordcount.css +3 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ar.js +11 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ca.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/da.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/de.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/el.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/es.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/fi.js +14 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/fr.js +11 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/he.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/hr.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/it.js +14 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ja.js +14 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/jp.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/nl.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/no.js +10 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pl.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pt-br.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pt.js +9 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/sv.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/tr.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/zh-cn.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +407 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/samples/wordcount.html +61 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/samples/wordcountWithMaxCount.html +110 -0
- data/app/assets/javascripts/integral/backend.js +268 -0
- data/app/assets/javascripts/integral/backend/extensions.js +1 -0
- data/app/assets/javascripts/integral/backend/support/Chart.bundle.min.js +10 -0
- data/app/assets/javascripts/integral/frontend.js +60 -0
- data/app/assets/javascripts/integral/support/character_counter.js +67 -0
- data/app/assets/javascripts/integral/support/chart_manager.coffee +145 -0
- data/app/assets/javascripts/integral/support/click_to_copy.coffee +28 -0
- data/app/assets/javascripts/integral/support/confirm_modal.coffee +58 -0
- data/app/assets/javascripts/integral/support/date_picker.coffee +83 -0
- data/app/assets/javascripts/integral/support/date_picker/picker.date.js +1435 -0
- data/app/assets/javascripts/integral/support/date_picker/picker.js +1132 -0
- data/app/assets/javascripts/integral/support/gallery.coffee +82 -0
- data/app/assets/javascripts/integral/support/google_analytics.coffee +23 -0
- data/app/assets/javascripts/integral/support/grid.coffee +92 -0
- data/app/assets/javascripts/integral/support/header_anchors.coffee +22 -0
- data/app/assets/javascripts/integral/support/image-preview.coffee +14 -0
- data/app/assets/javascripts/integral/support/image_selector.coffee +43 -0
- data/app/assets/javascripts/integral/support/image_uploader.coffee +59 -0
- data/app/assets/javascripts/integral/support/lib/html.sortable.js +691 -0
- data/app/assets/javascripts/integral/support/lib/jquery.are-you-sure.js +231 -0
- data/app/assets/javascripts/integral/support/lib/jquery_form.js +11 -0
- data/app/assets/javascripts/integral/support/lib/js.cookie.js +165 -0
- data/app/assets/javascripts/integral/support/lib/materialize-tags.js +758 -0
- data/app/assets/javascripts/integral/support/lib/materialize.clockpicker.js +699 -0
- data/app/assets/javascripts/integral/support/lib/swiper.js +7719 -0
- data/app/assets/javascripts/integral/support/lib/typeahead.js +2451 -0
- data/app/assets/javascripts/integral/support/lib/underscore.js +6 -0
- data/app/assets/javascripts/integral/support/list.coffee +71 -0
- data/app/assets/javascripts/integral/support/list_item.coffee +249 -0
- data/app/assets/javascripts/integral/support/notification_manager.coffee +17 -0
- data/app/assets/javascripts/integral/support/record_selector.coffee +161 -0
- data/app/assets/javascripts/integral/support/remote_form.coffee +87 -0
- data/app/assets/javascripts/integral/support/responsive_swiper.coffee +26 -0
- data/app/assets/javascripts/integral/support/scroll_to_top.coffee +17 -0
- data/app/assets/javascripts/integral/support/slug_generator.coffee +49 -0
- data/app/assets/stylesheets/errors.css +1834 -0
- data/app/assets/stylesheets/integral/backend.sass +66 -0
- data/app/assets/stylesheets/integral/backend/_foundation_settings.scss +867 -0
- data/app/assets/stylesheets/integral/backend/dashboard-layout.scss +491 -0
- data/app/assets/stylesheets/integral/backend/devise.sass +40 -0
- data/app/assets/stylesheets/integral/backend/foundation_and_overrides.scss +56 -0
- data/app/assets/stylesheets/integral/backend/materialize-tags.sass +70 -0
- data/app/assets/stylesheets/integral/backend/notifications.sass +43 -0
- data/app/assets/stylesheets/integral/backend/overrides.sass +1 -0
- data/app/assets/stylesheets/integral/backend/shared.sass +770 -0
- data/app/assets/stylesheets/integral/emails.scss +19 -0
- data/app/assets/stylesheets/integral/emails/colors.sass +3 -0
- data/app/assets/stylesheets/integral/frontend.sass +26 -0
- data/app/assets/stylesheets/integral/frontend/_foundation_settings.scss +863 -0
- data/app/assets/stylesheets/integral/frontend/blog.sass +263 -0
- data/app/assets/stylesheets/integral/frontend/demo.sass +158 -0
- data/app/assets/stylesheets/integral/frontend/foundation_and_overrides.scss +56 -0
- data/app/assets/stylesheets/integral/frontend/layout.sass +66 -0
- data/app/assets/stylesheets/integral/frontend/overrides.sass +1 -0
- data/app/assets/stylesheets/integral/frontend/share_modal.sass +25 -0
- data/app/assets/stylesheets/integral/frontend/shared.sass +73 -0
- data/app/assets/stylesheets/integral/support/date-picker.scss +16 -0
- data/app/assets/stylesheets/integral/support/date_picker/_default.date.scss +452 -0
- data/app/assets/stylesheets/integral/support/date_picker/_default.scss +201 -0
- data/app/assets/stylesheets/integral/support/date_picker/_default.time.scss +125 -0
- data/app/assets/stylesheets/integral/support/date_picker/materialize_clockpicker.sass +220 -0
- data/app/assets/stylesheets/integral/support/gallery.sass +54 -0
- data/app/assets/stylesheets/integral/support/media-query-indicator.sass +25 -0
- data/app/assets/stylesheets/integral/support/mixins.sass +29 -0
- data/app/assets/stylesheets/integral/support/scroll-to-top.sass +19 -0
- data/app/assets/stylesheets/integral/support/swiper.css +618 -0
- data/app/assets/stylesheets/integral/wysiwyg.sass +13 -0
- data/app/controllers/integral/application_controller.rb +130 -0
- data/app/controllers/integral/backend/activities_controller.rb +55 -0
- data/app/controllers/integral/backend/base_controller.rb +123 -0
- data/app/controllers/integral/backend/images_controller.rb +120 -0
- data/app/controllers/integral/backend/lists_controller.rb +138 -0
- data/app/controllers/integral/backend/pages_controller.rb +142 -0
- data/app/controllers/integral/backend/posts_controller.rb +132 -0
- data/app/controllers/integral/backend/settings_controller.rb +53 -0
- data/app/controllers/integral/backend/static_pages_controller.rb +10 -0
- data/app/controllers/integral/backend/users_controller.rb +130 -0
- data/app/controllers/integral/blog_controller.rb +19 -0
- data/app/controllers/integral/contact_controller.rb +36 -0
- data/app/controllers/integral/pages_controller.rb +45 -0
- data/app/controllers/integral/posts_controller.rb +71 -0
- data/app/controllers/integral/tags_controller.rb +38 -0
- data/app/decorators/integral/image_decorator.rb +16 -0
- data/app/decorators/integral/list_decorator.rb +21 -0
- data/app/decorators/integral/page_decorator.rb +26 -0
- data/app/decorators/integral/post_decorator.rb +63 -0
- data/app/decorators/integral/user_decorator.rb +21 -0
- data/app/decorators/integral/version_decorator.rb +57 -0
- data/app/helpers/integral/application_helper.rb +52 -0
- data/app/helpers/integral/backend/base_helper.rb +72 -0
- data/app/helpers/integral/blog_helper.rb +26 -0
- data/app/helpers/integral/gallery_helper.rb +36 -0
- data/app/helpers/integral/mail_helper.rb +16 -0
- data/app/helpers/integral/social_helper.rb +123 -0
- data/app/helpers/integral/support_helper.rb +60 -0
- data/app/jobs/integral/application_job.rb +10 -0
- data/app/jobs/integral/newsletter_signup_job.rb +28 -0
- data/app/mailers/integral/contact_mailer.rb +56 -0
- data/app/models/ckeditor/asset.rb +8 -0
- data/app/models/ckeditor/attachment_file.rb +9 -0
- data/app/models/ckeditor/picture.rb +21 -0
- data/app/models/integral/application_record.rb +6 -0
- data/app/models/integral/basic.rb +11 -0
- data/app/models/integral/enquiry.rb +46 -0
- data/app/models/integral/image.rb +67 -0
- data/app/models/integral/image_version.rb +8 -0
- data/app/models/integral/link.rb +11 -0
- data/app/models/integral/list.rb +69 -0
- data/app/models/integral/list_item.rb +89 -0
- data/app/models/integral/list_version.rb +8 -0
- data/app/models/integral/newsletter_signup.rb +22 -0
- data/app/models/integral/object.rb +30 -0
- data/app/models/integral/page.rb +153 -0
- data/app/models/integral/page_version.rb +8 -0
- data/app/models/integral/post.rb +149 -0
- data/app/models/integral/post_version.rb +8 -0
- data/app/models/integral/post_viewing.rb +19 -0
- data/app/models/integral/role.rb +14 -0
- data/app/models/integral/role_assignment.rb +7 -0
- data/app/models/integral/settings.rb +5 -0
- data/app/models/integral/user.rb +59 -0
- data/app/models/integral/user_version.rb +8 -0
- data/app/models/integral/version.rb +31 -0
- data/app/models/paper_trail/version.rb +9 -0
- data/app/policies/integral/base_policy.rb +50 -0
- data/app/policies/integral/image_policy.rb +14 -0
- data/app/policies/integral/list_policy.rb +9 -0
- data/app/policies/integral/page_policy.rb +45 -0
- data/app/policies/integral/post_policy.rb +9 -0
- data/app/policies/integral/settings_policy.rb +17 -0
- data/app/policies/integral/user_policy.rb +17 -0
- data/app/policies/integral/version_policy.rb +19 -0
- data/app/uploaders/ckeditor_attachment_file_uploader.rb +34 -0
- data/app/uploaders/ckeditor_picture_uploader.rb +55 -0
- data/app/uploaders/integral/avatar_uploader.rb +9 -0
- data/app/uploaders/integral/image_uploader.rb +114 -0
- data/app/views/devise/invitations/edit.haml +17 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/devise/mailer/invitation_instructions.html.erb +13 -0
- data/app/views/devise/mailer/invitation_instructions.text.erb +12 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/passwords/edit.haml +17 -0
- data/app/views/devise/passwords/new.haml +12 -0
- data/app/views/devise/sessions/new.haml +18 -0
- data/app/views/devise/shared/_links.html.erb +25 -0
- data/app/views/integral/backend/activities/_grid.haml +23 -0
- data/app/views/integral/backend/activities/index.haml +15 -0
- data/app/views/integral/backend/activities/shared/_grid.haml +20 -0
- data/app/views/integral/backend/activities/shared/_listing.haml +14 -0
- data/app/views/integral/backend/activities/shared/_log.haml +56 -0
- data/app/views/integral/backend/activities/show.haml +18 -0
- data/app/views/integral/backend/images/_create_modal.haml +17 -0
- data/app/views/integral/backend/images/_form.haml +41 -0
- data/app/views/integral/backend/images/_grid.haml +16 -0
- data/app/views/integral/backend/images/edit.haml +3 -0
- data/app/views/integral/backend/images/index.haml +18 -0
- data/app/views/integral/backend/images/new.haml +1 -0
- data/app/views/integral/backend/lists/_child_fields.haml +26 -0
- data/app/views/integral/backend/lists/_form.haml +25 -0
- data/app/views/integral/backend/lists/_grid.haml +16 -0
- data/app/views/integral/backend/lists/_item_container.haml +26 -0
- data/app/views/integral/backend/lists/_item_modal.haml +46 -0
- data/app/views/integral/backend/lists/_list_item_fields.haml +26 -0
- data/app/views/integral/backend/lists/_manager.haml +14 -0
- data/app/views/integral/backend/lists/edit.haml +2 -0
- data/app/views/integral/backend/lists/index.haml +18 -0
- data/app/views/integral/backend/lists/new.haml +1 -0
- data/app/views/integral/backend/lists/show.haml +26 -0
- data/app/views/integral/backend/pages/_form.haml +52 -0
- data/app/views/integral/backend/pages/_grid.haml +21 -0
- data/app/views/integral/backend/pages/activities.haml +2 -0
- data/app/views/integral/backend/pages/activity.haml +1 -0
- data/app/views/integral/backend/pages/edit.html.haml +15 -0
- data/app/views/integral/backend/pages/index.haml +22 -0
- data/app/views/integral/backend/pages/new.haml +2 -0
- data/app/views/integral/backend/posts/_form.haml +57 -0
- data/app/views/integral/backend/posts/_grid.haml +25 -0
- data/app/views/integral/backend/posts/activities.haml +3 -0
- data/app/views/integral/backend/posts/activity.haml +1 -0
- data/app/views/integral/backend/posts/edit.haml +16 -0
- data/app/views/integral/backend/posts/index.haml +20 -0
- data/app/views/integral/backend/posts/new.haml +2 -0
- data/app/views/integral/backend/settings/_input.haml +4 -0
- data/app/views/integral/backend/settings/_section.haml +11 -0
- data/app/views/integral/backend/settings/index.haml +10 -0
- data/app/views/integral/backend/settings/sections/_general.haml +12 -0
- data/app/views/integral/backend/settings/sections/_lists.haml +4 -0
- data/app/views/integral/backend/settings/sections/_seo.haml +8 -0
- data/app/views/integral/backend/settings/sections/_social.haml +16 -0
- data/app/views/integral/backend/shared/_breadcrumbs.haml +9 -0
- data/app/views/integral/backend/shared/_empty_grid.haml +7 -0
- data/app/views/integral/backend/shared/_grid.haml +18 -0
- data/app/views/integral/backend/shared/_image_preview.haml +23 -0
- data/app/views/integral/backend/shared/_image_selector.haml +4 -0
- data/app/views/integral/backend/shared/_pagination.haml +1 -0
- data/app/views/integral/backend/shared/cards/_at_a_glance.haml +5 -0
- data/app/views/integral/backend/shared/cards/_welcome.haml +29 -0
- data/app/views/integral/backend/shared/graphs/_donut.haml +5 -0
- data/app/views/integral/backend/shared/graphs/_line.haml +5 -0
- data/app/views/integral/backend/shared/graphs/_no_data_available.haml +2 -0
- data/app/views/integral/backend/shared/record_selector/_collection.haml +13 -0
- data/app/views/integral/backend/shared/record_selector/_modal.haml +42 -0
- data/app/views/integral/backend/shared/record_selector/_record.haml +6 -0
- data/app/views/integral/backend/static_pages/_card.haml +24 -0
- data/app/views/integral/backend/static_pages/dashboard.haml +20 -0
- data/app/views/integral/backend/users/_form.haml +58 -0
- data/app/views/integral/backend/users/_grid.haml +19 -0
- data/app/views/integral/backend/users/edit.haml +3 -0
- data/app/views/integral/backend/users/index.haml +18 -0
- data/app/views/integral/backend/users/new.haml +2 -0
- data/app/views/integral/backend/users/show.haml +36 -0
- data/app/views/integral/contact_mailer/auto_reply.html.haml +16 -0
- data/app/views/integral/contact_mailer/auto_reply.text.erb +15 -0
- data/app/views/integral/contact_mailer/forward_enquiry.haml +12 -0
- data/app/views/integral/contact_mailer/forward_enquiry.text.erb +9 -0
- data/app/views/integral/pages/_demo.haml +188 -0
- data/app/views/integral/pages/templates/default.haml +6 -0
- data/app/views/integral/posts/_item.haml +16 -0
- data/app/views/integral/posts/index.haml +6 -0
- data/app/views/integral/posts/templates/default.haml +38 -0
- data/app/views/integral/shared/_blog_layout.haml +15 -0
- data/app/views/integral/shared/_blog_sidebar.haml +49 -0
- data/app/views/integral/shared/_breadcrumbs.haml +5 -0
- data/app/views/integral/shared/_media_query_indicator.haml +2 -0
- data/app/views/integral/shared/_scroll_to_top.haml +3 -0
- data/app/views/integral/shared/_share_modal.haml +20 -0
- data/app/views/integral/shared/_social_list_items.haml +41 -0
- data/app/views/integral/shared/_swiper_layout.haml +20 -0
- data/app/views/integral/shared/gallery/_placeholder.haml +7 -0
- data/app/views/integral/shared/gallery/_slide.haml +5 -0
- data/app/views/integral/shared/gallery/_thumb_slide.haml +2 -0
- data/app/views/integral/shared/gallery/gallery.haml +7 -0
- data/app/views/integral/tags/index.haml +6 -0
- data/app/views/integral/tags/show.haml +6 -0
- data/app/views/layouts/error.haml +12 -0
- data/app/views/layouts/integral/backend.html.haml +93 -0
- data/app/views/layouts/integral/backend/_create_dropdown.haml +30 -0
- data/app/views/layouts/integral/backend/_head.html.haml +17 -0
- data/app/views/layouts/integral/backend/_main_menu_items.haml +91 -0
- data/app/views/layouts/integral/frontend.html.haml +36 -0
- data/app/views/layouts/integral/frontend/_admin_bar.haml +25 -0
- data/app/views/layouts/integral/frontend/_footer.haml +23 -0
- data/app/views/layouts/integral/frontend/_header.haml +12 -0
- data/app/views/layouts/integral/login.haml +8 -0
- data/app/views/layouts/integral/mailer.html.inky-haml +17 -0
- data/app/views/layouts/integral/mailer/_footer.html.inky-haml +11 -0
- data/app/views/layouts/integral/mailer/_header.html.inky-haml +7 -0
- data/config/initializers/acts_as_taggable_on.rb +6 -0
- data/config/initializers/ckeditor.rb +51 -0
- data/config/initializers/client_side_validations.rb +20 -0
- data/config/initializers/compression.rb +46 -0
- data/config/initializers/devise.rb +308 -0
- data/config/initializers/extensions/ckeditor.rb +31 -0
- data/config/initializers/friendly_id.rb +88 -0
- data/config/initializers/gaffe.rb +3 -0
- data/config/initializers/simple_form.rb +169 -0
- data/config/initializers/simple_form/length_component.rb +36 -0
- data/config/locales/devise.en.yml +60 -0
- data/config/locales/devise_invitable.en.yml +31 -0
- data/config/locales/en.yml +477 -0
- data/config/locales/simple_form.en.yml +31 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20160129021044_devise_create_integral_users.rb +42 -0
- data/db/migrate/20160130051535_add_name_and_avatar_to_users.rb +6 -0
- data/db/migrate/20160201003936_add_roles.rb +13 -0
- data/db/migrate/20160302071241_create_integral_images.rb +13 -0
- data/db/migrate/20160311092506_create_ckeditor_assets.rb +26 -0
- data/db/migrate/20160318004136_create_integral_pages.rb +12 -0
- data/db/migrate/20160513033619_create_integral_posts.rb +12 -0
- data/db/migrate/20160514063048_add_slug_column_to_post.rb +6 -0
- data/db/migrate/20160516084702_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +31 -0
- data/db/migrate/20160516084703_add_missing_unique_indices.acts_as_taggable_on_engine.rb +20 -0
- data/db/migrate/20160516084704_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +15 -0
- data/db/migrate/20160516084705_add_missing_taggable_index.acts_as_taggable_on_engine.rb +10 -0
- data/db/migrate/20160516084706_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +10 -0
- data/db/migrate/20160519005736_add_image_to_posts.rb +5 -0
- data/db/migrate/20160519053329_create_friendly_id_slugs.rb +15 -0
- data/db/migrate/20160610021858_add_view_count_to_posts.rb +5 -0
- data/db/migrate/20160613035508_add_drafting_to_posts.rb +6 -0
- data/db/migrate/20160628050006_create_integral_post_viewings.rb +10 -0
- data/db/migrate/20160718011218_add_locale_to_integral_users.rb +5 -0
- data/db/migrate/20160722100113_devise_invitable_add_to_integral_users.rb +23 -0
- data/db/migrate/20160809115906_add_drafting_to_pages.rb +5 -0
- data/db/migrate/20160909124940_add_deleted_at_to_objects.rb +15 -0
- data/db/migrate/20161014175823_create_lists.rb +31 -0
- data/db/migrate/20161102094859_create_settings.rb +18 -0
- data/db/migrate/20170215012231_add_templates_to_pages.rb +5 -0
- data/db/migrate/20170425091312_add_image_processing_fields.rb +7 -0
- data/db/migrate/20170516033523_add_timestamps_to_lists.rb +6 -0
- data/db/migrate/20170608131624_add_file_size_to_images.rb +5 -0
- data/db/migrate/20170801182434_add_parent_to_pages.rb +5 -0
- data/db/migrate/20170922201940_add_image_id_to_posts.rb +9 -0
- data/db/migrate/20171008193414_create_post_versions.rb +21 -0
- data/db/migrate/20171030215146_create_page_versions.rb +20 -0
- data/db/migrate/20171030215154_create_user_versions.rb +20 -0
- data/db/migrate/20171030215202_create_list_versions.rb +20 -0
- data/db/migrate/20171123155010_create_integral_enquiries.rb +13 -0
- data/db/migrate/20171127141132_add_deleted_at_to_lists.rb +6 -0
- data/db/migrate/20171230213848_add_image_to_pages.rb +6 -0
- data/db/migrate/20180202010010_add_lock_version_to_integral_objects.rb +9 -0
- data/db/migrate/20180202010020_create_image_versions.rb +20 -0
- data/db/migrate/20180207174914_add_fields_to_lists.rb +7 -0
- data/db/migrate/20180223232512_create_integral_newsletter_signups.rb +11 -0
- data/db/migrate/20180306204912_add_admin_to_integral_users.rb +5 -0
- data/db/migrate/20180326224500_add_processed_to_enquiries_and_newsletters.rb +6 -0
- data/db/migrate/20180509101917_add_context_to_enquiries.rb +6 -0
- data/db/migrate/20180920030236_update_posts_and_pages_null.rb +6 -0
- data/db/migrate/20181011234446_add_preview_image_to_posts.rb +6 -0
- data/db/seeds.rb +53 -0
- data/lib/generators/integral/install_generator.rb +19 -0
- data/lib/generators/templates/app.yml +24 -0
- data/lib/generators/templates/carrierwave.rb +35 -0
- data/lib/generators/templates/carrierwave_backgrounder.rb +11 -0
- data/lib/generators/templates/integral.rb +129 -0
- data/lib/generators/templates/sitemap.rb +41 -0
- data/lib/integral.rb +155 -0
- data/lib/integral/acts_as_listable.rb +45 -0
- data/lib/integral/button_link_renderer.rb +54 -0
- data/lib/integral/chart_renderer/base.rb +80 -0
- data/lib/integral/chart_renderer/donut.rb +21 -0
- data/lib/integral/chart_renderer/line.rb +24 -0
- data/lib/integral/content_renderer.rb +78 -0
- data/lib/integral/engine.rb +124 -0
- data/lib/integral/foundation_builder.rb +33 -0
- data/lib/integral/google_tag_manager.rb +33 -0
- data/lib/integral/grids/activities_grid.rb +37 -0
- data/lib/integral/grids/images_grid.rb +21 -0
- data/lib/integral/grids/lists_grid.rb +21 -0
- data/lib/integral/grids/pages_grid.rb +27 -0
- data/lib/integral/grids/posts_grid.rb +32 -0
- data/lib/integral/grids/users_grid.rb +22 -0
- data/lib/integral/list_item_renderer.rb +204 -0
- data/lib/integral/list_renderer.rb +91 -0
- data/lib/integral/middleware/page_router.rb +84 -0
- data/lib/integral/partial_list_item_renderer.rb +40 -0
- data/lib/integral/router.rb +106 -0
- data/lib/integral/slack_bot.rb +45 -0
- data/lib/integral/swiper_list_renderer.rb +30 -0
- data/lib/integral/version.rb +5 -0
- data/lib/integral/widgets/recent_posts.rb +41 -0
- data/lib/integral/widgets/swiper_list.rb +40 -0
- data/lib/tasks/integral_tasks.rake +57 -0
- data/lib/templates/erb/scaffold/_form.html.erb +13 -0
- data/spec/factories.rb +114 -0
- data/spec/support/image.jpg +0 -0
- metadata +1734 -0
@@ -0,0 +1,60 @@
|
|
1
|
+
//= require jquery
|
2
|
+
//= require rails-ujs
|
3
|
+
//= require turbolinks
|
4
|
+
//= require nprogress
|
5
|
+
//= require nprogress-turbolinks
|
6
|
+
//= require foundation
|
7
|
+
//= require i18n
|
8
|
+
//= require i18n/translations
|
9
|
+
//= require toastr
|
10
|
+
//= require rails.validations
|
11
|
+
//= require rails.validations.simple_form
|
12
|
+
//= require integral/support/date_picker/picker
|
13
|
+
//= require integral/support/date_picker/picker.date
|
14
|
+
//= require integral/support/date_picker
|
15
|
+
//= require integral/support/click_to_copy
|
16
|
+
//= require integral/support/google_analytics
|
17
|
+
//= require integral/support/header_anchors
|
18
|
+
//= require integral/support/scroll_to_top
|
19
|
+
//= require integral/support/remote_form
|
20
|
+
|
21
|
+
// Initialize Page
|
22
|
+
function ready() {
|
23
|
+
if (window.initialized == true) {
|
24
|
+
return;
|
25
|
+
} else {
|
26
|
+
window.initialized = true;
|
27
|
+
}
|
28
|
+
|
29
|
+
// Initialize foundation
|
30
|
+
$(document).foundation();
|
31
|
+
|
32
|
+
ClickToCopy.init();
|
33
|
+
ScrollToTop.init();
|
34
|
+
HeaderAnchors.init();
|
35
|
+
new RemoteForm($('.remote-form'));
|
36
|
+
new DatePicker('.datepicker');
|
37
|
+
GoogleAnalytics.trackRead();
|
38
|
+
};
|
39
|
+
|
40
|
+
// Initial Page load event handler
|
41
|
+
$(document).ready(ready);
|
42
|
+
|
43
|
+
// User navigates using Turbolinks
|
44
|
+
document.addEventListener("turbolinks:load", ready);
|
45
|
+
|
46
|
+
// User navigates using Turbolinks
|
47
|
+
document.addEventListener("turbolinks:visit", function() {
|
48
|
+
window.initialized = false;
|
49
|
+
});
|
50
|
+
|
51
|
+
document.addEventListener("turbolinks:render", function() {
|
52
|
+
GoogleAnalytics.virtualPageView();
|
53
|
+
|
54
|
+
// Fix Sticky for TL
|
55
|
+
setTimeout(function(){
|
56
|
+
$(window).trigger('load.zf.sticky');
|
57
|
+
}, 2000);
|
58
|
+
});
|
59
|
+
|
60
|
+
|
@@ -0,0 +1,67 @@
|
|
1
|
+
// This was originally sourced from MaterializeCSS & edited
|
2
|
+
|
3
|
+
jQuery.fn.characterCounter = function(){
|
4
|
+
return this.each(function(){
|
5
|
+
var $input = $(this);
|
6
|
+
var $counterElement = $input.parent().find('span[class="character-counter"]');
|
7
|
+
|
8
|
+
// character counter has already been added appended to the parent container
|
9
|
+
if ($counterElement.length) {
|
10
|
+
return;
|
11
|
+
}
|
12
|
+
|
13
|
+
var itHasLengthAttribute = $input.attr('maxlength') != undefined;
|
14
|
+
|
15
|
+
if(itHasLengthAttribute){
|
16
|
+
$input.on('input', updateCounter);
|
17
|
+
$input.on('focus', updateCounter);
|
18
|
+
$input.on('blur', removeCounterElement);
|
19
|
+
|
20
|
+
addCounterElement($input);
|
21
|
+
}
|
22
|
+
});
|
23
|
+
};
|
24
|
+
|
25
|
+
function updateCounter(){
|
26
|
+
var maxLength = +$(this).attr('maxlength'),
|
27
|
+
actualLength = this.value.length,
|
28
|
+
isValidLength = actualLength <= maxLength;
|
29
|
+
|
30
|
+
$(this).parent().find('span[class="character-counter"]')
|
31
|
+
.html( actualLength + '/' + maxLength);
|
32
|
+
|
33
|
+
addInputStyle(isValidLength, $(this));
|
34
|
+
}
|
35
|
+
|
36
|
+
function addCounterElement($input) {
|
37
|
+
var $counterElement = $input.parent().find('span[class="character-counter"]');
|
38
|
+
|
39
|
+
if ($counterElement.length) {
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
|
43
|
+
$counterElement = $('<span/>')
|
44
|
+
.addClass('character-counter')
|
45
|
+
.css('float','right')
|
46
|
+
.css('font-size','12px')
|
47
|
+
.css('margin-top', '-.5rem')
|
48
|
+
.css('height', 1);
|
49
|
+
|
50
|
+
$input.after($counterElement);
|
51
|
+
}
|
52
|
+
|
53
|
+
function removeCounterElement(){
|
54
|
+
$(this).parent().find('span[class="character-counter"]').html('');
|
55
|
+
}
|
56
|
+
|
57
|
+
function addInputStyle(isValidLength, $input){
|
58
|
+
var inputHasInvalidClass = $input.hasClass('invalid');
|
59
|
+
if (isValidLength && inputHasInvalidClass) {
|
60
|
+
$input.removeClass('invalid');
|
61
|
+
}
|
62
|
+
else if(!isValidLength && !inputHasInvalidClass){
|
63
|
+
$input.removeClass('valid');
|
64
|
+
$input.addClass('invalid');
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
@@ -0,0 +1,145 @@
|
|
1
|
+
# Handles chart manipulation
|
2
|
+
# http://www.chartjs.org/
|
3
|
+
class this.ChartManager
|
4
|
+
@colors = [
|
5
|
+
'#1b8ecf',
|
6
|
+
'#316498',
|
7
|
+
'#2d4a67',
|
8
|
+
'#17212b'
|
9
|
+
]
|
10
|
+
|
11
|
+
@randomScalingFactor: ->
|
12
|
+
Math.round(Math.random() * 100)
|
13
|
+
|
14
|
+
constructor: ->
|
15
|
+
@set_defaults()
|
16
|
+
@renderChart(element) for element in $('canvas[data-chart]')
|
17
|
+
|
18
|
+
# Render chart from supplied element
|
19
|
+
renderChart: (element) ->
|
20
|
+
dataset = @parseData(element)
|
21
|
+
|
22
|
+
config = switch element.dataset.chartType
|
23
|
+
when 'donut' then @donutChart(element, dataset)
|
24
|
+
when 'line' then @lineChart(element, dataset)
|
25
|
+
else @respond_to_invalid_chart_type()
|
26
|
+
|
27
|
+
new Chart(element, config)
|
28
|
+
|
29
|
+
# Render data for donut chart from supplied element
|
30
|
+
# http://www.chartjs.org/docs/latest/charts/doughnut.html
|
31
|
+
#
|
32
|
+
# @return [Hash] config created from parameters to create donut chart
|
33
|
+
donutChart: (element, dataset) ->
|
34
|
+
{
|
35
|
+
type: 'doughnut',
|
36
|
+
data: {
|
37
|
+
datasets: [{
|
38
|
+
data: _.map dataset[0]['data'], (item) ->
|
39
|
+
item.value
|
40
|
+
backgroundColor: ChartManager.colors
|
41
|
+
}],
|
42
|
+
labels: _.map dataset[0]['data'], (item) ->
|
43
|
+
item.label
|
44
|
+
},
|
45
|
+
options: {
|
46
|
+
tooltips: {
|
47
|
+
callbacks: {
|
48
|
+
label: (tooltipItem, data) ->
|
49
|
+
data.labels[tooltipItem.index]
|
50
|
+
}
|
51
|
+
},
|
52
|
+
responsive: true,
|
53
|
+
legend: {
|
54
|
+
position: 'right'
|
55
|
+
},
|
56
|
+
title: {
|
57
|
+
display: false
|
58
|
+
},
|
59
|
+
animation: {
|
60
|
+
animateScale: true,
|
61
|
+
animateRotate: true
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
# Render data for line chart from supplied element
|
67
|
+
# http://www.chartjs.org/docs/latest/charts/line.html
|
68
|
+
#
|
69
|
+
# @return [Hash] config created from parameters to create line chart
|
70
|
+
lineChart: (element, rawDataset) ->
|
71
|
+
chartData = _.map rawDataset, (item, i) ->
|
72
|
+
{
|
73
|
+
label: item['label'],
|
74
|
+
data: _.map item['data'], (item) ->
|
75
|
+
item.value
|
76
|
+
backgroundColor: ChartManager.colors[i],
|
77
|
+
borderColor: ChartManager.colors[i],
|
78
|
+
borderWidth: 1,
|
79
|
+
pointRadius: 2,
|
80
|
+
fill: false
|
81
|
+
}
|
82
|
+
|
83
|
+
{
|
84
|
+
type: 'line',
|
85
|
+
data: {
|
86
|
+
labels: element.dataset.chartLabels.split(',')
|
87
|
+
datasets: chartData
|
88
|
+
},
|
89
|
+
options: {
|
90
|
+
scales: {
|
91
|
+
xAxes: [{
|
92
|
+
gridLines: {
|
93
|
+
display: false,
|
94
|
+
color: '#d4dfef',
|
95
|
+
drawBorder: false
|
96
|
+
}
|
97
|
+
}],
|
98
|
+
yAxes: [{
|
99
|
+
ticks: {
|
100
|
+
maxTicksLimit: 4
|
101
|
+
},
|
102
|
+
gridLines: {
|
103
|
+
color: '#d4dfef',
|
104
|
+
drawBorder: false,
|
105
|
+
zeroLineColor: '#d4dfef'
|
106
|
+
}
|
107
|
+
}]
|
108
|
+
},
|
109
|
+
responsive: true,
|
110
|
+
legend: {
|
111
|
+
position: 'bottom'
|
112
|
+
},
|
113
|
+
title:{
|
114
|
+
display: false
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
# Response when an invalid chart type is supplied
|
120
|
+
respond_to_invalid_chart_type: ->
|
121
|
+
console.log 'Invalid chart type supplied.'
|
122
|
+
|
123
|
+
# Set ChartJS defaults
|
124
|
+
set_defaults: ->
|
125
|
+
Chart.defaults.global.defaultFontColor = '#17212b';
|
126
|
+
Chart.defaults.global.defaultFontFamily = "'Nunito', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif"
|
127
|
+
|
128
|
+
# Parse chart data from element markup
|
129
|
+
parseData: (element) ->
|
130
|
+
dataset = []
|
131
|
+
|
132
|
+
$(element).find('ul').each (i, elementSet) =>
|
133
|
+
dSet = {}
|
134
|
+
dSet['data'] = []
|
135
|
+
dSet['label'] = elementSet.dataset.chartLabel
|
136
|
+
|
137
|
+
$(elementSet).find('li').each (i, elementItem) =>
|
138
|
+
dItem = $(elementItem)
|
139
|
+
dSet['data'].push {
|
140
|
+
value: dItem.data('value'),
|
141
|
+
label: dItem.text()
|
142
|
+
}
|
143
|
+
dataset.push dSet
|
144
|
+
dataset
|
145
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class this.ClickToCopy
|
2
|
+
# Create flashes for all those found within markup
|
3
|
+
@init: ->
|
4
|
+
$('.copy-url').click (ev) ->
|
5
|
+
ev.preventDefault()
|
6
|
+
target = $(ev.currentTarget)
|
7
|
+
|
8
|
+
# Create hidden input to copy the URL from
|
9
|
+
hiddenInput = document.createElement("textarea")
|
10
|
+
hiddenInput.style.position = "absolute"
|
11
|
+
hiddenInput.style.left = "-9999px"
|
12
|
+
hiddenInput.style.top = "0"
|
13
|
+
hiddenInput.id = $.now()
|
14
|
+
document.body.appendChild(hiddenInput)
|
15
|
+
|
16
|
+
# Add text into hidden input & copy it
|
17
|
+
hiddenInput.textContent = target.attr('href')
|
18
|
+
hiddenInput.focus()
|
19
|
+
hiddenInput.setSelectionRange(0, hiddenInput.value.length)
|
20
|
+
document.execCommand("copy")
|
21
|
+
|
22
|
+
# Notify user URL has been copied
|
23
|
+
targetSpan = target.find('span')
|
24
|
+
originalText = targetSpan.text()
|
25
|
+
targetSpan.text(I18n.t('integral.actions.copied'))
|
26
|
+
window.setTimeout ->
|
27
|
+
targetSpan.text(originalText)
|
28
|
+
, 300
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Present confirmation dialog to user
|
2
|
+
$.rails.showConfirmationDialog = (link) ->
|
3
|
+
message = link.data("confirm")
|
4
|
+
modal = $($.rails.appendConfirmationDialog(link, message))
|
5
|
+
new Foundation.Reveal(modal)
|
6
|
+
modal.foundation('open')
|
7
|
+
|
8
|
+
# Build confirmation Dialog
|
9
|
+
$.rails.buildConfirmationDialog = (message, modalId, confirmBtnId, cancelBtnId) ->
|
10
|
+
"<div class='reveal dialog small' id='#{modalId}' data-reveal>
|
11
|
+
<div class='modal-header'>
|
12
|
+
<h4>Confirmation</h4>
|
13
|
+
</div>
|
14
|
+
<div class='modal-content'>
|
15
|
+
<p>#{message}</p>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class='modal-footer'>
|
19
|
+
<a id='#{cancelBtnId}' class='button secondary hollow'>#{I18n.t('integral.backend.confirmation_modal.cancel')}</a>
|
20
|
+
<a id='#{confirmBtnId}' class='button primary'>#{I18n.t('integral.backend.confirmation_modal.confirm')}</a>
|
21
|
+
</div>
|
22
|
+
<button class='close-button' data-close aria-label='Close modal' type='button'>
|
23
|
+
<span aria-hidden='true'>×</span>
|
24
|
+
</button>
|
25
|
+
</div>"
|
26
|
+
|
27
|
+
# Add confirmation dialog to DOM and setup event listeners
|
28
|
+
$.rails.appendConfirmationDialog = (link, message) ->
|
29
|
+
id = Date.now()
|
30
|
+
modalId = "rails_confirm_modal_#{id}"
|
31
|
+
confirmBtnId = "rails_confirm_modal_#{id}_confirm_btn"
|
32
|
+
cancelBtnId = "rails_confirm_modal_#{id}_cancel_btn"
|
33
|
+
modalSelector = "##{modalId}"
|
34
|
+
|
35
|
+
confirmationDialogContents = $.rails.buildConfirmationDialog(message, modalId, confirmBtnId, cancelBtnId)
|
36
|
+
$(confirmationDialogContents).appendTo 'body'
|
37
|
+
|
38
|
+
$("##{confirmBtnId}").click ->
|
39
|
+
$.rails.confirmed(link)
|
40
|
+
$(modalSelector).foundation('close')
|
41
|
+
|
42
|
+
$("##{cancelBtnId}").click =>
|
43
|
+
$(modalSelector).foundation('close')
|
44
|
+
|
45
|
+
modalSelector
|
46
|
+
|
47
|
+
# Handle user confirmation of confirm modal
|
48
|
+
$.rails.confirmed = (link) ->
|
49
|
+
link.data('confirm', '')
|
50
|
+
link.trigger("click.rails")
|
51
|
+
|
52
|
+
# Override the default confirm dialog by rails
|
53
|
+
$.rails.allowAction = (link) ->
|
54
|
+
return true if link.data('confirm') == '' || link.data('confirm') == undefined
|
55
|
+
|
56
|
+
$.rails.showConfirmationDialog(link)
|
57
|
+
false
|
58
|
+
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# Represents Date Picker (PickADate)
|
2
|
+
class this.DatePicker
|
3
|
+
@initDateRanges: ->
|
4
|
+
$('[data-date-picker-end-element]').each (index, dpStartElement) ->
|
5
|
+
$dpStartElement = $(dpStartElement)
|
6
|
+
dpStart = $dpStartElement.pickadate('picker')
|
7
|
+
$dpEndElement = $('#' + $dpStartElement.data().datePickerEndElement)
|
8
|
+
dpEnd = $dpEndElement.pickadate('picker')
|
9
|
+
|
10
|
+
# Check if there’s a “from” or “to” date to start with.
|
11
|
+
if dpStart.get('value')
|
12
|
+
minimumDate = new Date(dpStart.get('select').obj.valueOf() + 86400000)
|
13
|
+
dpEnd.set('min', minimumDate)
|
14
|
+
if dpEnd.get('value')
|
15
|
+
maximumDate = new Date(dpEnd.get('select').obj.valueOf() - 86400000)
|
16
|
+
dpStart.set('max', maximumDate)
|
17
|
+
|
18
|
+
# When something is selected, update the “from” and “to” limits.
|
19
|
+
dpStart.on 'set', (event) =>
|
20
|
+
if event.select
|
21
|
+
minimumDate = new Date(dpStart.get('select').obj.valueOf() + 86400000)
|
22
|
+
dpEnd.set('min', minimumDate)
|
23
|
+
|
24
|
+
dpEnd.on 'set', (event) =>
|
25
|
+
if event.select
|
26
|
+
maximumDate = new Date(dpEnd.get('select').obj.valueOf() - 86400000)
|
27
|
+
dpStart.set('max', maximumDate)
|
28
|
+
else if 'clear' of event
|
29
|
+
dpStart.set('max', false)
|
30
|
+
|
31
|
+
constructor: (selector, opts={}) ->
|
32
|
+
@selector = selector
|
33
|
+
@opts = opts
|
34
|
+
|
35
|
+
@_setLanguage()
|
36
|
+
@_initializeDatePicker()
|
37
|
+
|
38
|
+
_initializeDatePicker: ->
|
39
|
+
$(@selector).each (i, dp) =>
|
40
|
+
dp = $(dp)
|
41
|
+
|
42
|
+
minRaw = dp[0].min
|
43
|
+
maxRaw = dp[0].max
|
44
|
+
minDate = new Date minRaw if minRaw
|
45
|
+
maxDate = new Date maxRaw if maxRaw
|
46
|
+
|
47
|
+
dp.pickadate
|
48
|
+
min: minDate
|
49
|
+
max: maxDate
|
50
|
+
disable: @getDisabledDates(dp)
|
51
|
+
container: @getContainer(dp)
|
52
|
+
closeOnSelect: true
|
53
|
+
format: "yyyy-mm-dd"
|
54
|
+
onOpen: @opts.onOpen
|
55
|
+
onClose: @opts.onClose
|
56
|
+
|
57
|
+
getContainer: (dp) ->
|
58
|
+
dp.data('date-picker-container')
|
59
|
+
|
60
|
+
getDisabledDates: (dp) ->
|
61
|
+
data = dp.data('disabled-dates')
|
62
|
+
return [] if not data
|
63
|
+
|
64
|
+
dates = []
|
65
|
+
for date in data.split(',')
|
66
|
+
dates.push new Date(date)
|
67
|
+
|
68
|
+
dates
|
69
|
+
|
70
|
+
# TODO: Change this to I18n
|
71
|
+
_setLanguage: ->
|
72
|
+
$.extend($.fn.pickadate.defaults, {
|
73
|
+
monthsFull: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ],
|
74
|
+
monthsShort: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ],
|
75
|
+
weekdaysFull: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ],
|
76
|
+
weekdaysShort: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],
|
77
|
+
weekdaysLetter: [ 'S', 'M', 'T', 'W', 'T', 'F', 'S' ],
|
78
|
+
today: 'Today',
|
79
|
+
clear: 'Clear',
|
80
|
+
close: 'Close',
|
81
|
+
firstDay: 1,
|
82
|
+
})
|
83
|
+
|
@@ -0,0 +1,1435 @@
|
|
1
|
+
/*!
|
2
|
+
* Date picker for pickadate.js v3.5.0
|
3
|
+
* http://amsul.github.io/pickadate.js/date.htm
|
4
|
+
*/
|
5
|
+
|
6
|
+
(function ( factory ) {
|
7
|
+
|
8
|
+
// AMD.
|
9
|
+
if ( typeof define == 'function' && define.amd )
|
10
|
+
define( ['picker', 'jquery'], factory )
|
11
|
+
|
12
|
+
// Node.js/browserify.
|
13
|
+
else if ( typeof exports == 'object' )
|
14
|
+
module.exports = factory( require('./picker.js'), require('jquery') )
|
15
|
+
|
16
|
+
// Browser globals.
|
17
|
+
else factory( Picker, jQuery )
|
18
|
+
|
19
|
+
}(function( Picker, $ ) {
|
20
|
+
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Globals and constants
|
24
|
+
*/
|
25
|
+
var DAYS_IN_WEEK = 7,
|
26
|
+
WEEKS_IN_CALENDAR = 6,
|
27
|
+
_ = Picker._
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
/**
|
32
|
+
* The date picker constructor
|
33
|
+
*/
|
34
|
+
function DatePicker( picker, settings ) {
|
35
|
+
|
36
|
+
var calendar = this,
|
37
|
+
element = picker.$node[ 0 ],
|
38
|
+
elementValue = element.value,
|
39
|
+
elementDataValue = picker.$node.data( 'value' ),
|
40
|
+
valueString = elementDataValue || elementValue,
|
41
|
+
formatString = elementDataValue ? settings.formatSubmit : settings.format,
|
42
|
+
isRTL = function() {
|
43
|
+
|
44
|
+
return element.currentStyle ?
|
45
|
+
|
46
|
+
// For IE.
|
47
|
+
element.currentStyle.direction == 'rtl' :
|
48
|
+
|
49
|
+
// For normal browsers.
|
50
|
+
getComputedStyle( picker.$root[0] ).direction == 'rtl'
|
51
|
+
}
|
52
|
+
|
53
|
+
calendar.settings = settings
|
54
|
+
calendar.$node = picker.$node
|
55
|
+
|
56
|
+
// The queue of methods that will be used to build item objects.
|
57
|
+
calendar.queue = {
|
58
|
+
min: 'measure create',
|
59
|
+
max: 'measure create',
|
60
|
+
now: 'now create',
|
61
|
+
select: 'parse create validate',
|
62
|
+
highlight: 'parse navigate create validate',
|
63
|
+
view: 'parse create validate viewset',
|
64
|
+
disable: 'deactivate',
|
65
|
+
enable: 'activate'
|
66
|
+
}
|
67
|
+
|
68
|
+
// The component's item object.
|
69
|
+
calendar.item = {}
|
70
|
+
|
71
|
+
calendar.item.clear = null
|
72
|
+
calendar.item.disable = ( settings.disable || [] ).slice( 0 )
|
73
|
+
calendar.item.enable = -(function( collectionDisabled ) {
|
74
|
+
return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1
|
75
|
+
})( calendar.item.disable )
|
76
|
+
|
77
|
+
calendar.
|
78
|
+
set( 'min', settings.min ).
|
79
|
+
set( 'max', settings.max ).
|
80
|
+
set( 'now' )
|
81
|
+
|
82
|
+
// When there’s a value, set the `select`, which in turn
|
83
|
+
// also sets the `highlight` and `view`.
|
84
|
+
if ( valueString ) {
|
85
|
+
calendar.set( 'select', valueString, { format: formatString })
|
86
|
+
}
|
87
|
+
|
88
|
+
// If there’s no value, default to highlighting “today”.
|
89
|
+
else {
|
90
|
+
calendar.
|
91
|
+
set( 'select', null ).
|
92
|
+
set( 'highlight', calendar.item.now )
|
93
|
+
}
|
94
|
+
|
95
|
+
|
96
|
+
// The keycode to movement mapping.
|
97
|
+
calendar.key = {
|
98
|
+
40: 7, // Down
|
99
|
+
38: -7, // Up
|
100
|
+
39: function() { return isRTL() ? -1 : 1 }, // Right
|
101
|
+
37: function() { return isRTL() ? 1 : -1 }, // Left
|
102
|
+
go: function( timeChange ) {
|
103
|
+
var highlightedObject = calendar.item.highlight,
|
104
|
+
targetDate = new Date( highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange )
|
105
|
+
calendar.set(
|
106
|
+
'highlight',
|
107
|
+
targetDate,
|
108
|
+
{ interval: timeChange }
|
109
|
+
)
|
110
|
+
this.render()
|
111
|
+
}
|
112
|
+
}
|
113
|
+
|
114
|
+
|
115
|
+
// Bind some picker events.
|
116
|
+
picker.
|
117
|
+
on( 'render', function() {
|
118
|
+
picker.$root.find( '.' + settings.klass.selectMonth ).on( 'change', function() {
|
119
|
+
var value = this.value
|
120
|
+
if ( value ) {
|
121
|
+
picker.set( 'highlight', [ picker.get( 'view' ).year, value, picker.get( 'highlight' ).date ] )
|
122
|
+
picker.$root.find( '.' + settings.klass.selectMonth ).trigger( 'focus' )
|
123
|
+
}
|
124
|
+
})
|
125
|
+
picker.$root.find( '.' + settings.klass.selectYear ).on( 'change', function() {
|
126
|
+
var value = this.value
|
127
|
+
if ( value ) {
|
128
|
+
picker.set( 'highlight', [ value, picker.get( 'view' ).month, picker.get( 'highlight' ).date ] )
|
129
|
+
picker.$root.find( '.' + settings.klass.selectYear ).trigger( 'focus' )
|
130
|
+
}
|
131
|
+
})
|
132
|
+
}, 1 ).
|
133
|
+
on( 'open', function() {
|
134
|
+
var includeToday = ''
|
135
|
+
if ( calendar.disabled( calendar.get('now') ) ) {
|
136
|
+
includeToday = ':not(.' + settings.klass.buttonToday + ')'
|
137
|
+
}
|
138
|
+
picker.$root.find( 'button' + includeToday + ', select' ).attr( 'disabled', false )
|
139
|
+
}, 1 ).
|
140
|
+
on( 'close', function() {
|
141
|
+
picker.$root.find( 'button, select' ).attr( 'disabled', true )
|
142
|
+
}, 1 )
|
143
|
+
|
144
|
+
} //DatePicker
|
145
|
+
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Set a datepicker item object.
|
149
|
+
*/
|
150
|
+
DatePicker.prototype.set = function( type, value, options ) {
|
151
|
+
|
152
|
+
var calendar = this,
|
153
|
+
calendarItem = calendar.item
|
154
|
+
|
155
|
+
// If the value is `null` just set it immediately.
|
156
|
+
if ( value === null ) {
|
157
|
+
if ( type == 'clear' ) type = 'select'
|
158
|
+
calendarItem[ type ] = value
|
159
|
+
return calendar
|
160
|
+
}
|
161
|
+
|
162
|
+
// Otherwise go through the queue of methods, and invoke the functions.
|
163
|
+
// Update this as the time unit, and set the final value as this item.
|
164
|
+
// * In the case of `enable`, keep the queue but set `disable` instead.
|
165
|
+
// And in the case of `flip`, keep the queue but set `enable` instead.
|
166
|
+
calendarItem[ ( type == 'enable' ? 'disable' : type == 'flip' ? 'enable' : type ) ] = calendar.queue[ type ].split( ' ' ).map( function( method ) {
|
167
|
+
value = calendar[ method ]( type, value, options )
|
168
|
+
return value
|
169
|
+
}).pop()
|
170
|
+
|
171
|
+
// Check if we need to cascade through more updates.
|
172
|
+
if ( type == 'select' ) {
|
173
|
+
calendar.set( 'highlight', calendarItem.select, options )
|
174
|
+
}
|
175
|
+
else if ( type == 'highlight' ) {
|
176
|
+
calendar.set( 'view', calendarItem.highlight, options )
|
177
|
+
}
|
178
|
+
else if ( type.match( /^(flip|min|max|disable|enable)$/ ) ) {
|
179
|
+
if ( calendarItem.select && calendar.disabled( calendarItem.select ) ) {
|
180
|
+
calendar.set( 'select', calendarItem.select, options )
|
181
|
+
}
|
182
|
+
if ( calendarItem.highlight && calendar.disabled( calendarItem.highlight ) ) {
|
183
|
+
calendar.set( 'highlight', calendarItem.highlight, options )
|
184
|
+
}
|
185
|
+
}
|
186
|
+
|
187
|
+
return calendar
|
188
|
+
} //DatePicker.prototype.set
|
189
|
+
|
190
|
+
|
191
|
+
/**
|
192
|
+
* Get a datepicker item object.
|
193
|
+
*/
|
194
|
+
DatePicker.prototype.get = function( type ) {
|
195
|
+
return this.item[ type ]
|
196
|
+
} //DatePicker.prototype.get
|
197
|
+
|
198
|
+
|
199
|
+
/**
|
200
|
+
* Create a picker date object.
|
201
|
+
*/
|
202
|
+
DatePicker.prototype.create = function( type, value, options ) {
|
203
|
+
|
204
|
+
var isInfiniteValue,
|
205
|
+
calendar = this
|
206
|
+
|
207
|
+
// If there’s no value, use the type as the value.
|
208
|
+
value = value === undefined ? type : value
|
209
|
+
|
210
|
+
|
211
|
+
// If it’s infinity, update the value.
|
212
|
+
if ( value == -Infinity || value == Infinity ) {
|
213
|
+
isInfiniteValue = value
|
214
|
+
}
|
215
|
+
|
216
|
+
// If it’s an object, use the native date object.
|
217
|
+
else if ( $.isPlainObject( value ) && _.isInteger( value.pick ) ) {
|
218
|
+
value = value.obj
|
219
|
+
}
|
220
|
+
|
221
|
+
// If it’s an array, convert it into a date and make sure
|
222
|
+
// that it’s a valid date – otherwise default to today.
|
223
|
+
else if ( $.isArray( value ) ) {
|
224
|
+
value = new Date( value[ 0 ], value[ 1 ], value[ 2 ] )
|
225
|
+
value = _.isDate( value ) ? value : calendar.create().obj
|
226
|
+
}
|
227
|
+
|
228
|
+
// If it’s a number or date object, make a normalized date.
|
229
|
+
else if ( _.isInteger( value ) || _.isDate( value ) ) {
|
230
|
+
value = calendar.normalize( new Date( value ), options )
|
231
|
+
}
|
232
|
+
|
233
|
+
// If it’s a literal true or any other case, set it to now.
|
234
|
+
else /*if ( value === true )*/ {
|
235
|
+
value = calendar.now( type, value, options )
|
236
|
+
}
|
237
|
+
|
238
|
+
// Return the compiled object.
|
239
|
+
return {
|
240
|
+
year: isInfiniteValue || value.getFullYear(),
|
241
|
+
month: isInfiniteValue || value.getMonth(),
|
242
|
+
date: isInfiniteValue || value.getDate(),
|
243
|
+
day: isInfiniteValue || value.getDay(),
|
244
|
+
obj: isInfiniteValue || value,
|
245
|
+
pick: isInfiniteValue || value.getTime()
|
246
|
+
}
|
247
|
+
} //DatePicker.prototype.create
|
248
|
+
|
249
|
+
|
250
|
+
/**
|
251
|
+
* Create a range limit object using an array, date object,
|
252
|
+
* literal “true”, or integer relative to another time.
|
253
|
+
*/
|
254
|
+
DatePicker.prototype.createRange = function( from, to ) {
|
255
|
+
|
256
|
+
var calendar = this,
|
257
|
+
createDate = function( date ) {
|
258
|
+
if ( date === true || $.isArray( date ) || _.isDate( date ) ) {
|
259
|
+
return calendar.create( date )
|
260
|
+
}
|
261
|
+
return date
|
262
|
+
}
|
263
|
+
|
264
|
+
// Create objects if possible.
|
265
|
+
if ( !_.isInteger( from ) ) {
|
266
|
+
from = createDate( from )
|
267
|
+
}
|
268
|
+
if ( !_.isInteger( to ) ) {
|
269
|
+
to = createDate( to )
|
270
|
+
}
|
271
|
+
|
272
|
+
// Create relative dates.
|
273
|
+
if ( _.isInteger( from ) && $.isPlainObject( to ) ) {
|
274
|
+
from = [ to.year, to.month, to.date + from ];
|
275
|
+
}
|
276
|
+
else if ( _.isInteger( to ) && $.isPlainObject( from ) ) {
|
277
|
+
to = [ from.year, from.month, from.date + to ];
|
278
|
+
}
|
279
|
+
|
280
|
+
return {
|
281
|
+
from: createDate( from ),
|
282
|
+
to: createDate( to )
|
283
|
+
}
|
284
|
+
} //DatePicker.prototype.createRange
|
285
|
+
|
286
|
+
|
287
|
+
/**
|
288
|
+
* Check if a date unit falls within a date range object.
|
289
|
+
*/
|
290
|
+
DatePicker.prototype.withinRange = function( range, dateUnit ) {
|
291
|
+
range = this.createRange(range.from, range.to)
|
292
|
+
return dateUnit.pick >= range.from.pick && dateUnit.pick <= range.to.pick
|
293
|
+
}
|
294
|
+
|
295
|
+
|
296
|
+
/**
|
297
|
+
* Check if two date range objects overlap.
|
298
|
+
*/
|
299
|
+
DatePicker.prototype.overlapRanges = function( one, two ) {
|
300
|
+
|
301
|
+
var calendar = this
|
302
|
+
|
303
|
+
// Convert the ranges into comparable dates.
|
304
|
+
one = calendar.createRange( one.from, one.to )
|
305
|
+
two = calendar.createRange( two.from, two.to )
|
306
|
+
|
307
|
+
return calendar.withinRange( one, two.from ) || calendar.withinRange( one, two.to ) ||
|
308
|
+
calendar.withinRange( two, one.from ) || calendar.withinRange( two, one.to )
|
309
|
+
}
|
310
|
+
|
311
|
+
|
312
|
+
/**
|
313
|
+
* Get the date today.
|
314
|
+
*/
|
315
|
+
DatePicker.prototype.now = function( type, value, options ) {
|
316
|
+
value = new Date()
|
317
|
+
if ( options && options.rel ) {
|
318
|
+
value.setDate( value.getDate() + options.rel )
|
319
|
+
}
|
320
|
+
return this.normalize( value, options )
|
321
|
+
}
|
322
|
+
|
323
|
+
|
324
|
+
/**
|
325
|
+
* Navigate to next/prev month.
|
326
|
+
*/
|
327
|
+
DatePicker.prototype.navigate = function( type, value, options ) {
|
328
|
+
|
329
|
+
var targetDateObject,
|
330
|
+
targetYear,
|
331
|
+
targetMonth,
|
332
|
+
targetDate,
|
333
|
+
isTargetArray = $.isArray( value ),
|
334
|
+
isTargetObject = $.isPlainObject( value ),
|
335
|
+
viewsetObject = this.item.view/*,
|
336
|
+
safety = 100*/
|
337
|
+
|
338
|
+
|
339
|
+
if ( isTargetArray || isTargetObject ) {
|
340
|
+
|
341
|
+
if ( isTargetObject ) {
|
342
|
+
targetYear = value.year
|
343
|
+
targetMonth = value.month
|
344
|
+
targetDate = value.date
|
345
|
+
}
|
346
|
+
else {
|
347
|
+
targetYear = +value[0]
|
348
|
+
targetMonth = +value[1]
|
349
|
+
targetDate = +value[2]
|
350
|
+
}
|
351
|
+
|
352
|
+
// If we’re navigating months but the view is in a different
|
353
|
+
// month, navigate to the view’s year and month.
|
354
|
+
if ( options && options.nav && viewsetObject && viewsetObject.month !== targetMonth ) {
|
355
|
+
targetYear = viewsetObject.year
|
356
|
+
targetMonth = viewsetObject.month
|
357
|
+
}
|
358
|
+
|
359
|
+
// Figure out the expected target year and month.
|
360
|
+
targetDateObject = new Date( targetYear, targetMonth + ( options && options.nav ? options.nav : 0 ), 1 )
|
361
|
+
targetYear = targetDateObject.getFullYear()
|
362
|
+
targetMonth = targetDateObject.getMonth()
|
363
|
+
|
364
|
+
// If the month we’re going to doesn’t have enough days,
|
365
|
+
// keep decreasing the date until we reach the month’s last date.
|
366
|
+
while ( /*safety &&*/ new Date( targetYear, targetMonth, targetDate ).getMonth() !== targetMonth ) {
|
367
|
+
targetDate -= 1
|
368
|
+
/*safety -= 1
|
369
|
+
if ( !safety ) {
|
370
|
+
throw 'Fell into an infinite loop while navigating to ' + new Date( targetYear, targetMonth, targetDate ) + '.'
|
371
|
+
}*/
|
372
|
+
}
|
373
|
+
|
374
|
+
value = [ targetYear, targetMonth, targetDate ]
|
375
|
+
}
|
376
|
+
|
377
|
+
return value
|
378
|
+
} //DatePicker.prototype.navigate
|
379
|
+
|
380
|
+
|
381
|
+
/**
|
382
|
+
* Normalize a date by setting the hours to midnight.
|
383
|
+
*/
|
384
|
+
DatePicker.prototype.normalize = function( value/*, options*/ ) {
|
385
|
+
value.setHours( 0, 0, 0, 0 )
|
386
|
+
return value
|
387
|
+
}
|
388
|
+
|
389
|
+
|
390
|
+
/**
|
391
|
+
* Measure the range of dates.
|
392
|
+
*/
|
393
|
+
DatePicker.prototype.measure = function( type, value/*, options*/ ) {
|
394
|
+
|
395
|
+
var calendar = this
|
396
|
+
|
397
|
+
// If it’s anything false-y, remove the limits.
|
398
|
+
if ( !value ) {
|
399
|
+
value = type == 'min' ? -Infinity : Infinity
|
400
|
+
}
|
401
|
+
|
402
|
+
// If it’s a string, parse it.
|
403
|
+
else if ( typeof value == 'string' ) {
|
404
|
+
value = calendar.parse( type, value )
|
405
|
+
}
|
406
|
+
|
407
|
+
// If it's an integer, get a date relative to today.
|
408
|
+
else if ( _.isInteger( value ) ) {
|
409
|
+
value = calendar.now( type, value, { rel: value } )
|
410
|
+
}
|
411
|
+
|
412
|
+
return value
|
413
|
+
} ///DatePicker.prototype.measure
|
414
|
+
|
415
|
+
|
416
|
+
/**
|
417
|
+
* Create a viewset object based on navigation.
|
418
|
+
*/
|
419
|
+
DatePicker.prototype.viewset = function( type, dateObject/*, options*/ ) {
|
420
|
+
return this.create([ dateObject.year, dateObject.month, 1 ])
|
421
|
+
}
|
422
|
+
|
423
|
+
|
424
|
+
/**
|
425
|
+
* Validate a date as enabled and shift if needed.
|
426
|
+
*/
|
427
|
+
DatePicker.prototype.validate = function( type, dateObject, options ) {
|
428
|
+
|
429
|
+
var calendar = this,
|
430
|
+
|
431
|
+
// Keep a reference to the original date.
|
432
|
+
originalDateObject = dateObject,
|
433
|
+
|
434
|
+
// Make sure we have an interval.
|
435
|
+
interval = options && options.interval ? options.interval : 1,
|
436
|
+
|
437
|
+
// Check if the calendar enabled dates are inverted.
|
438
|
+
isFlippedBase = calendar.item.enable === -1,
|
439
|
+
|
440
|
+
// Check if we have any enabled dates after/before now.
|
441
|
+
hasEnabledBeforeTarget, hasEnabledAfterTarget,
|
442
|
+
|
443
|
+
// The min & max limits.
|
444
|
+
minLimitObject = calendar.item.min,
|
445
|
+
maxLimitObject = calendar.item.max,
|
446
|
+
|
447
|
+
// Check if we’ve reached the limit during shifting.
|
448
|
+
reachedMin, reachedMax,
|
449
|
+
|
450
|
+
// Check if the calendar is inverted and at least one weekday is enabled.
|
451
|
+
hasEnabledWeekdays = isFlippedBase && calendar.item.disable.filter( function( value ) {
|
452
|
+
|
453
|
+
// If there’s a date, check where it is relative to the target.
|
454
|
+
if ( $.isArray( value ) ) {
|
455
|
+
var dateTime = calendar.create( value ).pick
|
456
|
+
if ( dateTime < dateObject.pick ) hasEnabledBeforeTarget = true
|
457
|
+
else if ( dateTime > dateObject.pick ) hasEnabledAfterTarget = true
|
458
|
+
}
|
459
|
+
|
460
|
+
// Return only integers for enabled weekdays.
|
461
|
+
return _.isInteger( value )
|
462
|
+
}).length/*,
|
463
|
+
|
464
|
+
safety = 100*/
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
// Cases to validate for:
|
469
|
+
// [1] Not inverted and date disabled.
|
470
|
+
// [2] Inverted and some dates enabled.
|
471
|
+
// [3] Not inverted and out of range.
|
472
|
+
//
|
473
|
+
// Cases to **not** validate for:
|
474
|
+
// • Navigating months.
|
475
|
+
// • Not inverted and date enabled.
|
476
|
+
// • Inverted and all dates disabled.
|
477
|
+
// • ..and anything else.
|
478
|
+
if ( !options || !options.nav ) if (
|
479
|
+
/* 1 */ ( !isFlippedBase && calendar.disabled( dateObject ) ) ||
|
480
|
+
/* 2 */ ( isFlippedBase && calendar.disabled( dateObject ) && ( hasEnabledWeekdays || hasEnabledBeforeTarget || hasEnabledAfterTarget ) ) ||
|
481
|
+
/* 3 */ ( !isFlippedBase && (dateObject.pick <= minLimitObject.pick || dateObject.pick >= maxLimitObject.pick) )
|
482
|
+
) {
|
483
|
+
|
484
|
+
|
485
|
+
// When inverted, flip the direction if there aren’t any enabled weekdays
|
486
|
+
// and there are no enabled dates in the direction of the interval.
|
487
|
+
if ( isFlippedBase && !hasEnabledWeekdays && ( ( !hasEnabledAfterTarget && interval > 0 ) || ( !hasEnabledBeforeTarget && interval < 0 ) ) ) {
|
488
|
+
interval *= -1
|
489
|
+
}
|
490
|
+
|
491
|
+
|
492
|
+
// Keep looping until we reach an enabled date.
|
493
|
+
while ( /*safety &&*/ calendar.disabled( dateObject ) ) {
|
494
|
+
|
495
|
+
/*safety -= 1
|
496
|
+
if ( !safety ) {
|
497
|
+
throw 'Fell into an infinite loop while validating ' + dateObject.obj + '.'
|
498
|
+
}*/
|
499
|
+
|
500
|
+
|
501
|
+
// If we’ve looped into the next/prev month with a large interval, return to the original date and flatten the interval.
|
502
|
+
if ( Math.abs( interval ) > 1 && ( dateObject.month < originalDateObject.month || dateObject.month > originalDateObject.month ) ) {
|
503
|
+
dateObject = originalDateObject
|
504
|
+
interval = interval > 0 ? 1 : -1
|
505
|
+
}
|
506
|
+
|
507
|
+
|
508
|
+
// If we’ve reached the min/max limit, reverse the direction, flatten the interval and set it to the limit.
|
509
|
+
if ( dateObject.pick <= minLimitObject.pick ) {
|
510
|
+
reachedMin = true
|
511
|
+
interval = 1
|
512
|
+
dateObject = calendar.create([
|
513
|
+
minLimitObject.year,
|
514
|
+
minLimitObject.month,
|
515
|
+
minLimitObject.date + (dateObject.pick === minLimitObject.pick ? 0 : -1)
|
516
|
+
])
|
517
|
+
}
|
518
|
+
else if ( dateObject.pick >= maxLimitObject.pick ) {
|
519
|
+
reachedMax = true
|
520
|
+
interval = -1
|
521
|
+
dateObject = calendar.create([
|
522
|
+
maxLimitObject.year,
|
523
|
+
maxLimitObject.month,
|
524
|
+
maxLimitObject.date + (dateObject.pick === maxLimitObject.pick ? 0 : 1)
|
525
|
+
])
|
526
|
+
}
|
527
|
+
|
528
|
+
|
529
|
+
// If we’ve reached both limits, just break out of the loop.
|
530
|
+
if ( reachedMin && reachedMax ) {
|
531
|
+
break
|
532
|
+
}
|
533
|
+
|
534
|
+
|
535
|
+
// Finally, create the shifted date using the interval and keep looping.
|
536
|
+
dateObject = calendar.create([ dateObject.year, dateObject.month, dateObject.date + interval ])
|
537
|
+
}
|
538
|
+
|
539
|
+
} //endif
|
540
|
+
|
541
|
+
|
542
|
+
// Return the date object settled on.
|
543
|
+
return dateObject
|
544
|
+
} //DatePicker.prototype.validate
|
545
|
+
|
546
|
+
|
547
|
+
/**
|
548
|
+
* Check if a date is disabled.
|
549
|
+
*/
|
550
|
+
DatePicker.prototype.disabled = function( dateToVerify ) {
|
551
|
+
|
552
|
+
var
|
553
|
+
calendar = this,
|
554
|
+
|
555
|
+
// Filter through the disabled dates to check if this is one.
|
556
|
+
isDisabledMatch = calendar.item.disable.filter( function( dateToDisable ) {
|
557
|
+
|
558
|
+
// If the date is a number, match the weekday with 0index and `firstDay` check.
|
559
|
+
if ( _.isInteger( dateToDisable ) ) {
|
560
|
+
return dateToVerify.day === ( calendar.settings.firstDay ? dateToDisable : dateToDisable - 1 ) % 7
|
561
|
+
}
|
562
|
+
|
563
|
+
// If it’s an array or a native JS date, create and match the exact date.
|
564
|
+
if ( $.isArray( dateToDisable ) || _.isDate( dateToDisable ) ) {
|
565
|
+
return dateToVerify.pick === calendar.create( dateToDisable ).pick
|
566
|
+
}
|
567
|
+
|
568
|
+
// If it’s an object, match a date within the “from” and “to” range.
|
569
|
+
if ( $.isPlainObject( dateToDisable ) ) {
|
570
|
+
return calendar.withinRange( dateToDisable, dateToVerify )
|
571
|
+
}
|
572
|
+
})
|
573
|
+
|
574
|
+
// If this date matches a disabled date, confirm it’s not inverted.
|
575
|
+
isDisabledMatch = isDisabledMatch.length && !isDisabledMatch.filter(function( dateToDisable ) {
|
576
|
+
return $.isArray( dateToDisable ) && dateToDisable[3] == 'inverted' ||
|
577
|
+
$.isPlainObject( dateToDisable ) && dateToDisable.inverted
|
578
|
+
}).length
|
579
|
+
|
580
|
+
// Check the calendar “enabled” flag and respectively flip the
|
581
|
+
// disabled state. Then also check if it’s beyond the min/max limits.
|
582
|
+
return calendar.item.enable === -1 ? !isDisabledMatch : isDisabledMatch ||
|
583
|
+
dateToVerify.pick < calendar.item.min.pick ||
|
584
|
+
dateToVerify.pick > calendar.item.max.pick
|
585
|
+
|
586
|
+
} //DatePicker.prototype.disabled
|
587
|
+
|
588
|
+
|
589
|
+
/**
|
590
|
+
* Parse a string into a usable type.
|
591
|
+
*/
|
592
|
+
DatePicker.prototype.parse = function( type, value, options ) {
|
593
|
+
|
594
|
+
var calendar = this,
|
595
|
+
parsingObject = {}
|
596
|
+
|
597
|
+
// If it’s already parsed, we’re good.
|
598
|
+
if ( !value || typeof value != 'string' ) {
|
599
|
+
return value
|
600
|
+
}
|
601
|
+
|
602
|
+
// We need a `.format` to parse the value with.
|
603
|
+
if ( !( options && options.format ) ) {
|
604
|
+
options = options || {}
|
605
|
+
options.format = calendar.settings.format
|
606
|
+
}
|
607
|
+
|
608
|
+
// Convert the format into an array and then map through it.
|
609
|
+
calendar.formats.toArray( options.format ).map( function( label ) {
|
610
|
+
|
611
|
+
var
|
612
|
+
// Grab the formatting label.
|
613
|
+
formattingLabel = calendar.formats[ label ],
|
614
|
+
|
615
|
+
// The format length is from the formatting label function or the
|
616
|
+
// label length without the escaping exclamation (!) mark.
|
617
|
+
formatLength = formattingLabel ? _.trigger( formattingLabel, calendar, [ value, parsingObject ] ) : label.replace( /^!/, '' ).length
|
618
|
+
|
619
|
+
// If there's a format label, split the value up to the format length.
|
620
|
+
// Then add it to the parsing object with appropriate label.
|
621
|
+
if ( formattingLabel ) {
|
622
|
+
parsingObject[ label ] = value.substr( 0, formatLength )
|
623
|
+
}
|
624
|
+
|
625
|
+
// Update the value as the substring from format length to end.
|
626
|
+
value = value.substr( formatLength )
|
627
|
+
})
|
628
|
+
|
629
|
+
// Compensate for month 0index.
|
630
|
+
return [
|
631
|
+
parsingObject.yyyy || parsingObject.yy,
|
632
|
+
+( parsingObject.mm || parsingObject.m ) - 1,
|
633
|
+
parsingObject.dd || parsingObject.d
|
634
|
+
]
|
635
|
+
} //DatePicker.prototype.parse
|
636
|
+
|
637
|
+
|
638
|
+
/**
|
639
|
+
* Various formats to display the object in.
|
640
|
+
*/
|
641
|
+
DatePicker.prototype.formats = (function() {
|
642
|
+
|
643
|
+
// Return the length of the first word in a collection.
|
644
|
+
function getWordLengthFromCollection( string, collection, dateObject ) {
|
645
|
+
|
646
|
+
// Grab the first word from the string.
|
647
|
+
var word = string.match( /\w+/ )[ 0 ]
|
648
|
+
|
649
|
+
// If there's no month index, add it to the date object
|
650
|
+
if ( !dateObject.mm && !dateObject.m ) {
|
651
|
+
dateObject.m = collection.indexOf( word ) + 1
|
652
|
+
}
|
653
|
+
|
654
|
+
// Return the length of the word.
|
655
|
+
return word.length
|
656
|
+
}
|
657
|
+
|
658
|
+
// Get the length of the first word in a string.
|
659
|
+
function getFirstWordLength( string ) {
|
660
|
+
return string.match( /\w+/ )[ 0 ].length
|
661
|
+
}
|
662
|
+
|
663
|
+
return {
|
664
|
+
|
665
|
+
d: function( string, dateObject ) {
|
666
|
+
|
667
|
+
// If there's string, then get the digits length.
|
668
|
+
// Otherwise return the selected date.
|
669
|
+
return string ? _.digits( string ) : dateObject.date
|
670
|
+
},
|
671
|
+
dd: function( string, dateObject ) {
|
672
|
+
|
673
|
+
// If there's a string, then the length is always 2.
|
674
|
+
// Otherwise return the selected date with a leading zero.
|
675
|
+
return string ? 2 : _.lead( dateObject.date )
|
676
|
+
},
|
677
|
+
ddd: function( string, dateObject ) {
|
678
|
+
|
679
|
+
// If there's a string, then get the length of the first word.
|
680
|
+
// Otherwise return the short selected weekday.
|
681
|
+
return string ? getFirstWordLength( string ) : this.settings.weekdaysShort[ dateObject.day ]
|
682
|
+
},
|
683
|
+
dddd: function( string, dateObject ) {
|
684
|
+
|
685
|
+
// If there's a string, then get the length of the first word.
|
686
|
+
// Otherwise return the full selected weekday.
|
687
|
+
return string ? getFirstWordLength( string ) : this.settings.weekdaysFull[ dateObject.day ]
|
688
|
+
},
|
689
|
+
m: function( string, dateObject ) {
|
690
|
+
|
691
|
+
// If there's a string, then get the length of the digits
|
692
|
+
// Otherwise return the selected month with 0index compensation.
|
693
|
+
return string ? _.digits( string ) : dateObject.month + 1
|
694
|
+
},
|
695
|
+
mm: function( string, dateObject ) {
|
696
|
+
|
697
|
+
// If there's a string, then the length is always 2.
|
698
|
+
// Otherwise return the selected month with 0index and leading zero.
|
699
|
+
return string ? 2 : _.lead( dateObject.month + 1 )
|
700
|
+
},
|
701
|
+
mmm: function( string, dateObject ) {
|
702
|
+
|
703
|
+
var collection = this.settings.monthsShort
|
704
|
+
|
705
|
+
// If there's a string, get length of the relevant month from the short
|
706
|
+
// months collection. Otherwise return the selected month from that collection.
|
707
|
+
return string ? getWordLengthFromCollection( string, collection, dateObject ) : collection[ dateObject.month ]
|
708
|
+
},
|
709
|
+
mmmm: function( string, dateObject ) {
|
710
|
+
|
711
|
+
var collection = this.settings.monthsFull
|
712
|
+
|
713
|
+
// If there's a string, get length of the relevant month from the full
|
714
|
+
// months collection. Otherwise return the selected month from that collection.
|
715
|
+
return string ? getWordLengthFromCollection( string, collection, dateObject ) : collection[ dateObject.month ]
|
716
|
+
},
|
717
|
+
yy: function( string, dateObject ) {
|
718
|
+
|
719
|
+
// If there's a string, then the length is always 2.
|
720
|
+
// Otherwise return the selected year by slicing out the first 2 digits.
|
721
|
+
return string ? 2 : ( '' + dateObject.year ).slice( 2 )
|
722
|
+
},
|
723
|
+
yyyy: function( string, dateObject ) {
|
724
|
+
|
725
|
+
// If there's a string, then the length is always 4.
|
726
|
+
// Otherwise return the selected year.
|
727
|
+
return string ? 4 : dateObject.year
|
728
|
+
},
|
729
|
+
|
730
|
+
// Create an array by splitting the formatting string passed.
|
731
|
+
toArray: function( formatString ) { return formatString.split( /(d{1,4}|m{1,4}|y{4}|yy|!.)/g ) },
|
732
|
+
|
733
|
+
// Format an object into a string using the formatting options.
|
734
|
+
toString: function ( formatString, itemObject ) {
|
735
|
+
var calendar = this
|
736
|
+
return calendar.formats.toArray( formatString ).map( function( label ) {
|
737
|
+
return _.trigger( calendar.formats[ label ], calendar, [ 0, itemObject ] ) || label.replace( /^!/, '' )
|
738
|
+
}).join( '' )
|
739
|
+
}
|
740
|
+
}
|
741
|
+
})() //DatePicker.prototype.formats
|
742
|
+
|
743
|
+
|
744
|
+
|
745
|
+
|
746
|
+
/**
|
747
|
+
* Check if two date units are the exact.
|
748
|
+
*/
|
749
|
+
DatePicker.prototype.isDateExact = function( one, two ) {
|
750
|
+
|
751
|
+
var calendar = this
|
752
|
+
|
753
|
+
// When we’re working with weekdays, do a direct comparison.
|
754
|
+
if (
|
755
|
+
( _.isInteger( one ) && _.isInteger( two ) ) ||
|
756
|
+
( typeof one == 'boolean' && typeof two == 'boolean' )
|
757
|
+
) {
|
758
|
+
return one === two
|
759
|
+
}
|
760
|
+
|
761
|
+
// When we’re working with date representations, compare the “pick” value.
|
762
|
+
if (
|
763
|
+
( _.isDate( one ) || $.isArray( one ) ) &&
|
764
|
+
( _.isDate( two ) || $.isArray( two ) )
|
765
|
+
) {
|
766
|
+
return calendar.create( one ).pick === calendar.create( two ).pick
|
767
|
+
}
|
768
|
+
|
769
|
+
// When we’re working with range objects, compare the “from” and “to”.
|
770
|
+
if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {
|
771
|
+
return calendar.isDateExact( one.from, two.from ) && calendar.isDateExact( one.to, two.to )
|
772
|
+
}
|
773
|
+
|
774
|
+
return false
|
775
|
+
}
|
776
|
+
|
777
|
+
|
778
|
+
/**
|
779
|
+
* Check if two date units overlap.
|
780
|
+
*/
|
781
|
+
DatePicker.prototype.isDateOverlap = function( one, two ) {
|
782
|
+
|
783
|
+
var calendar = this,
|
784
|
+
firstDay = calendar.settings.firstDay ? 1 : 0
|
785
|
+
|
786
|
+
// When we’re working with a weekday index, compare the days.
|
787
|
+
if ( _.isInteger( one ) && ( _.isDate( two ) || $.isArray( two ) ) ) {
|
788
|
+
one = one % 7 + firstDay
|
789
|
+
return one === calendar.create( two ).day + 1
|
790
|
+
}
|
791
|
+
if ( _.isInteger( two ) && ( _.isDate( one ) || $.isArray( one ) ) ) {
|
792
|
+
two = two % 7 + firstDay
|
793
|
+
return two === calendar.create( one ).day + 1
|
794
|
+
}
|
795
|
+
|
796
|
+
// When we’re working with range objects, check if the ranges overlap.
|
797
|
+
if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {
|
798
|
+
return calendar.overlapRanges( one, two )
|
799
|
+
}
|
800
|
+
|
801
|
+
return false
|
802
|
+
}
|
803
|
+
|
804
|
+
|
805
|
+
/**
|
806
|
+
* Flip the “enabled” state.
|
807
|
+
*/
|
808
|
+
DatePicker.prototype.flipEnable = function(val) {
|
809
|
+
var itemObject = this.item
|
810
|
+
itemObject.enable = val || (itemObject.enable == -1 ? 1 : -1)
|
811
|
+
}
|
812
|
+
|
813
|
+
|
814
|
+
/**
|
815
|
+
* Mark a collection of dates as “disabled”.
|
816
|
+
*/
|
817
|
+
DatePicker.prototype.deactivate = function( type, datesToDisable ) {
|
818
|
+
|
819
|
+
var calendar = this,
|
820
|
+
disabledItems = calendar.item.disable.slice(0)
|
821
|
+
|
822
|
+
|
823
|
+
// If we’re flipping, that’s all we need to do.
|
824
|
+
if ( datesToDisable == 'flip' ) {
|
825
|
+
calendar.flipEnable()
|
826
|
+
}
|
827
|
+
|
828
|
+
else if ( datesToDisable === false ) {
|
829
|
+
calendar.flipEnable(1)
|
830
|
+
disabledItems = []
|
831
|
+
}
|
832
|
+
|
833
|
+
else if ( datesToDisable === true ) {
|
834
|
+
calendar.flipEnable(-1)
|
835
|
+
disabledItems = []
|
836
|
+
}
|
837
|
+
|
838
|
+
// Otherwise go through the dates to disable.
|
839
|
+
else {
|
840
|
+
|
841
|
+
datesToDisable.map(function( unitToDisable ) {
|
842
|
+
|
843
|
+
var matchFound
|
844
|
+
|
845
|
+
// When we have disabled items, check for matches.
|
846
|
+
// If something is matched, immediately break out.
|
847
|
+
for ( var index = 0; index < disabledItems.length; index += 1 ) {
|
848
|
+
if ( calendar.isDateExact( unitToDisable, disabledItems[index] ) ) {
|
849
|
+
matchFound = true
|
850
|
+
break
|
851
|
+
}
|
852
|
+
}
|
853
|
+
|
854
|
+
// If nothing was found, add the validated unit to the collection.
|
855
|
+
if ( !matchFound ) {
|
856
|
+
if (
|
857
|
+
_.isInteger( unitToDisable ) ||
|
858
|
+
_.isDate( unitToDisable ) ||
|
859
|
+
$.isArray( unitToDisable ) ||
|
860
|
+
( $.isPlainObject( unitToDisable ) && unitToDisable.from && unitToDisable.to )
|
861
|
+
) {
|
862
|
+
disabledItems.push( unitToDisable )
|
863
|
+
}
|
864
|
+
}
|
865
|
+
})
|
866
|
+
}
|
867
|
+
|
868
|
+
// Return the updated collection.
|
869
|
+
return disabledItems
|
870
|
+
} //DatePicker.prototype.deactivate
|
871
|
+
|
872
|
+
|
873
|
+
/**
|
874
|
+
* Mark a collection of dates as “enabled”.
|
875
|
+
*/
|
876
|
+
DatePicker.prototype.activate = function( type, datesToEnable ) {
|
877
|
+
|
878
|
+
var calendar = this,
|
879
|
+
disabledItems = calendar.item.disable,
|
880
|
+
disabledItemsCount = disabledItems.length
|
881
|
+
|
882
|
+
// If we’re flipping, that’s all we need to do.
|
883
|
+
if ( datesToEnable == 'flip' ) {
|
884
|
+
calendar.flipEnable()
|
885
|
+
}
|
886
|
+
|
887
|
+
else if ( datesToEnable === true ) {
|
888
|
+
calendar.flipEnable(1)
|
889
|
+
disabledItems = []
|
890
|
+
}
|
891
|
+
|
892
|
+
else if ( datesToEnable === false ) {
|
893
|
+
calendar.flipEnable(-1)
|
894
|
+
disabledItems = []
|
895
|
+
}
|
896
|
+
|
897
|
+
// Otherwise go through the disabled dates.
|
898
|
+
else {
|
899
|
+
|
900
|
+
datesToEnable.map(function( unitToEnable ) {
|
901
|
+
|
902
|
+
var matchFound,
|
903
|
+
disabledUnit,
|
904
|
+
index,
|
905
|
+
isExactRange
|
906
|
+
|
907
|
+
// Go through the disabled items and try to find a match.
|
908
|
+
for ( index = 0; index < disabledItemsCount; index += 1 ) {
|
909
|
+
|
910
|
+
disabledUnit = disabledItems[index]
|
911
|
+
|
912
|
+
// When an exact match is found, remove it from the collection.
|
913
|
+
if ( calendar.isDateExact( disabledUnit, unitToEnable ) ) {
|
914
|
+
matchFound = disabledItems[index] = null
|
915
|
+
isExactRange = true
|
916
|
+
break
|
917
|
+
}
|
918
|
+
|
919
|
+
// When an overlapped match is found, add the “inverted” state to it.
|
920
|
+
else if ( calendar.isDateOverlap( disabledUnit, unitToEnable ) ) {
|
921
|
+
if ( $.isPlainObject( unitToEnable ) ) {
|
922
|
+
unitToEnable.inverted = true
|
923
|
+
matchFound = unitToEnable
|
924
|
+
}
|
925
|
+
else if ( $.isArray( unitToEnable ) ) {
|
926
|
+
matchFound = unitToEnable
|
927
|
+
if ( !matchFound[3] ) matchFound.push( 'inverted' )
|
928
|
+
}
|
929
|
+
else if ( _.isDate( unitToEnable ) ) {
|
930
|
+
matchFound = [ unitToEnable.getFullYear(), unitToEnable.getMonth(), unitToEnable.getDate(), 'inverted' ]
|
931
|
+
}
|
932
|
+
break
|
933
|
+
}
|
934
|
+
}
|
935
|
+
|
936
|
+
// If a match was found, remove a previous duplicate entry.
|
937
|
+
if ( matchFound ) for ( index = 0; index < disabledItemsCount; index += 1 ) {
|
938
|
+
if ( calendar.isDateExact( disabledItems[index], unitToEnable ) ) {
|
939
|
+
disabledItems[index] = null
|
940
|
+
break
|
941
|
+
}
|
942
|
+
}
|
943
|
+
|
944
|
+
// In the event that we’re dealing with an exact range of dates,
|
945
|
+
// make sure there are no “inverted” dates because of it.
|
946
|
+
if ( isExactRange ) for ( index = 0; index < disabledItemsCount; index += 1 ) {
|
947
|
+
if ( calendar.isDateOverlap( disabledItems[index], unitToEnable ) ) {
|
948
|
+
disabledItems[index] = null
|
949
|
+
break
|
950
|
+
}
|
951
|
+
}
|
952
|
+
|
953
|
+
// If something is still matched, add it into the collection.
|
954
|
+
if ( matchFound ) {
|
955
|
+
disabledItems.push( matchFound )
|
956
|
+
}
|
957
|
+
})
|
958
|
+
}
|
959
|
+
|
960
|
+
// Return the updated collection.
|
961
|
+
return disabledItems.filter(function( val ) { return val != null })
|
962
|
+
} //DatePicker.prototype.activate
|
963
|
+
|
964
|
+
|
965
|
+
/**
|
966
|
+
* Create a string for the nodes in the picker.
|
967
|
+
*/
|
968
|
+
DatePicker.prototype.nodes = function( isOpen ) {
|
969
|
+
|
970
|
+
var
|
971
|
+
calendar = this,
|
972
|
+
settings = calendar.settings,
|
973
|
+
calendarItem = calendar.item,
|
974
|
+
nowObject = calendarItem.now,
|
975
|
+
selectedObject = calendarItem.select,
|
976
|
+
highlightedObject = calendarItem.highlight,
|
977
|
+
viewsetObject = calendarItem.view,
|
978
|
+
disabledCollection = calendarItem.disable,
|
979
|
+
minLimitObject = calendarItem.min,
|
980
|
+
maxLimitObject = calendarItem.max,
|
981
|
+
|
982
|
+
|
983
|
+
// Create the calendar table head using a copy of weekday labels collection.
|
984
|
+
// * We do a copy so we don't mutate the original array.
|
985
|
+
tableHead = (function( collection, fullCollection ) {
|
986
|
+
|
987
|
+
// If the first day should be Monday, move Sunday to the end.
|
988
|
+
if ( settings.firstDay ) {
|
989
|
+
collection.push( collection.shift() )
|
990
|
+
fullCollection.push( fullCollection.shift() )
|
991
|
+
}
|
992
|
+
|
993
|
+
// Create and return the table head group.
|
994
|
+
return _.node(
|
995
|
+
'thead',
|
996
|
+
_.node(
|
997
|
+
'tr',
|
998
|
+
_.group({
|
999
|
+
min: 0,
|
1000
|
+
max: DAYS_IN_WEEK - 1,
|
1001
|
+
i: 1,
|
1002
|
+
node: 'th',
|
1003
|
+
item: function( counter ) {
|
1004
|
+
return [
|
1005
|
+
collection[ counter ],
|
1006
|
+
settings.klass.weekdays,
|
1007
|
+
'scope=col title="' + fullCollection[ counter ] + '"'
|
1008
|
+
]
|
1009
|
+
}
|
1010
|
+
})
|
1011
|
+
)
|
1012
|
+
) //endreturn
|
1013
|
+
|
1014
|
+
// Materialize modified
|
1015
|
+
})( ( settings.showWeekdaysFull ? settings.weekdaysFull : settings.weekdaysLetter ).slice( 0 ), settings.weekdaysFull.slice( 0 ) ), //tableHead
|
1016
|
+
|
1017
|
+
|
1018
|
+
// Create the nav for next/prev month.
|
1019
|
+
createMonthNav = function( next ) {
|
1020
|
+
|
1021
|
+
// Otherwise, return the created month tag.
|
1022
|
+
return _.node(
|
1023
|
+
'div',
|
1024
|
+
' ',
|
1025
|
+
settings.klass[ 'nav' + ( next ? 'Next' : 'Prev' ) ] + (
|
1026
|
+
|
1027
|
+
// If the focused month is outside the range, disabled the button.
|
1028
|
+
( next && viewsetObject.year >= maxLimitObject.year && viewsetObject.month >= maxLimitObject.month ) ||
|
1029
|
+
( !next && viewsetObject.year <= minLimitObject.year && viewsetObject.month <= minLimitObject.month ) ?
|
1030
|
+
' ' + settings.klass.navDisabled : ''
|
1031
|
+
),
|
1032
|
+
'data-nav=' + ( next || -1 ) + ' ' +
|
1033
|
+
_.ariaAttr({
|
1034
|
+
role: 'button',
|
1035
|
+
controls: calendar.$node[0].id + '_table'
|
1036
|
+
}) + ' ' +
|
1037
|
+
'title="' + (next ? settings.labelMonthNext : settings.labelMonthPrev ) + '"'
|
1038
|
+
) //endreturn
|
1039
|
+
}, //createMonthNav
|
1040
|
+
|
1041
|
+
|
1042
|
+
// Create the month label.
|
1043
|
+
//Materialize modified
|
1044
|
+
createMonthLabel = function(override) {
|
1045
|
+
|
1046
|
+
var monthsCollection = settings.showMonthsShort ? settings.monthsShort : settings.monthsFull
|
1047
|
+
|
1048
|
+
// Materialize modified
|
1049
|
+
if (override == "short_months") {
|
1050
|
+
monthsCollection = settings.monthsShort;
|
1051
|
+
}
|
1052
|
+
|
1053
|
+
// If there are months to select, add a dropdown menu.
|
1054
|
+
if ( settings.selectMonths && override == undefined) {
|
1055
|
+
|
1056
|
+
return _.node( 'select',
|
1057
|
+
_.group({
|
1058
|
+
min: 0,
|
1059
|
+
max: 11,
|
1060
|
+
i: 1,
|
1061
|
+
node: 'option',
|
1062
|
+
item: function( loopedMonth ) {
|
1063
|
+
|
1064
|
+
return [
|
1065
|
+
|
1066
|
+
// The looped month and no classes.
|
1067
|
+
monthsCollection[ loopedMonth ], 0,
|
1068
|
+
|
1069
|
+
// Set the value and selected index.
|
1070
|
+
'value=' + loopedMonth +
|
1071
|
+
( viewsetObject.month == loopedMonth ? ' selected' : '' ) +
|
1072
|
+
(
|
1073
|
+
(
|
1074
|
+
( viewsetObject.year == minLimitObject.year && loopedMonth < minLimitObject.month ) ||
|
1075
|
+
( viewsetObject.year == maxLimitObject.year && loopedMonth > maxLimitObject.month )
|
1076
|
+
) ?
|
1077
|
+
' disabled' : ''
|
1078
|
+
)
|
1079
|
+
]
|
1080
|
+
}
|
1081
|
+
}),
|
1082
|
+
settings.klass.selectMonth + ' browser-default',
|
1083
|
+
( isOpen ? '' : 'disabled' ) + ' ' +
|
1084
|
+
_.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' +
|
1085
|
+
'title="' + settings.labelMonthSelect + '"'
|
1086
|
+
)
|
1087
|
+
}
|
1088
|
+
|
1089
|
+
// Materialize modified
|
1090
|
+
if (override == "short_months")
|
1091
|
+
if (selectedObject != null)
|
1092
|
+
return _.node( 'div', monthsCollection[ selectedObject.month ] );
|
1093
|
+
else return _.node( 'div', monthsCollection[ viewsetObject.month ] );
|
1094
|
+
|
1095
|
+
// If there's a need for a month selector
|
1096
|
+
return _.node( 'div', monthsCollection[ viewsetObject.month ], settings.klass.month )
|
1097
|
+
}, //createMonthLabel
|
1098
|
+
|
1099
|
+
|
1100
|
+
// Create the year label.
|
1101
|
+
// Materialize modified
|
1102
|
+
createYearLabel = function(override) {
|
1103
|
+
|
1104
|
+
var focusedYear = viewsetObject.year,
|
1105
|
+
|
1106
|
+
// If years selector is set to a literal "true", set it to 5. Otherwise
|
1107
|
+
// divide in half to get half before and half after focused year.
|
1108
|
+
numberYears = settings.selectYears === true ? 5 : ~~( settings.selectYears / 2 )
|
1109
|
+
|
1110
|
+
// If there are years to select, add a dropdown menu.
|
1111
|
+
if ( numberYears ) {
|
1112
|
+
|
1113
|
+
var
|
1114
|
+
minYear = minLimitObject.year,
|
1115
|
+
maxYear = maxLimitObject.year,
|
1116
|
+
lowestYear = focusedYear - numberYears,
|
1117
|
+
highestYear = focusedYear + numberYears
|
1118
|
+
|
1119
|
+
// If the min year is greater than the lowest year, increase the highest year
|
1120
|
+
// by the difference and set the lowest year to the min year.
|
1121
|
+
if ( minYear > lowestYear ) {
|
1122
|
+
highestYear += minYear - lowestYear
|
1123
|
+
lowestYear = minYear
|
1124
|
+
}
|
1125
|
+
|
1126
|
+
// If the max year is less than the highest year, decrease the lowest year
|
1127
|
+
// by the lower of the two: available and needed years. Then set the
|
1128
|
+
// highest year to the max year.
|
1129
|
+
if ( maxYear < highestYear ) {
|
1130
|
+
|
1131
|
+
var availableYears = lowestYear - minYear,
|
1132
|
+
neededYears = highestYear - maxYear
|
1133
|
+
|
1134
|
+
lowestYear -= availableYears > neededYears ? neededYears : availableYears
|
1135
|
+
highestYear = maxYear
|
1136
|
+
}
|
1137
|
+
|
1138
|
+
if ( settings.selectYears && override == undefined ) {
|
1139
|
+
return _.node( 'select',
|
1140
|
+
_.group({
|
1141
|
+
min: lowestYear,
|
1142
|
+
max: highestYear,
|
1143
|
+
i: 1,
|
1144
|
+
node: 'option',
|
1145
|
+
item: function( loopedYear ) {
|
1146
|
+
return [
|
1147
|
+
|
1148
|
+
// The looped year and no classes.
|
1149
|
+
loopedYear, 0,
|
1150
|
+
|
1151
|
+
// Set the value and selected index.
|
1152
|
+
'value=' + loopedYear + ( focusedYear == loopedYear ? ' selected' : '' )
|
1153
|
+
]
|
1154
|
+
}
|
1155
|
+
}),
|
1156
|
+
settings.klass.selectYear + ' browser-default',
|
1157
|
+
( isOpen ? '' : 'disabled' ) + ' ' + _.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' +
|
1158
|
+
'title="' + settings.labelYearSelect + '"'
|
1159
|
+
)
|
1160
|
+
}
|
1161
|
+
}
|
1162
|
+
|
1163
|
+
// Materialize modified
|
1164
|
+
if (override == "raw")
|
1165
|
+
return _.node( 'div', focusedYear )
|
1166
|
+
|
1167
|
+
// Otherwise just return the year focused
|
1168
|
+
return _.node( 'div', focusedYear, settings.klass.year )
|
1169
|
+
} //createYearLabel
|
1170
|
+
|
1171
|
+
|
1172
|
+
// Materialize modified
|
1173
|
+
createDayLabel = function() {
|
1174
|
+
if (selectedObject != null)
|
1175
|
+
return _.node( 'div', selectedObject.date)
|
1176
|
+
else return _.node( 'div', nowObject.date)
|
1177
|
+
}
|
1178
|
+
createWeekdayLabel = function() {
|
1179
|
+
var display_day;
|
1180
|
+
|
1181
|
+
if (selectedObject != null)
|
1182
|
+
display_day = selectedObject.day;
|
1183
|
+
else
|
1184
|
+
display_day = nowObject.day;
|
1185
|
+
var weekday = settings.weekdaysFull[ display_day ]
|
1186
|
+
return weekday
|
1187
|
+
}
|
1188
|
+
|
1189
|
+
|
1190
|
+
// Create and return the entire calendar.
|
1191
|
+
return _.node(
|
1192
|
+
// Date presentation View
|
1193
|
+
'div',
|
1194
|
+
_.node(
|
1195
|
+
'div',
|
1196
|
+
createWeekdayLabel(),
|
1197
|
+
"picker__weekday-display"
|
1198
|
+
)+
|
1199
|
+
_.node(
|
1200
|
+
// Div for short Month
|
1201
|
+
'div',
|
1202
|
+
createMonthLabel("short_months"),
|
1203
|
+
settings.klass.month_display
|
1204
|
+
)+
|
1205
|
+
_.node(
|
1206
|
+
// Div for Day
|
1207
|
+
'div',
|
1208
|
+
createDayLabel() ,
|
1209
|
+
settings.klass.day_display
|
1210
|
+
)+
|
1211
|
+
_.node(
|
1212
|
+
// Div for Year
|
1213
|
+
'div',
|
1214
|
+
createYearLabel("raw") ,
|
1215
|
+
settings.klass.year_display
|
1216
|
+
),
|
1217
|
+
settings.klass.date_display
|
1218
|
+
)+
|
1219
|
+
// Calendar container
|
1220
|
+
_.node('div',
|
1221
|
+
_.node('div',
|
1222
|
+
( settings.selectYears ? createMonthLabel() + createYearLabel() : createMonthLabel() + createYearLabel() ) +
|
1223
|
+
createMonthNav() + createMonthNav( 1 ),
|
1224
|
+
settings.klass.header
|
1225
|
+
) + _.node(
|
1226
|
+
'table',
|
1227
|
+
tableHead +
|
1228
|
+
_.node(
|
1229
|
+
'tbody',
|
1230
|
+
_.group({
|
1231
|
+
min: 0,
|
1232
|
+
max: WEEKS_IN_CALENDAR - 1,
|
1233
|
+
i: 1,
|
1234
|
+
node: 'tr',
|
1235
|
+
item: function( rowCounter ) {
|
1236
|
+
|
1237
|
+
// If Monday is the first day and the month starts on Sunday, shift the date back a week.
|
1238
|
+
var shiftDateBy = settings.firstDay && calendar.create([ viewsetObject.year, viewsetObject.month, 1 ]).day === 0 ? -7 : 0
|
1239
|
+
|
1240
|
+
return [
|
1241
|
+
_.group({
|
1242
|
+
min: DAYS_IN_WEEK * rowCounter - viewsetObject.day + shiftDateBy + 1, // Add 1 for weekday 0index
|
1243
|
+
max: function() {
|
1244
|
+
return this.min + DAYS_IN_WEEK - 1
|
1245
|
+
},
|
1246
|
+
i: 1,
|
1247
|
+
node: 'td',
|
1248
|
+
item: function( targetDate ) {
|
1249
|
+
|
1250
|
+
// Convert the time date from a relative date to a target date.
|
1251
|
+
targetDate = calendar.create([ viewsetObject.year, viewsetObject.month, targetDate + ( settings.firstDay ? 1 : 0 ) ])
|
1252
|
+
|
1253
|
+
var isSelected = selectedObject && selectedObject.pick == targetDate.pick,
|
1254
|
+
isHighlighted = highlightedObject && highlightedObject.pick == targetDate.pick,
|
1255
|
+
isDisabled = disabledCollection && calendar.disabled( targetDate ) || targetDate.pick < minLimitObject.pick || targetDate.pick > maxLimitObject.pick,
|
1256
|
+
formattedDate = _.trigger( calendar.formats.toString, calendar, [ settings.format, targetDate ] )
|
1257
|
+
|
1258
|
+
return [
|
1259
|
+
_.node(
|
1260
|
+
'div',
|
1261
|
+
targetDate.date,
|
1262
|
+
(function( klasses ) {
|
1263
|
+
|
1264
|
+
// Add the `infocus` or `outfocus` classes based on month in view.
|
1265
|
+
klasses.push( viewsetObject.month == targetDate.month ? settings.klass.infocus : settings.klass.outfocus )
|
1266
|
+
|
1267
|
+
// Add the `today` class if needed.
|
1268
|
+
if ( nowObject.pick == targetDate.pick ) {
|
1269
|
+
klasses.push( settings.klass.now )
|
1270
|
+
}
|
1271
|
+
|
1272
|
+
// Add the `selected` class if something's selected and the time matches.
|
1273
|
+
if ( isSelected ) {
|
1274
|
+
klasses.push( settings.klass.selected )
|
1275
|
+
}
|
1276
|
+
|
1277
|
+
// Add the `highlighted` class if something's highlighted and the time matches.
|
1278
|
+
if ( isHighlighted ) {
|
1279
|
+
klasses.push( settings.klass.highlighted )
|
1280
|
+
}
|
1281
|
+
|
1282
|
+
// Add the `disabled` class if something's disabled and the object matches.
|
1283
|
+
if ( isDisabled ) {
|
1284
|
+
klasses.push( settings.klass.disabled )
|
1285
|
+
}
|
1286
|
+
|
1287
|
+
return klasses.join( ' ' )
|
1288
|
+
})([ settings.klass.day ]),
|
1289
|
+
'data-pick=' + targetDate.pick + ' ' + _.ariaAttr({
|
1290
|
+
role: 'gridcell',
|
1291
|
+
label: formattedDate,
|
1292
|
+
selected: isSelected && calendar.$node.val() === formattedDate ? true : null,
|
1293
|
+
activedescendant: isHighlighted ? true : null,
|
1294
|
+
disabled: isDisabled ? true : null
|
1295
|
+
})
|
1296
|
+
),
|
1297
|
+
'',
|
1298
|
+
_.ariaAttr({ role: 'presentation' })
|
1299
|
+
] //endreturn
|
1300
|
+
}
|
1301
|
+
})
|
1302
|
+
] //endreturn
|
1303
|
+
}
|
1304
|
+
})
|
1305
|
+
),
|
1306
|
+
settings.klass.table,
|
1307
|
+
'id="' + calendar.$node[0].id + '_table' + '" ' + _.ariaAttr({
|
1308
|
+
role: 'grid',
|
1309
|
+
controls: calendar.$node[0].id,
|
1310
|
+
readonly: true
|
1311
|
+
})
|
1312
|
+
)
|
1313
|
+
, settings.klass.calendar_container) // end calendar
|
1314
|
+
|
1315
|
+
+
|
1316
|
+
|
1317
|
+
// * For Firefox forms to submit, make sure to set the buttons’ `type` attributes as “button”.
|
1318
|
+
_.node(
|
1319
|
+
'div',
|
1320
|
+
_.node( 'button', settings.today, "btn-flat picker__today",
|
1321
|
+
'type=button data-pick=' + nowObject.pick +
|
1322
|
+
( isOpen && !calendar.disabled(nowObject) ? '' : ' disabled' ) + ' ' +
|
1323
|
+
_.ariaAttr({ controls: calendar.$node[0].id }) ) +
|
1324
|
+
_.node( 'button', settings.clear, "btn-flat picker__clear",
|
1325
|
+
'type=button data-clear=1' +
|
1326
|
+
( isOpen ? '' : ' disabled' ) + ' ' +
|
1327
|
+
_.ariaAttr({ controls: calendar.$node[0].id }) ) +
|
1328
|
+
_.node('button', settings.close, "btn-flat picker__close",
|
1329
|
+
'type=button data-close=true ' +
|
1330
|
+
( isOpen ? '' : ' disabled' ) + ' ' +
|
1331
|
+
_.ariaAttr({ controls: calendar.$node[0].id }) ),
|
1332
|
+
settings.klass.footer
|
1333
|
+
) //endreturn
|
1334
|
+
} //DatePicker.prototype.nodes
|
1335
|
+
|
1336
|
+
|
1337
|
+
|
1338
|
+
|
1339
|
+
/**
|
1340
|
+
* The date picker defaults.
|
1341
|
+
*/
|
1342
|
+
DatePicker.defaults = (function( prefix ) {
|
1343
|
+
|
1344
|
+
return {
|
1345
|
+
|
1346
|
+
// The title label to use for the month nav buttons
|
1347
|
+
labelMonthNext: 'Next month',
|
1348
|
+
labelMonthPrev: 'Previous month',
|
1349
|
+
|
1350
|
+
// The title label to use for the dropdown selectors
|
1351
|
+
labelMonthSelect: 'Select a month',
|
1352
|
+
labelYearSelect: 'Select a year',
|
1353
|
+
|
1354
|
+
// Months and weekdays
|
1355
|
+
monthsFull: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ],
|
1356
|
+
monthsShort: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ],
|
1357
|
+
weekdaysFull: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ],
|
1358
|
+
weekdaysShort: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],
|
1359
|
+
|
1360
|
+
// Materialize modified
|
1361
|
+
weekdaysLetter: [ 'S', 'M', 'T', 'W', 'T', 'F', 'S' ],
|
1362
|
+
|
1363
|
+
// Today and clear
|
1364
|
+
today: 'Today',
|
1365
|
+
clear: 'Clear',
|
1366
|
+
close: 'Close',
|
1367
|
+
|
1368
|
+
// The format to show on the `input` element
|
1369
|
+
format: 'd mmmm, yyyy',
|
1370
|
+
|
1371
|
+
// Added Options
|
1372
|
+
closeOnSelect: true,
|
1373
|
+
closeOnClear: true,
|
1374
|
+
|
1375
|
+
|
1376
|
+
// Classes
|
1377
|
+
klass: {
|
1378
|
+
|
1379
|
+
table: prefix + 'table',
|
1380
|
+
|
1381
|
+
header: prefix + 'header',
|
1382
|
+
|
1383
|
+
|
1384
|
+
// Materialize Added klasses
|
1385
|
+
date_display: prefix + 'date-display',
|
1386
|
+
day_display: prefix + 'day-display',
|
1387
|
+
month_display: prefix + 'month-display',
|
1388
|
+
year_display: prefix + 'year-display',
|
1389
|
+
calendar_container: prefix + 'calendar-container',
|
1390
|
+
// end
|
1391
|
+
|
1392
|
+
|
1393
|
+
|
1394
|
+
navPrev: prefix + 'nav--prev',
|
1395
|
+
navNext: prefix + 'nav--next',
|
1396
|
+
navDisabled: prefix + 'nav--disabled',
|
1397
|
+
|
1398
|
+
month: prefix + 'month',
|
1399
|
+
year: prefix + 'year',
|
1400
|
+
|
1401
|
+
selectMonth: prefix + 'select--month',
|
1402
|
+
selectYear: prefix + 'select--year',
|
1403
|
+
|
1404
|
+
weekdays: prefix + 'weekday',
|
1405
|
+
|
1406
|
+
day: prefix + 'day',
|
1407
|
+
disabled: prefix + 'day--disabled',
|
1408
|
+
selected: prefix + 'day--selected',
|
1409
|
+
highlighted: prefix + 'day--highlighted',
|
1410
|
+
now: prefix + 'day--today',
|
1411
|
+
infocus: prefix + 'day--infocus',
|
1412
|
+
outfocus: prefix + 'day--outfocus',
|
1413
|
+
|
1414
|
+
footer: prefix + 'footer',
|
1415
|
+
|
1416
|
+
buttonClear: prefix + 'button--clear',
|
1417
|
+
buttonToday: prefix + 'button--today',
|
1418
|
+
buttonClose: prefix + 'button--close'
|
1419
|
+
}
|
1420
|
+
}
|
1421
|
+
})( Picker.klasses().picker + '__' )
|
1422
|
+
|
1423
|
+
|
1424
|
+
|
1425
|
+
|
1426
|
+
|
1427
|
+
/**
|
1428
|
+
* Extend the picker to add the date picker.
|
1429
|
+
*/
|
1430
|
+
Picker.extend( 'pickadate', DatePicker )
|
1431
|
+
|
1432
|
+
|
1433
|
+
}));
|
1434
|
+
|
1435
|
+
|