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
@@ -1,121 +0,0 @@
|
|
1
|
-
/* ===========================================================
|
2
|
-
* trumbowyg.base64.js v1.0
|
3
|
-
* Base64 plugin for Trumbowyg
|
4
|
-
* http://alex-d.github.com/Trumbowyg
|
5
|
-
* ===========================================================
|
6
|
-
* Author : Cyril Biencourt (lizardK)
|
7
|
-
*/
|
8
|
-
|
9
|
-
(function ($) {
|
10
|
-
'use strict';
|
11
|
-
|
12
|
-
var isSupported = function () {
|
13
|
-
return typeof FileReader !== 'undefined';
|
14
|
-
};
|
15
|
-
|
16
|
-
var isValidImage = function (type) {
|
17
|
-
return /^data:image\/[a-z]?/i.test(type);
|
18
|
-
};
|
19
|
-
|
20
|
-
$.extend(true, $.trumbowyg, {
|
21
|
-
langs: {
|
22
|
-
// jshint camelcase:false
|
23
|
-
en: {
|
24
|
-
base64: 'Image as base64',
|
25
|
-
file: 'File',
|
26
|
-
errFileReaderNotSupported: 'FileReader is not supported by your browser.',
|
27
|
-
errInvalidImage: 'Invalid image file.'
|
28
|
-
},
|
29
|
-
fr: {
|
30
|
-
base64: 'Image en base64',
|
31
|
-
file: 'Fichier'
|
32
|
-
},
|
33
|
-
cs: {
|
34
|
-
base64: 'Vložit obrázek',
|
35
|
-
file: 'Soubor'
|
36
|
-
},
|
37
|
-
zh_cn: {
|
38
|
-
base64: '图片(Base64编码)',
|
39
|
-
file: '文件'
|
40
|
-
},
|
41
|
-
nl: {
|
42
|
-
errFileReaderNotSupported: 'Uw browser ondersteunt deze functionaliteit niet.',
|
43
|
-
errInvalidImage: 'De gekozen afbeelding is ongeldig.'
|
44
|
-
},
|
45
|
-
ru: {
|
46
|
-
base64: 'Изображение как код в base64',
|
47
|
-
file: 'Файл',
|
48
|
-
errFileReaderNotSupported: 'FileReader не поддерживается вашим браузером.',
|
49
|
-
errInvalidImage: 'Недопустимый файл изображения.'
|
50
|
-
},
|
51
|
-
ja: {
|
52
|
-
base64: '画像 (Base64形式)',
|
53
|
-
file: 'ファイル',
|
54
|
-
errFileReaderNotSupported: 'あなたのブラウザーはFileReaderをサポートしていません',
|
55
|
-
errInvalidImage: '画像形式が正しくありません'
|
56
|
-
}
|
57
|
-
},
|
58
|
-
// jshint camelcase:true
|
59
|
-
|
60
|
-
plugins: {
|
61
|
-
base64: {
|
62
|
-
shouldInit: isSupported,
|
63
|
-
init: function (trumbowyg) {
|
64
|
-
var btnDef = {
|
65
|
-
isSupported: isSupported,
|
66
|
-
fn: function () {
|
67
|
-
trumbowyg.saveRange();
|
68
|
-
|
69
|
-
var file;
|
70
|
-
var $modal = trumbowyg.openModalInsert(
|
71
|
-
// Title
|
72
|
-
trumbowyg.lang.base64,
|
73
|
-
|
74
|
-
// Fields
|
75
|
-
{
|
76
|
-
file: {
|
77
|
-
type: 'file',
|
78
|
-
required: true,
|
79
|
-
attributes: {
|
80
|
-
accept: 'image/*'
|
81
|
-
}
|
82
|
-
},
|
83
|
-
alt: {
|
84
|
-
label: 'description',
|
85
|
-
value: trumbowyg.getRangeText()
|
86
|
-
}
|
87
|
-
},
|
88
|
-
|
89
|
-
// Callback
|
90
|
-
function (values) {
|
91
|
-
var fReader = new FileReader();
|
92
|
-
|
93
|
-
fReader.onloadend = function (e) {
|
94
|
-
if (isValidImage(e.target.result)) {
|
95
|
-
trumbowyg.execCmd('insertImage', fReader.result);
|
96
|
-
$(['img[src="', fReader.result, '"]:not([alt])'].join(''), trumbowyg.$box).attr('alt', values.alt);
|
97
|
-
trumbowyg.closeModal();
|
98
|
-
} else {
|
99
|
-
trumbowyg.addErrorOnModalField(
|
100
|
-
$('input[type=file]', $modal),
|
101
|
-
trumbowyg.lang.errInvalidImage
|
102
|
-
);
|
103
|
-
}
|
104
|
-
};
|
105
|
-
|
106
|
-
fReader.readAsDataURL(file);
|
107
|
-
}
|
108
|
-
);
|
109
|
-
|
110
|
-
$('input[type=file]').on('change', function (e) {
|
111
|
-
file = e.target.files[0];
|
112
|
-
});
|
113
|
-
}
|
114
|
-
};
|
115
|
-
|
116
|
-
trumbowyg.addBtnDef('base64', btnDef);
|
117
|
-
}
|
118
|
-
}
|
119
|
-
}
|
120
|
-
});
|
121
|
-
})(jQuery);
|
@@ -1 +0,0 @@
|
|
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(n){var l=new FileReader;l.onloadend=function(a){r(a.target.result)?(i.execCmd("insertImage",l.result),e(['img[src="',l.result,'"]:not([alt])'].join(""),i.$box).attr("alt",n.alt),i.closeModal()):i.addErrorOnModalField(e("input[type=file]",t),i.lang.errInvalidImage)},l.readAsDataURL(a)});e("input[type=file]").on("change",function(e){a=e.target.files[0]})}};i.addBtnDef("base64",t)}}}})}(jQuery);
|
data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.js
DELETED
@@ -1,179 +0,0 @@
|
|
1
|
-
/* ===========================================================
|
2
|
-
* trumbowyg.cleanpaste.js v1.0
|
3
|
-
* Font Clean paste plugin for Trumbowyg
|
4
|
-
* http://alex-d.github.com/Trumbowyg
|
5
|
-
* ===========================================================
|
6
|
-
* Author : Eric Radin
|
7
|
-
*/
|
8
|
-
|
9
|
-
/**
|
10
|
-
* This plugin will perform a "cleaning" on any paste, in particular
|
11
|
-
* it will clean pasted content of microsoft word document tags and classes.
|
12
|
-
*/
|
13
|
-
(function ($) {
|
14
|
-
'use strict';
|
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
|
-
function checkValidTags(snippet) {
|
25
|
-
var theString = snippet;
|
26
|
-
|
27
|
-
// Replace uppercase element names with lowercase
|
28
|
-
theString = theString.replace(/<[^> ]*/g, function (match) {
|
29
|
-
return match.toLowerCase();
|
30
|
-
});
|
31
|
-
|
32
|
-
// Replace uppercase attribute names with lowercase
|
33
|
-
theString = theString.replace(/<[^>]*>/g, function (match) {
|
34
|
-
match = match.replace(/ [^=]+=/g, function (match2) {
|
35
|
-
return match2.toLowerCase();
|
36
|
-
});
|
37
|
-
return match;
|
38
|
-
});
|
39
|
-
|
40
|
-
// Put quotes around unquoted attributes
|
41
|
-
theString = theString.replace(/<[^>]*>/g, function (match) {
|
42
|
-
match = match.replace(/( [^=]+=)([^"][^ >]*)/g, '$1\"$2\"');
|
43
|
-
return match;
|
44
|
-
});
|
45
|
-
|
46
|
-
return theString;
|
47
|
-
}
|
48
|
-
|
49
|
-
function cleanIt(htmlBefore, htmlAfter) {
|
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
|
-
|
102
|
-
// first make sure all tags and attributes are made valid
|
103
|
-
newSnippet = checkValidTags(newSnippet);
|
104
|
-
|
105
|
-
// Replace opening bold tags with strong
|
106
|
-
newSnippet = newSnippet.replace(/<b(\s+|>)/g, '<strong$1');
|
107
|
-
// Replace closing bold tags with closing strong
|
108
|
-
newSnippet = newSnippet.replace(/<\/b(\s+|>)/g, '</strong$1');
|
109
|
-
|
110
|
-
// Replace italic tags with em
|
111
|
-
newSnippet = newSnippet.replace(/<i(\s+|>)/g, '<em$1');
|
112
|
-
// Replace closing italic tags with closing em
|
113
|
-
newSnippet = newSnippet.replace(/<\/i(\s+|>)/g, '</em$1');
|
114
|
-
|
115
|
-
// strip out comments -cgCraft
|
116
|
-
newSnippet = newSnippet.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g, '');
|
117
|
-
|
118
|
-
// strip out -cgCraft
|
119
|
-
newSnippet = newSnippet.replace(/ /gi, ' ');
|
120
|
-
// strip out extra spaces -cgCraft
|
121
|
-
newSnippet = newSnippet.replace(/ <\//gi, '</');
|
122
|
-
|
123
|
-
while (newSnippet.indexOf(' ') !== -1) {
|
124
|
-
var anArray = newSnippet.split(' ');
|
125
|
-
newSnippet = anArray.join(' ');
|
126
|
-
}
|
127
|
-
|
128
|
-
// strip -cgCraft
|
129
|
-
newSnippet = newSnippet.replace(/^\s*|\s*$/g, '');
|
130
|
-
|
131
|
-
// Strip out unaccepted attributes
|
132
|
-
newSnippet = newSnippet.replace(/<[^>]*>/g, function (match) {
|
133
|
-
match = match.replace(/ ([^=]+)="[^"]*"/g, function (match2, attributeName) {
|
134
|
-
if (['alt', 'href', 'src', 'title'].indexOf(attributeName) !== -1) {
|
135
|
-
return match2;
|
136
|
-
}
|
137
|
-
return '';
|
138
|
-
});
|
139
|
-
return match;
|
140
|
-
});
|
141
|
-
|
142
|
-
// Final cleanout for MS Word crud
|
143
|
-
newSnippet = newSnippet.replace(/<\?xml[^>]*>/g, '');
|
144
|
-
newSnippet = newSnippet.replace(/<[^ >]+:[^>]*>/g, '');
|
145
|
-
newSnippet = newSnippet.replace(/<\/[^ >]+:[^>]*>/g, '');
|
146
|
-
|
147
|
-
// remove unwanted tags
|
148
|
-
newSnippet = newSnippet.replace(/<(div|span|style|meta|link){1}.*?>/gi, '');
|
149
|
-
|
150
|
-
htmlAfter = matchedHead + newSnippet + matchedTail;
|
151
|
-
return htmlAfter;
|
152
|
-
}
|
153
|
-
|
154
|
-
// clean editor
|
155
|
-
// this will clean the inserted contents
|
156
|
-
// it does a compare, before and after paste to determine the
|
157
|
-
// pasted contents
|
158
|
-
$.extend(true, $.trumbowyg, {
|
159
|
-
plugins: {
|
160
|
-
cleanPaste: {
|
161
|
-
init: function (trumbowyg) {
|
162
|
-
trumbowyg.pasteHandlers.push(function () {
|
163
|
-
try {
|
164
|
-
var contentBefore = trumbowyg.$ed.html();
|
165
|
-
setTimeout(function () {
|
166
|
-
var contentAfter = trumbowyg.$ed.html();
|
167
|
-
contentAfter = cleanIt(contentBefore, contentAfter);
|
168
|
-
trumbowyg.$ed.html(contentAfter);
|
169
|
-
}, 0);
|
170
|
-
} catch (c) {
|
171
|
-
}
|
172
|
-
});
|
173
|
-
}
|
174
|
-
}
|
175
|
-
}
|
176
|
-
});
|
177
|
-
})(jQuery);
|
178
|
-
|
179
|
-
|
data/app/assets/stylesheets/activeadmin/trumbowyg/plugins/cleanpaste/trumbowyg.cleanpaste.min.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
!function(r){"use strict";function e(r){for(var e="",t=r.length-1;t>=0;t-=1)e+=r.charAt(t);return e}function t(r){var e=r;return e=e.replace(/<[^> ]*/g,function(r){return r.toLowerCase()}),e=e.replace(/<[^>]*>/g,function(r){return r=r.replace(/ [^=]+=/g,function(r){return r.toLowerCase()})}),e=e.replace(/<[^>]*>/g,function(r){return r=r.replace(/( [^=]+=)([^"][^ >]*)/g,'$1"$2"')})}function n(r,n){var a,c,i,l="",s="";for(a=0;n.charAt(a)===r.charAt(a);a+=1)l+=n.charAt(a);for(var u=a;u>=0;u-=1){if("<"===r.charAt(u)){a=u,l=r.substring(0,a);break}if(">"===r.charAt(u))break}for(n=e(n),r=e(r),c=0;n.charAt(c)===r.charAt(c);c+=1)s+=n.charAt(c);for(var g=c;g>=0;g-=1){if(">"===r.charAt(g)){c=g,s=r.substring(0,c);break}if("<"===r.charAt(g))break}if(s=e(s),a===n.length-c)return!1;for(n=e(n),i=n.substring(a,n.length-c),i=t(i),i=i.replace(/<b(\s+|>)/g,"<strong$1"),i=i.replace(/<\/b(\s+|>)/g,"</strong$1"),i=i.replace(/<i(\s+|>)/g,"<em$1"),i=i.replace(/<\/i(\s+|>)/g,"</em$1"),i=i.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g,""),i=i.replace(/ /gi," "),i=i.replace(/ <\//gi,"</");-1!==i.indexOf(" ");){var o=i.split(" ");i=o.join(" ")}return i=i.replace(/^\s*|\s*$/g,""),i=i.replace(/<[^>]*>/g,function(r){return r=r.replace(/ ([^=]+)="[^"]*"/g,function(r,e){return-1!==["alt","href","src","title"].indexOf(e)?r:""})}),i=i.replace(/<\?xml[^>]*>/g,""),i=i.replace(/<[^ >]+:[^>]*>/g,""),i=i.replace(/<\/[^ >]+:[^>]*>/g,""),i=i.replace(/<(div|span|style|meta|link){1}.*?>/gi,""),n=l+i+s}r.extend(!0,r.trumbowyg,{plugins:{cleanPaste:{init:function(r){r.pasteHandlers.push(function(){try{var e=r.$ed.html();setTimeout(function(){var t=r.$ed.html();t=n(e,t),r.$ed.html(t)},0)}catch(t){}})}}}})}(jQuery);
|
@@ -1,176 +0,0 @@
|
|
1
|
-
/* ===========================================================
|
2
|
-
* trumbowyg.colors.js v1.2
|
3
|
-
* Colors picker plugin for Trumbowyg
|
4
|
-
* http://alex-d.github.com/Trumbowyg
|
5
|
-
* ===========================================================
|
6
|
-
* Author : Alexandre Demode (Alex-D)
|
7
|
-
* Twitter : @AlexandreDemode
|
8
|
-
* Website : alex-d.fr
|
9
|
-
*/
|
10
|
-
|
11
|
-
(function ($) {
|
12
|
-
'use strict';
|
13
|
-
|
14
|
-
$.extend(true, $.trumbowyg, {
|
15
|
-
langs: {
|
16
|
-
// jshint camelcase:false
|
17
|
-
cs: {
|
18
|
-
foreColor: 'Barva textu',
|
19
|
-
backColor: 'Barva pozadí'
|
20
|
-
},
|
21
|
-
en: {
|
22
|
-
foreColor: 'Text color',
|
23
|
-
backColor: 'Background color'
|
24
|
-
},
|
25
|
-
fr: {
|
26
|
-
foreColor: 'Couleur du texte',
|
27
|
-
backColor: 'Couleur de fond'
|
28
|
-
},
|
29
|
-
sk: {
|
30
|
-
foreColor: 'Farba textu',
|
31
|
-
backColor: 'Farba pozadia'
|
32
|
-
},
|
33
|
-
zh_cn: {
|
34
|
-
foreColor: '文字颜色',
|
35
|
-
backColor: '背景颜色'
|
36
|
-
},
|
37
|
-
ru: {
|
38
|
-
foreColor: 'Цвет текста',
|
39
|
-
backColor: 'Цвет выделения текста'
|
40
|
-
},
|
41
|
-
ja: {
|
42
|
-
foreColor: '文字色',
|
43
|
-
backColor: '背景色'
|
44
|
-
}
|
45
|
-
}
|
46
|
-
});
|
47
|
-
// jshint camelcase:true
|
48
|
-
|
49
|
-
|
50
|
-
function hex(x) {
|
51
|
-
return ('0' + parseInt(x).toString(16)).slice(-2);
|
52
|
-
}
|
53
|
-
|
54
|
-
function colorToHex(rgb) {
|
55
|
-
if (rgb.search('rgb') === -1) {
|
56
|
-
return rgb.replace('#', '');
|
57
|
-
} else if (rgb === 'rgba(0, 0, 0, 0)') {
|
58
|
-
return 'transparent';
|
59
|
-
} else {
|
60
|
-
rgb = rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/);
|
61
|
-
return hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
|
62
|
-
}
|
63
|
-
}
|
64
|
-
|
65
|
-
function colorTagHandler(element, trumbowyg) {
|
66
|
-
var tags = [];
|
67
|
-
|
68
|
-
if(!element.style){
|
69
|
-
return tags;
|
70
|
-
}
|
71
|
-
|
72
|
-
// background color
|
73
|
-
if (element.style.backgroundColor !== '') {
|
74
|
-
var backColor = colorToHex(element.style.backgroundColor);
|
75
|
-
if (trumbowyg.o.plugins.colors.colorList.indexOf(backColor) >= 0) {
|
76
|
-
tags.push('backColor' + backColor);
|
77
|
-
} else {
|
78
|
-
tags.push('backColorFree');
|
79
|
-
}
|
80
|
-
}
|
81
|
-
|
82
|
-
// text color
|
83
|
-
var foreColor;
|
84
|
-
if (element.style.color !== '') {
|
85
|
-
foreColor = colorToHex(element.style.color);
|
86
|
-
} else if (element.hasAttribute('color')) {
|
87
|
-
foreColor = colorToHex(element.getAttribute('color'));
|
88
|
-
}
|
89
|
-
if (foreColor) {
|
90
|
-
if (trumbowyg.o.plugins.colors.colorList.indexOf(foreColor) >= 0) {
|
91
|
-
tags.push('foreColor' + foreColor);
|
92
|
-
} else {
|
93
|
-
tags.push('foreColorFree');
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
return tags;
|
98
|
-
}
|
99
|
-
|
100
|
-
var defaultOptions = {
|
101
|
-
colorList: ['ffffff', '000000', 'eeece1', '1f497d', '4f81bd', 'c0504d', '9bbb59', '8064a2', '4bacc6', 'f79646', 'ffff00', 'f2f2f2', '7f7f7f', 'ddd9c3', 'c6d9f0', 'dbe5f1', 'f2dcdb', 'ebf1dd', 'e5e0ec', 'dbeef3', 'fdeada', 'fff2ca', 'd8d8d8', '595959', 'c4bd97', '8db3e2', 'b8cce4', 'e5b9b7', 'd7e3bc', 'ccc1d9', 'b7dde8', 'fbd5b5', 'ffe694', 'bfbfbf', '3f3f3f', '938953', '548dd4', '95b3d7', 'd99694', 'c3d69b', 'b2a2c7', 'b7dde8', 'fac08f', 'f2c314', 'a5a5a5', '262626', '494429', '17365d', '366092', '953734', '76923c', '5f497a', '92cddc', 'e36c09', 'c09100', '7f7f7f', '0c0c0c', '1d1b10', '0f243e', '244061', '632423', '4f6128', '3f3151', '31859b', '974806', '7f6000']
|
102
|
-
};
|
103
|
-
|
104
|
-
// Add all colors in two dropdowns
|
105
|
-
$.extend(true, $.trumbowyg, {
|
106
|
-
plugins: {
|
107
|
-
color: {
|
108
|
-
init: function (trumbowyg) {
|
109
|
-
trumbowyg.o.plugins.colors = trumbowyg.o.plugins.colors || defaultOptions;
|
110
|
-
var foreColorBtnDef = {
|
111
|
-
dropdown: buildDropdown('foreColor', trumbowyg)
|
112
|
-
},
|
113
|
-
backColorBtnDef = {
|
114
|
-
dropdown: buildDropdown('backColor', trumbowyg)
|
115
|
-
};
|
116
|
-
|
117
|
-
trumbowyg.addBtnDef('foreColor', foreColorBtnDef);
|
118
|
-
trumbowyg.addBtnDef('backColor', backColorBtnDef);
|
119
|
-
},
|
120
|
-
tagHandler: colorTagHandler
|
121
|
-
}
|
122
|
-
}
|
123
|
-
});
|
124
|
-
|
125
|
-
function buildDropdown(fn, trumbowyg) {
|
126
|
-
var dropdown = [];
|
127
|
-
|
128
|
-
$.each(trumbowyg.o.plugins.colors.colorList, function (i, color) {
|
129
|
-
var btn = fn + color,
|
130
|
-
btnDef = {
|
131
|
-
fn: fn,
|
132
|
-
forceCss: true,
|
133
|
-
param: '#' + color,
|
134
|
-
style: 'background-color: #' + color + ';'
|
135
|
-
};
|
136
|
-
trumbowyg.addBtnDef(btn, btnDef);
|
137
|
-
dropdown.push(btn);
|
138
|
-
});
|
139
|
-
|
140
|
-
var removeColorButtonName = fn + 'Remove',
|
141
|
-
removeColorBtnDef = {
|
142
|
-
fn: 'removeFormat',
|
143
|
-
param: fn,
|
144
|
-
style: 'background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAG0lEQVQIW2NkQAAfEJMRmwBYhoGBYQtMBYoAADziAp0jtJTgAAAAAElFTkSuQmCC);'
|
145
|
-
};
|
146
|
-
trumbowyg.addBtnDef(removeColorButtonName, removeColorBtnDef);
|
147
|
-
dropdown.push(removeColorButtonName);
|
148
|
-
|
149
|
-
// add free color btn
|
150
|
-
var freeColorButtonName = fn + 'Free',
|
151
|
-
freeColorBtnDef = {
|
152
|
-
fn: function () {
|
153
|
-
trumbowyg.openModalInsert(trumbowyg.lang[fn],
|
154
|
-
{
|
155
|
-
color: {
|
156
|
-
label: fn,
|
157
|
-
value: '#FFFFFF'
|
158
|
-
}
|
159
|
-
},
|
160
|
-
// callback
|
161
|
-
function (values) {
|
162
|
-
trumbowyg.execCmd(fn, values.color);
|
163
|
-
return true;
|
164
|
-
}
|
165
|
-
);
|
166
|
-
},
|
167
|
-
text: '#',
|
168
|
-
// style adjust for displaying the text
|
169
|
-
style: 'text-indent: 0;line-height: 20px;padding: 0 5px;'
|
170
|
-
};
|
171
|
-
trumbowyg.addBtnDef(freeColorButtonName, freeColorBtnDef);
|
172
|
-
dropdown.push(freeColorButtonName);
|
173
|
-
|
174
|
-
return dropdown;
|
175
|
-
}
|
176
|
-
})(jQuery);
|