markitup-rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.md +81 -0
- data/lib/markitup-rails.rb +9 -0
- data/lib/markitup-rails/engine.rb +6 -0
- data/lib/markitup-rails/railtie.rb +6 -0
- data/lib/markitup-rails/version.rb +5 -0
- data/markitup-rails.gemspec +21 -0
- data/vendor/assets/images/images/bg-container.png +0 -0
- data/vendor/assets/images/images/bg-editor-bbcode.png +0 -0
- data/vendor/assets/images/images/bg-editor-dotclear.png +0 -0
- data/vendor/assets/images/images/bg-editor-html.png +0 -0
- data/vendor/assets/images/images/bg-editor-json.png +0 -0
- data/vendor/assets/images/images/bg-editor-markdown.png +0 -0
- data/vendor/assets/images/images/bg-editor-textile.png +0 -0
- data/vendor/assets/images/images/bg-editor-wiki.png +0 -0
- data/vendor/assets/images/images/bg-editor-xml.png +0 -0
- data/vendor/assets/images/images/bg-editor.png +0 -0
- data/vendor/assets/images/images/bold.png +0 -0
- data/vendor/assets/images/images/clean.png +0 -0
- data/vendor/assets/images/images/code.png +0 -0
- data/vendor/assets/images/images/css.png +0 -0
- data/vendor/assets/images/images/disconnect.png +0 -0
- data/vendor/assets/images/images/h1.png +0 -0
- data/vendor/assets/images/images/h2.png +0 -0
- data/vendor/assets/images/images/h3.png +0 -0
- data/vendor/assets/images/images/h4.png +0 -0
- data/vendor/assets/images/images/h5.png +0 -0
- data/vendor/assets/images/images/h6.png +0 -0
- data/vendor/assets/images/images/handle.png +0 -0
- data/vendor/assets/images/images/image.png +0 -0
- data/vendor/assets/images/images/italic.png +0 -0
- data/vendor/assets/images/images/link.png +0 -0
- data/vendor/assets/images/images/list-bullet.png +0 -0
- data/vendor/assets/images/images/list-item.png +0 -0
- data/vendor/assets/images/images/list-numeric.png +0 -0
- data/vendor/assets/images/images/menu.png +0 -0
- data/vendor/assets/images/images/page_white_code.png +0 -0
- data/vendor/assets/images/images/paragraph.png +0 -0
- data/vendor/assets/images/images/picture.png +0 -0
- data/vendor/assets/images/images/preview.png +0 -0
- data/vendor/assets/images/images/quotes.png +0 -0
- data/vendor/assets/images/images/stroke.png +0 -0
- data/vendor/assets/images/images/submenu.png +0 -0
- data/vendor/assets/images/images/tag.png +0 -0
- data/vendor/assets/images/images/text_align_center.png +0 -0
- data/vendor/assets/images/images/text_align_justify.png +0 -0
- data/vendor/assets/images/images/text_align_left.png +0 -0
- data/vendor/assets/images/images/text_align_right.png +0 -0
- data/vendor/assets/images/images/text_indent.png +0 -0
- data/vendor/assets/images/images/text_letterspacing.png +0 -0
- data/vendor/assets/images/images/text_linespacing.png +0 -0
- data/vendor/assets/images/images/text_lowercase.png +0 -0
- data/vendor/assets/images/images/text_padding_bottom.png +0 -0
- data/vendor/assets/images/images/text_padding_left.png +0 -0
- data/vendor/assets/images/images/text_padding_right.png +0 -0
- data/vendor/assets/images/images/text_padding_top.png +0 -0
- data/vendor/assets/images/images/text_uppercase.png +0 -0
- data/vendor/assets/images/images/url.png +0 -0
- data/vendor/assets/javascripts/markitup-css.js +52 -0
- data/vendor/assets/javascripts/markitup-html.js +39 -0
- data/vendor/assets/javascripts/markitup-markdown.js +52 -0
- data/vendor/assets/javascripts/markitup-textile.js +40 -0
- data/vendor/assets/javascripts/markitup.js +593 -0
- data/vendor/assets/javascripts/marmarkitup-texy.js +51 -0
- data/vendor/assets/javascripts/marmarkitup-wiki.js +37 -0
- data/vendor/assets/stylesheets/markitup-css.css +72 -0
- data/vendor/assets/stylesheets/markitup-html.css +59 -0
- data/vendor/assets/stylesheets/markitup-markdown.css +54 -0
- data/vendor/assets/stylesheets/markitup-textile.css +61 -0
- data/vendor/assets/stylesheets/markitup.css +149 -0
- data/vendor/assets/stylesheets/marmarkitup-texy.css +51 -0
- data/vendor/assets/stylesheets/marmarkitup-wiki.css +57 -0
- metadata +164 -0
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.DS_Store
|
data/README.md
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
markitup-rails
|
2
|
+
========================
|
3
|
+
|
4
|
+
This is a gem that contains the vendor assets for [markitup](http://markitup.jaysalvat.com/home/).
|
5
|
+
|
6
|
+
## Support
|
7
|
+
|
8
|
+
Should support rails 3.0 and higher.
|
9
|
+
|
10
|
+
### Supported markup languages:
|
11
|
+
|
12
|
+
* `html`
|
13
|
+
* `textile`
|
14
|
+
* `markdown`
|
15
|
+
* `wiki`
|
16
|
+
* `texty`
|
17
|
+
* `css`
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
### Installing the Gem
|
22
|
+
|
23
|
+
Require `markitup-rails` in your `Gemfile`.
|
24
|
+
|
25
|
+
require 'markitup-rails'
|
26
|
+
|
27
|
+
Install the gem via `bundle` command.
|
28
|
+
|
29
|
+
|
30
|
+
### Using it in your application
|
31
|
+
|
32
|
+
Add to `application.css`
|
33
|
+
|
34
|
+
*= require markitup
|
35
|
+
*= require markitup-[markup lang]
|
36
|
+
|
37
|
+
Example
|
38
|
+
|
39
|
+
*= require markitup
|
40
|
+
*= require markitup-textile
|
41
|
+
|
42
|
+
And in `application.js`
|
43
|
+
|
44
|
+
//= require markitup
|
45
|
+
//= require markitup-[markup lang]
|
46
|
+
|
47
|
+
Example
|
48
|
+
|
49
|
+
//= require markitup
|
50
|
+
//= require markitup-textile
|
51
|
+
|
52
|
+
|
53
|
+
### Using markitup
|
54
|
+
|
55
|
+
Include in either `application.js` or another file that will be included in the pipelin:
|
56
|
+
|
57
|
+
// To target all text areas
|
58
|
+
$(document).ready(function() {
|
59
|
+
$("textarea").markItUp(mySettings);
|
60
|
+
});
|
61
|
+
|
62
|
+
//----- OR
|
63
|
+
|
64
|
+
// To target a specific ID
|
65
|
+
$(document).ready(function() {
|
66
|
+
$("textarea#my_id").markItUp(mySettings);
|
67
|
+
});
|
68
|
+
|
69
|
+
//----- OR
|
70
|
+
|
71
|
+
// To target a specific class
|
72
|
+
$(document).ready(function() {
|
73
|
+
$("textarea.markitup").markItUp(mySettings);
|
74
|
+
});
|
75
|
+
|
76
|
+
|
77
|
+
See the [markitup documentation](http://markitup.jaysalvat.com/documentation/) for more info.
|
78
|
+
|
79
|
+
----
|
80
|
+
|
81
|
+
*Based on the [blueprint-rails gem](https://github.com/bai/blueprint-rails)*
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require './lib/markitup-rails/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = 'markitup-rails'
|
5
|
+
s.version = Markitup::Rails::VERSION
|
6
|
+
s.date = '2012-05-23'
|
7
|
+
s.summary = "MarkItUp for rails."
|
8
|
+
s.description = "Sets up the asset pipeline."
|
9
|
+
s.authors = ["Uri Gorelik"]
|
10
|
+
s.email = 'uri@ndstorefront.com'
|
11
|
+
s.files = ["lib/markitup-rails.rb"]
|
12
|
+
s.homepage =
|
13
|
+
'https://github.com/HealthyWeb/markitup-rails'
|
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
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -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
|
+
};
|