ledge 0.1.0 → 0.2.0
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/images/image_add.png +0 -0
- data/app/assets/images/link_add.png +0 -0
- data/app/assets/images/link_delete.png +0 -0
- data/app/assets/images/shape_align_left.png +0 -0
- data/app/assets/images/shape_align_right.png +0 -0
- data/app/assets/images/text_align_center.png +0 -0
- data/app/assets/images/text_align_justify.png +0 -0
- data/app/assets/images/text_align_left.png +0 -0
- data/app/assets/images/text_align_right.png +0 -0
- data/app/assets/images/text_bold.png +0 -0
- data/app/assets/images/text_heading_1.png +0 -0
- data/app/assets/images/text_heading_2.png +0 -0
- data/app/assets/images/text_heading_3.png +0 -0
- data/app/assets/images/text_heading_4.png +0 -0
- data/app/assets/images/text_heading_5.png +0 -0
- data/app/assets/images/text_heading_6.png +0 -0
- data/app/assets/images/text_indent.png +0 -0
- data/app/assets/images/text_indent_remove.png +0 -0
- data/app/assets/images/text_italic.png +0 -0
- data/app/assets/images/text_list_bullets.png +0 -0
- data/app/assets/images/text_list_numbers.png +0 -0
- data/app/assets/images/text_strikethrough.png +0 -0
- data/app/assets/images/text_subscript.png +0 -0
- data/app/assets/images/text_superscript.png +0 -0
- data/app/assets/images/text_underline.png +0 -0
- data/app/assets/images/trash.png +0 -0
- data/app/assets/javascripts/ledge/index.coffee +17 -14
- data/app/assets/javascripts/ledge/rows/heading.coffee +6 -6
- data/app/assets/javascripts/ledge/rows/text.coffee +40 -0
- data/app/assets/stylesheets/ledge/index.scss +6 -10
- data/lib/ledge/version.rb +1 -1
- metadata +28 -6
- data/README.rdoc +0 -3
- data/app/assets/javascripts/ledge/rows/heading.rb +0 -19
- data/app/assets/javascripts/ledge/rows/row.rb +0 -9
- data/app/assets/javascripts/ledge/rows/text.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89bdc7c6ba2ee182f17d75524c664a0f742d729c
|
4
|
+
data.tar.gz: ad79e08b1636d3d21b3f045f10dd156971658ea4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf5591a9fdac9c54ed822c8a8d2157283173a8bda3acf40a15e41193dcc801cec57b56acf11d4433baa364d4f1aa6f73e26a981e19b256e7a281a9b5ba561b86
|
7
|
+
data.tar.gz: 935df66afd6376b49f7d27853979855e7b97cf5b8d566ceaabf6eba341834242378b8b526b7d0a7129534fb10d7f7ad664f54549ba54b81a8b1a7a96f43405ca
|
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
|
@@ -36,21 +36,21 @@ class Ledge
|
|
36
36
|
JSON.stringify(json)
|
37
37
|
|
38
38
|
setup: ->
|
39
|
+
if $("textarea#ledge").length
|
40
|
+
$("textarea#ledge").hide()
|
41
|
+
$("textarea#ledge").before("<div class='__ledge_edit'></div>")
|
42
|
+
|
43
|
+
data = JSON.parse($("textarea#ledge").text())
|
44
|
+
for column in data["columns"]
|
45
|
+
column_div = Ledge::create_column (col) ->
|
46
|
+
$("div.__ledge_edit").append(col)
|
47
|
+
Ledge::click_delete_column(column_div.find(".__ledge_delete"))
|
48
|
+
for row in column["rows"]
|
49
|
+
Ledge::create_row(row["type"], Ledge::html_for(row["type"], row["content"])).appendTo(column_div)
|
39
50
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
data = JSON.parse($("textarea#ledge").text())
|
44
|
-
for column in data["columns"]
|
45
|
-
column_div = Ledge::create_column (col) ->
|
46
|
-
$("div.__ledge_edit").append(col)
|
47
|
-
Ledge::click_delete_column(column_div.find(".__ledge_delete"))
|
48
|
-
for row in column["rows"]
|
49
|
-
Ledge::create_row(row["type"], Ledge::html_for(row["type"], row["content"])).appendTo(column_div)
|
50
|
-
|
51
|
-
Ledge::refresh_row_adders()
|
52
|
-
Ledge::refresh_column_adders()
|
53
|
-
Ledge::update_textarea()
|
51
|
+
Ledge::refresh_row_adders()
|
52
|
+
Ledge::refresh_column_adders()
|
53
|
+
Ledge::update_textarea()
|
54
54
|
|
55
55
|
update_textarea: ->
|
56
56
|
$("textarea#ledge").text(Ledge::jsonify($("div.__ledge_edit")))
|
@@ -123,6 +123,9 @@ class Ledge
|
|
123
123
|
.click(->
|
124
124
|
cindex = $(this).attr("data-ledge-type-index")
|
125
125
|
Ledge::ROW_TYPES[index]::on_option($(this).parent().parent(), $(this).attr("data-ledge-option"))
|
126
|
+
).mousedown((event) ->
|
127
|
+
event.preventDefault()
|
128
|
+
return false
|
126
129
|
).appendTo(options)
|
127
130
|
options.append("<div class='__ledge_delete'>Delete</div>")
|
128
131
|
Ledge::click_delete_row(options.find(".__ledge_delete"))
|
@@ -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": "/assets/text_heading_1.png"
|
8
|
+
"H2": "/assets/text_heading_2.png"
|
9
|
+
"H3": "/assets/text_heading_3.png"
|
10
|
+
"H4": "/assets/text_heading_4.png"
|
11
|
+
"H5": "/assets/text_heading_5.png"
|
12
|
+
"H6": "/assets/text_heading_6.png"
|
13
13
|
|
14
14
|
on_option: (row, option) ->
|
15
15
|
text = $(row).find(".__ledge_row_content").children().text()
|
@@ -1,6 +1,46 @@
|
|
1
|
+
# Icons: https://www.iconfinder.com/iconsets/silk2
|
2
|
+
|
1
3
|
class Text extends Row
|
2
4
|
type: "text"
|
3
5
|
name: "Text"
|
4
6
|
initial_content: "<p>Your text here..</p>"
|
5
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
|
+
|
6
46
|
window.Text = Text
|
@@ -40,11 +40,6 @@
|
|
40
40
|
text-align: center;
|
41
41
|
padding: 10px 20px;
|
42
42
|
|
43
|
-
// .__ledge_delete {
|
44
|
-
// border-top-left-radius: 0;
|
45
|
-
// border-bottom-right-radius: 0;
|
46
|
-
// }
|
47
|
-
|
48
43
|
.__ledge_row_content {
|
49
44
|
margin: auto;
|
50
45
|
display: inline-block;
|
@@ -126,6 +121,11 @@
|
|
126
121
|
background-repeat: no-repeat;
|
127
122
|
cursor: pointer;
|
128
123
|
float:left;
|
124
|
+
-moz-user-select: none;
|
125
|
+
-khtml-user-select: none;
|
126
|
+
-webkit-user-select: none;
|
127
|
+
-ms-user-select: none;
|
128
|
+
user-select: none;
|
129
129
|
|
130
130
|
&:hover {
|
131
131
|
background-color: rgba(255, 0, 0, .4);
|
@@ -133,11 +133,7 @@
|
|
133
133
|
}
|
134
134
|
|
135
135
|
.__ledge_delete {
|
136
|
-
background-image: url(
|
137
|
-
}
|
138
|
-
|
139
|
-
.__ledge_settings {
|
140
|
-
background-image: url(https://cdn2.iconfinder.com/data/icons/ios-7-icons/50/settings-16.png);
|
136
|
+
background-image: url(/assets/trash.png);
|
141
137
|
}
|
142
138
|
|
143
139
|
:last-child {
|
data/lib/ledge/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ledge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Birtles
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -89,15 +89,37 @@ extensions: []
|
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
91
|
- MIT-LICENSE
|
92
|
-
- README.rdoc
|
93
92
|
- Rakefile
|
93
|
+
- app/assets/images/image_add.png
|
94
|
+
- app/assets/images/link_add.png
|
95
|
+
- app/assets/images/link_delete.png
|
96
|
+
- app/assets/images/shape_align_left.png
|
97
|
+
- app/assets/images/shape_align_right.png
|
98
|
+
- app/assets/images/text_align_center.png
|
99
|
+
- app/assets/images/text_align_justify.png
|
100
|
+
- app/assets/images/text_align_left.png
|
101
|
+
- app/assets/images/text_align_right.png
|
102
|
+
- app/assets/images/text_bold.png
|
103
|
+
- app/assets/images/text_heading_1.png
|
104
|
+
- app/assets/images/text_heading_2.png
|
105
|
+
- app/assets/images/text_heading_3.png
|
106
|
+
- app/assets/images/text_heading_4.png
|
107
|
+
- app/assets/images/text_heading_5.png
|
108
|
+
- app/assets/images/text_heading_6.png
|
109
|
+
- app/assets/images/text_indent.png
|
110
|
+
- app/assets/images/text_indent_remove.png
|
111
|
+
- app/assets/images/text_italic.png
|
112
|
+
- app/assets/images/text_list_bullets.png
|
113
|
+
- app/assets/images/text_list_numbers.png
|
114
|
+
- app/assets/images/text_strikethrough.png
|
115
|
+
- app/assets/images/text_subscript.png
|
116
|
+
- app/assets/images/text_superscript.png
|
117
|
+
- app/assets/images/text_underline.png
|
118
|
+
- app/assets/images/trash.png
|
94
119
|
- app/assets/javascripts/ledge/index.coffee
|
95
120
|
- app/assets/javascripts/ledge/rows/heading.coffee
|
96
|
-
- app/assets/javascripts/ledge/rows/heading.rb
|
97
121
|
- app/assets/javascripts/ledge/rows/row.coffee
|
98
|
-
- app/assets/javascripts/ledge/rows/row.rb
|
99
122
|
- app/assets/javascripts/ledge/rows/text.coffee
|
100
|
-
- app/assets/javascripts/ledge/rows/text.rb
|
101
123
|
- app/assets/stylesheets/ledge/index.scss
|
102
124
|
- lib/ledge.rb
|
103
125
|
- lib/ledge/column.rb
|
data/README.rdoc
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
class Heading < Row
|
2
|
-
@@type = "heading"
|
3
|
-
@@name = "Heading"
|
4
|
-
@@initial_content = "<h1>Heading</h1>"
|
5
|
-
@@options = ["H1", "H2", "H3", "H4", "H5", "H6"]
|
6
|
-
@@icons = {
|
7
|
-
h1: "https://cdn1.iconfinder.com/data/icons/silk2/text_heading_1.png",
|
8
|
-
h2: "https://cdn1.iconfinder.com/data/icons/silk2/text_heading_2.png",
|
9
|
-
h3: "https://cdn1.iconfinder.com/data/icons/silk2/text_heading_3.png",
|
10
|
-
h4: "https://cdn1.iconfinder.com/data/icons/silk2/text_heading_4.png",
|
11
|
-
h5: "https://cdn1.iconfinder.com/data/icons/silk2/text_heading_5.png",
|
12
|
-
h6: "https://cdn1.iconfinder.com/data/icons/silk2/text_heading_6.png"
|
13
|
-
}
|
14
|
-
|
15
|
-
def on_option row, option
|
16
|
-
text = jQuery(row).find("__ledge_row_content").children.text
|
17
|
-
jQuery(row).find("__ledge_row_content").html("<#{option}>#{text}</#{option}>")
|
18
|
-
end
|
19
|
-
end
|