integral 1.1.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +6 -33
- data/Rakefile +1 -1
- data/app/assets/images/integral/defaults/no_image_available.jpg +0 -0
- data/app/assets/images/logo.png +0 -0
- data/app/assets/javascripts/ckeditor/my_config.js.erb +26 -18
- data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/lv.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/autoembed/plugin.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +14 -14
- data/app/assets/javascripts/ckeditor/plugins/autogrow/samples/autogrow.html +8 -8
- data/app/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
- data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/autoformat.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/images/autocomplete.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/images/autoformat.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/images/commentselectedrange.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/images/searchcode.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/images/uncommentselectedrange.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -6
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.handlebars.min.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -3
- data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/bg.js +7 -7
- data/app/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +231 -217
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/darcula.css +46 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/gruvbox-dark.css +34 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/idea.css +42 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +1 -1
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/lucario.css +37 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +5 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/oceanic-next.css +44 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/shadowfox.css +52 -0
- data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/ssms.css +16 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ar.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/lv.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/embedbase/plugin.js +1 -1
- data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/copywidget.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/editwidget.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/hidpi/copywidget.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/hidpi/editwidget.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/hidpi/removewidget.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/hidpi/widget.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/removewidget.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/foundation-callout/icons/widget.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/foundation-callout/plugin.js +86 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/dev/assets/image1.jpg +0 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/dev/assets/image2.jpg +0 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/dev/contents.css +35 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/dev/image2.html +339 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/dialogs/image2.js +553 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/icons/hidpi/image.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/icons/image.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/af.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/ar.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/az.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/bg.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/bn.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/bs.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/ca.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/cs.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/cy.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/da.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/de-ch.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/de.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/el.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/en-au.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/en-ca.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/en-gb.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/en.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/eo.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/es-mx.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/es.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/et.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/eu.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/fa.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/fi.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/fo.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/fr-ca.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/fr.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/gl.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/gu.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/he.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/hi.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/hr.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/hu.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/id.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/is.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/it.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/ja.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/ka.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/km.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/ko.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/ku.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/lt.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/lv.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/mk.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/mn.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/ms.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/nb.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/nl.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/no.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/oc.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/pl.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/pt-br.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/pt.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/ro.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/ru.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/si.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/sk.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/sl.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/sq.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/sr-latn.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/sr.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/sv.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/th.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/tr.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/tt.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/ug.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/uk.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/vi.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/zh-cn.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/lang/zh.js +21 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/plugin.js +1720 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/samples/assets/image1.jpg +0 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/samples/assets/image2.jpg +0 -0
- data/app/assets/javascripts/ckeditor/plugins/image2/samples/image2.html +68 -0
- data/app/assets/javascripts/ckeditor/plugins/lineutils/dev/dnd.html +4 -4
- data/app/assets/javascripts/ckeditor/plugins/lineutils/dev/magicfinger.html +4 -4
- data/app/assets/javascripts/ckeditor/plugins/lineutils/plugin.js +7 -7
- data/app/assets/javascripts/ckeditor/plugins/linkballoon/README.md +5 -0
- data/app/assets/javascripts/ckeditor/plugins/linkballoon/assets/demo.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/linkballoon/plugin.js +25 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/az.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/bg.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/ca.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/cs.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/da.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/de-ch.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/de.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/en-au.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/en.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/eo.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/es-mx.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/es.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/et.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/eu.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/fa.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/fr.js +3 -3
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/gl.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/hr.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/hu.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/id.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/it.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/ja.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/km.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/ko.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/ku.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/lv.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/nb.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/nl.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/oc.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/pl.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/pt-br.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/pt.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/ro.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/sk.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/sq.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/sv.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/tr.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/ug.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/uk.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/zh-cn.js +3 -3
- data/app/assets/javascripts/ckeditor/plugins/notification/lang/zh.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/notification/plugin.js +794 -784
- data/app/assets/javascripts/ckeditor/plugins/openlink/README.md +50 -0
- data/app/assets/javascripts/ckeditor/plugins/openlink/icons/hidpi/openLink.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/openlink/icons/openLink.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/openlink/lang/bg.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/openlink/lang/de.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/openlink/lang/en.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/openlink/lang/pl.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/openlink/lang/ru.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/openlink/lang/uk.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/openlink/plugin.js +178 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/dev/placeholder.html +5 -5
- data/app/assets/javascripts/ckeditor/plugins/placeholder/dialogs/placeholder.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/af.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ar.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/az.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/bg.js +5 -5
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ca.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/cs.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/cy.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/da.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/de-ch.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/de.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/el.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/en-au.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/en-gb.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/en.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/eo.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/es-mx.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/es.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/et.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/eu.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fa.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fi.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fr-ca.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fr.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/gl.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/he.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/hr.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/hu.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/id.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/it.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ja.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/km.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ko.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ku.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/lv.js +5 -5
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/nb.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/nl.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/no.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/oc.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pl.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pt-br.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pt.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ro.js +12 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ru.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/si.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sk.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sl.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sq.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sv.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/th.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/tr.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/tt.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ug.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/uk.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/vi.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/zh-cn.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/zh.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +3 -3
- data/app/assets/javascripts/ckeditor/plugins/placeholder/samples/placeholder.html +6 -6
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/dialogs/simplebox.js +4 -4
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/plugin.js +3 -3
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/console.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/nestedwidgets.html +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/dev/widgetstyles.html +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/af.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ar.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/az.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/bg.js +3 -3
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ca.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/cs.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/cy.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/da.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/de-ch.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/de.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/el.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/en-au.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/en-gb.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/en.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/eo.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/es-mx.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/es.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/et.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/eu.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/fa.js +3 -3
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/fi.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/fr.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/gl.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/he.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/hr.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/hu.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/id.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/it.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ja.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/km.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ko.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ku.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/lv.js +3 -3
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/nb.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/nl.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/no.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/oc.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/pl.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/pt-br.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/pt.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ro.js +8 -0
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ru.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/sk.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/sl.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/sq.js +3 -3
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/sv.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/tr.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/tt.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/ug.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/uk.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/vi.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/zh-cn.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/lang/zh.js +2 -2
- data/app/assets/javascripts/ckeditor/plugins/widget/plugin.js +235 -64
- data/app/assets/javascripts/ckeditor/plugins/widgetselection/plugin.js +6 -11
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ar.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/bg.js +17 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ca.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/cs.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/da.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/de.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/el.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +5 -1
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/es.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/eu.js +17 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/fa.js +13 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/fi.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/fr.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/he.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/hr.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/hu.js +14 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/it.js +4 -3
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ja.js +5 -5
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ko.js +16 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/nl.js +3 -2
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/no.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pl.js +4 -3
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pt-br.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pt.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ro.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +2 -1
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/sk.js +15 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/sv.js +5 -3
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/tr.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/uk.js +17 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/zh-cn.js +1 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/zh.js +14 -0
- data/app/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +485 -302
- data/app/assets/javascripts/ckeditor/plugins/wordcount/samples/maxParagraphs.html +26 -0
- data/app/assets/javascripts/integral/backend.js +196 -25
- data/app/assets/javascripts/integral/frontend.js +37 -2
- data/app/assets/javascripts/integral/support/character_counter.js +13 -8
- data/app/assets/javascripts/integral/support/confirm_modal.coffee +2 -2
- data/app/assets/javascripts/integral/support/date_picker.coffee +54 -59
- data/app/assets/javascripts/integral/support/gallery.coffee +71 -54
- data/app/assets/javascripts/integral/support/grid.coffee +11 -4
- data/app/assets/javascripts/integral/support/lib/lazysizes.js +755 -0
- data/app/assets/javascripts/integral/support/lib/materialize-tags.js +49 -44
- data/app/assets/javascripts/integral/support/list.coffee +1 -0
- data/app/assets/javascripts/integral/support/ls.instagram.js +57 -0
- data/app/assets/javascripts/integral/support/ls.twitter.js +66 -0
- data/app/assets/javascripts/integral/support/record_selector.coffee +3 -1
- data/app/assets/javascripts/integral/support/remote_form.coffee +18 -11
- data/app/assets/javascripts/integral/support/slug_generator.coffee +1 -0
- data/app/assets/stylesheets/integral/backend.sass +36 -24
- data/app/assets/stylesheets/integral/backend/_foundation_settings.scss +5 -6
- data/app/assets/stylesheets/integral/backend/dashboard-layout.scss +31 -64
- data/app/assets/stylesheets/integral/backend/devise.sass +2 -3
- data/app/assets/stylesheets/integral/backend/materialize-tags.sass +2 -1
- data/app/assets/stylesheets/integral/backend/modules/dropdown_pane_notifications.scss +150 -0
- data/app/assets/stylesheets/integral/backend/modules/dropdown_pane_profile.scss +59 -0
- data/app/assets/stylesheets/integral/backend/modules/timeline.scss +214 -0
- data/app/assets/stylesheets/integral/backend/shared.sass +121 -13
- data/app/assets/stylesheets/integral/frontend.scss +45 -0
- data/app/assets/stylesheets/integral/frontend/_foundation_settings.scss +2 -2
- data/app/assets/stylesheets/integral/frontend/blog.sass +155 -142
- data/app/assets/stylesheets/integral/frontend/layout.sass +13 -3
- data/app/assets/stylesheets/integral/frontend/modules/article-footer.scss +55 -0
- data/app/assets/stylesheets/integral/frontend/modules/article.scss +34 -0
- data/app/assets/stylesheets/integral/frontend/modules/horizontal-post.scss +44 -0
- data/app/assets/stylesheets/integral/frontend/modules/inline-articles.scss +23 -0
- data/app/assets/stylesheets/integral/frontend/modules/latest-post.scss +37 -0
- data/app/assets/stylesheets/integral/frontend/modules/list-widget.scss +50 -0
- data/app/assets/stylesheets/integral/frontend/modules/piped-list.scss +33 -0
- data/app/assets/stylesheets/integral/frontend/modules/post-tags.scss +19 -0
- data/app/assets/stylesheets/integral/frontend/modules/scroll-container.scss +9 -0
- data/app/assets/stylesheets/integral/frontend/modules/sidebar-articles.scss +42 -0
- data/app/assets/stylesheets/integral/frontend/modules/sidebar-tags.scss +6 -0
- data/app/assets/stylesheets/integral/frontend/modules/sidebar-widget.scss +47 -0
- data/app/assets/stylesheets/integral/frontend/modules/vertical-post.scss +31 -0
- data/app/assets/stylesheets/integral/frontend/share_modal.sass +0 -5
- data/app/assets/stylesheets/integral/support/gallery.sass +8 -0
- data/app/assets/stylesheets/integral/support/media-query-indicator.sass +9 -3
- data/app/controllers/integral/application_controller.rb +10 -3
- data/app/controllers/integral/backend/activities_controller.rb +31 -26
- data/app/controllers/integral/backend/base_controller.rb +265 -26
- data/app/controllers/integral/backend/categories_controller.rb +49 -0
- data/app/controllers/integral/backend/images_controller.rb +39 -54
- data/app/controllers/integral/backend/lists_controller.rb +16 -98
- data/app/controllers/integral/backend/notification_subscriptions_controller.rb +23 -0
- data/app/controllers/integral/backend/pages_controller.rb +15 -117
- data/app/controllers/integral/backend/posts_controller.rb +22 -108
- data/app/controllers/integral/backend/settings_controller.rb +7 -8
- data/app/controllers/integral/backend/static_pages_controller.rb +14 -0
- data/app/controllers/integral/backend/users_controller.rb +61 -79
- data/app/controllers/integral/blog_controller.rb +12 -0
- data/app/controllers/integral/categories_controller.rb +45 -0
- data/app/controllers/integral/pages_controller.rb +3 -3
- data/app/controllers/integral/posts_controller.rb +7 -9
- data/app/controllers/integral/tags_controller.rb +5 -2
- data/app/decorators/integral/base_decorator.rb +16 -0
- data/app/decorators/integral/category_decorator.rb +30 -0
- data/app/decorators/integral/image_decorator.rb +3 -3
- data/app/decorators/integral/list_decorator.rb +1 -13
- data/app/decorators/integral/notification/notification_decorator.rb +74 -0
- data/app/decorators/integral/page_decorator.rb +1 -13
- data/app/decorators/integral/paginating_decorator.rb +6 -0
- data/app/decorators/integral/post_decorator.rb +44 -4
- data/app/decorators/integral/user_decorator.rb +1 -13
- data/app/decorators/integral/version_decorator.rb +58 -15
- data/app/helpers/integral/application_helper.rb +7 -0
- data/app/helpers/integral/backend/base_helper.rb +135 -15
- data/app/helpers/integral/blog_helper.rb +46 -0
- data/app/helpers/integral/social_helper.rb +0 -23
- data/app/jobs/integral/application_job.rb +1 -0
- data/app/jobs/integral/newsletter_signup_job.rb +0 -2
- data/app/jobs/integral/webhook/delivery_job.rb +37 -0
- data/app/mailers/integral/contact_mailer.rb +4 -1
- data/app/mailers/integral/devise_mailer.rb +6 -0
- data/app/models/concerns/integral/lazy_contentable.rb +54 -0
- data/app/models/concerns/integral/notification/subscribable.rb +67 -0
- data/app/models/concerns/integral/webhook/delivery.rb +30 -0
- data/app/models/concerns/integral/webhook/observable.rb +23 -0
- data/app/models/integral/application_record.rb +9 -0
- data/app/models/integral/category.rb +29 -0
- data/app/models/integral/category_version.rb +8 -0
- data/app/models/integral/image.rb +40 -3
- data/app/models/integral/list.rb +11 -4
- data/app/models/integral/list_item.rb +15 -16
- data/app/models/integral/list_item_connection.rb +6 -0
- data/app/models/integral/notification/notification.rb +28 -0
- data/app/models/integral/notification/subscription.rb +14 -0
- data/app/models/integral/page.rb +32 -10
- data/app/models/integral/post.rb +39 -14
- data/app/models/integral/user.rb +51 -2
- data/app/models/integral/version.rb +2 -2
- data/app/models/integral/webhook/endpoint.rb +40 -0
- data/app/models/integral/webhook/event.rb +20 -0
- data/app/policies/integral/base_policy.rb +7 -11
- data/app/policies/integral/category_policy.rb +9 -0
- data/app/policies/integral/page_policy.rb +1 -0
- data/app/policies/integral/version_policy.rb +0 -8
- data/app/serializers/integral/post_serializer.rb +24 -0
- data/app/uploaders/integral/avatar_uploader.rb +1 -1
- data/app/views/devise/invitations/edit.haml +1 -4
- data/app/views/devise/mailer/invitation_instructions.inky-haml +20 -0
- data/app/views/devise/sessions/new.haml +2 -2
- data/app/views/integral/backend/activities/_activity.haml +21 -0
- data/app/views/integral/backend/activities/grid/_dropdown_actions.haml +1 -0
- data/app/views/integral/backend/activities/grid/_row_content.haml +13 -0
- data/app/views/integral/backend/activities/index.haml +7 -13
- data/app/views/integral/backend/activities/shared/_grid.haml +35 -19
- data/app/views/integral/backend/activities/shared/index.haml +15 -0
- data/app/views/integral/backend/activities/shared/{_log.haml → show.haml} +7 -7
- data/app/views/integral/backend/activities/show.haml +1 -1
- data/app/views/integral/backend/categories/_modal.haml +24 -0
- data/app/views/integral/backend/images/_form.haml +16 -28
- data/app/views/integral/backend/images/edit.haml +2 -2
- data/app/views/integral/backend/images/grid/_dropdown_actions.haml +5 -0
- data/app/views/integral/backend/images/grid/_row_content.haml +5 -0
- data/app/views/integral/backend/images/index.haml +11 -17
- data/app/views/integral/backend/images/list.haml +11 -0
- data/app/views/integral/backend/images/show.haml +26 -0
- data/app/views/integral/backend/lists/_form.haml +7 -20
- data/app/views/integral/backend/lists/_item_container.haml +1 -1
- data/app/views/integral/backend/lists/_item_modal.haml +3 -3
- data/app/views/integral/backend/lists/_list_item_fields.haml +3 -2
- data/app/views/integral/backend/lists/_manager.haml +11 -13
- data/app/views/integral/backend/lists/edit.haml +11 -11
- data/app/views/integral/backend/lists/grid/_dropdown_actions.haml +9 -0
- data/app/views/integral/backend/lists/grid/_row_content.haml +3 -0
- data/app/views/integral/backend/lists/index.haml +11 -17
- data/app/views/integral/backend/lists/list.haml +11 -0
- data/app/views/integral/backend/lists/show.haml +30 -0
- data/app/views/integral/backend/notifications/_notification.haml +21 -0
- data/app/views/integral/backend/pages/_form.haml +20 -47
- data/app/views/integral/backend/pages/edit.haml +18 -0
- data/app/views/integral/backend/pages/grid/_dropdown_actions.haml +11 -0
- data/app/views/integral/backend/pages/grid/_row_content.haml +5 -0
- data/app/views/integral/backend/pages/index.haml +11 -21
- data/app/views/integral/backend/pages/list.haml +15 -0
- data/app/views/integral/backend/pages/show.haml +32 -0
- data/app/views/integral/backend/posts/_form.haml +19 -51
- data/app/views/integral/backend/posts/edit.haml +5 -10
- data/app/views/integral/backend/posts/grid/_dropdown_actions.haml +10 -0
- data/app/views/integral/backend/posts/grid/_row_content.haml +6 -0
- data/app/views/integral/backend/posts/index.haml +13 -19
- data/app/views/integral/backend/posts/list.haml +13 -0
- data/app/views/integral/backend/posts/new.haml +0 -1
- data/app/views/integral/backend/posts/show.haml +31 -0
- data/app/views/integral/backend/settings/sections/_social.haml +1 -3
- data/app/views/integral/backend/shared/_activity_modal.haml +13 -0
- data/app/views/integral/backend/shared/_breadcrumbs.haml +7 -4
- data/app/views/integral/backend/shared/_image_preview.haml +10 -3
- data/app/views/integral/backend/shared/_image_selector.haml +1 -1
- data/app/views/integral/backend/shared/_notification_subscription_toggle.haml +22 -0
- data/app/views/integral/backend/shared/action_bar/_index.haml +9 -0
- data/app/views/integral/backend/shared/action_bar/_show.haml +3 -0
- data/app/views/integral/backend/shared/cards/_at_a_glance.haml +3 -3
- data/app/views/integral/backend/shared/cards/_categories.haml +33 -0
- data/app/views/integral/backend/{static_pages/_card.haml → shared/cards/_object.haml} +1 -1
- data/app/views/integral/backend/shared/cards/_recent_activity.haml +20 -0
- data/app/views/integral/backend/shared/cards/_recent_resources.haml +17 -0
- data/app/views/integral/backend/shared/cards/_recent_user_activity.haml +1 -0
- data/app/views/integral/backend/shared/cards/_top_post_authors.haml +18 -0
- data/app/views/integral/backend/shared/cards/_welcome.haml +24 -25
- data/app/views/integral/backend/shared/{_empty_grid.haml → grid/_empty.haml} +0 -0
- data/app/views/integral/backend/shared/grid/_form.haml +9 -0
- data/app/views/integral/backend/shared/grid/_grid.haml +21 -0
- data/app/views/integral/backend/shared/{_pagination.haml → grid/_pagination.haml} +0 -0
- data/app/views/integral/backend/shared/grid/_row_layout.haml +8 -0
- data/app/views/integral/backend/shared/record_selector/_collection.haml +1 -0
- data/app/views/integral/backend/shared/record_selector/_modal.haml +9 -10
- data/app/views/integral/backend/shared/record_selector/_record.haml +6 -4
- data/app/views/integral/backend/static_pages/dashboard.haml +17 -16
- data/app/views/integral/backend/users/_form.haml +35 -47
- data/app/views/integral/backend/users/edit.haml +1 -1
- data/app/views/integral/backend/users/grid/_dropdown_actions.haml +17 -0
- data/app/views/integral/backend/users/grid/_row_content.haml +8 -0
- data/app/views/integral/backend/users/index.haml +11 -17
- data/app/views/integral/backend/users/list.haml +12 -0
- data/app/views/integral/backend/users/show.haml +22 -19
- data/app/views/integral/categories/show.haml +5 -0
- data/app/views/integral/posts/_article_footer.haml +17 -0
- data/app/views/integral/posts/_card.haml +11 -0
- data/app/views/integral/posts/_latest_post.haml +8 -0
- data/app/views/integral/posts/_most_read_section.haml +8 -0
- data/app/views/integral/posts/_post.haml +11 -0
- data/app/views/integral/posts/_similar_posts.haml +5 -0
- data/app/views/integral/posts/index.haml +7 -5
- data/app/views/integral/posts/templates/default.haml +35 -35
- data/app/views/integral/shared/_share_modal.haml +0 -3
- data/app/views/integral/shared/_social_list_items.haml +6 -12
- data/app/views/integral/shared/_subscribe_modal.haml +14 -0
- data/app/views/integral/shared/blog/_categories.haml +15 -0
- data/app/views/integral/shared/blog/_layout.haml +9 -0
- data/app/views/integral/shared/blog/_sidebar.haml +10 -0
- data/app/views/integral/shared/gallery/_placeholder.haml +1 -1
- data/app/views/integral/shared/gallery/_slide.haml +2 -2
- data/app/views/integral/shared/gallery/gallery.haml +5 -2
- data/app/views/integral/shared/sidebar/_item.haml +8 -0
- data/app/views/integral/shared/sidebar/_newsletter_signup.haml +7 -0
- data/app/views/integral/shared/sidebar/_popular_posts.haml +7 -0
- data/app/views/integral/shared/sidebar/_popular_tags.haml +7 -0
- data/app/views/integral/shared/sidebar/_recent_posts.haml +7 -0
- data/app/views/integral/tags/index.haml +2 -2
- data/app/views/integral/tags/show.haml +3 -6
- data/app/views/layouts/integral/backend.html.haml +27 -5
- data/app/views/layouts/integral/backend/_create_dropdown.haml +1 -30
- data/app/views/layouts/integral/backend/_main_menu_items.haml +1 -91
- data/app/views/layouts/integral/frontend.html.haml +3 -3
- data/config/initializers/devise.rb +1 -1
- data/config/locales/en.yml +127 -55
- data/config/routes.rb +2 -0
- data/db/migrate/20190414172018_create_webhook_endpoints.rb +10 -0
- data/db/migrate/20190929191412_add_integral_post_categories.rb +13 -0
- data/db/migrate/20191203090008_add_image_to_integral_categories.rb +6 -0
- data/db/migrate/20200401210442_create_category_versions.rb +20 -0
- data/db/migrate/20200407022636_create_integral_notifications.rb +25 -0
- data/db/migrate/20200421223602_add_status_to_integral_users.rb +5 -0
- data/db/seeds.rb +15 -9
- data/lib/generators/integral/assets_generator.rb +2 -2
- data/lib/generators/integral/install_generator.rb +1 -1
- data/lib/generators/integral/views_generator.rb +1 -1
- data/lib/generators/templates/app.yml +0 -1
- data/lib/generators/templates/integral.rb +5 -0
- data/lib/integral.rb +4 -30
- data/lib/integral/acts_as_integral.rb +115 -0
- data/lib/integral/acts_as_listable.rb +3 -3
- data/lib/integral/chart_renderer/base.rb +2 -0
- data/lib/integral/content_renderer.rb +2 -2
- data/lib/integral/engine.rb +12 -2
- data/lib/integral/grids/activities_grid.rb +15 -2
- data/lib/integral/grids/lists_grid.rb +1 -0
- data/lib/integral/grids/posts_grid.rb +5 -1
- data/lib/integral/grids/users_grid.rb +5 -0
- data/lib/integral/list_item_renderer.rb +4 -2
- data/lib/integral/list_renderer.rb +6 -1
- data/lib/integral/middleware/page_router.rb +15 -6
- data/lib/integral/router.rb +42 -8
- data/lib/integral/version.rb +1 -1
- data/lib/integral/widgets/swiper_list.rb +3 -2
- data/public/images/integral/demo/continous-integration.png +0 -0
- data/public/images/integral/demo/foundation-frontend-framework.jpg +0 -0
- data/public/images/integral/demo/heroku.png +0 -0
- data/public/images/integral/demo/integral-cms-without-hassle.jpg +0 -0
- data/public/images/integral/demo/integral-features-activity-tracking.jpg +0 -0
- data/public/images/integral/demo/integral-features-contact-form.png +0 -0
- data/public/images/integral/demo/integral-features-design.jpg +0 -0
- data/public/images/integral/demo/integral-features-dynamic-pages.jpg +0 -0
- data/public/images/integral/demo/integral-features-image-management.jpg +0 -0
- data/public/images/integral/demo/integral-features-integrated-blog.jpg +0 -0
- data/public/images/integral/demo/integral-features-list-management.jpg +0 -0
- data/public/images/integral/demo/integral-features-seo-ready.jpg +0 -0
- data/public/images/integral/demo/integral-features-user-management.jpg +0 -0
- data/public/images/integral/demo/integral-presentation.png +0 -0
- data/public/integral/ckeditor_demo_content.html +0 -13
- data/spec/factories.rb +30 -8
- metadata +305 -113
- data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/jp.js +0 -13
- data/app/assets/javascripts/integral/support/date_picker/picker.date.js +0 -1435
- data/app/assets/javascripts/integral/support/date_picker/picker.js +0 -1132
- data/app/assets/stylesheets/integral/frontend.sass +0 -26
- data/app/assets/stylesheets/integral/support/date-picker.scss +0 -16
- data/app/assets/stylesheets/integral/support/date_picker/_default.date.scss +0 -452
- data/app/assets/stylesheets/integral/support/date_picker/_default.scss +0 -201
- data/app/assets/stylesheets/integral/support/date_picker/materialize_clockpicker.sass +0 -220
- data/app/views/devise/mailer/invitation_instructions.html.erb +0 -13
- data/app/views/integral/backend/activities/_grid.haml +0 -23
- data/app/views/integral/backend/activities/shared/_listing.haml +0 -14
- data/app/views/integral/backend/images/_grid.haml +0 -16
- data/app/views/integral/backend/lists/_grid.haml +0 -14
- data/app/views/integral/backend/pages/_grid.haml +0 -21
- data/app/views/integral/backend/pages/activities.haml +0 -2
- data/app/views/integral/backend/pages/activity.haml +0 -1
- data/app/views/integral/backend/pages/edit.html.haml +0 -15
- data/app/views/integral/backend/posts/_grid.haml +0 -25
- data/app/views/integral/backend/posts/activities.haml +0 -3
- data/app/views/integral/backend/posts/activity.haml +0 -1
- data/app/views/integral/backend/shared/_grid.haml +0 -18
- data/app/views/integral/backend/users/_grid.haml +0 -19
- data/app/views/integral/posts/_collection.haml +0 -4
- data/app/views/integral/posts/_item.haml +0 -16
- data/app/views/integral/shared/_blog_layout.haml +0 -15
- data/app/views/integral/shared/_blog_sidebar.haml +0 -49
- data/lib/integral/slack_bot.rb +0 -45
@@ -3,165 +3,211 @@
|
|
3
3
|
* For licensing, see LICENSE.html or http://ckeditor.com/license
|
4
4
|
*/
|
5
5
|
|
6
|
-
CKEDITOR.plugins.add("wordcount",
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
6
|
+
CKEDITOR.plugins.add("wordcount",
|
7
|
+
{
|
8
|
+
lang: "ar,bg,ca,cs,da,de,el,en,es,eu,fa,fi,fr,he,hr,hu,it,ko,ja,nl,no,pl,pt,pt-br,ru,sk,sv,tr,uk,zh-cn,zh,ro", // %REMOVE_LINE_CORE%
|
9
|
+
version: "1.17.4",
|
10
|
+
requires: 'htmlwriter,notification,undo',
|
11
|
+
bbcodePluginLoaded: false,
|
12
|
+
onLoad: function() {
|
13
|
+
CKEDITOR.document.appendStyleSheet(this.path + "css/wordcount.css");
|
14
|
+
},
|
15
|
+
init: function(editor) {
|
16
|
+
var defaultFormat = "",
|
17
|
+
lastWordCount = -1,
|
18
|
+
lastCharCount = -1,
|
19
|
+
lastParagraphs = -1,
|
20
|
+
limitReachedNotified = false,
|
21
|
+
limitRestoredNotified = false,
|
22
|
+
timeoutId = 0,
|
23
|
+
notification = null;
|
24
|
+
|
25
|
+
|
26
|
+
var dispatchEvent = function(type, currentLength, maxLength) {
|
27
|
+
if (typeof document.dispatchEvent == 'undefined') {
|
28
|
+
return;
|
29
|
+
}
|
30
|
+
|
31
|
+
type = 'ckeditor.wordcount.' + type;
|
32
|
+
|
33
|
+
var cEvent;
|
34
|
+
var eventInitDict = {
|
35
|
+
bubbles: false,
|
36
|
+
cancelable: true,
|
37
|
+
detail: {
|
38
|
+
currentLength: currentLength,
|
39
|
+
maxLength: maxLength
|
40
|
+
}
|
41
|
+
};
|
42
|
+
|
43
|
+
try {
|
44
|
+
cEvent = new CustomEvent(type, eventInitDict);
|
45
|
+
} catch (o_O) {
|
46
|
+
cEvent = document.createEvent('CustomEvent');
|
47
|
+
cEvent.initCustomEvent(
|
48
|
+
type,
|
49
|
+
eventInitDict.bubbles,
|
50
|
+
eventInitDict.cancelable,
|
51
|
+
eventInitDict.detail
|
52
|
+
);
|
53
|
+
}
|
24
54
|
|
25
|
-
|
55
|
+
document.dispatchEvent(cEvent);
|
56
|
+
};
|
26
57
|
|
27
|
-
|
28
|
-
var
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
58
|
+
// Default Config
|
59
|
+
var defaultConfig = {
|
60
|
+
showRemaining: false,
|
61
|
+
showParagraphs: true,
|
62
|
+
showWordCount: true,
|
63
|
+
showCharCount: false,
|
64
|
+
countBytesAsChars: false,
|
65
|
+
countSpacesAsChars: false,
|
66
|
+
countHTML: false,
|
67
|
+
countLineBreaks: false,
|
68
|
+
hardLimit: true,
|
69
|
+
|
70
|
+
//MAXLENGTH Properties
|
71
|
+
maxWordCount: -1,
|
72
|
+
maxCharCount: -1,
|
73
|
+
maxParagraphs: -1,
|
74
|
+
|
75
|
+
// Filter
|
76
|
+
filter: null,
|
77
|
+
|
78
|
+
// How long to show the 'paste' warning
|
79
|
+
pasteWarningDuration: 0,
|
80
|
+
|
81
|
+
//DisAllowed functions
|
82
|
+
wordCountGreaterThanMaxLengthEvent: function(currentLength, maxLength) {
|
83
|
+
dispatchEvent('wordCountGreaterThanMaxLengthEvent', currentLength, maxLength);
|
84
|
+
},
|
85
|
+
charCountGreaterThanMaxLengthEvent: function(currentLength, maxLength) {
|
86
|
+
dispatchEvent('charCountGreaterThanMaxLengthEvent', currentLength, maxLength);
|
87
|
+
},
|
88
|
+
|
89
|
+
//Allowed Functions
|
90
|
+
wordCountLessThanMaxLengthEvent: function(currentLength, maxLength) {
|
91
|
+
dispatchEvent('wordCountLessThanMaxLengthEvent', currentLength, maxLength);
|
92
|
+
},
|
93
|
+
charCountLessThanMaxLengthEvent: function(currentLength, maxLength) {
|
94
|
+
dispatchEvent('charCountLessThanMaxLengthEvent', currentLength, maxLength);
|
34
95
|
}
|
35
96
|
};
|
36
97
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
98
|
+
// Get Config & Lang
|
99
|
+
var config = CKEDITOR.tools.extend(defaultConfig, editor.config.wordcount || {}, true);
|
100
|
+
|
101
|
+
if (config.showParagraphs) {
|
102
|
+
if (config.maxParagraphs > -1) {
|
103
|
+
if (config.showRemaining) {
|
104
|
+
defaultFormat += "%paragraphsCount% " + editor.lang.wordcount.ParagraphsRemaining;
|
105
|
+
} else {
|
106
|
+
defaultFormat += editor.lang.wordcount.Paragraphs + " %paragraphsCount%";
|
107
|
+
|
108
|
+
defaultFormat += "/" + config.maxParagraphs;
|
109
|
+
}
|
110
|
+
} else {
|
111
|
+
defaultFormat += editor.lang.wordcount.Paragraphs + " %paragraphsCount%";
|
112
|
+
}
|
47
113
|
}
|
48
114
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
// Default Config
|
53
|
-
var defaultConfig = {
|
54
|
-
showParagraphs: true,
|
55
|
-
showWordCount: true,
|
56
|
-
showCharCount: false,
|
57
|
-
countSpacesAsChars: false,
|
58
|
-
countHTML: false,
|
59
|
-
hardLimit: true,
|
60
|
-
|
61
|
-
//MAXLENGTH Properties
|
62
|
-
maxWordCount: -1,
|
63
|
-
maxCharCount: -1,
|
64
|
-
|
65
|
-
// Filter
|
66
|
-
filter: null,
|
67
|
-
|
68
|
-
//DisAllowed functions
|
69
|
-
wordCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
|
70
|
-
dispatchEvent('wordCountGreaterThanMaxLengthEvent', currentLength, maxLength);
|
71
|
-
},
|
72
|
-
charCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
|
73
|
-
dispatchEvent('charCountGreaterThanMaxLengthEvent', currentLength, maxLength);
|
74
|
-
},
|
75
|
-
|
76
|
-
//Allowed Functions
|
77
|
-
wordCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
|
78
|
-
dispatchEvent('wordCountLessThanMaxLengthEvent', currentLength, maxLength);
|
79
|
-
},
|
80
|
-
charCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
|
81
|
-
dispatchEvent('charCountLessThanMaxLengthEvent', currentLength, maxLength);
|
115
|
+
if (config.showParagraphs && (config.showWordCount || config.showCharCount)) {
|
116
|
+
defaultFormat += ", ";
|
82
117
|
}
|
83
|
-
};
|
84
118
|
|
85
|
-
|
86
|
-
|
119
|
+
if (config.showWordCount) {
|
120
|
+
if (config.maxWordCount > -1) {
|
121
|
+
if (config.showRemaining) {
|
122
|
+
defaultFormat += "%wordCount% " + editor.lang.wordcount.WordCountRemaining;
|
123
|
+
} else {
|
124
|
+
defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
|
87
125
|
|
88
|
-
|
89
|
-
|
90
|
-
|
126
|
+
defaultFormat += "/" + config.maxWordCount;
|
127
|
+
}
|
128
|
+
} else {
|
129
|
+
defaultFormat += editor.lang.wordcount.WordCount + " %wordCount%";
|
130
|
+
}
|
131
|
+
}
|
91
132
|
|
92
|
-
|
93
|
-
|
94
|
-
|
133
|
+
if (config.showCharCount && config.showWordCount) {
|
134
|
+
defaultFormat += ", ";
|
135
|
+
}
|
95
136
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
137
|
+
if (config.showCharCount) {
|
138
|
+
if (config.maxCharCount > -1) {
|
139
|
+
if (config.showRemaining) {
|
140
|
+
defaultFormat += "%charCount% " +
|
141
|
+
editor.lang.wordcount[config.countHTML
|
142
|
+
? "CharCountWithHTMLRemaining"
|
143
|
+
: "CharCountRemaining"];
|
144
|
+
} else {
|
145
|
+
defaultFormat += editor.lang.wordcount[config.countHTML
|
146
|
+
? "CharCountWithHTML"
|
147
|
+
: "CharCount"] +
|
148
|
+
" %charCount%";
|
149
|
+
|
150
|
+
defaultFormat += "/" + config.maxCharCount;
|
151
|
+
}
|
152
|
+
} else {
|
153
|
+
defaultFormat += editor.lang.wordcount[config.countHTML ? "CharCountWithHTML" : "CharCount"] +
|
154
|
+
" %charCount%";
|
155
|
+
}
|
100
156
|
}
|
101
|
-
}
|
102
157
|
|
103
|
-
|
104
|
-
defaultFormat += ", ";
|
105
|
-
}
|
158
|
+
var format = defaultFormat;
|
106
159
|
|
107
|
-
|
108
|
-
var charLabel = editor.lang.wordcount[config.countHTML ? "CharCountWithHTML" : "CharCount"];
|
160
|
+
bbcodePluginLoaded = typeof editor.plugins.bbcode != 'undefined';
|
109
161
|
|
110
|
-
|
111
|
-
|
112
|
-
defaultFormat += "/" + config.maxCharCount;
|
162
|
+
function counterId(editorInstance) {
|
163
|
+
return "cke_wordcount_" + editorInstance.name;
|
113
164
|
}
|
114
|
-
}
|
115
|
-
|
116
|
-
var format = defaultFormat;
|
117
165
|
|
118
|
-
|
119
|
-
|
120
|
-
|
166
|
+
function counterElement(editorInstance) {
|
167
|
+
return document.getElementById(counterId(editorInstance));
|
168
|
+
}
|
121
169
|
|
122
|
-
|
123
|
-
|
124
|
-
|
170
|
+
function strip(html) {
|
171
|
+
if (bbcodePluginLoaded) {
|
172
|
+
// stripping out BBCode tags [...][/...]
|
173
|
+
return html.replace(/\[.*?\]/gi, '');
|
174
|
+
}
|
125
175
|
|
126
|
-
|
127
|
-
return document.getElementById(counterId(editorInstance));
|
128
|
-
}
|
176
|
+
var tmp = document.createElement("div");
|
129
177
|
|
130
|
-
|
131
|
-
|
178
|
+
// Add filter before strip
|
179
|
+
html = filter(html);
|
132
180
|
|
133
|
-
|
134
|
-
html = filter(html);
|
181
|
+
tmp.innerHTML = html;
|
135
182
|
|
136
|
-
|
183
|
+
if (tmp.textContent == "" && typeof tmp.innerText == "undefined") {
|
184
|
+
return "";
|
185
|
+
}
|
137
186
|
|
138
|
-
|
139
|
-
return "";
|
187
|
+
return tmp.textContent || tmp.innerText;
|
140
188
|
}
|
141
189
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
writer
|
154
|
-
|
155
|
-
|
156
|
-
return writer.getHtml();
|
190
|
+
/**
|
191
|
+
* Implement filter to add or remove before counting
|
192
|
+
* @param html
|
193
|
+
* @returns string
|
194
|
+
*/
|
195
|
+
function filter(html) {
|
196
|
+
if (config.filter instanceof CKEDITOR.htmlParser.filter) {
|
197
|
+
var fragment = CKEDITOR.htmlParser.fragment.fromHtml(html),
|
198
|
+
writer = new CKEDITOR.htmlParser.basicWriter();
|
199
|
+
config.filter.applyTo(fragment);
|
200
|
+
fragment.writeHtml(writer);
|
201
|
+
return writer.getHtml();
|
202
|
+
}
|
203
|
+
return html;
|
157
204
|
}
|
158
|
-
return html;
|
159
|
-
}
|
160
205
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
206
|
+
function countCharacters(text) {
|
207
|
+
if (config.countHTML) {
|
208
|
+
return (filter(text).length);
|
209
|
+
}
|
210
|
+
|
165
211
|
var normalizedText;
|
166
212
|
|
167
213
|
// strip body tags
|
@@ -177,231 +223,368 @@ CKEDITOR.plugins.add("wordcount", {
|
|
177
223
|
normalizedText = text;
|
178
224
|
|
179
225
|
if (!config.countSpacesAsChars) {
|
180
|
-
normalizedText = text.
|
181
|
-
replace(/\s/g, "").
|
182
|
-
replace(/ /g, "");
|
226
|
+
normalizedText = text.replace(/\s/g, "").replace(/ /g, "");
|
183
227
|
}
|
184
228
|
|
185
|
-
|
186
|
-
replace(/(\r\n|\n|\r)/gm, "")
|
187
|
-
|
229
|
+
if (config.countLineBreaks) {
|
230
|
+
normalizedText = normalizedText.replace(/(\r\n|\n|\r)/gm, " ");
|
231
|
+
} else {
|
232
|
+
normalizedText = normalizedText.replace(/(\r\n|\n|\r)/gm, "").replace(/ /gi, " ");
|
233
|
+
}
|
188
234
|
|
189
235
|
normalizedText = strip(normalizedText).replace(/^([\t\r\n]*)$/, "");
|
190
236
|
|
191
|
-
return(normalizedText.length);
|
237
|
+
return config.countBytesAsChars ? (countBytes(normalizedText)) : (normalizedText.length);
|
192
238
|
}
|
193
|
-
}
|
194
239
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
replace(/(\r\n|\n|\r)/gm, " ").
|
202
|
-
replace(/^\s+|\s+$/g, "").
|
203
|
-
replace(" ", " ");
|
204
|
-
|
205
|
-
normalizedText = strip(normalizedText);
|
206
|
-
|
207
|
-
var words = normalizedText.split(/\s+/);
|
208
|
-
|
209
|
-
for (var wordIndex = words.length - 1; wordIndex >= 0; wordIndex--) {
|
210
|
-
if (words[wordIndex].match(/^([\s\t\r\n]*)$/)) {
|
211
|
-
words.splice(wordIndex, 1);
|
240
|
+
function countBytes(text) {
|
241
|
+
var count = 0, stringLength = text.length, i;
|
242
|
+
text = String(text || "");
|
243
|
+
for (i = 0; i < stringLength; i++) {
|
244
|
+
var partCount = encodeURI(text[i]).split("%").length;
|
245
|
+
count += partCount == 1 ? 1 : partCount - 1;
|
212
246
|
}
|
247
|
+
return count;
|
213
248
|
}
|
214
249
|
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
function limitReached(editorInstance, notify) {
|
219
|
-
limitReachedNotified = true;
|
220
|
-
limitRestoredNotified = false;
|
221
|
-
|
222
|
-
if (config.hardLimit) {
|
223
|
-
editorInstance.loadSnapshot(snapShot);
|
224
|
-
// lock editor
|
225
|
-
editorInstance.config.Locked = 1;
|
226
|
-
}
|
227
|
-
|
228
|
-
if (!notify) {
|
229
|
-
counterElement(editorInstance).className = "cke_path_item cke_wordcountLimitReached";
|
230
|
-
editorInstance.fire("limitReached", {}, editor);
|
250
|
+
function countParagraphs(text) {
|
251
|
+
return (text.replace(/ /g, " ").replace(/(<([^>]+)>)/ig, "").replace(/^\s*$[\n\r]{1,}/gm, "++")
|
252
|
+
.split("++").length);
|
231
253
|
}
|
232
|
-
}
|
233
|
-
|
234
|
-
function limitRestored(editorInstance) {
|
235
|
-
limitRestoredNotified = true;
|
236
|
-
limitReachedNotified = false;
|
237
|
-
editorInstance.config.Locked = 0;
|
238
|
-
snapShot = editor.getSnapshot();
|
239
254
|
|
240
|
-
|
241
|
-
|
255
|
+
function countWords(text) {
|
256
|
+
var normalizedText = text.replace(/(\r\n|\n|\r)/gm, " ").replace(/^\s+|\s+$/g, "")
|
257
|
+
.replace(" ", " ");
|
242
258
|
|
243
|
-
|
244
|
-
var paragraphs = 0,
|
245
|
-
wordCount = 0,
|
246
|
-
charCount = 0,
|
247
|
-
text;
|
259
|
+
normalizedText = strip(normalizedText);
|
248
260
|
|
249
|
-
|
250
|
-
if (config.showCharCount) {
|
251
|
-
charCount = countCharacters(text, editorInstance);
|
252
|
-
}
|
261
|
+
var words = normalizedText.split(/\s+/);
|
253
262
|
|
254
|
-
|
255
|
-
|
263
|
+
for (var wordIndex = words.length - 1; wordIndex >= 0; wordIndex--) {
|
264
|
+
if (words[wordIndex].match(/^([\s\t\r\n]*)$/)) {
|
265
|
+
words.splice(wordIndex, 1);
|
266
|
+
}
|
256
267
|
}
|
257
268
|
|
258
|
-
|
259
|
-
wordCount = countWords(text);
|
260
|
-
}
|
269
|
+
return (words.length);
|
261
270
|
}
|
262
271
|
|
263
|
-
|
272
|
+
function limitReached(editorInstance, notify) {
|
273
|
+
limitReachedNotified = true;
|
274
|
+
limitRestoredNotified = false;
|
264
275
|
|
265
|
-
|
266
|
-
|
276
|
+
if (config.hardLimit) {
|
277
|
+
editorInstance.execCommand('undo');
|
278
|
+
}
|
267
279
|
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
280
|
+
if (!notify) {
|
281
|
+
counterElement(editorInstance).className = "cke_path_item cke_wordcountLimitReached";
|
282
|
+
editorInstance.fire("limitReached", { firedBy: "wordCount.limitReached" }, editor);
|
283
|
+
}
|
272
284
|
}
|
273
285
|
|
274
|
-
|
275
|
-
|
286
|
+
function limitRestored(editorInstance) {
|
287
|
+
limitRestoredNotified = true;
|
288
|
+
limitReachedNotified = false;
|
289
|
+
editorInstance.fire('saveSnapshot');
|
290
|
+
|
291
|
+
counterElement(editorInstance).className = "cke_path_item";
|
276
292
|
}
|
277
293
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
294
|
+
function updateCounter(editorInstance) {
|
295
|
+
if (!counterElement(editorInstance)) {
|
296
|
+
return;
|
297
|
+
}
|
282
298
|
|
283
|
-
|
284
|
-
|
299
|
+
var paragraphs = 0,
|
300
|
+
wordCount = 0,
|
301
|
+
charCount = 0,
|
302
|
+
text;
|
303
|
+
|
304
|
+
// BeforeGetData and getData events are fired when calling
|
305
|
+
// getData(). We can prevent this by passing true as an
|
306
|
+
// argument to getData(). This allows us to fire the events
|
307
|
+
// manually with additional event data: firedBy. This additional
|
308
|
+
// data helps differentiate calls to getData() made by
|
309
|
+
// wordCount plugin from calls made by other plugins/code.
|
310
|
+
editorInstance.fire("beforeGetData", { firedBy: "wordCount.updateCounter" }, editor);
|
311
|
+
text = editorInstance.getData(true);
|
312
|
+
editorInstance.fire("getData", { dataValue: text, firedBy: "wordCount.updateCounter" }, editor);
|
313
|
+
|
314
|
+
if (text) {
|
315
|
+
if (config.showCharCount) {
|
316
|
+
charCount = countCharacters(text);
|
317
|
+
}
|
285
318
|
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
if (lastCharCount == -1) {
|
290
|
-
lastCharCount = charCount;
|
291
|
-
}
|
319
|
+
if (config.showParagraphs) {
|
320
|
+
paragraphs = countParagraphs(text);
|
321
|
+
}
|
292
322
|
|
293
|
-
|
294
|
-
|
295
|
-
|
323
|
+
if (config.showWordCount) {
|
324
|
+
wordCount = countWords(text);
|
325
|
+
}
|
326
|
+
}
|
296
327
|
|
297
|
-
|
298
|
-
|
299
|
-
|
328
|
+
var html = format;
|
329
|
+
if (config.showRemaining) {
|
330
|
+
if (config.maxCharCount >= 0) {
|
331
|
+
html = html.replace("%charCount%", config.maxCharCount - charCount);
|
332
|
+
} else {
|
333
|
+
html = html.replace("%charCount%", charCount);
|
334
|
+
}
|
300
335
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
336
|
+
if (config.maxWordCount >= 0) {
|
337
|
+
html = html.replace("%wordCount%", config.maxWordCount - wordCount);
|
338
|
+
} else {
|
339
|
+
html = html.replace("%wordCount%", wordCount);
|
340
|
+
}
|
305
341
|
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
342
|
+
if (config.maxParagraphs >= 0) {
|
343
|
+
html = html.replace("%paragraphsCount%", config.maxParagraphs - paragraphs);
|
344
|
+
} else {
|
345
|
+
html = html.replace("%paragraphsCount%", paragraphs);
|
346
|
+
}
|
310
347
|
} else {
|
311
|
-
|
348
|
+
html = html.replace("%wordCount%", wordCount).replace("%charCount%", charCount).replace("%paragraphsCount%", paragraphs);
|
312
349
|
}
|
313
|
-
}
|
314
350
|
|
315
|
-
|
316
|
-
|
317
|
-
config.wordCountGreaterThanMaxLengthEvent(wordCount, config.maxWordCount);
|
351
|
+
(editorInstance.config.wordcount || (editorInstance.config.wordcount = {})).wordCount = wordCount;
|
352
|
+
(editorInstance.config.wordcount || (editorInstance.config.wordcount = {})).charCount = charCount;
|
318
353
|
|
354
|
+
if (CKEDITOR.env.gecko) {
|
355
|
+
counterElement(editorInstance).innerHTML = html;
|
319
356
|
} else {
|
320
|
-
|
357
|
+
counterElement(editorInstance).innerText = html;
|
321
358
|
}
|
322
|
-
}
|
323
359
|
|
324
|
-
|
325
|
-
|
360
|
+
if (charCount == lastCharCount && wordCount == lastWordCount && paragraphs == lastParagraphs) {
|
361
|
+
if (charCount == config.maxCharCount || wordCount == config.maxWordCount || paragraphs > config.maxParagraphs) {
|
362
|
+
editorInstance.fire('saveSnapshot');
|
363
|
+
}
|
364
|
+
return true;
|
365
|
+
}
|
326
366
|
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
if (event.data.space == "top") {
|
340
|
-
event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
|
341
|
-
" title=\"" +
|
342
|
-
editor.lang.wordcount.title +
|
343
|
-
"\"" +
|
344
|
-
"><span id=\"" +
|
345
|
-
counterId(event.editor) +
|
346
|
-
"\" class=\"cke_path_item\"> </span></div>";
|
367
|
+
//If the limit is already over, allow the deletion of characters/words. Otherwise,
|
368
|
+
//the user would have to delete at one go the number of offending characters
|
369
|
+
var deltaWord = wordCount - lastWordCount;
|
370
|
+
var deltaChar = charCount - lastCharCount;
|
371
|
+
var deltaParagraphs = paragraphs - lastParagraphs;
|
372
|
+
|
373
|
+
lastWordCount = wordCount;
|
374
|
+
lastCharCount = charCount;
|
375
|
+
lastParagraphs = paragraphs;
|
376
|
+
|
377
|
+
if (lastWordCount == -1) {
|
378
|
+
lastWordCount = wordCount;
|
347
379
|
}
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
"\"" +
|
354
|
-
"><span id=\"" +
|
355
|
-
counterId(event.editor) +
|
356
|
-
"\" class=\"cke_path_item\"> </span></div>";
|
380
|
+
if (lastCharCount == -1) {
|
381
|
+
lastCharCount = charCount;
|
382
|
+
}
|
383
|
+
if (lastParagraphs == -1) {
|
384
|
+
lastParagraphs = paragraphs;
|
357
385
|
}
|
358
|
-
}
|
359
386
|
|
360
|
-
|
387
|
+
// Check for word limit and/or char limit
|
388
|
+
if ((config.maxWordCount > -1 && wordCount > config.maxWordCount && deltaWord > 0) ||
|
389
|
+
(config.maxCharCount > -1 && charCount > config.maxCharCount && deltaChar > 0) ||
|
390
|
+
(config.maxParagraphs > -1 && paragraphs > config.maxParagraphs && deltaParagraphs > 0)) {
|
361
391
|
|
362
|
-
|
363
|
-
|
364
|
-
|
392
|
+
limitReached(editorInstance, limitReachedNotified);
|
393
|
+
} else if ((config.maxWordCount == -1 || wordCount <= config.maxWordCount) &&
|
394
|
+
(config.maxCharCount == -1 || charCount <= config.maxCharCount) &&
|
395
|
+
(config.maxParagraphs == -1 || paragraphs <= config.maxParagraphs)) {
|
365
396
|
|
366
|
-
|
367
|
-
|
397
|
+
limitRestored(editorInstance);
|
398
|
+
} else {
|
399
|
+
editorInstance.fire('saveSnapshot');
|
400
|
+
}
|
368
401
|
|
369
|
-
//
|
370
|
-
|
371
|
-
|
372
|
-
|
402
|
+
// update instance
|
403
|
+
editorInstance.wordCount =
|
404
|
+
{
|
405
|
+
paragraphs: paragraphs,
|
406
|
+
wordCount: wordCount,
|
407
|
+
charCount: charCount
|
408
|
+
};
|
409
|
+
|
410
|
+
|
411
|
+
// Fire Custom Events
|
412
|
+
if (config.charCountGreaterThanMaxLengthEvent && config.charCountLessThanMaxLengthEvent) {
|
413
|
+
if (charCount > config.maxCharCount && config.maxCharCount > -1) {
|
414
|
+
config.charCountGreaterThanMaxLengthEvent(charCount, config.maxCharCount);
|
415
|
+
} else {
|
416
|
+
config.charCountLessThanMaxLengthEvent(charCount, config.maxCharCount);
|
417
|
+
}
|
418
|
+
}
|
373
419
|
|
420
|
+
if (config.wordCountGreaterThanMaxLengthEvent && config.wordCountLessThanMaxLengthEvent) {
|
421
|
+
if (wordCount > config.maxWordCount && config.maxWordCount > -1) {
|
422
|
+
config.wordCountGreaterThanMaxLengthEvent(wordCount, config.maxWordCount);
|
374
423
|
|
375
|
-
|
376
|
-
|
424
|
+
} else {
|
425
|
+
config.wordCountLessThanMaxLengthEvent(wordCount, config.maxWordCount);
|
426
|
+
}
|
377
427
|
}
|
378
428
|
|
379
|
-
|
380
|
-
|
381
|
-
}
|
429
|
+
return true;
|
430
|
+
}
|
382
431
|
|
383
|
-
|
432
|
+
function isCloseToLimits() {
|
433
|
+
if (config.maxWordCount > -1 && config.maxWordCount - lastWordCount < 5) {
|
434
|
+
return true;
|
435
|
+
}
|
384
436
|
|
385
|
-
if (config.maxCharCount >
|
386
|
-
|
387
|
-
event.cancel();
|
437
|
+
if (config.maxCharCount > -1 && config.maxCharCount - lastCharCount < 20) {
|
438
|
+
return true;
|
388
439
|
}
|
389
440
|
|
390
|
-
if (config.
|
391
|
-
|
392
|
-
event.cancel();
|
441
|
+
if (config.maxParagraphs > -1 && config.maxParagraphs - lastParagraphs < 1) {
|
442
|
+
return true;
|
393
443
|
}
|
444
|
+
|
445
|
+
return false;
|
394
446
|
}
|
395
|
-
}, editor, null, 100);
|
396
447
|
|
397
|
-
|
398
|
-
|
399
|
-
|
448
|
+
editor.on("key",
|
449
|
+
function(event) {
|
450
|
+
if (editor.mode === "source") {
|
451
|
+
clearTimeout(timeoutId);
|
452
|
+
timeoutId = setTimeout(
|
453
|
+
updateCounter.bind(this, event.editor),
|
454
|
+
250
|
455
|
+
);
|
456
|
+
}
|
457
|
+
},
|
458
|
+
editor,
|
459
|
+
null,
|
460
|
+
100);
|
461
|
+
|
462
|
+
editor.on("change",
|
463
|
+
function(event) {
|
464
|
+
var ms = isCloseToLimits() ? 5 : 250;
|
465
|
+
clearTimeout(timeoutId);
|
466
|
+
timeoutId = setTimeout(
|
467
|
+
updateCounter.bind(this, event.editor),
|
468
|
+
ms
|
469
|
+
);
|
470
|
+
},
|
471
|
+
editor,
|
472
|
+
null,
|
473
|
+
100);
|
474
|
+
|
475
|
+
editor.on("uiSpace",
|
476
|
+
function(event) {
|
477
|
+
if (editor.elementMode === CKEDITOR.ELEMENT_MODE_INLINE) {
|
478
|
+
if (event.data.space == "top") {
|
479
|
+
event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
|
480
|
+
" title=\"" +
|
481
|
+
editor.lang.wordcount.title +
|
482
|
+
"\"" +
|
483
|
+
"><span id=\"" +
|
484
|
+
counterId(event.editor) +
|
485
|
+
"\" class=\"cke_path_item\"> </span></div>";
|
486
|
+
}
|
487
|
+
} else {
|
488
|
+
if (event.data.space == "bottom") {
|
489
|
+
event.data.html += "<div class=\"cke_wordcount\" style=\"\"" +
|
490
|
+
" title=\"" +
|
491
|
+
editor.lang.wordcount.title +
|
492
|
+
"\"" +
|
493
|
+
"><span id=\"" +
|
494
|
+
counterId(event.editor) +
|
495
|
+
"\" class=\"cke_path_item\"> </span></div>";
|
496
|
+
}
|
497
|
+
}
|
400
498
|
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
499
|
+
},
|
500
|
+
editor,
|
501
|
+
null,
|
502
|
+
100);
|
503
|
+
|
504
|
+
editor.on("dataReady",
|
505
|
+
function(event) {
|
506
|
+
updateCounter(event.editor);
|
507
|
+
},
|
508
|
+
editor,
|
509
|
+
null,
|
510
|
+
100);
|
511
|
+
|
512
|
+
editor.on("paste",
|
513
|
+
function(event) {
|
514
|
+
if (config.maxWordCount > 0 || config.maxCharCount > 0 || config.maxParagraphs > 0) {
|
515
|
+
|
516
|
+
// Check if pasted content is above the limits
|
517
|
+
var wordCount = -1,
|
518
|
+
charCount = -1,
|
519
|
+
paragraphs = -1;
|
520
|
+
|
521
|
+
// BeforeGetData and getData events are fired when calling
|
522
|
+
// getData(). We can prevent this by passing true as an
|
523
|
+
// argument to getData(). This allows us to fire the events
|
524
|
+
// manually with additional event data: firedBy. This additional
|
525
|
+
// data helps differentiate calls to getData() made by
|
526
|
+
// wordCount plugin from calls made by other plugins/code.
|
527
|
+
event.editor.fire("beforeGetData", { firedBy: "wordCount.onPaste" }, event.editor);
|
528
|
+
var text = event.editor.getData(true);
|
529
|
+
event.editor.fire("getData", { dataValue: text, firedBy: "wordCount.onPaste" }, event.editor);
|
530
|
+
|
531
|
+
text += event.data.dataValue;
|
532
|
+
|
533
|
+
if (config.showCharCount) {
|
534
|
+
charCount = countCharacters(text);
|
535
|
+
}
|
536
|
+
|
537
|
+
if (config.showWordCount) {
|
538
|
+
wordCount = countWords(text);
|
539
|
+
}
|
540
|
+
|
541
|
+
if (config.showParagraphs) {
|
542
|
+
paragraphs = countParagraphs(text);
|
543
|
+
}
|
544
|
+
|
545
|
+
|
546
|
+
// Instantiate the notification when needed and only have one instance
|
547
|
+
if (notification === null) {
|
548
|
+
notification = new CKEDITOR.plugins.notification(event.editor,
|
549
|
+
{
|
550
|
+
message: event.editor.lang.wordcount.pasteWarning,
|
551
|
+
type: 'warning',
|
552
|
+
duration: config.pasteWarningDuration
|
553
|
+
});
|
554
|
+
}
|
555
|
+
|
556
|
+
if (config.maxCharCount > 0 && charCount > config.maxCharCount && config.hardLimit) {
|
557
|
+
if (!notification.isVisible()) {
|
558
|
+
notification.show();
|
559
|
+
}
|
560
|
+
event.cancel();
|
561
|
+
}
|
562
|
+
|
563
|
+
if (config.maxWordCount > 0 && wordCount > config.maxWordCount && config.hardLimit) {
|
564
|
+
if (!notification.isVisible()) {
|
565
|
+
notification.show();
|
566
|
+
}
|
567
|
+
event.cancel();
|
568
|
+
}
|
569
|
+
|
570
|
+
if (config.maxParagraphs > 0 && paragraphs > config.maxParagraphs && config.hardLimit) {
|
571
|
+
if (!notification.isVisible()) {
|
572
|
+
notification.show();
|
573
|
+
}
|
574
|
+
event.cancel();
|
575
|
+
}
|
576
|
+
}
|
577
|
+
},
|
578
|
+
editor,
|
579
|
+
null,
|
580
|
+
100);
|
581
|
+
|
582
|
+
editor.on("afterPaste",
|
583
|
+
function(event) {
|
584
|
+
updateCounter(event.editor);
|
585
|
+
},
|
586
|
+
editor,
|
587
|
+
null,
|
588
|
+
100);
|
589
|
+
}
|
590
|
+
});
|