tinymce-rails 3.5.11.1 → 4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/README.md +40 -103
- data/Rakefile +10 -15
- data/app/assets/javascripts/tinymce-jquery.js +1 -1
- data/app/assets/javascripts/tinymce.js +1 -1
- data/app/assets/javascripts/tinymce/preinit.js.erb +1 -2
- data/lib/tasks/tinymce-assets.rake +3 -6
- data/lib/tinymce/rails.rb +1 -1
- data/lib/tinymce/rails/asset_installer.rb +36 -34
- data/lib/tinymce/rails/asset_manifest.rb +89 -108
- data/lib/tinymce/rails/configuration.rb +36 -29
- data/lib/tinymce/rails/engine.rb +1 -40
- data/lib/tinymce/rails/helper.rb +5 -9
- data/lib/tinymce/rails/version.rb +2 -2
- data/vendor/assets/javascripts/tinymce/jquery.tinymce.js +1 -1
- data/vendor/assets/javascripts/tinymce/langs/readme.md +3 -0
- data/vendor/assets/javascripts/tinymce/license.txt +504 -504
- data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/{utils → plugins/compat3x}/editable_selects.js +70 -70
- data/vendor/assets/javascripts/tinymce/{utils → plugins/compat3x}/form_utils.js +210 -210
- data/vendor/assets/javascripts/tinymce/{utils → plugins/compat3x}/mctabs.js +161 -161
- data/vendor/assets/javascripts/tinymce/plugins/compat3x/tiny_mce_popup.js +435 -0
- data/vendor/assets/javascripts/tinymce/{utils → plugins/compat3x}/validate.js +252 -252
- data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-cool.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-cry.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-embarassed.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-foot-in-mouth.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-frown.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-innocent.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-kiss.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-laughing.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-money-mouth.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-sealed.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-smile.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-surprised.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-tongue-out.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-undecided.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-wink.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/{emotions → emoticons}/img/smiley-yell.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/example/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/example_dependency/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/layer/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/visualblocks/css/visualblocks.css +114 -21
- data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/content.inline.min.css +1 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/content.min.css +1 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon-small.eot +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon-small.svg +166 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon-small.ttf +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon-small.woff +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon.eot +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon.svg +150 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon.ttf +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/icomoon.woff +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/readme.md +1 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/img/object.gif +0 -0
- data/vendor/assets/javascripts/tinymce/{themes/advanced → skins/lightgray}/img/trans.gif +0 -0
- data/vendor/assets/javascripts/tinymce/{plugins/spellchecker → skins/lightgray}/img/wline.gif +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.min.css +1 -0
- data/vendor/assets/javascripts/tinymce/themes/modern/theme.js +1 -0
- data/vendor/assets/javascripts/tinymce/tinymce.js +10 -0
- data/vendor/assets/javascripts/tinymce/tinymce_jquery.js +9 -0
- metadata +100 -272
- checksums.yaml +0 -7
- data/lib/tinymce/rails/asset_installer/compile.rb +0 -44
- data/lib/tinymce/rails/asset_installer/copy.rb +0 -52
- data/vendor/assets/javascripts/tinymce/langs/en.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/advhr/css/advhr.css +0 -5
- data/vendor/assets/javascripts/tinymce/plugins/advhr/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/advhr/editor_plugin_src.js +0 -57
- data/vendor/assets/javascripts/tinymce/plugins/advhr/js/rule.js +0 -43
- data/vendor/assets/javascripts/tinymce/plugins/advhr/langs/en_dlg.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/advhr/rule.htm +0 -58
- data/vendor/assets/javascripts/tinymce/plugins/advimage/css/advimage.css +0 -13
- data/vendor/assets/javascripts/tinymce/plugins/advimage/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/advimage/editor_plugin_src.js +0 -50
- data/vendor/assets/javascripts/tinymce/plugins/advimage/image.htm +0 -235
- data/vendor/assets/javascripts/tinymce/plugins/advimage/img/sample.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/advimage/js/image.js +0 -464
- data/vendor/assets/javascripts/tinymce/plugins/advimage/langs/en_dlg.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/advlink/css/advlink.css +0 -8
- data/vendor/assets/javascripts/tinymce/plugins/advlink/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/advlink/editor_plugin_src.js +0 -61
- data/vendor/assets/javascripts/tinymce/plugins/advlink/js/advlink.js +0 -543
- data/vendor/assets/javascripts/tinymce/plugins/advlink/langs/en_dlg.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/advlink/link.htm +0 -338
- data/vendor/assets/javascripts/tinymce/plugins/advlist/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/advlist/editor_plugin_src.js +0 -176
- data/vendor/assets/javascripts/tinymce/plugins/autolink/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/autolink/editor_plugin_src.js +0 -184
- data/vendor/assets/javascripts/tinymce/plugins/autoresize/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/autoresize/editor_plugin_src.js +0 -119
- data/vendor/assets/javascripts/tinymce/plugins/autosave/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/autosave/editor_plugin_src.js +0 -433
- data/vendor/assets/javascripts/tinymce/plugins/bbcode/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/bbcode/editor_plugin_src.js +0 -120
- data/vendor/assets/javascripts/tinymce/plugins/contextmenu/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/contextmenu/editor_plugin_src.js +0 -163
- data/vendor/assets/javascripts/tinymce/plugins/directionality/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/directionality/editor_plugin_src.js +0 -85
- data/vendor/assets/javascripts/tinymce/plugins/emotions/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/emotions/editor_plugin_src.js +0 -43
- data/vendor/assets/javascripts/tinymce/plugins/emotions/emotions.htm +0 -42
- data/vendor/assets/javascripts/tinymce/plugins/emotions/js/emotions.js +0 -43
- data/vendor/assets/javascripts/tinymce/plugins/emotions/langs/en_dlg.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/example/dialog.htm +0 -22
- data/vendor/assets/javascripts/tinymce/plugins/example/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/example/editor_plugin_src.js +0 -84
- data/vendor/assets/javascripts/tinymce/plugins/example/img/example.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/example/js/dialog.js +0 -19
- data/vendor/assets/javascripts/tinymce/plugins/example/langs/en.js +0 -3
- data/vendor/assets/javascripts/tinymce/plugins/example/langs/en_dlg.js +0 -3
- data/vendor/assets/javascripts/tinymce/plugins/example_dependency/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/example_dependency/editor_plugin_src.js +0 -50
- data/vendor/assets/javascripts/tinymce/plugins/fullpage/css/fullpage.css +0 -143
- data/vendor/assets/javascripts/tinymce/plugins/fullpage/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullpage/editor_plugin_src.js +0 -405
- data/vendor/assets/javascripts/tinymce/plugins/fullpage/fullpage.htm +0 -259
- data/vendor/assets/javascripts/tinymce/plugins/fullpage/js/fullpage.js +0 -232
- data/vendor/assets/javascripts/tinymce/plugins/fullpage/langs/en_dlg.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/editor_plugin_src.js +0 -234
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/fullscreen.htm +0 -117
- data/vendor/assets/javascripts/tinymce/plugins/iespell/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/iespell/editor_plugin_src.js +0 -54
- data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/editor_plugin_src.js +0 -699
- data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css +0 -90
- data/vendor/assets/javascripts/tinymce/plugins/inlinepopups/template.htm +0 -387
- data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/editor_plugin_src.js +0 -83
- data/vendor/assets/javascripts/tinymce/plugins/layer/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/layer/editor_plugin_src.js +0 -262
- data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/editor_plugin_src.js +0 -139
- data/vendor/assets/javascripts/tinymce/plugins/lists/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/lists/editor_plugin_src.js +0 -955
- data/vendor/assets/javascripts/tinymce/plugins/media/css/media.css +0 -17
- data/vendor/assets/javascripts/tinymce/plugins/media/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/media/editor_plugin_src.js +0 -898
- data/vendor/assets/javascripts/tinymce/plugins/media/js/embed.js +0 -73
- data/vendor/assets/javascripts/tinymce/plugins/media/js/media.js +0 -513
- data/vendor/assets/javascripts/tinymce/plugins/media/langs/en_dlg.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/media/media.htm +0 -922
- data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/editor_plugin_src.js +0 -54
- data/vendor/assets/javascripts/tinymce/plugins/noneditable/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/noneditable/editor_plugin_src.js +0 -537
- data/vendor/assets/javascripts/tinymce/plugins/pagebreak/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/pagebreak/editor_plugin_src.js +0 -74
- data/vendor/assets/javascripts/tinymce/plugins/paste/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/paste/editor_plugin_src.js +0 -887
- data/vendor/assets/javascripts/tinymce/plugins/paste/js/pastetext.js +0 -36
- data/vendor/assets/javascripts/tinymce/plugins/paste/js/pasteword.js +0 -51
- data/vendor/assets/javascripts/tinymce/plugins/paste/langs/en_dlg.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/paste/pastetext.htm +0 -27
- data/vendor/assets/javascripts/tinymce/plugins/paste/pasteword.htm +0 -21
- data/vendor/assets/javascripts/tinymce/plugins/preview/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/preview/editor_plugin_src.js +0 -53
- data/vendor/assets/javascripts/tinymce/plugins/preview/example.html +0 -28
- data/vendor/assets/javascripts/tinymce/plugins/preview/jscripts/embed.js +0 -73
- data/vendor/assets/javascripts/tinymce/plugins/preview/preview.html +0 -17
- data/vendor/assets/javascripts/tinymce/plugins/print/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/print/editor_plugin_src.js +0 -34
- data/vendor/assets/javascripts/tinymce/plugins/save/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/save/editor_plugin_src.js +0 -101
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/css/searchreplace.css +0 -6
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/editor_plugin_src.js +0 -61
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/js/searchreplace.js +0 -152
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/langs/en_dlg.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/searchreplace.htm +0 -100
- data/vendor/assets/javascripts/tinymce/plugins/spellchecker/css/content.css +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/spellchecker/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/spellchecker/editor_plugin_src.js +0 -471
- data/vendor/assets/javascripts/tinymce/plugins/style/css/props.css +0 -14
- data/vendor/assets/javascripts/tinymce/plugins/style/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/style/editor_plugin_src.js +0 -71
- data/vendor/assets/javascripts/tinymce/plugins/style/js/props.js +0 -709
- data/vendor/assets/javascripts/tinymce/plugins/style/langs/en_dlg.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/style/props.htm +0 -845
- data/vendor/assets/javascripts/tinymce/plugins/style/readme.txt +0 -19
- data/vendor/assets/javascripts/tinymce/plugins/tabfocus/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/tabfocus/editor_plugin_src.js +0 -122
- data/vendor/assets/javascripts/tinymce/plugins/table/cell.htm +0 -180
- data/vendor/assets/javascripts/tinymce/plugins/table/css/cell.css +0 -17
- data/vendor/assets/javascripts/tinymce/plugins/table/css/row.css +0 -25
- data/vendor/assets/javascripts/tinymce/plugins/table/css/table.css +0 -13
- data/vendor/assets/javascripts/tinymce/plugins/table/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/table/editor_plugin_src.js +0 -1456
- data/vendor/assets/javascripts/tinymce/plugins/table/js/cell.js +0 -319
- data/vendor/assets/javascripts/tinymce/plugins/table/js/merge_cells.js +0 -27
- data/vendor/assets/javascripts/tinymce/plugins/table/js/row.js +0 -254
- data/vendor/assets/javascripts/tinymce/plugins/table/js/table.js +0 -501
- data/vendor/assets/javascripts/tinymce/plugins/table/langs/en_dlg.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/table/merge_cells.htm +0 -32
- data/vendor/assets/javascripts/tinymce/plugins/table/row.htm +0 -158
- data/vendor/assets/javascripts/tinymce/plugins/table/table.htm +0 -188
- data/vendor/assets/javascripts/tinymce/plugins/template/blank.htm +0 -12
- data/vendor/assets/javascripts/tinymce/plugins/template/css/template.css +0 -23
- data/vendor/assets/javascripts/tinymce/plugins/template/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/template/editor_plugin_src.js +0 -159
- data/vendor/assets/javascripts/tinymce/plugins/template/js/template.js +0 -106
- data/vendor/assets/javascripts/tinymce/plugins/template/langs/en_dlg.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/template/template.htm +0 -31
- data/vendor/assets/javascripts/tinymce/plugins/visualblocks/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/visualblocks/editor_plugin_src.js +0 -63
- data/vendor/assets/javascripts/tinymce/plugins/visualchars/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/visualchars/editor_plugin_src.js +0 -83
- data/vendor/assets/javascripts/tinymce/plugins/wordcount/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/wordcount/editor_plugin_src.js +0 -122
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/abbr.htm +0 -142
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/acronym.htm +0 -142
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/attributes.htm +0 -149
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/cite.htm +0 -142
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/css/attributes.css +0 -11
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/css/popup.css +0 -9
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/del.htm +0 -162
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/editor_plugin.js +0 -1
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/editor_plugin_src.js +0 -132
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/ins.htm +0 -162
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/abbr.js +0 -28
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/acronym.js +0 -28
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/attributes.js +0 -111
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/cite.js +0 -28
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/del.js +0 -53
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/element_common.js +0 -229
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/js/ins.js +0 -53
- data/vendor/assets/javascripts/tinymce/plugins/xhtmlxtras/langs/en_dlg.js +0 -1
- data/vendor/assets/javascripts/tinymce/themes/advanced/about.htm +0 -52
- data/vendor/assets/javascripts/tinymce/themes/advanced/anchor.htm +0 -26
- data/vendor/assets/javascripts/tinymce/themes/advanced/charmap.htm +0 -55
- data/vendor/assets/javascripts/tinymce/themes/advanced/color_picker.htm +0 -70
- data/vendor/assets/javascripts/tinymce/themes/advanced/editor_template.js +0 -1
- data/vendor/assets/javascripts/tinymce/themes/advanced/editor_template_src.js +0 -1490
- data/vendor/assets/javascripts/tinymce/themes/advanced/image.htm +0 -80
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/colorpicker.jpg +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/flash.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/icons.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/iframe.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/pagebreak.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/quicktime.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/realmedia.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/shockwave.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/video.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/img/windowsmedia.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/about.js +0 -73
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/anchor.js +0 -56
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/charmap.js +0 -363
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/color_picker.js +0 -345
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/image.js +0 -253
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/link.js +0 -159
- data/vendor/assets/javascripts/tinymce/themes/advanced/js/source_editor.js +0 -78
- data/vendor/assets/javascripts/tinymce/themes/advanced/langs/en.js +0 -1
- data/vendor/assets/javascripts/tinymce/themes/advanced/langs/en_dlg.js +0 -1
- data/vendor/assets/javascripts/tinymce/themes/advanced/link.htm +0 -57
- data/vendor/assets/javascripts/tinymce/themes/advanced/shortcuts.htm +0 -47
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/content.css +0 -50
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/dialog.css +0 -118
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/img/buttons.png +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/img/items.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/img/menu_check.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/img/progress.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/img/tabs.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/default/ui.css +0 -219
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/highcontrast/content.css +0 -24
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/highcontrast/dialog.css +0 -106
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/highcontrast/ui.css +0 -106
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/content.css +0 -48
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/dialog.css +0 -118
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/ui.css +0 -222
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/ui_black.css +0 -8
- data/vendor/assets/javascripts/tinymce/themes/advanced/skins/o2k7/ui_silver.css +0 -5
- data/vendor/assets/javascripts/tinymce/themes/advanced/source_editor.htm +0 -25
- data/vendor/assets/javascripts/tinymce/themes/simple/editor_template.js +0 -1
- data/vendor/assets/javascripts/tinymce/themes/simple/editor_template_src.js +0 -84
- data/vendor/assets/javascripts/tinymce/themes/simple/img/icons.gif +0 -0
- data/vendor/assets/javascripts/tinymce/themes/simple/langs/en.js +0 -1
- data/vendor/assets/javascripts/tinymce/themes/simple/skins/default/content.css +0 -25
- data/vendor/assets/javascripts/tinymce/themes/simple/skins/default/ui.css +0 -32
- data/vendor/assets/javascripts/tinymce/themes/simple/skins/o2k7/content.css +0 -17
- data/vendor/assets/javascripts/tinymce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
- data/vendor/assets/javascripts/tinymce/themes/simple/skins/o2k7/ui.css +0 -35
- data/vendor/assets/javascripts/tinymce/tiny_mce.js +0 -1
- data/vendor/assets/javascripts/tinymce/tiny_mce_jquery.js +0 -1
- data/vendor/assets/javascripts/tinymce/tiny_mce_jquery_src.js +0 -17942
- data/vendor/assets/javascripts/tinymce/tiny_mce_popup.js +0 -5
- data/vendor/assets/javascripts/tinymce/tiny_mce_src.js +0 -19156
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -5,60 +5,45 @@ The `tinymce-rails` gem integrates the [TinyMCE](http://www.tinymce.com/) editor
|
|
5
5
|
|
6
6
|
This gem is compatible with Rails 3.1.1 and higher (including Rails 4).
|
7
7
|
|
8
|
-
This is the branch for TinyMCE 3.5.x
|
8
|
+
This is the branch for TinyMCE 4. TinyMCE 3.5.x is currently available in the [master branch](https://github.com/spohlenz/tinymce-rails). For the time being, parallel versions of TinyMCE (3.5.x and 4.x) will be maintained. However TinyMCE 4 will eventually be promoted to the master branch.
|
9
9
|
|
10
|
-
[![Build Status](https://travis-ci.org/spohlenz/tinymce-rails.png?branch=tinymce-
|
10
|
+
[![Build Status](https://travis-ci.org/spohlenz/tinymce-rails.png?branch=tinymce-4)](https://travis-ci.org/spohlenz/tinymce-rails)
|
11
11
|
|
12
|
-
**New in 3.5.11, 4.1.10 and 4.2.1:** Alternative asset installation methods (copy vs compile/symlink). See the [Asset Compilation](#asset-compilation) section below for details.
|
13
12
|
|
14
13
|
Instructions
|
15
14
|
------------
|
16
15
|
|
17
16
|
**1. Add `tinymce-rails` to your Gemfile**
|
18
17
|
|
19
|
-
|
20
|
-
gem 'tinymce-rails'
|
21
|
-
```
|
18
|
+
gem 'tinymce-rails'
|
22
19
|
|
23
20
|
Be sure to add to the global group, not the `assets` group. Then run `bundle install`.
|
24
21
|
|
25
22
|
|
26
23
|
**2. Create a `config/tinymce.yml` file with your global configuration options:**
|
27
24
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
- fullscreen
|
35
|
-
plugins:
|
36
|
-
- table
|
37
|
-
- fullscreen
|
38
|
-
```
|
39
|
-
|
25
|
+
toolbar1: styleselect | bold italic | link image | undo redo
|
26
|
+
toolbar2: table | fullscreen
|
27
|
+
plugins:
|
28
|
+
- table
|
29
|
+
- fullscreen
|
30
|
+
|
40
31
|
The Rails server no longer needs to be restarted when this file is updated in development mode.
|
41
32
|
|
42
33
|
To define multiple configuration sets, follow this syntax (a default configuration must be specified):
|
43
34
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
theme_advanced_toolbar_align: left
|
55
|
-
theme_advanced_buttons3_add:
|
56
|
-
- tablecontrols
|
57
|
-
plugins:
|
58
|
-
- table
|
59
|
-
```
|
35
|
+
default:
|
36
|
+
plugins:
|
37
|
+
- image
|
38
|
+
- link
|
39
|
+
|
40
|
+
alternate:
|
41
|
+
selector: textarea.table-editor
|
42
|
+
toolbar: styleselect | bold italic | link image | undo redo | table
|
43
|
+
plugins:
|
44
|
+
- table
|
60
45
|
|
61
|
-
See the [TinyMCE
|
46
|
+
See the [TinyMCE 4 Documentation](http://www.tinymce.com/wiki.php/Configuration) for a full list of configuration options.
|
62
47
|
|
63
48
|
|
64
49
|
**3. Include the TinyMCE assets**
|
@@ -67,70 +52,36 @@ Use *one* of the following options to include TinyMCE assets.
|
|
67
52
|
|
68
53
|
(1) Add to your application.js:
|
69
54
|
|
70
|
-
|
71
|
-
//= require tinymce
|
72
|
-
```
|
55
|
+
//= require tinymce
|
73
56
|
|
74
57
|
or (2) with jQuery integration:
|
75
58
|
|
76
|
-
|
77
|
-
//= require tinymce-jquery
|
78
|
-
```
|
59
|
+
//= require tinymce-jquery
|
79
60
|
|
80
61
|
(3) The TinyMCE assets can be included on a per-page basis using the `tinymce_assets` helper:
|
81
62
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
```
|
63
|
+
<%= tinymce_assets %>
|
64
|
+
#=> <script type="text/javascript" src="/assets/tinymce.js">
|
65
|
+
|
86
66
|
|
87
67
|
**4. Initialize TinyMCE**
|
88
68
|
|
89
69
|
For each textarea that you want to use with TinyMCE, add the "tinymce" class and ensure it has a unique ID:
|
90
70
|
|
91
|
-
|
92
|
-
<%= text_area_tag :content, "", :class => "tinymce", :rows => 40, :cols => 120 %>
|
93
|
-
```
|
94
|
-
|
95
|
-
or if you are using Rails' form builders:
|
96
|
-
|
97
|
-
```erb
|
98
|
-
<%= f.text_area :content, :class => "tinymce", :rows => 40, :cols => 120 %>
|
99
|
-
```
|
71
|
+
<%= text_area_tag :editor, "", :class => "tinymce", :rows => 40, :cols => 120 %>
|
100
72
|
|
101
73
|
Then invoke the `tinymce` helper to initialize TinyMCE:
|
102
74
|
|
103
|
-
|
104
|
-
<%= tinymce %>
|
105
|
-
```
|
75
|
+
<%= tinymce %>
|
106
76
|
|
107
77
|
Custom options can be passed to `tinymce` to override the global options specified in `config/tinymce.yml`:
|
108
78
|
|
109
|
-
|
110
|
-
<%= tinymce :theme => "simple", :language => "de", :plugins => ["inlinepopups", "paste"] %>
|
111
|
-
```
|
79
|
+
<%= tinymce :theme => "simple", :language => "de", :plugins => ["wordcount", "paste"] %>
|
112
80
|
|
113
81
|
Alternate configurations defined in 'config/tinymce.yml' can be used with:
|
114
82
|
|
115
|
-
|
116
|
-
<%= tinymce :alternate %>
|
117
|
-
```
|
118
|
-
|
119
|
-
Manual Initialization
|
120
|
-
---------------------
|
121
|
-
|
122
|
-
Using the `tinymce` helper and global configuration file is entirely optional. The `tinyMCE.init` function can be invoked manually if desired.
|
123
|
-
|
124
|
-
```erb
|
125
|
-
<%= text_area_tag :editor, "", :rows => 40, :cols => 120 %>
|
83
|
+
<%= tinymce :alternate %>
|
126
84
|
|
127
|
-
<script type="text/javascript">
|
128
|
-
tinyMCE.init({
|
129
|
-
mode: 'textareas',
|
130
|
-
theme: 'advanced'
|
131
|
-
});
|
132
|
-
</script>
|
133
|
-
```
|
134
85
|
|
135
86
|
Language Packs
|
136
87
|
--------------
|
@@ -138,40 +89,26 @@ Language Packs
|
|
138
89
|
See the [tinymce-rails-langs](https://github.com/spohlenz/tinymce-rails-langs) gem for additional language packs for TinyMCE. The `tinymce` helper will use the current locale as the language if available, falling back to English if the core language files are missing.
|
139
90
|
|
140
91
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
Since TinyMCE loads most of its files dynamically, some workarounds are required to ensure that the TinyMCE asset files are accessible using non-digested filenames.
|
145
|
-
|
146
|
-
As of tinymce-rails 3.5.11, 4.1.10 and 4.2.1, two alternative asset installation methods are available, which can be changed by setting `config.tinymce.install` within your `config/application.rb` file. Both methods are called when you run `rake asset:precompile` (via `Rake::Task#enhance`) after the regular application assets are compiled.
|
147
|
-
|
148
|
-
The default method, `copy`, copies the TinyMCE assets directly into `public/assets` and appends the file information into the asset manifest.
|
149
|
-
|
150
|
-
```ruby
|
151
|
-
config.tinymce.install = :copy
|
152
|
-
```
|
153
|
-
|
154
|
-
The new method, `compile`, adds the TinyMCE paths to the Sprockets precompilation paths and then creates symlinks from the non-digested filenames to their digested versions.
|
155
|
-
|
156
|
-
```ruby
|
157
|
-
config.tinymce.install = :compile
|
158
|
-
```
|
92
|
+
Manual Initialization
|
93
|
+
---------------------
|
159
94
|
|
160
|
-
|
95
|
+
Using the `tinymce` helper and global configuration file is entirely optional. The `tinyMCE.init` function can be invoked manually if desired.
|
161
96
|
|
162
|
-
|
97
|
+
<%= text_area_tag :editor, "", :rows => 40, :cols => 120 %>
|
163
98
|
|
164
|
-
|
165
|
-
|
166
|
-
|
99
|
+
<script type="text/javascript">
|
100
|
+
tinyMCE.init({
|
101
|
+
selector: 'textarea.editor'
|
102
|
+
});
|
103
|
+
</script>
|
167
104
|
|
168
105
|
|
169
106
|
Custom Plugins & Skins
|
170
107
|
----------------------
|
171
108
|
|
172
|
-
To use custom plugins or skins, simply add the files to your asset load path so that they are locatable at a path beneath `tinymce/plugins/` or `tinymce/
|
109
|
+
To use custom plugins or skins, simply add the files to your asset load path so that they are locatable at a path beneath `tinymce/plugins/` or `tinymce/skins/`.
|
173
110
|
|
174
|
-
For example, a plugin called `mycustomplugin` could have its main JS file at `app/assets/javascripts/tinymce/plugins/mycustomplugin/
|
111
|
+
For example, a plugin called `mycustomplugin` could have its main JS file at `app/assets/javascripts/tinymce/plugins/mycustomplugin/plugin.js`.
|
175
112
|
|
176
113
|
You should also ensure that your custom paths are added to the asset precompile paths.
|
177
114
|
|
data/Rakefile
CHANGED
@@ -13,7 +13,7 @@ def download(url, filename)
|
|
13
13
|
end
|
14
14
|
|
15
15
|
desc "Update TinyMCE to version #{TinyMCE::Rails::TINYMCE_VERSION}"
|
16
|
-
task :update => [ :fetch, :extract, :
|
16
|
+
task :update => [ :fetch, :extract, :rename ]
|
17
17
|
|
18
18
|
task :fetch do
|
19
19
|
download("http://download.moxiecode.com/tinymce/tinymce_#{TinyMCE::Rails::TINYMCE_VERSION}.zip", "tinymce.zip")
|
@@ -26,26 +26,21 @@ task :extract do
|
|
26
26
|
`unzip -u tmp/tinymce.zip -d tmp`
|
27
27
|
`rm -rf vendor/assets/javascripts/tinymce`
|
28
28
|
`mkdir -p vendor/assets/javascripts/tinymce`
|
29
|
-
`mv tmp/tinymce/
|
29
|
+
`mv tmp/tinymce/js/tinymce/* vendor/assets/javascripts/tinymce/`
|
30
30
|
end
|
31
31
|
|
32
32
|
step "Extracting jQuery files" do
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
`mv tmp/tinymce/jscripts/tiny_mce/tiny_mce_src.js vendor/assets/javascripts/tinymce/tiny_mce_jquery_src.js`
|
33
|
+
`rm -rf tmp/tinymce`
|
34
|
+
`unzip -u tmp/tinymce.jquery.zip -d tmp`
|
35
|
+
`mv tmp/tinymce/js/tinymce/jquery.tinymce.min.js vendor/assets/javascripts/tinymce/jquery.tinymce.js`
|
36
|
+
`mv tmp/tinymce/js/tinymce/tinymce.min.js vendor/assets/javascripts/tinymce/tinymce_jquery.js`
|
38
37
|
end
|
39
38
|
end
|
40
39
|
|
41
|
-
task :
|
42
|
-
step "
|
43
|
-
|
44
|
-
|
45
|
-
Dir["vendor/assets/javascripts/tinymce/**/*.js"].each do |file|
|
46
|
-
contents = converter.iconv(File.read(file))
|
47
|
-
contents = contents.force_encoding('UTF-8') if contents.respond_to?(:force_encoding)
|
48
|
-
File.open(file, 'w') { |f| f.write(contents) }
|
40
|
+
task :rename do
|
41
|
+
step "Renaming files" do
|
42
|
+
Dir["vendor/assets/javascripts/tinymce/**/*.min.js"].each do |file|
|
43
|
+
FileUtils.mv(file, file.sub(/\.min\.js$/, '.js'))
|
49
44
|
end
|
50
45
|
end
|
51
46
|
end
|
@@ -1,2 +1,2 @@
|
|
1
1
|
//= require tinymce/preinit.js
|
2
|
-
//= require tinymce/
|
2
|
+
//= require tinymce/tinymce.js
|
@@ -2,15 +2,12 @@ assets_task = Rake::Task.task_defined?('assets:precompile:primary') ? 'assets:pr
|
|
2
2
|
|
3
3
|
Rake::Task[assets_task].enhance do
|
4
4
|
require "tinymce/rails/asset_installer"
|
5
|
-
|
6
|
-
assets = Pathname.new(File.expand_path(File.dirname(__FILE__) + "/../../vendor/assets/javascripts/tinymce"))
|
7
5
|
|
6
|
+
assets = Pathname.new(File.expand_path(File.dirname(__FILE__) + "/../../vendor/assets/javascripts/tinymce"))
|
7
|
+
|
8
8
|
config = Rails.application.config
|
9
9
|
target = File.join(Rails.public_path, config.assets.prefix)
|
10
10
|
manifest = config.assets.manifest
|
11
11
|
|
12
|
-
|
13
|
-
installer.log_level = Logger::INFO
|
14
|
-
installer.strategy = config.tinymce.install
|
15
|
-
installer.install
|
12
|
+
TinyMCE::Rails::AssetInstaller.new(assets, target, manifest).install
|
16
13
|
end
|
data/lib/tinymce/rails.rb
CHANGED
@@ -7,7 +7,7 @@ module TinyMCE
|
|
7
7
|
require "tinymce/rails/helper"
|
8
8
|
|
9
9
|
def self.configuration
|
10
|
-
@configuration ||= ConfigurationFile.new(
|
10
|
+
@configuration ||= ConfigurationFile.new(::Rails.root.join("config/tinymce.yml"))
|
11
11
|
@configuration.respond_to?(:configuration) ? @configuration.configuration : @configuration
|
12
12
|
end
|
13
13
|
|
@@ -1,62 +1,64 @@
|
|
1
1
|
require "tinymce/rails/asset_manifest"
|
2
2
|
|
3
|
-
require "tinymce/rails/asset_installer/copy"
|
4
|
-
require "tinymce/rails/asset_installer/compile"
|
5
|
-
|
6
3
|
module TinyMCE
|
7
4
|
module Rails
|
8
5
|
class AssetInstaller
|
9
|
-
attr_reader :assets, :target, :strategy
|
10
|
-
attr_accessor :logger
|
11
|
-
|
12
6
|
def initialize(assets, target, manifest_path)
|
13
7
|
@assets = assets
|
14
8
|
@target = target
|
15
9
|
@manifest_path = manifest_path || target
|
16
|
-
|
17
|
-
@logger = Logger.new($stderr)
|
18
|
-
@logger.level = Logger::INFO
|
19
10
|
end
|
20
11
|
|
21
12
|
def install
|
22
|
-
|
13
|
+
cleanup_assets
|
14
|
+
copy_assets
|
15
|
+
append_to_manifest
|
16
|
+
|
17
|
+
manifest.write
|
23
18
|
end
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
|
20
|
+
private
|
21
|
+
def manifest
|
22
|
+
@manifest ||= AssetManifest.load(@manifest_path)
|
27
23
|
end
|
28
|
-
|
29
|
-
def
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
24
|
+
|
25
|
+
def cleanup_assets
|
26
|
+
manifest.each(/^tinymce\//) do |asset|
|
27
|
+
manifest.remove(asset) if index_asset?(asset)
|
28
|
+
|
29
|
+
manifest.remove_digest(asset) do |src, dest|
|
30
|
+
move_asset(src, dest)
|
31
|
+
end
|
34
32
|
end
|
35
33
|
end
|
36
34
|
|
37
|
-
def
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
35
|
+
def copy_assets
|
36
|
+
FileUtils.cp_r(@assets, @target, :preserve => true)
|
37
|
+
end
|
38
|
+
|
39
|
+
def append_to_manifest
|
40
|
+
asset_files.each do |file|
|
41
|
+
manifest.append(logical_path(file), file)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
def
|
46
|
-
|
45
|
+
def asset_files
|
46
|
+
Pathname.glob("#{@assets}/**/*").select(&:file?)
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
def logical_path(file)
|
50
50
|
file.relative_path_from(@assets.parent).to_s
|
51
51
|
end
|
52
52
|
|
53
|
-
def
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
53
|
+
def move_asset(src, dest)
|
54
|
+
src = File.join(@target, src)
|
55
|
+
dest = File.join(@target, dest)
|
56
|
+
|
57
|
+
FileUtils.mv(src, dest, :force => true) if src != dest && File.exists?(src)
|
58
|
+
end
|
59
|
+
|
60
|
+
def index_asset?(asset)
|
61
|
+
asset =~ /\/index\.js$/
|
60
62
|
end
|
61
63
|
end
|
62
64
|
end
|
@@ -1,141 +1,122 @@
|
|
1
|
+
require "multi_json"
|
2
|
+
|
1
3
|
module TinyMCE
|
2
4
|
module Rails
|
3
5
|
class AssetManifest
|
4
|
-
attr_reader :file
|
5
|
-
|
6
6
|
def self.load(manifest_path)
|
7
|
-
|
8
|
-
JsonManifest.try(manifest_path
|
9
|
-
YamlManifest.try(manifest_path) ||
|
7
|
+
YamlManifest.try(manifest_path) ||
|
8
|
+
JsonManifest.try(manifest_path) ||
|
10
9
|
NullManifest.new
|
11
10
|
end
|
12
|
-
|
13
|
-
def each(pattern)
|
14
|
-
assets.each_key do |asset|
|
15
|
-
if asset =~ pattern && !index_asset?(asset)
|
16
|
-
yield asset
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def asset_path(logical_path)
|
22
|
-
if digested = assets[logical_path]
|
23
|
-
yield digested, logical_path if block_given?
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def to_s
|
28
|
-
dump
|
29
|
-
end
|
30
|
-
|
31
|
-
protected
|
32
|
-
def index_asset?(asset)
|
33
|
-
asset =~ /\/index[^\/]*\.\w+$/
|
34
|
-
end
|
35
11
|
end
|
12
|
+
end
|
36
13
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
14
|
+
class YamlManifest
|
15
|
+
def self.try(manifest_path)
|
16
|
+
yaml_file = File.join(manifest_path, "manifest.yml")
|
17
|
+
new(yaml_file) if File.exists?(yaml_file)
|
18
|
+
end
|
42
19
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
20
|
+
def initialize(file)
|
21
|
+
@file = file
|
22
|
+
@manifest = YAML.load_file(file)
|
23
|
+
end
|
47
24
|
|
48
|
-
|
49
|
-
|
50
|
-
|
25
|
+
def append(logical_path, file)
|
26
|
+
@manifest[logical_path] = logical_path
|
27
|
+
end
|
51
28
|
|
52
|
-
|
53
|
-
|
54
|
-
|
29
|
+
def remove(logical_path)
|
30
|
+
@manifest.delete(logical_path)
|
31
|
+
end
|
55
32
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
yield digested, logical_path if block_given?
|
61
|
-
end
|
33
|
+
def remove_digest(logical_path)
|
34
|
+
if digested = @manifest[logical_path]
|
35
|
+
@manifest[logical_path] = logical_path
|
36
|
+
yield digested, logical_path if block_given?
|
62
37
|
end
|
38
|
+
end
|
63
39
|
|
64
|
-
|
65
|
-
|
40
|
+
def each(pattern)
|
41
|
+
@manifest.each_key do |asset|
|
42
|
+
yield asset if asset =~ pattern
|
66
43
|
end
|
44
|
+
end
|
67
45
|
|
68
|
-
|
69
|
-
|
70
|
-
|
46
|
+
def to_s
|
47
|
+
dump
|
48
|
+
end
|
71
49
|
|
72
|
-
|
73
|
-
|
74
|
-
end
|
50
|
+
def dump(io=nil)
|
51
|
+
YAML.dump(@manifest, io)
|
75
52
|
end
|
53
|
+
|
54
|
+
def write
|
55
|
+
File.open(@file, "wb") { |f| dump(f) }
|
56
|
+
end
|
57
|
+
end
|
76
58
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
59
|
+
class JsonManifest
|
60
|
+
def self.try(manifest_path)
|
61
|
+
paths = Dir[File.join(manifest_path, "manifest*.json")]
|
62
|
+
new(paths.first) if paths.any?
|
63
|
+
end
|
82
64
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
65
|
+
def initialize(file)
|
66
|
+
@file = file
|
67
|
+
@manifest = MultiJson.load(File.read(file))
|
68
|
+
end
|
87
69
|
|
88
|
-
|
89
|
-
|
70
|
+
def append(logical_path, file)
|
71
|
+
stat = File.stat(file)
|
90
72
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
73
|
+
@manifest["assets"][logical_path] = logical_path
|
74
|
+
@manifest["files"][logical_path] = {
|
75
|
+
"logical_path" => logical_path,
|
76
|
+
"mtime" => stat.mtime.iso8601,
|
77
|
+
"size" => stat.size,
|
78
|
+
"digest" => nil
|
79
|
+
}
|
80
|
+
end
|
99
81
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
end
|
82
|
+
def remove(logical_path)
|
83
|
+
if digested = @manifest["assets"].delete(logical_path)
|
84
|
+
@manifest["files"].delete(digested)
|
104
85
|
end
|
86
|
+
end
|
105
87
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
yield digested, logical_path if block_given?
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
def assets
|
116
|
-
@manifest["assets"]
|
117
|
-
end
|
118
|
-
|
119
|
-
def files
|
120
|
-
@manifest["files"]
|
88
|
+
def remove_digest(logical_path)
|
89
|
+
if digested = @manifest["assets"][logical_path]
|
90
|
+
@manifest["assets"][logical_path] = logical_path
|
91
|
+
@manifest["files"][logical_path] = @manifest["files"].delete(digested).tap { |f| f["digest"] = nil }
|
92
|
+
yield digested, logical_path if block_given?
|
121
93
|
end
|
94
|
+
end
|
122
95
|
|
123
|
-
|
124
|
-
|
96
|
+
def each(pattern)
|
97
|
+
@manifest["assets"].each_key do |asset|
|
98
|
+
yield asset if asset =~ pattern
|
125
99
|
end
|
100
|
+
end
|
126
101
|
|
127
|
-
|
128
|
-
|
129
|
-
end
|
102
|
+
def to_s
|
103
|
+
dump
|
130
104
|
end
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
def write; end
|
105
|
+
|
106
|
+
def dump
|
107
|
+
MultiJson.dump(@manifest)
|
108
|
+
end
|
109
|
+
|
110
|
+
def write
|
111
|
+
File.open(@file, "wb") { |f| f.write(dump) }
|
139
112
|
end
|
140
113
|
end
|
114
|
+
|
115
|
+
class NullManifest
|
116
|
+
def append(*); end
|
117
|
+
def remove(*); end
|
118
|
+
def remove_digest(*); end
|
119
|
+
def each(*); end
|
120
|
+
def write; end
|
121
|
+
end
|
141
122
|
end
|