ledge 0.2.0 → 0.2.1
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/app/assets/javascripts/ledge/rows/{heading.coffee → heading.coffee.erb} +6 -6
- data/app/assets/javascripts/ledge/rows/text.coffee.erb +46 -0
- data/app/assets/stylesheets/ledge/index.scss +1 -1
- data/lib/ledge/version.rb +1 -1
- metadata +3 -3
- data/app/assets/javascripts/ledge/rows/text.coffee +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6a4ea2983504f61b4d1b612b51bf0fa9de46903
|
4
|
+
data.tar.gz: 8facd3ec72865f734af7d8c84b4096b66643dadd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af81eb7ac375a1e615e7ab1daba0867d11128a7d81826e8b77a7e88cde7f2dbb790782f093be0da02d0637eaf5269887b84cd47f757c1b279622d00dae040997
|
7
|
+
data.tar.gz: f4cd37fdcc5bf7436411e5e8a2b513814ba02a39e140cfdc4333a751bbe1a40f5d042637c4286bfe08fd2f69995c4bc266d468afe9a3f429c3c10dfd3bdaa47d
|
@@ -4,12 +4,12 @@ class Heading extends Row
|
|
4
4
|
initial_content: "<h1>Heading</h1>"
|
5
5
|
options: ["H1", "H2", "H3", "H4", "H5", "H6"]
|
6
6
|
icons:
|
7
|
-
"H1": "
|
8
|
-
"H2": "
|
9
|
-
"H3": "
|
10
|
-
"H4": "
|
11
|
-
"H5": "
|
12
|
-
"H6": "
|
7
|
+
"H1": "<%= asset_path('text_heading_1.png') %>"
|
8
|
+
"H2": "<%= asset_path('text_heading_2.png') %>"
|
9
|
+
"H3": "<%= asset_path('text_heading_3.png') %>"
|
10
|
+
"H4": "<%= asset_path('text_heading_4.png') %>"
|
11
|
+
"H5": "<%= asset_path('text_heading_5.png') %>"
|
12
|
+
"H6": "<%= asset_path('text_heading_6.png') %>"
|
13
13
|
|
14
14
|
on_option: (row, option) ->
|
15
15
|
text = $(row).find(".__ledge_row_content").children().text()
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Icons: https://www.iconfinder.com/iconsets/silk2
|
2
|
+
|
3
|
+
class Text extends Row
|
4
|
+
type: "text"
|
5
|
+
name: "Text"
|
6
|
+
initial_content: "<p>Your text here..</p>"
|
7
|
+
|
8
|
+
options: ["bold", "italic", "underline", "strikeThrough", "createLink", "unlink", "insertImage", "floatLeft", "floatRight", "insertOrderedList", "insertUnorderedList", "indent", "outdent", "justifyLeft", "justifyCenter", "justifyRight", "justifyFull", "subscript", "superscript"]
|
9
|
+
icons:
|
10
|
+
"bold": "<%= asset_path('text_bold.png') %>"
|
11
|
+
"italic": "<%= asset_path('text_italic.png') %>"
|
12
|
+
"underline": "<%= asset_path('text_underline.png') %>"
|
13
|
+
"strikeThrough": "<%= asset_path('text_strikethrough.png') %>"
|
14
|
+
"createLink": "<%= asset_path('link_add.png') %>"
|
15
|
+
"unlink": "<%= asset_path('link_delete.png') %>"
|
16
|
+
"insertOrderedList": "<%= asset_path('text_list_numbers.png') %>"
|
17
|
+
"insertUnorderedList": "<%= asset_path('text_list_bullets.png') %>"
|
18
|
+
"indent": "<%= asset_path('text_indent.png') %>"
|
19
|
+
"outdent": "<%= asset_path('text_indent_remove.png') %>"
|
20
|
+
"justifyLeft": "<%= asset_path('text_align_left.png') %>"
|
21
|
+
"justifyCenter": "<%= asset_path('text_align_center.png') %>"
|
22
|
+
"justifyRight": "<%= asset_path('text_align_right.png') %>"
|
23
|
+
"justifyFull": "<%= asset_path('text_align_justify.png') %>"
|
24
|
+
"subscript": "<%= asset_path('text_subscript.png') %>"
|
25
|
+
"superscript": "<%= asset_path('text_superscript.png') %>"
|
26
|
+
"insertImage": "<%= asset_path('image_add.png') %>"
|
27
|
+
"floatLeft": "<%= asset_path('shape_align_left.png') %>"
|
28
|
+
"floatRight": "<%= asset_path('shape_align_right.png') %>"
|
29
|
+
|
30
|
+
on_option: (row, option) ->
|
31
|
+
args = null
|
32
|
+
switch option
|
33
|
+
when "createLink"
|
34
|
+
args = prompt("Where should the link take you? (Link URL)")
|
35
|
+
when "insertImage"
|
36
|
+
args = prompt("What is the image URL?")
|
37
|
+
when "floatRight"
|
38
|
+
$(window.getSelection().focusNode).addClass("pull-right")
|
39
|
+
return
|
40
|
+
when "floatLeft"
|
41
|
+
$(window.getSelection().focusNode).addClass("pull-left")
|
42
|
+
return
|
43
|
+
else
|
44
|
+
document.execCommand(option, false, args)
|
45
|
+
|
46
|
+
window.Text = Text
|
data/lib/ledge/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ledge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Birtles
|
@@ -117,9 +117,9 @@ files:
|
|
117
117
|
- app/assets/images/text_underline.png
|
118
118
|
- app/assets/images/trash.png
|
119
119
|
- app/assets/javascripts/ledge/index.coffee
|
120
|
-
- app/assets/javascripts/ledge/rows/heading.coffee
|
120
|
+
- app/assets/javascripts/ledge/rows/heading.coffee.erb
|
121
121
|
- app/assets/javascripts/ledge/rows/row.coffee
|
122
|
-
- app/assets/javascripts/ledge/rows/text.coffee
|
122
|
+
- app/assets/javascripts/ledge/rows/text.coffee.erb
|
123
123
|
- app/assets/stylesheets/ledge/index.scss
|
124
124
|
- lib/ledge.rb
|
125
125
|
- lib/ledge/column.rb
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# Icons: https://www.iconfinder.com/iconsets/silk2
|
2
|
-
|
3
|
-
class Text extends Row
|
4
|
-
type: "text"
|
5
|
-
name: "Text"
|
6
|
-
initial_content: "<p>Your text here..</p>"
|
7
|
-
|
8
|
-
options: ["bold", "italic", "underline", "strikeThrough", "createLink", "unlink", "insertImage", "floatLeft", "floatRight", "insertOrderedList", "insertUnorderedList", "indent", "outdent", "justifyLeft", "justifyCenter", "justifyRight", "justifyFull", "subscript", "superscript"]
|
9
|
-
icons:
|
10
|
-
"bold": "/assets/text_bold.png"
|
11
|
-
"italic": "/assets/text_italic.png"
|
12
|
-
"underline": "/assets/text_underline.png"
|
13
|
-
"strikeThrough": "/assets/text_strikethrough.png"
|
14
|
-
"createLink": "/assets/link_add.png"
|
15
|
-
"unlink": "/assets/link_delete.png"
|
16
|
-
"insertOrderedList": "/assets/text_list_numbers.png"
|
17
|
-
"insertUnorderedList": "/assets/text_list_bullets.png"
|
18
|
-
"indent": "/assets/text_indent.png"
|
19
|
-
"outdent": "/assets/text_indent_remove.png"
|
20
|
-
"justifyLeft": "/assets/text_align_left.png"
|
21
|
-
"justifyCenter": "/assets/text_align_center.png"
|
22
|
-
"justifyRight": "/assets/text_align_right.png"
|
23
|
-
"justifyFull": "/assets/text_align_justify.png"
|
24
|
-
"subscript": "/assets/text_subscript.png"
|
25
|
-
"superscript": "/assets/text_superscript.png"
|
26
|
-
"insertImage": "/assets/image_add.png"
|
27
|
-
"floatLeft": "/assets/shape_align_left.png"
|
28
|
-
"floatRight": "/assets/shape_align_right.png"
|
29
|
-
|
30
|
-
on_option: (row, option) ->
|
31
|
-
args = null
|
32
|
-
switch option
|
33
|
-
when "createLink"
|
34
|
-
args = prompt("Where should the link take you? (Link URL)")
|
35
|
-
when "insertImage"
|
36
|
-
args = prompt("What is the image URL?")
|
37
|
-
when "floatRight"
|
38
|
-
$(window.getSelection().focusNode).addClass("pull-right")
|
39
|
-
return
|
40
|
-
when "floatLeft"
|
41
|
-
$(window.getSelection().focusNode).addClass("pull-left")
|
42
|
-
return
|
43
|
-
else
|
44
|
-
document.execCommand(option, false, args)
|
45
|
-
|
46
|
-
window.Text = Text
|