drg_cms 0.7.0.2 → 0.7.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/drg_cms/drg_cms.js +63 -18
  3. data/app/assets/javascripts/drg_cms/jquery.bpopup.js +372 -0
  4. data/app/assets/javascripts/drg_cms_application.js +1 -1
  5. data/app/assets/javascripts/drg_cms_cms.js +1 -1
  6. data/app/assets/stylesheets/drg_cms/drg_cms.css +37 -5
  7. data/app/assets/stylesheets/drg_cms/select-multiple.css +2 -2
  8. data/app/controllers/cmsedit_controller.rb +22 -24
  9. data/app/controllers/dc_application_controller.rb +8 -8
  10. data/app/controllers/dc_common_controller.rb +9 -6
  11. data/app/controllers/dc_main_controller.rb +0 -1
  12. data/app/controls/{dc_category_control.rb → dc_gallery_control.rb} +15 -30
  13. data/app/controls/dc_image_control.rb +180 -0
  14. data/app/controls/dc_page_control.rb +3 -3
  15. data/app/controls/dc_poll_result_control.rb +7 -8
  16. data/app/controls/dc_report.rb +9 -4
  17. data/app/controls/design_element_settings_control.rb +88 -37
  18. data/app/forms/all_options.yml +18 -7
  19. data/app/forms/cms_menu.yml +7 -2
  20. data/app/forms/dc_gallery.yml +1 -1
  21. data/app/forms/dc_image.yml +122 -0
  22. data/app/forms/dc_image_search.yml +72 -0
  23. data/app/forms/dc_page.yml +11 -8
  24. data/app/forms/dc_steps_template.yml +2 -1
  25. data/app/helpers/cms_common_helper.rb +24 -16
  26. data/app/helpers/cms_edit_helper.rb +26 -33
  27. data/app/helpers/cms_helper.rb +21 -5
  28. data/app/helpers/cms_index_helper.rb +53 -38
  29. data/app/helpers/dc_application_helper.rb +64 -72
  30. data/app/helpers/dc_image_helper.rb +127 -0
  31. data/app/models/concerns/dc_policy_rule_concern.rb +1 -1
  32. data/app/models/concerns/dc_user_concern.rb +12 -4
  33. data/app/models/dc_category.rb +12 -0
  34. data/app/models/dc_design.rb +5 -4
  35. data/app/models/dc_filter.rb +19 -18
  36. data/app/models/dc_image.rb +237 -0
  37. data/app/models/dc_internals.rb +5 -9
  38. data/app/models/dc_policy_role.rb +8 -8
  39. data/app/models/drgcms_form_fields/drgcms_field.rb +9 -26
  40. data/app/models/drgcms_form_fields/embedded.rb +11 -8
  41. data/app/models/drgcms_form_fields/journal_diff.rb +2 -2
  42. data/app/models/drgcms_form_fields/multitext_autocomplete.rb +51 -47
  43. data/app/models/drgcms_form_fields/select.rb +20 -14
  44. data/app/models/drgcms_form_fields/text_with_select.rb +5 -9
  45. data/app/renderers/dc_gallery_renderer.rb +10 -4
  46. data/app/renderers/dc_page_renderer.rb +7 -7
  47. data/app/renderers/dc_poll_renderer.rb +13 -12
  48. data/app/views/cmsedit/_edit_stuff.html.erb +1 -1
  49. data/app/views/cmsedit/edit.html.erb +1 -1
  50. data/app/views/cmsedit/index.html.erb +1 -1
  51. data/app/views/cmsedit/new.html.erb +1 -0
  52. data/config/locales/drgcms_en.yml +14 -2
  53. data/config/locales/drgcms_sl.yml +13 -2
  54. data/config/locales/models_en.yml +33 -0
  55. data/config/locales/models_sl.yml +44 -1
  56. data/drg_cms.gemspec +1 -1
  57. data/lib/drg_cms/version.rb +1 -1
  58. data/lib/drg_cms.rb +19 -5
  59. data/lib/generators/convert_to_ar/USAGE +8 -0
  60. data/lib/generators/convert_to_ar/convert_to_ar_generator.rb +158 -0
  61. metadata +16 -10
  62. data/app/assets/javascripts/drg_cms/jquery.bpopup.min.js +0 -7
  63. data/app/views/layouts/__cmsedit.html.erb +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02d39a65170a68812cc184efecaa6e53f0b0360c4133311e463a1e213005bda1
