md_simple_editor 0.1.7 → 0.1.8
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.
- checksums.yaml +4 -4
- data/.idea/.rakeTasks +7 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/md_simple_editor.iml +36 -0
- data/.idea/misc.xml +36 -0
- data/.idea/modules.xml +9 -0
- data/.idea/scopes/scope_settings.xml +5 -0
- data/.idea/vcs.xml +7 -0
- data/.idea/workspace.xml +56 -0
- data/Gemfile +2 -0
- data/app/assets/javascripts/md_simple_editor.js.coffee +65 -41
- data/app/assets/stylesheets/md_simple_editor.css.scss +5 -66
- data/app/controllers/md_simple_editor_controller.rb +7 -0
- data/app/helpers/md_simple_editor/rails/md_helper.rb +32 -22
- data/config/routes.rb +3 -0
- data/lib/md_simple_editor/version.rb +1 -1
- data/md_simple_editor.gemspec +1 -0
- metadata +26 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 76002001149a0f1abf08382bf6a35c580e8b3bfe
|
|
4
|
+
data.tar.gz: f852f816be8929c6b71980df839d8c8dae29badc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1548c1a6c48aa8152357e8f27f17f749a0491948c35eb882476e72607e24729c24d26a6ba237ad40ceb3d4f17092b3592be1c564aef6605b4cd2a1de71cfa27a
|
|
7
|
+
data.tar.gz: 0979ef0a533fe67d1c6f5e3bcb05a7c9e760094b91d2d0bbf9f44b6d14dd3f5cc4778210b63ee644c945c74cfb7619f2b4d804d41eb73e622080e41261d4faec
|
data/.idea/.rakeTasks
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
|
3
|
+
You are allowed to:
|
|
4
|
+
1. Remove rake task
|
|
5
|
+
2. Add existing rake tasks
|
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build md_simple_editor-0.1.8.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install md_simple_editor-0.1.8.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v0.1.8 and build and push md_simple_editor-0.1.8.gem to Rubygems" fullCmd="release" taksId="release" /></RakeGroup></Settings>
|
data/.idea/encodings.xml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
|
3
|
+
<component name="FacetManager">
|
|
4
|
+
<facet type="gem" name="Ruby Gem">
|
|
5
|
+
<configuration>
|
|
6
|
+
<option name="GEM_APP_ROOT_PATH" value="$MODULE_DIR$" />
|
|
7
|
+
<option name="GEM_APP_TEST_PATH" value="" />
|
|
8
|
+
<option name="GEM_APP_LIB_PATH" value="$MODULE_DIR$/lib" />
|
|
9
|
+
</configuration>
|
|
10
|
+
</facet>
|
|
11
|
+
</component>
|
|
12
|
+
<component name="NewModuleRootManager">
|
|
13
|
+
<content url="file://$MODULE_DIR$" />
|
|
14
|
+
<orderEntry type="inheritedJdk" />
|
|
15
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
16
|
+
<orderEntry type="module-library">
|
|
17
|
+
<library name="md_simple_editor (v0.1.8, /Users/rubenespinosaroldan/Documents/Projects/md_simple_editor) [path][gem]">
|
|
18
|
+
<CLASSES>
|
|
19
|
+
<root url="file://$MODULE_DIR$/app" />
|
|
20
|
+
<root url="file://$MODULE_DIR$/lib" />
|
|
21
|
+
<root url="file://$MODULE_DIR$/pkg" />
|
|
22
|
+
<root url="file://$MODULE_DIR$/.idea" />
|
|
23
|
+
</CLASSES>
|
|
24
|
+
<SOURCES>
|
|
25
|
+
<root url="file://$MODULE_DIR$/app" />
|
|
26
|
+
<root url="file://$MODULE_DIR$/lib" />
|
|
27
|
+
<root url="file://$MODULE_DIR$/pkg" />
|
|
28
|
+
<root url="file://$MODULE_DIR$/.idea" />
|
|
29
|
+
</SOURCES>
|
|
30
|
+
</library>
|
|
31
|
+
</orderEntry>
|
|
32
|
+
<orderEntry type="library" scope="PROVIDED" name="erubis (v2.7.0, RVM: ruby-1.9.3-p392) [gem]" level="application" />
|
|
33
|
+
<orderEntry type="library" scope="PROVIDED" name="rack-test (v0.6.2, RVM: ruby-1.9.3-p392) [gem]" level="application" />
|
|
34
|
+
</component>
|
|
35
|
+
</module>
|
|
36
|
+
|
data/.idea/misc.xml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectInspectionProfilesVisibleTreeState">
|
|
4
|
+
<entry key="Project Default">
|
|
5
|
+
<profile-state>
|
|
6
|
+
<expanded-state>
|
|
7
|
+
<State>
|
|
8
|
+
<id />
|
|
9
|
+
</State>
|
|
10
|
+
</expanded-state>
|
|
11
|
+
<selected-state>
|
|
12
|
+
<State>
|
|
13
|
+
<id>CoffeeScript</id>
|
|
14
|
+
</State>
|
|
15
|
+
</selected-state>
|
|
16
|
+
</profile-state>
|
|
17
|
+
</entry>
|
|
18
|
+
</component>
|
|
19
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-1.9.3-p392" project-jdk-type="RUBY_SDK" />
|
|
20
|
+
<component name="masterDetails">
|
|
21
|
+
<states>
|
|
22
|
+
<state key="ScopeChooserConfigurable.UI">
|
|
23
|
+
<settings>
|
|
24
|
+
<splitter-proportions>
|
|
25
|
+
<option name="proportions">
|
|
26
|
+
<list>
|
|
27
|
+
<option value="0.2" />
|
|
28
|
+
</list>
|
|
29
|
+
</option>
|
|
30
|
+
</splitter-proportions>
|
|
31
|
+
</settings>
|
|
32
|
+
</state>
|
|
33
|
+
</states>
|
|
34
|
+
</component>
|
|
35
|
+
</project>
|
|
36
|
+
|
data/.idea/modules.xml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/md_simple_editor.iml" filepath="$PROJECT_DIR$/.idea/md_simple_editor.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
9
|
+
|
data/.idea/vcs.xml
ADDED
data/.idea/workspace.xml
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ChangeListManager">
|
|
4
|
+
<option name="TRACKING_ENABLED" value="true" />
|
|
5
|
+
<option name="SHOW_DIALOG" value="false" />
|
|
6
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
7
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
8
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
9
|
+
</component>
|
|
10
|
+
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
|
|
11
|
+
<component name="CreatePatchCommitExecutor">
|
|
12
|
+
<option name="PATCH_PATH" value="" />
|
|
13
|
+
</component>
|
|
14
|
+
<component name="DaemonCodeAnalyzer">
|
|
15
|
+
<disable_hints />
|
|
16
|
+
</component>
|
|
17
|
+
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
|
18
|
+
<OptionsSetting value="true" id="Add" />
|
|
19
|
+
<OptionsSetting value="true" id="Remove" />
|
|
20
|
+
<OptionsSetting value="true" id="Checkout" />
|
|
21
|
+
<OptionsSetting value="true" id="Update" />
|
|
22
|
+
<OptionsSetting value="true" id="Status" />
|
|
23
|
+
<OptionsSetting value="true" id="Edit" />
|
|
24
|
+
<ConfirmationsSetting value="0" id="Add" />
|
|
25
|
+
<ConfirmationsSetting value="0" id="Remove" />
|
|
26
|
+
</component>
|
|
27
|
+
<component name="ProjectReloadState">
|
|
28
|
+
<option name="STATE" value="0" />
|
|
29
|
+
</component>
|
|
30
|
+
<component name="PropertiesComponent">
|
|
31
|
+
<property name="options.lastSelected" value="reference.settingsdialog.project.vagrant" />
|
|
32
|
+
<property name="options.splitter.main.proportions" value="0.3" />
|
|
33
|
+
<property name="options.splitter.details.proportions" value="0.2" />
|
|
34
|
+
<property name="options.searchVisible" value="true" />
|
|
35
|
+
</component>
|
|
36
|
+
<component name="RunManager">
|
|
37
|
+
<list size="0" />
|
|
38
|
+
</component>
|
|
39
|
+
<component name="ShelveChangesManager" show_recycled="false" />
|
|
40
|
+
<component name="TaskManager">
|
|
41
|
+
<task active="true" id="Default" summary="Default task" />
|
|
42
|
+
<servers />
|
|
43
|
+
</component>
|
|
44
|
+
<component name="VcsContentAnnotationSettings">
|
|
45
|
+
<option name="myLimit" value="2678400000" />
|
|
46
|
+
</component>
|
|
47
|
+
<component name="VcsManagerConfiguration">
|
|
48
|
+
<option name="myTodoPanelSettings">
|
|
49
|
+
<TodoPanelSettings />
|
|
50
|
+
</option>
|
|
51
|
+
</component>
|
|
52
|
+
<component name="XDebuggerManager">
|
|
53
|
+
<breakpoint-manager />
|
|
54
|
+
</component>
|
|
55
|
+
</project>
|
|
56
|
+
|
data/Gemfile
CHANGED
|
@@ -3,51 +3,66 @@
|
|
|
3
3
|
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
|
4
4
|
|
|
5
5
|
md_simple_editor = () ->
|
|
6
|
-
$('
|
|
6
|
+
$('.btn-toolbar .btn-group button').click ->
|
|
7
7
|
att_class = this.classList
|
|
8
8
|
rgex = /md_/
|
|
9
9
|
|
|
10
10
|
option = $.grep att_class, (item) ->
|
|
11
11
|
return rgex.test(item)
|
|
12
12
|
|
|
13
|
-
option
|
|
13
|
+
if option.length != 0
|
|
14
|
+
option = option[0].toString()
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
16
|
+
text = if option == 'md_h1'
|
|
17
|
+
"# Your Title here"
|
|
18
|
+
else if option == 'md_h2'
|
|
19
|
+
"## Your Title here"
|
|
20
|
+
else if option == 'md_h3'
|
|
21
|
+
"### Your Title here"
|
|
22
|
+
else if option == 'md_h4'
|
|
23
|
+
"#### Your Title here"
|
|
24
|
+
else if option == 'md_h5'
|
|
25
|
+
"##### Your Title here"
|
|
26
|
+
else if option == 'md_italic'
|
|
27
|
+
"_Your italic text here_"
|
|
28
|
+
else if option == 'md_bold'
|
|
29
|
+
"__Your bold text here__"
|
|
30
|
+
else if option == 'md_list-ul'
|
|
31
|
+
"\n\n* Item 1\n* Item 2\n* Item 3 \n\n<br>"
|
|
32
|
+
else if option == 'md_list-ol'
|
|
33
|
+
"\n\n1. Item 1\n2. Item 2\n3. Item 3 \n\n<br> "
|
|
34
|
+
else if option == 'md_indent'
|
|
35
|
+
">Your indented text here"
|
|
36
|
+
else if option == 'md_underline'
|
|
37
|
+
"<u>Your undelined text here </u>"
|
|
38
|
+
else if option == 'md_table'
|
|
39
|
+
"\n|Header|Header|Header|\n|:------|:-------:|------:|\n|Left alignment|Centered|Right alignment|\n\n<br>"
|
|
40
|
+
else if option == 'md_minus'
|
|
41
|
+
"\n<hr>\n"
|
|
42
|
+
else if option == 'md_square'
|
|
43
|
+
"\n\t Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam ut aliquet velit. Nam fermentum, mi quis egestas ornare, massa velit pharetra ante, sed
|
|
44
|
+
pellentesque tortor nisl non quam. Nunc eget egestas orci.\n\n<br> "
|
|
45
|
+
else if option == 'md_link'
|
|
46
|
+
"\n[This is a link](http://google.com)\n"
|
|
47
|
+
else if option == 'md_camera-retro'
|
|
48
|
+
"\n\n"
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
textarea = $('#md-editor #md-text textarea')
|
|
51
|
+
insertAtCaret(textarea.attr('id'), text)
|
|
52
|
+
|
|
53
|
+
preview = ->
|
|
54
|
+
if $('#md-text').attr('hidden')
|
|
55
|
+
$('#md-text').removeAttr('hidden')
|
|
56
|
+
$('.preview-panel').attr('hidden', 'true')
|
|
57
|
+
else
|
|
58
|
+
$('#md-text').attr('hidden', 'true')
|
|
59
|
+
$('.preview-panel').removeAttr('hidden')
|
|
60
|
+
$.post(
|
|
61
|
+
'/md_simple_editor/preview',
|
|
62
|
+
{md:$('#md-text textarea').val()},
|
|
63
|
+
(data) ->
|
|
64
|
+
$('#md-preview').html(data)
|
|
65
|
+
)
|
|
51
66
|
|
|
52
67
|
insertAtCaret = (areaId, text) ->
|
|
53
68
|
txtarea = document.getElementById(areaId)
|
|
@@ -76,9 +91,18 @@ insertAtCaret = (areaId, text) ->
|
|
|
76
91
|
txtarea.selectionEnd = strPos
|
|
77
92
|
txtarea.focus()
|
|
78
93
|
txtarea.scrollTop = scrollPos
|
|
79
|
-
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
$ ->
|
|
97
|
+
md_simple_editor()
|
|
98
|
+
$('.preview_md').click ->
|
|
99
|
+
preview()
|
|
100
|
+
|
|
101
|
+
|
|
80
102
|
$(document).on 'page:load', ->
|
|
81
|
-
md_simple_editor()
|
|
82
|
-
|
|
83
|
-
$ ->
|
|
84
103
|
md_simple_editor()
|
|
104
|
+
$('.preview_md').click ->
|
|
105
|
+
preview()
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
@@ -1,74 +1,13 @@
|
|
|
1
1
|
#md-editor{
|
|
2
|
-
border: 1px solid #66afe9;
|
|
3
|
-
overflow: hidden;
|
|
4
|
-
#md-toolbar{
|
|
5
|
-
height: 50px;
|
|
6
|
-
margin-top: -5px;
|
|
7
|
-
background-color: #f5f5f5;
|
|
8
|
-
border-bottom: 1px dashed gray;
|
|
9
|
-
#btn-group{
|
|
10
|
-
margin: 10px 0 0 10px;
|
|
11
|
-
position: relative;
|
|
12
|
-
display: inline-block;
|
|
13
|
-
vertical-align: middle;
|
|
14
|
-
.btn{
|
|
15
|
-
margin-left: -3px;
|
|
16
|
-
position: relative;
|
|
17
|
-
float: left;
|
|
18
|
-
display: inline-block;
|
|
19
|
-
padding: 6px 12px;
|
|
20
|
-
margin-bottom: 0;
|
|
21
|
-
font-size: 14px;
|
|
22
|
-
font-weight: normal;
|
|
23
|
-
line-height: 1.428571429;
|
|
24
|
-
height: 36px;
|
|
25
|
-
text-align: center;
|
|
26
|
-
white-space: nowrap;
|
|
27
|
-
vertical-align: middle;
|
|
28
|
-
cursor: pointer;
|
|
29
|
-
border: 1px solid transparent;
|
|
30
|
-
-webkit-user-select: none;
|
|
31
|
-
-moz-user-select: none;
|
|
32
|
-
-ms-user-select: none;
|
|
33
|
-
-o-user-select: none;
|
|
34
|
-
user-select: none;
|
|
35
|
-
}
|
|
36
|
-
.btn-default{
|
|
37
|
-
color: #333;
|
|
38
|
-
background-color: #fff;
|
|
39
|
-
border-color: #ccc;
|
|
40
|
-
&:hover{
|
|
41
|
-
color: white;
|
|
42
|
-
text-decoration: none;
|
|
43
|
-
text-shadow: #ffff 0px -1px 0px;
|
|
44
|
-
background-color: #3072b3;
|
|
45
|
-
background-image: -webkit-linear-gradient(top, #599bcd, #3072b3);
|
|
46
|
-
background-image: -moz-linear-gradient(top, #599bcd, #3072b3);
|
|
47
|
-
background-image: linear-gradient(top, #599bcd, #3072b3);
|
|
48
|
-
border-color: #2a65a0;
|
|
49
|
-
background-repeat: repeat no-repeat;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&:hover, &:focus, &:active{
|
|
53
|
-
outline: 0; outline-style:none; outline-width:0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
&>.btn:first-child{
|
|
58
|
-
border-radius: 4px 0 0 4px;
|
|
59
|
-
}
|
|
60
|
-
&>.btn:last-child{
|
|
61
|
-
border-radius: 0 4px 4px 0;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
}
|
|
66
2
|
#md-text{
|
|
67
3
|
textarea{
|
|
68
|
-
|
|
69
|
-
padding: 4px;
|
|
4
|
+
padding: 15px;
|
|
70
5
|
}
|
|
71
6
|
}
|
|
7
|
+
#md-preview{
|
|
8
|
+
border: solid 1px #cccccc;
|
|
9
|
+
padding: 15px;
|
|
10
|
+
}
|
|
72
11
|
}
|
|
73
12
|
|
|
74
13
|
.markdown{
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
class MdSimpleEditorController < ApplicationController
|
|
2
|
+
def preview
|
|
3
|
+
options = {autolink: true, tables: true, hard_wrap: true, no_intra_emphasis: true, fenced_code:true, gh_blockcode: true}
|
|
4
|
+
html = Redcarpet::Markdown.new(Redcarpet::Render::HTML, options).render(params['md']).html_safe
|
|
5
|
+
render text: html
|
|
6
|
+
end
|
|
7
|
+
end
|
|
@@ -3,67 +3,77 @@ module MdSimpleEditor
|
|
|
3
3
|
module MdHelper
|
|
4
4
|
def md_simple_editor
|
|
5
5
|
content_tag(:div, :id => "md-editor") do
|
|
6
|
-
content_tag(:div, :
|
|
7
|
-
content_tag(:div, :
|
|
8
|
-
button_tag(:type => 'button', :class => "btn btn-default md_h1"
|
|
6
|
+
content_tag(:div, :class => "btn-toolbar", role: "toolbar") do
|
|
7
|
+
content_tag(:div, :class => "btn-group") do
|
|
8
|
+
button_tag(:type => 'button', :class => "btn btn-default md_h1") do
|
|
9
9
|
content_tag(:strong, 'H1')
|
|
10
10
|
end +
|
|
11
|
-
button_tag(:type => 'button', :class => "btn btn-default md_h2"
|
|
11
|
+
button_tag(:type => 'button', :class => "btn btn-default md_h2") do
|
|
12
12
|
content_tag(:strong, 'H2')
|
|
13
13
|
end +
|
|
14
|
-
button_tag(:type => 'button', :class => "btn btn-default md_h3"
|
|
14
|
+
button_tag(:type => 'button', :class => "btn btn-default md_h3") do
|
|
15
15
|
content_tag(:strong, 'H3')
|
|
16
16
|
end +
|
|
17
|
-
button_tag(:type => 'button', :class => "btn btn-default md_h4"
|
|
17
|
+
button_tag(:type => 'button', :class => "btn btn-default md_h4") do
|
|
18
18
|
content_tag(:strong, 'H4')
|
|
19
19
|
end +
|
|
20
|
-
button_tag(:type => 'button', :class => "btn btn-default md_h5"
|
|
20
|
+
button_tag(:type => 'button', :class => "btn btn-default md_h5") do
|
|
21
21
|
content_tag(:strong, 'H5')
|
|
22
22
|
end
|
|
23
23
|
end +
|
|
24
|
-
content_tag(:div, :
|
|
25
|
-
button_tag(:type => 'button', :class => "btn btn-default md_italic"
|
|
24
|
+
content_tag(:div, :class => "btn-group") do
|
|
25
|
+
button_tag(:type => 'button', :class => "btn btn-default md_italic") do
|
|
26
26
|
fa_icon "italic"
|
|
27
27
|
end +
|
|
28
|
-
button_tag(:type => 'button', :class => "btn btn-default md_bold"
|
|
28
|
+
button_tag(:type => 'button', :class => "btn btn-default md_bold") do
|
|
29
29
|
fa_icon "bold"
|
|
30
30
|
end +
|
|
31
|
-
button_tag(:type => 'button', :class => "btn btn-default md_list-ul"
|
|
31
|
+
button_tag(:type => 'button', :class => "btn btn-default md_list-ul") do
|
|
32
32
|
fa_icon "list-ul"
|
|
33
33
|
end +
|
|
34
|
-
button_tag(:type => 'button', :class => "btn btn-default md_list-ol"
|
|
34
|
+
button_tag(:type => 'button', :class => "btn btn-default md_list-ol") do
|
|
35
35
|
fa_icon "list-ol"
|
|
36
36
|
end +
|
|
37
|
-
button_tag(:type => 'button', :class => "btn btn-default md_indent"
|
|
37
|
+
button_tag(:type => 'button', :class => "btn btn-default md_indent") do
|
|
38
38
|
fa_icon "indent"
|
|
39
39
|
end +
|
|
40
|
-
button_tag(:type => 'button', :class => "btn btn-default md_underline"
|
|
40
|
+
button_tag(:type => 'button', :class => "btn btn-default md_underline") do
|
|
41
41
|
fa_icon "underline"
|
|
42
42
|
end +
|
|
43
|
-
button_tag(:type => 'button', :class => "btn btn-default md_table"
|
|
43
|
+
button_tag(:type => 'button', :class => "btn btn-default md_table") do
|
|
44
44
|
fa_icon "table"
|
|
45
45
|
end +
|
|
46
|
-
button_tag(:type => 'button', :class => "btn btn-default md_square"
|
|
46
|
+
button_tag(:type => 'button', :class => "btn btn-default md_square") do
|
|
47
47
|
fa_icon "square"
|
|
48
48
|
end +
|
|
49
|
-
button_tag(:type => 'button', :class => "btn btn-default md_minus"
|
|
49
|
+
button_tag(:type => 'button', :class => "btn btn-default md_minus") do
|
|
50
50
|
fa_icon "minus"
|
|
51
51
|
end
|
|
52
52
|
end +
|
|
53
|
-
content_tag(:div, :
|
|
54
|
-
button_tag(:type => 'button', :class => "btn btn-default md_link"
|
|
53
|
+
content_tag(:div, :class => "btn-group") do
|
|
54
|
+
button_tag(:type => 'button', :class => "btn btn-default md_link") do
|
|
55
55
|
fa_icon "link"
|
|
56
56
|
end +
|
|
57
|
-
button_tag(:type => 'button', :class => "btn btn-default md_camera-retro"
|
|
57
|
+
button_tag(:type => 'button', :class => "btn btn-default md_camera-retro") do
|
|
58
58
|
fa_icon "camera-retro"
|
|
59
59
|
end
|
|
60
|
+
end +
|
|
61
|
+
content_tag(:div, class: 'btn-group pull-righ') do
|
|
62
|
+
button_tag(:type => 'button', :class => "btn btn-primary preview_md") do
|
|
63
|
+
'Preview'
|
|
64
|
+
end
|
|
60
65
|
end
|
|
61
66
|
end +
|
|
67
|
+
content_tag(:br) +
|
|
62
68
|
content_tag(:div, :id => "md-text") do
|
|
63
69
|
yield
|
|
64
70
|
end +
|
|
65
|
-
content_tag(:div, :
|
|
66
|
-
|
|
71
|
+
content_tag(:div, class: 'panel panel-success preview-panel', hidden: true) do
|
|
72
|
+
content_tag(:div, class: 'panel-heading') do
|
|
73
|
+
"Preview"
|
|
74
|
+
end +
|
|
75
|
+
content_tag(:div, :id => "md-preview", class: 'panel-body') do
|
|
76
|
+
end
|
|
67
77
|
end
|
|
68
78
|
end
|
|
69
79
|
end
|
data/config/routes.rb
ADDED
data/md_simple_editor.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: md_simple_editor
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ruben Espinosa
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -52,6 +52,20 @@ dependencies:
|
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: 4.0.3.1
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: redcarpet
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: 3.1.2
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: 3.1.2
|
|
55
69
|
description: Simple editor for markdown and rails
|
|
56
70
|
email:
|
|
57
71
|
- rderoldan1@gmail.com
|
|
@@ -60,6 +74,14 @@ extensions: []
|
|
|
60
74
|
extra_rdoc_files: []
|
|
61
75
|
files:
|
|
62
76
|
- ".gitignore"
|
|
77
|
+
- ".idea/.rakeTasks"
|
|
78
|
+
- ".idea/encodings.xml"
|
|
79
|
+
- ".idea/md_simple_editor.iml"
|
|
80
|
+
- ".idea/misc.xml"
|
|
81
|
+
- ".idea/modules.xml"
|
|
82
|
+
- ".idea/scopes/scope_settings.xml"
|
|
83
|
+
- ".idea/vcs.xml"
|
|
84
|
+
- ".idea/workspace.xml"
|
|
63
85
|
- Gemfile
|
|
64
86
|
- LICENSE
|
|
65
87
|
- LICENSE.txt
|
|
@@ -67,7 +89,9 @@ files:
|
|
|
67
89
|
- Rakefile
|
|
68
90
|
- app/assets/javascripts/md_simple_editor.js.coffee
|
|
69
91
|
- app/assets/stylesheets/md_simple_editor.css.scss
|
|
92
|
+
- app/controllers/md_simple_editor_controller.rb
|
|
70
93
|
- app/helpers/md_simple_editor/rails/md_helper.rb
|
|
94
|
+
- config/routes.rb
|
|
71
95
|
- lib/md_simple_editor.rb
|
|
72
96
|
- lib/md_simple_editor/engine.rb
|
|
73
97
|
- lib/md_simple_editor/version.rb
|