scrivito_editors 0.71.2 → 0.90.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/scrivito_editors/binary_editor.js +41 -0
- data/app/assets/javascripts/scrivito_editors/date_editor.js +66 -0
- data/app/assets/javascripts/scrivito_editors/default_editor.js +43 -0
- data/app/assets/javascripts/scrivito_editors/deprecated_data_attrs.js +44 -0
- data/app/assets/javascripts/scrivito_editors/enum_editor.js +68 -0
- data/app/assets/javascripts/scrivito_editors/filter_context.js +54 -0
- data/app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js +33 -0
- data/app/assets/javascripts/scrivito_editors/helpers/imgly_assets.js.erb +5 -0
- data/app/assets/javascripts/scrivito_editors/helpers/setup_binary_button_container.js +12 -0
- data/app/assets/javascripts/scrivito_editors/html_editor.js +15 -0
- data/app/assets/javascripts/scrivito_editors/image_drop_editor.js +52 -0
- data/app/assets/javascripts/scrivito_editors/image_editor.js +114 -0
- data/app/assets/javascripts/scrivito_editors/link_editor.js +88 -0
- data/app/assets/javascripts/scrivito_editors/linklist_editor.js +187 -0
- data/app/assets/javascripts/scrivito_editors/medium_editor.js +97 -0
- data/app/assets/javascripts/scrivito_editors/multienum_editor.js +48 -0
- data/app/assets/javascripts/scrivito_editors/permalink_editor.js +124 -0
- data/app/assets/javascripts/scrivito_editors/placeholder.js +37 -0
- data/app/assets/javascripts/scrivito_editors/redactor_editor.js +155 -0
- data/app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js +41 -0
- data/app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_link_manager.js +56 -0
- data/app/assets/javascripts/scrivito_editors/reference_editor.js +60 -0
- data/app/assets/javascripts/scrivito_editors/referencelist_editor.js +120 -0
- data/app/assets/javascripts/scrivito_editors/reload.js +14 -0
- data/app/assets/javascripts/scrivito_editors/slider_editor.js +62 -0
- data/app/assets/javascripts/scrivito_editors/string_editor.js +156 -0
- data/app/assets/javascripts/scrivito_editors/stringlist_editor.js +22 -0
- data/app/assets/javascripts/scrivito_editors.js +3 -0
- data/app/assets/stylesheets/scrivito_editors/editors/medium_editor.css +20 -0
- data/app/assets/stylesheets/scrivito_editors/editors/{html_editor.css → redactor_editor.css} +0 -0
- data/app/assets/stylesheets/scrivito_editors/editors/referencelist_editor.css +4 -0
- data/app/assets/stylesheets/scrivito_editors/placeholder.css +14 -3
- data/app/helpers/scrivito_editors/scrivito_tag_helper.rb +40 -135
- data/lib/scrivito_editors/engine.rb +0 -1
- data/vendor/assets/javascripts/medium-editor.js +6445 -0
- data/{app → vendor}/assets/javascripts/redactor.js +0 -0
- data/{app/assets/javascripts/scrivito_editors → vendor/assets/javascripts}/redactor_plugins/table.js +0 -0
- data/vendor/assets/stylesheets/medium-editor-themes/flat.css +58 -0
- data/vendor/assets/stylesheets/medium-editor.css +214 -0
- metadata +78 -56
- data/app/assets/javascripts/scrivito_editors/binary_editor.js.coffee +0 -25
- data/app/assets/javascripts/scrivito_editors/date_editor.js.coffee +0 -59
- data/app/assets/javascripts/scrivito_editors/enum_editor.js.coffee +0 -41
- data/app/assets/javascripts/scrivito_editors/filter_context.js.coffee +0 -26
- data/app/assets/javascripts/scrivito_editors/helpers/file_dropzone.js.coffee +0 -16
- data/app/assets/javascripts/scrivito_editors/helpers/setup_binary_button_container.js.coffee +0 -6
- data/app/assets/javascripts/scrivito_editors/html_editor.js.coffee +0 -138
- data/app/assets/javascripts/scrivito_editors/image_drop_editor.js.coffee +0 -19
- data/app/assets/javascripts/scrivito_editors/image_editor.js.coffee.erb +0 -96
- data/app/assets/javascripts/scrivito_editors/link_editor.js.coffee +0 -141
- data/app/assets/javascripts/scrivito_editors/linklist_editor.js.coffee +0 -197
- data/app/assets/javascripts/scrivito_editors/multienum_editor.js.coffee +0 -42
- data/app/assets/javascripts/scrivito_editors/permalink_editor.js.coffee +0 -111
- data/app/assets/javascripts/scrivito_editors/placeholder.js.coffee +0 -22
- data/app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_image_manager.js.coffee +0 -22
- data/app/assets/javascripts/scrivito_editors/redactor_plugins/scrivito_editors_link_manager.js.coffee +0 -49
- data/app/assets/javascripts/scrivito_editors/reference_editor.js.coffee +0 -33
- data/app/assets/javascripts/scrivito_editors/referencelist_editor.js.coffee +0 -113
- data/app/assets/javascripts/scrivito_editors/reload.js.coffee +0 -12
- data/app/assets/javascripts/scrivito_editors/slider_editor.js.coffee +0 -41
- data/app/assets/javascripts/scrivito_editors/string_editor.js.coffee +0 -136
- data/app/assets/javascripts/scrivito_editors/stringlist_editor.js.coffee +0 -13
- data/app/helpers/scrivito_editors/cms_tag_helper.rb +0 -36
@@ -1,147 +1,52 @@
|
|
1
1
|
module ScrivitoEditors
|
2
|
-
# This module includes helpers that render the HTML for specfic CMS
|
3
|
-
# attributes and their JS editors. These special methods are needed
|
4
|
-
# because the editors need additional information that is not provided
|
5
|
-
# by the Scrivito SDK's ++scrivito_tag++ method.
|
6
2
|
module ScrivitoTagHelper
|
7
|
-
|
8
|
-
# Allows you to edit a CMS ++enum++ attribute using a dropdown
|
9
|
-
#
|
10
|
-
# @param [Obj, Widgegt] object
|
11
|
-
# @param [String, Symbol] attribute_name
|
12
|
-
# @param [Hash] options passed to the ++scrivito_tag++ helper
|
13
3
|
def scrivito_edit_enum(object, attribute_name, options = {})
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
values: values,
|
20
|
-
min: values.min,
|
21
|
-
max: values.max,
|
22
|
-
}
|
23
|
-
})
|
24
|
-
|
25
|
-
scrivito_tag(:div, object, attribute_name, options)
|
4
|
+
raise %{
|
5
|
+
The "scrivito_edit_enum" view helper has been removed.
|
6
|
+
Please use the "scrivito_tag" helper instead.
|
7
|
+
"scrivito_tag" now activates the enum editor by default for all enum attributes.
|
8
|
+
}
|
26
9
|
end
|
27
10
|
|
28
|
-
# Allows you to edit a CMS ++multienum++ attribute using a multi-select.
|
29
|
-
#
|
30
|
-
# @param [Obj, Widget] object
|
31
|
-
# @param [String, Symbol] attribute_name
|
32
|
-
# @param [Hash] options passed to the ++scrivito_tag++ helper
|
33
11
|
def scrivito_edit_multienum(object, attribute_name, options = {})
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
values: values,
|
40
|
-
}
|
41
|
-
})
|
42
|
-
|
43
|
-
scrivito_tag(:div, object, attribute_name, options) do |tag|
|
44
|
-
(object[attribute_name] || []).join(', ')
|
45
|
-
end
|
12
|
+
raise %{
|
13
|
+
The "scrivito_edit_multienum" view helper has been removed.
|
14
|
+
Please use the "scrivito_tag" helper instead.
|
15
|
+
"scrivito_tag" now activates the multienum editor by default for all multienum attributes.
|
16
|
+
}
|
46
17
|
end
|
47
18
|
|
48
|
-
# Allows you to edit a CMS ++reference++ attribute using the resource
|
49
|
-
# browser.
|
50
|
-
#
|
51
|
-
# @param [Obj, Widget] object
|
52
|
-
# @param [String, Symbol] attribute_name
|
53
|
-
# @param [Hash] options passed to the ++scrivito_tag++ helper
|
54
19
|
def scrivito_edit_reference(object, attribute_name, options = {})
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
# Allows you to edit a CMS ++linklist++ attribute
|
91
|
-
#
|
92
|
-
# @param [Obj, Widget] object
|
93
|
-
# @param [String, Symbol] attribute_name
|
94
|
-
# @param [Hash] options passed to the ++scrivito_tag++ helper
|
95
|
-
def scrivito_edit_linklist(object, attribute_name, options = {})
|
96
|
-
linklist = object[attribute_name]
|
97
|
-
|
98
|
-
scrivito_tag(:div, object, attribute_name, options) do
|
99
|
-
if linklist
|
100
|
-
content_tag(:ul) do
|
101
|
-
html = ''.html_safe
|
102
|
-
|
103
|
-
linklist.each do |link|
|
104
|
-
html << _edit_link_li(link)
|
105
|
-
end
|
106
|
-
|
107
|
-
html
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
# Allows you to edit a CMS ++link++ attribute
|
114
|
-
#
|
115
|
-
# @param [Obj, Widget] object
|
116
|
-
# @param [String, Symbol] attribute_name
|
117
|
-
# @param [Hash] options passed to the ++scrivito_tag++ helper
|
118
|
-
def scrivito_edit_link(object, attribute_name, options = {})
|
119
|
-
link = object[attribute_name]
|
120
|
-
|
121
|
-
scrivito_tag(:div, object, attribute_name, options) do
|
122
|
-
content_tag(:ul) { _edit_link_li(link || Scrivito::Link.new(url: "")) }
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
private
|
127
|
-
|
128
|
-
def _values_for(object, attribute_name)
|
129
|
-
object.attribute_definitions[attribute_name].try(:values) || []
|
130
|
-
end
|
131
|
-
|
132
|
-
def _edit_link_li(link)
|
133
|
-
query = link.query.present? ? "?#{link.query}" : ""
|
134
|
-
fragment = link.fragment.present? ? "##{link.fragment}" : ""
|
135
|
-
url = link.internal? ? scrivito_path(link).sub(/\?.*/, "#{query}#{fragment}") : link.url
|
136
|
-
description = link.internal? ? link.obj.description_for_editor : link.url
|
137
|
-
data = { description: description, title: link.title, url: url }
|
138
|
-
data[:id] = link.obj.id if link.internal?
|
139
|
-
|
140
|
-
content_tag(:li, data: data) do
|
141
|
-
content_tag(:span, class: 'list-content') do
|
142
|
-
"#{link.title} #{link_to(description, url, target: :_blank)}".html_safe
|
143
|
-
end
|
144
|
-
end
|
20
|
+
raise %{
|
21
|
+
The "scrivito_edit_reference" view helper has been removed.
|
22
|
+
Please use the "scrivito_tag" helper instead.
|
23
|
+
"scrivito_tag" now activates the reference editor by default for all reference attributes.
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
def scrivito_edit_referencelist(object, attribute_name, html_options = {}, editing_options = {})
|
28
|
+
raise %{
|
29
|
+
The "scrivito_edit_referencelist" view helper has been removed.
|
30
|
+
Please use the "scrivito_tag" helper instead.
|
31
|
+
"scrivito_tag" now activates the referencelist editor by default for all referencelist
|
32
|
+
attributes.
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def scrivito_edit_link(object, attribute_name, html_options = {}, editing_options = {})
|
37
|
+
raise %{
|
38
|
+
The "scrivito_edit_link" view helper has been removed.
|
39
|
+
Please use the "scrivito_tag" helper instead.
|
40
|
+
"scrivito_tag" now activates the link editor by default for all link attributes.
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
def scrivito_edit_linklist(object, attribute_name, html_options = {}, editing_options = {})
|
45
|
+
raise %{
|
46
|
+
The "scrivito_edit_linklist" view helper has been removed.
|
47
|
+
Please use the "scrivito_tag" helper instead.
|
48
|
+
"scrivito_tag" now activates the linklist editor by default for all linklist attributes.
|
49
|
+
}
|
145
50
|
end
|
146
51
|
end
|
147
52
|
end
|