4
- data.tar.gz: 334d0446b894f7063a503fbb1dcb8fb69b54c128ea7ac8f21da941205a808da4
3
+ metadata.gz: f2d3e3ad52492c5dccf2b91cd7c9c1ea203b7a60c21b0e3d4f7947a3b298bd8b
4
+ data.tar.gz: a9b23d36c053d8770a661827a211e88172ccadf10eb0c0f17419e0069799f402
5
5
  SHA512:
6
- metadata.gz: 613591551d270da4a2ac32e6b9215d1985b50f209231a9c6d00ddedae95775a08386c7d89fffe5fd536d440b58e69d53659a653925c486e5e5c0c273902e3644
7
- data.tar.gz: 979c3b634d3a1ed71e7e0dab7f1aff20bc4ccd34df5f2695f05855beb833c3f716b342893ac638096d2fb5419dc87649751ebb85b8ca1905fe53c053af104284
6
+ metadata.gz: f745ccb1e0902369746c51da513b1487eca95b1bc02f1bd427ccca2403fc2fd54341cccf8359ab301206fcc5ae4e61d13f03ee30d42b5d3ce0e14a3d357b7d54
7
+ data.tar.gz: e61ee50affe2a0aa4a2ea5fd5a386cad6b3a0f614c2fd3233cab5a5ae47e553eeab290ab527678265153d76352b37dac95867a1ff558b4a4c29dcafbb080fcaf
@@ -87,13 +87,33 @@ confirmation_is_cancled = function(object) {
87
87
  *******************************************************************/
88
88
  update_select_depend = function(select_name, depend_name, method) {
89
89
  let select_field = $('#' + select_name);
90
- let depend_field = $('#' + depend_name);
91
-
90
+ let depend_value= ''
91
+ let depend_field= null;
92
+ let field_value= null;
93
+
94
+ depend_name.split(",").forEach( function(depend) {
95
+ if ( $('#record_' + depend.trim()).length ) {
96
+ depend_field = $('#record_' + depend.trim());
97
+ } else {
98
+ depend_field = $('#_record_' + depend.trim()); // virtual field
99
+ }
100
+
101
+ // checkbox
102
+ if (depend_field.is(':checkbox')) {
103
+ field_value = depend_field.is(":checked");
104
+ } else {
105
+ field_value = depend_field.val();
106
+ }
107
+
108
+ if (depend_value.length > 0) depend_value = depend_value + ',';
109
+ depend_value = depend_value + field_value;
110
+ });
111
+
92
112
  $.ajax({
93
113
  url: "/dc_common/autocomplete",
94
114
  type: "POST",
95
115
  dataType: "json",
96
- data: { input: depend_field.val(), search: method},
116
+ data: { input: depend_value, search: method},
97
117
  success: function(data) {
98
118
 
99
119
  select_field.empty();
@@ -478,11 +498,38 @@ function dc_url_add_params(form, url) {
478
498
  *******************************************************************/
479
499
  function dc_copy_to_clipboard(div) {
480
500
  let copyText = document.getElementById(div).innerText;
481
- console.log(copyText);
501
+ //console.log(copyText);
482
502
  /* Copy the text inside the text field */
483
503
  navigator.clipboard.writeText(copyText);
484
504
  }
485
505
 
506
+ /*******************************************************************
507
+ * Image preview called in images manager. Preview image in bPopup window.
508
+ *******************************************************************/
509
+ dc_image_preview = function(img) {
510
+ $('#dc-image-preview').bPopup({
511
+ content: 'image',
512
+ contentContainer: '#dc-image-preview',
513
+ loadUrl: img,
514
+ opacity: 0
515
+ });
516
+ };
517
+
518
+ /*******************************************************************
519
+ * Image selected in images manager. Return selected image file name to caller.
520
+ *******************************************************************/
521
+ dc_image_select = function(img) {
522
+ let ck_func_name = $.getUrlParam('CKEditorFuncNum');
523
+ let field_name = $.getUrlParam('field_name');
524
+ if (ck_func_name !== '') {
525
+ window.opener.CKEDITOR.tools.callFunction(ck_func_name, img);
526
+ } else {
527
+ window.opener.document.getElementById(field_name).value = img;
528
+ }
529
+ window.close();
530
+ };
531
+
532
+
486
533
  /*******************************************************************
487
534
  * Events start here
488
535
  *******************************************************************/
@@ -546,11 +593,12 @@ $(document).ready( function() {
546
593
  /*******************************************************************
547
594
  * Popup CMS edit menu option clicked
548
595
  *******************************************************************/
549
- $('.drgcms_popmenu_item').on('click',function(e) {
596
+ $('.drgcms_popmenu_item').on('click', function(e) {
550
597
  let url = e.target.getAttribute("data-url");
598
+ if (url === null) { url = e.target.parentNode.getAttribute("data-url") };
599
+
551
600
  $('#iframe_cms').attr('src', url);
552
- // $('#iframe_cms').width(1000).height(1000);
553
- // scroll to top of page and hide menu
601
+ // scroll to top of page and hide menu
554
602
  window.scrollTo(0,0);
555
603
  $(e.target).parents('dl:first').find('ul').toggleClass('div-hidden');
556
604
  });
@@ -563,7 +611,6 @@ $(document).ready( function() {
563
611
  let form = e.target.getAttribute("data-form");
564
612
  if (form === null) form = table;
565
613
  let sort = e.target.value;
566
- // e.target.value = null;
567
614
  let url = "/cmsedit/run?control=cmsedit.sort&sort=" + sort + "&table=" + table + "&form_name=" + form;
568
615
  simple_ajax_call(url);
569
616
  });
@@ -1019,9 +1066,7 @@ $(document).ready( function() {
1019
1066
  *******************************************************************/
1020
1067
  $('#_record__filter_field').keydown( function(e) {
1021
1068
  if (e.which == '13' || e.which == '9') {
1022
- // let url = $(this).parents('span').attr("data-url");
1023
- // url = url + "&filter_value=" + this.value;
1024
- // simple_ajax_call(url);
1069
+ e.preventDefault();
1025
1070
  $('.record_filter_field_icon').trigger("click")
1026
1071
  };
1027
1072
  });
@@ -1045,7 +1090,7 @@ $(document).ready( function() {
1045
1090
  });
1046
1091
 
1047
1092
  /*******************************************************************
1048
- * Click on show filter form
1093
+ * on click => show filter form
1049
1094
  *******************************************************************/
1050
1095
  $('#open_drgcms_filter').on('click', function(e) {
1051
1096
  $('#drgcms_filter').bPopup({
@@ -1056,9 +1101,9 @@ $(document).ready( function() {
1056
1101
  position: ['auto', 20],
1057
1102
  closeClass: 'dc-link' });
1058
1103
  });
1059
-
1104
+
1060
1105
  /*******************************************************************
1061
- * Click on preview selected image
1106
+ * on click => Preview image in popup window
1062
1107
  *******************************************************************/
1063
1108
  $('.dc-image-preview').on('click', function(e) {
1064
1109
  let img = $(this).children(":first").attr('src');
@@ -1069,9 +1114,9 @@ $(document).ready( function() {
1069
1114
  opacity: 0
1070
1115
  });
1071
1116
  });
1072
-
1117
+
1073
1118
  /*******************************************************************
1074
- * Set new filter
1119
+ * on click => set new filter
1075
1120
  *******************************************************************/
1076
1121
  $('.dc-filter-set').on('click', function(e) {
1077
1122
  let url = $(this).attr( 'data-url' );
@@ -1082,7 +1127,7 @@ $(document).ready( function() {
1082
1127
  });
1083
1128
 
1084
1129
  /*******************************************************************
1085
- * Toggle one cmsedit menu level
1130
+ * on click => toggle one cmsedit menu level
1086
1131
  *******************************************************************/
1087
1132
  $('.cmsedit-top-level-menu div').on('click', function(e) {
1088
1133
  $(e.target).siblings('ul').toggle('fast');
@@ -1090,7 +1135,7 @@ $(document).ready( function() {
1090
1135
  });
1091
1136
 
1092
1137
  /*******************************************************************
1093
- * Toggle result set record menu
1138
+ * on click => toggle result set record menu
1094
1139
  *
1095
1140
  * This and additional two event hadlers provide expected behavior of submenus popup and close.
1096
1141
  *******************************************************************/
@@ -0,0 +1,372 @@
1
+ /*===================================================================================================================
2
+ * @name: bPopupy
3
+ * @type: jQuery
4
+ * @author: (c) Bjoern Klinggaard - @bklinggaard
5
+ * @demo: http://dinbror.dk/bpopup
6
+ * @version: 0.11.0
7
+ * @requires jQuery 1.4.3
8
+ *==================================================================================================================*/
9
+ ;(function($) {
10
+ 'use strict';
11
+
12
+ $.fn.bPopup = function(options, callback) {
13
+
14
+ if ($.isFunction(options)) {
15
+ callback = options;
16
+ options = null;
17
+ }
18
+
19
+ // OPTIONS
20
+ var o = $.extend({}, $.fn.bPopup.defaults, options);
21
+
22
+ // HIDE SCROLLBAR?
23
+ if (!o.scrollBar)
24
+ $('html').css('overflow', 'hidden');
25
+
26
+ // VARIABLES
27
+ var $popup = this
28
+ , d = $(document)
29
+ , w = window
30
+ , $w = $(w)
31
+ , wH = windowHeight()
32
+ , wW = windowWidth()
33
+ , prefix = '__b-popup'
34
+ , isIOS6X = (/OS 6(_\d)+/i).test(navigator.userAgent) // Used for a temporary fix for ios6 timer bug when using zoom/scroll
35
+ , buffer = 200
36
+ , popups = 0
37
+ , id
38
+ , inside
39
+ , fixedVPos
40
+ , fixedHPos
41
+ , fixedPosStyle
42
+ , vPos
43
+ , hPos
44
+ , height
45
+ , width
46
+ , debounce
47
+ , autoCloseTO
48
+ ;
49
+
50
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////
51
+ // PUBLIC FUNCTION - call it: $(element).bPopup().close();
52
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////
53
+ $popup.close = function() {
54
+ close();
55
+ };
56
+
57
+ $popup.reposition = function(animateSpeed) {
58
+ reposition(animateSpeed);
59
+ };
60
+
61
+ return $popup.each(function() {
62
+ if ($(this).data('bPopup')) return; //POPUP already exists?
63
+ init();
64
+ });
65
+
66
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////
67
+ // HELPER FUNCTIONS - PRIVATE
68
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////
69
+ function init() {
70
+ triggerCall(o.onOpen);
71
+ popups = ($w.data('bPopup') || 0) + 1, id = prefix + popups + '__',fixedVPos = o.position[1] !== 'auto', fixedHPos = o.position[0] !== 'auto', fixedPosStyle = o.positionStyle === 'fixed', height = $popup.outerHeight(true), width = $popup.outerWidth(true);
72
+ o.loadUrl ? createContent() : open();
73
+ };
74
+
75
+ function createContent() {
76
+ o.contentContainer = $(o.contentContainer || $popup);
77
+ switch (o.content) {
78
+ case ('iframe'):
79
+ var iframe = $('<iframe class="b-iframe" ' + o.iframeAttr +'></iframe>');
80
+ iframe.appendTo(o.contentContainer);
81
+ height = $popup.outerHeight(true);
82
+ width = $popup.outerWidth(true);
83
+ open();
84
+ iframe.attr('src', o.loadUrl); // setting iframe src after open due IE9 bug
85
+ triggerCall(o.loadCallback);
86
+ break;
87
+ case ('image'):
88
+ open();
89
+ $('<img />')
90
+ .on('load',function() {
91
+ triggerCall(o.loadCallback);
92
+ recenter($(this));
93
+ }).attr('src', o.loadUrl).hide().appendTo(o.contentContainer);
94
+ break;
95
+ default:
96
+ open();
97
+ $('<div class="b-ajax-wrapper"></div>')
98
+ .load(o.loadUrl, o.loadData, function(response, status, xhr) {
99
+ triggerCall(o.loadCallback, status);
100
+ recenter($(this));
101
+ }).hide().appendTo(o.contentContainer);
102
+ break;
103
+ }
104
+ };
105
+
106
+ function open(){
107
+ // MODAL OVERLAY
108
+ if (o.modal) {
109
+ $('<div class="b-modal '+id+'"></div>')
110
+ .css({backgroundColor: o.modalColor, position: 'fixed', top: 0, right:0, bottom:0, left: 0, opacity: 0, zIndex: o.zIndex + popups})
111
+ .appendTo(o.appendTo)
112
+ .fadeTo(o.speed, o.opacity);
113
+ }
114
+
115
+ // POPUP
116
+ calcPosition();
117
+ $popup
118
+ .data('bPopup', o).data('id',id)
119
+ .css({
120
+ 'left': o.transition == 'slideIn' || o.transition == 'slideBack' ? (o.transition == 'slideBack' ? d.scrollLeft() + wW : (hPos + width) *-1) : getLeftPos(!(!o.follow[0] && fixedHPos || fixedPosStyle))
121
+ , 'position': o.positionStyle || 'absolute'
122
+ , 'top': o.transition == 'slideDown' || o.transition == 'slideUp' ? (o.transition == 'slideUp' ? d.scrollTop() + wH : vPos + height * -1) : getTopPos(!(!o.follow[1] && fixedVPos || fixedPosStyle))
123
+ , 'z-index': o.zIndex + popups + 1
124
+ }).each(function() {
125
+ if(o.appending) {
126
+ $(this).appendTo(o.appendTo);
127
+ }
128
+ });
129
+ doTransition(true);
130
+ };
131
+
132
+ function close() {
133
+ if (o.modal) {
134
+ $('.b-modal.'+$popup.data('id'))
135
+ .fadeTo(o.speed, 0, function() {
136
+ $(this).remove();
137
+ });
138
+ }
139
+ // Clean up
140
+ unbindEvents();
141
+ clearTimeout(autoCloseTO);
142
+ // Close trasition
143
+ doTransition();
144
+
145
+ return false; // Prevent default
146
+ };
147
+
148
+ function reposition(animateSpeed){
149
+ wH = windowHeight();
150
+ wW = windowWidth();
151
+ inside = insideWindow();
152
+ if(inside.x || inside.y){
153
+ clearTimeout(debounce);
154
+ debounce = setTimeout(function(){
155
+ calcPosition();
156
+ animateSpeed = animateSpeed || o.followSpeed;
157
+ var css = {};
158
+ if(inside.x)
159
+ css.left = o.follow[0] ? getLeftPos(true) : 'auto';
160
+ if(inside.y)
161
+ css.top = o.follow[1] ? getTopPos(true) : 'auto';
162
+ $popup
163
+ .dequeue()
164
+ .each(function() {
165
+ if(fixedPosStyle) {
166
+ $(this).css({ 'left': hPos, 'top': vPos });
167
+ }
168
+ else {
169
+ $(this).animate(css, animateSpeed, o.followEasing);
170
+ }
171
+ });
172
+ }, 50);
173
+ }
174
+ };
175
+
176
+ //Eksperimental
177
+ function recenter(content){
178
+ var _width = content.width(), _height = content.height(), css = {};
179
+ o.contentContainer.css({height:_height,width:_width});
180
+
181
+ if (_height >= $popup.height()){
182
+ css.height = $popup.height();
183
+ }
184
+ if(_width >= $popup.width()){
185
+ css.width = $popup.width();
186
+ }
187
+ height = $popup.outerHeight(true)
188
+ , width = $popup.outerWidth(true);
189
+
190
+ calcPosition();
191
+ o.contentContainer.css({height:'auto',width:'auto'});
192
+
193
+ css.left = getLeftPos(!(!o.follow[0] && fixedHPos || fixedPosStyle)),
194
+ css.top = getTopPos(!(!o.follow[1] && fixedVPos || fixedPosStyle));
195
+
196
+ $popup
197
+ .animate(
198
+ css
199
+ , 250
200
+ , function() {
201
+ content.show();
202
+ inside = insideWindow();
203
+ }
204
+ );
205
+ };
206
+
207
+ function bindEvents() {
208
+ $w.data('bPopup', popups);
209
+ $popup.delegate('.bClose, .' + o.closeClass, 'click.'+id, close); // legacy, still supporting the close class bClose
210
+
211
+ if (o.modalClose) {
212
+ $('.b-modal.'+id).css('cursor', 'pointer').bind('click', close);
213
+ }
214
+
215
+ // Temporary disabling scroll/resize events on devices with IOS6+
216
+ // due to a bug where events are dropped after pinch to zoom
217
+ if (!isIOS6X && (o.follow[0] || o.follow[1])) {
218
+ $w.bind('scroll.'+id, function() {
219
+ if(inside.x || inside.y){
220
+ var css = {};
221
+ if(inside.x)
222
+ css.left = o.follow[0] ? getLeftPos(!fixedPosStyle) : 'auto';
223
+ if(inside.y)
224
+ css.top = o.follow[1] ? getTopPos(!fixedPosStyle) : 'auto';
225
+ $popup
226
+ .dequeue()
227
+ .animate(css, o.followSpeed, o.followEasing);
228
+ }
229
+ }).bind('resize.'+id, function() {
230
+ reposition();
231
+ });
232
+ }
233
+ if (o.escClose) {
234
+ d.bind('keydown.'+id, function(e) {
235
+ if (e.which == 27) { //escape
236
+ close();
237
+ }
238
+ });
239
+ }
240
+ };
241
+
242
+ function unbindEvents() {
243
+ if (!o.scrollBar) {
244
+ $('html').css('overflow', 'auto');
245
+ }
246
+ $('.b-modal.'+id).unbind('click');
247
+ d.unbind('keydown.'+id);
248
+ $w.unbind('.'+id).data('bPopup', ($w.data('bPopup')-1 > 0) ? $w.data('bPopup')-1 : null);
249
+ $popup.undelegate('.bClose, .' + o.closeClass, 'click.'+id, close).data('bPopup', null);
250
+ };
251
+
252
+ function doTransition(open) {
253
+ switch (open ? o.transition : o.transitionClose || o.transition) {
254
+ case "slideIn":
255
+ animate({
256
+ left: open ? getLeftPos(!(!o.follow[0] && fixedHPos || fixedPosStyle)) : d.scrollLeft() - (width || $popup.outerWidth(true)) - buffer
257
+ });
258
+ break;
259
+ case "slideBack":
260
+ animate({
261
+ left: open ? getLeftPos(!(!o.follow[0] && fixedHPos || fixedPosStyle)) : d.scrollLeft() + wW + buffer
262
+ });
263
+ break;
264
+ case "slideDown":
265
+ animate({
266
+ top: open ? getTopPos(!(!o.follow[1] && fixedVPos || fixedPosStyle)) : d.scrollTop() - (height || $popup.outerHeight(true)) - buffer
267
+ });
268
+ break;
269
+ case "slideUp":
270
+ animate({
271
+ top: open ? getTopPos(!(!o.follow[1] && fixedVPos || fixedPosStyle)) : d.scrollTop() + wH + buffer
272
+ });
273
+ break;
274
+ default:
275
+ //Hardtyping 1 and 0 to ensure opacity 1 and not 0.9999998
276
+ $popup.stop().fadeTo(o.speed, open ? 1 : 0, function(){onCompleteCallback(open);});
277
+ }
278
+
279
+ function animate(css){
280
+ $popup
281
+ .css({display: 'block',opacity: 1})
282
+ .animate(css, o.speed, o.easing, function(){ onCompleteCallback(open); });
283
+ };
284
+ };
285
+
286
+
287
+ function onCompleteCallback(open){
288
+ if(open){
289
+ bindEvents();
290
+ triggerCall(callback);
291
+ if(o.autoClose){
292
+ autoCloseTO = setTimeout(close, o.autoClose);
293
+ }
294
+ } else {
295
+ $popup.hide();
296
+ triggerCall(o.onClose);
297
+ if (o.loadUrl) {
298
+ o.contentContainer.empty();
299
+ $popup.css({height: 'auto', width: 'auto'});
300
+ }
301
+ }
302
+ };
303
+
304
+ function getLeftPos(includeScroll){
305
+ return includeScroll ? hPos + d.scrollLeft() : hPos;
306
+ };
307
+
308
+ function getTopPos(includeScroll){
309
+ return includeScroll ? vPos + d.scrollTop() : vPos;
310
+ };
311
+
312
+ function triggerCall(func, arg) {
313
+ $.isFunction(func) && func.call($popup, arg);
314
+ };
315
+
316
+ function calcPosition(){
317
+ vPos = fixedVPos ? o.position[1] : Math.max(0, ((wH- $popup.outerHeight(true)) / 2) - o.amsl)
318
+ , hPos = fixedHPos ? o.position[0] : (wW - $popup.outerWidth(true)) / 2
319
+ , inside = insideWindow();
320
+ };
321
+
322
+ function insideWindow(){
323
+ return {
324
+ x: wW > $popup.outerWidth(true),
325
+ y: wH > $popup.outerHeight(true)
326
+ }
327
+ };
328
+
329
+ function windowHeight(){
330
+ return $w.height();
331
+ };
332
+
333
+ function windowWidth(){
334
+ return $w.width();
335
+ };
336
+ };
337
+
338
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////
339
+ // DEFAULT VALUES
340
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////
341
+ $.fn.bPopup.defaults = {
342
+ amsl: 50
343
+ , appending: true
344
+ , appendTo: 'body'
345
+ , autoClose: false
346
+ , closeClass: 'b-close'
347
+ , content: 'ajax' // ajax, iframe or image
348
+ , contentContainer: false
349
+ , easing: 'swing'
350
+ , escClose: true
351
+ , follow: [true, true] // x, y
352
+ , followEasing: 'swing'
353
+ , followSpeed: 500
354
+ , iframeAttr: 'scrolling="no" frameborder="0"'
355
+ , loadCallback: false
356
+ , loadData: false
357
+ , loadUrl: false
358
+ , modal: true
359
+ , modalClose: true
360
+ , modalColor: '#000'
361
+ , onClose: false
362
+ , onOpen: false
363
+ , opacity: 0.7
364
+ , position: ['auto', 'auto'] // x, y,
365
+ , positionStyle: 'absolute'// absolute or fixed
366
+ , scrollBar: true
367
+ , speed: 250 // open & close speed
368
+ , transition: 'fadeIn' //transitions: fadeIn, slideDown, slideIn, slideBack
369
+ , transitionClose: false
370
+ , zIndex: 9997 // popup gets z-index 9999, modal overlay 9998
371
+ };
372
+ })(jQuery);
@@ -7,4 +7,4 @@
7
7
  //= require jquery3
8
8
  //= require jquery_ujs
9
9
  //= require drg_cms/drg_cms
10
- //= require drg_cms/jquery.bpopup.min
10
+ //= require drg_cms/jquery.bpopup
@@ -17,7 +17,7 @@
17
17
  //= require drg_cms/drg_cms
18
18
  //= require drg_cms/jquery.datetimepicker
19
19
 
20
- //= require drg_cms/jquery.bpopup.min
20
+ //= require drg_cms/jquery.bpopup
21
21
  //= require drg_cms/select-multiple
22
22
  //= require drg_cms/jstree.min
23
23
 
@@ -212,6 +212,13 @@ img { vertical-align:bottom; }
212
212
  .dc-image-preview img { max-height: 2rem; padding-left: 0.5rem;}
213
213
  .dc-image-preview img:hover { cursor: zoom-in;}
214
214
 
215
+ #dc-image-preview {
216
+ padding: 2px;
217
+ background-color: #fff;
218
+ filter: drop-shadow(0 0 1rem #000);
219
+ display: none;
220
+ }
221
+
215
222
  .text-with-select { width: 20px; }
216
223
 
217
224
  .no-borders {
@@ -396,7 +403,7 @@ border-radius: 1px;
396
403
  .dc-result-data.footer {
397
404
  border-top: 2px solid #222;
398
405
  color: #000;
399
- font-weight: bold;
406
+ font-weight: 600;
400
407
  background-color: #eee;
401
408
  }
402
409
 
@@ -548,6 +555,12 @@ display: inline-table;
548
555
  background-color: #444;
549
556
  }
550
557
 
558
+ .dc-inline-link.dc-link-ajax {
559
+ padding: initial;
560
+ border: none;
561
+ background: initial;
562
+ }
563
+
551
564
  .skip-next {
552
565
  text-align: center;
553
566
  border:1px solid #888;
@@ -721,7 +734,6 @@ display: inline-table;
721
734
  }
722
735
 
723
736
  .dc-form-label.dc-color-odd, .dc-form-label.dc-color-even {background-color: transparent;}
724
- .dc-form-field.dc-color-odd, .dc-form-field.dc-color-even {background-color: transparent;}
725
737
 
726
738
  .dc-align-left {
727
739
  text-align: left;
@@ -734,6 +746,8 @@ display: inline-table;
734
746
  text-align: left;
735
747
  padding: 4px 2px;
736
748
  z-index: 10;
749
+ white-space: nowrap;
750
+ text-overflow: fade;
737
751
  }
738
752
 
739
753
  .dc-form-field .action li {
@@ -878,6 +892,10 @@ display: flex;
878
892
  color: rgba(44, 142, 255, 1);
879
893
  }
880
894
 
895
+ .dc-popup-open:hover {
896
+ color: rgba(44, 142, 255, 1);
897
+ }
898
+
881
899
  /*** CMS toggle button */
882
900
  .cms-toggle {
883
901
  z-index: 1000000;
@@ -1166,16 +1184,18 @@ color: #000;
1166
1184
  border-radius: 2px;
1167
1185
  z-index: 100;
1168
1186
  list-style-type: none;
1169
- filter: drop-shadow(1px 1px 4px #eee);
1187
+ filter: drop-shadow(1px 1px 6px #ccc);
1170
1188
  }
1171
1189
 
1172
1190
  .drgcms_popmenu_class i {
1173
1191
  vertical-align: sub;
1174
1192
  color: rgba(44, 142, 255, 1);
1193
+ font-size: 22px;
1175
1194
  }
1176
1195
 
1177
1196
  .drgcms_popmenu_item {
1178
1197
  padding: 4px;
1198
+ font-size: 1.1em;
1179
1199
  }
1180
1200
 
1181
1201
  .drgcms_popmenu_item:hover {
@@ -1193,7 +1213,7 @@ color: #000;
1193
1213
  }
1194
1214
 
1195
1215
  #iframe_edit, #iframe_cms {
1196
- height: 1px;
1216
+ /* height: 1px;*/
1197
1217
  width: 100%;
1198
1218
  border: 0;
1199
1219
  margin-bottom: 0;
@@ -1576,13 +1596,25 @@ cursor: pointer;
1576
1596
  margin: 6px 4px 0 0;
1577
1597
  }
1578
1598
 
1599
+ .dc-image-preview-1 {
1600
+ right: 1rem;
1601
+ position: absolute;
1602
+ top: 5rem;
1603
+ max-height: 150px;
1604
+ max-width: 200px;
1605
+ }
1606
+
1607
+ #dc_image .dc-image-preview img {
1608
+ max-height: 150px;
1609
+ max-width: 200px;
1610
+ }
1611
+
1579
1612
  /****** MOBILE DEVICE *****/
1580
1613
  @media only screen and (max-device-width: 600px) {
1581
1614
  #body-cms {font-size: 11px;}
1582
1615
  #site-top div:nth-of-type(2) {padding-top: 0 !important;}
1583
1616
  .dc-title { font-size: 1.5em;}
1584
1617
 
1585
-
1586
1618
  .dc-form {
1587
1619
  border: none;
1588
1620
  border-top: 2px solid #888;