activeadmin_trumbowyg 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +7 -2
- data/app/assets/fonts/trumbowyg/icons.svg +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/ar.js +67 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/bg.js +54 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/by.js +61 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/ca.js +57 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/cs.js +54 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/da.js +64 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/da.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/de.js +57 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/de.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/el.js +59 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/es.js +63 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/es_ar.js +56 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/fa.js +58 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/fa.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/fi.js +58 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/fr.js +66 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/fr.min.js +3 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/he.js +57 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/hr.js +54 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/hu.js +58 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/id.js +57 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/it.js +59 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/ja.js +63 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/ko.js +63 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/ko.min.js +3 -4
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/lt.js +59 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/lt.min.js +8 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/mn.js +49 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/my.js +54 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/nl.js +61 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/nl.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/no_nb.js +56 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/ph.js +54 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/pl.js +55 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/pt.js +65 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/pt_br.js +65 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/pt_br.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/ro.js +58 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/rs.js +53 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/rs_latin.js +54 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/ru.js +61 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/ru.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/sk.js +54 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/sl.js +48 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/sl.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/sq.js +65 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/sq.min.js +8 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/sv.js +58 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/th.js +55 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/th.min.js +9 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/tr.js +55 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/ua.js +54 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/vi.js +56 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/vi.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/zh_cn.js +57 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/zh_tw.js +66 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/langs/zh_tw.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.js +162 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/allowtagsfrompaste/trumbowyg.allowtagsfrompaste.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.js +34 -2
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js +29 -97
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.js +109 -35
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss +30 -11
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.css +27 -15
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css +2 -2
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.js +1265 -877
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss +1 -4
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css +2 -5
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css +2 -2
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.js +95 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontfamily/trumbowyg.fontfamily.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontsize/trumbowyg.fontsize.js +257 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/fontsize/trumbowyg.fontsize.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/trumbowyg.giphy.js +182 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/trumbowyg.giphy.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/ui/sass/trumbowyg.giphy.scss +111 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/ui/trumbowyg.giphy.css +90 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/giphy/ui/trumbowyg.giphy.min.css +2 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/trumbowyg.highlight.js +90 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/trumbowyg.highlight.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/sass/trumbowyg.highlight.scss +25 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.css +20 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css +2 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/history/trumbowyg.history.js +216 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/history/trumbowyg.history.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +19 -2
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/lineheight/trumbowyg.lineheight.js +162 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/lineheight/trumbowyg.lineheight.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/trumbowyg.mathml.js +117 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/trumbowyg.mathml.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/sass/trumbowyg.mathml.scss +36 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.css +29 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mathml/ui/trumbowyg.mathml.min.css +2 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/trumbowyg.mention.js +116 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/trumbowyg.mention.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/sass/trumbowyg.mention.scss +29 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/trumbowyg.mention.css +24 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/mention/ui/trumbowyg.mention.min.css +2 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.js +21 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.js +96 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteembed/trumbowyg.pasteembed.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js +10 -2
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js +22 -3
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/resizable-resolveconflict.js +20 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/resizable-resolveconflict.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/trumbowyg.resizimg.js +303 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/resizimg/trumbowyg.resizimg.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/ruby/trumbowyg.ruby.js +94 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/ruby/trumbowyg.ruby.min.js +1 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/trumbowyg.specialchars.js +79 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/trumbowyg.specialchars.min.js +1 -0
- data/app/assets/{stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/sass/trumbowyg.emoji.scss → javascripts/activeadmin/trumbowyg/plugins/specialchars/ui/sass/trumbowyg.specialchars.scss} +11 -11
- data/app/assets/{stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.css → javascripts/activeadmin/trumbowyg/plugins/specialchars/ui/trumbowyg.specialchars.css} +12 -12
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/specialchars/ui/trumbowyg.specialchars.min.css +2 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.js +346 -81
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/trumbowyg.table.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/sass/trumbowyg.table.scss +46 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/trumbowyg.table.css +36 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/table/ui/trumbowyg.table.min.css +2 -0
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.js +32 -9
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/template/trumbowyg.template.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js +58 -23
- data/app/assets/javascripts/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.min.js +1 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.js +427 -188
- data/app/assets/javascripts/activeadmin/trumbowyg/trumbowyg.min.js +2 -2
- data/app/assets/javascripts/activeadmin/trumbowyg_input.js +17 -4
- data/app/assets/stylesheets/activeadmin/_trumbowyg_input.sass +11 -3
- data/app/assets/stylesheets/activeadmin/trumbowyg/{ui/sass/trumbowyg.scss → trumbowyg.scss} +44 -16
- data/lib/activeadmin/trumbowyg/version.rb +1 -1
- data/lib/tasks/trumbowyg.rake +21 -0
- metadata +230 -91
- data/.gitignore +0 -3
- data/Gemfile +0 -4
- data/activeadmin_trumbowyg.gemspec +0 -19
- data/app/assets/fonts/ui/icons.svg +0 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/ui/icons.svg +0 -1
- data/app/assets/javascripts/activeadmin/trumbowyg/ui/sass/trumbowyg.scss +0 -796
- data/app/assets/javascripts/activeadmin/trumbowyg/ui/trumbowyg.css +0 -584
- data/app/assets/javascripts/activeadmin/trumbowyg/ui/trumbowyg.min.css +0 -2
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ar.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/bg.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/by.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ca.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/cs.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/da.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/de.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/el.min.js +0 -12
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/es.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/es_ar.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fa.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fi.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/fr.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/he.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/hr.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/hu.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/id.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/it.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ja.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ko.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/mn.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/my.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/nl.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/no_nb.min.js +0 -10
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ph.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pl.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pt.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/pt_br.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ro.min.js +0 -12
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/rs.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/rs_latin.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ru.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/sk.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/sv.min.js +0 -12
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/tr.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/ua.min.js +0 -8
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/vi.min.js +0 -9
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/zh_cn.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/langs/zh_tw.min.js +0 -11
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.js +0 -121
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/base64/trumbowyg.base64.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js +0 -179
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.js +0 -176
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/trumbowyg.colors.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/sass/trumbowyg.colors.scss +0 -49
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.css +0 -43
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/colors/ui/trumbowyg.colors.min.css +0 -2
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.js +0 -965
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/trumbowyg.emoji.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/emoji/ui/trumbowyg.emoji.min.css +0 -2
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.js +0 -83
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/insertaudio/trumbowyg.insertaudio.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.js +0 -101
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/noembed/trumbowyg.noembed.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.js +0 -41
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/pasteimage/trumbowyg.pasteimage.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.js +0 -123
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/preformatted/trumbowyg.preformatted.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/table/trumbowyg.table.js +0 -154
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/table/trumbowyg.table.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/template/trumbowyg.template.js +0 -58
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/template/trumbowyg.template.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.js +0 -242
- data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/upload/trumbowyg.upload.min.js +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/trumbowyg.js +0 -1688
- data/app/assets/stylesheets/activeadmin/trumbowyg/trumbowyg.min.js +0 -2
- data/app/assets/stylesheets/activeadmin/trumbowyg/ui/icons.svg +0 -1
- data/app/assets/stylesheets/activeadmin/trumbowyg/ui/trumbowyg.css +0 -584
- data/app/assets/stylesheets/activeadmin/trumbowyg/ui/trumbowyg.min.css +0 -2
- data/screenshot.jpg +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
!function(e){"use strict";var a={allowedTags:[],removableTags:["a","abbr","address","b","bdi","bdo","blockquote","br","cite","code","del","dfn","details","em","h1","h2","h3","h4","h5","h6","hr","i","ins","kbd","mark","meter","pre","progress","q","rp","rt","ruby","s","samp","small","span","strong","sub","summary","sup","time","u","var","wbr","img","map","area","canvas","figcaption","figure","picture","audio","source","track","video","ul","ol","li","dl","dt","dd","table","caption","th","tr","td","thead","tbody","tfoot","col","colgroup","style","div","p","form","input","textarea","button","select","optgroup","option","label","fieldset","legend","datalist","keygen","output","iframe","link","nav","header","hgroup","footer","main","section","article","aside","dialog","script","noscript","embed","object","param"]};e.extend(!0,e.trumbowyg,{plugins:{allowTagsFromPaste:{init:function(t){if(t.o.removeformatPasted=!1,t.o.plugins.allowTagsFromPaste){var o=t.o.plugins.allowTagsFromPaste.allowedTags||a.allowedTags,r=t.o.plugins.allowTagsFromPaste.removableTags||a.removableTags;if(0!==o.length){var s=e(r).not(o).get();t.pasteHandlers.push(function(){setTimeout(function(){var a=t.$ed.html();e.each(s,function(e,t){a=a.replace(new RegExp("<\\/?"+t+"(\\s[^>]*)?>","gi"),"")}),t.$ed.html(a)},0)})}}}}}})}(jQuery);
|
@@ -26,6 +26,12 @@
|
|
26
26
|
errFileReaderNotSupported: 'FileReader is not supported by your browser.',
|
27
27
|
errInvalidImage: 'Invalid image file.'
|
28
28
|
},
|
29
|
+
da: {
|
30
|
+
base64: 'Billede som base64',
|
31
|
+
file: 'Fil',
|
32
|
+
errFileReaderNotSupported: 'FileReader er ikke understøttet af din browser.',
|
33
|
+
errInvalidImage: 'Ugyldig billedfil.'
|
34
|
+
},
|
29
35
|
fr: {
|
30
36
|
base64: 'Image en base64',
|
31
37
|
file: 'Fichier'
|
@@ -39,6 +45,8 @@
|
|
39
45
|
file: '文件'
|
40
46
|
},
|
41
47
|
nl: {
|
48
|
+
base64: 'Afbeelding inline',
|
49
|
+
file: 'Bestand',
|
42
50
|
errFileReaderNotSupported: 'Uw browser ondersteunt deze functionaliteit niet.',
|
43
51
|
errInvalidImage: 'De gekozen afbeelding is ongeldig.'
|
44
52
|
},
|
@@ -53,7 +61,31 @@
|
|
53
61
|
file: 'ファイル',
|
54
62
|
errFileReaderNotSupported: 'あなたのブラウザーはFileReaderをサポートしていません',
|
55
63
|
errInvalidImage: '画像形式が正しくありません'
|
56
|
-
}
|
64
|
+
},
|
65
|
+
tr: {
|
66
|
+
base64: 'Base64 olarak resim',
|
67
|
+
file: 'Dosya',
|
68
|
+
errFileReaderNotSupported: 'FileReader tarayıcınız tarafından desteklenmiyor.',
|
69
|
+
errInvalidImage: 'Geçersiz resim dosyası.'
|
70
|
+
},
|
71
|
+
zh_tw: {
|
72
|
+
base64: '圖片(base64編碼)',
|
73
|
+
file: '檔案',
|
74
|
+
errFileReaderNotSupported: '你的瀏覽器不支援FileReader',
|
75
|
+
errInvalidImage: '不正確的檔案格式'
|
76
|
+
},
|
77
|
+
pt_br: {
|
78
|
+
base64: 'Imagem em base64',
|
79
|
+
file: 'Arquivo',
|
80
|
+
errFileReaderNotSupported: 'FileReader não é suportado pelo seu navegador.',
|
81
|
+
errInvalidImage: 'Arquivo de imagem inválido.'
|
82
|
+
},
|
83
|
+
ko: {
|
84
|
+
base64: '그림 넣기(base64)',
|
85
|
+
file: '파일',
|
86
|
+
errFileReaderNotSupported: 'FileReader가 현재 브라우저를 지원하지 않습니다.',
|
87
|
+
errInvalidImage: '유효하지 않은 파일'
|
88
|
+
},
|
57
89
|
},
|
58
90
|
// jshint camelcase:true
|
59
91
|
|
@@ -92,7 +124,7 @@
|
|
92
124
|
|
93
125
|
fReader.onloadend = function (e) {
|
94
126
|
if (isValidImage(e.target.result)) {
|
95
|
-
trumbowyg.execCmd('insertImage', fReader.result);
|
127
|
+
trumbowyg.execCmd('insertImage', fReader.result, false, true);
|
96
128
|
$(['img[src="', fReader.result, '"]:not([alt])'].join(''), trumbowyg.$box).attr('alt', values.alt);
|
97
129
|
trumbowyg.closeModal();
|
98
130
|
} else {
|
@@ -1 +1 @@
|
|
1
|
-
!function(e){"use strict";var a=function(){return"undefined"!=typeof FileReader},r=function(e){return/^data:image\/[a-z]?/i.test(e)};e.extend(!0,e.trumbowyg,{langs:{en:{base64:"Image as base64",file:"File",errFileReaderNotSupported:"FileReader is not supported by your browser.",errInvalidImage:"Invalid image file."},fr:{base64:"Image en base64",file:"Fichier"},cs:{base64:"Vložit obrázek",file:"Soubor"},zh_cn:{base64:"图片(Base64编码)",file:"文件"},nl:{errFileReaderNotSupported:"Uw browser ondersteunt deze functionaliteit niet.",errInvalidImage:"De gekozen afbeelding is ongeldig."},ru:{base64:"Изображение как код в base64",file:"Файл",errFileReaderNotSupported:"FileReader не поддерживается вашим браузером.",errInvalidImage:"Недопустимый файл изображения."},ja:{base64:"画像 (Base64形式)",file:"ファイル",errFileReaderNotSupported:"あなたのブラウザーはFileReaderをサポートしていません",errInvalidImage:"画像形式が正しくありません"}},plugins:{base64:{shouldInit:a,init:function(i){var t={isSupported:a,fn:function(){i.saveRange();var a,t=i.openModalInsert(i.lang.base64,{file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:i.getRangeText()}},function(
|
1
|
+
!function(e){"use strict";var a=function(){return"undefined"!=typeof FileReader},r=function(e){return/^data:image\/[a-z]?/i.test(e)};e.extend(!0,e.trumbowyg,{langs:{en:{base64:"Image as base64",file:"File",errFileReaderNotSupported:"FileReader is not supported by your browser.",errInvalidImage:"Invalid image file."},da:{base64:"Billede som base64",file:"Fil",errFileReaderNotSupported:"FileReader er ikke understøttet af din browser.",errInvalidImage:"Ugyldig billedfil."},fr:{base64:"Image en base64",file:"Fichier"},cs:{base64:"Vložit obrázek",file:"Soubor"},zh_cn:{base64:"图片(Base64编码)",file:"文件"},nl:{base64:"Afbeelding inline",file:"Bestand",errFileReaderNotSupported:"Uw browser ondersteunt deze functionaliteit niet.",errInvalidImage:"De gekozen afbeelding is ongeldig."},ru:{base64:"Изображение как код в base64",file:"Файл",errFileReaderNotSupported:"FileReader не поддерживается вашим браузером.",errInvalidImage:"Недопустимый файл изображения."},ja:{base64:"画像 (Base64形式)",file:"ファイル",errFileReaderNotSupported:"あなたのブラウザーはFileReaderをサポートしていません",errInvalidImage:"画像形式が正しくありません"},tr:{base64:"Base64 olarak resim",file:"Dosya",errFileReaderNotSupported:"FileReader tarayıcınız tarafından desteklenmiyor.",errInvalidImage:"Geçersiz resim dosyası."},zh_tw:{base64:"圖片(base64編碼)",file:"檔案",errFileReaderNotSupported:"你的瀏覽器不支援FileReader",errInvalidImage:"不正確的檔案格式"},pt_br:{base64:"Imagem em base64",file:"Arquivo",errFileReaderNotSupported:"FileReader não é suportado pelo seu navegador.",errInvalidImage:"Arquivo de imagem inválido."},ko:{base64:"그림 넣기(base64)",file:"파일",errFileReaderNotSupported:"FileReader가 현재 브라우저를 지원하지 않습니다.",errInvalidImage:"유효하지 않은 파일"}},plugins:{base64:{shouldInit:a,init:function(i){var t={isSupported:a,fn:function(){i.saveRange();var a,t=i.openModalInsert(i.lang.base64,{file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:i.getRangeText()}},function(l){var n=new FileReader;n.onloadend=function(a){r(a.target.result)?(i.execCmd("insertImage",n.result,!1,!0),e(['img[src="',n.result,'"]:not([alt])'].join(""),i.$box).attr("alt",l.alt),i.closeModal()):i.addErrorOnModalField(e("input[type=file]",t),i.lang.errInvalidImage)},n.readAsDataURL(a)});e("input[type=file]").on("change",function(e){a=e.target.files[0]})}};i.addBtnDef("base64",t)}}}})}(jQuery);
|
data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js
CHANGED
@@ -3,24 +3,16 @@
|
|
3
3
|
* Font Clean paste plugin for Trumbowyg
|
4
4
|
* http://alex-d.github.com/Trumbowyg
|
5
5
|
* ===========================================================
|
6
|
-
*
|
7
|
-
|
8
|
-
|
9
|
-
/**
|
6
|
+
* Authors : Eric Radin
|
7
|
+
* Todd Graham (slackwalker)
|
8
|
+
*
|
10
9
|
* This plugin will perform a "cleaning" on any paste, in particular
|
11
10
|
* it will clean pasted content of microsoft word document tags and classes.
|
12
11
|
*/
|
12
|
+
|
13
13
|
(function ($) {
|
14
14
|
'use strict';
|
15
15
|
|
16
|
-
function reverse(sentString) {
|
17
|
-
var theString = '';
|
18
|
-
for (var i = sentString.length - 1; i >= 0; i -= 1) {
|
19
|
-
theString += sentString.charAt(i);
|
20
|
-
}
|
21
|
-
return theString;
|
22
|
-
}
|
23
|
-
|
24
16
|
function checkValidTags(snippet) {
|
25
17
|
var theString = snippet;
|
26
18
|
|
@@ -46,90 +38,36 @@
|
|
46
38
|
return theString;
|
47
39
|
}
|
48
40
|
|
49
|
-
function cleanIt(
|
50
|
-
var matchedHead = '';
|
51
|
-
var matchedTail = '';
|
52
|
-
var afterStart;
|
53
|
-
var afterFinish;
|
54
|
-
var newSnippet;
|
55
|
-
|
56
|
-
// we need to extract the inserted block
|
57
|
-
for (afterStart = 0; htmlAfter.charAt(afterStart) === htmlBefore.charAt(afterStart); afterStart += 1) {
|
58
|
-
matchedHead += htmlAfter.charAt(afterStart);
|
59
|
-
}
|
60
|
-
|
61
|
-
// If afterStart is inside a HTML tag, move to opening brace of tag
|
62
|
-
for (var i = afterStart; i >= 0; i -= 1) {
|
63
|
-
if (htmlBefore.charAt(i) === '<') {
|
64
|
-
afterStart = i;
|
65
|
-
matchedHead = htmlBefore.substring(0, afterStart);
|
66
|
-
break;
|
67
|
-
} else if (htmlBefore.charAt(i) === '>') {
|
68
|
-
break;
|
69
|
-
}
|
70
|
-
}
|
71
|
-
|
72
|
-
// now reverse string and work from the end in
|
73
|
-
htmlAfter = reverse(htmlAfter);
|
74
|
-
htmlBefore = reverse(htmlBefore);
|
75
|
-
|
76
|
-
// Find end of both strings that matches
|
77
|
-
for (afterFinish = 0; htmlAfter.charAt(afterFinish) === htmlBefore.charAt(afterFinish); afterFinish += 1) {
|
78
|
-
matchedTail += htmlAfter.charAt(afterFinish);
|
79
|
-
}
|
80
|
-
|
81
|
-
// If afterFinish is inside a HTML tag, move to closing brace of tag
|
82
|
-
for (var j = afterFinish; j >= 0; j -= 1) {
|
83
|
-
if (htmlBefore.charAt(j) === '>') {
|
84
|
-
afterFinish = j;
|
85
|
-
matchedTail = htmlBefore.substring(0, afterFinish);
|
86
|
-
break;
|
87
|
-
} else if (htmlBefore.charAt(j) === '<') {
|
88
|
-
break;
|
89
|
-
}
|
90
|
-
}
|
91
|
-
|
92
|
-
matchedTail = reverse(matchedTail);
|
93
|
-
|
94
|
-
// If there's no difference in pasted content
|
95
|
-
if (afterStart === (htmlAfter.length - afterFinish)) {
|
96
|
-
return false;
|
97
|
-
}
|
98
|
-
|
99
|
-
htmlAfter = reverse(htmlAfter);
|
100
|
-
newSnippet = htmlAfter.substring(afterStart, htmlAfter.length - afterFinish);
|
101
|
-
|
41
|
+
function cleanIt(html) {
|
102
42
|
// first make sure all tags and attributes are made valid
|
103
|
-
|
43
|
+
html = checkValidTags(html);
|
104
44
|
|
105
45
|
// Replace opening bold tags with strong
|
106
|
-
|
46
|
+
html = html.replace(/<b(\s+|>)/g, '<strong$1');
|
107
47
|
// Replace closing bold tags with closing strong
|
108
|
-
|
48
|
+
html = html.replace(/<\/b(\s+|>)/g, '</strong$1');
|
109
49
|
|
110
50
|
// Replace italic tags with em
|
111
|
-
|
51
|
+
html = html.replace(/<i(\s+|>)/g, '<em$1');
|
112
52
|
// Replace closing italic tags with closing em
|
113
|
-
|
53
|
+
html = html.replace(/<\/i(\s+|>)/g, '</em$1');
|
114
54
|
|
115
55
|
// strip out comments -cgCraft
|
116
|
-
|
56
|
+
html = html.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g, '');
|
117
57
|
|
118
58
|
// strip out -cgCraft
|
119
|
-
|
59
|
+
html = html.replace(/ /gi, ' ');
|
120
60
|
// strip out extra spaces -cgCraft
|
121
|
-
|
61
|
+
html = html.replace(/ <\//gi, '</');
|
122
62
|
|
123
|
-
|
124
|
-
|
125
|
-
newSnippet = anArray.join(' ');
|
126
|
-
}
|
63
|
+
// Remove multiple spaces
|
64
|
+
html.replace(/\s+/g, ' ');
|
127
65
|
|
128
66
|
// strip -cgCraft
|
129
|
-
|
67
|
+
html = html.replace(/^\s*|\s*$/g, '');
|
130
68
|
|
131
69
|
// Strip out unaccepted attributes
|
132
|
-
|
70
|
+
html = html.replace(/<[^>]*>/g, function (match) {
|
133
71
|
match = match.replace(/ ([^=]+)="[^"]*"/g, function (match2, attributeName) {
|
134
72
|
if (['alt', 'href', 'src', 'title'].indexOf(attributeName) !== -1) {
|
135
73
|
return match2;
|
@@ -139,16 +77,15 @@
|
|
139
77
|
return match;
|
140
78
|
});
|
141
79
|
|
142
|
-
// Final
|
143
|
-
|
144
|
-
|
145
|
-
|
80
|
+
// Final clean out for MS Word crud
|
81
|
+
html = html.replace(/<\?xml[^>]*>/g, '');
|
82
|
+
html = html.replace(/<[^ >]+:[^>]*>/g, '');
|
83
|
+
html = html.replace(/<\/[^ >]+:[^>]*>/g, '');
|
146
84
|
|
147
85
|
// remove unwanted tags
|
148
|
-
|
86
|
+
html = html.replace(/<(div|span|style|meta|link).*?>/gi, '');
|
149
87
|
|
150
|
-
|
151
|
-
return htmlAfter;
|
88
|
+
return html;
|
152
89
|
}
|
153
90
|
|
154
91
|
// clean editor
|
@@ -160,20 +97,15 @@
|
|
160
97
|
cleanPaste: {
|
161
98
|
init: function (trumbowyg) {
|
162
99
|
trumbowyg.pasteHandlers.push(function () {
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
}, 0);
|
170
|
-
} catch (c) {
|
171
|
-
}
|
100
|
+
setTimeout(function () {
|
101
|
+
try {
|
102
|
+
trumbowyg.$ed.html(cleanIt(trumbowyg.$ed.html()));
|
103
|
+
} catch (c) {
|
104
|
+
}
|
105
|
+
}, 0);
|
172
106
|
});
|
173
107
|
}
|
174
108
|
}
|
175
109
|
}
|
176
110
|
});
|
177
111
|
})(jQuery);
|
178
|
-
|
179
|
-
|
data/app/assets/javascripts/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(
|
1
|
+
!function(e){"use strict";function r(e){var r=e;return r=r.replace(/<[^> ]*/g,function(e){return e.toLowerCase()}),r=r.replace(/<[^>]*>/g,function(e){return e=e.replace(/ [^=]+=/g,function(e){return e.toLowerCase()})}),r=r.replace(/<[^>]*>/g,function(e){return e=e.replace(/( [^=]+=)([^"][^ >]*)/g,'$1"$2"')})}function n(e){return e=r(e),e=e.replace(/<b(\s+|>)/g,"<strong$1"),e=e.replace(/<\/b(\s+|>)/g,"</strong$1"),e=e.replace(/<i(\s+|>)/g,"<em$1"),e=e.replace(/<\/i(\s+|>)/g,"</em$1"),e=e.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g,""),e=e.replace(/ /gi," "),e=e.replace(/ <\//gi,"</"),e.replace(/\s+/g," "),e=e.replace(/^\s*|\s*$/g,""),e=e.replace(/<[^>]*>/g,function(e){return e=e.replace(/ ([^=]+)="[^"]*"/g,function(e,r){return["alt","href","src","title"].indexOf(r)!==-1?e:""})}),e=e.replace(/<\?xml[^>]*>/g,""),e=e.replace(/<[^ >]+:[^>]*>/g,""),e=e.replace(/<\/[^ >]+:[^>]*>/g,""),e=e.replace(/<(div|span|style|meta|link).*?>/gi,"")}e.extend(!0,e.trumbowyg,{plugins:{cleanPaste:{init:function(e){e.pasteHandlers.push(function(){setTimeout(function(){try{e.$ed.html(n(e.$ed.html()))}catch(r){}},0)})}}}})}(jQuery);
|
@@ -20,11 +20,27 @@
|
|
20
20
|
},
|
21
21
|
en: {
|
22
22
|
foreColor: 'Text color',
|
23
|
-
backColor: 'Background color'
|
23
|
+
backColor: 'Background color',
|
24
|
+
foreColorRemove: 'Remove text color',
|
25
|
+
backColorRemove: 'Remove background color'
|
26
|
+
},
|
27
|
+
da: {
|
28
|
+
foreColor: 'Tekstfarve',
|
29
|
+
backColor: 'Baggrundsfarve'
|
24
30
|
},
|
25
31
|
fr: {
|
26
32
|
foreColor: 'Couleur du texte',
|
27
|
-
backColor: 'Couleur de fond'
|
33
|
+
backColor: 'Couleur de fond',
|
34
|
+
foreColorRemove: 'Supprimer la couleur du texte',
|
35
|
+
backColorRemove: 'Supprimer la couleur de fond'
|
36
|
+
},
|
37
|
+
de: {
|
38
|
+
foreColor: 'Textfarbe',
|
39
|
+
backColor: 'Hintergrundfarbe'
|
40
|
+
},
|
41
|
+
nl: {
|
42
|
+
foreColor: 'Tekstkleur',
|
43
|
+
backColor: 'Achtergrondkleur'
|
28
44
|
},
|
29
45
|
sk: {
|
30
46
|
foreColor: 'Farba textu',
|
@@ -34,6 +50,10 @@
|
|
34
50
|
foreColor: '文字颜色',
|
35
51
|
backColor: '背景颜色'
|
36
52
|
},
|
53
|
+
zh_tw: {
|
54
|
+
foreColor: '文字顏色',
|
55
|
+
backColor: '背景顏色'
|
56
|
+
},
|
37
57
|
ru: {
|
38
58
|
foreColor: 'Цвет текста',
|
39
59
|
backColor: 'Цвет выделения текста'
|
@@ -41,9 +61,24 @@
|
|
41
61
|
ja: {
|
42
62
|
foreColor: '文字色',
|
43
63
|
backColor: '背景色'
|
44
|
-
}
|
64
|
+
},
|
65
|
+
tr: {
|
66
|
+
foreColor: 'Yazı rengi',
|
67
|
+
backColor: 'Arkaplan rengi'
|
68
|
+
},
|
69
|
+
pt_br: {
|
70
|
+
foreColor: 'Cor de fonte',
|
71
|
+
backColor: 'Cor de fundo'
|
72
|
+
},
|
73
|
+
ko: {
|
74
|
+
foreColor: '글자색',
|
75
|
+
backColor: '배경색',
|
76
|
+
foreColorRemove: '글자색 지우기',
|
77
|
+
backColorRemove: '배경색 지우기'
|
78
|
+
},
|
45
79
|
}
|
46
80
|
});
|
81
|
+
|
47
82
|
// jshint camelcase:true
|
48
83
|
|
49
84
|
|
@@ -65,7 +100,7 @@
|
|
65
100
|
function colorTagHandler(element, trumbowyg) {
|
66
101
|
var tags = [];
|
67
102
|
|
68
|
-
if(!element.style){
|
103
|
+
if (!element.style) {
|
69
104
|
return tags;
|
70
105
|
}
|
71
106
|
|
@@ -98,7 +133,19 @@
|
|
98
133
|
}
|
99
134
|
|
100
135
|
var defaultOptions = {
|
101
|
-
colorList: [
|
136
|
+
colorList: [
|
137
|
+
'ffffff', '000000', 'eeece1', '1f497d', '4f81bd', 'c0504d', '9bbb59', '8064a2', '4bacc6', 'f79646', 'ffff00',
|
138
|
+
'f2f2f2', '7f7f7f', 'ddd9c3', 'c6d9f0', 'dbe5f1', 'f2dcdb', 'ebf1dd', 'e5e0ec', 'dbeef3', 'fdeada', 'fff2ca',
|
139
|
+
'd8d8d8', '595959', 'c4bd97', '8db3e2', 'b8cce4', 'e5b9b7', 'd7e3bc', 'ccc1d9', 'b7dde8', 'fbd5b5', 'ffe694',
|
140
|
+
'bfbfbf', '3f3f3f', '938953', '548dd4', '95b3d7', 'd99694', 'c3d69b', 'b2a2c7', 'b7dde8', 'fac08f', 'f2c314',
|
141
|
+
'a5a5a5', '262626', '494429', '17365d', '366092', '953734', '76923c', '5f497a', '92cddc', 'e36c09', 'c09100',
|
142
|
+
'7f7f7f', '0c0c0c', '1d1b10', '0f243e', '244061', '632423', '4f6128', '3f3151', '31859b', '974806', '7f6000'
|
143
|
+
],
|
144
|
+
foreColorList: null, // fallbacks on colorList
|
145
|
+
backColorList: null, // fallbacks on colorList
|
146
|
+
allowCustomForeColor: true,
|
147
|
+
allowCustomBackColor: true,
|
148
|
+
displayAsList: false,
|
102
149
|
};
|
103
150
|
|
104
151
|
// Add all colors in two dropdowns
|
@@ -107,12 +154,16 @@
|
|
107
154
|
color: {
|
108
155
|
init: function (trumbowyg) {
|
109
156
|
trumbowyg.o.plugins.colors = trumbowyg.o.plugins.colors || defaultOptions;
|
157
|
+
var dropdownClass = trumbowyg.o.plugins.colors.displayAsList ? trumbowyg.o.prefix + 'dropdown--color-list' : '';
|
158
|
+
|
110
159
|
var foreColorBtnDef = {
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
160
|
+
dropdown: buildDropdown('foreColor', trumbowyg),
|
161
|
+
dropdownClass: dropdownClass,
|
162
|
+
},
|
163
|
+
backColorBtnDef = {
|
164
|
+
dropdown: buildDropdown('backColor', trumbowyg),
|
165
|
+
dropdownClass: dropdownClass,
|
166
|
+
};
|
116
167
|
|
117
168
|
trumbowyg.addBtnDef('foreColor', foreColorBtnDef);
|
118
169
|
trumbowyg.addBtnDef('backColor', backColorBtnDef);
|
@@ -123,53 +174,76 @@
|
|
123
174
|
});
|
124
175
|
|
125
176
|
function buildDropdown(fn, trumbowyg) {
|
126
|
-
var dropdown = []
|
177
|
+
var dropdown = [],
|
178
|
+
trumbowygColorOptions = trumbowyg.o.plugins.colors,
|
179
|
+
colorList = trumbowygColorOptions[fn + 'List'] || trumbowygColorOptions.colorList;
|
127
180
|
|
128
|
-
$.each(
|
181
|
+
$.each(colorList, function (i, color) {
|
129
182
|
var btn = fn + color,
|
130
183
|
btnDef = {
|
131
184
|
fn: fn,
|
132
185
|
forceCss: true,
|
186
|
+
hasIcon: false,
|
187
|
+
text: trumbowyg.lang['#' + color] || ('#' + color),
|
133
188
|
param: '#' + color,
|
134
189
|
style: 'background-color: #' + color + ';'
|
135
190
|
};
|
191
|
+
|
192
|
+
if (trumbowygColorOptions.displayAsList && fn === 'foreColor') {
|
193
|
+
btnDef.style = 'color: #' + color + ' !important;';
|
194
|
+
}
|
195
|
+
|
136
196
|
trumbowyg.addBtnDef(btn, btnDef);
|
137
197
|
dropdown.push(btn);
|
138
198
|
});
|
139
199
|
|
200
|
+
// Remove color
|
140
201
|
var removeColorButtonName = fn + 'Remove',
|
141
202
|
removeColorBtnDef = {
|
142
203
|
fn: 'removeFormat',
|
204
|
+
hasIcon: false,
|
143
205
|
param: fn,
|
144
206
|
style: 'background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAG0lEQVQIW2NkQAAfEJMRmwBYhoGBYQtMBYoAADziAp0jtJTgAAAAAElFTkSuQmCC);'
|
145
207
|
};
|
208
|
+
|
209
|
+
if (trumbowygColorOptions.displayAsList) {
|
210
|
+
removeColorBtnDef.style = '';
|
211
|
+
}
|
212
|
+
|
146
213
|
trumbowyg.addBtnDef(removeColorButtonName, removeColorBtnDef);
|
147
214
|
dropdown.push(removeColorButtonName);
|
148
215
|
|
149
|
-
//
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
216
|
+
// Custom color
|
217
|
+
if (trumbowygColorOptions['allowCustom' + fn.charAt(0).toUpperCase() + fn.substr(1)]) {
|
218
|
+
// add free color btn
|
219
|
+
var freeColorButtonName = fn + 'Free',
|
220
|
+
freeColorBtnDef = {
|
221
|
+
fn: function () {
|
222
|
+
trumbowyg.openModalInsert(trumbowyg.lang[fn],
|
223
|
+
{
|
224
|
+
color: {
|
225
|
+
label: fn,
|
226
|
+
forceCss: true,
|
227
|
+
type: 'color',
|
228
|
+
value: '#FFFFFF'
|
229
|
+
}
|
230
|
+
},
|
231
|
+
// callback
|
232
|
+
function (values) {
|
233
|
+
trumbowyg.execCmd(fn, values.color);
|
234
|
+
return true;
|
158
235
|
}
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
};
|
171
|
-
trumbowyg.addBtnDef(freeColorButtonName, freeColorBtnDef);
|
172
|
-
dropdown.push(freeColorButtonName);
|
236
|
+
);
|
237
|
+
},
|
238
|
+
hasIcon: false,
|
239
|
+
text: '#',
|
240
|
+
// style adjust for displaying the text
|
241
|
+
style: 'text-indent: 0; line-height: 20px; padding: 0 5px;'
|
242
|
+
};
|
243
|
+
|
244
|
+
trumbowyg.addBtnDef(freeColorButtonName, freeColorBtnDef);
|
245
|
+
dropdown.push(freeColorButtonName);
|
246
|
+
}
|
173
247
|
|
174
248
|
return dropdown;
|
175
249
|
}
|