collective.z3cform.select2 4.0.0__py3-none-any.whl

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.
Files changed (38) hide show
  1. collective/z3cform/select2/__init__.py +7 -0
  2. collective/z3cform/select2/browser/__init__.py +0 -0
  3. collective/z3cform/select2/browser/configure.zcml +21 -0
  4. collective/z3cform/select2/browser/select2widget.py +55 -0
  5. collective/z3cform/select2/browser/static/select2-widget.css +11 -0
  6. collective/z3cform/select2/browser/static/select2-widget.js +42 -0
  7. collective/z3cform/select2/browser/templates/select2-view.js +333 -0
  8. collective/z3cform/select2/browser/templates/select2.pt +50 -0
  9. collective/z3cform/select2/configure.zcml +11 -0
  10. collective/z3cform/select2/interfaces.py +9 -0
  11. collective/z3cform/select2/locales/collective.z3cform.select2.pot +0 -0
  12. collective/z3cform/select2/locales/update.sh +12 -0
  13. collective/z3cform/select2/minimal.zcml +70 -0
  14. collective/z3cform/select2/profiles/default/browserlayer.xml +7 -0
  15. collective/z3cform/select2/profiles/default/collectivez3cformselect2_default.txt +0 -0
  16. collective/z3cform/select2/profiles/default/metadata.xml +7 -0
  17. collective/z3cform/select2/profiles/default/registry.xml +24 -0
  18. collective/z3cform/select2/profiles/uninstall/browserlayer.xml +8 -0
  19. collective/z3cform/select2/profiles/uninstall/registry.xml +15 -0
  20. collective/z3cform/select2/testing.py +46 -0
  21. collective/z3cform/select2/tests/__init__.py +0 -0
  22. collective/z3cform/select2/tests/robot/test_example.robot +66 -0
  23. collective/z3cform/select2/tests/test_robot.py +30 -0
  24. collective/z3cform/select2/tests/test_setup.py +46 -0
  25. collective/z3cform/select2/tests/test_widgets.py +113 -0
  26. collective/z3cform/select2/widget/__init__.py +1 -0
  27. collective/z3cform/select2/widget/adapters.zcml +37 -0
  28. collective/z3cform/select2/widget/bootstrap.zcml +13 -0
  29. collective/z3cform/select2/widget/configure.zcml +52 -0
  30. collective/z3cform/select2/widget/multi_select2_input.pt +45 -0
  31. collective/z3cform/select2/widget/single_select2_input.pt +45 -0
  32. collective/z3cform/select2/widget/widget.py +93 -0
  33. collective/z3cform/select2/widget/widget_display.pt +26 -0
  34. collective/z3cform/select2/widget/widget_input.pt +49 -0
  35. collective_z3cform_select2-4.0.0.dist-info/METADATA +355 -0
  36. collective_z3cform_select2-4.0.0.dist-info/RECORD +38 -0
  37. collective_z3cform_select2-4.0.0.dist-info/WHEEL +5 -0
  38. collective_z3cform_select2-4.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,7 @@
