iaddict-bcms_fckeditor 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.txt +165 -0
- data/README.markdown +34 -0
- data/lib/bcms_fckeditor.rb +2 -0
- data/lib/bcms_fckeditor/engine.rb +12 -0
- data/lib/bcms_fckeditor/routes.rb +7 -0
- data/lib/bcms_fckeditor/section_controller_extensions.rb +88 -0
- data/lib/generators/bcms_fckeditor/install/USAGE +10 -0
- data/lib/generators/bcms_fckeditor/install/install_generator.rb +18 -0
- data/lib/generators/bcms_fckeditor/install/templates/fckstyles.xml +111 -0
- data/public/bcms/fckeditor/README +1 -0
- data/public/bcms/fckeditor/editor.js +56 -0
- data/public/bcms/fckeditor/editor/css/behaviors/disablehandles.htc +15 -0
- data/public/bcms/fckeditor/editor/css/behaviors/showtableborders.htc +36 -0
- data/public/bcms/fckeditor/editor/css/fck_editorarea.css +110 -0
- data/public/bcms/fckeditor/editor/css/fck_internal.css +199 -0
- data/public/bcms/fckeditor/editor/css/fck_showtableborders_gecko.css +49 -0
- data/public/bcms/fckeditor/editor/css/images/block_address.png +0 -0
- data/public/bcms/fckeditor/editor/css/images/block_blockquote.png +0 -0
- data/public/bcms/fckeditor/editor/css/images/block_div.png +0 -0
- data/public/bcms/fckeditor/editor/css/images/block_h1.png +0 -0
- data/public/bcms/fckeditor/editor/css/images/block_h2.png +0 -0
- data/public/bcms/fckeditor/editor/css/images/block_h3.png +0 -0
- data/public/bcms/fckeditor/editor/css/images/block_h4.png +0 -0
- data/public/bcms/fckeditor/editor/css/images/block_h5.png +0 -0
- data/public/bcms/fckeditor/editor/css/images/block_h6.png +0 -0
- data/public/bcms/fckeditor/editor/css/images/block_p.png +0 -0
- data/public/bcms/fckeditor/editor/css/images/block_pre.png +0 -0
- data/public/bcms/fckeditor/editor/css/images/fck_anchor.gif +0 -0
- data/public/bcms/fckeditor/editor/css/images/fck_flashlogo.gif +0 -0
- data/public/bcms/fckeditor/editor/css/images/fck_hiddenfield.gif +0 -0
- data/public/bcms/fckeditor/editor/css/images/fck_pagebreak.gif +0 -0
- data/public/bcms/fckeditor/editor/css/images/fck_plugin.gif +0 -0
- data/public/bcms/fckeditor/editor/dialog/common/fck_dialog_common.css +85 -0
- data/public/bcms/fckeditor/editor/dialog/common/fck_dialog_common.js +311 -0
- data/public/bcms/fckeditor/editor/dialog/common/images/locked.gif +0 -0
- data/public/bcms/fckeditor/editor/dialog/common/images/reset.gif +0 -0
- data/public/bcms/fckeditor/editor/dialog/common/images/unlocked.gif +0 -0
- data/public/bcms/fckeditor/editor/dialog/fck_about.html +161 -0
- data/public/bcms/fckeditor/editor/dialog/fck_about/logo_fckeditor.gif +0 -0
- data/public/bcms/fckeditor/editor/dialog/fck_about/logo_fredck.gif +0 -0
- data/public/bcms/fckeditor/editor/dialog/fck_about/sponsors/spellchecker_net.gif +0 -0
- data/public/bcms/fckeditor/editor/dialog/fck_anchor.html +220 -0
- data/public/bcms/fckeditor/editor/dialog/fck_button.html +104 -0
- data/public/bcms/fckeditor/editor/dialog/fck_checkbox.html +104 -0
- data/public/bcms/fckeditor/editor/dialog/fck_colorselector.html +172 -0
- data/public/bcms/fckeditor/editor/dialog/fck_div.html +364 -0
- data/public/bcms/fckeditor/editor/dialog/fck_docprops.html +600 -0
- data/public/bcms/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html +113 -0
- data/public/bcms/fckeditor/editor/dialog/fck_flash.html +152 -0
- data/public/bcms/fckeditor/editor/dialog/fck_flash/fck_flash.js +300 -0
- data/public/bcms/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html +50 -0
- data/public/bcms/fckeditor/editor/dialog/fck_form.html +109 -0
- data/public/bcms/fckeditor/editor/dialog/fck_hiddenfield.html +115 -0
- data/public/bcms/fckeditor/editor/dialog/fck_image.html +258 -0
- data/public/bcms/fckeditor/editor/dialog/fck_image/fck_image.js +512 -0
- data/public/bcms/fckeditor/editor/dialog/fck_image/fck_image_preview.html +72 -0
- data/public/bcms/fckeditor/editor/dialog/fck_link.html +295 -0
- data/public/bcms/fckeditor/editor/dialog/fck_link/fck_link.js +893 -0
- data/public/bcms/fckeditor/editor/dialog/fck_listprop.html +120 -0
- data/public/bcms/fckeditor/editor/dialog/fck_paste.html +346 -0
- data/public/bcms/fckeditor/editor/dialog/fck_radiobutton.html +104 -0
- data/public/bcms/fckeditor/editor/dialog/fck_replace.html +648 -0
- data/public/bcms/fckeditor/editor/dialog/fck_select.html +180 -0
- data/public/bcms/fckeditor/editor/dialog/fck_select/fck_select.js +194 -0
- data/public/bcms/fckeditor/editor/dialog/fck_smiley.html +111 -0
- data/public/bcms/fckeditor/editor/dialog/fck_source.html +68 -0
- data/public/bcms/fckeditor/editor/dialog/fck_specialchar.html +121 -0
- data/public/bcms/fckeditor/editor/dialog/fck_spellerpages.html +70 -0
- data/public/bcms/fckeditor/editor/dialog/fck_spellerpages/spellerpages/blank.html +0 -0
- data/public/bcms/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js +87 -0
- data/public/bcms/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html +153 -0
- data/public/bcms/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm +148 -0
- data/public/bcms/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php +199 -0
- data/public/bcms/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl +181 -0
- data/public/bcms/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js +461 -0
- data/public/bcms/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html +71 -0
- data/public/bcms/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css +49 -0
- data/public/bcms/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js +272 -0
- data/public/bcms/fckeditor/editor/dialog/fck_table.html +298 -0
- data/public/bcms/fckeditor/editor/dialog/fck_tablecell.html +257 -0
- data/public/bcms/fckeditor/editor/dialog/fck_template.html +242 -0
- data/public/bcms/fckeditor/editor/dialog/fck_template/images/template1.gif +0 -0
- data/public/bcms/fckeditor/editor/dialog/fck_template/images/template2.gif +0 -0
- data/public/bcms/fckeditor/editor/dialog/fck_template/images/template3.gif +0 -0
- data/public/bcms/fckeditor/editor/dialog/fck_textarea.html +94 -0
- data/public/bcms/fckeditor/editor/dialog/fck_textfield.html +136 -0
- data/public/bcms/fckeditor/editor/dtd/fck_dtd_test.html +41 -0
- data/public/bcms/fckeditor/editor/dtd/fck_xhtml10strict.js +116 -0
- data/public/bcms/fckeditor/editor/dtd/fck_xhtml10transitional.js +140 -0
- data/public/bcms/fckeditor/editor/fckdebug.html +153 -0
- data/public/bcms/fckeditor/editor/fckdialog.html +812 -0
- data/public/bcms/fckeditor/editor/fckeditor.html +317 -0
- data/public/bcms/fckeditor/editor/fckeditor.original.html +424 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/browser.css +87 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/browser.html +200 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/frmactualfolder.html +95 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html +114 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/frmfolders.html +198 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/frmresourceslist.html +169 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/frmresourcetype.html +68 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/frmupload.html +115 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/ButtonArrow.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/Folder.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/Folder32.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/FolderOpened.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/FolderOpened32.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/FolderUp.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/ai.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/avi.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/bmp.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/cs.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/default.icon.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/dll.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/doc.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/exe.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/fla.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/gif.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/htm.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/html.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/jpg.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/js.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/mdb.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/mp3.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/pdf.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/png.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/ppt.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/rdp.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/swf.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/swt.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/txt.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/vsd.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/xls.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/xml.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/32/zip.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/ai.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/avi.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/bmp.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/cs.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/default.icon.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/dll.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/doc.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/exe.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/fla.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/gif.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/htm.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/html.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/jpg.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/js.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/mdb.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/mp3.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/pdf.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/png.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/ppt.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/rdp.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/swf.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/swt.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/txt.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/vsd.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/xls.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/xml.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/icons/zip.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/images/spacer.gif +0 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/js/common.js +88 -0
- data/public/bcms/fckeditor/editor/filemanager/browser/default/js/fckxml.js +147 -0
- data/public/bcms/fckeditor/editor/images/anchor.gif +0 -0
- data/public/bcms/fckeditor/editor/images/arrow_ltr.gif +0 -0
- data/public/bcms/fckeditor/editor/images/arrow_rtl.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/angel_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/angry_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/broken_heart.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/cake.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/confused_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/cry_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/devil_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/embaressed_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/envelope.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/heart.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/kiss.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/lightbulb.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/omg_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/regular_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/sad_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/shades_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/teeth_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/thumbs_down.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/thumbs_up.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/tounge_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/whatchutalkingabout_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/smiley/msn/wink_smile.gif +0 -0
- data/public/bcms/fckeditor/editor/images/spacer.gif +0 -0
- data/public/bcms/fckeditor/editor/js/fckadobeair.js +176 -0
- data/public/bcms/fckeditor/editor/js/fckeditorcode_gecko.js +108 -0
- data/public/bcms/fckeditor/editor/js/fckeditorcode_ie.js +109 -0
- data/public/bcms/fckeditor/editor/lang/_translationstatus.txt +78 -0
- data/public/bcms/fckeditor/editor/lang/af.js +526 -0
- data/public/bcms/fckeditor/editor/lang/ar.js +526 -0
- data/public/bcms/fckeditor/editor/lang/bg.js +526 -0
- data/public/bcms/fckeditor/editor/lang/bn.js +526 -0
- data/public/bcms/fckeditor/editor/lang/bs.js +526 -0
- data/public/bcms/fckeditor/editor/lang/ca.js +526 -0
- data/public/bcms/fckeditor/editor/lang/cs.js +526 -0
- data/public/bcms/fckeditor/editor/lang/da.js +526 -0
- data/public/bcms/fckeditor/editor/lang/de.js +526 -0
- data/public/bcms/fckeditor/editor/lang/el.js +526 -0
- data/public/bcms/fckeditor/editor/lang/en-au.js +526 -0
- data/public/bcms/fckeditor/editor/lang/en-ca.js +526 -0
- data/public/bcms/fckeditor/editor/lang/en-uk.js +526 -0
- data/public/bcms/fckeditor/editor/lang/en.js +526 -0
- data/public/bcms/fckeditor/editor/lang/eo.js +526 -0
- data/public/bcms/fckeditor/editor/lang/es.js +526 -0
- data/public/bcms/fckeditor/editor/lang/et.js +526 -0
- data/public/bcms/fckeditor/editor/lang/eu.js +527 -0
- data/public/bcms/fckeditor/editor/lang/fa.js +526 -0
- data/public/bcms/fckeditor/editor/lang/fi.js +526 -0
- data/public/bcms/fckeditor/editor/lang/fo.js +526 -0
- data/public/bcms/fckeditor/editor/lang/fr-ca.js +526 -0
- data/public/bcms/fckeditor/editor/lang/fr.js +526 -0
- data/public/bcms/fckeditor/editor/lang/gl.js +526 -0
- data/public/bcms/fckeditor/editor/lang/gu.js +526 -0
- data/public/bcms/fckeditor/editor/lang/he.js +526 -0
- data/public/bcms/fckeditor/editor/lang/hi.js +526 -0
- data/public/bcms/fckeditor/editor/lang/hr.js +526 -0
- data/public/bcms/fckeditor/editor/lang/hu.js +526 -0
- data/public/bcms/fckeditor/editor/lang/it.js +526 -0
- data/public/bcms/fckeditor/editor/lang/ja.js +526 -0
- data/public/bcms/fckeditor/editor/lang/km.js +526 -0
- data/public/bcms/fckeditor/editor/lang/ko.js +526 -0
- data/public/bcms/fckeditor/editor/lang/lt.js +526 -0
- data/public/bcms/fckeditor/editor/lang/lv.js +526 -0
- data/public/bcms/fckeditor/editor/lang/mn.js +526 -0
- data/public/bcms/fckeditor/editor/lang/ms.js +526 -0
- data/public/bcms/fckeditor/editor/lang/nb.js +526 -0
- data/public/bcms/fckeditor/editor/lang/nl.js +526 -0
- data/public/bcms/fckeditor/editor/lang/no.js +526 -0
- data/public/bcms/fckeditor/editor/lang/pl.js +526 -0
- data/public/bcms/fckeditor/editor/lang/pt-br.js +526 -0
- data/public/bcms/fckeditor/editor/lang/pt.js +526 -0
- data/public/bcms/fckeditor/editor/lang/ro.js +526 -0
- data/public/bcms/fckeditor/editor/lang/ru.js +526 -0
- data/public/bcms/fckeditor/editor/lang/sk.js +526 -0
- data/public/bcms/fckeditor/editor/lang/sl.js +526 -0
- data/public/bcms/fckeditor/editor/lang/sr-latn.js +526 -0
- data/public/bcms/fckeditor/editor/lang/sr.js +526 -0
- data/public/bcms/fckeditor/editor/lang/sv.js +526 -0
- data/public/bcms/fckeditor/editor/lang/th.js +526 -0
- data/public/bcms/fckeditor/editor/lang/tr.js +526 -0
- data/public/bcms/fckeditor/editor/lang/uk.js +526 -0
- data/public/bcms/fckeditor/editor/lang/vi.js +526 -0
- data/public/bcms/fckeditor/editor/lang/zh-cn.js +526 -0
- data/public/bcms/fckeditor/editor/lang/zh.js +526 -0
- data/public/bcms/fckeditor/editor/plugins/autogrow/fckplugin.js +99 -0
- data/public/bcms/fckeditor/editor/plugins/bbcode/_sample/sample.config.js +26 -0
- data/public/bcms/fckeditor/editor/plugins/bbcode/_sample/sample.html +67 -0
- data/public/bcms/fckeditor/editor/plugins/bbcode/fckplugin.js +123 -0
- data/public/bcms/fckeditor/editor/plugins/dragresizetable/fckplugin.js +524 -0
- data/public/bcms/fckeditor/editor/plugins/placeholder/fck_placeholder.html +105 -0
- data/public/bcms/fckeditor/editor/plugins/placeholder/fckplugin.js +187 -0
- data/public/bcms/fckeditor/editor/plugins/placeholder/lang/de.js +27 -0
- data/public/bcms/fckeditor/editor/plugins/placeholder/lang/en.js +27 -0
- data/public/bcms/fckeditor/editor/plugins/placeholder/lang/es.js +27 -0
- data/public/bcms/fckeditor/editor/plugins/placeholder/lang/fr.js +27 -0
- data/public/bcms/fckeditor/editor/plugins/placeholder/lang/it.js +27 -0
- data/public/bcms/fckeditor/editor/plugins/placeholder/lang/pl.js +27 -0
- data/public/bcms/fckeditor/editor/plugins/placeholder/placeholder.gif +0 -0
- data/public/bcms/fckeditor/editor/plugins/simplecommands/fckplugin.js +29 -0
- data/public/bcms/fckeditor/editor/plugins/tablecommands/fckplugin.js +33 -0
- data/public/bcms/fckeditor/editor/skins/_fckviewstrips.html +121 -0
- data/public/bcms/fckeditor/editor/skins/default/fck_dialog.css +402 -0
- data/public/bcms/fckeditor/editor/skins/default/fck_dialog_ie6.js +110 -0
- data/public/bcms/fckeditor/editor/skins/default/fck_editor.css +464 -0
- data/public/bcms/fckeditor/editor/skins/default/fck_strip.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/default/images/dialog.sides.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/default/images/dialog.sides.png +0 -0
- data/public/bcms/fckeditor/editor/skins/default/images/dialog.sides.rtl.png +0 -0
- data/public/bcms/fckeditor/editor/skins/default/images/sprites.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/default/images/sprites.png +0 -0
- data/public/bcms/fckeditor/editor/skins/default/images/toolbar.arrowright.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/default/images/toolbar.buttonarrow.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/default/images/toolbar.collapse.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/default/images/toolbar.end.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/default/images/toolbar.expand.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/default/images/toolbar.separator.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/default/images/toolbar.start.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/fck_dialog.css +402 -0
- data/public/bcms/fckeditor/editor/skins/office2003/fck_dialog_ie6.js +110 -0
- data/public/bcms/fckeditor/editor/skins/office2003/fck_editor.css +476 -0
- data/public/bcms/fckeditor/editor/skins/office2003/fck_strip.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/images/dialog.sides.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/images/dialog.sides.png +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/images/dialog.sides.rtl.png +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/images/sprites.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/images/sprites.png +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/images/toolbar.arrowright.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/images/toolbar.bg.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/images/toolbar.buttonarrow.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/images/toolbar.collapse.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/images/toolbar.end.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/images/toolbar.expand.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/images/toolbar.separator.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/office2003/images/toolbar.start.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/fck_dialog.css +402 -0
- data/public/bcms/fckeditor/editor/skins/silver/fck_dialog_ie6.js +110 -0
- data/public/bcms/fckeditor/editor/skins/silver/fck_editor.css +473 -0
- data/public/bcms/fckeditor/editor/skins/silver/fck_strip.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/images/dialog.sides.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/images/dialog.sides.png +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/images/dialog.sides.rtl.png +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/images/sprites.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/images/sprites.png +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/images/toolbar.arrowright.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/images/toolbar.buttonarrow.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/images/toolbar.buttonbg.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/images/toolbar.collapse.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/images/toolbar.end.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/images/toolbar.expand.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/images/toolbar.separator.gif +0 -0
- data/public/bcms/fckeditor/editor/skins/silver/images/toolbar.start.gif +0 -0
- data/public/bcms/fckeditor/fckconfig.js +359 -0
- data/public/bcms/fckeditor/fckdebug.html +153 -0
- data/public/bcms/fckeditor/fckdialog.html +812 -0
- data/public/bcms/fckeditor/fckeditor.html +317 -0
- data/public/bcms/fckeditor/fckeditor.js +328 -0
- data/public/bcms/fckeditor/fckeditor.original.html +424 -0
- data/public/bcms/fckeditor/fckpackager.xml +262 -0
- data/public/bcms/fckeditor/fcktemplates.xml +103 -0
- data/public/bcms_config/fckeditor/fckstyles.xml +111 -0
- metadata +455 -0
@@ -0,0 +1,148 @@
|
|
1
|
+
<cfsetting enablecfoutputonly="true">
|
2
|
+
<!---
|
3
|
+
This code uses a CF User Defined Function and should work in CF version 5.0
|
4
|
+
and up without alteration.
|
5
|
+
|
6
|
+
Also if you are hosting your site at an ISP, you will have to check with them
|
7
|
+
to see if the use of <CFEXECUTE> is allowed. In most cases ISP will not allow
|
8
|
+
the use of that tag for security reasons. Clients would be able to access each
|
9
|
+
others files in certain cases.
|
10
|
+
--->
|
11
|
+
|
12
|
+
<!--- The following variables values must reflect your installation. --->
|
13
|
+
<cfset aspell_dir = "C:\Program Files\Aspell\bin">
|
14
|
+
<cfset lang = "en_US">
|
15
|
+
<cfset aspell_opts = "-a --lang=#lang# --encoding=utf-8 -H --rem-sgml-check=alt">
|
16
|
+
<cfset tempfile_in = GetTempFile(GetTempDirectory(), "spell_")>
|
17
|
+
<cfset tempfile_out = GetTempFile(GetTempDirectory(), "spell_")>
|
18
|
+
<cfset spellercss = "../spellerStyle.css">
|
19
|
+
<cfset word_win_src = "../wordWindow.js">
|
20
|
+
|
21
|
+
<cfset form.checktext = form["textinputs[]"]>
|
22
|
+
|
23
|
+
<!--- make no difference between URL and FORM scopes --->
|
24
|
+
<cfparam name="url.checktext" default="">
|
25
|
+
<cfparam name="form.checktext" default="#url.checktext#">
|
26
|
+
|
27
|
+
<!--- Takes care of those pesky smart quotes from MS apps, replaces them with regular quotes --->
|
28
|
+
<cfset submitted_text = ReplaceList(form.checktext,"%u201C,%u201D","%22,%22")>
|
29
|
+
|
30
|
+
<!--- submitted_text now is ready for processing --->
|
31
|
+
|
32
|
+
<!--- use carat on each line to escape possible aspell commands --->
|
33
|
+
<cfset text = "">
|
34
|
+
<cfset CRLF = Chr(13) & Chr(10)>
|
35
|
+
|
36
|
+
<cfloop list="#submitted_text#" index="field" delimiters=",">
|
37
|
+
<cfset text = text & "%" & CRLF
|
38
|
+
& "^A" & CRLF
|
39
|
+
& "!" & CRLF>
|
40
|
+
<!--- Strip all tags for the text. (by FredCK - #339 / #681) --->
|
41
|
+
<cfset field = REReplace(URLDecode(field), "<[^>]+>", " ", "all")>
|
42
|
+
<cfloop list="#field#" index="line" delimiters="#CRLF#">
|
43
|
+
<cfset text = ListAppend(text, "^" & Trim(JSStringFormat(line)), CRLF)>
|
44
|
+
</cfloop>
|
45
|
+
</cfloop>
|
46
|
+
|
47
|
+
<!--- create temp file from the submitted text, this will be passed to aspell to be check for misspelled words --->
|
48
|
+
<cffile action="write" file="#tempfile_in#" output="#text#" charset="utf-8">
|
49
|
+
|
50
|
+
<!--- execute aspell in an UTF-8 console and redirect output to a file. UTF-8 encoding is lost if done differently --->
|
51
|
+
<cfexecute name="cmd.exe" arguments='/c type "#tempfile_in#" | "#aspell_dir#\aspell.exe" #aspell_opts# > "#tempfile_out#"' timeout="100"/>
|
52
|
+
|
53
|
+
<!--- read output file for further processing --->
|
54
|
+
<cffile action="read" file="#tempfile_out#" variable="food" charset="utf-8">
|
55
|
+
|
56
|
+
<!--- remove temp files --->
|
57
|
+
<cffile action="delete" file="#tempfile_in#">
|
58
|
+
<cffile action="delete" file="#tempfile_out#">
|
59
|
+
|
60
|
+
<cfset texts = StructNew()>
|
61
|
+
<cfset texts.textinputs = "">
|
62
|
+
<cfset texts.words = "">
|
63
|
+
<cfset texts.abort = "">
|
64
|
+
|
65
|
+
<!--- Generate Text Inputs --->
|
66
|
+
<cfset i = 0>
|
67
|
+
<cfloop list="#submitted_text#" index="textinput">
|
68
|
+
<cfset texts.textinputs = ListAppend(texts.textinputs, 'textinputs[#i#] = decodeURIComponent("#textinput#");', CRLF)>
|
69
|
+
<cfset i = i + 1>
|
70
|
+
</cfloop>
|
71
|
+
|
72
|
+
<!--- Generate Words Lists --->
|
73
|
+
<cfset word_cnt = 0>
|
74
|
+
<cfset input_cnt = -1>
|
75
|
+
<cfloop list="#food#" index="aspell_line" delimiters="#CRLF#">
|
76
|
+
<cfset leftChar = Left(aspell_line, 1)>
|
77
|
+
<cfif leftChar eq "*">
|
78
|
+
<cfset input_cnt = input_cnt + 1>
|
79
|
+
<cfset word_cnt = 0>
|
80
|
+
<cfset texts.words = ListAppend(texts.words, "words[#input_cnt#] = [];", CRLF)>
|
81
|
+
<cfset texts.words = ListAppend(texts.words, "suggs[#input_cnt#] = [];", CRLF)>
|
82
|
+
<cfelse>
|
83
|
+
<cfif leftChar eq "&" or leftChar eq "##">
|
84
|
+
<!--- word that misspelled --->
|
85
|
+
<cfset bad_word = Trim(ListGetAt(aspell_line, 2, " "))>
|
86
|
+
<cfset bad_word = Replace(bad_word, "'", "\'", "ALL")>
|
87
|
+
<!--- sugestions --->
|
88
|
+
<cfset sug_list = Trim(ListRest(aspell_line, ":"))>
|
89
|
+
<cfset sug_list = ListQualify(Replace(sug_list, "'", "\'", "ALL"), "'")>
|
90
|
+
<!--- javascript --->
|
91
|
+
<cfset texts.words = ListAppend(texts.words, "words[#input_cnt#][#word_cnt#] = '#bad_word#';", CRLF)>
|
92
|
+
<cfset texts.words = ListAppend(texts.words, "suggs[#input_cnt#][#word_cnt#] = [#sug_list#];", CRLF)>
|
93
|
+
<cfset word_cnt = word_cnt + 1>
|
94
|
+
</cfif>
|
95
|
+
</cfif>
|
96
|
+
</cfloop>
|
97
|
+
|
98
|
+
<cfif texts.words eq "">
|
99
|
+
<cfset texts.abort = "alert('Spell check complete.\n\nNo misspellings found.'); top.window.close();">
|
100
|
+
</cfif>
|
101
|
+
|
102
|
+
<cfcontent type="text/html; charset=utf-8">
|
103
|
+
|
104
|
+
<cfoutput><html>
|
105
|
+
<head>
|
106
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
107
|
+
<link rel="stylesheet" type="text/css" href="#spellercss#" />
|
108
|
+
<script language="javascript" src="#word_win_src#"></script>
|
109
|
+
<script language="javascript">
|
110
|
+
var suggs = new Array();
|
111
|
+
var words = new Array();
|
112
|
+
var textinputs = new Array();
|
113
|
+
var error;
|
114
|
+
|
115
|
+
#texts.textinputs##CRLF#
|
116
|
+
#texts.words#
|
117
|
+
#texts.abort#
|
118
|
+
|
119
|
+
var wordWindowObj = new wordWindow();
|
120
|
+
wordWindowObj.originalSpellings = words;
|
121
|
+
wordWindowObj.suggestions = suggs;
|
122
|
+
wordWindowObj.textInputs = textinputs;
|
123
|
+
|
124
|
+
function init_spell() {
|
125
|
+
// check if any error occured during server-side processing
|
126
|
+
if( error ) {
|
127
|
+
alert( error );
|
128
|
+
} else {
|
129
|
+
// call the init_spell() function in the parent frameset
|
130
|
+
if (parent.frames.length) {
|
131
|
+
parent.init_spell( wordWindowObj );
|
132
|
+
} else {
|
133
|
+
alert('This page was loaded outside of a frameset. It might not display properly');
|
134
|
+
}
|
135
|
+
}
|
136
|
+
}
|
137
|
+
</script>
|
138
|
+
|
139
|
+
</head>
|
140
|
+
<body onLoad="init_spell();">
|
141
|
+
|
142
|
+
<script type="text/javascript">
|
143
|
+
wordWindowObj.writeBody();
|
144
|
+
</script>
|
145
|
+
|
146
|
+
</body>
|
147
|
+
</html></cfoutput>
|
148
|
+
<cfsetting enablecfoutputonly="false">
|
@@ -0,0 +1,199 @@
|
|
1
|
+
<?php
|
2
|
+
header('Content-type: text/html; charset=utf-8');
|
3
|
+
|
4
|
+
// The following variables values must reflect your installation needs.
|
5
|
+
|
6
|
+
$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows)
|
7
|
+
//$aspell_prog = 'aspell'; // by FredCK (for Linux)
|
8
|
+
|
9
|
+
$lang = 'en_US';
|
10
|
+
$aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; // by FredCK
|
11
|
+
|
12
|
+
$tempfiledir = "./";
|
13
|
+
|
14
|
+
$spellercss = '../spellerStyle.css'; // by FredCK
|
15
|
+
$word_win_src = '../wordWindow.js'; // by FredCK
|
16
|
+
|
17
|
+
$textinputs = $_POST['textinputs']; # array
|
18
|
+
$input_separator = "A";
|
19
|
+
|
20
|
+
# set the JavaScript variable to the submitted text.
|
21
|
+
# textinputs is an array, each element corresponding to the (url-encoded)
|
22
|
+
# value of the text control submitted for spell-checking
|
23
|
+
function print_textinputs_var() {
|
24
|
+
global $textinputs;
|
25
|
+
foreach( $textinputs as $key=>$val ) {
|
26
|
+
# $val = str_replace( "'", "%27", $val );
|
27
|
+
echo "textinputs[$key] = decodeURIComponent(\"" . $val . "\");\n";
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
# make declarations for the text input index
|
32
|
+
function print_textindex_decl( $text_input_idx ) {
|
33
|
+
echo "words[$text_input_idx] = [];\n";
|
34
|
+
echo "suggs[$text_input_idx] = [];\n";
|
35
|
+
}
|
36
|
+
|
37
|
+
# set an element of the JavaScript 'words' array to a misspelled word
|
38
|
+
function print_words_elem( $word, $index, $text_input_idx ) {
|
39
|
+
echo "words[$text_input_idx][$index] = '" . escape_quote( $word ) . "';\n";
|
40
|
+
}
|
41
|
+
|
42
|
+
|
43
|
+
# set an element of the JavaScript 'suggs' array to a list of suggestions
|
44
|
+
function print_suggs_elem( $suggs, $index, $text_input_idx ) {
|
45
|
+
echo "suggs[$text_input_idx][$index] = [";
|
46
|
+
foreach( $suggs as $key=>$val ) {
|
47
|
+
if( $val ) {
|
48
|
+
echo "'" . escape_quote( $val ) . "'";
|
49
|
+
if ( $key+1 < count( $suggs )) {
|
50
|
+
echo ", ";
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
echo "];\n";
|
55
|
+
}
|
56
|
+
|
57
|
+
# escape single quote
|
58
|
+
function escape_quote( $str ) {
|
59
|
+
return preg_replace ( "/'/", "\\'", $str );
|
60
|
+
}
|
61
|
+
|
62
|
+
|
63
|
+
# handle a server-side error.
|
64
|
+
function error_handler( $err ) {
|
65
|
+
echo "error = '" . preg_replace( "/['\\\\]/", "\\\\$0", $err ) . "';\n";
|
66
|
+
}
|
67
|
+
|
68
|
+
## get the list of misspelled words. Put the results in the javascript words array
|
69
|
+
## for each misspelled word, get suggestions and put in the javascript suggs array
|
70
|
+
function print_checker_results() {
|
71
|
+
|
72
|
+
global $aspell_prog;
|
73
|
+
global $aspell_opts;
|
74
|
+
global $tempfiledir;
|
75
|
+
global $textinputs;
|
76
|
+
global $input_separator;
|
77
|
+
$aspell_err = "";
|
78
|
+
# create temp file
|
79
|
+
$tempfile = tempnam( $tempfiledir, 'aspell_data_' );
|
80
|
+
|
81
|
+
# open temp file, add the submitted text.
|
82
|
+
if( $fh = fopen( $tempfile, 'w' )) {
|
83
|
+
for( $i = 0; $i < count( $textinputs ); $i++ ) {
|
84
|
+
$text = urldecode( $textinputs[$i] );
|
85
|
+
|
86
|
+
// Strip all tags for the text. (by FredCK - #339 / #681)
|
87
|
+
$text = preg_replace( "/<[^>]+>/", " ", $text ) ;
|
88
|
+
|
89
|
+
$lines = explode( "\n", $text );
|
90
|
+
fwrite ( $fh, "%\n" ); # exit terse mode
|
91
|
+
fwrite ( $fh, "^$input_separator\n" );
|
92
|
+
fwrite ( $fh, "!\n" ); # enter terse mode
|
93
|
+
foreach( $lines as $key=>$value ) {
|
94
|
+
# use carat on each line to escape possible aspell commands
|
95
|
+
fwrite( $fh, "^$value\n" );
|
96
|
+
}
|
97
|
+
}
|
98
|
+
fclose( $fh );
|
99
|
+
|
100
|
+
# exec aspell command - redirect STDERR to STDOUT
|
101
|
+
$cmd = "$aspell_prog $aspell_opts < $tempfile 2>&1";
|
102
|
+
if( $aspellret = shell_exec( $cmd )) {
|
103
|
+
$linesout = explode( "\n", $aspellret );
|
104
|
+
$index = 0;
|
105
|
+
$text_input_index = -1;
|
106
|
+
# parse each line of aspell return
|
107
|
+
foreach( $linesout as $key=>$val ) {
|
108
|
+
$chardesc = substr( $val, 0, 1 );
|
109
|
+
# if '&', then not in dictionary but has suggestions
|
110
|
+
# if '#', then not in dictionary and no suggestions
|
111
|
+
# if '*', then it is a delimiter between text inputs
|
112
|
+
# if '@' then version info
|
113
|
+
if( $chardesc == '&' || $chardesc == '#' ) {
|
114
|
+
$line = explode( " ", $val, 5 );
|
115
|
+
print_words_elem( $line[1], $index, $text_input_index );
|
116
|
+
if( isset( $line[4] )) {
|
117
|
+
$suggs = explode( ", ", $line[4] );
|
118
|
+
} else {
|
119
|
+
$suggs = array();
|
120
|
+
}
|
121
|
+
print_suggs_elem( $suggs, $index, $text_input_index );
|
122
|
+
$index++;
|
123
|
+
} elseif( $chardesc == '*' ) {
|
124
|
+
$text_input_index++;
|
125
|
+
print_textindex_decl( $text_input_index );
|
126
|
+
$index = 0;
|
127
|
+
} elseif( $chardesc != '@' && $chardesc != "" ) {
|
128
|
+
# assume this is error output
|
129
|
+
$aspell_err .= $val;
|
130
|
+
}
|
131
|
+
}
|
132
|
+
if( $aspell_err ) {
|
133
|
+
$aspell_err = "Error executing `$cmd`\\n$aspell_err";
|
134
|
+
error_handler( $aspell_err );
|
135
|
+
}
|
136
|
+
} else {
|
137
|
+
error_handler( "System error: Aspell program execution failed (`$cmd`)" );
|
138
|
+
}
|
139
|
+
} else {
|
140
|
+
error_handler( "System error: Could not open file '$tempfile' for writing" );
|
141
|
+
}
|
142
|
+
|
143
|
+
# close temp file, delete file
|
144
|
+
unlink( $tempfile );
|
145
|
+
}
|
146
|
+
|
147
|
+
|
148
|
+
?>
|
149
|
+
<html>
|
150
|
+
<head>
|
151
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
152
|
+
<link rel="stylesheet" type="text/css" href="<?php echo $spellercss ?>" />
|
153
|
+
<script language="javascript" src="<?php echo $word_win_src ?>"></script>
|
154
|
+
<script language="javascript">
|
155
|
+
var suggs = new Array();
|
156
|
+
var words = new Array();
|
157
|
+
var textinputs = new Array();
|
158
|
+
var error;
|
159
|
+
<?php
|
160
|
+
|
161
|
+
print_textinputs_var();
|
162
|
+
|
163
|
+
print_checker_results();
|
164
|
+
|
165
|
+
?>
|
166
|
+
|
167
|
+
var wordWindowObj = new wordWindow();
|
168
|
+
wordWindowObj.originalSpellings = words;
|
169
|
+
wordWindowObj.suggestions = suggs;
|
170
|
+
wordWindowObj.textInputs = textinputs;
|
171
|
+
|
172
|
+
function init_spell() {
|
173
|
+
// check if any error occured during server-side processing
|
174
|
+
if( error ) {
|
175
|
+
alert( error );
|
176
|
+
} else {
|
177
|
+
// call the init_spell() function in the parent frameset
|
178
|
+
if (parent.frames.length) {
|
179
|
+
parent.init_spell( wordWindowObj );
|
180
|
+
} else {
|
181
|
+
alert('This page was loaded outside of a frameset. It might not display properly');
|
182
|
+
}
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
</script>
|
189
|
+
|
190
|
+
</head>
|
191
|
+
<!-- <body onLoad="init_spell();"> by FredCK -->
|
192
|
+
<body onLoad="init_spell();" bgcolor="#ffffff">
|
193
|
+
|
194
|
+
<script type="text/javascript">
|
195
|
+
wordWindowObj.writeBody();
|
196
|
+
</script>
|
197
|
+
|
198
|
+
</body>
|
199
|
+
</html>
|
@@ -0,0 +1,181 @@
|
|
1
|
+
#!/usr/bin/perl
|
2
|
+
|
3
|
+
use CGI qw/ :standard /;
|
4
|
+
use File::Temp qw/ tempfile tempdir /;
|
5
|
+
|
6
|
+
# my $spellercss = '/speller/spellerStyle.css'; # by FredCK
|
7
|
+
my $spellercss = '../spellerStyle.css'; # by FredCK
|
8
|
+
# my $wordWindowSrc = '/speller/wordWindow.js'; # by FredCK
|
9
|
+
my $wordWindowSrc = '../wordWindow.js'; # by FredCK
|
10
|
+
my @textinputs = param( 'textinputs[]' ); # array
|
11
|
+
# my $aspell_cmd = 'aspell'; # by FredCK (for Linux)
|
12
|
+
my $aspell_cmd = '"C:\Program Files\Aspell\bin\aspell.exe"'; # by FredCK (for Windows)
|
13
|
+
my $lang = 'en_US';
|
14
|
+
# my $aspell_opts = "-a --lang=$lang --encoding=utf-8"; # by FredCK
|
15
|
+
my $aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; # by FredCK
|
16
|
+
my $input_separator = "A";
|
17
|
+
|
18
|
+
# set the 'wordtext' JavaScript variable to the submitted text.
|
19
|
+
sub printTextVar {
|
20
|
+
for( my $i = 0; $i <= $#textinputs; $i++ ) {
|
21
|
+
print "textinputs[$i] = decodeURIComponent('" . escapeQuote( $textinputs[$i] ) . "')\n";
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
sub printTextIdxDecl {
|
26
|
+
my $idx = shift;
|
27
|
+
print "words[$idx] = [];\n";
|
28
|
+
print "suggs[$idx] = [];\n";
|
29
|
+
}
|
30
|
+
|
31
|
+
sub printWordsElem {
|
32
|
+
my( $textIdx, $wordIdx, $word ) = @_;
|
33
|
+
print "words[$textIdx][$wordIdx] = '" . escapeQuote( $word ) . "';\n";
|
34
|
+
}
|
35
|
+
|
36
|
+
sub printSuggsElem {
|
37
|
+
my( $textIdx, $wordIdx, @suggs ) = @_;
|
38
|
+
print "suggs[$textIdx][$wordIdx] = [";
|
39
|
+
for my $i ( 0..$#suggs ) {
|
40
|
+
print "'" . escapeQuote( $suggs[$i] ) . "'";
|
41
|
+
if( $i < $#suggs ) {
|
42
|
+
print ", ";
|
43
|
+
}
|
44
|
+
}
|
45
|
+
print "];\n";
|
46
|
+
}
|
47
|
+
|
48
|
+
sub printCheckerResults {
|
49
|
+
my $textInputIdx = -1;
|
50
|
+
my $wordIdx = 0;
|
51
|
+
my $unhandledText;
|
52
|
+
# create temp file
|
53
|
+
my $dir = tempdir( CLEANUP => 1 );
|
54
|
+
my( $fh, $tmpfilename ) = tempfile( DIR => $dir );
|
55
|
+
|
56
|
+
# temp file was created properly?
|
57
|
+
|
58
|
+
# open temp file, add the submitted text.
|
59
|
+
for( my $i = 0; $i <= $#textinputs; $i++ ) {
|
60
|
+
$text = url_decode( $textinputs[$i] );
|
61
|
+
# Strip all tags for the text. (by FredCK - #339 / #681)
|
62
|
+
$text =~ s/<[^>]+>/ /g;
|
63
|
+
@lines = split( /\n/, $text );
|
64
|
+
print $fh "\%\n"; # exit terse mode
|
65
|
+
print $fh "^$input_separator\n";
|
66
|
+
print $fh "!\n"; # enter terse mode
|
67
|
+
for my $line ( @lines ) {
|
68
|
+
# use carat on each line to escape possible aspell commands
|
69
|
+
print $fh "^$line\n";
|
70
|
+
}
|
71
|
+
|
72
|
+
}
|
73
|
+
# exec aspell command
|
74
|
+
my $cmd = "$aspell_cmd $aspell_opts < $tmpfilename 2>&1";
|
75
|
+
open ASPELL, "$cmd |" or handleError( "Could not execute `$cmd`\\n$!" ) and return;
|
76
|
+
# parse each line of aspell return
|
77
|
+
for my $ret ( <ASPELL> ) {
|
78
|
+
chomp( $ret );
|
79
|
+
# if '&', then not in dictionary but has suggestions
|
80
|
+
# if '#', then not in dictionary and no suggestions
|
81
|
+
# if '*', then it is a delimiter between text inputs
|
82
|
+
if( $ret =~ /^\*/ ) {
|
83
|
+
$textInputIdx++;
|
84
|
+
printTextIdxDecl( $textInputIdx );
|
85
|
+
$wordIdx = 0;
|
86
|
+
|
87
|
+
} elsif( $ret =~ /^(&|#)/ ) {
|
88
|
+
my @tokens = split( " ", $ret, 5 );
|
89
|
+
printWordsElem( $textInputIdx, $wordIdx, $tokens[1] );
|
90
|
+
my @suggs = ();
|
91
|
+
if( $tokens[4] ) {
|
92
|
+
@suggs = split( ", ", $tokens[4] );
|
93
|
+
}
|
94
|
+
printSuggsElem( $textInputIdx, $wordIdx, @suggs );
|
95
|
+
$wordIdx++;
|
96
|
+
} else {
|
97
|
+
$unhandledText .= $ret;
|
98
|
+
}
|
99
|
+
}
|
100
|
+
close ASPELL or handleError( "Error executing `$cmd`\\n$unhandledText" ) and return;
|
101
|
+
}
|
102
|
+
|
103
|
+
sub escapeQuote {
|
104
|
+
my $str = shift;
|
105
|
+
$str =~ s/'/\\'/g;
|
106
|
+
return $str;
|
107
|
+
}
|
108
|
+
|
109
|
+
sub handleError {
|
110
|
+
my $err = shift;
|
111
|
+
print "error = '" . escapeQuote( $err ) . "';\n";
|
112
|
+
}
|
113
|
+
|
114
|
+
sub url_decode {
|
115
|
+
local $_ = @_ ? shift : $_;
|
116
|
+
defined or return;
|
117
|
+
# change + signs to spaces
|
118
|
+
tr/+/ /;
|
119
|
+
# change hex escapes to the proper characters
|
120
|
+
s/%([a-fA-F0-9]{2})/pack "H2", $1/eg;
|
121
|
+
return $_;
|
122
|
+
}
|
123
|
+
|
124
|
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
125
|
+
# Display HTML
|
126
|
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
127
|
+
|
128
|
+
print <<EOF;
|
129
|
+
Content-type: text/html; charset=utf-8
|
130
|
+
|
131
|
+
<html>
|
132
|
+
<head>
|
133
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
134
|
+
<link rel="stylesheet" type="text/css" href="$spellercss"/>
|
135
|
+
<script src="$wordWindowSrc"></script>
|
136
|
+
<script type="text/javascript">
|
137
|
+
var suggs = new Array();
|
138
|
+
var words = new Array();
|
139
|
+
var textinputs = new Array();
|
140
|
+
var error;
|
141
|
+
EOF
|
142
|
+
|
143
|
+
printTextVar();
|
144
|
+
|
145
|
+
printCheckerResults();
|
146
|
+
|
147
|
+
print <<EOF;
|
148
|
+
var wordWindowObj = new wordWindow();
|
149
|
+
wordWindowObj.originalSpellings = words;
|
150
|
+
wordWindowObj.suggestions = suggs;
|
151
|
+
wordWindowObj.textInputs = textinputs;
|
152
|
+
|
153
|
+
|
154
|
+
function init_spell() {
|
155
|
+
// check if any error occured during server-side processing
|
156
|
+
if( error ) {
|
157
|
+
alert( error );
|
158
|
+
} else {
|
159
|
+
// call the init_spell() function in the parent frameset
|
160
|
+
if (parent.frames.length) {
|
161
|
+
parent.init_spell( wordWindowObj );
|
162
|
+
} else {
|
163
|
+
error = "This page was loaded outside of a frameset. ";
|
164
|
+
error += "It might not display properly";
|
165
|
+
alert( error );
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}
|
169
|
+
|
170
|
+
</script>
|
171
|
+
|
172
|
+
</head>
|
173
|
+
<body onLoad="init_spell();">
|
174
|
+
|
175
|
+
<script type="text/javascript">
|
176
|
+
wordWindowObj.writeBody();
|
177
|
+
</script>
|
178
|
+
|
179
|
+
</body>
|
180
|
+
</html>
|
181
|
+
EOF
|