contributions/javascript.wymeditor/start.inc.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * @defgroup WYMEditor 00004 * @ingroup JavaScript 00005 * 00006 * Include WYMEditor (http://www.wymeditor.org/) 00007 * 00008 * @section Usage 00009 * 00010 * On install, the module copies wymeditor files to the a folder named "js/wymeditor" below web root. The version 00011 * of WYMEditor installed is 0.5, but tidy and fullscreen plugin are taken from trunk. 00012 * 00013 * @see http://forum.wymeditor.org/forum/viewtopic.php?f=3&t=734 00014 * 00015 * WYMEditor files are not included by default. To enable WYMEditor on a page, place the 00016 * following code 00017 * 00018 * @code 00019 * Load::components('wymeditor'); 00020 * WYMEditor::enable($page_data); 00021 * @endcode 00022 * 00023 * This will turn all textareas with class "rte" into a WYMEditor instance. 00024 * 00025 * @note It is good practice to use "rte" as classname for rich text editors. 00026 * 00027 * @section Config Creating Configurations 00028 * 00029 * If the default configuration is not sufficent, you may create your own. This is 00030 * a two step process: 00031 * 00032 * - Create and name a config 00033 * - Refer to it by name when enabling editor 00034 * 00035 * First, create a config: 00036 * 00037 * @code 00038 * Load::components('wymeditor'); 00039 * $config WYMEditor::create_config('fancy'); 00040 * $config->init_file = 'js/fancy_wym.js'; // JS script to fire up editor 00041 * // Add tidy plugin 00042 * $config->plugins['js/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js'] = 'var wymtidy = wym.tidy();wymtidy.init();'; 00043 * @endcode 00044 * 00045 * You now can use the config anywhere: 00046 * 00047 * @code 00048 * WYMEditor::enable($page_data, 'fancy); 00049 * @endcode 00050 * 00051 * Note you don't need to change the init file, if you add or remove plugins. 00052 * 00053 * @section Notes Additional notes 00054 * 00055 * WYMEditor is released under GPL and MIT license. 00056 * 00057 */ 00058 00059 EventSource::Instance()->register(new JavascriptWYMEditorEventSink());