fondant-rails 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/fondant-rails/version.rb +1 -1
- data/vendor/assets/javascripts/fondant.coffee +22 -29
- data/vendor/assets/stylesheets/fondant.scss +13 -22
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea8f67fa775fe28e3580606bb997dc6119e77a3c
|
4
|
+
data.tar.gz: 15a8d98d368a0581a19fab8eb76086374caf56df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc2bb3d8b65ca95b2ae078f895a120f8eae061cffa8fbfcfc52fa317231f340e6613fd432e52be7f61e9b456192cab8a304c1aa574563e7e97cbf74eee08d194
|
7
|
+
data.tar.gz: c2b6c5dc93d52e0b21e6cc561a7b83b4c9b394cdc94ebc1343496f3d0fda27d34d1d2479126ebe12d03075c278ff30a6a1a29bdcc4518d20666e02bd269733c9
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# ## Fondant v0.
|
1
|
+
# ## Fondant v0.6.0
|
2
2
|
#
|
3
3
|
# The icing on the cake for user input. A simple jQuery HTML5 WYSIWYG editor
|
4
4
|
# using `contenteditable`.
|
@@ -38,6 +38,12 @@
|
|
38
38
|
# a toolbar and you are responsible for building and wiring up your own.
|
39
39
|
# (default: `true`)
|
40
40
|
#
|
41
|
+
# * `buttons` - An array of commands to include as buttons. Links & custom html cannot be
|
42
|
+
# automatically addes as a toolbar button because there needs to be some form of input between
|
43
|
+
# the button click and the application. Everything else is available to use.
|
44
|
+
# (default: [ 'bold', 'italic', 'p', 'h1', 'h2', 'h3', 'h4', 'blockquote', 'ol', 'ul', 'indent',
|
45
|
+
# 'outdent', 'remove', 'unlink', 'undo', 'redo' ]`)
|
46
|
+
#
|
41
47
|
|
42
48
|
|
43
49
|
$ = jQuery
|
@@ -50,6 +56,7 @@ if typeof $ isnt 'undefined'
|
|
50
56
|
# is called.
|
51
57
|
#
|
52
58
|
class Fondant
|
59
|
+
version: "0.6.0"
|
53
60
|
|
54
61
|
# ## Methods
|
55
62
|
|
@@ -120,7 +127,7 @@ if typeof $ isnt 'undefined'
|
|
120
127
|
#
|
121
128
|
bindToolbar: ->
|
122
129
|
for action in @actions
|
123
|
-
$button = $("[data-action='#{ @type }-#{ action }']")
|
130
|
+
$button = $("##{ @type }-#{ @id } [data-action='#{ @type }-#{ action }']")
|
124
131
|
$button.on 'click.fondant', { action: action, editor: this }, (event) ->
|
125
132
|
event.preventDefault()
|
126
133
|
event.data.editor[event.data.action]()
|
@@ -131,7 +138,7 @@ if typeof $ isnt 'undefined'
|
|
131
138
|
# this is not needed since the DOM elements will be destroyed
|
132
139
|
#
|
133
140
|
unbindToolbar: ->
|
134
|
-
$("[data-action^='#{ @type }-']").off('.fondant') unless @options.toolbar
|
141
|
+
$("##{ @type }-#{ @id } [data-action^='#{ @type }-']").off('.fondant') unless @options.toolbar
|
135
142
|
|
136
143
|
# ### removeToolbar()
|
137
144
|
#
|
@@ -397,33 +404,13 @@ if typeof $ isnt 'undefined'
|
|
397
404
|
# ### templates.toolbar()
|
398
405
|
#
|
399
406
|
toolbar: ->
|
400
|
-
group = @toolbarClass() + '-button-group'
|
401
407
|
button = @toolbarClass() + '-button'
|
402
|
-
"""
|
403
|
-
|
404
|
-
<li class="#{
|
405
|
-
<
|
406
|
-
|
407
|
-
|
408
|
-
</ul>
|
409
|
-
<li class="#{ group }-label">Block Styles</li>
|
410
|
-
<ul class="#{ group }">
|
411
|
-
<li class="#{ button } #{ button }-p"><a href="#" data-action="#{ @fondant.type }-p">P</a></li>
|
412
|
-
<li class="#{ button } #{ button }-h1"><a href="#" data-action="#{ @fondant.type }-h1">H1</a></li>
|
413
|
-
<li class="#{ button } #{ button }-h2"><a href="#" data-action="#{ @fondant.type }-h2">H2</a></li>
|
414
|
-
<li class="#{ button } #{ button }-h3"><a href="#" data-action="#{ @fondant.type }-h3">H3</a></li>
|
415
|
-
<li class="#{ button } #{ button }-h4"><a href="#" data-action="#{ @fondant.type }-h4">H4</a></li>
|
416
|
-
<li class="#{ button } #{ button }-blockquote"><a href="#" data-action="#{ @fondant.type }-blockquote">Quote</a></li>
|
417
|
-
</ul>
|
418
|
-
<li class="#{ group }-label">Lists</li>
|
419
|
-
<ul class="#{ group }">
|
420
|
-
<li class="#{ button } #{ button }-ol"><a href="#" data-action="#{ @fondant.type }-ol">Numbers</a></li>
|
421
|
-
<li class="#{ button } #{ button }-ul"><a href="#" data-action="#{ @fondant.type }-ul">Bullets</a></li>
|
422
|
-
<li class="#{ button } #{ button }-indent"><a href="#" data-action="#{ @fondant.type }-indent">Increase Indent</a></li>
|
423
|
-
<li class="#{ button } #{ button }-outdent"><a href="#" data-action="#{ @fondant.type }-outdent">Decrease Indent</a></li>
|
424
|
-
</ul>
|
425
|
-
</ul>
|
426
|
-
"""
|
408
|
+
html = """<ul class="#{ @toolbarClass() }">"""
|
409
|
+
for action in @fondant.options.buttons
|
410
|
+
html += """<li class="#{ button } #{ button }-#{ action }">"""
|
411
|
+
html += """<a href="#" data-action="#{ @fondant.type }-#{ action }">#{ action }</a>"""
|
412
|
+
html += """</li>"""
|
413
|
+
html
|
427
414
|
|
428
415
|
window.Fondant = Fondant
|
429
416
|
|
@@ -465,4 +452,10 @@ if typeof $ isnt 'undefined'
|
|
465
452
|
$.fn.fondant.defaults =
|
466
453
|
prefix: 'fondant'
|
467
454
|
toolbar: true
|
455
|
+
buttons: [
|
456
|
+
'bold', 'italic',
|
457
|
+
'p', 'h1', 'h2', 'h3', 'h4', 'blockquote',
|
458
|
+
'ol', 'ul', 'indent', 'outdent',
|
459
|
+
'remove', 'unlink', 'undo', 'redo'
|
460
|
+
]
|
468
461
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// Fondant v0.
|
1
|
+
// Fondant v0.6.0
|
2
2
|
// see http://github.com/ovenbits-ingredients/fondant for more information
|
3
3
|
//
|
4
4
|
.fondant-toolbar {
|
@@ -8,30 +8,21 @@
|
|
8
8
|
padding: 0;
|
9
9
|
|
10
10
|
li {
|
11
|
-
display:
|
12
|
-
|
13
|
-
|
14
|
-
ul {
|
15
|
-
display: inline;
|
16
|
-
margin: 0;
|
17
|
-
padding: 0;
|
18
|
-
|
19
|
-
li {
|
20
|
-
display: inline-block;
|
11
|
+
display: inline-block;
|
12
|
+
margin-right: 3px;
|
21
13
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
}
|
14
|
+
a {
|
15
|
+
background: #eee;
|
16
|
+
border: 1px solid #ddd;
|
17
|
+
border-radius: 0.3rem;
|
18
|
+
color: #777;
|
19
|
+
padding: 0.2rem 0.4rem;
|
20
|
+
&:hover {
|
21
|
+
background: #e0e0e0;
|
22
|
+
text-decoration: none;
|
32
23
|
}
|
33
|
-
|
34
24
|
}
|
35
25
|
}
|
26
|
+
|
36
27
|
}
|
37
28
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fondant-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phillip Ridlen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|