radiant-filter_toolbars-extension 0.6.0 → 1.0.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.
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#Filter Toolbars
|
1
|
+
# Filter Toolbars
|
2
2
|
|
3
3
|
Adds a textile or markdown WYSIWYG filter to the admin textareas using Control.TextArea [http://livepipe.net/control/textarea]
|
4
4
|
|
@@ -7,7 +7,6 @@ If the Clipped asset manager extension is installed then the image button will l
|
|
7
7
|
|
8
8
|
## TODO
|
9
9
|
|
10
|
-
- Disable toolbar when selecting <none>
|
11
10
|
- Refactor duplicated filter funtions
|
12
11
|
- Implement SmartyPants
|
13
12
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module RadiantFilterToolbarsExtension
|
2
|
-
VERSION = '0.
|
2
|
+
VERSION = '1.0.0'
|
3
3
|
SUMMARY = 'WYSIWYG Toolbar for Radiant CMS'
|
4
4
|
DESCRIPTION = 'Adds a WYSIWYG toolbar for the textile and markdown filters.'
|
5
5
|
HOMEPAGE = 'https://github.com/jsntv200/radiant-filter_toolbars-extension'
|
@@ -1,6 +1,8 @@
|
|
1
1
|
var FilterToolBars = {
|
2
|
+
filter: null,
|
3
|
+
toolbar: null,
|
4
|
+
textarea: null,
|
2
5
|
className: 'filter_toolbar',
|
3
|
-
textarea: null,
|
4
6
|
buttons: [
|
5
7
|
{ title: 'Bold', slug: 'bold' },
|
6
8
|
{ title: 'Italics', slug: 'italics' },
|
@@ -14,9 +16,27 @@ var FilterToolBars = {
|
|
14
16
|
{ title: 'Image', slug: 'image', attrs: {href:'#attach_asset'}},
|
15
17
|
{ title: 'Block Quote', slug: 'quote' },
|
16
18
|
{ title: 'Help', slug: 'help' }
|
17
|
-
]
|
19
|
+
],
|
20
|
+
|
21
|
+
update_filter: function(filter) {
|
22
|
+
this.filter = filter || null;
|
23
|
+
this.filter == null ? this.hide() : this.show();
|
24
|
+
},
|
25
|
+
|
26
|
+
click: function(tag) {
|
27
|
+
this[this.filter][tag]();
|
28
|
+
},
|
29
|
+
|
30
|
+
show: function() {
|
31
|
+
this.toolbar.show();
|
32
|
+
},
|
33
|
+
|
34
|
+
hide: function() {
|
35
|
+
this.toolbar.hide();
|
36
|
+
}
|
18
37
|
}
|
19
38
|
|
39
|
+
|
20
40
|
FilterToolBars.Filters = {
|
21
41
|
image: function() {
|
22
42
|
return false;
|
@@ -28,6 +48,7 @@ FilterToolBars.Filters = {
|
|
28
48
|
}
|
29
49
|
}
|
30
50
|
|
51
|
+
|
31
52
|
FilterToolBars.AttachBehavior = Behavior.create({
|
32
53
|
initialize: function(options) {
|
33
54
|
this.textarea = new Control.TextArea(this.element);
|
@@ -42,40 +63,64 @@ FilterToolBars.AttachBehavior = Behavior.create({
|
|
42
63
|
var attributes = Object.extend({ className: 'button_' + button.slug, title: button.title }, button.attrs || {})
|
43
64
|
this.toolbar.addButton(button.title, function() { this.click(button.slug) }.bind(this), attributes);
|
44
65
|
}.bind(this));
|
66
|
+
|
67
|
+
if (this.element.up('.page').visible()) {
|
68
|
+
FilterToolBars.textarea = this.textarea;
|
69
|
+
}
|
45
70
|
},
|
46
71
|
|
47
72
|
click: function(tag) {
|
48
73
|
FilterToolBars.textarea = this.textarea;
|
49
|
-
FilterToolBars
|
50
|
-
}
|
74
|
+
FilterToolBars.click(tag);
|
75
|
+
}
|
76
|
+
});
|
51
77
|
|
52
|
-
filter: function() {
|
53
|
-
return this.element.up('.part').down('select').getValue();
|
54
|
-
},
|
55
78
|
|
56
|
-
|
57
|
-
|
79
|
+
FilterToolBars.TabBehavior = Behavior.create({
|
80
|
+
initialize: function(options) {
|
81
|
+
this.element.observe('click', this.change.bind(this));
|
82
|
+
this.element.observe('init:click', this.change.bind(this));
|
83
|
+
|
84
|
+
|
85
|
+
if (this.element.hasClassName('here')) {
|
86
|
+
this.element.fire('init:click');
|
87
|
+
this.element.stopObserving('init:click');
|
88
|
+
}
|
58
89
|
},
|
59
90
|
|
60
|
-
|
61
|
-
|
91
|
+
change: function(event) {
|
92
|
+
var e = event.findElement('.tab');
|
93
|
+
|
94
|
+
if (e) {
|
95
|
+
var page = TabControls.tab_control.findTabByElement(e).page;
|
96
|
+
var filter = page.down('select').getValue();
|
97
|
+
|
98
|
+
FilterToolBars.toolbar = page.down('.filter_toolbar');
|
99
|
+
FilterToolBars.update_filter(filter);
|
100
|
+
}
|
62
101
|
}
|
63
102
|
});
|
64
103
|
|
65
|
-
|
104
|
+
|
105
|
+
FilterToolBars.SelectBehavior = Behavior.create({
|
66
106
|
initialize: function(options) {
|
67
|
-
this.change();
|
68
107
|
this.element.observe('change', this.change.bind(this));
|
108
|
+
|
109
|
+
if (this.element.up('.page').visible()) {
|
110
|
+
this.change();
|
111
|
+
}
|
69
112
|
},
|
70
113
|
|
71
|
-
change: function() {
|
72
|
-
|
114
|
+
change: function(event) {
|
115
|
+
var filter = this.element.getValue();
|
116
|
+
FilterToolBars.update_filter(filter);
|
73
117
|
}
|
74
118
|
});
|
75
119
|
|
120
|
+
|
76
121
|
Event.addBehavior({
|
77
|
-
'.part
|
78
|
-
'.
|
79
|
-
'
|
122
|
+
'.part textarea' : FilterToolBars.AttachBehavior(),
|
123
|
+
'.tabs .tab' : FilterToolBars.TabBehavior(),
|
124
|
+
'.part select' : FilterToolBars.SelectBehavior()
|
80
125
|
});
|
81
126
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
background-color:#F6F6F6;
|
11
11
|
width:100%;
|
12
12
|
height:26px;
|
13
|
-
border-bottom:
|
13
|
+
border-bottom:0;
|
14
14
|
|
15
15
|
li {
|
16
16
|
list-style:none;
|
@@ -21,7 +21,7 @@
|
|
21
21
|
}
|
22
22
|
|
23
23
|
a {
|
24
|
-
margin:
|
24
|
+
margin:2px;
|
25
25
|
width:20px;
|
26
26
|
height:20px;
|
27
27
|
float:left;
|
@@ -31,7 +31,7 @@
|
|
31
31
|
|
32
32
|
&:hover {
|
33
33
|
border-color:#0A246A;
|
34
|
-
background-color
|
34
|
+
background-color:#B2BBD0;
|
35
35
|
}
|
36
36
|
}
|
37
37
|
|
@@ -48,10 +48,10 @@
|
|
48
48
|
|
49
49
|
.button_bold { background-position:0 0 }
|
50
50
|
.button_italics { background-position:-60px 0 }
|
51
|
-
.button_h1 { background-position
|
52
|
-
.button_h2 { background-position
|
53
|
-
.button_h3 { background-position
|
54
|
-
.button_h4 { background-position
|
51
|
+
.button_h1 { background-position:-660px 0 }
|
52
|
+
.button_h2 { background-position:-680px 0 }
|
53
|
+
.button_h3 { background-position:-700px 0 }
|
54
|
+
.button_h4 { background-position:-720px 0 }
|
55
55
|
.button_ordered { background-position:-80px 0 }
|
56
56
|
.button_unordered { background-position:-20px 0 }
|
57
57
|
.button_link { background-position:-500px 0 }
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-filter_toolbars-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
- 6
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 1.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jason Taylor
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-07-19 00:00:00 +10:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -52,7 +52,7 @@ has_rdoc: true
|
|
52
52
|
homepage: https://github.com/jsntv200/radiant-filter_toolbars-extension
|
53
53
|
licenses: []
|
54
54
|
|
55
|
-
post_install_message: "\n Add this to your radiant project with:\n config.gem 'radiant-filter_toolbars-extension', :version => '~>0.
|
55
|
+
post_install_message: "\n Add this to your radiant project with:\n config.gem 'radiant-filter_toolbars-extension', :version => '~>1.0.0'\n "
|
56
56
|
rdoc_options: []
|
57
57
|
|
58
58
|
require_paths:
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
requirements: []
|
79
79
|
|
80
80
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.
|
81
|
+
rubygems_version: 1.5.0
|
82
82
|
signing_key:
|
83
83
|
specification_version: 3
|
84
84
|
summary: WYSIWYG Toolbar for Radiant CMS
|