Index: .cvsignore
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/.cvsignore,v
retrieving revision 1.6
diff -u -p -r1.6 .cvsignore
--- .cvsignore	8 Dec 2008 18:58:09 -0000	1.6
+++ .cvsignore	29 Dec 2008 23:17:41 -0000
@@ -4,3 +4,4 @@ jwysiwyg*
 nicedit*
 whizzywig*
 yui*
+markitup*
Index: editors/markitup.inc
===================================================================
RCS file: editors/markitup.inc
diff -N editors/markitup.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ editors/markitup.inc	30 Dec 2008 02:24:33 -0000
@@ -0,0 +1,129 @@
+<?php
+// $Id: markitup.inc,v 1.4 2008/12/05 15:35:23 sun Exp $
+
+
+/**
+ * Plugin implementation of hook_editor().
+ */
+function wysiwyg_markitup_editor() {
+  $editor = array();
+  $editor['markitup'] = array(
+    'title' => '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('jquery.markitup.js'),
+      ),
+      'pack' => array(
+        'title' => 'Packed',
+        'files' => array('jquery.markitup.pack.js'),
+      ),
+    ),
+    'version callback' => 'wysiwyg_markitup_version',
+    'settings callback' => 'wysiwyg_markitup_settings',
+    'plugin callback' => 'wysiwyg_markitup_plugins',
+    'versions' => array(
+      '1.1.4' => array(
+        'js files' => array('markitup.js'),
+      ),
+    ),
+    'css files' => array('markitup-1.css'),
+  );
+  return $editor;
+}
+
+/**
+ * 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 = wysiwyg_get_path('markitup') . '/readme.txt';
+  $changelog = fopen($changelog, 'r');
+  $line = fgets($changelog);
+  if (preg_match('@([0-9\.]+)@', $line, $version)) {
+    fclose($changelog);
+    return $version[1];
+  }
+  fclose($changelog);
+}
+
+/**
+ * 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) {
+  // Whoever is guilty for adding this horrible CSS-file-without-filepath
+  // override "feature" to Drupal core... stand in the corner!
+  drupal_add_css($editor['library path'] .'/skins/markitup/style.css', 'theme');
+  
+  $settings = array(
+    'root' => wysiwyg_get_path('markitup', TRUE) . '/',
+    'nameSpace' => $theme,
+    'markupSet' => array(),
+  );
+
+  // Add configured buttons or all available.
+  $default_buttons = array(
+    'bold' => array('name' => t('Bold'), 'className' => 'markitup-bold', 'key' => 'B', 'openWith' => '(!(<strong>|!|<b>)!)', 'closeWith' => '(!(</strong>|!|</b>)!)'),
+    'italic' => array('name' => t('Italic'), 'className' => 'markitup-italic', 'key' => 'I', 'openWith' => '(!(<em>|!|<i>)!)', 'closeWith' => '(!(</em>|!|</i>)!)'),
+    'stroke' => array('name' => t('Strike-through'), 'className' => 'markitup-stroke', 'key' => 'S', 'openWith' => '<del>', 'closeWith' => '</del>'),
+    'image' => array('name' => t('Image'), 'className' => 'markitup-image', 'key' => 'P', 'replaceWith' => '<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />'),
+    'link' => array('name' => t('Link'), 'className' => 'markitup-link', 'key' => 'K', 'openWith' => '<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', 'closeWith' => '</a>', 'placeHolder' => 'Your text to link...'),
+    // @todo
+    // 'cleanup' => array('name' => t('Clean-up'), 'className' => 'markitup-cleanup', 'replaceWith' => 'function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") }'),
+    'preview' => array('name' => t('Preview'), 'className' => 'markitup-preview', 'call' => 'preview'),
+  );
+      
+  if (!empty($config['buttons'])) {
+    foreach ($config['buttons'] as $plugin) {
+      foreach ($plugin as $button => $enabled) {
+        if (isset($default_buttons[$button])) {
+          $settings['markupSet'][] = $default_buttons[$button];
+        }
+      }
+    }
+  }
+  else {
+    $settings['markupSet'] = $default_buttons;
+  }
+
+  return $settings;
+}
+
+/**
+ * Return internal plugins for this editor; semi-implementation of hook_wysiwyg_plugin().
+ */
+function wysiwyg_markitup_plugins($editor) {
+  return array(
+    'default' => array(
+      'buttons' => array(
+        'bold' => t('Bold'), 'italic' => t('Italic'),
+        'stroke' => t('Strike-through'),
+        'image' => t('Image'),
+        'link' => t('Link'),
+        'cleanup' => t('Clean-up'),
+        'preview' => t('Preview'),
+      ),
+      'internal' => TRUE,
+    ),
+  );
+}
+
Index: editors/css/markitup-1.css
===================================================================
RCS file: editors/css/markitup-1.css
diff -N editors/css/markitup-1.css
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ editors/css/markitup-1.css	30 Dec 2008 00:46:12 -0000
@@ -0,0 +1,26 @@
+/* $Id: markitup.css,v 1.3 2008/10/29 00:35:11 sun Exp $ */
+
+/**
+ * markItUp
+ */
+.markItUp .markitup-bold a {
+  background-image: url(../../markitup/sets/default/images/bold.png);
+}
+.markItUp .markitup-italic a {
+  background-image: url(../../markitup/sets/default/images/italic.png);
+}
+.markItUp .markitup-stroke a {
+  background-image: url(../../markitup/sets/default/images/stroke.png);
+}
+.markItUp .markitup-image a {
+  background-image: url(../../markitup/sets/default/images/picture.png);
+}
+.markItUp .markitup-link a {
+  background-image: url(../../markitup/sets/default/images/link.png);
+}
+.markItUp .markitup-cleanup a {
+  background-image: url(../../markitup/sets/default/images/clean.png);
+}
+.markItUp .markitup-preview a {
+  background-image: url(../../markitup/sets/default/images/preview.png);
+}
Index: editors/js/markitup.js
===================================================================
RCS file: editors/js/markitup.js
diff -N editors/js/markitup.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ editors/js/markitup.js	30 Dec 2008 01:33:35 -0000
@@ -0,0 +1,23 @@
+// $Id: markitup.js,v 1.3 2008/12/01 14:14:41 sun Exp $
+
+/**
+ * Attach this editor to a target element.
+ */
+Drupal.wysiwyg.editor.attach.markitup = function(context, params, settings) {
+  $('#' + params.field, context).markItUp(settings);
+};
+
+/**
+ * Detach a single or all editors.
+ *
+ * See Drupal.wysiwyg.editor.detach.none() for a full desciption of this hook.
+ */
+Drupal.wysiwyg.editor.detach.markitup = function(context, params) {
+  if (typeof params != 'undefined') {
+    $('#' + params.field, context).markItUpRemove();
+  }
+  else {
+    $('.markItUpEditor', context).markItUpRemove();
+  }
+};
+
