Permalink
Browse files

change markdown HTML mode

  • Loading branch information...
hunk committed Mar 16, 2010
1 parent 7ec36b7 commit 8a65dd84c8f8c4a22e4448c52f278e2bfac82ac7
Showing with 117 additions and 150 deletions.
  1. +0 −1 Main.php
  2. +2 −2 RCCWP_WritePostPage.php
  3. +2 −11 get-custom.php
  4. BIN js/markitup/sets/{markdown → html}/images/bold.png
  5. BIN js/markitup/sets/html/images/clean.png
  6. BIN js/markitup/sets/{markdown → html}/images/h1.png
  7. BIN js/markitup/sets/{markdown → html}/images/h2.png
  8. BIN js/markitup/sets/{markdown → html}/images/h3.png
  9. BIN js/markitup/sets/{markdown → html}/images/h4.png
  10. BIN js/markitup/sets/{markdown → html}/images/h5.png
  11. BIN js/markitup/sets/{markdown → html}/images/h6.png
  12. BIN js/markitup/sets/html/images/image.png
  13. BIN js/markitup/sets/{markdown → html}/images/italic.png
  14. BIN js/markitup/sets/{markdown → html}/images/link.png
  15. BIN js/markitup/sets/{markdown → html}/images/list-bullet.png
  16. BIN js/markitup/sets/html/images/list-item.png
  17. BIN js/markitup/sets/{markdown → html}/images/list-numeric.png
  18. BIN js/markitup/sets/html/images/paragraph.png
  19. BIN js/markitup/sets/{markdown → html}/images/picture.png
  20. BIN js/markitup/sets/{markdown → html}/images/preview.png
  21. BIN js/markitup/sets/html/images/stroke.png
  22. +11 −0 js/markitup/sets/html/readme.txt
  23. +42 −0 js/markitup/sets/html/set.js
  24. +59 −0 js/markitup/sets/html/style.css
  25. BIN js/markitup/sets/markdown/images/code.png
  26. BIN js/markitup/sets/markdown/images/line-break.png
  27. BIN js/markitup/sets/markdown/images/link-blue.png
  28. BIN js/markitup/sets/markdown/images/link-green.png
  29. BIN js/markitup/sets/markdown/images/quotes.png
  30. +0 −11 js/markitup/sets/markdown/readme.txt
  31. +0 −55 js/markitup/sets/markdown/set.js
  32. +0 −63 js/markitup/sets/markdown/style.css
  33. +1 −7 markdownPreview.php
