'markItUp', 'vendor url' => 'http://markitup.jaysalvat.com', 'download url' => 'http://markitup.jaysalvat.com/downloads', 'library path' => wysiwyg_get_path('markitup'), 'libraries' => array( '' => array( 'title' => 'Source', 'files' => array('markitup/jquery.markitup.js'), ), 'pack' => array( 'title' => 'Packed', 'files' => array('markitup/jquery.markitup.pack.js'), ), ), 'install note callback' => 'wysiwyg_markitup_install_note', 'verified version range' => array('1.1.5', '1.1.14'), 'version callback' => 'wysiwyg_markitup_version', 'themes callback' => 'wysiwyg_markitup_themes', 'settings form callback' => 'wysiwyg_markitup_settings_form', 'settings callback' => 'wysiwyg_markitup_settings', 'plugin callback' => '_wysiwyg_markitup_plugins', 'versions' => array( '1.1.5' => array( 'js files' => array('markitup.js'), ), ), ); return $editor; } /** * Return an install note. */ function wysiwyg_markitup_install_note() { return '
' . t('Only rename the extracted folder from "latest" to "markitup", no other changes needed.') . '
'; } /** * Detect editor version. * * @param $editor * An array containing editor properties as returned from hook_editor(). * * @return * The installed editor version. */ function wysiwyg_markitup_version($editor) { // Changelog was in markitup/markitup/readme.txt <= 1.1.5. $changelog = $editor['library path'] . '/markitup/readme.txt'; if (!file_exists($changelog)) { // Changelog was moved up to markitup/CHANGELOG.md after 1.1.5. $changelog = $editor['library path'] . '/CHANGELOG.md'; if (!file_exists($changelog)) { return; } } $changelog = fopen($changelog, 'r'); $line = fgets($changelog); if (preg_match('@([0-9\.]+)@', $line, $version)) { fclose($changelog); return $version[1]; } fclose($changelog); } /** * Determine available editor themes or check/reset a given one. * * @param $editor * A processed hook_editor() array of editor properties. * @param $profile * A wysiwyg editor profile. * * @return * An array of theme names. The first returned name should be the default * theme name. */ function wysiwyg_markitup_themes($editor, $profile) { return array('simple', 'markitup'); } /** * Enhances the editor profile settings form for markItUp. */ function wysiwyg_markitup_settings_form(&$form, &$form_state) { $form['basic']['language']['#access'] = FALSE; $form['css']['#access'] = FALSE; } /** * Return runtime editor settings for a given wysiwyg profile. * * @param $editor * A processed hook_editor() array of editor properties. * @param $config * An array containing wysiwyg editor profile settings. * @param $theme * The name of a theme/GUI/skin to use. * * @return * A settings array to be populated in * Drupal.settings.wysiwyg.configs.{editor} */ function wysiwyg_markitup_settings($editor, $config, $theme) { drupal_add_css($editor['library path'] . '/markitup/skins/' . $theme . '/style.css', array( // Specify an alternate basename; otherwise, style.css would override a // commonly used style.css file of the theme. 'basename' => 'markitup.' . $theme . '.style.css', 'group' => CSS_THEME, )); $settings = array( 'root' => base_path() . $editor['library path'] . '/markitup/', 'nameSpace' => $theme, 'markupSet' => array(), ); // Add configured buttons or all available. $default_buttons = array( 'bold' => array( 'name' => t('Bold'), 'className' => 'markitup-bold', 'key' => 'B', 'openWith' => '(!(|!|)!)', 'closeWith' => '(!(|!|)!)', ), 'italic' => array( 'name' => t('Italic'), 'className' => 'markitup-italic', 'key' => 'I', 'openWith' => '(!(|!|)!)', 'closeWith' => '(!(|!|)!)', ), 'stroke' => array( 'name' => t('Strike-through'), 'className' => 'markitup-stroke', 'key' => 'S', 'openWith' => '