PixTypes - Version 1.4.2

Version Description

  • Fixed Builder visuals
  • Safely sanitize builder output
Download this release

Release Info

Developer euthelup
Plugin Icon wp plugin PixTypes
Version 1.4.2
Comparing to
See all releases

Code changes from version 1.3.5 to 1.4.2

class-pixtypes.php CHANGED
@@ -24,7 +24,7 @@ class PixTypesPlugin {
24
  *
25
  * @const string
26
  */
27
- protected $version = '1.3.5';
28
  /**
29
  * Unique identifier for your plugin.
30
  *
24
  *
25
  * @const string
26
  */
27
+ protected $version = '1.4.2';
28
  /**
29
  * Unique identifier for your plugin.
30
  *
css/admin.css CHANGED
@@ -48,4 +48,4 @@ fieldset.group {
48
 
49
  .uninstall_area {
50
  margin-top: 15px;
51
- }
48
 
49
  .uninstall_area {
50
  margin-top: 15px;
51
+ }
features/class-pix-query.php CHANGED
@@ -25,6 +25,7 @@ class Pix_Query extends Wp_Query {
25
  * Get the gallery of the global post
26
  * @required global $post this should be called inside a loop
27
  * @return array $ids
 
28
  */
29
 
30
  function get_gallery_ids( $key = '' ){
25
  * Get the gallery of the global post
26
  * @required global $post this should be called inside a loop
27
  * @return array $ids
28
+ * @deprecated
29
  */
30
 
31
  function get_gallery_ids( $key = '' ){
features/metaboxes/cmb-field-select2/cmb-field-select2.php CHANGED
@@ -22,8 +22,6 @@ function pw_select2( $field, $meta ) {
22
  wp_enqueue_style( 'pw-select2-field-mods', PW_SELECT2_URL . 'css/select2.css', array(), null );
23
 
24
  call_user_func( $field['type'], $field, $meta );
25
-
26
- echo ( isset( $field['desc'] ) && ! empty( $meta ) ? '<p class="cmb_metabox_description">' . $field['desc'] . '</p>' : '' );
27
  }
28
  add_filter( 'cmb_render_pw_select', 'pw_select2', 10, 2 );
29
  add_filter( 'cmb_render_pw_multiselect', 'pw_select2', 10, 2 );
22
  wp_enqueue_style( 'pw-select2-field-mods', PW_SELECT2_URL . 'css/select2.css', array(), null );
23
 
24
  call_user_func( $field['type'], $field, $meta );
 
 
25
  }
26
  add_filter( 'cmb_render_pw_select', 'pw_select2', 10, 2 );
27
  add_filter( 'cmb_render_pw_multiselect', 'pw_select2', 10, 2 );
features/metaboxes/css/pix_builder.css CHANGED
@@ -27,7 +27,6 @@
27
  .pixbuilder-grid li {
28
  position: relative; }
29
  .pixbuilder-grid li.item {
30
- overflow: hidden;
31
  display: list-item;
32
  border: 1px dashed #d9d9d9;
33
  -moz-box-sizing: border-box;
@@ -48,12 +47,17 @@
48
  -moz-box-sizing: border-box;
49
  -webkit-box-sizing: border-box;
50
  box-sizing: border-box; }
 
 
51
 
52
  /*----------------------------------------*\
53
  CONTENT & CONTROLS
54
  \*----------------------------------------*/
55
  .pixbuilder-grid {
56
  margin-top: -10px;
 
 
 
57
  /*ul*/
58
  /*ul.nav*/ }
59
  .pixbuilder-grid .item__controls {
@@ -70,29 +74,40 @@
70
  transition: all 0.15s; }
71
  .pixbuilder-grid .item__controls li {
72
  display: inline-block;
73
- padding: 12px 18px;
 
 
74
  background: none;
75
  color: white; }
76
  .pixbuilder-grid .item__controls li:hover {
77
- color: #0095ea; }
78
  .pixbuilder-grid .item__controls li.edit {
79
  padding: 0; }
80
  .pixbuilder-grid .item__controls li.edit a {
81
  padding: 12px 18px;
82
- color: white;
83
  cursor: pointer; }
84
  .pixbuilder-grid .item__controls li.edit a span {
85
  display: none; }
86
  .pixbuilder-grid .item__controls li.edit a:before {
87
  content: ""; }
88
- .pixbuilder-grid .item__controls li.edit a:hover {
89
- color: #0095ea; }
90
  .pixbuilder-grid .item__controls li.remove {
91
  cursor: pointer; }
92
  .pixbuilder-grid .item__controls li.remove span {
93
  display: none; }
94
  .pixbuilder-grid .item__controls li.remove:before {
95
  content: ""; }
 
 
 
 
 
 
 
 
 
 
96
  .pixbuilder-grid .item__controls li.move {
97
  overflow: hidden;
98
  cursor: pointer;
@@ -128,17 +143,62 @@
128
  -ms-transform: translate(-50%, -50%);
129
  -webkit-transform: translate(-50%, -50%);
130
  transform: translate(-50%, -50%);
131
- width: 175px;
132
  background: #262526;
133
  -moz-border-radius: 6px;
134
  -webkit-border-radius: 6px;
135
  border-radius: 6px; }
 
 
 
 
 
 
 
 
 
136
  .pixbuilder-grid .item__content {
137
  height: 100%;
138
  padding: 12px;
139
  -moz-box-sizing: border-box;
140
  -webkit-box-sizing: border-box;
141
- box-sizing: border-box; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
 
143
  /*----------------------------------------*\
144
  BLOCK TYPES
@@ -156,21 +216,17 @@
156
  /**
157
  * EDITOR
158
  */
159
- .block-type--editor {
 
 
160
  text-align: left; }
161
- .block-type--editor .editor_preview {
162
- width: 100%;
163
- padding: 12px;
164
- -webkit-box-sizing: border-box;
165
- -moz-box-sizing: border-box;
166
- box-sizing: border-box; }
167
- .block-type--editor .block_content.empty:before {
168
- content: ""; }
169
 
170
  /*----------------------------------------*\
171
  GENERAL
172
  \*----------------------------------------*/
173
- img {
174
  max-width: 100%;
175
  max-height: 100%; }
176
 
@@ -189,7 +245,7 @@ img {
189
  -webkit-font-smoothing: antialiased;
190
  -moz-osx-font-smoothing: grayscale; }
191
 
192
- .block-type--image img, .block-type--editor img, .block-type--image .block_content.empty:before, .block-type--editor .block_content.empty:before, .block-type--editor .editor_preview {
193
  position: absolute;
194
  top: 50%;
195
  left: 50%;
@@ -204,42 +260,187 @@ img {
204
  border: none; }
205
 
206
  .pixbuilder-controls {
207
- padding: 25px 30px 0 30px;
208
- z-index: 100; }
209
 
210
  .pix_builder_editor_modal_container {
211
  position: relative; }
212
- .pix_builder_editor_modal_container .modal_wrapper .media-modal {
213
- height: 80%;
214
- max-height: 650px;
215
- max-width: 800px;
216
- left: 50%;
217
- top: 50%;
218
- -moz-transform: translate(-50%, -50%);
219
- -ms-transform: translate(-50%, -50%);
220
- -webkit-transform: translate(-50%, -50%);
221
- transform: translate(-50%, -50%);
222
- z-index: 10000; }
223
- .pix_builder_editor_modal_container .modal_wrapper .media-modal-backdrop {
224
- z-index: 88; }
225
- .pix_builder_editor_modal_container .modal_wrapper .media-frame-content, .pix_builder_editor_modal_container .modal_wrapper .media-frame-title, .pix_builder_editor_modal_container .modal_wrapper .media-frame-router, .pix_builder_editor_modal_container .modal_wrapper .media-frame-toolbar {
226
- right: 30px;
227
- left: 30px; }
228
- .pix_builder_editor_modal_container .modal_wrapper .media-frame-title {
229
- top: 15px; }
230
- .pix_builder_editor_modal_container .modal_wrapper .media-frame-content {
231
- top: 90px;
232
- bottom: 80px;
233
- background: none;
234
- border: none; }
235
- .pix_builder_editor_modal_container .modal_wrapper .modal_controls {
236
- text-align: right; }
237
 
238
  .pix_builder_container {
239
- padding-top: 50px; }
240
  .pix_builder_container .clear-all {
241
  float: right;
242
  color: #a00;
243
  border-color: rgba(170, 0, 0, 0.62); }
244
 
245
  /* Responsive Gridster */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  .pixbuilder-grid li {
28
  position: relative; }
29
  .pixbuilder-grid li.item {
 
30
  display: list-item;
31
  border: 1px dashed #d9d9d9;
32
  -moz-box-sizing: border-box;
47
  -moz-box-sizing: border-box;
48
  -webkit-box-sizing: border-box;
49
  box-sizing: border-box; }
50
+ .pixbuilder-grid.is--over-controls {
51
+ z-index: 1300; }
52
 
53
  /*----------------------------------------*\
54
  CONTENT & CONTROLS
55
  \*----------------------------------------*/
56
  .pixbuilder-grid {
57
  margin-top: -10px;
58
+ margin-left: 15px;
59
+ margin-bottom: -15px;
60
+ z-index: 1000;
61
  /*ul*/
62
  /*ul.nav*/ }
63
  .pixbuilder-grid .item__controls {
74
  transition: all 0.15s; }
75
  .pixbuilder-grid .item__controls li {
76
  display: inline-block;
77
+ padding: 12px;
78
+ padding-bottom: 11px;
79
+ margin: 0;
80
  background: none;
81
  color: white; }
82
  .pixbuilder-grid .item__controls li:hover {
83
+ background-color: #7CC6EB; }
84
  .pixbuilder-grid .item__controls li.edit {
85
  padding: 0; }
86
  .pixbuilder-grid .item__controls li.edit a {
87
  padding: 12px 18px;
 
88
  cursor: pointer; }
89
  .pixbuilder-grid .item__controls li.edit a span {
90
  display: none; }
91
  .pixbuilder-grid .item__controls li.edit a:before {
92
  content: ""; }
93
+ .pixbuilder-grid .item__controls li.edit a, .pixbuilder-grid .item__controls li.edit a:hover, .pixbuilder-grid .item__controls li.edit a:active {
94
+ color: white; }
95
  .pixbuilder-grid .item__controls li.remove {
96
  cursor: pointer; }
97
  .pixbuilder-grid .item__controls li.remove span {
98
  display: none; }
99
  .pixbuilder-grid .item__controls li.remove:before {
100
  content: ""; }
101
+ .pixbuilder-grid .item__controls li.position {
102
+ cursor: pointer; }
103
+ .pixbuilder-grid .item__controls li.position span {
104
+ display: none; }
105
+ .pixbuilder-grid .item__controls li.position:before {
106
+ content: "";
107
+ display: inline-block;
108
+ width: 20px;
109
+ height: 20px;
110
+ background: url(../images/icon-position.svg) center center no-repeat; }
111
  .pixbuilder-grid .item__controls li.move {
112
  overflow: hidden;
113
  cursor: pointer;
143
  -ms-transform: translate(-50%, -50%);
144
  -webkit-transform: translate(-50%, -50%);
145
  transform: translate(-50%, -50%);
146
+ display: flex;
147
  background: #262526;
148
  -moz-border-radius: 6px;
149
  -webkit-border-radius: 6px;
150
  border-radius: 6px; }
151
+ .pixbuilder-grid .nav > li {
152
+ width: 47px;
153
+ box-sizing: border-box; }
154
+ .pixbuilder-grid .nav > li:first-child {
155
+ border-top-left-radius: 6px;
156
+ border-bottom-left-radius: 6px; }
157
+ .pixbuilder-grid .nav > li:last-child {
158
+ border-top-right-radius: 6px;
159
+ border-bottom-right-radius: 6px; }
160
  .pixbuilder-grid .item__content {
161
  height: 100%;
162
  padding: 12px;
163
  -moz-box-sizing: border-box;
164
  -webkit-box-sizing: border-box;
165
+ box-sizing: border-box;
166
+ position: relative;
167
+ overflow: hidden;
168
+ display: flex;
169
+ justify-content: center; }
170
+ .pixbuilder-grid .item__content.top-1, .pixbuilder-grid .item__content.top-2, .pixbuilder-grid .item__content.top-3 {
171
+ align-items: flex-start; }
172
+ .pixbuilder-grid .item__content.right-1, .pixbuilder-grid .item__content.right-2, .pixbuilder-grid .item__content.right-3 {
173
+ justify-content: flex-end; }
174
+ .pixbuilder-grid .item__content.bottom-1, .pixbuilder-grid .item__content.bottom-2, .pixbuilder-grid .item__content.bottom-3 {
175
+ align-items: flex-end; }
176
+ .pixbuilder-grid .item__content.left-1, .pixbuilder-grid .item__content.left-2, .pixbuilder-grid .item__content.left-3 {
177
+ justify-content: flex-start; }
178
+ .pixbuilder-grid .item__content.top-1 {
179
+ top: -12px; }
180
+ .pixbuilder-grid .item__content.top-2 {
181
+ top: -24px; }
182
+ .pixbuilder-grid .item__content.top-3 {
183
+ top: -36px; }
184
+ .pixbuilder-grid .item__content.right-1 {
185
+ right: -12px; }
186
+ .pixbuilder-grid .item__content.right-2 {
187
+ right: -24px; }
188
+ .pixbuilder-grid .item__content.right-3 {
189
+ right: -36px; }
190
+ .pixbuilder-grid .item__content.bottom-1 {
191
+ bottom: -12px; }
192
+ .pixbuilder-grid .item__content.bottom-2 {
193
+ bottom: -24px; }
194
+ .pixbuilder-grid .item__content.bottom-3 {
195
+ bottom: -36px; }
196
+ .pixbuilder-grid .item__content.left-1 {
197
+ left: -12px; }
198
+ .pixbuilder-grid .item__content.left-2 {
199
+ left: -24px; }
200
+ .pixbuilder-grid .item__content.left-3 {
201
+ left: -36px; }
202
 
203
  /*----------------------------------------*\
204
  BLOCK TYPES
216
  /**
217
  * EDITOR
218
  */
219
+ .block-type--editor .editor_preview {
220
+ width: 100%; }
221
+ .block-type--editor .block_content:not(empty) {
222
  text-align: left; }
223
+ .block-type--editor .block_content.empty:before {
224
+ content: ""; }
 
 
 
 
 
 
225
 
226
  /*----------------------------------------*\
227
  GENERAL
228
  \*----------------------------------------*/
229
+ .pix_builder_container img {
230
  max-width: 100%;
231
  max-height: 100%; }
232
 
245
  -webkit-font-smoothing: antialiased;
246
  -moz-osx-font-smoothing: grayscale; }
247
 
248
+ .block-type--image .block_content.empty:before, .block-type--editor .block_content.empty:before {
249
  position: absolute;
250
  top: 50%;
251
  left: 50%;
260
  border: none; }
261
 
262
  .pixbuilder-controls {
263
+ padding: 0 30px;
264
+ z-index: 1100; }
265
 
266
  .pix_builder_editor_modal_container {
267
  position: relative; }
268
+ .pix_builder_editor_modal_container .modal_wrapper {
269
+ position: relative;
270
+ z-index: 11000; }
271
+ .pix_builder_editor_modal_container .modal_wrapper .media-modal {
272
+ height: 80%;
273
+ max-height: 750px;
274
+ max-width: 800px;
275
+ left: 50%;
276
+ top: 50%;
277
+ -moz-transform: translate(-50%, -50%);
278
+ -ms-transform: translate(-50%, -50%);
279
+ -webkit-transform: translate(-50%, -50%);
280
+ transform: translate(-50%, -50%); }
281
+ .pix_builder_editor_modal_container .modal_wrapper .media-frame-content, .pix_builder_editor_modal_container .modal_wrapper .media-frame-title, .pix_builder_editor_modal_container .modal_wrapper .media-frame-router, .pix_builder_editor_modal_container .modal_wrapper .media-frame-toolbar {
282
+ right: 30px;
283
+ left: 30px; }
284
+ .pix_builder_editor_modal_container .modal_wrapper .media-frame-title {
285
+ top: 15px; }
286
+ .pix_builder_editor_modal_container .modal_wrapper .media-frame-content {
287
+ top: 90px;
288
+ bottom: 80px;
289
+ background: none;
290
+ border: none; }
291
+ .pix_builder_editor_modal_container .modal_wrapper .modal_controls {
292
+ text-align: right; }
293
 
294
  .pix_builder_container {
295
+ padding-top: 55px; }
296
  .pix_builder_container .clear-all {
297
  float: right;
298
  color: #a00;
299
  border-color: rgba(170, 0, 0, 0.62); }
300
 
301
  /* Responsive Gridster */
302
+ .position {
303
+ position: relative; }
304
+
305
+ .position__ui {
306
+ border-radius: 5px;
307
+ background: #000;
308
+ position: absolute;
309
+ bottom: 100%;
310
+ left: 50%;
311
+ margin-left: -94px;
312
+ margin-bottom: 4px;
313
+ opacity: 0;
314
+ pointer-events: none;
315
+ transform: translateY(10px);
316
+ transition: all .2s ease-out; }
317
+ .position:hover > .position__ui {
318
+ opacity: 1;
319
+ pointer-events: auto;
320
+ transform: none; }
321
+ .position__ui:after {
322
+ content: "";
323
+ display: block;
324
+ position: absolute;
325
+ top: 100%;
326
+ left: 50%;
327
+ margin-left: -8px;
328
+ border: 8px solid transparent;
329
+ border-top-color: #000;
330
+ border-bottom: 0; }
331
+
332
+ .position__ui-title {
333
+ background: #444;
334
+ font-family: Arial, sans-serif;
335
+ font-size: 10px;
336
+ text-transform: uppercase;
337
+ border-top-right-radius: 5px;
338
+ border-top-left-radius: 5px;
339
+ color: white;
340
+ padding: 8px 8px 7px; }
341
+
342
+ .position__ui-body {
343
+ display: flex;
344
+ flex-direction: column;
345
+ padding: 7px; }
346
+
347
+ .position__ui-row {
348
+ display: flex;
349
+ justify-content: center; }
350
+
351
+ .position__ui-cell {
352
+ position: relative;
353
+ z-index: 10; }
354
+ .position__ui-cell:hover:before {
355
+ content: "";
356
+ position: absolute;
357
+ top: 0;
358
+ right: 0;
359
+ bottom: 0;
360
+ left: 0;
361
+ border: 1px dashed #777777;
362
+ border-radius: 4px; }
363
+ .position__ui-cell .position__ui-handle:after {
364
+ content: "";
365
+ border: 0 solid transparent; }
366
+ .position__ui-cell.top .position__ui-handle {
367
+ flex-direction: column-reverse;
368
+ bottom: 0; }
369
+ .position__ui-cell.top .position__ui-handle[data-step="1"] {
370
+ bottom: 10px; }
371
+ .position__ui-cell.top .position__ui-handle[data-step="2"] {
372
+ bottom: 20px; }
373
+ .position__ui-cell.top .position__ui-handle[data-step="3"] {
374
+ bottom: 30px; }
375
+ .position__ui-cell.top .position__ui-handle:after {
376
+ border-width: 0 6px;
377
+ border-bottom: 6px solid white;
378
+ margin-bottom: 4px; }
379
+ .position__ui-cell.right .position__ui-handle {
380
+ left: 0; }
381
+ .position__ui-cell.right .position__ui-handle[data-step="1"] {
382
+ left: 10px; }
383
+ .position__ui-cell.right .position__ui-handle[data-step="2"] {
384
+ left: 20px; }
385
+ .position__ui-cell.right .position__ui-handle[data-step="3"] {
386
+ left: 30px; }
387
+ .position__ui-cell.right .position__ui-handle:after {
388
+ border-width: 6px 0;
389
+ border-left: 6px solid white;
390
+ margin-left: 4px; }
391
+ .position__ui-cell.bottom .position__ui-handle {
392
+ flex-direction: column;
393
+ top: 0; }
394
+ .position__ui-cell.bottom .position__ui-handle[data-step="1"] {
395
+ top: 10px; }
396
+ .position__ui-cell.bottom .position__ui-handle[data-step="2"] {
397
+ top: 20px; }
398
+ .position__ui-cell.bottom .position__ui-handle[data-step="3"] {
399
+ top: 30px; }
400
+ .position__ui-cell.bottom .position__ui-handle:after {
401
+ border-width: 0 6px;
402
+ border-top: 6px solid white;
403
+ margin-top: 4px; }
404
+ .position__ui-cell.left .position__ui-handle {
405
+ flex-direction: row-reverse;
406
+ right: 0; }
407
+ .position__ui-cell.left .position__ui-handle[data-step="1"] {
408
+ right: 10px; }
409
+ .position__ui-cell.left .position__ui-handle[data-step="2"] {
410
+ right: 20px; }
411
+ .position__ui-cell.left .position__ui-handle[data-step="3"] {
412
+ right: 30px; }
413
+ .position__ui-cell.left .position__ui-handle:after {
414
+ border-width: 6px 0;
415
+ border-right: 6px solid white;
416
+ margin-right: 4px; }
417
+ .position__ui-cell.top:before {
418
+ top: -30px; }
419
+ .position__ui-cell.right:before {
420
+ right: -30px; }
421
+ .position__ui-cell.bottom:before {
422
+ bottom: -30px; }
423
+ .position__ui-cell.left:before {
424
+ left: -30px; }
425
+ .position__ui-cell.middle:before, .position__ui-cell.middle .position__ui-handle:after {
426
+ display: none; }
427
+ .position__ui-cell:hover .position__ui-handle {
428
+ background: #888888; }
429
+ .position__ui-cell.active .position__ui-handle {
430
+ background: #7CC6EB; }
431
+
432
+ .position__ui-handle {
433
+ font-family: Arial, sans-serif;
434
+ font-size: 10px;
435
+ display: flex;
436
+ width: 50px;
437
+ height: 50px;
438
+ margin: 3px;
439
+ background: #303030;
440
+ align-items: center;
441
+ justify-content: center;
442
+ color: white;
443
+ text-transform: uppercase;
444
+ border-radius: 4px;
445
+ transition: all .2s ease-out;
446
+ position: relative; }
features/metaboxes/css/style.css CHANGED
@@ -1663,6 +1663,11 @@
1663
  /**
1664
  * CMB Styling
1665
  */
 
 
 
 
 
1666
  table.cmb_metabox th {
1667
  text-align: right;
1668
  font-weight: bold; }
@@ -1671,15 +1676,6 @@ table.cmb_metabox th label {
1671
  margin-top: 5px;
1672
  display: block; }
1673
 
1674
- p.cmb_metabox_description {
1675
- color: #AAA;
1676
- font-style: italic;
1677
- margin: 2px 0 !important; }
1678
-
1679
- span.cmb_metabox_description {
1680
- color: #AAA;
1681
- font-style: italic; }
1682
-
1683
  table.cmb_metabox input, table.cmb_metabox textarea {
1684
  font-size: 12px;
1685
  padding: 5px; }
@@ -1689,7 +1685,8 @@ table.cmb_metabox input[type=text], table.cmb_metabox textarea {
1689
 
1690
  table.cmb_metabox textarea.cmb_textarea_code {
1691
  font-family: Consolas, Monaco, monospace;
1692
- line-height: 16px; }
 
1693
 
1694
  table.cmb_metabox input.cmb_text_small {
1695
  width: 100px;
@@ -1729,7 +1726,9 @@ table.cmb_metabox input:focus, table.cmb_metabox textarea:focus {
1729
  .cmb_metabox_title {
1730
  margin: 0 0 5px 0;
1731
  padding: 5px 0 0 0;
1732
- font: italic 24px/35px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; }
 
 
1733
 
1734
  .cmb_radio_inline {
1735
  padding: 4px 0 0 0; }
@@ -2862,9 +2861,11 @@ div.time-picker li.selected {
2862
  #pixgallery .open_pixgallery .icon:before {
2863
  content: "\f233" !important; }
2864
 
 
 
2865
  #pixvideos > ul {
2866
  list-style: none;
2867
- min-height: 55px; }
2868
  #pixvideos > ul li {
2869
  width: 100%;
2870
  font-size: 14px;
@@ -2903,9 +2904,6 @@ div.time-picker li.selected {
2903
  /*----------------------------------------*\
2904
  GENERAL
2905
  \*----------------------------------------*/
2906
- img {
2907
- max-width: 100%; }
2908
-
2909
  .icon {
2910
  display: inline-block;
2911
  font-size: 20px;
@@ -2920,43 +2918,112 @@ img {
2920
  -webkit-font-smoothing: antialiased;
2921
  -moz-osx-font-smoothing: grayscale; }
2922
 
 
 
 
 
 
2923
  .gmap_pins_container {
2924
- position: relative;
2925
- padding-bottom: 30px; }
2926
- .gmap_pins_container .gmap_pin > * {
2927
- display: inline-block; }
2928
- .gmap_pins_container .gmap_pin .pin_location_url {
2929
- width: 68%; }
2930
- .gmap_pins_container .gmap_pin .pin_name {
2931
- width: 29%; }
2932
- .gmap_pins_container .gmap_pin .pin_delete {
2933
- width: 2%;
2934
- opacity: 0;
2935
- color: #AA0000; }
2936
- .gmap_pins_container .gmap_pin:hover .pin_delete {
2937
- opacity: 1;
2938
- text-decoration: underline;
2939
- cursor: pointer;
2940
- transition: all .2s linear; }
2941
- .gmap_pins_container .gmap_pin:hover .pin_delete:before {
2942
- content: url(../images/ico-delete.png); }
2943
- .gmap_pins_container .gmap_pin fieldset label {
2944
- display: inline-block;
2945
- width: 23%;
2946
- padding: 4px 3% 4px 0;
2947
- font-weight: bold;
2948
- text-align: right;
2949
- font-size: 15px;
2950
- color: #000; }
2951
- .gmap_pins_container .gmap_pin fieldset input {
2952
- display: inline-block;
2953
- width: 68%; }
 
 
2954
  .gmap_pins_container .add_new_location {
2955
  position: absolute;
2956
  right: 4%; }
2957
  .gmap_pins_container .cmb_metabox_description {
2958
  padding-left: 18%; }
2959
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2960
  #pixgallery .open_pixgallery div, #pixgallery .open_pixvideos div, #pixvideos .open_pixgallery div, #pixvideos .open_pixvideos div {
2961
  position: absolute;
2962
  top: 50%;
@@ -2991,3 +3058,423 @@ img {
2991
  -webkit-align-items: center;
2992
  -ms-flex-align: center;
2993
  align-items: center; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1663
  /**
1664
  * CMB Styling
1665
  */
1666
+ .form-table.cmb_metabox:first-of-type {
1667
+ margin-top: 0; }
1668
+ .form-table.cmb_metabox:last-of-type {
1669
+ margin-bottom: 0; }
1670
+
1671
  table.cmb_metabox th {
1672
  text-align: right;
1673
  font-weight: bold; }
1676
  margin-top: 5px;
1677
  display: block; }
1678
 
 
 
 
 
 
 
 
 
 
1679
  table.cmb_metabox input, table.cmb_metabox textarea {
1680
  font-size: 12px;
1681
  padding: 5px; }
1685
 
1686
  table.cmb_metabox textarea.cmb_textarea_code {
1687
  font-family: Consolas, Monaco, monospace;
1688
+ line-height: 16px;
1689
+ width: 100%; }
1690
 
1691
  table.cmb_metabox input.cmb_text_small {
1692
  width: 100px;
1726
  .cmb_metabox_title {
1727
  margin: 0 0 5px 0;
1728
  padding: 5px 0 0 0;
1729
+ font-size: 23px;
1730
+ line-height: 1.25;
1731
+ color: #232323; }
1732
 
1733
  .cmb_radio_inline {
1734
  padding: 4px 0 0 0; }
2861
  #pixgallery .open_pixgallery .icon:before {
2862
  content: "\f233" !important; }
2863
 
2864
+ #pixvideos.has-items {
2865
+ min-height: 0; }
2866
  #pixvideos > ul {
2867
  list-style: none;
2868
+ min-height: 3vw; }
2869
  #pixvideos > ul li {
2870
  width: 100%;
2871
  font-size: 14px;
2904
  /*----------------------------------------*\
2905
  GENERAL
2906
  \*----------------------------------------*/
 
 
 
2907
  .icon {
2908
  display: inline-block;
2909
  font-size: 20px;
2918
  -webkit-font-smoothing: antialiased;
2919
  -moz-osx-font-smoothing: grayscale; }
2920
 
2921
+ .cmb-type-gmap_pins .gmap_pins_container {
2922
+ flex-basis: 100%; }
2923
+ .cmb-type-gmap_pins .cmb_metabox_description {
2924
+ display: none; }
2925
+
2926
  .gmap_pins_container {
2927
+ position: relative; }
2928
+ .gmap_pins_container .gmap_pin {
2929
+ display: flex;
2930
+ justify-content: space-between; }
2931
+ .gmap_pins_container .gmap_pin > * {
2932
+ display: inline-block; }
2933
+ .gmap_pins_container .gmap_pin .pin_location_url {
2934
+ flex-basis: 68%; }
2935
+ .gmap_pins_container .gmap_pin .pin_name {
2936
+ flex-basis: 29%; }
2937
+ .gmap_pins_container .gmap_pin .pin_delete {
2938
+ flex-basis: 2%;
2939
+ opacity: 0;
2940
+ color: #AA0000; }
2941
+ .gmap_pins_container .gmap_pin:hover .pin_delete {
2942
+ opacity: 1;
2943
+ text-decoration: underline;
2944
+ cursor: pointer;
2945
+ transition: all .2s linear; }
2946
+ .gmap_pins_container .gmap_pin:hover .pin_delete:before {
2947
+ content: url(../images/ico-delete.png); }
2948
+ .gmap_pins_container .gmap_pin fieldset label {
2949
+ display: inline-block;
2950
+ width: 23%;
2951
+ padding: 4px 3% 4px 0;
2952
+ font-weight: bold;
2953
+ text-align: right;
2954
+ font-size: 15px;
2955
+ color: #000; }
2956
+ .gmap_pins_container .gmap_pin fieldset input {
2957
+ display: inline-block;
2958
+ width: 68%; }
2959
  .gmap_pins_container .add_new_location {
2960
  position: absolute;
2961
  right: 4%; }
2962
  .gmap_pins_container .cmb_metabox_description {
2963
  padding-left: 18%; }
2964
 
2965
+ .cmb-type-positions_map .positions_map {
2966
+ display: flex;
2967
+ flex-wrap: wrap;
2968
+ width: 162px; }
2969
+
2970
+ .cmb-type-positions_map .positions_map li {
2971
+ width: 44px;
2972
+ margin: 5px; }
2973
+
2974
+ .positions_map label {
2975
+ display: block;
2976
+ padding-top: 100%;
2977
+ border: 1px solid #DDD;
2978
+ border-radius: 4px;
2979
+ position: relative; }
2980
+ .positions_map label:after {
2981
+ content: "";
2982
+ display: block;
2983
+ position: absolute;
2984
+ top: 0;
2985
+ left: 0;
2986
+ width: 100%;
2987
+ height: 100%;
2988
+ background: url("../images/icon-arrow.svg") center no-repeat; }
2989
+ .positions_map label span {
2990
+ display: none; }
2991
+
2992
+ .positions_map li:nth-child(1) label:after {
2993
+ transform: rotate(45deg); }
2994
+ .positions_map li:nth-child(2) label:after {
2995
+ transform: rotate(90deg); }
2996
+ .positions_map li:nth-child(3) label:after {
2997
+ transform: rotate(135deg); }
2998
+ .positions_map li:nth-child(5) label:after {
2999
+ width: 10px;
3000
+ height: 10px;
3001
+ top: 50%;
3002
+ left: 50%;
3003
+ margin-left: -5px;
3004
+ margin-top: -5px;
3005
+ border-radius: 50%;
3006
+ background: black; }
3007
+ .positions_map li:nth-child(6) label:after {
3008
+ transform: rotate(180deg); }
3009
+ .positions_map li:nth-child(7) label:after {
3010
+ transform: rotate(315deg); }
3011
+ .positions_map li:nth-child(8) label:after {
3012
+ transform: rotate(270deg); }
3013
+ .positions_map li:nth-child(9) label:after {
3014
+ transform: rotate(225deg); }
3015
+
3016
+ .positions_map input {
3017
+ display: none; }
3018
+
3019
+ .positions_map input:checked + label {
3020
+ background: #EAF9FE;
3021
+ border-color: #73C5EE; }
3022
+
3023
+ .cmb-type-positions_map .positions_map input:before {
3024
+ content: '';
3025
+ display: none; }
3026
+
3027
  #pixgallery .open_pixgallery div, #pixgallery .open_pixvideos div, #pixvideos .open_pixgallery div, #pixvideos .open_pixvideos div {
3028
  position: absolute;
3029
  top: 50%;
3058
  -webkit-align-items: center;
3059
  -ms-flex-align: center;
3060
  align-items: center; }
3061
+
3062
+ .cmb-type {
3063
+ position: relative;
3064
+ padding: 29px 0 41px;
3065
+ margin: 0; }
3066
+ .cmb-type:first-of-type {
3067
+ padding-top: 0; }
3068
+ .cmb-type:last-of-type {
3069
+ padding-bottom: 0; }
3070
+ .cmb-type + .cmb-type {
3071
+ border-top: 1px solid #EEEEEE; }
3072
+ #postbox-container-2 .cmb-type {
3073
+ display: flex;
3074
+ flex-wrap: wrap;
3075
+ align-items: flex-start; }
3076
+ #postbox-container-1 .cmb-type {
3077
+ padding: 10px 0; }
3078
+ #postbox-container-1 .cmb-type + .cmb-type {
3079
+ border-top: none; }
3080
+
3081
+ .cmb-type-wysiwyg + .cmb-type,
3082
+ .cmb-type-gallery + .cmb-type,
3083
+ .cmb-type-playlist + .cmb-type {
3084
+ border-top: 0; }
3085
+
3086
+ .cmb-type-wysiwyg + .cmb-type {
3087
+ padding-top: 0; }
3088
+
3089
+ .cmb-type-gallery,
3090
+ .cmb-type-playlist {
3091
+ padding-bottom: 0; }
3092
+ .cmb-type-gallery:first-child,
3093
+ .cmb-type-playlist:first-child {
3094
+ padding-top: 0; }
3095
+
3096
+ .cmb-type-pix_builder {
3097
+ flex-direction: column;
3098
+ align-items: stretch;
3099
+ margin: 0 -30px;
3100
+ padding-bottom: 0 !important; }
3101
+
3102
+ .cmb_metabox_description {
3103
+ width: 100%;
3104
+ color: #AAA;
3105
+ font-size: 14px;
3106
+ line-height: 1.5;
3107
+ margin: 0; }
3108
+ .cmb_metabox_description strong {
3109
+ color: #444; }
3110
+ .cmb_metabox_description p, .cmb_metabox_description ul {
3111
+ font: inherit;
3112
+ margin: 0;
3113
+ margin-bottom: 1.5em; }
3114
+ .cmb_metabox_description > :last-child {
3115
+ margin-bottom: 0; }
3116
+ .cmb_metabox_description li {
3117
+ margin: 0; }
3118
+ .cmb_metabox_description li:before {
3119
+ content: "\2014 ";
3120
+ padding-right: 10px; }
3121
+
3122
+ #postbox-container-2 .inside {
3123
+ padding: 30px 30px;
3124
+ margin-top: 0; }
3125
+ #postbox-container-2 .cmb-type-title {
3126
+ margin: 0 -30px;
3127
+ padding-top: 20px;
3128
+ padding-bottom: 8px;
3129
+ padding-left: 30px;
3130
+ padding-right: 30px;
3131
+ border-top: 2px solid #EEEEEE; }
3132
+ #postbox-container-2 .cmb-type-title + .cmb-type {
3133
+ padding-top: 0;
3134
+ padding-bottom: 10px;
3135
+ border-top: 0; }
3136
+ #postbox-container-2 .cmb-type-title h3 {
3137
+ font-size: 23px;
3138
+ font-weight: 500;
3139
+ line-height: 1.8;
3140
+ color: #232323; }
3141
+ #postbox-container-2 .cmb-type-title:not(.is--disabled) .cmb_metabox_description {
3142
+ flex-basis: 100%; }
3143
+ #postbox-container-2 .cmb_metabox_description {
3144
+ flex-basis: 50%;
3145
+ flex-shrink: 0;
3146
+ padding-right: 2vw; }
3147
+ #postbox-container-2 .cmb_metabox_description:empty {
3148
+ display: none; }
3149
+ #postbox-container-2 .cmb-type-wysiwyg .cmb_metabox_description {
3150
+ flex-basis: 100%; }
3151
+ #postbox-container-2 .select2-container-multi {
3152
+ width: auto;
3153
+ flex-basis: 46%; }
3154
+ #postbox-container-2 .select2-container-multi .select2-choices {
3155
+ padding: 5px;
3156
+ line-height: 1.5;
3157
+ border: 1px solid #DDD;
3158
+ border-radius: 4px;
3159
+ box-shadow: none;
3160
+ color: #444444;
3161
+ flex: 1 1 auto; }
3162
+
3163
+ .cmb_metabox .cmb_metabox_description h3 {
3164
+ font-size: 16px;
3165
+ font-weight: 600;
3166
+ color: #444;
3167
+ margin: 6px 0; }
3168
+
3169
+ .wp-editor-wrap {
3170
+ width: 100%; }
3171
+
3172
+ .cmb_metabox select,
3173
+ .cmb_text,
3174
+ .cmb_text_small,
3175
+ .cmb_text_medium,
3176
+ .cmb-type-text_range output,
3177
+ .cmb_metabox input[type=text],
3178
+ .cmb_metabox input[type=search],
3179
+ .cmb_metabox input[type=tel],
3180
+ .cmb_metabox input[type=time],
3181
+ .cmb_metabox input[type=url],
3182
+ .cmb_metabox input[type=week],
3183
+ .cmb_metabox input[type=password],
3184
+ .cmb_metabox input[type=date],
3185
+ .cmb_metabox input[type=datetime],
3186
+ .cmb_metabox input[type=datetime-local],
3187
+ .cmb_metabox input[type=email],
3188
+ .cmb_metabox input[type=month],
3189
+ .cmb_metabox input[type=number],
3190
+ .cmb_metabox select {
3191
+ -webkit-appearance: none;
3192
+ padding: 10px 14px 10px 16px;
3193
+ line-height: 1.5;
3194
+ height: auto;
3195
+ border: 1px solid #DDD;
3196
+ border-radius: 4px;
3197
+ box-shadow: none;
3198
+ color: #444444;
3199
+ flex: 1 1 auto; }
3200
+
3201
+ .cmb_textarea,
3202
+ .cmb_text {
3203
+ flex-basis: 46%; }
3204
+
3205
+ .cmb_metabox .selector-wrapper {
3206
+ flex-basis: 46%;
3207
+ position: relative; }
3208
+ .cmb_metabox .selector-wrapper:before {
3209
+ top: 13px;
3210
+ position: absolute;
3211
+ right: 8px;
3212
+ color: #DDD; }
3213
+ .cmb_metabox .selector-wrapper > select {
3214
+ width: 100%; }
3215
+
3216
+ .cmb_metabox .cmb-type-multicheck {
3217
+ margin-left: -24px; }
3218
+ .cmb_metabox .cmb-type-multicheck ul {
3219
+ margin-left: 0 !important; }
3220
+
3221
+ .cmb_metabox .cmb-type-checkbox,
3222
+ .cmb_metabox .cmb-type-multicheck {
3223
+ display: flex;
3224
+ flex-wrap: nowrap;
3225
+ align-items: flex-start; }
3226
+ .cmb_metabox .cmb-type-checkbox input[type=checkbox],
3227
+ .cmb_metabox .cmb-type-checkbox input[type=radio],
3228
+ .cmb_metabox .cmb-type-multicheck input[type=checkbox],
3229
+ .cmb_metabox .cmb-type-multicheck input[type=radio] {
3230
+ order: -1;
3231
+ width: 26px;
3232
+ height: 26px;
3233
+ margin-top: 1px;
3234
+ margin-right: 8px;
3235
+ margin-left: 0;
3236
+ margin-bottom: 0;
3237
+ background: #FFFFFF;
3238
+ border: 1px solid #DDDDDD;
3239
+ border-radius: 4px;
3240
+ font-size: 14px;
3241
+ line-height: 1.5;
3242
+ color: #76C6EC;
3243
+ outline: 0;
3244
+ box-shadow: none; }
3245
+ .cmb_metabox .cmb-type-checkbox input[type=checkbox]:checked,
3246
+ .cmb_metabox .cmb-type-checkbox input[type=radio]:checked,
3247
+ .cmb_metabox .cmb-type-multicheck input[type=checkbox]:checked,
3248
+ .cmb_metabox .cmb-type-multicheck input[type=radio]:checked {
3249
+ background: #76C6EC;
3250
+ border-color: #76C6EC; }
3251
+ .cmb_metabox .cmb-type-checkbox input[type=checkbox]:checked:before,
3252
+ .cmb_metabox .cmb-type-checkbox input[type=radio]:checked:before,
3253
+ .cmb_metabox .cmb-type-multicheck input[type=checkbox]:checked:before,
3254
+ .cmb_metabox .cmb-type-multicheck input[type=radio]:checked:before {
3255
+ color: white;
3256
+ margin: 1px 0 0 0px;
3257
+ font-size: 23px; }
3258
+ .cmb_metabox .cmb-type-checkbox h3,
3259
+ .cmb_metabox .cmb-type-multicheck h3 {
3260
+ margin-top: 0;
3261
+ margin-left: 0px;
3262
+ padding-top: 0;
3263
+ padding-bottom: 0;
3264
+ color: #444444; }
3265
+ .cmb_metabox .cmb-type-checkbox h3 + *,
3266
+ .cmb_metabox .cmb-type-multicheck h3 + * {
3267
+ font-weight: normal;
3268
+ color: #AAA; }
3269
+ .cmb_metabox .cmb-type-checkbox .cmb_metabox_description,
3270
+ .cmb_metabox .cmb-type-multicheck .cmb_metabox_description {
3271
+ font-size: 100%;
3272
+ font-weight: bold;
3273
+ color: #444; }
3274
+ #postbox-container-2 .cmb_metabox .cmb-type-checkbox:first-child, #postbox-container-2
3275
+ .cmb_metabox .cmb-type-multicheck:first-child {
3276
+ padding-top: 0; }
3277
+ #postbox-container-2 .cmb_metabox .cmb-type-checkbox h3, #postbox-container-2
3278
+ .cmb_metabox .cmb-type-multicheck h3 {
3279
+ margin-top: -2px; }
3280
+ #postbox-container-2 .cmb_metabox .cmb-type-checkbox h3 + *, #postbox-container-2
3281
+ .cmb_metabox .cmb-type-multicheck h3 + * {
3282
+ margin-left: -34px; }
3283
+ #postbox-container-2 .cmb_metabox .cmb-type-checkbox .cmb_metabox_description, #postbox-container-2
3284
+ .cmb_metabox .cmb-type-multicheck .cmb_metabox_description {
3285
+ margin-top: 2px;
3286
+ flex-basis: 90%; }
3287
+ #postbox-container-1 .cmb_metabox .cmb-type-checkbox, #postbox-container-1
3288
+ .cmb_metabox .cmb-type-multicheck {
3289
+ border-top: none; }
3290
+ #postbox-container-1 .cmb_metabox .cmb-type-checkbox h3, #postbox-container-1
3291
+ .cmb_metabox .cmb-type-multicheck h3 {
3292
+ font-size: 14px;
3293
+ margin-top: 1px; }
3294
+ #postbox-container-1 .cmb_metabox .cmb-type-checkbox h3 + *, #postbox-container-1
3295
+ .cmb_metabox .cmb-type-multicheck h3 + * {
3296
+ font-size: 90%; }
3297
+ #postbox-container-1 .cmb_metabox .cmb-type-checkbox .cmb_metabox_description, #postbox-container-1
3298
+ .cmb_metabox .cmb-type-multicheck .cmb_metabox_description {
3299
+ position: relative;
3300
+ flex-basis: 80%;
3301
+ font-size: 14px; }
3302
+ #postbox-container-1 .cmb_metabox .cmb-type-checkbox .tooltipster-icon, #postbox-container-1
3303
+ .cmb_metabox .cmb-type-multicheck .tooltipster-icon {
3304
+ position: absolute;
3305
+ top: 5px;
3306
+ right: -19px; }
3307
+
3308
+ .cmb-type-text_range output {
3309
+ width: 40px;
3310
+ max-width: 50px;
3311
+ padding: 6px 0;
3312
+ text-align: center;
3313
+ display: inline-block; }
3314
+
3315
+ .cmb_text_range {
3316
+ margin: 14px 0;
3317
+ min-width: 187px;
3318
+ flex-grow: 1;
3319
+ position: relative;
3320
+ -webkit-appearance: none;
3321
+ height: 6px;
3322
+ outline: none;
3323
+ background: none;
3324
+ margin-right: 20px;
3325
+ background: linear-gradient(to right, #0083BD, #0083BD 100%, transparent 100%) top left no-repeat;
3326
+ background-size: 100% 100%;
3327
+ padding-left: 0;
3328
+ padding-right: 0;
3329
+ cursor: pointer;
3330
+ cursor: -webkit-grab;
3331
+ /* Special styling for WebKit/Blink */
3332
+ /* All the same stuff for Firefox */ }
3333
+ .cmb_text_range:active {
3334
+ cursor: -webkit-grabbing; }
3335
+ .cmb_text_range:before {
3336
+ content: " ";
3337
+ position: absolute;
3338
+ top: 0;
3339
+ left: 0;
3340
+ height: 6px;
3341
+ width: 100%;
3342
+ box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.3);
3343
+ border-radius: 10px; }
3344
+ .cmb_text_range::-webkit-slider-thumb {
3345
+ -webkit-appearance: none;
3346
+ border-radius: 4px;
3347
+ width: 22px;
3348
+ height: 22px;
3349
+ border: 1px solid #0083BD;
3350
+ position: relative;
3351
+ z-index: 20;
3352
+ background: white; }
3353
+
3354
+ #wp-_pile_header_cover_description-wrap .mce-toolbar.mce-last .mce-btn {
3355
+ border: 1px solid #ddd;
3356
+ border-radius: 2px;
3357
+ margin: 16px 0 0 10px;
3358
+ background: white; }
3359
+
3360
+ body .mce-toolbar.mce-last .mce-container.mce-first .mce-menubtn.mce-first button {
3361
+ font-size: 13px;
3362
+ line-height: 1.5;
3363
+ padding: 2px 10px 2px 8px;
3364
+ border: 0;
3365
+ width: auto;
3366
+ visibility: hidden;
3367
+ width: 12em; }
3368
+ body .mce-toolbar.mce-last .mce-container.mce-first .mce-menubtn.mce-first button i {
3369
+ visibility: visible; }
3370
+ body .mce-toolbar.mce-last .mce-container.mce-first .mce-menubtn.mce-first button:before {
3371
+ content: "Custom Elements";
3372
+ position: absolute;
3373
+ top: 2px;
3374
+ left: 8px;
3375
+ visibility: visible; }
3376
+ body .mce-toolbar.mce-last .mce-container.mce-first .mce-menubtn.mce-first .mce-caret {
3377
+ position: absolute;
3378
+ margin-top: -2px !important;
3379
+ right: 8px;
3380
+ top: 50%; }
3381
+
3382
+ .cmb-type-textarea_code {
3383
+ flex-direction: column-reverse;
3384
+ align-items: stretch; }
3385
+ .cmb-type-textarea_code > *:not(:last-child) {
3386
+ margin-top: 10px; }
3387
+
3388
+ #pixvideos,
3389
+ #pixgallery {
3390
+ width: 100%; }
3391
+
3392
+ .wp-color-result {
3393
+ position: absolute;
3394
+ top: 0;
3395
+ right: 0;
3396
+ width: 38px;
3397
+ min-height: 33px;
3398
+ border: 1px solid #DDD;
3399
+ margin: 0;
3400
+ padding: 0;
3401
+ box-shadow: none;
3402
+ display: flex;
3403
+ align-items: center; }
3404
+ .wp-color-result:after {
3405
+ content: none; }
3406
+
3407
+ .wp-picker-container {
3408
+ position: absolute;
3409
+ right: 0;
3410
+ top: 50%;
3411
+ margin-top: -9px;
3412
+ z-index: 10; }
3413
+ .wp-picker-container .iris-border {
3414
+ border-radius: 4px; }
3415
+
3416
+ .wp-picker-active {
3417
+ display: flex;
3418
+ flex-wrap: wrap; }
3419
+ .wp-picker-active .wp-color-result:after {
3420
+ content: none; }
3421
+
3422
+ .wp-picker-open + .wp-picker-input-wrap {
3423
+ display: flex;
3424
+ align-items: stretch; }
3425
+ .wp-picker-open + .wp-picker-input-wrap .button {
3426
+ height: auto;
3427
+ padding-left: 10px;
3428
+ padding-right: 10px; }
3429
+
3430
+ .wp-picker-container input[type=text].wp-color-picker {
3431
+ width: 85px;
3432
+ text-align: left; }
3433
+
3434
+ .media-modal-close {
3435
+ text-decoration: none; }
3436
+ .media-modal-close span.media-modal-icon {
3437
+ position: absolute;
3438
+ top: 50%;
3439
+ left: 50%;
3440
+ transform: translateX(-50%) translateY(-50%); }
3441
+
3442
+ .tooltipster-base {
3443
+ border-color: #23282d; }
3444
+ .tooltipster-base .tooltipster-content {
3445
+ padding: 20px;
3446
+ font-style: normal;
3447
+ color: inherit;
3448
+ background-color: #23282d;
3449
+ text-align: left;
3450
+ color: #FFF;
3451
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.06); }
3452
+ .tooltipster-base .tooltipster-content a {
3453
+ color: white;
3454
+ text-decoration: none;
3455
+ border-bottom: 1px dotted; }
3456
+ .tooltipster-base .tooltipster-content a:hover {
3457
+ opacity: 0.7; }
3458
+ .tooltipster-base .tooltipster-content p {
3459
+ margin: 0 0 1em 0; }
3460
+ .tooltipster-base .tooltipster-content p:last-child {
3461
+ margin-bottom: 0; }
3462
+ .tooltipster-base .tooltipster-content title {
3463
+ display: block;
3464
+ font-weight: bold;
3465
+ margin-bottom: 12px;
3466
+ font-size: 14px;
3467
+ margin-top: -4px; }
3468
+ .tooltipster-base .tooltipster-arrow {
3469
+ z-index: 1;
3470
+ height: auto;
3471
+ width: auto;
3472
+ top: auto;
3473
+ right: auto;
3474
+ left: calc(50% - 5px);
3475
+ bottom: 0; }
3476
+ .tooltipster-base .tooltipster-arrow span {
3477
+ border-top-color: #23282d !important; }
3478
+
3479
+ .tooltipster-icon {
3480
+ color: #AAA; }
features/metaboxes/fields/gallery.php CHANGED
@@ -15,7 +15,7 @@ wp_localize_script( 'pixgallery', 'locals', array(
15
  'confirmClearGallery' => __( 'You want for sure to clear this gallery?', 'pixtypes' ),
16
  'alertGalleryIsEmpty' => __( 'Gallery is already empty!', 'pixtypes' )
17
  )
18
- ) );?>
19
  <div id="pixgallery" class="pixgallery_field hidden" >
20
  <ul></ul>
21
  <a class="open_pixgallery" href="#" >
15
  'confirmClearGallery' => __( 'You want for sure to clear this gallery?', 'pixtypes' ),
16
  'alertGalleryIsEmpty' => __( 'Gallery is already empty!', 'pixtypes' )
17
  )
18
+ ) ); ?>
19
  <div id="pixgallery" class="pixgallery_field hidden" >
20
  <ul></ul>
21
  <a class="open_pixgallery" href="#" >
features/metaboxes/fields/pix_builder.php CHANGED
@@ -1,26 +1,55 @@
1
  <div class="pix_builder_container hidden">
2
  <?php
 
3
  $gridster_params = '';
4
- if ( isset($field['gridster_params'] ) ) {
5
- $gridster_params = ' data-params=\'' . json_encode($field['gridster_params'] ) . '\'';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  }
7
 
8
- echo '<input type="hidden" name="', $field['id'], '" id="pix_builder" value="', '' !== $meta ? htmlspecialchars($meta) : $field['std'], '" '. $gridster_params .' />'; ?>
9
  <div class="pixbuilder-controls">
10
- <button class="add_block button button-primary button-large" value="image" > + Image</button>
11
- <button class="add_block button button-primary button-large" value="editor"> + Editor</button>
 
 
12
  </div>
13
 
14
  <!-- <span class="clear-all button button-secondary">Clear All</span> -->
15
 
16
  <div class="pixbuilder-grid gridster">
17
  <ul>
18
- <?php if ( !empty($meta) ) {
19
- $meta = json_decode($meta);
20
- if ( !empty($meta)) {
21
- foreach ( $meta as $key => $block ) {
22
 
23
- if ( ! isset( $block->type ) ) {
 
 
 
 
 
 
24
  return;
25
  }
26
 
@@ -28,24 +57,32 @@
28
  $controls_content = '';
29
  switch ( $block->type ) {
30
  case 'editor' :
31
- $content = '<textarea class="to_send" style="display: none">' . htmlspecialchars($block->content) . '</textarea>' . '<div class="editor_preview">' . '<div class="editor_preview_wrapper">' . pix_builder_display_content( $block->content ) . '</div>' . '</div>';
 
 
 
 
32
 
33
- $controls_content = '<a class="edit_editor"><span>Edit</span></a>';
 
 
34
 
35
  break;
36
 
37
  case 'image' :
38
- // in case of an image the content should hold only an integer which represents the id
39
- if ( is_numeric( $block->content ) && $block->content !== '' ) {
40
- $attach = wp_get_attachment_image_src( $block->content );
41
-
42
- if ( isset( $attach[ 0 ] ) && ! empty( $attach[ 0 ] ) ) {
43
- $content = '<img class="image_preview" src="' . $attach[ 0 ] . '">';
44
- $controls_content = '<a class="open_media" href="#" class="wp-gallery" data-attachment_id="' . $block->content . '"><span>' . __( 'Set Image', 'pixtypes' ) . '</span></a>';
 
 
 
 
 
45
  }
46
- } else {
47
- $content = '<img class="image_preview">';
48
- $controls_content = '<a class="open_media" href="#" class="wp-gallery" data-attachment_id="' . $block->content . '"><span>' . __( 'Set Image', 'pixtypes' ) . '</pan></a>';
49
  }
50
  break;
51
  default :
@@ -54,70 +91,131 @@
54
 
55
  $empty_class = '';
56
 
57
- if ( empty($block->content) ) {
58
  $empty_class = 'empty';
59
- } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
- <li id="block_<?php echo $block->id ?>" class="block-type--<?php echo $block->type; ?> item" data-type="<?php echo $block->type ?>" data-row="<?php echo $block->row ?>" data-col="<?php echo $block->col ?>" data-sizex="<?php echo $block->size_x ?>" data-sizey="<?php echo $block->size_y ?>">
 
 
 
 
 
 
 
 
62
  <div class="item__controls">
63
  <ul class="nav nav--controls">
64
  <li class="edit"><?php echo $controls_content ?></li>
65
- <li class="remove remove_block"><span>Remove</span></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  <li class="move drag_handler"></li>
67
  </ul>
68
  </div>
69
- <div class="item__content block_content <?php echo $empty_class;?>">
70
  <?php echo $content ?>
71
  </div>
72
  </li>
73
- <?php
74
  }
75
  }
76
- }?>
77
  </ul>
78
  </div>
79
  </div>
80
- <?php add_action('admin_footer', 'my_admin_footer_function');
81
  function my_admin_footer_function() { ?>
82
  <div class="pix_builder_editor_modal_container" style="display:none">
83
  <div class="modal_wrapper">
84
  <div class="media-modal wp-core-ui">
85
- <a class="media-modal-close close_modal_btn" href="#" title="Close"><span class="media-modal-icon"></span></a>
 
86
  <!-- <a class="close_modal_btn media-modal-close" href="#"></a>-->
87
  <div class="media-modal-content">
88
- <div class="media-frame-title"><h1>Insert Content</h1></div>
89
  <div class="media-frame-router"></div>
90
  <div class="media-frame-content">
91
  <?php
92
- function pix_builder_change_mce_options($initArray) {
93
 
94
- $initArray['verify_html'] = false;
95
- $initArray['cleanup_on_startup'] = false;
96
- $initArray['cleanup'] = false;
97
- $initArray['forced_root_block'] = false;
98
- $initArray['validate_children'] = false;
99
  $initArray['remove_redundant_brs'] = false;
100
- $initArray['remove_linebreaks'] = false;
101
- $initArray['force_p_newlines'] = true;
102
- $initArray['force_br_newlines'] = true;
103
- $initArray['fix_table_elements'] = false;
104
- $initArray['entity_encoding'] = "named";
 
 
105
 
106
  $initArray['entities'] = '160,nbsp,38,amp,60,lt,62,gt';
107
 
108
  return $initArray;
109
  }
110
 
111
- add_filter('tiny_mce_before_init', 'pix_builder_change_mce_options');
112
 
113
  wp_editor( '', 'pix_builder_editor', array( 'textarea_rows' => 20, 'editor_height' => 350 ) );
114
 
115
- remove_filter('tiny_mce_before_init', 'pix_builder_change_mce_options');
116
- ?>
117
  </div>
118
  <div class="modal_controls media-frame-toolbar">
119
- <a class="close_modal_btn button button-large" href="#">Cancel</a>
120
- <a class="insert_editor_content button media-button button-primary button-large" href="#">Insert Content</a>
 
121
  </div>
122
  </div>
123
  </div>
@@ -126,8 +224,11 @@ function my_admin_footer_function() { ?>
126
  </div>
127
  <?php }
128
 
 
129
 
130
- function pix_builder_display_content( $content = '' ) {
 
 
131
  // since we cannot apply "the_content" filter on some content blocks we should apply at least these bellow
132
  $content = apply_filters( 'wptexturize', $content );
133
  $content = apply_filters( 'convert_smilies', $content );
@@ -135,7 +236,7 @@ function pix_builder_display_content( $content = '' ) {
135
 
136
  $content = wpautop( $content );
137
 
138
- if ( function_exists( 'wpgrade_remove_spaces_around_shortcodes' ) ) {
139
  $content = wpgrade_remove_spaces_around_shortcodes( $content );
140
  }
141
  // $content = shortcode_unautop ($content);
1
  <div class="pix_builder_container hidden">
2
  <?php
3
+ $base64_decode = false;
4
  $gridster_params = '';
5
+
6
+ if( isset( $field['gridster_params'] ) ) {
7
+ $gridster_params = ' data-params=\'' . json_encode( $field['gridster_params'] ) . '\'';
8
+ }
9
+
10
+ global $post;
11
+ $content = $field['std'];
12
+
13
+ $test_for_content = json_decode( $post->post_content );
14
+ if( isset( $post->post_content ) && ! empty( $post->post_content ) && ! empty( $test_for_content ) ) {
15
+ $base64_decode = true;
16
+ // remove the white spacces added by the editor
17
+ $content = preg_replace( '/[\p{Z}\s]{2,}/u', ' ', $post->post_content );
18
+ } elseif ( ! empty( $meta ) ) {
19
+ $content = $meta;
20
+ }
21
+
22
+ $post_type = get_post_type();
23
+ if ( $post_type !== 'page' ) {
24
+ echo '<style>
25
+ .post-type-' . $post_type . ' #postdivrich {
26
+ display: none !important;
27
+ }
28
+ </style>';
29
  }
30
 
31
+ echo '<input type="hidden" name="', $field['id'], '" id="pix_builder" value="', '' !== $meta ? htmlspecialchars( $meta ) : $content, '" ' . $gridster_params . ' ' . ( $base64_decode ? 'data-base64_encoded="true"' : '' ) .' />'; ?>
32
  <div class="pixbuilder-controls">
33
+ <button class="add_block button button-primary button-large"
34
+ value="image"> <?php esc_html_e( '+ Add Image', 'pixtypes' ); ?></button>
35
+ <button class="add_block button button-primary button-large"
36
+ value="editor"> <?php esc_html_e( '+ Text', 'pixtypes' ); ?></button>
37
  </div>
38
 
39
  <!-- <span class="clear-all button button-secondary">Clear All</span> -->
40
 
41
  <div class="pixbuilder-grid gridster">
42
  <ul>
43
+ <?php
44
+ if( ! empty ( $content ) ) {
 
 
45
 
46
+ $content = json_decode( $content );
47
+
48
+ if( ! empty( $content ) && is_array( $content ) ) {
49
+
50
+ foreach ( $content as $key => $block ) {
51
+
52
+ if( ! isset( $block->type ) ) {
53
  return;
54
  }
55
 
57
  $controls_content = '';
58
  switch ( $block->type ) {
59
  case 'editor' :
60
+ if ( $base64_decode ) {
61
+ $block->content = base64_decode( $block->content );
62
+ }
63
+
64
+ $block->content = wp_unslash( $block->content );
65
 
66
+ $content = '<textarea class="to_send" style="display: none">' . $block->content. '</textarea>' . '<div class="editor_preview">' . '<div class="editor_preview_wrapper">' . pix_builder_display_content( $block->content, false ) . '</div>' . '</div>';
67
+
68
+ $controls_content = '<a class="edit_editor"><span>' . esc_html__( 'Edit', 'pixtypes' ) . '</span></a>';
69
 
70
  break;
71
 
72
  case 'image' :
73
+ if ( isset( $block->content ) ) {
74
+ // in case of an image the content should hold only an integer which represents the id
75
+ if ( ! empty( $block->content ) && is_numeric( $block->content ) ) {
76
+ $attach = wp_get_attachment_image_src( $block->content );
77
+
78
+ if ( isset( $attach[0] ) && ! empty( $attach[0] ) ) {
79
+ $content = '<img class="image_preview" src="' . $attach[0] . '">';
80
+ $controls_content = '<a class="open_media" href="#" class="wp-gallery" data-attachment_id="' . $block->content . '"><span>' . __( 'Set Image', 'pixtypes' ) . '</span></a>';
81
+ }
82
+ } else {
83
+ $content = '<img class="image_preview">';
84
+ $controls_content = '<a class="open_media" href="#" class="wp-gallery" data-attachment_id="' . $block->content . '"><span>' . __( 'Set Image', 'pixtypes' ) . '</pan></a>';
85
  }
 
 
 
86
  }
87
  break;
88
  default :
91
 
92
  $empty_class = '';
93
 
94
+ if( empty( $block->content ) ) {
95
  $empty_class = 'empty';
96
+ }
97
+
98
+ if( empty( $block->position ) ) {
99
+ $block->position = array(
100
+ 'top' => 0,
101
+ 'right' => 0,
102
+ 'bottom' => 0,
103
+ 'left' => 0
104
+ );
105
+ } else {
106
+ $block->position = (array) $block->position;
107
+ }
108
+
109
+ $middle_status = 'active';
110
 
111
+ foreach ( $block->position as $pos ) {
112
+ if( $pos !== '0' ) {
113
+ $middle_status = '';
114
+ }
115
+ } ?>
116
+ <li id="block_<?php echo $block->id ?>" class="block-type--<?php echo $block->type; ?> item"
117
+ data-type="<?php echo $block->type ?>" data-row="<?php echo $block->row ?>"
118
+ data-col="<?php echo $block->col ?>" data-sizex="<?php echo $block->size_x ?>"
119
+ data-sizey="<?php echo $block->size_y ?>">
120
  <div class="item__controls">
121
  <ul class="nav nav--controls">
122
  <li class="edit"><?php echo $controls_content ?></li>
123
+ <li class="position"><span><?php esc_html_e( 'Position', 'pixtypes' ); ?></span>
124
+ <div class="position__ui">
125
+ <div
126
+ class="position__ui-title"><?php esc_html_e( 'Alignment', 'pixtypes' ); ?></div>
127
+ <div class="position__ui-body">
128
+ <div class="position__ui-row">
129
+ <div
130
+ class="position__ui-cell top <?php echo '0' === $block->position['top'] ? '' : 'active'; ?>">
131
+ <div class="position__ui-handle"
132
+ data-step="<?php echo $block->position['top']; ?>"><?php esc_html_e( 'top', 'pixtypes' ); ?></div>
133
+ </div>
134
+ </div>
135
+ <div class="position__ui-row">
136
+ <div
137
+ class="position__ui-cell left <?php echo '0' === $block->position['left'] ? '' : 'active'; ?>">
138
+ <div class="position__ui-handle"
139
+ data-step="<?php echo $block->position['left']; ?>"><?php esc_html_e( 'left', 'pixtypes' ); ?></div>
140
+ </div>
141
+ <div class="position__ui-cell middle <?php echo $middle_status; ?>">
142
+ <div class="position__ui-handle">middle</div>
143
+ </div>
144
+ <div
145
+ class="position__ui-cell right <?php echo '0' === $block->position['right'] ? '' : 'active'; ?>">
146
+ <div class="position__ui-handle"
147
+ data-step="<?php echo $block->position['right']; ?>"><?php esc_html_e( 'right', 'pixtypes' ); ?></div>
148
+ </div>
149
+ </div>
150
+ <div class="position__ui-row">
151
+ <div
152
+ class="position__ui-cell bottom <?php echo '0' === $block->position['bottom'] ? '' : 'active'; ?>">
153
+ <div class="position__ui-handle"
154
+ data-step="<?php echo $block->position['bottom']; ?>"><?php esc_html_e( 'bottom', 'pixtypes' ); ?></div>
155
+ </div>
156
+ </div>
157
+ </div>
158
+ </div>
159
+ </li>
160
+ <li class="remove remove_block">
161
+ <span><?php esc_html_e( 'Remove', 'pixtypes' ); ?></span></li>
162
  <li class="move drag_handler"></li>
163
  </ul>
164
  </div>
165
+ <div class="item__content block_content <?php echo $empty_class; ?>">
166
  <?php echo $content ?>
167
  </div>
168
  </li>
169
+ <?php
170
  }
171
  }
172
+ } ?>
173
  </ul>
174
  </div>
175
  </div>
176
+ <?php add_action( 'admin_footer', 'my_admin_footer_function' );
177
  function my_admin_footer_function() { ?>
178
  <div class="pix_builder_editor_modal_container" style="display:none">
179
  <div class="modal_wrapper">
180
  <div class="media-modal wp-core-ui">
181
+ <a class="media-modal-close close_modal_btn" href="#" title="Close"><span
182
+ class="media-modal-icon"></span></a>
183
  <!-- <a class="close_modal_btn media-modal-close" href="#"></a>-->
184
  <div class="media-modal-content">
185
+ <div class="media-frame-title"><h1><?php esc_html_e( 'Insert Content', 'pixtypes' ); ?></h1></div>
186
  <div class="media-frame-router"></div>
187
  <div class="media-frame-content">
188
  <?php
189
+ function pix_builder_change_mce_options( $initArray ) {
190
 
191
+ $initArray['verify_html'] = false;
192
+ $initArray['cleanup_on_startup'] = false;
193
+ $initArray['cleanup'] = false;
194
+ $initArray['validate_children'] = false;
 
195
  $initArray['remove_redundant_brs'] = false;
196
+ $initArray['remove_linebreaks'] = false;
197
+ $initArray['force_p_newlines'] = true;
198
+ $initArray['force_br_newlines'] = true;
199
+ $initArray['fix_table_elements'] = false;
200
+ $initArray['convert_urls'] = false;
201
+ $initArray['relative_urls'] = false;
202
+ $initArray['entity_encoding'] = "raw";
203
 
204
  $initArray['entities'] = '160,nbsp,38,amp,60,lt,62,gt';
205
 
206
  return $initArray;
207
  }
208
 
209
+ add_filter( 'tiny_mce_before_init', 'pix_builder_change_mce_options' );
210
 
211
  wp_editor( '', 'pix_builder_editor', array( 'textarea_rows' => 20, 'editor_height' => 350 ) );
212
 
213
+ remove_filter( 'tiny_mce_before_init', 'pix_builder_change_mce_options' ); ?>
 
214
  </div>
215
  <div class="modal_controls media-frame-toolbar">
216
+ <a class="close_modal_btn button button-large" href="#"><?php esc_html_e( 'Cancel', 'pixtypes' ) ?></a>
217
+ <a class="insert_editor_content button media-button button-primary button-large"
218
+ href="#"><?php esc_html_e( 'Insert Content', 'pixtypes' ); ?></a>
219
  </div>
220
  </div>
221
  </div>
224
  </div>
225
  <?php }
226
 
227
+ function pix_builder_display_content( $content = '', $decode = true ) {
228
 
229
+ if ( $decode && ! empty( $content ) ) {
230
+ $content = base64_decode($content);
231
+ }
232
  // since we cannot apply "the_content" filter on some content blocks we should apply at least these bellow
233
  $content = apply_filters( 'wptexturize', $content );
234
  $content = apply_filters( 'convert_smilies', $content );
236
 
237
  $content = wpautop( $content );
238
 
239
+ if( function_exists( 'wpgrade_remove_spaces_around_shortcodes' ) ) {
240
  $content = wpgrade_remove_spaces_around_shortcodes( $content );
241
  }
242
  // $content = shortcode_unautop ($content);
features/metaboxes/init.php CHANGED
@@ -124,7 +124,6 @@ class cmb_Meta_Box {
124
  add_action( 'admin_menu', array( &$this, 'add' ) );
125
  }
126
 
127
-
128
  add_action( 'save_post', array( &$this, 'save' ) );
129
 
130
  add_action( 'admin_head', array( &$this, 'fold_display' ) );
@@ -133,6 +132,8 @@ class cmb_Meta_Box {
133
  //add_filter( 'cmb_show_on', array( &$this, 'add_for_page_template' ), 10, 2 );
134
  //add_filter( 'cmb_show_on', array( &$this, 'add_for_specific_select_value' ), 10, 2 );
135
 
 
 
136
  }
137
 
138
  function add_post_enctype() {
@@ -145,6 +146,17 @@ class cmb_Meta_Box {
145
  </script>';
146
  }
147
 
 
 
 
 
 
 
 
 
 
 
 
148
  // Add metaboxes
149
  function add() {
150
  $this->_meta_box['context'] = empty( $this->_meta_box['context'] ) ? 'normal' : $this->_meta_box['context'];
@@ -156,10 +168,14 @@ class cmb_Meta_Box {
156
 
157
  foreach ( $this->_meta_box['pages'] as $page ) {
158
  if ( apply_filters( 'cmb_show_on', true, $this->_meta_box ) ) {
159
- add_meta_box( $this->_meta_box['id'], $this->_meta_box['title'], array(
160
- &$this,
161
- 'show'
162
- ), $page, $this->_meta_box['context'], $this->_meta_box['priority'] );
 
 
 
 
163
  }
164
  }
165
  }
@@ -172,7 +188,7 @@ class cmb_Meta_Box {
172
 
173
  // Add for ID
174
  function add_for_id( $display, $meta_box ) {
175
- if ( 'id' !== $meta_box['show_on']['key'] ) {
176
  return $display;
177
  }
178
 
@@ -297,7 +313,27 @@ class cmb_Meta_Box {
297
  } else {
298
  return $display;
299
  }
 
 
 
 
 
 
300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  }
302
 
303
  // Show fields
@@ -328,13 +364,23 @@ class cmb_Meta_Box {
328
  // Use nonce for verification
329
  echo '<input type="hidden" name="wp_meta_box_nonce" value="', wp_create_nonce( basename( __FILE__ ) ), '" />';
330
 
331
- echo '<table class="form-table cmb_metabox">';
 
 
 
332
 
333
  foreach ( $this->_meta_box['fields'] as $field ) {
 
 
 
 
334
  // Set up blank or default values for empty ones
335
  if ( ! isset( $field['name'] ) ) {
336
  $field['name'] = '';
337
  }
 
 
 
338
  if ( ! isset( $field['desc'] ) ) {
339
  $field['desc'] = '';
340
  }
@@ -350,12 +396,16 @@ class cmb_Meta_Box {
350
  if ( 'multicheck' == $field['type'] ) {
351
  $field['multiple'] = true;
352
  }
353
- //some extra classes
354
- $classes = 'cmb-type-' . sanitize_html_class( $field['type'] );
355
 
356
  $meta = get_post_meta( $post->ID, $field['id'], 'multicheck' != $field['type'] /* If multicheck this can be multiple values */ );
 
 
 
 
 
 
357
  if ( isset( $field['options'] ) && isset( $field['options']['hidden'] ) && $field['options']['hidden'] == true ) {
358
- echo '<tr style="display:none;">';
359
  } else {
360
 
361
  $requires = '';
@@ -382,50 +432,75 @@ class cmb_Meta_Box {
382
  } else {
383
  $requires .= 'data-has_value="' . $on['value'] . '"';
384
  }
385
-
386
  }
387
-
388
  }
389
 
390
- echo '<tr class="' . $classes . '" ' . $requires . '>';
391
  }
392
 
393
- if ( $field['type'] == "title" || $field['type'] == 'portfolio-gallery' || $field['type'] == 'gallery' || $field['type'] == 'pix_builder' || $field['type'] == 'gmap_pins' ) {
394
- echo '<td colspan="2">';
395
- } else {
396
  if ( isset( $this->_meta_box['show_names'] ) && $this->_meta_box['show_names'] == true ) {
397
- echo '<th style="width:18%"><label for="', $field['id'], '">', $field['name'], '</label></th>';
 
 
398
  }
399
- echo '<td>';
 
 
 
 
 
 
 
 
400
  }
401
 
402
  switch ( $field['type'] ) {
403
 
404
  case 'text':
405
- echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />', '<p class="cmb_metabox_description">', $field['desc'], '</p>';
406
  break;
407
  case 'text_small':
408
- echo '<input class="cmb_text_small" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
409
  break;
410
  case 'text_medium':
411
- echo '<input class="cmb_text_medium" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
412
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413
  case 'text_date':
414
- echo '<input class="cmb_text_small cmb_datepicker" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
415
  break;
416
  case 'text_date_timestamp':
417
- echo '<input class="cmb_text_small cmb_datepicker" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? date( 'm\/d\/Y', $meta ) : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
418
  break;
419
 
420
  case 'text_datetime_timestamp':
421
  echo '<input class="cmb_text_small cmb_datepicker" type="text" name="', $field['id'], '[date]" id="', $field['id'], '_date" value="', '' !== $meta ? date( 'm\/d\/Y', $meta ) : $field['std'], '" />';
422
- echo '<input class="cmb_timepicker text_time" type="text" name="', $field['id'], '[time]" id="', $field['id'], '_time" value="', '' !== $meta ? date( 'h:i A', $meta ) : $field['std'], '" /><span class="cmb_metabox_description" >', $field['desc'], '</span>';
423
  break;
424
  case 'text_time':
425
- echo '<input class="cmb_timepicker text_time" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
426
  break;
427
  case 'text_money':
428
- echo '$ <input class="cmb_text_money" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
429
  break;
430
  case 'colorpicker':
431
  $meta = '' !== $meta ? $meta : $field['std'];
@@ -438,16 +513,27 @@ class cmb_Meta_Box {
438
  {
439
  $meta = "#";
440
  }
441
- echo '<input class="cmb_colorpicker cmb_text_small" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta, '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
442
  break;
443
  case 'textarea':
444
- echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10">', '' !== $meta ? $meta : $field['std'], '</textarea>', '<p class="cmb_metabox_description">', $field['desc'], '</p>';
445
  break;
446
  case 'textarea_small':
447
- echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4">', '' !== $meta ? $meta : $field['std'], '</textarea>', '<p class="cmb_metabox_description">', $field['desc'], '</p>';
448
  break;
449
  case 'textarea_code':
450
- echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10" class="cmb_textarea_code">', '' !== $meta ? $meta : $field['std'], '</textarea>', '<p class="cmb_metabox_description">', $field['desc'], '</p>';
 
 
 
 
 
 
 
 
 
 
 
451
  break;
452
  case 'select':
453
  //we DON'T consider the '0' string as empty, nor do we consider (int)0 as empty
@@ -455,6 +541,7 @@ class cmb_Meta_Box {
455
  $meta = $field['std'];
456
  }
457
 
 
458
  echo '<select name="', $field['id'], '" id="', $field['id'], '">';
459
 
460
  foreach ( $field['options'] as $option ) {
@@ -468,9 +555,12 @@ class cmb_Meta_Box {
468
  echo '<option value="', $option['value'], '"', $meta == $option['value'] ? ' selected="selected"' : '', '>', $option['name'], '</option>';
469
  }
470
  echo '</select>';
471
- echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
 
472
  break;
473
  case 'select_cpt_post':
 
 
474
  echo '<select name="', $field['id'], '" id="', $field['id'], '">';
475
  $args = array(
476
  'posts_per_page' => - 1,
@@ -486,9 +576,10 @@ class cmb_Meta_Box {
486
  }
487
  $post = $old_post;
488
  echo '</select>';
489
- echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
490
  break;
491
  case 'select_cpt_term':
 
492
  echo '<select name="', $field['id'], '" id="', $field['id'], '">';
493
  $cpt_terms = get_terms( $field['taxonomy'], 'orderby=count&hide_empty=0' );
494
  if ( ! empty( $cpt_terms ) ) {
@@ -497,7 +588,7 @@ class cmb_Meta_Box {
497
  }
498
  }
499
  echo '</select>';
500
- echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
501
  break;
502
  case 'radio_inline':
503
  if ( empty( $meta ) && ! empty( $field['std'] ) ) {
@@ -510,7 +601,6 @@ class cmb_Meta_Box {
510
  $i ++;
511
  }
512
  echo '</div>';
513
- echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
514
  break;
515
  case 'radio':
516
  if ( empty( $meta ) && ! empty( $field['std'] ) ) {
@@ -523,11 +613,9 @@ class cmb_Meta_Box {
523
  $i ++;
524
  }
525
  echo '</ul>';
526
- echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
527
  break;
528
  case 'checkbox':
529
  echo '<input type="checkbox" name="', $field['id'], '" id="', $field['id'], '"', ( $meta === 'on' ) ? ' checked="checked"' : '', ' />';
530
- echo '<span class="cmb_metabox_description">', $field['desc'], '</span>';
531
  break;
532
  case 'multicheck':
533
  //even if empty, we should check for the meta key existance - empty is a valid value, it means all the checkboxes have been unchecked
@@ -543,17 +631,18 @@ class cmb_Meta_Box {
543
  $i ++;
544
  }
545
  echo '</ul>';
546
- echo '<span class="cmb_metabox_description">', $field['desc'], '</span>';
547
  break;
548
  case 'title':
549
- echo '<h5 class="cmb_metabox_title">', $field['name'], '</h5>';
550
- echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
 
551
  break;
552
  case 'wysiwyg':
553
- wp_editor( $meta ? $meta : $field['std'], $field['id'], isset( $field['options'] ) ? $field['options'] : array() );
554
- echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
555
  break;
556
  case 'taxonomy_select':
 
 
557
  echo '<select name="', $field['id'], '" id="', $field['id'], '">';
558
  $names = wp_get_object_terms( $post->ID, $field['taxonomy'] );
559
  $terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
@@ -565,7 +654,7 @@ class cmb_Meta_Box {
565
  }
566
  }
567
  echo '</select>';
568
- echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
569
  break;
570
  case 'taxonomy_radio':
571
  $names = wp_get_object_terms( $post->ID, $field['taxonomy'] );
@@ -579,7 +668,6 @@ class cmb_Meta_Box {
579
  }
580
  }
581
  echo '</ul>';
582
- echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
583
  break;
584
  case 'taxonomy_multicheck':
585
  echo '<ul>';
@@ -595,12 +683,10 @@ class cmb_Meta_Box {
595
  echo ' /><label>', $term->name, '</label></li>';
596
  }
597
  echo '</ul>';
598
- echo '<span class="cmb_metabox_description">', $field['desc'], '</span>';
599
  break;
600
  case 'file_list':
601
  echo '<input class="cmb_upload_file" type="text" size="36" name="', $field['id'], '" value="" />';
602
  echo '<input class="cmb_upload_button button" type="button" value="Upload File" />';
603
- echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
604
  $args = array(
605
  'post_type' => 'attachment',
606
  'numberposts' => null,
@@ -627,7 +713,6 @@ class cmb_Meta_Box {
627
  echo '<input class="cmb_upload_file" type="' . $input_type_url . '" size="45" id="', $field['id'], '" name="', $field['id'], '" value="', $meta, '" />';
628
  echo '<input class="cmb_upload_button button" type="button" value="Upload File" />';
629
  echo '<input class="cmb_upload_file_id" type="hidden" id="', $field['id'], '_id" name="', $field['id'], '_id" value="', get_post_meta( $post->ID, $field['id'] . "_id", true ), '" />';
630
- echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
631
  echo '<div id="', $field['id'], '_status" class="cmb_media_status">';
632
  if ( $meta != '' ) {
633
  $check_image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $meta );
@@ -655,7 +740,6 @@ class cmb_Meta_Box {
655
  echo '<input class="cmb_upload_file attachment" type="' . $input_type_url . '" size="45" id="', $field['id'], '" name="', $field['id'], '" value=\'', $meta, '\' />';
656
  echo '<input class="cmb_upload_button button" type="button" value="Upload File" />';
657
  echo '<input class="cmb_upload_file_id" type="hidden" id="', $field['id'], '_id" name="', $field['id'], '_id" value="', get_post_meta( $post->ID, $field['id'] . "_id", true ), '" />';
658
- echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
659
  echo '<div id="', $field['id'], '_status" class="cmb_media_status">';
660
  if ( $meta != '' ) {
661
  $check_image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $meta );
@@ -682,9 +766,6 @@ class cmb_Meta_Box {
682
  ob_start();
683
  include( $file_path );
684
  echo ob_get_clean();
685
- } else {
686
- echo '<p>Wrong path </p>';
687
- // util::var_dump( $file_path );
688
  }
689
 
690
  break;
@@ -695,9 +776,6 @@ class cmb_Meta_Box {
695
  ob_start();
696
  include( $file_path );
697
  echo ob_get_clean();
698
- } else {
699
- echo '<p>Wrong path </p>';
700
- // util::var_dump( $file_path );
701
  }
702
 
703
  break;
@@ -714,9 +792,6 @@ class cmb_Meta_Box {
714
  ob_start();
715
  include( $file_path );
716
  echo ob_get_clean();
717
- } else {
718
- echo '<p>Wrong path </p>';
719
- // util::var_dump( $file_path );
720
  }
721
 
722
  break;
@@ -752,7 +827,7 @@ class cmb_Meta_Box {
752
  break;
753
 
754
  case 'oembed':
755
- echo '<input class="cmb_oembed" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />', '<p class="cmb_metabox_description">', $field['desc'], '</p>';
756
  echo '<p class="cmb-spinner spinner"></p>';
757
  echo '<div id="', $field['id'], '_status" class="cmb_media_status ui-helper-clearfix embed_wrap">';
758
  if ( $meta != '' ) {
@@ -769,16 +844,44 @@ class cmb_Meta_Box {
769
  echo '</div>';
770
  break;
771
 
 
 
 
 
 
 
 
 
 
 
 
 
 
772
  default:
773
  do_action( 'cmb_render_' . $field['type'], $field, $meta );
774
  }
775
 
776
- echo '</td>', '</tr>';
777
  }
778
- echo '</table>';
779
  }
780
 
781
  function fold_display() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
782
 
783
  if ( ! isset( $this->_meta_box['display_on'] ) ) {
784
  return;
@@ -794,15 +897,15 @@ class cmb_Meta_Box {
794
  ob_start(); ?>
795
  <script>
796
  ;
797
- (function( $ ) {
798
- $( document ).ready( function() {
799
- var metabox = $( '#<?php echo $this->_meta_box['id']; ?>' );
800
- metabox.addClass( 'display_on' )
801
- .attr( 'data-action', '<?php echo 'show'; ?>' )
802
- .attr( 'data-when_key', '<?php echo $display_on['on']['field']; ?>' )
803
- .attr( 'data-has_value', '<?php echo $display_on['on']['value']; ?>' );
804
- } );
805
- })( jQuery );
806
  </script>
807
  <?php
808
  $script = ob_get_clean();
@@ -847,12 +950,6 @@ class cmb_Meta_Box {
847
  $old = get_post_meta( $post_id, $name, ! $field['multiple'] /* If multicheck this can be multiple values */ );
848
  $new = isset( $_POST[ $field['id'] ] ) ? $_POST[ $field['id'] ] : null;
849
 
850
-
851
- if ( $field['type'] == 'portfolio-gallery' || $field['type'] == 'gallery' ) {
852
- // util::var_dump($new);
853
- // continue;
854
- }
855
-
856
  if ( $type_comp == true && in_array( $field['type'], array(
857
  'taxonomy_select',
858
  'taxonomy_radio',
@@ -908,7 +1005,7 @@ class cmb_Meta_Box {
908
  } elseif ( '' !== $new && $new != $old ) {
909
  update_post_meta( $post_id, $name, $new );
910
  } elseif ( '' == $new ) {
911
- delete_post_meta( $post_id, $name );
912
  }
913
 
914
  if ( 'file' == $field['type'] ) {
@@ -939,7 +1036,7 @@ function cmb_scripts( $hook ) {
939
 
940
  global $pixtypes_plugin;
941
  $plugin_version = 0;
942
- if ( method_exists($pixtypes_plugin, 'get_plugin_version') ) {
943
  $plugin_version = $pixtypes_plugin->get_plugin_version();
944
  }
945
 
@@ -989,7 +1086,7 @@ function cmb_scripts( $hook ) {
989
 
990
  wp_register_style( 'gridster', CMB_META_BOX_URL . 'css/jquery.gridster.css' );
991
 
992
- wp_register_style( 'pix_builder', CMB_META_BOX_URL . 'css/pix_builder.css', array('gridster'), $plugin_version );
993
  wp_register_style( 'tooltipster', CMB_META_BOX_URL . 'css/tooltipster.css' );
994
  wp_register_style( 'cmb-styles', CMB_META_BOX_URL . 'css/style.css', $cmb_style_array, $plugin_version );
995
 
@@ -1009,9 +1106,9 @@ function cmb_editor_footer_scripts() {
1009
  }
1010
  ?>
1011
  <script type="text/javascript">
1012
- jQuery( function( $ ) {
1013
- $( 'td.savesend input' ).val( '<?php echo $label; ?>' );
1014
- } );
1015
  </script>
1016
  <?php
1017
  }
@@ -1138,7 +1235,7 @@ function ajax_pixgallery_preview() {
1138
  exit;
1139
  }
1140
 
1141
- $ids = rtrim($ids, ',');
1142
  $ids = explode( ',', $ids );
1143
 
1144
  $size = 'thumbnail';
@@ -1183,3 +1280,83 @@ function ajax_pixplaylist_preview() {
1183
 
1184
  add_action( 'wp_ajax_pixplaylist_preview', 'ajax_pixplaylist_preview' );
1185
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  add_action( 'admin_menu', array( &$this, 'add' ) );
125
  }
126
 
 
127
  add_action( 'save_post', array( &$this, 'save' ) );
128
 
129
  add_action( 'admin_head', array( &$this, 'fold_display' ) );
132
  //add_filter( 'cmb_show_on', array( &$this, 'add_for_page_template' ), 10, 2 );
133
  //add_filter( 'cmb_show_on', array( &$this, 'add_for_specific_select_value' ), 10, 2 );
134
 
135
+ //add_filter('_wp_post_revision_field_post_content', array( $this, 'pixtypes_fix_builder_revisions_display'), 915, 4 );
136
+ add_filter('default_hidden_meta_boxes', array( $this, 'hide_metaboxes_from_screen_options_by_config'), 15, 2 );
137
  }
138
 
139
  function add_post_enctype() {
146
  </script>';
147
  }
148
 
149
+ function hide_metaboxes_from_screen_options_by_config ( $hidden, $screen ){
150
+ foreach ( $this->_meta_box['pages'] as $page ) {
151
+ if ( apply_filters( 'cmb_show_on', true, $this->_meta_box ) ) {
152
+ if ( isset( $this->_meta_box['hidden'] ) && true === $this->_meta_box['hidden'] ) {
153
+ $hidden[]=$this->_meta_box['id'];
154
+ }
155
+ }
156
+ }
157
+ return $hidden;
158
+ }
159
+
160
  // Add metaboxes
161
  function add() {
162
  $this->_meta_box['context'] = empty( $this->_meta_box['context'] ) ? 'normal' : $this->_meta_box['context'];
168
 
169
  foreach ( $this->_meta_box['pages'] as $page ) {
170
  if ( apply_filters( 'cmb_show_on', true, $this->_meta_box ) ) {
171
+ add_meta_box(
172
+ $this->_meta_box['id'],
173
+ $this->_meta_box['title'],
174
+ array( &$this, 'show' ),
175
+ $page,
176
+ $this->_meta_box['context'],
177
+ $this->_meta_box['priority']
178
+ );
179
  }
180
  }
181
  }
188
 
189
  // Add for ID
190
  function add_for_id( $display, $meta_box ) {
191
+ if ( ! isset( $meta_box['show_on']['key'] ) || 'id' !== $meta_box['show_on']['key'] ) {
192
  return $display;
193
  }
194
 
313
  } else {
314
  return $display;
315
  }
316
+ }
317
+
318
+ function pixtypes_fix_builder_revisions_display ( $post_content, $field, $compare_to, $target ){
319
+
320
+ $change = false;
321
+ $parsed = json_decode( $post_content, true );
322
 
323
+ if ( empty( $parsed ) || ! is_array( $parsed ) ) return $post_content;
324
+
325
+ foreach ( $parsed as $key => $block ) {
326
+ if ( isset( $block['type'] ) && isset( $block['content'] ) && ! empty($block['content']) && $block['type']=== 'editor') {
327
+ $new_link = base64_decode( $block['content'] );
328
+ $change = true;
329
+ $parsed[$key]['content'] = $new_link;
330
+ }
331
+ }
332
+
333
+ if ( $change ) {
334
+ return json_encode( $parsed );
335
+ }
336
+ return $post_content;
337
  }
338
 
339
  // Show fields
364
  // Use nonce for verification
365
  echo '<input type="hidden" name="wp_meta_box_nonce" value="', wp_create_nonce( basename( __FILE__ ) ), '" />';
366
 
367
+ echo '<ul class="form-table cmb_metabox">';
368
+
369
+ // we use the variable to check if we need a default or not
370
+ $all_metas = get_post_meta( $post->ID );
371
 
372
  foreach ( $this->_meta_box['fields'] as $field ) {
373
+
374
+ //some extra classes
375
+ $classes = 'cmb-type cmb-type-' . sanitize_html_class( $field['type'] );
376
+
377
  // Set up blank or default values for empty ones
378
  if ( ! isset( $field['name'] ) ) {
379
  $field['name'] = '';
380
  }
381
+ if ( ! isset( $field['show_names'] ) ) {
382
+ $field['show_names'] = true;
383
+ }
384
  if ( ! isset( $field['desc'] ) ) {
385
  $field['desc'] = '';
386
  }
396
  if ( 'multicheck' == $field['type'] ) {
397
  $field['multiple'] = true;
398
  }
 
 
399
 
400
  $meta = get_post_meta( $post->ID, $field['id'], 'multicheck' != $field['type'] /* If multicheck this can be multiple values */ );
401
+
402
+ $meta_exists = false;
403
+ if ( isset( $all_metas[ $field['id'] ] ) ) {
404
+ $meta_exists = true;
405
+ }
406
+
407
  if ( isset( $field['options'] ) && isset( $field['options']['hidden'] ) && $field['options']['hidden'] == true ) {
408
+ echo '<li style="display:none;">';
409
  } else {
410
 
411
  $requires = '';
432
  } else {
433
  $requires .= 'data-has_value="' . $on['value'] . '"';
434
  }
 
435
  }
 
436
  }
437
 
438
+ echo '<li class="' . $classes . '" ' . $requires . '>';
439
  }
440
 
441
+ echo '<div class="cmb_metabox_description">';
442
+ if ( ! ( $field['type'] == 'portfolio-gallery' || $field['type'] == 'gallery' || $field['type'] == 'pix_builder' || $field['type'] == 'gmap_pins' ) ) {
 
443
  if ( isset( $this->_meta_box['show_names'] ) && $this->_meta_box['show_names'] == true ) {
444
+ if ( isset( $field['show_names'] ) && $field['show_names'] == true ) {
445
+ echo '<h3><label for="', $field['id'], '">', $field['name'], '</label></h3>';
446
+ }
447
  }
448
+ }
449
+ if ( ! empty($field['desc']) ) {
450
+ echo "<div>" . $field['desc'] . "</div>";
451
+ }
452
+ echo '</div>';
453
+
454
+
455
+ if ( ! $meta_exists && isset( $field['std'] ) ) {
456
+ $meta = $field['std'];
457
  }
458
 
459
  switch ( $field['type'] ) {
460
 
461
  case 'text':
462
+ echo '<input class="cmb_text" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta, '" />';
463
  break;
464
  case 'text_small':
465
+ echo '<input class="cmb_text cmb_text_small" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta, '" />';
466
  break;
467
  case 'text_medium':
468
+ echo '<input class="cmb_text cmb_text_medium" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta, '" />';
469
  break;
470
+
471
+ case 'text_range':
472
+ $atts = '';
473
+
474
+ if ( isset( $field['html_args'] ) && ! empty( $field['html_args'] ) ) {
475
+ foreach ( $field['html_args'] as $key => $att ) {
476
+ $atts .= $key . '="' . $att . '" ';
477
+ }
478
+ } ?>
479
+ <input class="cmb_text_range" type="range" name="<?php echo $field['id']; ?>"
480
+ id="<?php echo $field['id'] ?>"
481
+ value="<?php echo '' !== $meta ? $meta : $field['std']; ?>" <?php echo $atts ?>
482
+ style="background-size: <?php echo 0 !== $meta ? $meta : $field['std']; ?>% 100%;"
483
+ oninput="<?php echo $field['id'] . '_output.value = ' . $field['id'] . '.value'; ?>"/>
484
+ <output name="<?php echo $field['id'] ?>_output" id="<?php echo $field['id']; ?>_output">
485
+ <?php echo '' !== $meta ? $meta : $field['std']; ?>
486
+ </output>
487
+ <?php break;
488
  case 'text_date':
489
+ echo '<input class="cmb_text_small cmb_datepicker" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />';
490
  break;
491
  case 'text_date_timestamp':
492
+ echo '<input class="cmb_text_small cmb_datepicker" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? date( 'm\/d\/Y', $meta ) : $field['std'], '" />';
493
  break;
494
 
495
  case 'text_datetime_timestamp':
496
  echo '<input class="cmb_text_small cmb_datepicker" type="text" name="', $field['id'], '[date]" id="', $field['id'], '_date" value="', '' !== $meta ? date( 'm\/d\/Y', $meta ) : $field['std'], '" />';
497
+ echo '<input class="cmb_timepicker text_time" type="text" name="', $field['id'], '[time]" id="', $field['id'], '_time" value="', '' !== $meta ? date( 'h:i A', $meta ) : $field['std'], '" />';
498
  break;
499
  case 'text_time':
500
+ echo '<input class="cmb_timepicker text_time" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />';
501
  break;
502
  case 'text_money':
503
+ echo '$ <input class="cmb_text_money" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />';
504
  break;
505
  case 'colorpicker':
506
  $meta = '' !== $meta ? $meta : $field['std'];
513
  {
514
  $meta = "#";
515
  }
516
+ echo '<input class="cmb_colorpicker cmb_text_small" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta, '" />';
517
  break;
518
  case 'textarea':
519
+ echo '<textarea class="cmb_textarea" name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10">', $meta, '</textarea>';
520
  break;
521
  case 'textarea_small':
522
+ echo '<textarea class="cmb_textarea" name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4">', $meta, '</textarea>';
523
  break;
524
  case 'textarea_code':
525
+ $rows = $cols = '';
526
+ if( isset( $field['rows'] ) && ! empty( $field['rows'] ) ) {
527
+ $rows = 'rows="' . $field['rows'] . '"';
528
+ }
529
+
530
+ if( isset( $field['cols'] ) && ! empty( $field['cols'] ) ) {
531
+ $cols = 'cols="' . $field['cols'] . '"';
532
+ } else {
533
+ $cols = 'style="width: 100%"';
534
+ }
535
+
536
+ echo '<textarea name="', $field['id'], '" id="', $field['id'], '" ' . $cols .' ' . $rows . ' class="cmb_textarea cmb_textarea_code">', $meta, '</textarea>';
537
  break;
538
  case 'select':
539
  //we DON'T consider the '0' string as empty, nor do we consider (int)0 as empty
541
  $meta = $field['std'];
542
  }
543
 
544
+ echo '<div class="selector-wrapper dashicons-before dashicons-arrow-down-alt2">';
545
  echo '<select name="', $field['id'], '" id="', $field['id'], '">';
546
 
547
  foreach ( $field['options'] as $option ) {
555
  echo '<option value="', $option['value'], '"', $meta == $option['value'] ? ' selected="selected"' : '', '>', $option['name'], '</option>';
556
  }
557
  echo '</select>';
558
+ echo '</div>';
559
+
560
  break;
561
  case 'select_cpt_post':
562
+
563
+ echo '<div class="selector-wrapper dashicons-before dashicons-arrow-down-alt2">';
564
  echo '<select name="', $field['id'], '" id="', $field['id'], '">';
565
  $args = array(
566
  'posts_per_page' => - 1,
576
  }
577
  $post = $old_post;
578
  echo '</select>';
579
+ echo '</div>';
580
  break;
581
  case 'select_cpt_term':
582
+ echo '<div class="selector-wrapper dashicons-before dashicons-arrow-down-alt2">';
583
  echo '<select name="', $field['id'], '" id="', $field['id'], '">';
584
  $cpt_terms = get_terms( $field['taxonomy'], 'orderby=count&hide_empty=0' );
585
  if ( ! empty( $cpt_terms ) ) {
588
  }
589
  }
590
  echo '</select>';
591
+ echo '</div>';
592
  break;
593
  case 'radio_inline':
594
  if ( empty( $meta ) && ! empty( $field['std'] ) ) {
601
  $i ++;
602
  }
603
  echo '</div>';
 
604
  break;
605
  case 'radio':
606
  if ( empty( $meta ) && ! empty( $field['std'] ) ) {
613
  $i ++;
614
  }
615
  echo '</ul>';
 
616
  break;
617
  case 'checkbox':
618
  echo '<input type="checkbox" name="', $field['id'], '" id="', $field['id'], '"', ( $meta === 'on' ) ? ' checked="checked"' : '', ' />';
 
619
  break;
620
  case 'multicheck':
621
  //even if empty, we should check for the meta key existance - empty is a valid value, it means all the checkboxes have been unchecked
631
  $i ++;
632
  }
633
  echo '</ul>';
 
634
  break;
635
  case 'title':
636
+ if ( isset( $field['value']) ) {
637
+ echo '<div class="cmb_metabox_title" id="', $field['id'], '">', $field['value'], '</div>';
638
+ }
639
  break;
640
  case 'wysiwyg':
641
+ wp_editor( $meta, $field['id'], isset( $field['options'] ) ? $field['options'] : array() );
 
642
  break;
643
  case 'taxonomy_select':
644
+
645
+ echo '<div class="selector-wrapper dashicons-before dashicons-arrow-down-alt2">';
646
  echo '<select name="', $field['id'], '" id="', $field['id'], '">';
647
  $names = wp_get_object_terms( $post->ID, $field['taxonomy'] );
648
  $terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
654
  }
655
  }
656
  echo '</select>';
657
+ echo '</div>';
658
  break;
659
  case 'taxonomy_radio':
660
  $names = wp_get_object_terms( $post->ID, $field['taxonomy'] );
668
  }
669
  }
670
  echo '</ul>';
 
671
  break;
672
  case 'taxonomy_multicheck':
673
  echo '<ul>';
683
  echo ' /><label>', $term->name, '</label></li>';
684
  }
685
  echo '</ul>';
 
686
  break;
687
  case 'file_list':
688
  echo '<input class="cmb_upload_file" type="text" size="36" name="', $field['id'], '" value="" />';
689
  echo '<input class="cmb_upload_button button" type="button" value="Upload File" />';
 
690
  $args = array(
691
  'post_type' => 'attachment',
692
  'numberposts' => null,
713
  echo '<input class="cmb_upload_file" type="' . $input_type_url . '" size="45" id="', $field['id'], '" name="', $field['id'], '" value="', $meta, '" />';
714
  echo '<input class="cmb_upload_button button" type="button" value="Upload File" />';
715
  echo '<input class="cmb_upload_file_id" type="hidden" id="', $field['id'], '_id" name="', $field['id'], '_id" value="', get_post_meta( $post->ID, $field['id'] . "_id", true ), '" />';
 
716
  echo '<div id="', $field['id'], '_status" class="cmb_media_status">';
717
  if ( $meta != '' ) {
718
  $check_image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $meta );
740
  echo '<input class="cmb_upload_file attachment" type="' . $input_type_url . '" size="45" id="', $field['id'], '" name="', $field['id'], '" value=\'', $meta, '\' />';
741
  echo '<input class="cmb_upload_button button" type="button" value="Upload File" />';
742
  echo '<input class="cmb_upload_file_id" type="hidden" id="', $field['id'], '_id" name="', $field['id'], '_id" value="', get_post_meta( $post->ID, $field['id'] . "_id", true ), '" />';
 
743
  echo '<div id="', $field['id'], '_status" class="cmb_media_status">';
744
  if ( $meta != '' ) {
745
  $check_image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $meta );
766
  ob_start();
767
  include( $file_path );
768
  echo ob_get_clean();
 
 
 
769
  }
770
 
771
  break;
776
  ob_start();
777
  include( $file_path );
778
  echo ob_get_clean();
 
 
 
779
  }
780
 
781
  break;
792
  ob_start();
793
  include( $file_path );
794
  echo ob_get_clean();
 
 
 
795
  }
796
 
797
  break;
827
  break;
828
 
829
  case 'oembed':
830
+ echo '<input class="cmb_oembed" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />';
831
  echo '<p class="cmb-spinner spinner"></p>';
832
  echo '<div id="', $field['id'], '_status" class="cmb_media_status ui-helper-clearfix embed_wrap">';
833
  if ( $meta != '' ) {
844
  echo '</div>';
845
  break;
846
 
847
+ case 'positions_map':
848
+ if ( empty( $meta ) && ! empty( $field['std'] ) ) {
849
+ $meta = $field['std'];
850
+ }
851
+ echo '<ul class="positions_map">';
852
+ $i = 1;
853
+ foreach ( $field['options'] as $option ) {
854
+ echo '<li><input type="radio" name="', $field['id'], '" id="', $field['id'], $i, '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' /><label for="', $field['id'], $i, '">', '<span>' . $option['value'] . '</span>' . '</label></li>';
855
+ $i ++;
856
+ }
857
+ echo '</ul>';
858
+ break;
859
+
860
  default:
861
  do_action( 'cmb_render_' . $field['type'], $field, $meta );
862
  }
863
 
864
+ echo '</li>';
865
  }
866
+ echo '</ul>';
867
  }
868
 
869
  function fold_display() {
870
+ // some special care for the pix_builder type
871
+ // when this type is on the page we need to make sure that the editor is supported but folded by default
872
+ if ( ! empty( $this->_meta_box['fields'] ) ) {
873
+ foreach ( $this->_meta_box['fields'] as $field ) {
874
+ if ( 'pix_builder' === $field['type'] ) {
875
+ if ( ! isset( $this->_meta_box['pages'] ) || empty( $this->_meta_box['pages'] ) ) {
876
+ continue;
877
+ }
878
+ foreach ( $this->_meta_box['pages'] as $post_type ) {
879
+ add_post_type_support( $post_type, 'editor' );
880
+ }
881
+ break;
882
+ }
883
+ }
884
+ }
885
 
886
  if ( ! isset( $this->_meta_box['display_on'] ) ) {
887
  return;
897
  ob_start(); ?>
898
  <script>
899
  ;
900
+ (function ($) {
901
+ $(document).ready(function () {
902
+ var metabox = $('#<?php echo $this->_meta_box['id']; ?>');
903
+ metabox.addClass('display_on')
904
+ .attr('data-action', '<?php echo 'show'; ?>')
905
+ .attr('data-when_key', '<?php echo $display_on['on']['field']; ?>')
906
+ .attr('data-has_value', '<?php echo $display_on['on']['value']; ?>');
907
+ });
908
+ })(jQuery);
909
  </script>
910
  <?php
911
  $script = ob_get_clean();
950
  $old = get_post_meta( $post_id, $name, ! $field['multiple'] /* If multicheck this can be multiple values */ );
951
  $new = isset( $_POST[ $field['id'] ] ) ? $_POST[ $field['id'] ] : null;
952
 
 
 
 
 
 
 
953
  if ( $type_comp == true && in_array( $field['type'], array(
954
  'taxonomy_select',
955
  'taxonomy_radio',
1005
  } elseif ( '' !== $new && $new != $old ) {
1006
  update_post_meta( $post_id, $name, $new );
1007
  } elseif ( '' == $new ) {
1008
+ update_post_meta( $post_id, $name, $new );
1009
  }
1010
 
1011
  if ( 'file' == $field['type'] ) {
1036
 
1037
  global $pixtypes_plugin;
1038
  $plugin_version = 0;
1039
+ if ( method_exists( $pixtypes_plugin, 'get_plugin_version' ) ) {
1040
  $plugin_version = $pixtypes_plugin->get_plugin_version();
1041
  }
1042
 
1086
 
1087
  wp_register_style( 'gridster', CMB_META_BOX_URL . 'css/jquery.gridster.css' );
1088
 
1089
+ wp_register_style( 'pix_builder', CMB_META_BOX_URL . 'css/pix_builder.css', array( 'gridster' ), $plugin_version );
1090
  wp_register_style( 'tooltipster', CMB_META_BOX_URL . 'css/tooltipster.css' );
1091
  wp_register_style( 'cmb-styles', CMB_META_BOX_URL . 'css/style.css', $cmb_style_array, $plugin_version );
1092
 
1106
  }
1107
  ?>
1108
  <script type="text/javascript">
1109
+ jQuery(function ($) {
1110
+ $('td.savesend input').val('<?php echo $label; ?>');
1111
+ });
1112
  </script>
1113
  <?php
1114
  }
1235
  exit;
1236
  }
1237
 
1238
+ $ids = rtrim( $ids, ',' );
1239
  $ids = explode( ',', $ids );
1240
 
1241
  $size = 'thumbnail';
1280
 
1281
  add_action( 'wp_ajax_pixplaylist_preview', 'ajax_pixplaylist_preview' );
1282
 
1283
+
1284
+
1285
+ /* ========== RELATED TO PIXBUILDER ======== */
1286
+
1287
+
1288
+ /**
1289
+ * Add the builder meta to the revision fields (by default only post title, content and excerpt are accounted for)
1290
+ *
1291
+ * @param array $fields
1292
+ *
1293
+ * @return array
1294
+ */
1295
+ function pixbuilder_add_revision_field( $fields ) {
1296
+ $fields['_pile_project_builder'] = 'Content Builder';
1297
+
1298
+ return $fields;
1299
+ }
1300
+ add_filter( '_wp_post_revision_fields', 'pixbuilder_add_revision_field', 10, 1 );
1301
+
1302
+ /**
1303
+ * Overwrite the meta value if we have a global revision set
1304
+ *
1305
+ * @param mixed $value
1306
+ * @param string $field
1307
+ * @param WP_Post $revision
1308
+ * @param string $type It ca be either "from" or "to"; see wp-admin/includes/revision.php @73-76
1309
+ *
1310
+ * @return mixed
1311
+ */
1312
+ function pixbuilder_revision_field_value( $value, $field, $revision, $type ) {
1313
+ if ( ! empty( $revision->ID ) ) {
1314
+ $value = get_metadata( 'post', $revision->ID, $field, true );
1315
+ }
1316
+
1317
+ return $value;
1318
+ }
1319
+ add_filter( '_wp_post_revision_field__pile_project_builder', 'pixbuilder_revision_field_value', 10, 4 );
1320
+
1321
+ /**
1322
+ * @param int $post_ID Post ID.
1323
+ * @param int $revision_ID Post revision ID.
1324
+ */
1325
+ function pixbuilder_on_restore_revision( $post_ID, $revision_ID ) {
1326
+ //bail if something is fishy
1327
+ if ( empty( $post_ID ) || empty( $revision_ID ) ) {
1328
+ return;
1329
+ }
1330
+
1331
+ $revision_meta = get_metadata( 'post', $revision_ID, '_pile_project_builder', true );
1332
+
1333
+ //save the revision meta to the parent post
1334
+ if ( false === $revision_meta ) {
1335
+ delete_post_meta( $post_ID, '_pile_project_builder' );
1336
+ } else {
1337
+ update_post_meta( $post_ID, '_pile_project_builder', $revision_meta );
1338
+ }
1339
+ }
1340
+ add_action( 'wp_restore_post_revision', 'pixbuilder_on_restore_revision', 20, 2 );
1341
+
1342
+ function pixbuilder_save_revision_meta( $post_ID, $post ) {
1343
+ //test if the current post is a revision
1344
+ //we are only interested in them
1345
+ $parent_ID = wp_is_post_revision( $post_ID );
1346
+ if ( false !== $parent_ID ) {
1347
+ $parent = get_post( $parent_ID );
1348
+ if ( empty( $parent ) ) {
1349
+ //bail as we don't like playing with fire
1350
+ return;
1351
+ }
1352
+
1353
+ //get the parent's meta data
1354
+ $meta = get_post_meta( $parent->ID, '_pile_project_builder', true );
1355
+
1356
+ if ( false !== $meta ) {
1357
+ //we will only save one entry per revision, hence the update_metadata
1358
+ update_metadata( 'post', $post_ID, '_pile_project_builder', $meta );
1359
+ }
1360
+ }
1361
+ }
1362
+ add_action( 'save_post', 'pixbuilder_save_revision_meta', 20, 2 );
features/metaboxes/js/cmb.js CHANGED
@@ -19,6 +19,16 @@ jQuery(document).ready(function ($) {
19
 
20
  var formfield;
21
 
 
 
 
 
 
 
 
 
 
 
22
  /**
23
  * First we take care of showing and hiding the meta boxes for post formats
24
  */
@@ -55,7 +65,12 @@ jQuery(document).ready(function ($) {
55
  icon: '(?)',
56
  iconDesktop: true,
57
  iconTouch: true,
58
- iconTheme: '.tooltipster-icon'
 
 
 
 
 
59
  });
60
 
61
  /**
@@ -73,7 +88,14 @@ jQuery(document).ready(function ($) {
73
  * Initialize color picker
74
  */
75
  if (typeof jQuery.wp === 'object' && typeof jQuery.wp.wpColorPicker === 'function') {
76
- $('input:text.cmb_colorpicker').wpColorPicker();
 
 
 
 
 
 
 
77
  } else {
78
  $('input:text.cmb_colorpicker').each(function (i) {
79
  $(this).after('<div id="picker-' + i + '" style="z-index: 1000; background: #EEE; border: 1px solid #CCC; position: absolute; display: block;"></div>');
19
 
20
  var formfield;
21
 
22
+ $('body').on('input', '.cmb_text_range', function(e) {
23
+ var $slider = $(this),
24
+ value = $slider.val(),
25
+ sliderMin = $slider.attr('min'),
26
+ sliderMax = $slider.attr('max'),
27
+ progress = (value - sliderMin) / (sliderMax - sliderMin),
28
+ percentage = (progress * 100).toFixed(2) + '%';
29
+ $slider.css('background-size', percentage + ' 100%');
30
+ });
31
+
32
  /**
33
  * First we take care of showing and hiding the meta boxes for post formats
34
  */
65
  icon: '(?)',
66
  iconDesktop: true,
67
  iconTouch: true,
68
+ iconTheme: '.tooltipster-icon',
69
+ delay: 300,
70
+ maxWidth: 280,
71
+ interactive: true,
72
+ trigger: 'hover',
73
+ contentAsHTML: true,
74
  });
75
 
76
  /**
88
  * Initialize color picker
89
  */
90
  if (typeof jQuery.wp === 'object' && typeof jQuery.wp.wpColorPicker === 'function') {
91
+ $('input:text.cmb_colorpicker').wpColorPicker({
92
+ change: function ( ev ) {
93
+ $(this).trigger('wpcolorpicker:change');
94
+ },
95
+ color: function ( ev ) {
96
+ $(this).trigger('wpcolorpicker:change');
97
+ },
98
+ });
99
  } else {
100
  $('input:text.cmb_colorpicker').each(function (i) {
101
  $(this).after('<div id="picker-' + i + '" style="z-index: 1000; background: #EEE; border: 1px solid #CCC; position: absolute; display: block;"></div>');
features/metaboxes/js/jquery.gridster.js CHANGED
@@ -1620,10 +1620,17 @@
1620
  */
1621
  fn.serialize = function($widgets) {
1622
  $widgets || ($widgets = this.$widgets);
1623
-
1624
  return $widgets.map($.proxy(function(i, widget) {
1625
- var $w = $(widget);
1626
- return this.options.serialize_params($w, $w.coords().grid);
 
 
 
 
 
 
 
 
1627
  }, this)).get();
1628
 
1629
  };
@@ -3892,6 +3899,45 @@
3892
  return this;
3893
  };
3894
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3895
 
3896
  /**
3897
  * Calculate columns and rows to be set based on the configuration
1620
  */
1621
  fn.serialize = function($widgets) {
1622
  $widgets || ($widgets = this.$widgets);
 
1623
  return $widgets.map($.proxy(function(i, widget) {
1624
+ var $w = $(widget),
1625
+ serialized = this.options.serialize_params($w, $w.coords().grid);
1626
+
1627
+ serialized.position = {
1628
+ top: $w.find('.position__ui-cell.top .position__ui-handle').attr('data-step') || "0",
1629
+ right: $w.find('.position__ui-cell.right .position__ui-handle').attr('data-step') || "0",
1630
+ bottom: $w.find('.position__ui-cell.bottom .position__ui-handle').attr('data-step') || "0",
1631
+ left: $w.find('.position__ui-cell.left .position__ui-handle').attr('data-step') || "0"
1632
+ };
1633
+ return serialized;
1634
  }, this)).get();
1635
 
1636
  };
3899
  return this;
3900
  };
3901
 
3902
+ /**
3903
+ * Change the dimensions of widgets.
3904
+ *
3905
+ * @method resize_widget_dimensions
3906
+ * @param {Object} [options] An Object with all options you want to
3907
+ * overwrite:
3908
+ * @param {Array} [options.widget_margins] Margin between widgets.
3909
+ * The first index for the horizontal margin (left, right) and
3910
+ * the second for the vertical margin (top, bottom).
3911
+ * @param {Array} [options.widget_base_dimensions] Base widget dimensions
3912
+ * in pixels. The first index for the width and the second for the
3913
+ * height.
3914
+ * @return {Class} Returns the instance of the Gridster Class.
3915
+ */
3916
+ fn.resize_widget_dimensions = function(options) {
3917
+ if (options.widget_margins) {
3918
+ this.options.widget_margins = options.widget_margins;
3919
+ }
3920
+
3921
+ if (options.widget_base_dimensions) {
3922
+ this.options.widget_base_dimensions = options.widget_base_dimensions;
3923
+ }
3924
+
3925
+ this.min_widget_width = (this.options.widget_margins[0] * 2) + this.options.widget_base_dimensions[0];
3926
+ this.min_widget_height = (this.options.widget_margins[1] * 2) + this.options.widget_base_dimensions[1];
3927
+
3928
+ var serializedGrid = this.serialize();
3929
+ this.$widgets.each($.proxy(function(i, widget) {
3930
+ var $widget = $(widget);
3931
+ this.resize_widget($widget);
3932
+ }, this));
3933
+
3934
+ this.generate_grid_and_stylesheet();
3935
+ this.get_widgets_from_DOM();
3936
+ this.set_dom_grid_height();
3937
+
3938
+ return this;
3939
+ };
3940
+
3941
 
3942
  /**
3943
  * Calculate columns and rows to be set based on the configuration
features/metaboxes/js/jquery.tooltipster.min.js CHANGED
@@ -1 +1,11 @@
1
- (function(d,f,g,b){var e="tooltipster",c={animation:"fade",arrow:true,arrowColor:"",content:"",delay:200,fixedWidth:0,maxWidth:0,functionBefore:function(m,n){n()},functionReady:function(m,n){},functionAfter:function(m){},icon:"(?)",iconDesktop:false,iconTouch:false,iconTheme:".tooltipster-icon",interactive:false,interactiveTolerance:350,offsetX:0,offsetY:0,onlyOne:true,position:"top",speed:350,timer:0,theme:".tooltipster-default",touchDevices:true,trigger:"hover",updateAnimation:true};function j(n,m){this.element=n;this.options=d.extend({},c,m);this._defaults=c;this._name=e;this.init()}function k(){return !!("ontouchstart" in f)}function a(){var m=g.body||g.documentElement;var o=m.style;var q="transition";if(typeof o[q]=="string"){return true}v=["Moz","Webkit","Khtml","O","ms"],q=q.charAt(0).toUpperCase()+q.substr(1);for(var n=0;n<v.length;n++){if(typeof o[v[n]+q]=="string"){return true}}return false}var l=true;if(!a()){l=false}var h=k();d(f).on("mousemove.tooltipster",function(){h=false;d(f).off("mousemove.tooltipster")});j.prototype={init:function(){var s=d(this.element);var o=this;var r=true;if((o.options.touchDevices==false)&&(h)){r=false}if(g.all&&!g.querySelector){r=false}if(r==true){if((this.options.iconDesktop==true)&&(!h)||((this.options.iconTouch==true)&&(h))){var n=s.attr("title");s.removeAttr("title");var q=o.options.iconTheme;var p=d('<span class="'+q.replace(".","")+'" title="'+n+'">'+this.options.icon+"</span>");p.insertAfter(s);s.data("tooltipsterIcon",p);s=p}var m=d.trim(o.options.content).length>0?o.options.content:s.attr("title");s.data("tooltipsterContent",m);s.removeAttr("title");if((this.options.touchDevices==true)&&(h)&&((this.options.trigger=="click")||(this.options.trigger=="hover"))){s.bind("touchstart",function(u,t){o.showTooltip()})}else{if(this.options.trigger=="hover"){s.on("mouseenter.tooltipster",function(){o.showTooltip()});if(this.options.interactive==true){s.on("mouseleave.tooltipster",function(){var u=s.data("tooltipster");var w=false;if((u!==b)&&(u!=="")){u.mouseenter(function(){w=true});u.mouseleave(function(){w=false});var t=setTimeout(function(){if(w==true){u.mouseleave(function(){o.hideTooltip()})}else{o.hideTooltip()}},o.options.interactiveTolerance)}else{o.hideTooltip()}})}else{s.on("mouseleave.tooltipster",function(){o.hideTooltip()})}}if(this.options.trigger=="click"){s.on("click.tooltipster",function(){if((s.data("tooltipster")=="")||(s.data("tooltipster")==b)){o.showTooltip()}else{o.hideTooltip()}})}}}},showTooltip:function(n){var o=d(this.element);var m=this;if(o.data("tooltipsterIcon")!==b){o=o.data("tooltipsterIcon")}if(!o.hasClass("tooltipster-disable")){if((d(".tooltipster-base").not(".tooltipster-dying").length>0)&&(m.options.onlyOne==true)){d(".tooltipster-base").not(".tooltipster-dying").not(o.data("tooltipster")).each(function(){d(this).addClass("tooltipster-kill");var p=d(this).data("origin");p.data("plugin_tooltipster").hideTooltip()})}o.clearQueue().delay(m.options.delay).queue(function(){m.options.functionBefore(o,function(){if((o.data("tooltipster")!==b)&&(o.data("tooltipster")!=="")){var y=o.data("tooltipster");if(!y.hasClass("tooltipster-kill")){var u="tooltipster-"+m.options.animation;y.removeClass("tooltipster-dying");if(l==true){y.clearQueue().addClass(u+"-show")}if(m.options.timer>0){var r=y.data("tooltipsterTimer");clearTimeout(r);r=setTimeout(function(){y.data("tooltipsterTimer",b);m.hideTooltip()},m.options.timer);y.data("tooltipsterTimer",r)}if((m.options.touchDevices==true)&&(h)){d("body").bind("touchstart",function(D){if(m.options.interactive==true){var F=d(D.target);var E=true;F.parents().each(function(){if(d(this).hasClass("tooltipster-base")){E=false}});if(E==true){m.hideTooltip();d("body").unbind("touchstart")}}else{m.hideTooltip();d("body").unbind("touchstart")}})}}}else{d("body").css("overflow-x","hidden");var z=o.data("tooltipsterContent");var x=m.options.theme;var A=x.replace(".","");var u="tooltipster-"+m.options.animation;var t="-webkit-transition-duration: "+m.options.speed+"ms; -webkit-animation-duration: "+m.options.speed+"ms; -moz-transition-duration: "+m.options.speed+"ms; -moz-animation-duration: "+m.options.speed+"ms; -o-transition-duration: "+m.options.speed+"ms; -o-animation-duration: "+m.options.speed+"ms; -ms-transition-duration: "+m.options.speed+"ms; -ms-animation-duration: "+m.options.speed+"ms; transition-duration: "+m.options.speed+"ms; animation-duration: "+m.options.speed+"ms;";var p=m.options.fixedWidth>0?"width:"+m.options.fixedWidth+"px;":"";var B=m.options.maxWidth>0?"max-width:"+m.options.maxWidth+"px;":"";var w=m.options.interactive==true?"pointer-events: auto;":"";var y=d('<div class="tooltipster-base '+A+" "+u+'" style="'+p+" "+B+" "+w+" "+t+'"></div>');var s=d('<div class="tooltipster-content"></div>');s.html(z);y.append(s);y.appendTo("body");o.data("tooltipster",y);y.data("origin",o);m.positionTooltip();m.options.functionReady(o,y);if(l==true){y.addClass(u+"-show")}else{y.css("display","none").removeClass(u).fadeIn(m.options.speed)}var C=z;var q=setInterval(function(){var D=o.data("tooltipsterContent");if(d("body").find(o).length==0){y.addClass("tooltipster-dying");m.hideTooltip()}else{if((C!==D)&&(D!=="")){C=D;y.find(".tooltipster-content").html(D);if(m.options.updateAnimation==true){if(a()){y.css({width:"","-webkit-transition":"all "+m.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-moz-transition":"all "+m.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-o-transition":"all "+m.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-ms-transition":"all "+m.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms",transition:"all "+m.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms"}).addClass("tooltipster-content-changing");setTimeout(function(){y.removeClass("tooltipster-content-changing");setTimeout(function(){y.css({"-webkit-transition":m.options.speed+"ms","-moz-transition":m.options.speed+"ms","-o-transition":m.options.speed+"ms","-ms-transition":m.options.speed+"ms",transition:m.options.speed+"ms"})},m.options.speed)},m.options.speed)}else{y.fadeTo(m.options.speed,0.5,function(){y.fadeTo(m.options.speed,1)})}}m.positionTooltip()}}if((d("body").find(y).length==0)||(d("body").find(o).length==0)){clearInterval(q)}},200);if(m.options.timer>0){var r=setTimeout(function(){y.data("tooltipsterTimer",b);m.hideTooltip()},m.options.timer+m.options.speed);y.data("tooltipsterTimer",r)}if((m.options.touchDevices==true)&&(h)){d("body").bind("touchstart",function(D){if(m.options.interactive==true){var F=d(D.target);var E=true;F.parents().each(function(){if(d(this).hasClass("tooltipster-base")){E=false}});if(E==true){m.hideTooltip();d("body").unbind("touchstart")}}else{m.hideTooltip();d("body").unbind("touchstart")}})}y.mouseleave(function(){m.hideTooltip()})}});o.dequeue()})}},hideTooltip:function(n){var q=d(this.element);var m=this;if(q.data("tooltipsterIcon")!==b){q=q.data("tooltipsterIcon")}var p=q.data("tooltipster");if(p==b){p=d(".tooltipster-dying")}q.clearQueue();if((p!==b)&&(p!=="")){var r=p.data("tooltipsterTimer");if(r!==b){clearTimeout(r)}var o="tooltipster-"+m.options.animation;if(l==true){p.clearQueue().removeClass(o+"-show").addClass("tooltipster-dying").delay(m.options.speed).queue(function(){p.remove();q.data("tooltipster","");d("body").css("verflow-x","");m.options.functionAfter(q)})}else{p.clearQueue().addClass("tooltipster-dying").fadeOut(m.options.speed,function(){p.remove();q.data("tooltipster","");d("body").css("verflow-x","");m.options.functionAfter(q)})}}},positionTooltip:function(P){var B=d(this.element);var ac=this;if(B.data("tooltipsterIcon")!==b){B=B.data("tooltipsterIcon")}if((B.data("tooltipster")!==b)&&(B.data("tooltipster")!=="")){var ai=B.data("tooltipster");ai.css("width","");var aj=d(f).width();var C=B.outerWidth(false);var ah=B.outerHeight(false);var am=ai.outerWidth(false);var n=ai.innerWidth()+1;var N=ai.outerHeight(false);var ab=B.offset();var aa=ab.top;var w=ab.left;var z=b;if(B.is("area")){var U=B.attr("shape");var ag=B.parent().attr("name");var Q=d('img[usemap="#'+ag+'"]');var o=Q.offset().left;var M=Q.offset().top;var X=B.attr("coords")!==b?B.attr("coords").split(","):b;if(U=="circle"){var O=parseInt(X[0]);var s=parseInt(X[1]);var E=parseInt(X[2]);ah=E*2;C=E*2;aa=M+s-E;w=o+O-E}else{if(U=="rect"){var O=parseInt(X[0]);var s=parseInt(X[1]);var r=parseInt(X[2]);var K=parseInt(X[3]);ah=K-s;C=r-O;aa=M+s;w=o+O}else{if(U=="poly"){var y=[];var af=[];var I=0,H=0,ae=0,ad=0;var ak="even";for(i=0;i<X.length;i++){var G=parseInt(X[i]);if(ak=="even"){if(G>ae){ae=G;if(i==0){I=ae}}if(G<I){I=G}ak="odd"}else{if(G>ad){ad=G;if(i==1){H=ad}}if(G<H){H=G}ak="even"}}ah=ad-H;C=ae-I;aa=M+H;w=o+I}else{ah=Q.outerHeight(false);C=Q.outerWidth(false);aa=M;w=o}}}}if(ac.options.fixedWidth==0){ai.css({width:n+"px","padding-left":"0px","padding-right":"0px"})}var t=0,W=0;var Y=parseInt(ac.options.offsetY);var Z=parseInt(ac.options.offsetX);var q="";function x(){var ao=d(f).scrollLeft();if((t-ao)<0){var an=t-ao;t=ao;ai.data("arrow-reposition",an)}if(((t+am)-ao)>aj){var an=t-((aj+ao)-am);t=(aj+ao)-am;ai.data("arrow-reposition",an)}}function u(ao,an){if(((aa-d(f).scrollTop()-N-Y-12)<0)&&(an.indexOf("top")>-1)){ac.options.position=ao;z=an}if(((aa+ah+N+12+Y)>(d(f).scrollTop()+d(f).height()))&&(an.indexOf("bottom")>-1)){ac.options.position=ao;z=an;W=(aa-N)-Y-12}}if(ac.options.position=="top"){var R=(w+am)-(w+C);t=(w+Z)-(R/2);W=(aa-N)-Y-12;x();u("bottom","top")}if(ac.options.position=="top-left"){t=w+Z;W=(aa-N)-Y-12;x();u("bottom-left","top-left")}if(ac.options.position=="top-right"){t=(w+C+Z)-am;W=(aa-N)-Y-12;x();u("bottom-right","top-right")}if(ac.options.position=="bottom"){var R=(w+am)-(w+C);t=w-(R/2)+Z;W=(aa+ah)+Y+12;x();u("top","bottom")}if(ac.options.position=="bottom-left"){t=w+Z;W=(aa+ah)+Y+12;x();u("top-left","bottom-left")}if(ac.options.position=="bottom-right"){t=(w+C+Z)-am;W=(aa+ah)+Y+12;x();u("top-right","bottom-right")}if(ac.options.position=="left"){t=w-Z-am-12;myLeftMirror=w+Z+C+12;var L=(aa+N)-(aa+B.outerHeight(false));W=aa-(L/2)-Y;if((t<0)&&((myLeftMirror+am)>aj)){var p=parseFloat(ai.css("border-width"))*2;var m=(am+t)-p;ai.css("width",m+"px");N=ai.outerHeight(false);t=w-Z-m-12-p;L=(aa+N)-(aa+B.outerHeight(false));W=aa-(L/2)-Y}else{if(t<0){t=w+Z+C+12;ai.data("arrow-reposition","left")}}}if(ac.options.position=="right"){t=w+Z+C+12;myLeftMirror=w-Z-am-12;var L=(aa+N)-(aa+B.outerHeight(false));W=aa-(L/2)-Y;if(((t+am)>aj)&&(myLeftMirror<0)){var p=parseFloat(ai.css("border-width"))*2;var m=(aj-t)-p;ai.css("width",m+"px");N=ai.outerHeight(false);L=(aa+N)-(aa+B.outerHeight(false));W=aa-(L/2)-Y}else{if((t+am)>aj){t=w-Z-am-12;ai.data("arrow-reposition","right")}}}if(ac.options.arrow==true){var J="tooltipster-arrow-"+ac.options.position;if(ac.options.arrowColor.length<1){var S=ai.css("background-color")}else{var S=ac.options.arrowColor}var al=ai.data("arrow-reposition");if(!al){al=""}else{if(al=="left"){J="tooltipster-arrow-right";al=""}else{if(al=="right"){J="tooltipster-arrow-left";al=""}else{al="left:"+al+"px;"}}}if((ac.options.position=="top")||(ac.options.position=="top-left")||(ac.options.position=="top-right")){var V=parseFloat(ai.css("border-bottom-width"));var A=ai.css("border-bottom-color")}else{if((ac.options.position=="bottom")||(ac.options.position=="bottom-left")||(ac.options.position=="bottom-right")){var V=parseFloat(ai.css("border-top-width"));var A=ai.css("border-top-color")}else{if(ac.options.position=="left"){var V=parseFloat(ai.css("border-right-width"));var A=ai.css("border-right-color")}else{if(ac.options.position=="right"){var V=parseFloat(ai.css("border-left-width"));var A=ai.css("border-left-color")}else{var V=parseFloat(ai.css("border-bottom-width"));var A=ai.css("border-bottom-color")}}}}if(V>1){V++}var F="";if(V!==0){var D="";var T="border-color: "+A+";";if(J.indexOf("bottom")!==-1){D="margin-top: -"+V+"px;"}else{if(J.indexOf("top")!==-1){D="margin-bottom: -"+V+"px;"}else{if(J.indexOf("left")!==-1){D="margin-right: -"+V+"px;"}else{if(J.indexOf("right")!==-1){D="margin-left: -"+V+"px;"}}}}F='<span class="tooltipster-arrow-border" style="'+D+" "+T+';"></span>'}ai.find(".tooltipster-arrow").remove();q='<div class="'+J+' tooltipster-arrow" style="'+al+'">'+F+'<span style="border-color:'+S+';"></span></div>';ai.append(q)}ai.css({top:W+"px",left:t+"px"});if(z!==b){ac.options.position=z}}}};d.fn[e]=function(n){if(typeof n==="string"){var p=this;var m=arguments[1];if(p.data("plugin_tooltipster")==b){var o=p.find("*");p=d();o.each(function(){if(d(this).data("plugin_tooltipster")!==b){p.push(d(this))}})}p.each(function(){switch(n.toLowerCase()){case"show":d(this).data("plugin_tooltipster").showTooltip();break;case"hide":d(this).data("plugin_tooltipster").hideTooltip();break;case"disable":d(this).addClass("tooltipster-disable");break;case"enable":d(this).removeClass("tooltipster-disable");break;case"destroy":d(this).data("plugin_tooltipster").hideTooltip();d(this).data("plugin_tooltipster","").attr("title",p.data("tooltipsterContent")).data("tooltipsterContent","").data("plugin_tooltipster","").off("mouseenter.tooltipster mouseleave.tooltipster click.tooltipster");break;case"update":if(d(this).data("tooltipsterIcon")==b){d(this).data("tooltipsterContent",m)}else{var q=d(this).data("tooltipsterIcon");q.data("tooltipsterContent",m)}break;case"reposition":d(this).data("plugin_tooltipster").positionTooltip();break}});return this}return this.each(function(){if(!d.data(this,"plugin_"+e)){d.data(this,"plugin_"+e,new j(this,n))}var q=d(this).data("plugin_tooltipster").options;if((q.iconDesktop==true)&&(!h)||((q.iconTouch==true)&&(h))){var r=d(this).data("plugin_tooltipster");d(this).next().data("plugin_tooltipster",r)}})};if(h){f.addEventListener("orientationchange",function(){if(d(".tooltipster-base").length>0){d(".tooltipster-base").each(function(){var m=d(this).data("origin");m.data("plugin_tooltipster").hideTooltip()})}},false)}d(f).on("resize.tooltipster",function(){var m=d(".tooltipster-base").data("origin");if((m!==null)&&(m!==b)){m.tooltipster("reposition")}})})(jQuery,window,document);
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+
3
+ Tooltipster 3.3.0 | 2014-11-08
4
+ A rockin' custom tooltip jQuery plugin
5
+
6
+ Developed by Caleb Jacob under the MIT license http://opensource.org/licenses/MIT
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9
+
10
+ */
11
+ ;(function(e,t,n){function s(t,n){this.bodyOverflowX;this.callbacks={hide:[],show:[]};this.checkInterval=null;this.Content;this.$el=e(t);this.$elProxy;this.elProxyPosition;this.enabled=true;this.options=e.extend({},i,n);this.mouseIsOverProxy=false;this.namespace="tooltipster-"+Math.round(Math.random()*1e5);this.Status="hidden";this.timerHide=null;this.timerShow=null;this.$tooltip;this.options.iconTheme=this.options.iconTheme.replace(".","");this.options.theme=this.options.theme.replace(".","");this._init()}function o(t,n){var r=true;e.each(t,function(e,i){if(typeof n[e]==="undefined"||t[e]!==n[e]){r=false;return false}});return r}function f(){return!a&&u}function l(){var e=n.body||n.documentElement,t=e.style,r="transition";if(typeof t[r]=="string"){return true}v=["Moz","Webkit","Khtml","O","ms"],r=r.charAt(0).toUpperCase()+r.substr(1);for(var i=0;i<v.length;i++){if(typeof t[v[i]+r]=="string"){return true}}return false}var r="tooltipster",i={animation:"fade",arrow:true,arrowColor:"",autoClose:true,content:null,contentAsHTML:false,contentCloning:true,debug:true,delay:200,minWidth:0,maxWidth:null,functionInit:function(e,t){},functionBefore:function(e,t){t()},functionReady:function(e,t){},functionAfter:function(e){},hideOnClick:false,icon:"(?)",iconCloning:true,iconDesktop:false,iconTouch:false,iconTheme:"tooltipster-icon",interactive:false,interactiveTolerance:350,multiple:false,offsetX:0,offsetY:0,onlyOne:false,position:"top",positionTracker:false,positionTrackerCallback:function(e){if(this.option("trigger")=="hover"&&this.option("autoClose")){this.hide()}},restoration:"current",speed:350,timer:0,theme:"tooltipster-default",touchDevices:true,trigger:"hover",updateAnimation:true};s.prototype={_init:function(){var t=this;if(n.querySelector){var r=null;if(t.$el.data("tooltipster-initialTitle")===undefined){r=t.$el.attr("title");if(r===undefined)r=null;t.$el.data("tooltipster-initialTitle",r)}if(t.options.content!==null){t._content_set(t.options.content)}else{t._content_set(r)}var i=t.options.functionInit.call(t.$el,t.$el,t.Content);if(typeof i!=="undefined")t._content_set(i);t.$el.removeAttr("title").addClass("tooltipstered");if(!u&&t.options.iconDesktop||u&&t.options.iconTouch){if(typeof t.options.icon==="string"){t.$elProxy=e('<span class="'+t.options.iconTheme+'"></span>');t.$elProxy.text(t.options.icon)}else{if(t.options.iconCloning)t.$elProxy=t.options.icon.clone(true);else t.$elProxy=t.options.icon}t.$elProxy.insertAfter(t.$el)}else{t.$elProxy=t.$el}if(t.options.trigger=="hover"){t.$elProxy.on("mouseenter."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=true;t._show()}}).on("mouseleave."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=false}});if(u&&t.options.touchDevices){t.$elProxy.on("touchstart."+t.namespace,function(){t._showNow()})}}else if(t.options.trigger=="click"){t.$elProxy.on("click."+t.namespace,function(){if(!f()||t.options.touchDevices){t._show()}})}}},_show:function(){var e=this;if(e.Status!="shown"&&e.Status!="appearing"){if(e.options.delay){e.timerShow=setTimeout(function(){if(e.options.trigger=="click"||e.options.trigger=="hover"&&e.mouseIsOverProxy){e._showNow()}},e.options.delay)}else e._showNow()}},_showNow:function(n){var r=this;r.options.functionBefore.call(r.$el,r.$el,function(){if(r.enabled&&r.Content!==null){if(n)r.callbacks.show.push(n);r.callbacks.hide=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;if(r.options.onlyOne){e(".tooltipstered").not(r.$el).each(function(t,n){var r=e(n),i=r.data("tooltipster-ns");e.each(i,function(e,t){var n=r.data(t),i=n.status(),s=n.option("autoClose");if(i!=="hidden"&&i!=="disappearing"&&s){n.hide()}})})}var i=function(){r.Status="shown";e.each(r.callbacks.show,function(e,t){t.call(r.$el)});r.callbacks.show=[]};if(r.Status!=="hidden"){var s=0;if(r.Status==="disappearing"){r.Status="appearing";if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-"+r.options.animation+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.stop().fadeIn(i)}}else if(r.Status==="shown"){i()}}else{r.Status="appearing";var s=r.options.speed;r.bodyOverflowX=e("body").css("overflow-x");e("body").css("overflow-x","hidden");var o="tooltipster-"+r.options.animation,a="-webkit-transition-duration: "+r.options.speed+"ms; -webkit-animation-duration: "+r.options.speed+"ms; -moz-transition-duration: "+r.options.speed+"ms; -moz-animation-duration: "+r.options.speed+"ms; -o-transition-duration: "+r.options.speed+"ms; -o-animation-duration: "+r.options.speed+"ms; -ms-transition-duration: "+r.options.speed+"ms; -ms-animation-duration: "+r.options.speed+"ms; transition-duration: "+r.options.speed+"ms; animation-duration: "+r.options.speed+"ms;",f=r.options.minWidth?"min-width:"+Math.round(r.options.minWidth)+"px;":"",c=r.options.maxWidth?"max-width:"+Math.round(r.options.maxWidth)+"px;":"",h=r.options.interactive?"pointer-events: auto;":"";r.$tooltip=e('<div class="tooltipster-base '+r.options.theme+'" style="'+f+" "+c+" "+h+" "+a+'"><div class="tooltipster-content"></div></div>');if(l())r.$tooltip.addClass(o);r._content_insert();r.$tooltip.appendTo("body");r.reposition();r.options.functionReady.call(r.$el,r.$el,r.$tooltip);if(l()){r.$tooltip.addClass(o+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.css("display","none").fadeIn(r.options.speed,i)}r._interval_set();e(t).on("scroll."+r.namespace+" resize."+r.namespace,function(){r.reposition()});if(r.options.autoClose){e("body").off("."+r.namespace);if(r.options.trigger=="hover"){if(u){setTimeout(function(){e("body").on("touchstart."+r.namespace,function(){r.hide()})},0)}if(r.options.interactive){if(u){r.$tooltip.on("touchstart."+r.namespace,function(e){e.stopPropagation()})}var p=null;r.$elProxy.add(r.$tooltip).on("mouseleave."+r.namespace+"-autoClose",function(){clearTimeout(p);p=setTimeout(function(){r.hide()},r.options.interactiveTolerance)}).on("mouseenter."+r.namespace+"-autoClose",function(){clearTimeout(p)})}else{r.$elProxy.on("mouseleave."+r.namespace+"-autoClose",function(){r.hide()})}if(r.options.hideOnClick){r.$elProxy.on("click."+r.namespace+"-autoClose",function(){r.hide()})}}else if(r.options.trigger=="click"){setTimeout(function(){e("body").on("click."+r.namespace+" touchstart."+r.namespace,function(){r.hide()})},0);if(r.options.interactive){r.$tooltip.on("click."+r.namespace+" touchstart."+r.namespace,function(e){e.stopPropagation()})}}}}if(r.options.timer>0){r.timerHide=setTimeout(function(){r.timerHide=null;r.hide()},r.options.timer+s)}}})},_interval_set:function(){var t=this;t.checkInterval=setInterval(function(){if(e("body").find(t.$el).length===0||e("body").find(t.$elProxy).length===0||t.Status=="hidden"||e("body").find(t.$tooltip).length===0){if(t.Status=="shown"||t.Status=="appearing")t.hide();t._interval_cancel()}else{if(t.options.positionTracker){var n=t._repositionInfo(t.$elProxy),r=false;if(o(n.dimension,t.elProxyPosition.dimension)){if(t.$elProxy.css("position")==="fixed"){if(o(n.position,t.elProxyPosition.position))r=true}else{if(o(n.offset,t.elProxyPosition.offset))r=true}}if(!r){t.reposition();t.options.positionTrackerCallback.call(t,t.$el)}}}},200)},_interval_cancel:function(){clearInterval(this.checkInterval);this.checkInterval=null},_content_set:function(e){if(typeof e==="object"&&e!==null&&this.options.contentCloning){e=e.clone(true)}this.Content=e},_content_insert:function(){var e=this,t=this.$tooltip.find(".tooltipster-content");if(typeof e.Content==="string"&&!e.options.contentAsHTML){t.text(e.Content)}else{t.empty().append(e.Content)}},_update:function(e){var t=this;t._content_set(e);if(t.Content!==null){if(t.Status!=="hidden"){t._content_insert();t.reposition();if(t.options.updateAnimation){if(l()){t.$tooltip.css({width:"","-webkit-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-moz-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-o-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-ms-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms",transition:"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms"}).addClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!="hidden"){t.$tooltip.removeClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!=="hidden"){t.$tooltip.css({"-webkit-transition":t.options.speed+"ms","-moz-transition":t.options.speed+"ms","-o-transition":t.options.speed+"ms","-ms-transition":t.options.speed+"ms",transition:t.options.speed+"ms"})}},t.options.speed)}},t.options.speed)}else{t.$tooltip.fadeTo(t.options.speed,.5,function(){if(t.Status!="hidden"){t.$tooltip.fadeTo(t.options.speed,1)}})}}}}else{t.hide()}},_repositionInfo:function(e){return{dimension:{height:e.outerHeight(false),width:e.outerWidth(false)},offset:e.offset(),position:{left:parseInt(e.css("left")),top:parseInt(e.css("top"))}}},hide:function(n){var r=this;if(n)r.callbacks.hide.push(n);r.callbacks.show=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;var i=function(){e.each(r.callbacks.hide,function(e,t){t.call(r.$el)});r.callbacks.hide=[]};if(r.Status=="shown"||r.Status=="appearing"){r.Status="disappearing";var s=function(){r.Status="hidden";if(typeof r.Content=="object"&&r.Content!==null){r.Content.detach()}r.$tooltip.remove();r.$tooltip=null;e(t).off("."+r.namespace);e("body").off("."+r.namespace).css("overflow-x",r.bodyOverflowX);e("body").off("."+r.namespace);r.$elProxy.off("."+r.namespace+"-autoClose");r.options.functionAfter.call(r.$el,r.$el);i()};if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-"+r.options.animation+"-show").addClass("tooltipster-dying");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(s)}else{r.$tooltip.stop().fadeOut(r.options.speed,s)}}else if(r.Status=="hidden"){i()}return r},show:function(e){this._showNow(e);return this},update:function(e){return this.content(e)},content:function(e){if(typeof e==="undefined"){return this.Content}else{this._update(e);return this}},reposition:function(){var n=this;if(e("body").find(n.$tooltip).length!==0){n.$tooltip.css("width","");n.elProxyPosition=n._repositionInfo(n.$elProxy);var r=null,i=e(t).width(),s=n.elProxyPosition,o=n.$tooltip.outerWidth(false),u=n.$tooltip.innerWidth()+1,a=n.$tooltip.outerHeight(false);if(n.$elProxy.is("area")){var f=n.$elProxy.attr("shape"),l=n.$elProxy.parent().attr("name"),c=e('img[usemap="#'+l+'"]'),h=c.offset().left,p=c.offset().top,d=n.$elProxy.attr("coords")!==undefined?n.$elProxy.attr("coords").split(","):undefined;if(f=="circle"){var v=parseInt(d[0]),m=parseInt(d[1]),g=parseInt(d[2]);s.dimension.height=g*2;s.dimension.width=g*2;s.offset.top=p+m-g;s.offset.left=h+v-g}else if(f=="rect"){var v=parseInt(d[0]),m=parseInt(d[1]),y=parseInt(d[2]),b=parseInt(d[3]);s.dimension.height=b-m;s.dimension.width=y-v;s.offset.top=p+m;s.offset.left=h+v}else if(f=="poly"){var w=[],E=[],S=0,x=0,T=0,N=0,C="even";for(var k=0;k<d.length;k++){var L=parseInt(d[k]);if(C=="even"){if(L>T){T=L;if(k===0){S=T}}if(L<S){S=L}C="odd"}else{if(L>N){N=L;if(k==1){x=N}}if(L<x){x=L}C="even"}}s.dimension.height=N-x;s.dimension.width=T-S;s.offset.top=p+x;s.offset.left=h+S}else{s.dimension.height=c.outerHeight(false);s.dimension.width=c.outerWidth(false);s.offset.top=p;s.offset.left=h}}var A=0,O=0,M=0,_=parseInt(n.options.offsetY),D=parseInt(n.options.offsetX),P=n.options.position;function H(){var n=e(t).scrollLeft();if(A-n<0){r=A-n;A=n}if(A+o-n>i){r=A-(i+n-o);A=i+n-o}}function B(n,r){if(s.offset.top-e(t).scrollTop()-a-_-12<0&&r.indexOf("top")>-1){P=n}if(s.offset.top+s.dimension.height+a+12+_>e(t).scrollTop()+e(t).height()&&r.indexOf("bottom")>-1){P=n;M=s.offset.top-a-_-12}}if(P=="top"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left+D-j/2;M=s.offset.top-a-_-12;H();B("bottom","top")}if(P=="top-left"){A=s.offset.left+D;M=s.offset.top-a-_-12;H();B("bottom-left","top-left")}if(P=="top-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top-a-_-12;H();B("bottom-right","top-right")}if(P=="bottom"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left-j/2+D;M=s.offset.top+s.dimension.height+_+12;H();B("top","bottom")}if(P=="bottom-left"){A=s.offset.left+D;M=s.offset.top+s.dimension.height+_+12;H();B("top-left","bottom-left")}if(P=="bottom-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top+s.dimension.height+_+12;H();B("top-right","bottom-right")}if(P=="left"){A=s.offset.left-D-o-12;O=s.offset.left+D+s.dimension.width+12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A<0&&O+o>i){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=o+A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);A=s.offset.left-D-q-12-I;F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A<0){A=s.offset.left+D+s.dimension.width+12;r="left"}}if(P=="right"){A=s.offset.left+D+s.dimension.width+12;O=s.offset.left-D-o-12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A+o>i&&O<0){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=i-A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A+o>i){A=s.offset.left-D-o-12;r="right"}}if(n.options.arrow){var R="tooltipster-arrow-"+P;if(n.options.arrowColor.length<1){var U=n.$tooltip.css("background-color")}else{var U=n.options.arrowColor}if(!r){r=""}else if(r=="left"){R="tooltipster-arrow-right";r=""}else if(r=="right"){R="tooltipster-arrow-left";r=""}else{r="left:"+Math.round(r)+"px;"}if(P=="top"||P=="top-left"||P=="top-right"){var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}else if(P=="bottom"||P=="bottom-left"||P=="bottom-right"){var z=parseFloat(n.$tooltip.css("border-top-width")),W=n.$tooltip.css("border-top-color")}else if(P=="left"){var z=parseFloat(n.$tooltip.css("border-right-width")),W=n.$tooltip.css("border-right-color")}else if(P=="right"){var z=parseFloat(n.$tooltip.css("border-left-width")),W=n.$tooltip.css("border-left-color")}else{var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}if(z>1){z++}var X="";if(z!==0){var V="",J="border-color: "+W+";";if(R.indexOf("bottom")!==-1){V="margin-top: -"+Math.round(z)+"px;"}else if(R.indexOf("top")!==-1){V="margin-bottom: -"+Math.round(z)+"px;"}else if(R.indexOf("left")!==-1){V="margin-right: -"+Math.round(z)+"px;"}else if(R.indexOf("right")!==-1){V="margin-left: -"+Math.round(z)+"px;"}X='<span class="tooltipster-arrow-border" style="'+V+" "+J+';"></span>'}n.$tooltip.find(".tooltipster-arrow").remove();var K='<div class="'+R+' tooltipster-arrow" style="'+r+'">'+X+'<span style="border-color:'+U+';"></span></div>';n.$tooltip.append(K)}n.$tooltip.css({top:Math.round(M)+"px",left:Math.round(A)+"px"})}return n},enable:function(){this.enabled=true;return this},disable:function(){this.hide();this.enabled=false;return this},destroy:function(){var t=this;t.hide();if(t.$el[0]!==t.$elProxy[0]){t.$elProxy.remove()}t.$el.removeData(t.namespace).off("."+t.namespace);var n=t.$el.data("tooltipster-ns");if(n.length===1){var r=null;if(t.options.restoration==="previous"){r=t.$el.data("tooltipster-initialTitle")}else if(t.options.restoration==="current"){r=typeof t.Content==="string"?t.Content:e("<div></div>").append(t.Content).html()}if(r){t.$el.attr("title",r)}t.$el.removeClass("tooltipstered").removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else{n=e.grep(n,function(e,n){return e!==t.namespace});t.$el.data("tooltipster-ns",n)}return t},elementIcon:function(){return this.$el[0]!==this.$elProxy[0]?this.$elProxy[0]:undefined},elementTooltip:function(){return this.$tooltip?this.$tooltip[0]:undefined},option:function(e,t){if(typeof t=="undefined")return this.options[e];else{this.options[e]=t;return this}},status:function(){return this.Status}};e.fn[r]=function(){var t=arguments;if(this.length===0){if(typeof t[0]==="string"){var n=true;switch(t[0]){case"setDefaults":e.extend(i,t[1]);break;default:n=false;break}if(n)return true;else return this}else{return this}}else{if(typeof t[0]==="string"){var r="#*$~&";this.each(function(){var n=e(this).data("tooltipster-ns"),i=n?e(this).data(n[0]):null;if(i){if(typeof i[t[0]]==="function"){var s=i[t[0]](t[1],t[2])}else{throw new Error('Unknown method .tooltipster("'+t[0]+'")')}if(s!==i){r=s;return false}}else{throw new Error("You called Tooltipster's \""+t[0]+'" method on an uninitialized element')}});return r!=="#*$~&"?r:this}else{var o=[],u=t[0]&&typeof t[0].multiple!=="undefined",a=u&&t[0].multiple||!u&&i.multiple,f=t[0]&&typeof t[0].debug!=="undefined",l=f&&t[0].debug||!f&&i.debug;this.each(function(){var n=false,r=e(this).data("tooltipster-ns"),i=null;if(!r){n=true}else if(a){n=true}else if(l){console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.')}if(n){i=new s(this,t[0]);if(!r)r=[];r.push(i.namespace);e(this).data("tooltipster-ns",r);e(this).data(i.namespace,i)}o.push(i)});if(a)return o;else return this}}};var u=!!("ontouchstart"in t);var a=false;e("body").one("mousemove",function(){a=true})})(jQuery,window,document);
features/metaboxes/js/pix_builder.js CHANGED
@@ -9,7 +9,7 @@
9
 
10
  $(document).ready(function () {
11
 
12
- var $pix_builder = $('#pix_builder'),
13
  gridster = $(".gridster > ul"),
14
  modal_container = $('.pix_builder_editor_modal_container');
15
 
@@ -29,92 +29,21 @@
29
  gridster_params.on_resize_callback[1],
30
  gridster_params.on_resize_callback[2],
31
 
32
- gridster_params.on_resize_callback[3]);
33
-
34
- ///**
35
- // * use this to serialize these params
36
- // * after that echo them in activation.php config
37
- // */
38
- // var gridster_params = {
39
- // widget_margins: [30, 30],
40
- // widget_base_dimensions: [150, 100],
41
- // min_cols: 3,
42
- // max_cols: 6,
43
- // autogenerate_stylesheet: true,
44
- // resize: {
45
- // enabled: true,
46
- // axes: ['x'],
47
- // resize: function (el, ui, $widget) {
48
- // var size_x = this.resize_wgd.size_x;
49
- // if ( size_x == 5 ) {
50
- // // get the closest widget size
51
- // var cws = this.resize_last_sizex;
52
- // // force the widget size to 6
53
- // $(this.resize_wgd.el).attr('data-sizex', cws);
54
- // this.resize_wgd.size_x = cws;
55
- // // now the widget preview
56
- // var preview = $(this.resize_wgd.el).find('.preview-holder');
57
- // preview.attr('data-sizex', cws);
58
- // this.$resize_preview_holder.attr('data-sizex', cws);
59
- // $(document).trigger('pix_builder:serialize');
60
- // }
61
- // },
62
- // draggable: {
63
- // handle: '.drag_handler'
64
- // },
65
- // serialize_params: function ($w, wgd) {
66
- // var type = $w.data("type"),
67
- // content = $w.find(".block_content").text();
68
- // if (type == "text") {
69
- // content = $w.find(".block_content textarea").val();
70
- // } else if (type == "image") {
71
- // content = $w.find(".open_media").attr("data-attachment_id");
72
- // } else if (type == "editor") {
73
- // content = $w.find(".to_send").text();
74
- // }
75
- // return {
76
- // id: $w.prop("id").replace("block_", ""),
77
- // type: type,
78
- // content: content,
79
- // col: wgd.col,
80
- // row: wgd.row,
81
- // size_x: wgd.size_x,
82
- // size_y: wgd.size_y
83
- // };
84
- // }
85
- // };
86
 
87
  var widget_width = $('#normal-sortables').width() / 6;
88
- gridster_params.widget_base_dimensions = [ widget_width - 67 , 40];
89
 
90
  gridster = gridster.gridster(gridster_params).data('gridster');
91
 
92
- //Build the gridster if the builder has value
93
- //var serialized_value = $pix_builder.val();
94
- //if (serialized_value !== 'undefined' && serialized_value.length !== 0) {
95
- // var parsed = JSON.parse(serialized_value);
96
- //
97
- // // sort serialization
98
- // parsed = Gridster.sort_by_row_and_col_asc(parsed);
99
- //
100
- // $.each(parsed, function (i, e) {
101
- // var template_args = {
102
- // id: this.id,
103
- // type: this.type,
104
- // content: this.content
105
- // };
106
- // //debugger;
107
- // var block_template = get_block_template(template_args);
108
- // gridster.add_widget(block_template, this.size_x, this.size_y, this.col, this.row);
109
- // });
110
- //}
111
-
112
- // get the curent number of blocks
113
- var number_of_blocks = 0;
114
-
115
- if ( $(gridster)[0].$widgets.length > 0 ) {
116
- number_of_blocks = $(gridster)[0].$widgets.length;
117
- }
118
 
119
  // Functions
120
  /**
@@ -122,24 +51,70 @@
122
  * or start one if not
123
  */
124
  var intent_to_serialize = function() {
 
 
125
  if ( ! serialize_intention ) {
126
- serialize_timeout = setTimeout( serialize_pix_builder_values, 2000);
127
  serialize_intention = true;
128
  } else {
129
  // kill the timout and start a new one
130
  clearTimeout(serialize_timeout);
131
- serialize_timeout = setTimeout( serialize_pix_builder_values, 2000);
132
  }
133
  };
134
 
 
 
 
 
 
 
135
  var serialize_pix_builder_values = function(){
136
 
137
  var new_values = gridster.serialize();
 
138
  // sort_them
139
  new_values = Gridster.sort_by_row_and_col_asc(new_values);
140
 
141
- var parsed_string = JSON.stringify(new_values);
142
- $pix_builder.val(parsed_string);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  serialize_intention = false;
144
  };
145
 
@@ -158,11 +133,33 @@
158
  $('#pix_builder_editor').text( content );
159
 
160
  } else { // visual editor
161
- this_editor.setContent( content.replace(/\n/ig,"<br>") , {format:'text'});
162
  this_editor.save( { no_events: true } );
163
  }
164
  };
165
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  /**
167
  * Events
168
  */
@@ -176,14 +173,16 @@
176
  $(document).on('click', '.add_block', function (ev) {
177
  ev.preventDefault();
178
 
 
 
179
  var type = $(this).val(),
180
  args = {
181
- id: parseInt(number_of_blocks) + 1,
182
  type: type,
183
  content: ''
184
  };
185
  var block_template = get_block_template(args);
186
- number_of_blocks = parseInt(number_of_blocks) + 1;
187
  gridster.add_widget(block_template, 2, 2);
188
  //after we done update the json
189
  $(document).trigger('pix_builder:serialize');
@@ -203,19 +202,22 @@
203
  var id = $(this).closest('.item').attr('id').replace('block_', '');
204
 
205
  if ( ! modal_container.hasClass('modal_opened') ) {
206
- modal_container.addClass('modal_opened')
207
- .show();
208
 
209
- var content = $('#block_'+ id + ' .to_send').val();
 
210
 
211
- if ( content !== "" ) {
212
- set_pix_builder_editor_content( content );
213
- } else {
214
- set_pix_builder_editor_content( '' );
215
- }
216
 
217
- // ensure the editor is on visual
218
- switchEditors.go( 'pix_builder_editor', 'tmce' );
 
 
 
 
 
 
 
219
 
220
  modal_container.find('.insert_editor_content').data('block_id', id );
221
  }
@@ -250,10 +252,6 @@
250
  close_editor_modal();
251
  });
252
 
253
- $(document).on('click', '#publishing-action', function(){
254
- serialize_pix_builder_values();
255
- });
256
-
257
  // serialize pix_builder values
258
  $(document).on('pix_builder:serialize', intent_to_serialize );
259
 
@@ -316,6 +314,34 @@
316
  '<div class="item__controls">' +
317
  '<ul class="nav nav--controls">' +
318
  '<li class="edit">'+controls_content+'</li>' +
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  '<li class="remove remove_block"><span>Remove</span></li>' +
320
  '<li class="move drag_handler"></li>' +
321
  '</ul>' +
@@ -419,6 +445,77 @@
419
 
420
  $(".pixbuilder-controls").fixer({gap: 40});
421
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
422
  }); /* Window.load */
423
 
424
  })(jQuery);
@@ -486,4 +583,4 @@
486
  });
487
  };
488
 
489
- }(jQuery, this));
9
 
10
  $(document).ready(function () {
11
 
12
+ var $pix_builder = $('#content'),
13
  gridster = $(".gridster > ul"),
14
  modal_container = $('.pix_builder_editor_modal_container');
15
 
29
  gridster_params.on_resize_callback[1],
30
  gridster_params.on_resize_callback[2],
31
 
32
+ gridster_params.on_resize_callback[3]
33
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  var widget_width = $('#normal-sortables').width() / 6;
36
+ gridster_params.widget_base_dimensions = [ widget_width - 35 , 40];
37
 
38
  gridster = gridster.gridster(gridster_params).data('gridster');
39
 
40
+ $(window).on('resize', function() {
41
+ var widget_width = $('#normal-sortables').width() / 6,
42
+ options = {
43
+ widget_base_dimensions: [ widget_width - 35, 40 ]
44
+ }
45
+ gridster.resize_widget_dimensions(options);
46
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
  // Functions
49
  /**
51
  * or start one if not
52
  */
53
  var intent_to_serialize = function() {
54
+ // prevent the user from saving
55
+ $('#publish').attr('disabled', 'disabled');
56
  if ( ! serialize_intention ) {
57
+ serialize_timeout = setTimeout( serialize_pix_builder_values, 1000);
58
  serialize_intention = true;
59
  } else {
60
  // kill the timout and start a new one
61
  clearTimeout(serialize_timeout);
62
+ serialize_timeout = setTimeout( serialize_pix_builder_values, 1000);
63
  }
64
  };
65
 
66
+ var b64EncodeUnicode = function(str) {
67
+ return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
68
+ return String.fromCharCode('0x' + p1);
69
+ }));
70
+ };
71
+
72
  var serialize_pix_builder_values = function(){
73
 
74
  var new_values = gridster.serialize();
75
+
76
  // sort_them
77
  new_values = Gridster.sort_by_row_and_col_asc(new_values);
78
 
79
+ var public_content = '',
80
+ output = [],
81
+ attachment = null;
82
+
83
+ $.each( new_values, function ( i, j) {
84
+ if ( j.hasOwnProperty('content') ) {
85
+ if ( j.type === 'editor') {
86
+ public_content = public_content + j.content + "\n";
87
+ }
88
+ }
89
+ });
90
+
91
+ // we will save 2 versions of the content
92
+ // 1 for public: public_content
93
+ // 2 for internal use: internal_content
94
+ // var public_content = prepare_values_for_content( new_values );
95
+ // $.each( new_values, function ( i, j) {
96
+ // if ( j.hasOwnProperty('content') ) {
97
+ // if ( j.type === 'editor') {
98
+ // new_values[i].content = b64EncodeUnicode( j.content );
99
+ // }
100
+ // }
101
+ // });
102
+
103
+ var internal_content = JSON.stringify(new_values),
104
+ content_editor = tinyMCE.get('content');
105
+
106
+ if( typeof content_editor === "undefined" || content_editor === null ) { // text editor
107
+ $('#content').val( public_content );
108
+ $('#content').text( public_content );
109
+ } else { // visual editor
110
+ content_editor.setContent( public_content , {format:'text'});
111
+ }
112
+
113
+ $('#pix_builder').val(internal_content);
114
+
115
+ // now it can be saved
116
+ $('#publish').removeAttr('disabled');
117
+
118
  serialize_intention = false;
119
  };
120
 
133
  $('#pix_builder_editor').text( content );
134
 
135
  } else { // visual editor
136
+ this_editor.setContent( content, {format:'text'});
137
  this_editor.save( { no_events: true } );
138
  }
139
  };
140
 
141
+ function create_block_id() {
142
+
143
+ // get the curent number of blocks
144
+ var blocks = $('.pixbuilder-grid > ul > li'),
145
+ number_of_blocks = 1;
146
+
147
+ if ( $('.pixbuilder-grid > ul > li').length < 1 ) {
148
+ return number_of_blocks;
149
+ }
150
+
151
+ $('.pixbuilder-grid > ul > li').each( function (i, j) {
152
+ var id_nr = $( this ).attr('id').replace('block_', '');
153
+
154
+ if ( parseInt(id_nr) > number_of_blocks ) {
155
+ number_of_blocks = parseInt(id_nr) + 1;
156
+ } else {
157
+ number_of_blocks = number_of_blocks + 1;
158
+ }
159
+ });
160
+
161
+ return parseInt(number_of_blocks);
162
+ }
163
  /**
164
  * Events
165
  */
173
  $(document).on('click', '.add_block', function (ev) {
174
  ev.preventDefault();
175
 
176
+ var number_of_blocks = create_block_id();
177
+
178
  var type = $(this).val(),
179
  args = {
180
+ id: number_of_blocks,
181
  type: type,
182
  content: ''
183
  };
184
  var block_template = get_block_template(args);
185
+
186
  gridster.add_widget(block_template, 2, 2);
187
  //after we done update the json
188
  $(document).trigger('pix_builder:serialize');
202
  var id = $(this).closest('.item').attr('id').replace('block_', '');
203
 
204
  if ( ! modal_container.hasClass('modal_opened') ) {
205
+ setTimeout(function () {
 
206
 
207
+ modal_container.addClass('modal_opened')
208
+ .show();
209
 
210
+ var content = $('#block_'+ id + ' .to_send').val();
 
 
 
 
211
 
212
+ if ( content !== "" ) {
213
+ set_pix_builder_editor_content( content );
214
+ } else {
215
+ set_pix_builder_editor_content( '' );
216
+ }
217
+
218
+ // ensure the editor is on visual
219
+ switchEditors.go( 'pix_builder_editor', 'tmce' );
220
+ }, 600);
221
 
222
  modal_container.find('.insert_editor_content').data('block_id', id );
223
  }
252
  close_editor_modal();
253
  });
254
 
 
 
 
 
255
  // serialize pix_builder values
256
  $(document).on('pix_builder:serialize', intent_to_serialize );
257
 
314
  '<div class="item__controls">' +
315
  '<ul class="nav nav--controls">' +
316
  '<li class="edit">'+controls_content+'</li>' +
317
+ '<li class="position"><span>Position</span>' +
318
+ '<div class="position__ui">' +
319
+ '<div class="position__ui-title">Alignment</div>' +
320
+ '<div class="position__ui-body">' +
321
+ '<div class="position__ui-row">' +
322
+ '<div class="position__ui-cell top">' +
323
+ '<div class="position__ui-handle">top</div>' +
324
+ '</div>' +
325
+ '</div>' +
326
+ '<div class="position__ui-row">' +
327
+ '<div class="position__ui-cell left' + ((args.type === 'editor') ? ' active' : '') + '">' +
328
+ '<div class="position__ui-handle"' + ((args.type === 'editor') ? ' data-step="1"' : '') + '>left</div>' +
329
+ '</div>' +
330
+ '<div class="position__ui-cell middle' + ((args.type !== 'editor') ? ' active' : '') + '">' +
331
+ '<div class="position__ui-handle">middle</div>' +
332
+ '</div>' +
333
+ '<div class="position__ui-cell right">' +
334
+ '<div class="position__ui-handle">right</div>' +
335
+ '</div>' +
336
+ '</div>' +
337
+ '<div class="position__ui-row">' +
338
+ '<div class="position__ui-cell bottom">' +
339
+ '<div class="position__ui-handle">bottom</div>' +
340
+ '</div>' +
341
+ '</div>' +
342
+ '</div>' +
343
+ '</div>' +
344
+ '</li>' +
345
  '<li class="remove remove_block"><span>Remove</span></li>' +
346
  '<li class="move drag_handler"></li>' +
347
  '</ul>' +
445
 
446
  $(".pixbuilder-controls").fixer({gap: 40});
447
 
448
+ $(document).on('mouseover', '.position', function() {
449
+ $('.pixbuilder-grid').addClass('is--over-controls');
450
+ });
451
+
452
+ $(document).on('mouseout', '.position', function() {
453
+ $('.pixbuilder-grid').removeClass('is--over-controls');
454
+ });
455
+
456
+ // margins?
457
+ var $grid = $('.pixbuilder-grid');
458
+
459
+ $grid.on('click', '.position__ui-cell', function(e) {
460
+ var $cell = $(this),
461
+ $container = $cell.closest('.position__ui'),
462
+ $item = $cell.find('.position__ui-handle'),
463
+ step = $item.attr('data-step'),
464
+ $active = $container.find('.position__ui-cell.active'),
465
+ $turnOff = $container.find('.position__ui-cell.middle');
466
+
467
+ if ( $cell.is('.middle') ) $turnOff = $active;
468
+ if ( $cell.is('.top') && $active.filter('.bottom').length ) $turnOff = $turnOff.add($active.filter('.bottom'));
469
+ if ( $cell.is('.right') && $active.filter('.left').length ) $turnOff = $turnOff.add($active.filter('.left'));
470
+ if ( $cell.is('.bottom') && $active.filter('.top').length ) $turnOff = $turnOff.add($active.filter('.top'));
471
+ if ( $cell.is('.left') && $active.filter('.right').length ) $turnOff = $turnOff.add($active.filter('.right'));
472
+
473
+ $turnOff.removeClass('active').find('.position__ui-handle').attr('data-step', 0);
474
+ step = typeof step === "undefined" ? 1 : step == 3 ? 0 : parseInt(step) + 1;
475
+
476
+ $item.attr('data-step', step);
477
+ $cell.toggleClass('active', !!step);
478
+
479
+ $active = $container.find('.position__ui-cell.active');
480
+
481
+ if ( ! $active.filter('.active').length ) {
482
+ $container.find('.position__ui-cell.middle').addClass('active');
483
+ }
484
+
485
+ updateCell($cell);
486
+ });
487
+
488
+ $grid.on('mouseenter', '.position', function(e) {
489
+ $grid.css('z-index', '1200');
490
+ });
491
+
492
+ $grid.on('mouseleave', '.position', function(e) {
493
+ setTimeout(function() {
494
+ $grid.css('z-index', '');
495
+ }, 200);
496
+ });
497
+
498
+ $('.position__ui-cell').each(function() { updateCell($(this)); });
499
+
500
+ function updateCell($cell) {
501
+ var $container = $cell.closest('.position__ui'),
502
+ $active = $container.find('.position__ui-cell.active'),
503
+ $item = $cell.find('.position__ui-handle'),
504
+ step = $item.attr('data-step'),
505
+ $content = $item.closest('.item').find('.item__content'),
506
+ props = ['top', 'right', 'bottom', 'left'];
507
+
508
+ for (var i = 0; i < props.length; i++)
509
+ for (var j = 0; j < 4; j++)
510
+ $content.removeClass(props[i] + '-' + j);
511
+
512
+ // update block
513
+ for (var i = 0; i < props.length; i++) {
514
+ var $prop = $active.filter('.'+props[i]);
515
+ if ( $prop.length ) $content.addClass(props[i] + '-' + $prop.find('.position__ui-handle').attr('data-step'));
516
+ }
517
+ }
518
+
519
  }); /* Window.load */
520
 
521
  })(jQuery);
583
  });
584
  };
585
 
586
+ }(jQuery, this));
features/metaboxes/scss/pix_builder.scss CHANGED
@@ -42,7 +42,7 @@ $accent : #0095ea;
42
  position: relative;
43
 
44
  &.item {
45
- overflow: hidden;
46
  display: list-item;
47
 
48
  // Partial Fix
@@ -75,6 +75,10 @@ $accent : #0095ea;
75
  @include box-sizing(border-box);
76
  }
77
  }
 
 
 
 
78
  }
79
 
80
 
@@ -87,6 +91,9 @@ $accent : #0095ea;
87
 
88
  .pixbuilder-grid {
89
  margin-top: -10px;
 
 
 
90
 
91
  // Block Actions
92
  .item__controls {
@@ -104,13 +111,14 @@ $accent : #0095ea;
104
 
105
  li {
106
  display: inline-block;
107
- padding: 12px 18px;
108
-
 
109
  background: none;
110
  color: white;
111
 
112
  &:hover {
113
- color: $accent;
114
  }
115
 
116
 
@@ -122,26 +130,35 @@ $accent : #0095ea;
122
 
123
  a {
124
  padding: 12px 18px;
125
- color: white;
126
 
127
  cursor: pointer;
128
 
129
  span { display: none; }
130
  &:before { content: "\f040" }
131
 
132
- &:hover { color: $accent; }
133
  }
134
  }
135
 
136
  // REMOVE
137
  &.remove {
138
-
139
  cursor: pointer;
140
-
141
  span { display: none; }
142
  &:before { content: "\f014" }
143
  }
144
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  // MOVE
146
  &.move {
147
  overflow:hidden;
@@ -184,11 +201,26 @@ $accent : #0095ea;
184
  left: 50%;
185
  @include translate(-50%, -50%);
186
 
187
- width: 175px;
188
 
189
  background: $dark;
190
  @include border-radius(6px);
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  }
193
  /*ul.nav*/.nav--controls {
194
 
@@ -199,6 +231,31 @@ $accent : #0095ea;
199
  height: 100%;
200
  padding: 12px;
201
  @include box-sizing(border-box);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
  }
203
  }
204
 
@@ -217,10 +274,6 @@ $accent : #0095ea;
217
  .block-type--image {
218
  text-align: center;
219
 
220
- img {
221
- @extend %centered;
222
- }
223
-
224
  .block_content.empty {
225
 
226
  &:before {
@@ -237,16 +290,13 @@ $accent : #0095ea;
237
  */
238
  .block-type--editor {
239
  @extend .block-type--image;
240
- text-align: left;
241
 
242
  .editor_preview {
243
  width: 100%;
244
- padding: 12px;
245
 
246
- -webkit-box-sizing: border-box;
247
- -moz-box-sizing: border-box;
248
- box-sizing: border-box;
249
- @extend %centered;
250
  }
251
 
252
  .block_content.empty {
@@ -264,7 +314,7 @@ $accent : #0095ea;
264
  GENERAL
265
  \*----------------------------------------*/
266
 
267
- img {
268
  max-width: 100%;
269
  max-height: 100%;
270
  }
@@ -305,8 +355,8 @@ img {
305
 
306
  // Add Blocks Controls
307
  .pixbuilder-controls {
308
- padding: 25px 30px 0 30px;
309
- z-index: 100;
310
  }
311
 
312
 
@@ -317,24 +367,21 @@ img {
317
  position: relative;
318
 
319
  .modal_wrapper {
 
 
320
  .media-modal {
321
  height: 80%;
322
- max-height: 650px;
323
  max-width: 800px;
324
  left: 50%;
325
  top: 50%;
326
  @include translate(-50%, -50%);
327
- z-index: 10000;
328
  }
329
 
330
  .media-modal-content {
331
  // min-height: 600px;
332
  }
333
 
334
- .media-modal-backdrop {
335
- z-index: 88;
336
- }
337
-
338
  .media-frame-content, .media-frame-title, .media-frame-router, .media-frame-toolbar {
339
  right: 30px;
340
  left: 30px;
@@ -367,7 +414,7 @@ img {
367
  }
368
 
369
  .pix_builder_container {
370
- padding-top: 50px ;
371
 
372
  .clear-all {
373
  float: right;
@@ -397,3 +444,177 @@ img {
397
  // left: ($col - 1) * $col-w;
398
  // }
399
  //}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  position: relative;
43
 
44
  &.item {
45
+ // overflow: hidden;
46
  display: list-item;
47
 
48
  // Partial Fix
75
  @include box-sizing(border-box);
76
  }
77
  }
78
+
79
+ &.is--over-controls {
80
+ z-index: 1300;
81
+ }
82
  }
83
 
84
 
91
 
92
  .pixbuilder-grid {
93
  margin-top: -10px;
94
+ margin-left: 15px;
95
+ margin-bottom: -15px;
96
+ z-index: 1000;
97
 
98
  // Block Actions
99
  .item__controls {
111
 
112
  li {
113
  display: inline-block;
114
+ padding: 12px;
115
+ padding-bottom: 11px;
116
+ margin: 0;
117
  background: none;
118
  color: white;
119
 
120
  &:hover {
121
+ background-color: #7CC6EB;
122
  }
123
 
124
 
130
 
131
  a {
132
  padding: 12px 18px;
 
133
 
134
  cursor: pointer;
135
 
136
  span { display: none; }
137
  &:before { content: "\f040" }
138
 
139
+ &, &:hover, &:active { color: white; }
140
  }
141
  }
142
 
143
  // REMOVE
144
  &.remove {
 
145
  cursor: pointer;
 
146
  span { display: none; }
147
  &:before { content: "\f014" }
148
  }
149
 
150
+ &.position {
151
+ cursor: pointer;
152
+ span { display: none; }
153
+ &:before {
154
+ content: "";
155
+ display: inline-block;
156
+ width: 20px;
157
+ height: 20px;
158
+ background: url(../images/icon-position.svg) center center no-repeat;
159
+ }
160
+ }
161
+
162
  // MOVE
163
  &.move {
164
  overflow:hidden;
201
  left: 50%;
202
  @include translate(-50%, -50%);
203
 
204
+ display: flex;
205
 
206
  background: $dark;
207
  @include border-radius(6px);
208
 
209
+ > li {
210
+ width: 47px;
211
+ box-sizing: border-box;
212
+ }
213
+
214
+ > li:first-child {
215
+ border-top-left-radius: 6px;
216
+ border-bottom-left-radius: 6px;
217
+ }
218
+
219
+ > li:last-child {
220
+ border-top-right-radius: 6px;
221
+ border-bottom-right-radius: 6px;
222
+ }
223
+
224
  }
225
  /*ul.nav*/.nav--controls {
226
 
231
  height: 100%;
232
  padding: 12px;
233
  @include box-sizing(border-box);
234
+ position: relative;
235
+ overflow: hidden;
236
+ display: flex;
237
+ justify-content: center;
238
+
239
+ &.top-1, &.top-2, &.top-3 { align-items: flex-start; }
240
+ &.right-1, &.right-2, &.right-3 { justify-content: flex-end; }
241
+ &.bottom-1, &.bottom-2, &.bottom-3 { align-items: flex-end; }
242
+ &.left-1, &.left-2, &.left-3 { justify-content: flex-start; }
243
+
244
+ &.top-1 { top: -12px; }
245
+ &.top-2 { top: -24px; }
246
+ &.top-3 { top: -36px; }
247
+
248
+ &.right-1 { right: -12px; }
249
+ &.right-2 { right: -24px; }
250
+ &.right-3 { right: -36px; }
251
+
252
+ &.bottom-1 { bottom: -12px; }
253
+ &.bottom-2 { bottom: -24px; }
254
+ &.bottom-3 { bottom: -36px; }
255
+
256
+ &.left-1 { left: -12px; }
257
+ &.left-2 { left: -24px; }
258
+ &.left-3 { left: -36px; }
259
  }
260
  }
261
 
274
  .block-type--image {
275
  text-align: center;
276
 
 
 
 
 
277
  .block_content.empty {
278
 
279
  &:before {
290
  */
291
  .block-type--editor {
292
  @extend .block-type--image;
 
293
 
294
  .editor_preview {
295
  width: 100%;
296
+ }
297
 
298
+ .block_content:not(empty) {
299
+ text-align: left;
 
 
300
  }
301
 
302
  .block_content.empty {
314
  GENERAL
315
  \*----------------------------------------*/
316
 
317
+ .pix_builder_container img {
318
  max-width: 100%;
319
  max-height: 100%;
320
  }
355
 
356
  // Add Blocks Controls
357
  .pixbuilder-controls {
358
+ padding: 0 30px;
359
+ z-index: 1100;
360
  }
361
 
362
 
367
  position: relative;
368
 
369
  .modal_wrapper {
370
+ position: relative;
371
+ z-index: 11000;
372
  .media-modal {
373
  height: 80%;
374
+ max-height: 750px;
375
  max-width: 800px;
376
  left: 50%;
377
  top: 50%;
378
  @include translate(-50%, -50%);
 
379
  }
380
 
381
  .media-modal-content {
382
  // min-height: 600px;
383
  }
384
 
 
 
 
 
385
  .media-frame-content, .media-frame-title, .media-frame-router, .media-frame-toolbar {
386
  right: 30px;
387
  left: 30px;
414
  }
415
 
416
  .pix_builder_container {
417
+ padding-top: 55px;
418
 
419
  .clear-all {
420
  float: right;
444
  // left: ($col - 1) * $col-w;
445
  // }
446
  //}
447
+
448
+ .position {
449
+ position: relative;
450
+ }
451
+
452
+ .position__ui {
453
+ border-radius: 5px;
454
+ background: #000;
455
+ position: absolute;
456
+ bottom: 100%;
457
+ left: 50%;
458
+ margin-left: -94px;
459
+ margin-bottom: 4px;
460
+
461
+ opacity: 0;
462
+ pointer-events: none;
463
+ transform: translateY(10px);
464
+ transition: all .2s ease-out;
465
+
466
+ .position:hover > & {
467
+ opacity: 1;
468
+ pointer-events: auto;
469
+ transform: none;
470
+ }
471
+
472
+ &:after {
473
+ content: "";
474
+ display: block;
475
+ position: absolute;
476
+ top: 100%;
477
+ left: 50%;
478
+ margin-left: -8px;
479
+ border: 8px solid transparent;
480
+ border-top-color: #000;
481
+ border-bottom: 0;
482
+ }
483
+ }
484
+
485
+ .position__ui-title {
486
+ background: #444;
487
+ font-family: Arial, sans-serif;
488
+ font-size: 10px;
489
+ text-transform: uppercase;
490
+ border-top-right-radius: 5px;
491
+ border-top-left-radius: 5px;
492
+ color: white;
493
+ padding: 8px 8px 7px;
494
+ }
495
+
496
+ .position__ui-body {
497
+ display: flex;
498
+ flex-direction: column;
499
+ padding: 7px;
500
+ }
501
+
502
+ .position__ui-row {
503
+ display: flex;
504
+ justify-content: center;
505
+ }
506
+
507
+ .position__ui-cell {
508
+ position: relative;
509
+ z-index: 10;
510
+
511
+ &:hover:before {
512
+ content: "";
513
+ position: absolute;
514
+ top: 0;
515
+ right: 0;
516
+ bottom: 0;
517
+ left: 0;
518
+ border: 1px dashed #777777;
519
+ border-radius: 4px;
520
+ }
521
+
522
+ .position__ui-handle:after {
523
+ content: "";
524
+ border: 0 solid transparent;
525
+ }
526
+
527
+ &.top .position__ui-handle {
528
+ flex-direction: column-reverse;
529
+ bottom: 0;
530
+
531
+ &[data-step="1"] { bottom: 10px; }
532
+ &[data-step="2"] { bottom: 20px; }
533
+ &[data-step="3"] { bottom: 30px; }
534
+
535
+ &:after {
536
+ border-width: 0 6px;
537
+ border-bottom: 6px solid white;
538
+ margin-bottom: 4px;
539
+ }
540
+ }
541
+
542
+ &.right .position__ui-handle {
543
+ left: 0;
544
+
545
+ &[data-step="1"] { left: 10px; }
546
+ &[data-step="2"] { left: 20px; }
547
+ &[data-step="3"] { left: 30px; }
548
+
549
+ &:after {
550
+ border-width: 6px 0;
551
+ border-left: 6px solid white;
552
+ margin-left: 4px;
553
+ }
554
+ }
555
+
556
+ &.bottom .position__ui-handle {
557
+ flex-direction: column;
558
+ top: 0;
559
+
560
+ &[data-step="1"] { top: 10px; }
561
+ &[data-step="2"] { top: 20px; }
562
+ &[data-step="3"] { top: 30px; }
563
+
564
+ &:after {
565
+ border-width: 0 6px;
566
+ border-top: 6px solid white;
567
+ margin-top: 4px;
568
+ }
569
+ }
570
+
571
+ &.left .position__ui-handle {
572
+ flex-direction: row-reverse;
573
+ right: 0;
574
+
575
+ &[data-step="1"] { right: 10px; }
576
+ &[data-step="2"] { right: 20px; }
577
+ &[data-step="3"] { right: 30px; }
578
+
579
+ &:after {
580
+ border-width: 6px 0;
581
+ border-right: 6px solid white;
582
+ margin-right: 4px;
583
+ }
584
+ }
585
+
586
+ &.top:before { top: -30px; }
587
+ &.right:before { right: -30px; }
588
+ &.bottom:before { bottom: -30px; }
589
+ &.left:before { left: -30px; }
590
+
591
+ &.middle:before,
592
+ &.middle .position__ui-handle:after {
593
+ display: none;
594
+ }
595
+
596
+ &:hover .position__ui-handle {
597
+ background: #888888;
598
+ }
599
+
600
+ &.active .position__ui-handle {
601
+ background: #7CC6EB;
602
+ }
603
+ }
604
+
605
+ .position__ui-handle {
606
+ font-family: Arial, sans-serif;
607
+ font-size: 10px;
608
+ display: flex;
609
+ width: 50px;
610
+ height: 50px;
611
+ margin: 3px;
612
+ background: #303030;
613
+ align-items: center;
614
+ justify-content: center;
615
+ color: white;
616
+ text-transform: uppercase;
617
+ border-radius: 4px;
618
+ transition: all .2s ease-out;
619
+ position: relative;
620
+ }
features/metaboxes/scss/style.scss CHANGED
@@ -7,6 +7,16 @@ table.cmb_metabox td, table.cmb_metabox th {
7
  // border-bottom: 1px solid #E9E9E9;
8
  }
9
 
 
 
 
 
 
 
 
 
 
 
10
  table.cmb_metabox th {
11
  text-align: right;
12
  font-weight: bold;
@@ -17,17 +27,6 @@ table.cmb_metabox th label {
17
  display: block;
18
  }
19
 
20
- p.cmb_metabox_description {
21
- color: #AAA;
22
- font-style: italic;
23
- margin: 2px 0 !important;
24
- }
25
-
26
- span.cmb_metabox_description {
27
- color: #AAA;
28
- font-style: italic;
29
- }
30
-
31
  table.cmb_metabox input, table.cmb_metabox textarea {
32
  font-size: 12px;
33
  padding: 5px;
@@ -40,6 +39,7 @@ table.cmb_metabox input[type=text], table.cmb_metabox textarea {
40
  table.cmb_metabox textarea.cmb_textarea_code {
41
  font-family: Consolas, Monaco, monospace;
42
  line-height: 16px;
 
43
  }
44
 
45
  table.cmb_metabox input.cmb_text_small {
@@ -89,7 +89,11 @@ table.cmb_metabox input:focus, table.cmb_metabox textarea:focus {
89
  .cmb_metabox_title {
90
  margin: 0 0 5px 0;
91
  padding: 5px 0 0 0;
92
- font: italic 24px/35px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
 
 
 
 
93
  }
94
 
95
  .cmb_radio_inline {
@@ -1614,10 +1618,14 @@ $accent: #07d3f8;
1614
  // Videos
1615
  #pixvideos {
1616
 
 
 
 
 
1617
  // List Layout
1618
  & > ul {
1619
  list-style: none;
1620
- min-height: 55px;
1621
 
1622
  li {
1623
  width: 100%;
@@ -1700,11 +1708,6 @@ $accent: #07d3f8;
1700
  GENERAL
1701
  \*----------------------------------------*/
1702
 
1703
- img {
1704
- max-width: 100%;
1705
- max-height: 100%;
1706
- }
1707
-
1708
  .icon {
1709
  display: inline-block;
1710
  font-size: 20px;
@@ -1720,25 +1723,40 @@ img {
1720
  -moz-osx-font-smoothing: grayscale;
1721
  }
1722
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1723
  .gmap_pins_container {
1724
  position: relative;
1725
- padding-bottom: 30px;
1726
 
1727
  .gmap_pin {
 
 
1728
  & > * {
1729
  display: inline-block;
1730
  }
1731
 
1732
  .pin_location_url {
1733
- width: 68%;
1734
  }
1735
 
1736
  .pin_name {
1737
- width: 29%;
1738
  }
1739
 
1740
  .pin_delete {
1741
- width: 2%;
1742
  opacity: 0;
1743
  color: #AA0000;
1744
  }
@@ -1782,7 +1800,76 @@ img {
1782
  }
1783
  }
1784
 
1785
- //*------------------------------------*\
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1786
  // $HELPERS
1787
  //*------------------------------------*/
1788
 
@@ -1822,4 +1909,599 @@ img {
1822
  -webkit-align-items: center;
1823
  -ms-flex-align: center;
1824
  align-items: center;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1825
  }
7
  // border-bottom: 1px solid #E9E9E9;
8
  }
9
 
10
+ .form-table.cmb_metabox {
11
+ &:first-of-type {
12
+ margin-top: 0;
13
+ }
14
+
15
+ &:last-of-type {
16
+ margin-bottom: 0;
17
+ }
18
+ }
19
+
20
  table.cmb_metabox th {
21
  text-align: right;
22
  font-weight: bold;
27
  display: block;
28
  }
29
 
 
 
 
 
 
 
 
 
 
 
 
30
  table.cmb_metabox input, table.cmb_metabox textarea {
31
  font-size: 12px;
32
  padding: 5px;
39
  table.cmb_metabox textarea.cmb_textarea_code {
40
  font-family: Consolas, Monaco, monospace;
41
  line-height: 16px;
42
+ width: 100%;
43
  }
44
 
45
  table.cmb_metabox input.cmb_text_small {
89
  .cmb_metabox_title {
90
  margin: 0 0 5px 0;
91
  padding: 5px 0 0 0;
92
+ // font: italic 24px/35px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
93
+
94
+ font-size: 23px;
95
+ line-height: 1.25;
96
+ color: #232323;
97
  }
98
 
99
  .cmb_radio_inline {
1618
  // Videos
1619
  #pixvideos {
1620
 
1621
+ &.has-items {
1622
+ min-height: 0;
1623
+ }
1624
+
1625
  // List Layout
1626
  & > ul {
1627
  list-style: none;
1628
+ min-height: 3vw;
1629
 
1630
  li {
1631
  width: 100%;
1708
  GENERAL
1709
  \*----------------------------------------*/
1710
 
 
 
 
 
 
1711
  .icon {
1712
  display: inline-block;
1713
  font-size: 20px;
1723
  -moz-osx-font-smoothing: grayscale;
1724
  }
1725
 
1726
+ // Gmap Pins
1727
+ // MIES (maybe ROSA?)
1728
+ .cmb-type-gmap_pins {
1729
+ .gmap_pins_container {
1730
+ flex-basis: 100%;
1731
+ }
1732
+
1733
+ // Hide default field description
1734
+ .cmb_metabox_description {
1735
+ display: none;
1736
+ }
1737
+ }
1738
+
1739
  .gmap_pins_container {
1740
  position: relative;
1741
+ // padding-bottom: 30px;
1742
 
1743
  .gmap_pin {
1744
+ display: flex;
1745
+ justify-content: space-between;
1746
  & > * {
1747
  display: inline-block;
1748
  }
1749
 
1750
  .pin_location_url {
1751
+ flex-basis: 68%;
1752
  }
1753
 
1754
  .pin_name {
1755
+ flex-basis: 29%;
1756
  }
1757
 
1758
  .pin_delete {
1759
+ flex-basis: 2%;
1760
  opacity: 0;
1761
  color: #AA0000;
1762
  }
1800
  }
1801
  }
1802
 
1803
+
1804
+ .cmb-type-positions_map .positions_map {
1805
+ display: flex;
1806
+ flex-wrap: wrap;
1807
+ width: 162px;
1808
+ }
1809
+
1810
+ .cmb-type-positions_map .positions_map li {
1811
+ width: 44px;
1812
+ margin: 5px;
1813
+ }
1814
+
1815
+ .positions_map label {
1816
+ display: block;
1817
+ padding-top: 100%;
1818
+ border: 1px solid #DDD;
1819
+ border-radius: 4px;
1820
+ position: relative;
1821
+
1822
+ &:after {
1823
+ content: "";
1824
+ display: block;
1825
+ position: absolute;
1826
+ top: 0;
1827
+ left: 0;
1828
+ width: 100%;
1829
+ height: 100%;
1830
+ background: url('../images/icon-arrow.svg') center no-repeat;
1831
+ }
1832
+
1833
+ span {
1834
+ display: none;
1835
+ }
1836
+ }
1837
+
1838
+ .positions_map li {
1839
+ &:nth-child(1) label:after { transform: rotate(45deg); }
1840
+ &:nth-child(2) label:after { transform: rotate(90deg); }
1841
+ &:nth-child(3) label:after { transform: rotate(135deg); }
1842
+ &:nth-child(5) label:after {
1843
+ width: 10px;
1844
+ height: 10px;
1845
+ top: 50%;
1846
+ left: 50%;
1847
+ margin-left: -5px;
1848
+ margin-top: -5px;
1849
+ border-radius: 50%;
1850
+ background: black;
1851
+ }
1852
+ &:nth-child(6) label:after { transform: rotate(180deg); }
1853
+ &:nth-child(7) label:after { transform: rotate(315deg); }
1854
+ &:nth-child(8) label:after { transform: rotate(270deg); }
1855
+ &:nth-child(9) label:after { transform: rotate(225deg); }
1856
+ }
1857
+
1858
+ .positions_map input {
1859
+ display: none;
1860
+ }
1861
+
1862
+ .positions_map input:checked + label {
1863
+ background: #EAF9FE;
1864
+ border-color: #73C5EE;
1865
+ }
1866
+
1867
+ .cmb-type-positions_map .positions_map input:before {
1868
+ content: '';
1869
+ display: none;
1870
+ }
1871
+
1872
+ //*------------------------------------*\
1873
  // $HELPERS
1874
  //*------------------------------------*/
1875
 
1909
  -webkit-align-items: center;
1910
  -ms-flex-align: center;
1911
  align-items: center;
1912
+ }
1913
+
1914
+
1915
+ .cmb-type {
1916
+ position: relative;
1917
+ padding: 29px 0 41px;
1918
+ margin: 0;
1919
+
1920
+ &:first-of-type {
1921
+ padding-top: 0;
1922
+ }
1923
+
1924
+ &:last-of-type {
1925
+ padding-bottom: 0;
1926
+ }
1927
+
1928
+ & + .cmb-type {
1929
+ border-top: 1px solid #EEEEEE;
1930
+ }
1931
+
1932
+ // Main
1933
+ #postbox-container-2 & {
1934
+ display: flex;
1935
+ flex-wrap: wrap;
1936
+ align-items: flex-start;
1937
+ }
1938
+
1939
+ // Sidebar
1940
+ #postbox-container-1 & {
1941
+ padding: 10px 0;
1942
+
1943
+ + .cmb-type {
1944
+ border-top: none;
1945
+ }
1946
+ }
1947
+
1948
+ }
1949
+
1950
+ .cmb-type-wysiwyg,
1951
+ .cmb-type-gallery,
1952
+ .cmb-type-playlist {
1953
+ + .cmb-type {
1954
+ border-top: 0;
1955
+ }
1956
+ }
1957
+ .cmb-type-wysiwyg + .cmb-type {
1958
+ padding-top: 0;
1959
+ }
1960
+
1961
+ .cmb-type-gallery,
1962
+ .cmb-type-playlist {
1963
+ &:first-child {
1964
+ padding-top: 0;
1965
+ }
1966
+ padding-bottom: 0;
1967
+ }
1968
+
1969
+ .cmb-type-pix_builder {
1970
+ flex-direction: column;
1971
+ align-items: stretch;
1972
+ margin: 0 -30px;
1973
+ padding-bottom: 0 !important;
1974
+ }
1975
+
1976
+ .cmb_metabox_description {
1977
+ width: 100%;
1978
+ color: #AAA;
1979
+ font-size: 14px;
1980
+ line-height: 1.5;
1981
+ margin: 0;
1982
+
1983
+ strong {
1984
+ color: #444;
1985
+ }
1986
+
1987
+ p, ul {
1988
+ font: inherit;
1989
+ margin: 0;
1990
+ margin-bottom: 1.5em;
1991
+ }
1992
+
1993
+ > :last-child {
1994
+ margin-bottom: 0
1995
+ }
1996
+
1997
+ li {
1998
+ margin: 0;
1999
+
2000
+ &:before {
2001
+ content: "\2014 ";
2002
+ padding-right: 10px;
2003
+ }
2004
+ }
2005
+ }
2006
+
2007
+ #postbox-container-2 {
2008
+
2009
+ .inside {
2010
+ // padding: 15px 30px;
2011
+ padding: 30px 30px;
2012
+ margin-top: 0;
2013
+ }
2014
+
2015
+ // Title Type Field
2016
+ .cmb-type-title {
2017
+ margin: 0 -30px;
2018
+ padding-top: 20px;
2019
+ padding-bottom: 8px;
2020
+ padding-left: 30px;
2021
+ padding-right: 30px;
2022
+
2023
+ border-top: 2px solid #EEEEEE;
2024
+
2025
+ + .cmb-type {
2026
+ padding-top: 0;
2027
+ padding-bottom: 10px;
2028
+ border-top: 0;
2029
+ }
2030
+
2031
+ h3 {
2032
+ font-size: 23px;
2033
+ font-weight: 500;
2034
+ line-height: 1.8;
2035
+ color: #232323;
2036
+ }
2037
+
2038
+ &:not(.is--disabled) .cmb_metabox_description {
2039
+ flex-basis: 100%;
2040
+ }
2041
+ }
2042
+
2043
+ .cmb_metabox_description {
2044
+ flex-basis: 50%;
2045
+ flex-shrink: 0;
2046
+ padding-right: 2vw;
2047
+
2048
+ &:empty {
2049
+ display: none;
2050
+ }
2051
+ }
2052
+ .cmb-type-wysiwyg,
2053
+ // .cmb-type-textarea_small,
2054
+ // .cmb-type-textarea,
2055
+ // .cmb-type-textarea_medium,
2056
+ // .cmb-type-text,
2057
+ {
2058
+ .cmb_metabox_description {
2059
+ flex-basis: 100%;
2060
+ }
2061
+ }
2062
+
2063
+ // Select 2
2064
+ .select2-container-multi {
2065
+ width: auto;
2066
+ flex-basis: 46%;
2067
+
2068
+ .select2-choices {
2069
+ padding: 5px;
2070
+ line-height: 1.5;
2071
+ border: 1px solid #DDD;
2072
+ border-radius: 4px;
2073
+ box-shadow: none;
2074
+ color: #444444;
2075
+ flex: 1 1 auto;
2076
+ }
2077
+ }
2078
+ }
2079
+
2080
+ .cmb_metabox .cmb_metabox_description h3 {
2081
+ font-size: 16px;
2082
+ font-weight: 600;
2083
+ color: #444;
2084
+ margin: 6px 0;
2085
+ }
2086
+
2087
+ .wp-editor-wrap {
2088
+ width: 100%;
2089
+ }
2090
+ .cmb_metabox {
2091
+ input[type=text],
2092
+ input[type=search],
2093
+ input[type=tel],
2094
+ input[type=time],
2095
+ input[type=url],
2096
+ input[type=week],
2097
+ input[type=password],
2098
+ input[type=date],
2099
+ input[type=datetime],
2100
+ input[type=datetime-local],
2101
+ input[type=email],
2102
+ input[type=month],
2103
+ input[type=number],
2104
+ select,
2105
+ // textarea
2106
+ {
2107
+ @extend %input-fields;
2108
+ }
2109
+
2110
+ }
2111
+
2112
+ .cmb_metabox select,
2113
+ .cmb_text,
2114
+ .cmb_text_small,
2115
+ .cmb_text_medium,
2116
+ .cmb-type-text_range output,
2117
+ %input-fields {
2118
+ -webkit-appearance: none;
2119
+ padding: 10px 14px 10px 16px;
2120
+ line-height: 1.5;
2121
+ height: auto;
2122
+ border: 1px solid #DDD;
2123
+ border-radius: 4px;
2124
+ box-shadow: none;
2125
+ color: #444444;
2126
+
2127
+ flex: 1 1 auto;
2128
+ }
2129
+
2130
+ .cmb_textarea,
2131
+ .cmb_text {
2132
+ flex-basis: 46%;
2133
+ }
2134
+
2135
+
2136
+
2137
+ .cmb_metabox .selector-wrapper {
2138
+ flex-basis: 46%;
2139
+ position: relative;
2140
+ &:before {
2141
+ top: 13px;
2142
+ position: absolute;
2143
+ right: 8px;
2144
+ color: #DDD;
2145
+ }
2146
+ & > select {
2147
+ width: 100%;
2148
+ }
2149
+ }
2150
+
2151
+ // $Multicheck
2152
+ .cmb_metabox .cmb-type-multicheck {
2153
+ margin-left: -24px;
2154
+
2155
+ ul {
2156
+ margin-left: 0 !important;
2157
+ }
2158
+ }
2159
+
2160
+ // $Checkbox
2161
+ .cmb_metabox .cmb-type-checkbox,
2162
+ .cmb_metabox .cmb-type-multicheck {
2163
+
2164
+ display: flex;
2165
+ flex-wrap: nowrap;
2166
+ align-items: flex-start;
2167
+
2168
+ // Checkbox
2169
+ input[type=checkbox],
2170
+ input[type=radio] {
2171
+ order: -1;
2172
+ width: 26px;
2173
+ height: 26px;
2174
+
2175
+ margin-top: 1px;
2176
+ margin-right: 8px;
2177
+ margin-left: 0;
2178
+ margin-bottom: 0;
2179
+
2180
+ background: #FFFFFF;
2181
+ border: 1px solid #DDDDDD;
2182
+ border-radius: 4px;
2183
+ font-size: 14px;
2184
+ line-height: 1.5;
2185
+ color: #76C6EC;
2186
+ outline: 0;
2187
+ box-shadow: none;
2188
+
2189
+ &:checked {
2190
+ background: #76C6EC;
2191
+ border-color: #76C6EC;
2192
+
2193
+ &:before {
2194
+ color: white;
2195
+ margin: 1px 0 0 0px;
2196
+ font-size: 23px;
2197
+ }
2198
+ }
2199
+ }
2200
+
2201
+
2202
+ h3 {
2203
+ margin-top: 0;
2204
+ margin-left: 0px;
2205
+ padding-top: 0;
2206
+ padding-bottom: 0;
2207
+
2208
+ // text-indent: -6px;
2209
+
2210
+ color: #444444;
2211
+
2212
+ + * {
2213
+ font-weight: normal;
2214
+ color: #AAA;
2215
+ }
2216
+ }
2217
+
2218
+ .cmb_metabox_description {
2219
+ font-size: 100%;
2220
+ font-weight: bold;
2221
+ color: #444;
2222
+ }
2223
+
2224
+ // Main
2225
+ #postbox-container-2 & {
2226
+
2227
+ &:first-child {
2228
+ padding-top: 0;
2229
+ }
2230
+
2231
+ h3 {
2232
+ margin-top: -2px;
2233
+
2234
+ + * {
2235
+ margin-left: -34px;
2236
+ }
2237
+ }
2238
+ .cmb_metabox_description {
2239
+ margin-top: 2px;
2240
+ flex-basis: 90%;
2241
+ }
2242
+ }
2243
+
2244
+ // Sidebar
2245
+ #postbox-container-1 & {
2246
+
2247
+ border-top: none;
2248
+
2249
+ h3 {
2250
+ font-size: 14px;
2251
+ margin-top: 1px;
2252
+
2253
+ + * {
2254
+ font-size: 90%;
2255
+ }
2256
+ }
2257
+
2258
+ .cmb_metabox_description {
2259
+ position: relative;
2260
+ flex-basis: 80%;
2261
+ font-size: 14px;
2262
+ }
2263
+
2264
+ .tooltipster-icon {
2265
+ position: absolute;
2266
+ top: 5px;
2267
+ right: -19px;
2268
+ }
2269
+ }
2270
+
2271
+ }
2272
+
2273
+ .cmb-type-text_range output {
2274
+ width: 40px;
2275
+ max-width: 50px;
2276
+ padding: 6px 0;
2277
+ text-align: center;
2278
+ display: inline-block;
2279
+ }
2280
+
2281
+ .cmb_text_range {
2282
+ margin: 14px 0;
2283
+ min-width: 187px;
2284
+ flex-grow: 1;
2285
+ position: relative;
2286
+ -webkit-appearance: none;
2287
+ height: 6px;
2288
+ outline: none;
2289
+ background: none;
2290
+ margin-right: 20px;
2291
+ background: linear-gradient(to right, #0083BD, #0083BD 100%, transparent 100%) top left no-repeat;
2292
+ background-size: 100% 100%;
2293
+ padding-left: 0;
2294
+ padding-right: 0;
2295
+
2296
+ cursor: pointer;
2297
+ cursor: -webkit-grab;
2298
+
2299
+ &:active {
2300
+ cursor: -webkit-grabbing;
2301
+ }
2302
+
2303
+ &:before {
2304
+ content: " ";
2305
+ position: absolute;
2306
+ top: 0;
2307
+ left: 0;
2308
+ height: 6px;
2309
+ width: 100%;
2310
+ box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.3);
2311
+ border-radius: 10px;
2312
+ }
2313
+
2314
+ /* Special styling for WebKit/Blink */
2315
+ &::-webkit-slider-thumb {
2316
+ -webkit-appearance: none;
2317
+ border-radius: 4px;
2318
+ width: 22px;
2319
+ height: 22px;
2320
+ border: 1px solid #0083BD;
2321
+ position: relative;
2322
+ z-index: 20;
2323
+ background: white;
2324
+ }
2325
+
2326
+ /* All the same stuff for Firefox */
2327
+ &::-moz-range-thumb {}
2328
+ &::-ms-thumb {}
2329
+ }
2330
+
2331
+ #wp-_pile_header_cover_description-wrap .mce-toolbar.mce-last .mce-btn {
2332
+ border: 1px solid #ddd;
2333
+ border-radius: 2px;
2334
+ margin: 16px 0 0 10px;
2335
+ background: white;
2336
+ }
2337
+
2338
+ // Change Formats to Custom Elements
2339
+ body .mce-toolbar.mce-last .mce-container.mce-first .mce-menubtn.mce-first {
2340
+ button {
2341
+ font-size: 13px;
2342
+ line-height: 1.5;
2343
+ padding: 2px 10px 2px 8px;
2344
+ border: 0;
2345
+ width: auto;
2346
+ visibility: hidden;
2347
+ width: 12em;
2348
+
2349
+ i {
2350
+ visibility: visible;
2351
+ }
2352
+
2353
+ &:before {
2354
+ content: "Custom Elements";
2355
+ position: absolute;
2356
+ top: 2px;
2357
+ left: 8px;
2358
+ visibility: visible;
2359
+ }
2360
+ }
2361
+
2362
+ .mce-caret {
2363
+ position: absolute;
2364
+ margin-top: -2px !important;
2365
+ right: 8px;
2366
+ top: 50%;
2367
+ }
2368
+ }
2369
+
2370
+ .cmb-type-textarea_code {
2371
+ flex-direction: column-reverse;
2372
+ align-items: stretch;
2373
+
2374
+ > *:not(:last-child) {
2375
+ margin-top: 10px;
2376
+ }
2377
+ }
2378
+
2379
+ #pixvideos,
2380
+ #pixgallery {
2381
+ width: 100%;
2382
+ }
2383
+
2384
+ .wp-color-result {
2385
+ position: absolute;
2386
+ top: 0;
2387
+ right: 0;
2388
+ width: 38px;
2389
+ min-height: 33px;
2390
+ border: 1px solid #DDD;
2391
+ margin: 0;
2392
+ padding: 0;
2393
+ box-shadow: none;
2394
+
2395
+ display: flex;
2396
+ align-items: center;
2397
+
2398
+ &:after {
2399
+ content: none;
2400
+ }
2401
+ }
2402
+
2403
+ .wp-picker-container {
2404
+ position: absolute;
2405
+ right: 0;
2406
+ top: 50%;
2407
+ margin-top: -9px;
2408
+ z-index: 10;
2409
+
2410
+ .iris-border {
2411
+ border-radius: 4px;
2412
+ }
2413
+ }
2414
+
2415
+ .wp-picker-active {
2416
+ display: flex;
2417
+ flex-wrap: wrap;
2418
+
2419
+ .wp-color-result:after {
2420
+ content: none;
2421
+ }
2422
+ }
2423
+
2424
+ .wp-picker-open + .wp-picker-input-wrap {
2425
+ display: flex;
2426
+ align-items: stretch;
2427
+
2428
+ .button {
2429
+ height: auto;
2430
+ padding-left: 10px;
2431
+ padding-right: 10px;
2432
+ }
2433
+ }
2434
+
2435
+ .wp-picker-container input[type=text].wp-color-picker {
2436
+ width: 85px;
2437
+ text-align: left;
2438
+ }
2439
+
2440
+ .media-modal-close {
2441
+ text-decoration: none;
2442
+
2443
+ span.media-modal-icon {
2444
+ position: absolute;
2445
+ top: 50%;
2446
+ left: 50%;
2447
+ transform: translateX(-50%) translateY(-50%);
2448
+ }
2449
+ }
2450
+
2451
+ .tooltipster-base {
2452
+ border-color: #23282d;
2453
+ .tooltipster-content {
2454
+ padding: 20px;
2455
+
2456
+ font-style: normal;
2457
+ color: inherit;
2458
+ background-color: #23282d;
2459
+ text-align: left;
2460
+ color: #FFF;
2461
+ box-shadow: 0 4px 20px rgba(0,0,0,.20),0 0 0 1px rgba(0,0,0,.06);
2462
+
2463
+ a {
2464
+ color: white;
2465
+ text-decoration: none;
2466
+ border-bottom: 1px dotted;
2467
+
2468
+ &:hover {
2469
+ opacity: 0.7;
2470
+ }
2471
+ }
2472
+
2473
+ p {
2474
+ margin: 0 0 1em 0;
2475
+
2476
+ &:last-child {
2477
+ margin-bottom: 0;
2478
+ }
2479
+ }
2480
+
2481
+ title {
2482
+ display: block;
2483
+ font-weight: bold;
2484
+ margin-bottom: 12px;
2485
+ font-size: 14px;
2486
+ margin-top: -4px;
2487
+ }
2488
+ }
2489
+
2490
+ .tooltipster-arrow {
2491
+ z-index: 1;
2492
+ height: auto;
2493
+ width: auto;
2494
+ top: auto;
2495
+ right: auto;
2496
+ left: calc(50% - 5px);
2497
+ bottom: 0;
2498
+
2499
+ span {
2500
+ border-top-color: #23282d !important;
2501
+ }
2502
+ }
2503
+ }
2504
+
2505
+ .tooltipster-icon {
2506
+ color: #AAA;
2507
  }
pixtypes.php CHANGED
@@ -10,7 +10,7 @@
10
  Plugin Name: PixTypes
11
  Plugin URI: http://pixelgrade.com
12
  Description: Custom post types and metaboxes needed by your theme
13
- Version: 1.3.5
14
  Author: PixelGrade
15
  Author URI: http://pixelgrade.com
16
  Author Email: contact@pixelgrade.com
10
  Plugin Name: PixTypes
11
  Plugin URI: http://pixelgrade.com
12
  Description: Custom post types and metaboxes needed by your theme
13
+ Version: 1.4.2
14
  Author: PixelGrade
15
  Author URI: http://pixelgrade.com
16
  Author Email: contact@pixelgrade.com
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === PixTypes ===
2
- Contributors: pixelgrade, euthelup, babbardel, vlad.olaru
3
  Tags: custom, post-types, metadata
4
- Requires at least: 4.0.0
5
- Tested up to: 4.3.1
6
- Stable tag: 1.3.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -24,6 +24,26 @@ Note: This plugin is addressed to developers, it doesn't do nothing if it isn't
24
 
25
  == Changelog ==
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  = 1.3.3 =
28
 
29
  * Added a Playlist field
1
  === PixTypes ===
2
+ Contributors: pixelgrade, euthelup, babbardel, vlad.olaru, cristianfrumusanu, razvanonofrei
3
  Tags: custom, post-types, metadata
4
+ Requires at least: 4.2.0
5
+ Tested up to: 4.5.2
6
+ Stable tag: 1.4.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
24
 
25
  == Changelog ==
26
 
27
+ = 1.4.2 =
28
+ * Fixed Builder visuals
29
+ * Safely sanitize builder output
30
+
31
+ = 1.4.1 =
32
+ * Fixed pix_builder on old configs.
33
+ * Fixed an issue with WPJM Extended Location
34
+ * Fixed new block ids in pix_builder
35
+
36
+ = 1.4.0 =
37
+ * Improved all the fields Visuals and styles.
38
+ * Improved the pix_builder field, now will save values in the content instead of its own meta.And the editor is better now.
39
+ * Added a positioning UI for the builder blocks.
40
+ * Fixed the defaults for the textarea fields.
41
+ * Fixed the defaults for colorpicker.
42
+ * Fixed small PHP warnings and notices.
43
+
44
+ = 1.3.5 =
45
+ Improved the multicheck field
46
+
47
  = 1.3.3 =
48
 
49
  * Added a Playlist field