View
@@ -55,7 +55,6 @@
require_once 'RCCWP_CustomWritePanel.php';
// Include files containing Magic Fields public functions
-require_once("markdown.php");
require_once 'get-custom.php';
// Include other files used in this script
View
@@ -63,7 +63,7 @@ function CustomFieldsCSS(){
type="text/css" media="screen" charset="utf-8"
/>
<link rel="stylesheet" type="text/css" href="<?php echo MF_URI; ?>js/markitup/skins/markitup/style.css" />
- <link rel="stylesheet" type="text/css" href="<?php echo MF_URI; ?>js/markitup/sets/markdown/style.css" />
+ <link rel="stylesheet" type="text/css" href="<?php echo MF_URI; ?>js/markitup/sets/html/style.css" />
<?php
}
@@ -141,7 +141,7 @@ function CustomFieldsJavascript(){
);
wp_enqueue_script('markitup_set_markdown',
- MF_URI.'js/markitup/sets/markdown/set.js',
+ MF_URI.'js/markitup/sets/html/set.js',
array('markitup')
);
View
@@ -64,11 +64,6 @@ function get ($fieldName, $groupIndex=1, $fieldIndex=1, $readyForEIP=true,$post_
$results = apply_filters('the_content', $results);
}
- // filter for markup
- if($fieldType == $FIELD_TYPES['markdown_textbox']){
- $results = apply_filters('markdown', $results);
- }
-
if($fieldType == $FIELD_TYPES['image']){
$results = split('&',$results);
$results = $results[0];
@@ -433,6 +428,7 @@ function get_group($name_group,$post_id=NULL){
case $FIELD_TYPES["color_picker"]:
case $FIELD_TYPES["slider"]:
case $FIELD_TYPES["related_type"]:
+ case $FIELD_TYPES['markdown_textbox']:
$info[$data->order_id][$data->field_name][$data->field_count] = $data->meta_value;
break;
case $FIELD_TYPES['multiline_textbox']:
@@ -463,9 +459,6 @@ function get_group($name_group,$post_id=NULL){
$fieldValue = GetProcessedFieldValue($data->meta_value, $data->type, $format);
$info[$data->order_id][$data->field_name][$data->field_count] = $fieldValue;
break;
- case $FIELD_TYPES['markdown_textbox']:
- $info[$data->order_id][$data->field_name][$data->field_count] = apply_filters('markdown', $data->meta_value);
- break;
}
}
return $info;
@@ -507,6 +500,7 @@ function get_field_duplicate($fieldName, $groupIndex=1,$post_id=NULL){
case $FIELD_TYPES["color_picker"]:
case $FIELD_TYPES["slider"]:
case $FIELD_TYPES["related_type"]:
+ case $FIELD_TYPES['markdown_textbox']:
$info[$data->field_count] = $data->meta_value;
break;
case $FIELD_TYPES['multiline_textbox']:
@@ -537,9 +531,6 @@ function get_field_duplicate($fieldName, $groupIndex=1,$post_id=NULL){
$fieldValue = GetProcessedFieldValue($data->meta_value, $data->type, $format);
$info[$data->field_count] = $fieldValue;
break;
- case $FIELD_TYPES['markdown_textbox']:
- $info[$data->field_count] = apply_filters('markdown', $data->meta_value);
- break;
}
}
return $info;
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,11 @@
+Markup language:
+Html
+
+Description:
+A basic Html markup set with Headings, Paragraph, Bold, Italic, Stroke through, Picture, Link, List, Clean button, Preview button.
+
+Install:
+- Download the zip file
+- Unzip it in your markItUp! sets folder
+- Modify your JS link to point at this set.js
+- Modify your CSS link to point at this style.css
@@ -0,0 +1,42 @@
+// ----------------------------------------------------------------------------
+// markItUp!
+// ----------------------------------------------------------------------------
+// Copyright (C) 2008 Jay Salvat
+// http://markitup.jaysalvat.com/
+// ----------------------------------------------------------------------------
+// Html tags
+// http://en.wikipedia.org/wiki/html
+// ----------------------------------------------------------------------------
+// Basic set. Feel free to add more tags
+// ----------------------------------------------------------------------------
+mySettings = {
+ previewParserPath: mf_path +'markdownPreview.php',
+ previewInWindow: 'width=800, height=600, resizable=yes, scrollbars=yes',
+ onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'},
+ onEnter: {keepDefault:true, replaceWith:'<br />\n'},
+ onCtrlEnter: {keepDefault:false, openWith:'\n<p>', closeWith:'</p>\n'},
+ onTab: {keepDefault:false, openWith:' '},
+ markupSet: [
+ {name:'Heading 1', key:'1', openWith:'<h1(!( class="[![Class]!]")!)>', closeWith:'</h1>', placeHolder:'Your title here...' },
+ {name:'Heading 2', key:'2', openWith:'<h2(!( class="[![Class]!]")!)>', closeWith:'</h2>', placeHolder:'Your title here...' },
+ {name:'Heading 3', key:'3', openWith:'<h3(!( class="[![Class]!]")!)>', closeWith:'</h3>', placeHolder:'Your title here...' },
+ {name:'Heading 4', key:'4', openWith:'<h4(!( class="[![Class]!]")!)>', closeWith:'</h4>', placeHolder:'Your title here...' },
+ {name:'Heading 5', key:'5', openWith:'<h5(!( class="[![Class]!]")!)>', closeWith:'</h5>', placeHolder:'Your title here...' },
+ {name:'Heading 6', key:'6', openWith:'<h6(!( class="[![Class]!]")!)>', closeWith:'</h6>', placeHolder:'Your title here...' },
+ {name:'Paragraph', openWith:'<p(!( class="[![Class]!]")!)>', closeWith:'</p>' },
+ {separator:'---------------' },
+ {name:'Bold', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
+ {name:'Italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
+ {name:'Stroke through', key:'S', openWith:'<del>', closeWith:'</del>' },
+ {separator:'---------------' },
+ {name:'Ul', openWith:'<ul>\n', closeWith:'</ul>\n' },
+ {name:'Ol', openWith:'<ol>\n', closeWith:'</ol>\n' },
+ {name:'Li', openWith:'<li>', closeWith:'</li>' },
+ {separator:'---------------' },
+ {name:'Picture', key:'P', replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' },
+ {name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
+ {separator:'---------------' },
+ {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
+ {name:'Preview', className:'preview', call:'preview' }
+ ]
+}
@@ -0,0 +1,59 @@
+/* -------------------------------------------------------------------
+// markItUp!
+// By Jay Salvat - http://markitup.jaysalvat.com/
+// ------------------------------------------------------------------*/
+.markItUp .markItUpButton1 a {
+ background-image:url(images/h1.png);
+}
+.markItUp .markItUpButton2 a {
+ background-image:url(images/h2.png);
+}
+.markItUp .markItUpButton3 a {
+ background-image:url(images/h3.png);
+}
+.markItUp .markItUpButton4 a {
+ background-image:url(images/h4.png);
+}
+.markItUp .markItUpButton5 a {
+ background-image:url(images/h5.png);
+}
+.markItUp .markItUpButton6 a {
+ background-image:url(images/h6.png);
+}
+.markItUp .markItUpButton7 a {
+ background-image:url(images/paragraph.png);
+}
+
+.markItUp .markItUpButton8 a {
+ background-image:url(images/bold.png);
+}
+.markItUp .markItUpButton9 a {
+ background-image:url(images/italic.png);
+}
+.markItUp .markItUpButton10 a {
+ background-image:url(images/stroke.png);
+}
+
+.markItUp .markItUpButton11 a {
+ background-image:url(images/list-bullet.png);
+}
+.markItUp .markItUpButton12 a {
+ background-image:url(images/list-numeric.png);
+}
+.markItUp .markItUpButton13 a {
+ background-image:url(images/list-item.png);
+}
+
+.markItUp .markItUpButton14 a {
+ background-image:url(images/picture.png);
+}
+.markItUp .markItUpButton15 a {
+ background-image:url(images/link.png);
+}
+
+.markItUp .clean a {
+ background-image:url(images/clean.png);
+}
+.markItUp .preview a {
+ background-image:url(images/preview.png);
+}
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
@@ -1,11 +0,0 @@
-Markup language:
-Markdown
-
-Description:
-A basic Markdown markup set with Headings, Bold, Italic, Picture, Link, List, Quotes, Code, Preview button.
-
-Install:
-- Download the zip file
-- Unzip it in your markItUp! sets folder
-- Modify your JS link to point at this set.js
-- Modify your CSS link to point at this style.css
@@ -1,55 +0,0 @@
-// -------------------------------------------------------------------
-// markItUp!
-// -------------------------------------------------------------------
-// Copyright (C) 2008 Jay Salvat
-// http://markitup.jaysalvat.com/
-// -------------------------------------------------------------------
-// MarkDown tags example
-// http://en.wikipedia.org/wiki/Markdown
-// http://daringfireball.net/projects/markdown/
-// -------------------------------------------------------------------
-// Feel free to add more tags
-// -------------------------------------------------------------------
-mySettings = {
- previewParserPath: mf_path +'markdownPreview.php',
- previewInWindow: 'width=800, height=600, resizable=yes, scrollbars=yes',
- onShiftEnter: {keepDefault:false, openWith:' \n'},
- onCtrlEnter: {keepDefault:false, openWith:'\n\n'},
- markupSet: [
- {className: 'markItUpButtonH1', name:'Heading 1', key:'1', openWith:'# ', placeHolder:'Your title here...' },
- {className: 'markItUpButtonH2', name:'Heading 2', key:'2', openWith:'## ', placeHolder:'Your title here...' },
- {className: 'markItUpButtonH3', name:'Heading 3', key:'3', openWith:'### ', placeHolder:'Your title here...' },
- {className: 'markItUpButtonH4', name:'Heading 4', key:'4', openWith:'#### ', placeHolder:'Your title here...' },
- {className: 'markItUpButtonH5', name:'Heading 5', key:'5', openWith:'##### ', placeHolder:'Your title here...' },
- {className: 'markItUpButtonH6', name:'Heading 6', key:'6', openWith:'###### ', placeHolder:'Your title here...' },
- {separator:'---------------' },
- {className: 'markItUpButtonBold', name:'Bold', key:'B', openWith:'**', closeWith:'**'},
- {className: 'markItUpButtonItalic', name:'Italic', key:'I', openWith:'_', closeWith:'_'},
- {separator:'---------------' },
- {className: 'markItUpButtonUL', name:'Bulleted List', openWith:'- ' },
- {className: 'markItUpButtonOL', name:'Numeric List', openWith:function(markItUp) {
- return markItUp.line+'. ';
- }},
- {separator:'---------------' },
- {className: 'markItUpButtonImage', name:'Picture', key:'P', replaceWith:'![[![Alternative text]!]]([![Url:!:http://]!] "[![Title]!]")'},
- {className: 'markItUpButtonLink', name:'Link', key:'L', openWith:'[', closeWith:']([![Url:!:http://]!] "[![Title]!]")', placeHolder:'Your text to link here...' },
- {separator:'---------------'},
- {className: 'markItUpButtonQuote', name:'Quotes', openWith:'> '},
- {className: 'markItUpButtonPreformatted', name:'Preformatted Block', openWith:'~~~~~~~~~~\n', closeWith:'\n~~~~~~~~~~\n'},
- {className: 'markItUpButtonCode', name:'Code Block / Code', openWith:'(!(\t|!|`)!)', closeWith:'(!(`)!)'},
- {separator:'---------------'},
- {name:'Preview', call:'preview', className:"preview"}
- ]
-}
-
-// mIu nameSpace to avoid conflict.
-miu = {
- markdownTitle: function(markItUp, char) {
- heading = '';
- n = $.trim(markItUp.selection||markItUp.placeHolder).length;
- for(i = 0; i < n; i++) {
- heading += char;
- }
- return '\n'+heading;
- }
-}
@@ -1,63 +0,0 @@
-/* -------------------------------------------------------------------
-// markItUp!
-// By Jay Salvat - http://markitup.jaysalvat.com/
-// ------------------------------------------------------------------*/
-.markItUp .markItUpButtonH1 a {
- background-image:url(images/h1.png);
-}
-.markItUp .markItUpButtonH2 a {
- background-image:url(images/h2.png);
-}
-.markItUp .markItUpButtonH3 a {
- background-image:url(images/h3.png);
-}
-.markItUp .markItUpButtonH4 a {
- background-image:url(images/h4.png);
-}
-.markItUp .markItUpButtonH5 a {
- background-image:url(images/h5.png);
-}
-.markItUp .markItUpButtonH6 a {
- background-image:url(images/h6.png);
-}
-.markItUp .markItUpButtonBold a {
- background-image:url(images/bold.png);
-}
-.markItUp .markItUpButtonItalic a {
- background-image:url(images/italic.png);
-}
-.markItUp .markItUpButtonUL a {
- background-image:url(images/list-bullet.png);
-}
-.markItUp .markItUpButtonOL a {
- background-image:url(images/list-numeric.png);
-}
-.markItUp .markItUpButtonImage a {
- background-image:url(images/picture.png);
-}
-.markItUp .markItUpButtonLink a {
- background-image:url(images/link.png);
-}
-.markItUp .markItUpButtonLinkBlue a {
- background-image:url(images/link-blue.png);
-}
-.markItUp .markItUpButtonLinkGreen a {
- background-image:url(images/link-green.png);
-}
-.markItUp .markItUpButtonQuote a {
- background-image:url(images/quotes.png);
-}
-.markItUp .markItUpButtonPreformatted a {
- background-image:url(images/code.png);
-}
-.markItUp .markItUpButtonCode a {
- background-image:url(images/code.png);
-}
-.markItUp .preview a {
- background-image:url(images/preview.png);
-}
-
-.markItUp .markItUpLineBreak a {
- background-image:url(images/line-break.png);
-}
-
View
@@ -1,18 +1,12 @@
<?php
-require_once(dirname(__FILE__)."/markdown.php");
-
$data = $_POST['data'];
if(get_magic_quotes_gpc())
{
$data = stripslashes($data);
}
-
-$parser_class = MARKDOWN_PARSER_CLASS;
-$parser = new $parser_class;
-$result = $parser->transform($data);
?>
<html>
<body>
- <?php print $result; ?>
+ <?php print $data; ?>
</body>
</html>

0 comments on commit 8a65dd8

Please sign in to comment.