markitup_rails3 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. data/.gitignore +3 -0
  2. data/README.md +89 -0
  3. data/lib/markitup_rails3.rb +9 -0
  4. data/lib/markitup_rails3/engine.rb +6 -0
  5. data/lib/markitup_rails3/railtie.rb +6 -0
  6. data/lib/markitup_rails3/version.rb +5 -0
  7. data/markitup_rails3.gemspec +21 -0
  8. data/vendor/assets/images/markitup/bg-container.png +0 -0
  9. data/vendor/assets/images/markitup/bg-editor-bbcode.png +0 -0
  10. data/vendor/assets/images/markitup/bg-editor-dotclear.png +0 -0
  11. data/vendor/assets/images/markitup/bg-editor-html.png +0 -0
  12. data/vendor/assets/images/markitup/bg-editor-json.png +0 -0
  13. data/vendor/assets/images/markitup/bg-editor-markdown.png +0 -0
  14. data/vendor/assets/images/markitup/bg-editor-textile.png +0 -0
  15. data/vendor/assets/images/markitup/bg-editor-wiki.png +0 -0
  16. data/vendor/assets/images/markitup/bg-editor-xml.png +0 -0
  17. data/vendor/assets/images/markitup/bg-editor.png +0 -0
  18. data/vendor/assets/images/markitup/bold.png +0 -0
  19. data/vendor/assets/images/markitup/clean.png +0 -0
  20. data/vendor/assets/images/markitup/code.png +0 -0
  21. data/vendor/assets/images/markitup/css.png +0 -0
  22. data/vendor/assets/images/markitup/disconnect.png +0 -0
  23. data/vendor/assets/images/markitup/h1.png +0 -0
  24. data/vendor/assets/images/markitup/h2.png +0 -0
  25. data/vendor/assets/images/markitup/h3.png +0 -0
  26. data/vendor/assets/images/markitup/h4.png +0 -0
  27. data/vendor/assets/images/markitup/h5.png +0 -0
  28. data/vendor/assets/images/markitup/h6.png +0 -0
  29. data/vendor/assets/images/markitup/handle.png +0 -0
  30. data/vendor/assets/images/markitup/image.png +0 -0
  31. data/vendor/assets/images/markitup/italic.png +0 -0
  32. data/vendor/assets/images/markitup/link.png +0 -0
  33. data/vendor/assets/images/markitup/list-bullet.png +0 -0
  34. data/vendor/assets/images/markitup/list-item.png +0 -0
  35. data/vendor/assets/images/markitup/list-numeric.png +0 -0
  36. data/vendor/assets/images/markitup/menu.png +0 -0
  37. data/vendor/assets/images/markitup/page_white_code.png +0 -0
  38. data/vendor/assets/images/markitup/paragraph.png +0 -0
  39. data/vendor/assets/images/markitup/picture.png +0 -0
  40. data/vendor/assets/images/markitup/preview.png +0 -0
  41. data/vendor/assets/images/markitup/quotes.png +0 -0
  42. data/vendor/assets/images/markitup/stroke.png +0 -0
  43. data/vendor/assets/images/markitup/submenu.png +0 -0
  44. data/vendor/assets/images/markitup/tag.png +0 -0
  45. data/vendor/assets/images/markitup/text_align_center.png +0 -0
  46. data/vendor/assets/images/markitup/text_align_justify.png +0 -0
  47. data/vendor/assets/images/markitup/text_align_left.png +0 -0
  48. data/vendor/assets/images/markitup/text_align_right.png +0 -0
  49. data/vendor/assets/images/markitup/text_indent.png +0 -0
  50. data/vendor/assets/images/markitup/text_letterspacing.png +0 -0
  51. data/vendor/assets/images/markitup/text_linespacing.png +0 -0
  52. data/vendor/assets/images/markitup/text_lowercase.png +0 -0
  53. data/vendor/assets/images/markitup/text_padding_bottom.png +0 -0
  54. data/vendor/assets/images/markitup/text_padding_left.png +0 -0
  55. data/vendor/assets/images/markitup/text_padding_right.png +0 -0
  56. data/vendor/assets/images/markitup/text_padding_top.png +0 -0
  57. data/vendor/assets/images/markitup/text_uppercase.png +0 -0
  58. data/vendor/assets/images/markitup/url.png +0 -0
  59. data/vendor/assets/javascripts/markitup-css.js +52 -0
  60. data/vendor/assets/javascripts/markitup-html.js +39 -0
  61. data/vendor/assets/javascripts/markitup-markdown.js +52 -0
  62. data/vendor/assets/javascripts/markitup-textile.js +40 -0
  63. data/vendor/assets/javascripts/markitup.js +596 -0
  64. data/vendor/assets/javascripts/marmarkitup-texy.js +51 -0
  65. data/vendor/assets/javascripts/marmarkitup-wiki.js +37 -0
  66. data/vendor/assets/stylesheets/markitup-css.css.erb +72 -0
  67. data/vendor/assets/stylesheets/markitup-html.css.erb +59 -0
  68. data/vendor/assets/stylesheets/markitup-markdown.css.erb +54 -0
  69. data/vendor/assets/stylesheets/markitup-textile.css.erb +61 -0
  70. data/vendor/assets/stylesheets/markitup.css.erb +184 -0
  71. data/vendor/assets/stylesheets/marmarkitup-texy.css.erb +51 -0
  72. data/vendor/assets/stylesheets/marmarkitup-wiki.css.erb +57 -0
  73. metadata +156 -0
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ .DS_Store
2
+ *.gem
3
+ *.idea
data/README.md ADDED
@@ -0,0 +1,89 @@
1
+ markitup_rails3
2
+ ========================
3
+
4
+ ## MonkMartinez version
5
+
6
+ * built in showdown.js support for markdown
7
+ * bootstrap-ish style changes
8
+ * published to rubygems due to appfog not bundle installing from git
9
+
10
+ ========================
11
+
12
+ This is a gem that contains the vendor assets for [markitup](http://markitup.jaysalvat.com/home/).
13
+
14
+ ## Support
15
+
16
+ Should support rails 3.0 and higher.
17
+
18
+ ### Supported markup languages:
19
+
20
+ * `html`
21
+ * `textile`
22
+ * `markdown`
23
+ * `wiki`
24
+ * `texty`
25
+ * `css`
26
+
27
+ ## Usage
28
+
29
+ ### Installing the Gem
30
+
31
+ Require `markitup-rails` in your `Gemfile`.
32
+
33
+ require 'markitup-rails'
34
+
35
+ Install the gem via `bundle` command.
36
+
37
+
38
+ ### Using it in your application
39
+
40
+ Add to `application.css`
41
+
42
+ *= require markitup
43
+ *= require markitup-[markup lang]
44
+
45
+ Example
46
+
47
+ *= require markitup
48
+ *= require markitup-textile
49
+
50
+ And in `application.js`
51
+
52
+ //= require markitup
53
+ //= require markitup-[markup lang]
54
+
55
+ Example
56
+
57
+ //= require markitup
58
+ //= require markitup-textile
59
+
60
+
61
+ ### Using markitup
62
+
63
+ Include in either `application.js` or another file that will be included in the pipelin:
64
+
65
+ // To target all text areas
66
+ $(document).ready(function() {
67
+ $("textarea").markItUp(mySettings);
68
+ });
69
+
70
+ //----- OR
71
+
72
+ // To target a specific ID
73
+ $(document).ready(function() {
74
+ $("textarea#my_id").markItUp(mySettings);
75
+ });
76
+
77
+ //----- OR
78
+
79
+ // To target a specific class
80
+ $(document).ready(function() {
81
+ $("textarea.markitup").markItUp(mySettings);
82
+ });
83
+
84
+
85
+ See the [markitup documentation](http://markitup.jaysalvat.com/documentation/) for more info.
86
+
87
+ ----
88
+
89
+ *Based on the [blueprint-rails gem](https://github.com/bai/blueprint-rails)*
@@ -0,0 +1,9 @@
1
+ module Blueprint
2
+ module Rails
3
+ if ::Rails.version < "3.1"
4
+ require 'markitup_rails3/railtie'
5
+ else
6
+ require 'markitup_rails3/engine'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ module Markitup
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Markitup
2
+ module Rails
3
+ class Railtie < ::Rails::Railtie
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Markitup
2
+ module Rails
3
+ VERSION = "0.2.4"
4
+ end
5
+ end
@@ -0,0 +1,21 @@
1
+ require './lib/markitup_rails3/version'
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'markitup_rails3'
5
+ s.version = Markitup::Rails::VERSION
6
+ s.date = '2012-06-21'
7
+ s.summary = "MarkItUp for rails3."
8
+ s.description = "Markitup with Bootstrap styling for rails3."
9
+ s.authors = ["Michael Martinez"]
10
+ s.email = ['machinedesigner@gmail.com']
11
+ s.files = ["lib/markitup_rails3.rb"]
12
+ s.homepage =
13
+ 'https://github.com/MichaelMartinez/markitup_rails3'
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.platform = Gem::Platform::RUBY
17
+ s.require_path = 'lib'
18
+ s.add_dependency "railties", "~> 3.0"
19
+ s.add_development_dependency "bundler", "~> 1.0.0"
20
+ s.add_development_dependency "rails", "~> 3.0"
21
+ end
@@ -0,0 +1,52 @@
1
+ // ----------------------------------------------------------------------------
2
+ // markItUp!
3
+ // ----------------------------------------------------------------------------
4
+ // Copyright (C) 2008 Jay Salvat
5
+ // http://markitup.jaysalvat.com/
6
+ // ----------------------------------------------------------------------------
7
+ // CSS set by Kevin Papst
8
+ // http://www.kevinpapst.de/
9
+ // Initially written for the BIGACE CMS:
10
+ // http://www.bigace.de/
11
+ // ----------------------------------------------------------------------------
12
+ // Basic CSS set. Feel free to add more tags
13
+ // ----------------------------------------------------------------------------
14
+ mySettings = {
15
+ onEnter: {},
16
+ onShiftEnter: {keepDefault:false, placeHolder:'Your comment here', openWith:'\n\/* ', closeWith:' *\/'},
17
+ onCtrlEnter: {keepDefault:false, placeHolder:"classname", openWith:'\n.', closeWith:' { \n'},
18
+ onTab: {keepDefault:false, openWith:' '},
19
+ markupSet: [
20
+ {name:'Class', className:'class', key:'N', placeHolder:'Properties here...', openWith:'.[![Class name]!] {\n', closeWith:'\n}'},
21
+ {separator:'---------------' },
22
+ {name:'Bold', className:'bold', key:'B', replaceWith:'font-weight:bold;'},
23
+ {name:'Italic', className:'italic', key:'I', replaceWith:'font-style:italic;'},
24
+ {name:'Stroke through', className:'stroke', key:'S', replaceWith:'text-decoration:line-through;'},
25
+ {separator:'---------------' },
26
+ {name:'Lowercase', className:'lowercase', key:'L', replaceWith:'text-transform:lowercase;'},
27
+ {name:'Uppercase', className:'uppercase', key:'U', replaceWith:'text-transform:uppercase;'},
28
+ {separator:'---------------' },
29
+ {name:'Text indent', className:'indent', openWith:'text-indent:', placeHolder:'5px', closeWith:';' },
30
+ {name:'Letter spacing', className:'letterspacing', openWith:'letter-spacing:', placeHolder:'5px', closeWith:';' },
31
+ {name:'Line height', className:'lineheight', openWith:'line-height:', placeHolder:'1.5', closeWith:';' },
32
+ {separator:'---------------' },
33
+ {name:'Alignments', className:'alignments', dropMenu:[
34
+ {name:'Left', className:'left', replaceWith:'text-align:left;'},
35
+ {name:'Center', className:'center', replaceWith:'text-align:center;'},
36
+ {name:'Right', className:'right', replaceWith:'text-align:right;'},
37
+ {name:'Justify', className:'justify', replaceWith:'text-align:justify;'}
38
+ ]
39
+ },
40
+ {name:'Padding/Margin', className:'padding', dropMenu:[
41
+ {name:'Top', className:'top', openWith:'(!(padding|!|margin)!)-top:', placeHolder:'5px', closeWith:';' },
42
+ {name:'Left', className:'left', openWith:'(!(padding|!|margin)!)-left:', placeHolder:'5px', closeWith:';' },
43
+ {name:'Right', className:'right', openWith:'(!(padding|!|margin)!)-right:', placeHolder:'5px', closeWith:';' },
44
+ {name:'Bottom', className:'bottom', openWith:'(!(padding|!|margin)!)-bottom:', placeHolder:'5px', closeWith:';' }
45
+ ]
46
+ },
47
+ {separator:'---------------' },
48
+ {name:'Background Image', className:'background', replaceWith:'background:url([![Source:!:http://]!]) no-repeat 0 0;' },
49
+ {separator:'---------------' },
50
+ {name:'Import CSS file', className:'css', replaceWith:'@import "[![Source file:!:.css]!]";' }
51
+ ]
52
+ }
@@ -0,0 +1,39 @@
1
+ // ----------------------------------------------------------------------------
2
+ // markItUp!
3
+ // ----------------------------------------------------------------------------
4
+ // Copyright (C) 2008 Jay Salvat
5
+ // http://markitup.jaysalvat.com/
6
+ // ----------------------------------------------------------------------------
7
+ // Html tags
8
+ // http://en.wikipedia.org/wiki/html
9
+ // ----------------------------------------------------------------------------
10
+ // Basic set. Feel free to add more tags
11
+ // ----------------------------------------------------------------------------
12
+ mySettings = {
13
+ onShiftEnter: {keepDefault:false, replaceWith:'<br />\n'},
14
+ onCtrlEnter: {keepDefault:false, openWith:'\n<p>', closeWith:'</p>\n'},
15
+ onTab: {keepDefault:false, openWith:' '},
16
+ markupSet: [
17
+ {name:'Heading 1', key:'1', openWith:'<h1(!( class="[![Class]!]")!)>', closeWith:'</h1>', placeHolder:'Your title here...' },
18
+ {name:'Heading 2', key:'2', openWith:'<h2(!( class="[![Class]!]")!)>', closeWith:'</h2>', placeHolder:'Your title here...' },
19
+ {name:'Heading 3', key:'3', openWith:'<h3(!( class="[![Class]!]")!)>', closeWith:'</h3>', placeHolder:'Your title here...' },
20
+ {name:'Heading 4', key:'4', openWith:'<h4(!( class="[![Class]!]")!)>', closeWith:'</h4>', placeHolder:'Your title here...' },
21
+ {name:'Heading 5', key:'5', openWith:'<h5(!( class="[![Class]!]")!)>', closeWith:'</h5>', placeHolder:'Your title here...' },
22
+ {name:'Heading 6', key:'6', openWith:'<h6(!( class="[![Class]!]")!)>', closeWith:'</h6>', placeHolder:'Your title here...' },
23
+ {name:'Paragraph', openWith:'<p(!( class="[![Class]!]")!)>', closeWith:'</p>' },
24
+ {separator:'---------------' },
25
+ {name:'Bold', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
26
+ {name:'Italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)' },
27
+ {name:'Stroke through', key:'S', openWith:'<del>', closeWith:'</del>' },
28
+ {separator:'---------------' },
29
+ {name:'Ul', openWith:'<ul>\n', closeWith:'</ul>\n' },
30
+ {name:'Ol', openWith:'<ol>\n', closeWith:'</ol>\n' },
31
+ {name:'Li', openWith:'<li>', closeWith:'</li>' },
32
+ {separator:'---------------' },
33
+ {name:'Picture', key:'P', replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' },
34
+ {name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
35
+ {separator:'---------------' },
36
+ {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },
37
+ {name:'Preview', className:'preview', call:'preview' }
38
+ ]
39
+ }
@@ -0,0 +1,52 @@
1
+ // -------------------------------------------------------------------
2
+ // markItUp!
3
+ // -------------------------------------------------------------------
4
+ // Copyright (C) 2008 Jay Salvat
5
+ // http://markitup.jaysalvat.com/
6
+ // -------------------------------------------------------------------
7
+ // MarkDown tags example
8
+ // http://en.wikipedia.org/wiki/Markdown
9
+ // http://daringfireball.net/projects/markdown/
10
+ // -------------------------------------------------------------------
11
+ // Feel free to add more tags
12
+ // -------------------------------------------------------------------
13
+ mySettings = {
14
+ previewParserPath: '',
15
+ onShiftEnter: {keepDefault:false, openWith:'\n\n'},
16
+ markupSet: [
17
+ {name:'First Level Heading', key:'1', placeHolder:'Your title here...', closeWith:function(markItUp) { return miu.markdownTitle(markItUp, '=') } },
18
+ {name:'Second Level Heading', key:'2', placeHolder:'Your title here...', closeWith:function(markItUp) { return miu.markdownTitle(markItUp, '-') } },
19
+ {name:'Heading 3', key:'3', openWith:'### ', placeHolder:'Your title here...' },
20
+ {name:'Heading 4', key:'4', openWith:'#### ', placeHolder:'Your title here...' },
21
+ {name:'Heading 5', key:'5', openWith:'##### ', placeHolder:'Your title here...' },
22
+ {name:'Heading 6', key:'6', openWith:'###### ', placeHolder:'Your title here...' },
23
+ {separator:'---------------' },
24
+ {name:'Bold', key:'B', openWith:'**', closeWith:'**'},
25
+ {name:'Italic', key:'I', openWith:'_', closeWith:'_'},
26
+ {separator:'---------------' },
27
+ {name:'Bulleted List', openWith:'- ' },
28
+ {name:'Numeric List', openWith:function(markItUp) {
29
+ return markItUp.line+'. ';
30
+ }},
31
+ {separator:'---------------' },
32
+ {name:'Picture', key:'P', replaceWith:'![[![Alternative text]!]]([![Url:!:http://]!] "[![Title]!]")'},
33
+ {name:'Link', key:'L', openWith:'[', closeWith:']([![Url:!:http://]!] "[![Title]!]")', placeHolder:'Your text to link here...' },
34
+ {separator:'---------------'},
35
+ {name:'Quotes', openWith:'> '},
36
+ {name:'Code Block / Code', openWith:'(!(\t|!|`)!)', closeWith:'(!(`)!)'},
37
+ {separator:'---------------'},
38
+ {name:'Preview', call:'preview', className:"preview"}
39
+ ]
40
+ }
41
+
42
+ // mIu nameSpace to avoid conflict.
43
+ miu = {
44
+ markdownTitle: function(markItUp, char) {
45
+ heading = '';
46
+ n = $.trim(markItUp.selection||markItUp.placeHolder).length;
47
+ for(i = 0; i < n; i++) {
48
+ heading += char;
49
+ }
50
+ return '\n'+heading;
51
+ }
52
+ }
@@ -0,0 +1,40 @@
1
+ // -------------------------------------------------------------------
2
+ // markItUp!
3
+ // -------------------------------------------------------------------
4
+ // Copyright (C) 2008 Jay Salvat
5
+ // http://markitup.jaysalvat.com/
6
+ // -------------------------------------------------------------------
7
+ // Textile tags example
8
+ // http://en.wikipedia.org/wiki/Textile_(markup_language)
9
+ // http://www.textism.com/
10
+ // -------------------------------------------------------------------
11
+ // Feel free to add more tags
12
+ // -------------------------------------------------------------------
13
+ mySettings = {
14
+ previewParserPath: '', // path to your Textile parser
15
+ onShiftEnter: {keepDefault:false, replaceWith:'\n\n'},
16
+ markupSet: [
17
+ {name:'Heading 1', key:'1', openWith:'h1(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
18
+ {name:'Heading 2', key:'2', openWith:'h2(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
19
+ {name:'Heading 3', key:'3', openWith:'h3(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
20
+ {name:'Heading 4', key:'4', openWith:'h4(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
21
+ {name:'Heading 5', key:'5', openWith:'h5(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
22
+ {name:'Heading 6', key:'6', openWith:'h6(!(([![Class]!]))!). ', placeHolder:'Your title here...' },
23
+ {name:'Paragraph', key:'P', openWith:'p(!(([![Class]!]))!). '},
24
+ {separator:'---------------' },
25
+ {name:'Bold', key:'B', closeWith:'*', openWith:'*'},
26
+ {name:'Italic', key:'I', closeWith:'_', openWith:'_'},
27
+ {name:'Stroke through', key:'S', closeWith:'-', openWith:'-'},
28
+ {separator:'---------------' },
29
+ {name:'Bulleted list', openWith:'(!(* |!|*)!)'},
30
+ {name:'Numeric list', openWith:'(!(# |!|#)!)'},
31
+ {separator:'---------------' },
32
+ {name:'Picture', replaceWith:'![![Source:!:http://]!]([![Alternative text]!])!'},
33
+ {name:'Link', openWith:'"', closeWith:'([![Title]!])":[![Link:!:http://]!]', placeHolder:'Your text to link here...' },
34
+ {separator:'---------------' },
35
+ {name:'Quotes', openWith:'bq(!(([![Class]!]))!). '},
36
+ {name:'Code', openWith:'@', closeWith:'@'},
37
+ {separator:'---------------' },
38
+ {name:'Preview', call:'preview', className:'preview'}
39
+ ]
40
+ };