1
+ # -*- coding: utf-8 -*-
2
+ """Init and utils."""
3
+
4
+ from zope.i18nmessageid import MessageFactory
5
+
6
+
7
+ _ = MessageFactory("collective.z3cform.select2")
File without changes
@@ -0,0 +1,21 @@
1
+ <configure
2
+ xmlns="http://namespaces.zope.org/zope"
3
+ xmlns:browser="http://namespaces.zope.org/browser"
4
+ xmlns:faceted="http://namespaces.zope.org/faceted"
5
+ i18n_domain="collective.z3cform.select2">
6
+
7
+ <browser:resource
8
+ name="faceted.select2.view.js"
9
+ file="./templates/select2-view.js"
10
+ />
11
+
12
+ <browser:resourceDirectory
13
+ directory="static"
14
+ name="select2-widget"
15
+ layer="collective.z3cform.select2.interfaces.ICollectiveZ3CformSelect2Layer"
16
+ />
17
+
18
+ <faceted:widget factory=".select2widget.Widget"
19
+ schema=".select2widget.ISelect2Schema" />
20
+
21
+ </configure>
@@ -0,0 +1,55 @@
1
+ # -*- coding: utf-8 -*-
2
+ from eea.facetednavigation.widgets import ViewPageTemplateFile
3
+ from eea.facetednavigation.widgets.select.interfaces import ISelectSchema
4
+ from eea.facetednavigation.widgets.select.widget import Widget as SelectWidget
5
+ from Products.CMFPlone.utils import safe_unicode
6
+ from zope.i18n import MessageFactory
7
+
8
+
9
+ _ = MessageFactory("collective.z3cform.select2")
10
+
11
+
12
+ def compare_lowercase(a, b):
13
+ a = safe_unicode(a)
14
+ b = safe_unicode(b)
15
+ return a.lower() == b.lower()
16
+
17
+
18
+ class ISelect2Schema(ISelectSchema):
19
+ """ """
20
+
21
+
22
+ class Widget(SelectWidget):
23
+ """Widget"""
24
+
25
+ # Widget properties
26
+ widget_type = "select2"
27
+ widget_label = _("Select2")
28
+
29
+ index = ViewPageTemplateFile("templates/select2.pt")
30
+
31
+ @property
32
+ def default(self):
33
+ """Get default values"""
34
+ default = super(SelectWidget, self).default
35
+ if not default:
36
+ return []
37
+
38
+ if isinstance(default, str):
39
+ default = [
40
+ default,
41
+ ]
42
+
43
+ return default
44
+
45
+ def selected(self, key):
46
+ """Return True if key in self.default"""
47
+ default = self.default
48
+ if not default:
49
+ return False
50
+
51
+ for item in default:
52
+ if compare_lowercase(key, item):
53
+ return True
54
+
55
+ return False
@@ -0,0 +1,11 @@
1
+ .select2-search {
2
+ z-index: 110000 !important;
3
+ }
4
+
5
+ .select2-drop-mask {
6
+ z-index: 19998 !important;
7
+ }
8
+
9
+ .select2-drop {
10
+ z-index: 19999 !important;
11
+ }
@@ -0,0 +1,42 @@
1
+ var initializeSelect2SingleWidget = function(obj, width) {
2
+ if (typeof width === "undefined") {
3
+ width = 'resolve';
4
+ }
5
+
6
+ var format = function(state) {
7
+ var option = $(state.element);
8
+ return '<span class="' + option.data('css') + '">' + state.text + '</span>';
9
+ };
10
+
11
+ jQuery(obj).select2({
12
+ width: width,
13
+ formatResult: format,
14
+ formatSelection: format,
15
+ escapeMarkup: function(m) { return m; }
16
+ });
17
+ };
18
+
19
+ initializeSelect2Widgets = function(width) {
20
+ if (typeof width === "undefined") {
21
+ width = 'resolve';
22
+ }
23
+
24
+ jQuery('form .single-select2-widget').each(function() {
25
+ if (jQuery(this).is(':visible') == true) {
26
+ initializeSelect2SingleWidget($(this), width=width);
27
+ } else {
28
+ initializeSelect2SingleWidget($(this), width='20em');
29
+ }
30
+ });
31
+
32
+ jQuery('form .multi-select2-widget').each(function() {
33
+ if (jQuery(this).is(':visible') == true) {
34
+ initializeSelect2SingleWidget($(this), width=width);
35
+ } else {
36
+ initializeSelect2SingleWidget($(this), width='20em');
37
+ }
38
+ });
39
+
40
+ };
41
+
42
+ jQuery(document).ready(initializeSelect2Widgets);
@@ -0,0 +1,333 @@
1
+ if (typeof(Faceted) != 'undefined') {
2
+ Faceted.taxonomySeparator = ' » ';
3
+ Faceted.taxonomyAllString = ' (tous)';
4
+
5
+ Faceted.initSelect2 = function(select) {
6
+ if (select.hasClass('init-select2-done')) {
7
+ return;
8
+ }
9
+ var options = {'children': {}};
10
+ jQuery.map(select.find('option'), function(option, index) {
11
+ var parts = option.title.split(Faceted.taxonomySeparator);
12
+ var current = options;
13
+ for(var j=0; j<parts.length; j++) {
14
+ if(!current.children[parts[j]]) {
15
+ current.children[parts[j]] = {children: {}};
16
+ }
17
+ current = current.children[parts[j]];
18
+ }
19
+ current.value = option.value;
20
+ current.title = parts[parts.length-1];
21
+ if(option.selected) {
22
+ current.selected = true;
23
+ }
24
+ });
25
+ select.find('option').remove();
26
+ var html = '';
27
+ function create_options(sub_option, depth) {
28
+ var selected = '';
29
+ if(sub_option.selected) {
30
+ selected = ' selected="selected"';
31
+ }
32
+ if (Object.keys(sub_option.children).length > 0) {
33
+ html += '<optgroup class="depth-' + depth + '" label="' + sub_option.title + '">';
34
+ html += '<option title="' + sub_option.title + '" value="' + sub_option.value + '"' + selected + '>' + sub_option.title + Faceted.taxonomyAllString + '</option>';
35
+ for(var child in sub_option.children) {
36
+ create_options(sub_option.children[child], depth + 1);
37
+ }
38
+ html += '</optgroup>';
39
+ } else {
40
+ if(sub_option.value) {
41
+ html += '<option title="' + sub_option.title + '" value="' + sub_option.value + '"' + selected + '>' + sub_option.title + '</option>';
42
+ }
43
+ }
44
+ }
45
+ for (var child in options.children) {
46
+ create_options(options.children[child], 0);
47
+ }
48
+ select.append(html);
49
+ // select2 doesn't seem to like '-' in the id...
50
+ // you get the error "TypeError: b[0] is undefined"
51
+ select.select2();
52
+ select.siblings('button[data-select2-open]').click(function(){
53
+ jQuery('#' + jQuery(this).data('select2-open')).select2('open');
54
+ });
55
+ select.siblings('.select2-container')[0].style.minWidth = '200px';
56
+ select.addClass('init-select2-done');
57
+ };
58
+
59
+
60
+ jQuery(document).ready(function() {
61
+ // very important to have 'select' in the selector to avoid
62
+ // error "uncaught exception: query function not defined for Select2 someid"
63
+ // when it actually process a div.z3cform-select2
64
+ jQuery('select.z3cform-select2').each(function(i, elem) {
65
+ Faceted.initSelect2($(elem));
66
+ });
67
+ jQuery(document).on('formOverlayLoadSuccess', function(e, req, myform, api, pb, ajax_parent) {
68
+ jQuery('select.z3cform-select2').each(function(i, elem) {
69
+ Faceted.initSelect2($(elem));
70
+ });
71
+ });
72
+ jQuery(document).on('loadInsideOverlay', function(e, el, responseText, errorText, api) {
73
+ jQuery('select.z3cform-select2').each(function(i, elem) {
74
+ Faceted.initSelect2($(elem));
75
+ });
76
+ });
77
+ // jQuery('button[data-select2-open]').hide();
78
+ });
79
+
80
+
81
+ /* Select Widget
82
+ */
83
+ Faceted.Select2Widget = function(wid){
84
+ this.wid = wid;
85
+ this.widget = jQuery('#' + this.wid + '_widget');
86
+ this.widget.show();
87
+ this.title = jQuery('legend', this.widget).html();
88
+ this.elements = jQuery('option', this.widget);
89
+ this.select = jQuery('#' + this.wid);
90
+ this.selected = [];
91
+
92
+ // Faceted version
93
+ this.version = '';
94
+ var version = jQuery('#faceted-version');
95
+ if(version){
96
+ this.version = version.text();
97
+ }
98
+
99
+ // Handle change
100
+ jQuery('form', this.widget).submit(function(){
101
+ return false;
102
+ });
103
+
104
+ var js_widget = this;
105
+ this.select.change(function(evt){
106
+ js_widget.select_change(this, evt);
107
+ });
108
+
109
+ // Default value
110
+ var value = this.select.val();
111
+ if(value){
112
+ this.selected = jQuery("option[value='" + value + "']", js_widget.widget);
113
+ Faceted.Query[this.wid] = [value];
114
+ }
115
+
116
+ // Bind events
117
+ jQuery(Faceted.Events).bind(Faceted.Events.QUERY_CHANGED, function(evt){
118
+ js_widget.synchronize();
119
+ });
120
+ jQuery(Faceted.Events).bind(Faceted.Events.RESET, function(evt){
121
+ js_widget.reset();
122
+ });
123
+ if(this.widget.hasClass('faceted-count')){
124
+ var sortcountable = this.widget.hasClass('faceted-sortcountable');
125
+ jQuery(Faceted.Events).bind(Faceted.Events.QUERY_INITIALIZED, function(evt){
126
+ js_widget.count(sortcountable);
127
+ });
128
+ jQuery(Faceted.Events).bind(Faceted.Events.FORM_DO_QUERY, function(evt, data){
129
+ if(data.wid == js_widget.wid || data.wid == 'b_start'){
130
+ return;
131
+ }
132
+ js_widget.count(sortcountable);
133
+ });
134
+ }
135
+ Faceted.initSelect2(this.select);
136
+ };
137
+
138
+ Faceted.Select2Widget.prototype = {
139
+ select_change: function(element, evt){
140
+ if(!jQuery(element).val()){
141
+ element = null;
142
+ }
143
+ this.do_query(element);
144
+ },
145
+
146
+ do_query: function(element){
147
+ if(!element){
148
+ this.selected = [];
149
+ return Faceted.Form.do_query(this.wid, []);
150
+ }else{
151
+ var value = jQuery.map(
152
+ jQuery('#' + this.wid).select2('data'),
153
+ function(option) {return option.id;}
154
+ );
155
+ return Faceted.Form.do_query(this.wid, value);
156
+ }
157
+ },
158
+
159
+ reset: function(){
160
+ this.select.val(null).trigger("change.select2");
161
+ this.selected = [];
162
+ },
163
+
164
+ synchronize: function(){
165
+ var current_values = Faceted.Query[this.wid];
166
+ if(!current_values){
167
+ this.reset();
168
+ return;
169
+ }
170
+ if(current_values){
171
+ var context = this;
172
+ var selected = [];
173
+ this.select.val(current_values).trigger("change.select2");
174
+ jQuery.each(current_values, function(i, value){
175
+ var option_el = jQuery("option[value='" + value + "']", context.widget);
176
+ jQuery(option_el).attr('selected', 'selected');
177
+ selected.push(option_el);
178
+ });
179
+ if(!selected.length){
180
+ context.reset();
181
+ }else{
182
+ context.selected = selected;
183
+ }
184
+ }
185
+ },
186
+
187
+ criteria: function(){
188
+ var html = [];
189
+ var title = this.criteria_title();
190
+ var body = this.criteria_body();
191
+ if(title){
192
+ html.push(title);
193
+ }
194
+ if(body){
195
+ html.push(body);
196
+ }
197
+ return html;
198
+ },
199
+
200
+ criteria_title: function(){
201
+ if(!this.selected.length){
202
+ return '';
203
+ }
204
+
205
+ var link = jQuery('<a href="#">[X]</a>');
206
+ link.attr('id', 'criteria_' + this.wid);
207
+ link.attr('title', 'Remove ' + this.title + ' filters');
208
+ var widget = this;
209
+ link.click(function(evt){
210
+ widget.criteria_remove();
211
+ return false;
212
+ });
213
+
214
+ var html = jQuery('<dt>');
215
+ html.attr('id', 'criteria_' + this.wid + '_label');
216
+ html.append(link);
217
+ html.append('<span>' + this.title + '</span>');
218
+ return html;
219
+ },
220
+
221
+ criteria_body: function(){
222
+ if(!this.selected.length){
223
+ return '';
224
+ }
225
+
226
+ var widget = this;
227
+ var html = jQuery('<dd>');
228
+ var span = jQuery('<span class="faceted-select-criterion">');
229
+ html.attr('id', 'criteria_' + this.wid + '_entries');
230
+
231
+
232
+ jQuery.each(this.selected, function(i, elem) {
233
+ var element = jQuery(elem);
234
+ var value = element.val();
235
+ var label = element.attr('title');
236
+ var link = jQuery('<a href="#">[X]</a>');
237
+ var to_remove = value;
238
+ if(!value) {
239
+ value = element.parent().find('a').text();
240
+ to_remove = null;
241
+ }
242
+
243
+ link.attr('id', 'criteria_' + widget.wid + '_' + value);
244
+ link.attr('title', 'Remove ' + label + ' filter');
245
+ link.click(function(evt){
246
+ widget.criteria_remove(to_remove, element);
247
+ return false;
248
+ });
249
+ span.append(link);
250
+ jQuery('<span>').text(label).appendTo(span);
251
+ html.append(span);
252
+ });
253
+
254
+ return html;
255
+ },
256
+
257
+ criteria_remove: function(value, element){
258
+ // Remove all
259
+ if(!value){
260
+ this.select.val(null).trigger("change.select2");
261
+ this.do_query();
262
+ }else{
263
+ element.attr('selected', false);
264
+ this.select.trigger("change.select2");
265
+ this.do_query(this.select);
266
+ }
267
+ },
268
+
269
+ count: function(sortcountable){
270
+ var query = Faceted.SortedQuery();
271
+ query.cid = this.wid;
272
+ if(this.version){
273
+ query.version = this.version;
274
+ }
275
+
276
+ var context = this;
277
+ jQuery(Faceted.Events).trigger(Faceted.Events.AJAX_START, {wid: context.wid});
278
+ jQuery.getJSON(Faceted.BASEURL + '@@faceted_counter', query, function(data){
279
+ context.count_update(data, sortcountable);
280
+ jQuery(Faceted.Events).trigger(Faceted.Events.AJAX_STOP, {wid: context.wid});
281
+ });
282
+ },
283
+
284
+ count_update: function(data, sortcountable){
285
+ var context = this;
286
+ var select = jQuery('select', context.widget);
287
+ var options = jQuery('option', context.widget);
288
+ var current_val = select.val();
289
+ jQuery(options).each(function(){
290
+ var option = jQuery(this);
291
+ option.removeClass('faceted-select-item-disabled');
292
+ option.attr('disabled', false);
293
+ var key = option.val();
294
+
295
+ var value = data[key];
296
+ value = value ? value : 0;
297
+ var option_txt = option.attr('title');
298
+ option_txt += ' (' + value + ')';
299
+
300
+ option.html(option_txt);
301
+ if(sortcountable){
302
+ option.data('count', value);
303
+ }
304
+ if(!value){
305
+ option.attr('disabled', 'disabled');
306
+ option.addClass('faceted-select-item-disabled');
307
+ }
308
+ });
309
+ if(sortcountable){
310
+ options.detach().sort(function(x, y) {
311
+ var a = jQuery(x).data('count');
312
+ var b = jQuery(y).data('count');
313
+ return b - a;
314
+ });
315
+ select.append(options);
316
+ select.val(current_val);
317
+ }
318
+ }
319
+ };
320
+
321
+ Faceted.initializeSelect2Widget = function(evt){
322
+ jQuery('div.faceted-select2-widget').each(function(){
323
+ var wid = jQuery(this).attr('id');
324
+ wid = wid.split('_')[0];
325
+ Faceted.Widgets[wid] = new Faceted.Select2Widget(wid);
326
+ });
327
+ };
328
+
329
+ jQuery(Faceted.Events).on(
330
+ Faceted.Events.INITIALIZE,
331
+ Faceted.initializeSelect2Widget
332
+ );
333
+ }
@@ -0,0 +1,50 @@
1
+ <div class="faceted-widget faceted-select2-widget" style="display: none"
2
+ i18n:domain="eea" tal:define="
3
+ error_view nocall:context/@@faceted.widget.error;
4
+ wid python:view.data.getId();
5
+ hidden python:view.hidden;
6
+ hidezerocount python:view.hidezerocount;
7
+ sortcountable python:view.sortcountable;
8
+ css string:faceted-widget faceted-select2-widget;
9
+ css python:hidden and css + ' faceted-widget-hidden' or css;
10
+ css python:view.countable and css + ' faceted-count' or css;
11
+ css python:sortcountable and css + ' faceted-sortcountable' or css;
12
+ css python:hidezerocount and css + ' faceted-zero-count-hidden' or css;
13
+ vocabulary python:view.vocabulary()"
14
+ tal:attributes="id string:${wid}_widget; class css"
15
+ tal:condition="vocabulary">
16
+
17
+ <fieldset class="widget-fieldset"
18
+ tal:define="title python:view.data.get('title', '')">
19
+ <legend tal:content="
20
+ python:view.translate(title)" i18n:translate="">Current Search</legend>
21
+ <form action="." method="get"
22
+ tal:on-error="structure python:error_view(error=error, cid=wid)">
23
+ <label class="select-field"
24
+ tal:attributes="for wid"
25
+ tal:content="python:view.translate(title)" />
26
+ <div class="input-prepend">
27
+ <button class="btn" type="button" tal:attributes="data-select2-open wid">
28
+ <i class="fa fa-search"></i>
29
+ </button>
30
+ <select tal:attributes="name wid; id wid"
31
+ class="select2-container select2-container-multi select2"
32
+ multiple="multiple">
33
+ <tal:option repeat="term vocabulary">
34
+ <option tal:define="
35
+ term_id python:term[0];
36
+ term_label python:term[1];
37
+ term_label python:view.translate(term_label);
38
+ chbox_id string:${wid}_${term_id};
39
+ chbox_id python:view.cleanup(chbox_id);"
40
+ tal:attributes="
41
+ selected python:view.selected(term_id);
42
+ value term_id;
43
+ title term_label;"
44
+ tal:content="term_label" />
45
+ </tal:option>
46
+ </select>
47
+ </div>
48
+ </form>
49
+ </fieldset>
50
+ </div>
@@ -0,0 +1,11 @@
1
+ <configure
2
+ xmlns="http://namespaces.zope.org/zope"
3
+ xmlns:five="http://namespaces.zope.org/five"
4
+ xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
5
+ xmlns:i18n="http://namespaces.zope.org/i18n"
6
+ i18n_domain="collective.z3cform.select2">
7
+
8
+ <include file="minimal.zcml" />
9
+ <include package=".widget" file="bootstrap.zcml" />
10
+
11
+ </configure>
@@ -0,0 +1,9 @@
1
+ # -*- coding: utf-8 -*-
2
+ """Module where all interfaces, events and exceptions live."""
3
+
4
+ from z3c.form.interfaces import IFormLayer
5
+ from zope.publisher.interfaces.browser import IDefaultBrowserLayer
6
+
7
+
8
+ class ICollectiveZ3CformSelect2Layer(IFormLayer, IDefaultBrowserLayer):
9
+ """Marker interface that defines a browser layer."""
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+ # i18ndude should be available in current $PATH (eg by running
3
+ # ``export PATH=$PATH:$BUILDOUT_DIR/bin`` when i18ndude is located in your buildout's bin directory)
4
+ #
5
+ # For every language you want to translate into you need a
6
+ # locales/[language]/LC_MESSAGES/collective.z3cform.select2.po
7
+ # (e.g. locales/de/LC_MESSAGES/collective.z3cform.select2.po)
8
+
9
+ domain=collective.z3cform.select2
10
+
11
+ i18ndude rebuild-pot --pot $domain.pot --create $domain ../
12
+ i18ndude sync --pot $domain.pot */LC_MESSAGES/$domain.po
@@ -0,0 +1,70 @@
1
+ <configure
2
+ xmlns="http://namespaces.zope.org/zope"
3
+ xmlns:five="http://namespaces.zope.org/five"
4
+ xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
5
+ xmlns:i18n="http://namespaces.zope.org/i18n"
6
+ i18n_domain="collective.z3cform.select2">
7
+
8
+ <i18n:registerTranslations directory="locales" />
9
+
10
+ <include package="z3c.form" file="meta.zcml" />
11
+ <include package="z3c.form" />
12
+ <include package="eea.facetednavigation" />
13
+
14
+ <include package=".browser" />
15
+ <include package=".widget" />
16
+
17
+ <genericsetup:registerProfile
18
+ name="default"
19
+ title="collective.z3cform.select2"
20
+ directory="profiles/default"
21
+ description="Installs the collective.z3cform.select2 add-on."
22
+ provides="Products.GenericSetup.interfaces.EXTENSION"
23
+ />
24
+
25
+ <genericsetup:registerProfile
26
+ name="uninstall"
27
+ title="collective.z3cform.select2 (uninstall)"
28
+ directory="profiles/uninstall"
29
+ description="Uninstalls the collective.z3cform.select2 add-on."
30
+ provides="Products.GenericSetup.interfaces.EXTENSION"
31
+ />
32
+
33
+ <genericsetup:upgradeSteps
34
+ source="1000"
35
+ destination="2000"
36
+ profile="collective.z3cform.select2:default">
37
+ <genericsetup:upgradeDepends
38
+ title="Update registered JS resources"
39
+ description="Reorder an update JS resources definition"
40
+ import_steps="jsregistry" />
41
+ </genericsetup:upgradeSteps>
42
+
43
+ <genericsetup:upgradeSteps
44
+ source="2000"
45
+ destination="3000"
46
+ profile="collective.z3cform.select2:default">
47
+ <genericsetup:upgradeDepends
48
+ title="Update registered JS resources"
49
+ import_steps="plone.app.registry" />
50
+ </genericsetup:upgradeSteps>
51
+
52
+ <genericsetup:upgradeSteps
53
+ source="3000"
54
+ destination="4000"
55
+ profile="collective.z3cform.select2:default">
56
+ <genericsetup:upgradeDepends
57
+ title="Update registered JS resources"
58
+ import_steps="plone.app.registry" />
59
+ </genericsetup:upgradeSteps>
60
+
61
+ <genericsetup:upgradeSteps
62
+ source="4000"
63
+ destination="5000"
64
+ profile="collective.z3cform.select2:default">
65
+ <genericsetup:upgradeDepends
66
+ title="Update registered JS resources"
67
+ import_steps="plone.app.registry" />
68
+ </genericsetup:upgradeSteps>
69
+
70
+ </configure>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0"?>
2
+ <layers>
3
+ <layer
4
+ name="collective.z3cform.select2"
5
+ interface="collective.z3cform.select2.interfaces.ICollectiveZ3CformSelect2Layer"
6
+ />
7
+ </layers>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0"?>
2
+ <metadata>
3
+ <version>5000</version>
4
+ <dependencies>
5
+ <dependency>profile-eea.facetednavigation:default</dependency>
6
+ </dependencies>
7
+ </metadata>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0"?>
2
+ <registry>
3
+
4
+ <!-- bundles definition -->
5
+ <records prefix="plone.bundles/collective-z3cform-select2"
6
+ interface='Products.CMFPlone.interfaces.IBundleRegistry'>
7
+ <value key="depends">plone</value>
8
+ <value key="enabled">True</value>
9
+ <value key="csscompilation">++resource++select2-widget/select2-widget.css</value>
10
+ <value key="jscompilation">++resource++select2-widget/select2-widget.js</value>
11
+ <value key="load_async">False</value>
12
+ <value key="load_defer">False</value>
13
+ </records>
14
+
15
+ <records prefix="plone.bundles/collective-z3cform-select2-faceted"
16
+ interface='Products.CMFPlone.interfaces.IBundleRegistry'>
17
+ <value key="depends">faceted.view</value>
18
+ <value key="enabled">True</value>
19
+ <value key="jscompilation">++resource++faceted.select2.view.js</value>
20
+ <value key="load_async">True</value>
21
+ <value key="load_defer">True</value>
22
+ </records>
23
+
24
+ </registry>