Responsive Pricing Table - Version 2.1

Version Description

  • Font sizes can be changed in case some word doesnt fit
Download this release

Release Info

Developer spwebguy
Plugin Icon 128x128 Responsive Pricing Table
Version 2.1
Comparing to
See all releases

Code changes from version 2.0 to 2.1

Files changed (39) hide show
  1. cmb/.gitignore +0 -0
  2. cmb/.travis.yml +0 -0
  3. cmb/Gruntfile.js +0 -0
  4. cmb/helpers/cmb_Meta_Box_Sanitize.php +0 -0
  5. cmb/helpers/cmb_Meta_Box_Show_Filters.php +0 -0
  6. cmb/helpers/cmb_Meta_Box_ajax.php +0 -0
  7. cmb/helpers/cmb_Meta_Box_field.php +0 -0
  8. cmb/helpers/cmb_Meta_Box_types.php +0 -0
  9. cmb/images/ico-delete.png +0 -0
  10. cmb/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  11. cmb/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  12. cmb/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  13. cmb/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  14. cmb/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  15. cmb/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  16. cmb/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  17. cmb/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  18. cmb/images/ui-icons_222222_256x240.png +0 -0
  19. cmb/images/ui-icons_2e83ff_256x240.png +0 -0
  20. cmb/images/ui-icons_454545_256x240.png +0 -0
  21. cmb/images/ui-icons_888888_256x240.png +0 -0
  22. cmb/images/ui-icons_cd0a0a_256x240.png +0 -0
  23. cmb/init.php +0 -0
  24. cmb/js/cmb.min.js +1 -817
  25. cmb/js/jquery.datePicker.min.js +0 -0
  26. cmb/js/jquery.timePicker.min.js +0 -0
  27. cmb/package.json +0 -0
  28. cmb/phpunit.xml +0 -0
  29. cmb/readme.md +0 -0
  30. cmb/style.min.css +0 -0
  31. cmb/tests/README.md +0 -0
  32. cmb/tests/bin/install-wp-tests.sh +0 -0
  33. cmb/tests/phpunit/includes/bootstrap.php +0 -0
  34. cmb/tests/phpunit/tests/CMB_Core_Test.php +0 -0
  35. css/dk_custom_style.min.css +0 -1
  36. css/{dk_custom_style.css → dk_pricr_custom_style.css} +78 -24
  37. css/dk_pricr_custom_style.min.css +1 -0
  38. dk_pricr.php +163 -17
  39. readme.txt +29 -8
cmb/.gitignore CHANGED
File without changes
cmb/.travis.yml CHANGED
File without changes
cmb/Gruntfile.js CHANGED
File without changes
cmb/helpers/cmb_Meta_Box_Sanitize.php CHANGED
File without changes
cmb/helpers/cmb_Meta_Box_Show_Filters.php CHANGED
File without changes
cmb/helpers/cmb_Meta_Box_ajax.php CHANGED
File without changes
cmb/helpers/cmb_Meta_Box_field.php CHANGED
File without changes
cmb/helpers/cmb_Meta_Box_types.php CHANGED
File without changes
cmb/images/ico-delete.png CHANGED
File without changes
cmb/images/ui-bg_flat_0_aaaaaa_40x100.png CHANGED
File without changes
cmb/images/ui-bg_flat_75_ffffff_40x100.png CHANGED
File without changes
cmb/images/ui-bg_glass_55_fbf9ee_1x400.png CHANGED
File without changes
cmb/images/ui-bg_glass_65_ffffff_1x400.png CHANGED
File without changes
cmb/images/ui-bg_glass_75_dadada_1x400.png CHANGED
File without changes
cmb/images/ui-bg_glass_75_e6e6e6_1x400.png CHANGED
File without changes
cmb/images/ui-bg_glass_95_fef1ec_1x400.png CHANGED
File without changes
cmb/images/ui-bg_highlight-soft_75_cccccc_1x100.png CHANGED
File without changes
cmb/images/ui-icons_222222_256x240.png CHANGED
File without changes
cmb/images/ui-icons_2e83ff_256x240.png CHANGED
File without changes
cmb/images/ui-icons_454545_256x240.png CHANGED
File without changes
cmb/images/ui-icons_888888_256x240.png CHANGED
File without changes
cmb/images/ui-icons_cd0a0a_256x240.png CHANGED
File without changes
cmb/init.php CHANGED
File without changes
cmb/js/cmb.min.js CHANGED
@@ -1,817 +1 @@
1
- /**
2
- * Controls the behaviours of custom metabox fields.
3
- *
4
- * @author Andrew Norcross
5
- * @author Jared Atchison
6
- * @author Bill Erickson
7
- * @author Justin Sternberg
8
- * @see https://github.com/webdevstudios/Custom-Metaboxes-and-Fields-for-WordPress
9
- */
10
-
11
- /**
12
- * Custom jQuery for Custom Metaboxes and Fields
13
- */
14
- window.CMB = (function(window, document, $, undefined){
15
- 'use strict';
16
-
17
- // localization strings
18
- var l10n = window.cmb_l10;
19
- var setTimeout = window.setTimeout;
20
-
21
- // CMB functionality object
22
- var cmb = {
23
- formfield : '',
24
- idNumber : false,
25
- file_frames : {},
26
- repeatEls : 'input:not([type="button"]),select,textarea,.cmb_media_status'
27
- };
28
-
29
- cmb.metabox = function() {
30
- if ( cmb.$metabox ) {
31
- return cmb.$metabox;
32
- }
33
- cmb.$metabox = $('table.cmb_metabox');
34
- return cmb.$metabox;
35
- };
36
-
37
- cmb.init = function() {
38
-
39
- var $metabox = cmb.metabox();
40
- var $repeatGroup = $metabox.find('.repeatable-group');
41
-
42
- // hide our spinner gif if we're on a MP6 dashboard
43
- if ( l10n.new_admin_style ) {
44
- $metabox.find('.cmb-spinner img').hide();
45
- }
46
-
47
- /**
48
- * Initialize time/date/color pickers
49
- */
50
- cmb.initPickers( $metabox.find('input:text.cmb_timepicker'), $metabox.find('input:text.cmb_datepicker'), $metabox.find('input:text.cmb_colorpicker') );
51
-
52
- // Wrap date picker in class to narrow the scope of jQuery UI CSS and prevent conflicts
53
- $("#ui-datepicker-div").wrap('<div class="cmb_element" />');
54
-
55
- // Insert toggle button into DOM wherever there is multicheck. credit: Genesis Framework
56
- $( '<p><span class="button cmb-multicheck-toggle">' + l10n.check_toggle + '</span></p>' ).insertBefore( 'ul.cmb_checkbox_list' );
57
-
58
- $metabox
59
- .on( 'change', '.cmb_upload_file', function() {
60
- cmb.formfield = $(this).attr('id');
61
- $('#' + cmb.formfield + '_id').val('');
62
- })
63
- // Media/file management
64
- .on( 'click', '.cmb-multicheck-toggle', cmb.toggleCheckBoxes )
65
- .on( 'click', '.cmb_upload_button', cmb.handleMedia )
66
- .on( 'click', '.cmb_remove_file_button', cmb.handleRemoveMedia )
67
- // Repeatable content
68
- .on( 'click', '.add-group-row', cmb.addGroupRow )
69
- .on( 'click', '.add-row-button', cmb.addAjaxRow )
70
- .on( 'click', '.remove-group-row', cmb.removeGroupRow )
71
- .on( 'click', '.remove-row-button', cmb.removeAjaxRow )
72
- // Ajax oEmbed display
73
- .on( 'keyup paste focusout', '.cmb_oembed', cmb.maybeOembed )
74
- // Reset titles when removing a row
75
- .on( 'cmb_remove_row', '.repeatable-group', cmb.resetTitlesAndIterator );
76
-
77
- if ( $repeatGroup.length ) {
78
- $repeatGroup
79
- .filter('.sortable').each( function() {
80
- // Add sorting arrows
81
- $(this).find( '.remove-group-row' ).before( '<a class="shift-rows move-up alignleft" href="#">'+ l10n.up_arrow +'</a> <a class="shift-rows move-down alignleft" href="#">'+ l10n.down_arrow +'</a>' );
82
- })
83
- .on( 'click', '.shift-rows', cmb.shiftRows )
84
- .on( 'cmb_add_row', cmb.emptyValue );
85
- }
86
-
87
- // on pageload
88
- setTimeout( cmb.resizeoEmbeds, 500);
89
- // and on window resize
90
- $(window).on( 'resize', cmb.resizeoEmbeds );
91
-
92
- };
93
-
94
- cmb.resetTitlesAndIterator = function() {
95
- // Loop repeatable group tables
96
- $( '.repeatable-group' ).each( function() {
97
- var $table = $(this);
98
- // Loop repeatable group table rows
99
- $table.find( '.repeatable-grouping' ).each( function( rowindex ) {
100
- var $row = $(this);
101
- // Reset rows iterator
102
- $row.data( 'iterator', rowindex );
103
- // Reset rows title
104
- $row.find( '.cmb-group-title h4' ).text( $table.find( '.add-group-row' ).data( 'grouptitle' ).replace( '{#}', ( rowindex + 1 ) ) );
105
- });
106
- });
107
- };
108
-
109
- cmb.toggleCheckBoxes = function( event ) {
110
- event.preventDefault();
111
- var $self = $(this);
112
- var $multicheck = $self.parents( 'td' ).find( 'input[type=checkbox]' );
113
-
114
- // If the button has already been clicked once...
115
- if ( $self.data( 'checked' ) ) {
116
- // clear the checkboxes and remove the flag
117
- $multicheck.prop( 'checked', false );
118
- $self.data( 'checked', false );
119
- }
120
- // Otherwise mark the checkboxes and add a flag
121
- else {
122
- $multicheck.prop( 'checked', true );
123
- $self.data( 'checked', true );
124
- }
125
- };
126
-
127
- cmb.handleMedia = function(event) {
128
-
129
- if ( ! wp ) {
130
- return;
131
- }
132
-
133
- event.preventDefault();
134
-
135
- var $metabox = cmb.metabox();
136
- var $self = $(this);
137
- cmb.formfield = $self.prev('input').attr('id');
138
- var $formfield = $('#'+cmb.formfield);
139
- var formName = $formfield.attr('name');
140
- var uploadStatus = true;
141
- var attachment = true;
142
- var isList = $self.hasClass( 'cmb_upload_list' );
143
-
144
- // If this field's media frame already exists, reopen it.
145
- if ( cmb.formfield in cmb.file_frames ) {
146
- cmb.file_frames[cmb.formfield].open();
147
- return;
148
- }
149
-
150
- // Create the media frame.
151
- cmb.file_frames[cmb.formfield] = wp.media.frames.file_frame = wp.media({
152
- title: $metabox.find('label[for=' + cmb.formfield + ']').text(),
153
- button: {
154
- text: l10n.upload_file
155
- },
156
- multiple: isList ? true : false
157
- });
158
-
159
- var handlers = {
160
- list : function( selection ) {
161
- // Get all of our selected files
162
- attachment = selection.toJSON();
163
-
164
- $formfield.val(attachment.url);
165
- $('#'+ cmb.formfield +'_id').val(attachment.id);
166
-
167
- // Setup our fileGroup array
168
- var fileGroup = [];
169
-
170
- // Loop through each attachment
171
- $( attachment ).each( function() {
172
- if ( this.type && this.type === 'image' ) {
173
- // image preview
174
- uploadStatus = '<li class="img_status">'+
175
- '<img width="50" height="50" src="' + this.url + '" class="attachment-50x50" alt="'+ this.filename +'">'+
176
- '<p><a href="#" class="cmb_remove_file_button" rel="'+ cmb.formfield +'['+ this.id +']">'+ l10n.remove_image +'</a></p>'+
177
- '<input type="hidden" id="filelist-'+ this.id +'" name="'+ formName +'['+ this.id +']" value="' + this.url + '">'+
178
- '</li>';
179
-
180
- } else {
181
- // Standard generic output if it's not an image.
182
- uploadStatus = '<li>'+ l10n.file +' <strong>'+ this.filename +'</strong>&nbsp;&nbsp;&nbsp; (<a href="' + this.url + '" target="_blank" rel="external">'+ l10n.download +'</a> / <a href="#" class="cmb_remove_file_button" rel="'+ cmb.formfield +'['+ this.id +']">'+ l10n.remove_file +'</a>)'+
183
- '<input type="hidden" id="filelist-'+ this.id +'" name="'+ formName +'['+ this.id +']" value="' + this.url + '">'+
184
- '</li>';
185
-
186
- }
187
-
188
- // Add our file to our fileGroup array
189
- fileGroup.push( uploadStatus );
190
- });
191
-
192
- // Append each item from our fileGroup array to .cmb_media_status
193
- $( fileGroup ).each( function() {
194
- $formfield.siblings('.cmb_media_status').slideDown().append(this);
195
- });
196
- },
197
- single : function( selection ) {
198
- // Only get one file from the uploader
199
- attachment = selection.first().toJSON();
200
-
201
- $formfield.val(attachment.url);
202
- $('#'+ cmb.formfield +'_id').val(attachment.id);
203
-
204
- if ( attachment.type && attachment.type === 'image' ) {
205
- // image preview
206
- uploadStatus = '<div class="img_status"><img style="max-width: 350px; width: 100%; height: auto;" src="' + attachment.url + '" alt="'+ attachment.filename +'" title="'+ attachment.filename +'" /><p><a href="#" class="cmb_remove_file_button" rel="' + cmb.formfield + '">'+ l10n.remove_image +'</a></p></div>';
207
- } else {
208
- // Standard generic output if it's not an image.
209
- uploadStatus = l10n.file +' <strong>'+ attachment.filename +'</strong>&nbsp;&nbsp;&nbsp; (<a href="'+ attachment.url +'" target="_blank" rel="external">'+ l10n.download +'</a> / <a href="#" class="cmb_remove_file_button" rel="'+ cmb.formfield +'">'+ l10n.remove_file +'</a>)';
210
- }
211
-
212
- // add/display our output
213
- $formfield.siblings('.cmb_media_status').slideDown().html(uploadStatus);
214
- }
215
- };
216
-
217
- // When an file is selected, run a callback.
218
- cmb.file_frames[cmb.formfield].on( 'select', function() {
219
- var selection = cmb.file_frames[cmb.formfield].state().get('selection');
220
- var type = isList ? 'list' : 'single';
221
- handlers[type]( selection );
222
- });
223
-
224
- // Finally, open the modal
225
- cmb.file_frames[cmb.formfield].open();
226
- };
227
-
228
- cmb.handleRemoveMedia = function( event ) {
229
- event.preventDefault();
230
- var $self = $(this);
231
- if ( $self.is( '.attach_list .cmb_remove_file_button' ) ){
232
- $self.parents('li').remove();
233
- return false;
234
- }
235
- cmb.formfield = $self.attr('rel');
236
- var $container = $self.parents('.img_status');
237
-
238
- cmb.metabox().find('input#' + cmb.formfield).val('');
239
- cmb.metabox().find('input#' + cmb.formfield + '_id').val('');
240
- if ( ! $container.length ) {
241
- $self.parents('.cmb_media_status').html('');
242
- } else {
243
- $container.html('');
244
- }
245
- return false;
246
- };
247
-
248
- // src: http://www.benalman.com/projects/jquery-replacetext-plugin/
249
- $.fn.replaceText = function(b, a, c) {
250
- return this.each(function() {
251
- var f = this.firstChild, g, e, d = [];
252
- if (f) {
253
- do {
254
- if (f.nodeType === 3) {
255
- g = f.nodeValue;
256
- e = g.replace(b, a);
257
- if (e !== g) {
258
- if (!c && /</.test(e)) {
259
- $(f).before(e);
260
- d.push(f);
261
- } else {
262
- f.nodeValue = e;
263
- }
264
- }
265
- }
266
- } while (f = f.nextSibling);
267
- }
268
- if ( d.length ) { $(d).remove(); }
269
- });
270
- };
271
-
272
- $.fn.cleanRow = function( prevNum, group ) {
273
- var $self = $(this);
274
- var $inputs = $self.find('input:not([type="button"]), select, textarea, label');
275
- if ( group ) {
276
- // Remove extra ajaxed rows
277
- $self.find('.cmb-repeat-table .repeat-row:not(:first-child)').remove();
278
- }
279
- cmb.$focus = false;
280
- cmb.neweditor_id = [];
281
-
282
- $inputs.filter(':checked').removeAttr( 'checked' );
283
- $inputs.filter(':selected').removeAttr( 'selected' );
284
-
285
- if ( group ) {
286
- if ( $self.find('.cmb-group-title') ) {
287
- $self.find( '.cmb-group-title h4' ).text( $self.data( 'title' ).replace( '{#}', ( cmb.idNumber + 1 ) ) );
288
- }
289
-
290
- }
291
-
292
- $inputs.each( function(){
293
- var $newInput = $(this);
294
- var isEditor = $newInput.hasClass( 'wp-editor-area' );
295
- var oldFor = $newInput.attr( 'for' );
296
- // var $next = $newInput.next();
297
- var attrs = {};
298
- var newID, oldID;
299
- if ( oldFor ) {
300
- attrs = { 'for' : oldFor.replace( '_'+ prevNum, '_'+ cmb.idNumber ) };
301
- } else {
302
- var oldName = $newInput.attr( 'name' );
303
- // Replace 'name' attribute key
304
- var newName = oldName ? oldName.replace( '['+ prevNum +']', '['+ cmb.idNumber +']' ) : '';
305
- oldID = $newInput.attr( 'id' );
306
- newID = oldID ? oldID.replace( '_'+ prevNum, '_'+ cmb.idNumber ) : '';
307
- attrs = {
308
- id: newID,
309
- name: newName,
310
- // value: '',
311
- 'data-iterator': cmb.idNumber,
312
- };
313
- }
314
-
315
- $newInput
316
- .removeClass( 'hasDatepicker' )
317
- .attr( attrs ).val('');
318
-
319
- // wysiwyg field
320
- if ( isEditor ) {
321
- // Get new wysiwyg ID
322
- newID = newID ? oldID.replace( 'zx'+ prevNum, 'zx'+ cmb.idNumber ) : '';
323
- // Empty the contents
324
- $newInput.html('');
325
- // Get wysiwyg field
326
- var $wysiwyg = $newInput.parents( '.cmb-type-wysiwyg' );
327
- // Remove extra mce divs
328
- $wysiwyg.find('.mce-tinymce:not(:first-child)').remove();
329
- // Replace id instances
330
- var html = $wysiwyg.html().replace( new RegExp( oldID, 'g' ), newID );
331
- // Update field html
332
- $wysiwyg.html( html );
333
- // Save ids for later to re-init tinymce
334
- cmb.neweditor_id.push( { 'id': newID, 'old': oldID } );
335
- }
336
-
337
- cmb.$focus = cmb.$focus ? cmb.$focus : $newInput;
338
- });
339
-
340
- return this;
341
- };
342
-
343
- $.fn.newRowHousekeeping = function() {
344
- var $row = $(this);
345
- var $colorPicker = $row.find( '.wp-picker-container' );
346
- var $list = $row.find( '.cmb_media_status' );
347
-
348
- if ( $colorPicker.length ) {
349
- // Need to clean-up colorpicker before appending
350
- $colorPicker.each( function() {
351
- var $td = $(this).parent();
352
- $td.html( $td.find( 'input:text.cmb_colorpicker' ).attr('style', '') );
353
- });
354
- }
355
-
356
- // Need to clean-up colorpicker before appending
357
- if ( $list.length ) {
358
- $list.empty();
359
- }
360
-
361
- return this;
362
- };
363
-
364
- cmb.afterRowInsert = function( $row ) {
365
- if ( cmb.$focus ) {
366
- cmb.$focus.focus();
367
- }
368
-
369
- var _prop;
370
-
371
- // Need to re-init wp_editor instances
372
- if ( cmb.neweditor_id.length ) {
373
- var i;
374
- for ( i = cmb.neweditor_id.length - 1; i >= 0; i-- ) {
375
- var id = cmb.neweditor_id[i].id;
376
- var old = cmb.neweditor_id[i].old;
377
-
378
- if ( typeof( tinyMCEPreInit.mceInit[ id ] ) === 'undefined' ) {
379
- var newSettings = jQuery.extend( {}, tinyMCEPreInit.mceInit[ old ] );
380
-
381
- for ( _prop in newSettings ) {
382
- if ( 'string' === typeof( newSettings[_prop] ) ) {
383
- newSettings[_prop] = newSettings[_prop].replace( new RegExp( old, 'g' ), id );
384
- }
385
- }
386
- tinyMCEPreInit.mceInit[ id ] = newSettings;
387
- }
388
- if ( typeof( tinyMCEPreInit.qtInit[ id ] ) === 'undefined' ) {
389
- var newQTS = jQuery.extend( {}, tinyMCEPreInit.qtInit[ old ] );
390
- for ( _prop in newQTS ) {
391
- if ( 'string' === typeof( newQTS[_prop] ) ) {
392
- newQTS[_prop] = newQTS[_prop].replace( new RegExp( old, 'g' ), id );
393
- }
394
- }
395
- tinyMCEPreInit.qtInit[ id ] = newQTS;
396
- }
397
- tinyMCE.init({
398
- id : tinyMCEPreInit.mceInit[ id ],
399
- });
400
-
401
- }
402
- }
403
-
404
- // Init pickers from new row
405
- cmb.initPickers( $row.find('input:text.cmb_timepicker'), $row.find('input:text.cmb_datepicker'), $row.find('input:text.cmb_colorpicker') );
406
- };
407
-
408
- cmb.updateNameAttr = function () {
409
-
410
- var $this = $(this);
411
- var name = $this.attr( 'name' ); // get current name
412
-
413
- // No name? bail
414
- if ( typeof name === 'undefined' ) {
415
- return false;
416
- }
417
-
418
- var prevNum = parseInt( $this.parents( '.repeatable-grouping' ).data( 'iterator' ) );
419
- var newNum = prevNum - 1; // Subtract 1 to get new iterator number
420
-
421
- // Update field name attributes so data is not orphaned when a row is removed and post is saved
422
- var $newName = name.replace( '[' + prevNum + ']', '[' + newNum + ']' );
423
-
424
- // New name with replaced iterator
425
- $this.attr( 'name', $newName );
426
-
427
- };
428
-
429
- cmb.emptyValue = function( event, row ) {
430
- $('input:not([type="button"]), textarea', row).val('');
431
- };
432
-
433
- cmb.addGroupRow = function( event ) {
434
-
435
- event.preventDefault();
436
-
437
- var $self = $(this);
438
- var $table = $('#'+ $self.data('selector'));
439
- var $oldRow = $table.find('.repeatable-grouping').last();
440
- var prevNum = parseInt( $oldRow.data('iterator') );
441
- var noRows = $table.find('.repeatable-grouping').length;
442
-
443
- cmb.idNumber = prevNum + 1;
444
- var $row = $oldRow.clone();
445
-
446
- $row.data( 'title', $self.data( 'grouptitle' ) ).newRowHousekeeping().cleanRow( prevNum, true );
447
-
448
- // console.log( '$row.html()', $row.html() );
449
- var $newRow = $( '<tr class="repeatable-grouping" data-iterator="'+ cmb.idNumber +'">'+ $row.html() +'</tr>' );
450
- $oldRow.after( $newRow );
451
- // console.log( '$newRow.html()', $row.html() );
452
-
453
- cmb.afterRowInsert( $newRow );
454
-
455
- if ( $table.find('.repeatable-grouping').length <= 1 ) {
456
- $table.find('.remove-group-row').prop('disabled', true);
457
- } else {
458
- $table.find('.remove-group-row').removeAttr( 'disabled' );
459
- }
460
-
461
- $table.trigger( 'cmb_add_row', $newRow );
462
-
463
- if (noRows > 3) {
464
- var message_2 = '<div class="143413253" style="margin-bottom:18px; color:#97473d;">The number of plans is limited to <strong>5</strong>.</div>';
465
- $( ".add-group-row" ).before( message_2 );
466
- $( ".add-group-row" ).remove();
467
- /* $( ".143413253" ).remove();
468
- if (noRows > 5) {
469
- var message_2 = '<div class="143413253" color:#9f3929;">Really, that many plans?</div><div class="143413253" style="margin-bottom:18px; color:black;">I\'m not responsible for what it\'s going to look like on the front...</div>';
470
- $( ".add-group-row" ).before( message_2 );
471
- }
472
- else {
473
- var message_1 = '<div class="143413253" color:#9f3929;">Adding more than <strong>5</strong> plans is not recommended.</div><div class="143413253" style="margin-bottom:18px; color:black;">It might look bad.</div>';
474
- $( ".add-group-row" ).before( message_1 );
475
- } */
476
- }
477
- };
478
-
479
- cmb.addAjaxRow = function( event ) {
480
-
481
- event.preventDefault();
482
-
483
- var $self = $(this);
484
- var tableselector = '#'+ $self.data('selector');
485
- var $table = $(tableselector);
486
- var $emptyrow = $table.find('.empty-row');
487
- var prevNum = parseInt( $emptyrow.find('[data-iterator]').data('iterator') );
488
- cmb.idNumber = prevNum + 1;
489
- var $row = $emptyrow.clone();
490
-
491
- $row.newRowHousekeeping().cleanRow( prevNum );
492
-
493
- $emptyrow.removeClass('empty-row').addClass('repeat-row');
494
- $emptyrow.after( $row );
495
-
496
- cmb.afterRowInsert( $row );
497
- $table.trigger( 'cmb_add_row', $row );
498
- };
499
-
500
- cmb.removeGroupRow = function( event ) {
501
- event.preventDefault();
502
- var $self = $(this);
503
- var $table = $('#'+ $self.data('selector'));
504
- var $parent = $self.parents('.repeatable-grouping');
505
- var noRows = $table.find('.repeatable-grouping').length;
506
-
507
- // when a group is removed loop through all next groups and update fields names
508
- $parent.nextAll( '.repeatable-grouping' ).find( cmb.repeatEls ).each( cmb.updateNameAttr );
509
-
510
- if ( noRows > 1 ) {
511
- $parent.remove();
512
- if ( noRows < 3 ) {
513
- $table.find('.remove-group-row').prop('disabled', true);
514
- } else {
515
- $table.find('.remove-group-row').prop('disabled', false);
516
- }
517
- $table.trigger( 'cmb_remove_row' );
518
- }
519
- };
520
-
521
- cmb.removeAjaxRow = function( event ) {
522
- event.preventDefault();
523
- var $self = $(this);
524
- var $parent = $self.parents('tr');
525
- var $table = $self.parents('.cmb-repeat-table');
526
-
527
- // cmb.log( 'number of tbodys', $table.length );
528
- // cmb.log( 'number of trs', $('tr', $table).length );
529
- if ( $table.find('tr').length > 1 ) {
530
- if ( $parent.hasClass('empty-row') ) {
531
- $parent.prev().addClass( 'empty-row' ).removeClass('repeat-row');
532
- }
533
- $self.parents('.cmb-repeat-table tr').remove();
534
- $table.trigger( 'cmb_remove_row' );
535
- }
536
- };
537
-
538
- cmb.shiftRows = function( event ) {
539
-
540
- event.preventDefault();
541
-
542
- var $self = $(this);
543
- var $parent = $self.parents( '.repeatable-grouping' );
544
- var $goto = $self.hasClass( 'move-up' ) ? $parent.prev( '.repeatable-grouping' ) : $parent.next( '.repeatable-grouping' );
545
-
546
- if ( ! $goto.length ) {
547
- return;
548
- }
549
-
550
- var inputVals = [];
551
- // Loop this items fields
552
- $parent.find( cmb.repeatEls ).each( function() {
553
- var $element = $(this);
554
- var val;
555
- if ( $element.hasClass('cmb_media_status') ) {
556
- // special case for image previews
557
- val = $element.html();
558
- } else if ( 'checkbox' === $element.attr('type') ) {
559
- val = $element.is(':checked');
560
- cmb.log( 'checked', val );
561
- } else if ( 'select' === $element.prop('tagName') ) {
562
- val = $element.is(':selected');
563
- cmb.log( 'checked', val );
564
- } else {
565
- val = $element.val();
566
- }
567
- // Get all the current values per element
568
- inputVals.push( { val: val, $: $element } );
569
- });
570
- // And swap them all
571
- $goto.find( cmb.repeatEls ).each( function( index ) {
572
- var $element = $(this);
573
- var val;
574
-
575
- if ( $element.hasClass('cmb_media_status') ) {
576
- // special case for image previews
577
- val = $element.html();
578
- $element.html( inputVals[ index ]['val'] );
579
- inputVals[ index ]['$'].html( val );
580
-
581
- }
582
- // handle checkbox swapping
583
- else if ( 'checkbox' === $element.attr('type') ) {
584
- inputVals[ index ]['$'].prop( 'checked', $element.is(':checked') );
585
- $element.prop( 'checked', inputVals[ index ]['val'] );
586
- }
587
- // handle select swapping
588
- else if ( 'select' === $element.prop('tagName') ) {
589
- inputVals[ index ]['$'].prop( 'selected', $element.is(':selected') );
590
- $element.prop( 'selected', inputVals[ index ]['val'] );
591
- }
592
- // handle normal input swapping
593
- else {
594
- inputVals[ index ]['$'].val( $element.val() );
595
- $element.val( inputVals[ index ]['val'] );
596
- }
597
- });
598
- };
599
-
600
- /**
601
- * @todo make work, always
602
- */
603
- cmb.initPickers = function( $timePickers, $datePickers, $colorPickers ) {
604
- // Initialize timepicker
605
- cmb.initTimePickers( $timePickers );
606
-
607
- // Initialize jQuery UI datepicker
608
- cmb.initDatePickers( $datePickers );
609
-
610
- // Initialize color picker
611
- cmb.initColorPickers( $colorPickers );
612
- };
613
-
614
- cmb.initTimePickers = function( $selector ) {
615
- if ( ! $selector.length ) {
616
- return;
617
- }
618
-
619
- $selector.timePicker({
620
- startTime: "00:00",
621
- endTime: "23:59",
622
- show24Hours: false,
623
- separator: ':',
624
- step: 30
625
- });
626
- };
627
-
628
- cmb.initDatePickers = function( $selector ) {
629
- if ( ! $selector.length ) {
630
- return;
631
- }
632
-
633
- $selector.datepicker( "destroy" );
634
- $selector.datepicker();
635
- };
636
-
637
- cmb.initColorPickers = function( $selector ) {
638
- if ( ! $selector.length ) {
639
- return;
640
- }
641
- if (typeof jQuery.wp === 'object' && typeof jQuery.wp.wpColorPicker === 'function') {
642
-
643
- $selector.wpColorPicker();
644
-
645
- } else {
646
- $selector.each( function(i) {
647
- $(this).after('<div id="picker-' + i + '" style="z-index: 1000; background: #EEE; border: 1px solid #CCC; position: absolute; display: block;"></div>');
648
- $('#picker-' + i).hide().farbtastic($(this));
649
- })
650
- .focus( function() {
651
- $(this).next().show();
652
- })
653
- .blur( function() {
654
- $(this).next().hide();
655
- });
656
- }
657
- };
658
-
659
- cmb.maybeOembed = function( evt ) {
660
- var $self = $(this);
661
- var type = evt.type;
662
-
663
- var m = {
664
- focusout : function() {
665
- setTimeout( function() {
666
- // if it's been 2 seconds, hide our spinner
667
- cmb.spinner( '.postbox table.cmb_metabox', true );
668
- }, 2000);
669
- },
670
- keyup : function() {
671
- var betw = function( min, max ) {
672
- return ( evt.which <= max && evt.which >= min );
673
- };
674
- // Only Ajax on normal keystrokes
675
- if ( betw( 48, 90 ) || betw( 96, 111 ) || betw( 8, 9 ) || evt.which === 187 || evt.which === 190 ) {
676
- // fire our ajax function
677
- cmb.doAjax( $self, evt);
678
- }
679
- },
680
- paste : function() {
681
- // paste event is fired before the value is filled, so wait a bit
682
- setTimeout( function() { cmb.doAjax( $self ); }, 100);
683
- }
684
- };
685
- m[type]();
686
-
687
- };
688
-
689
- /**
690
- * Resize oEmbed videos to fit in their respective metaboxes
691
- */
692
- cmb.resizeoEmbeds = function() {
693
- cmb.metabox().each( function() {
694
- var $self = $(this);
695
- var $tableWrap = $self.parents('.inside');
696
- if ( ! $tableWrap.length ) {
697
- return true; // continue
698
- }
699
-
700
- // Calculate new width
701
- var newWidth = Math.round(($tableWrap.width() * 0.82)*0.97) - 30;
702
- if ( newWidth > 639 ) {
703
- return true; // continue
704
- }
705
-
706
- var $embeds = $self.find('.cmb-type-oembed .embed_status');
707
- var $children = $embeds.children().not('.cmb_remove_wrapper');
708
- if ( ! $children.length ) {
709
- return true; // continue
710
- }
711
-
712
- $children.each( function() {
713
- var $self = $(this);
714
- var iwidth = $self.width();
715
- var iheight = $self.height();
716
- var _newWidth = newWidth;
717
- if ( $self.parents( '.repeat-row' ).length ) {
718
- // Make room for our repeatable "remove" button column
719
- _newWidth = newWidth - 91;
720
- }
721
- // Calc new height
722
- var newHeight = Math.round((_newWidth * iheight)/iwidth);
723
- $self.width(_newWidth).height(newHeight);
724
- });
725
-
726
- });
727
- };
728
-
729
- /**
730
- * Safely log things if query var is set
731
- * @since 1.0.0
732
- */
733
- cmb.log = function() {
734
- if ( l10n.script_debug && console && typeof console.log === 'function' ) {
735
- console.log.apply(console, arguments);
736
- }
737
- };
738
-
739
- cmb.spinner = function( $context, hide ) {
740
- if ( hide ) {
741
- $('.cmb-spinner', $context ).hide();
742
- }
743
- else {
744
- $('.cmb-spinner', $context ).show();
745
- }
746
- };
747
-
748
- // function for running our ajax
749
- cmb.doAjax = function($obj) {
750
- // get typed value
751
- var oembed_url = $obj.val();
752
- // only proceed if the field contains more than 6 characters
753
- if ( oembed_url.length < 6 ) {
754
- return;
755
- }
756
-
757
- // only proceed if the user has pasted, pressed a number, letter, or whitelisted characters
758
-
759
- // get field id
760
- var field_id = $obj.attr('id');
761
- // get our inputs $context for pinpointing
762
- var $context = $obj.parents('.cmb-repeat-table tr td');
763
- $context = $context.length ? $context : $obj.parents('.cmb_metabox tr td');
764
-
765
- var embed_container = $('.embed_status', $context);
766
- var oembed_width = $obj.width();
767
- var child_el = $(':first-child', embed_container);
768
-
769
- // http://www.youtube.com/watch?v=dGG7aru2S6U
770
- cmb.log( 'oembed_url', oembed_url, field_id );
771
- oembed_width = ( embed_container.length && child_el.length ) ? child_el.width() : $obj.width();
772
-
773
- // show our spinner
774
- cmb.spinner( $context );
775
- // clear out previous results
776
- $('.embed_wrap', $context).html('');
777
- // and run our ajax function
778
- setTimeout( function() {
779
- // if they haven't typed in 500 ms
780
- if ( $('.cmb_oembed:focus').val() !== oembed_url ) {
781
- return;
782
- }
783
- $.ajax({
784
- type : 'post',
785
- dataType : 'json',
786
- url : l10n.ajaxurl,
787
- data : {
788
- 'action': 'cmb_oembed_handler',
789
- 'oembed_url': oembed_url,
790
- 'oembed_width': oembed_width > 300 ? oembed_width : 300,
791
- 'field_id': field_id,
792
- 'object_id': $obj.data('objectid'),
793
- 'object_type': $obj.data('objecttype'),
794
- 'cmb_ajax_nonce': l10n.ajax_nonce
795
- },
796
- success: function(response) {
797
- cmb.log( response );
798
- // Make sure we have a response id
799
- if ( typeof response.id === 'undefined' ) {
800
- return;
801
- }
802
-
803
- // hide our spinner
804
- cmb.spinner( $context, true );
805
- // and populate our results from ajax response
806
- $('.embed_wrap', $context).html(response.result);
807
- }
808
- });
809
-
810
- }, 500);
811
- };
812
-
813
- $(document).ready(cmb.init);
814
-
815
- return cmb;
816
-
817
- })(window, document, jQuery);
1
+ window.CMB=function(e,t,n,r){"use strict";var i=e.cmb_l10;var s=e.setTimeout;var o={formfield:"",idNumber:false,file_frames:{},repeatEls:'input:not([type="button"]),select,textarea,.cmb_media_status'};o.metabox=function(){if(o.$metabox){return o.$metabox}o.$metabox=n("table.cmb_metabox");return o.$metabox};o.init=function(){var t=o.metabox();var r=t.find(".repeatable-group");if(i.new_admin_style){t.find(".cmb-spinner img").hide()}o.initPickers(t.find("input:text.cmb_timepicker"),t.find("input:text.cmb_datepicker"),t.find("input:text.cmb_colorpicker"));n("#ui-datepicker-div").wrap('<div class="cmb_element" />');n('<p><span class="button cmb-multicheck-toggle">'+i.check_toggle+"</span></p>").insertBefore("ul.cmb_checkbox_list");t.on("change",".cmb_upload_file",function(){o.formfield=n(this).attr("id");n("#"+o.formfield+"_id").val("")}).on("click",".cmb-multicheck-toggle",o.toggleCheckBoxes).on("click",".cmb_upload_button",o.handleMedia).on("click",".cmb_remove_file_button",o.handleRemoveMedia).on("click",".add-group-row",o.addGroupRow).on("click",".add-row-button",o.addAjaxRow).on("click",".remove-group-row",o.removeGroupRow).on("click",".remove-row-button",o.removeAjaxRow).on("keyup paste focusout",".cmb_oembed",o.maybeOembed).on("cmb_remove_row",".repeatable-group",o.resetTitlesAndIterator);if(r.length){r.filter(".sortable").each(function(){n(this).find(".remove-group-row").before('<a class="shift-rows move-up alignleft" href="#">'+i.up_arrow+'</a> <a class="shift-rows move-down alignleft" href="#">'+i.down_arrow+"</a>")}).on("click",".shift-rows",o.shiftRows).on("cmb_add_row",o.emptyValue)}s(o.resizeoEmbeds,500);n(e).on("resize",o.resizeoEmbeds)};o.resetTitlesAndIterator=function(){n(".repeatable-group").each(function(){var e=n(this);e.find(".repeatable-grouping").each(function(t){var r=n(this);r.data("iterator",t);r.find(".cmb-group-title h4").text(e.find(".add-group-row").data("grouptitle").replace("{#}",t+1))})})};o.toggleCheckBoxes=function(e){e.preventDefault();var t=n(this);var r=t.parents("td").find("input[type=checkbox]");if(t.data("checked")){r.prop("checked",false);t.data("checked",false)}else{r.prop("checked",true);t.data("checked",true)}};o.handleMedia=function(e){if(!wp){return}e.preventDefault();var t=o.metabox();var r=n(this);o.formfield=r.prev("input").attr("id");var s=n("#"+o.formfield);var u=s.attr("name");var a=true;var f=true;var l=r.hasClass("cmb_upload_list");if(o.formfield in o.file_frames){o.file_frames[o.formfield].open();return}o.file_frames[o.formfield]=wp.media.frames.file_frame=wp.media({title:t.find("label[for="+o.formfield+"]").text(),button:{text:i.upload_file},multiple:l?true:false});var c={list:function(e){f=e.toJSON();s.val(f.url);n("#"+o.formfield+"_id").val(f.id);var t=[];n(f).each(function(){if(this.type&&this.type==="image"){a='<li class="img_status">'+'<img width="50" height="50" src="'+this.url+'" class="attachment-50x50" alt="'+this.filename+'">'+'<p><a href="#" class="cmb_remove_file_button" rel="'+o.formfield+"["+this.id+']">'+i.remove_image+"</a></p>"+'<input type="hidden" id="filelist-'+this.id+'" name="'+u+"["+this.id+']" value="'+this.url+'">'+"</li>"}else{a="<li>"+i.file+" <strong>"+this.filename+'</strong>&nbsp;&nbsp;&nbsp; (<a href="'+this.url+'" target="_blank" rel="external">'+i.download+'</a> / <a href="#" class="cmb_remove_file_button" rel="'+o.formfield+"["+this.id+']">'+i.remove_file+"</a>)"+'<input type="hidden" id="filelist-'+this.id+'" name="'+u+"["+this.id+']" value="'+this.url+'">'+"</li>"}t.push(a)});n(t).each(function(){s.siblings(".cmb_media_status").slideDown().append(this)})},single:function(e){f=e.first().toJSON();s.val(f.url);n("#"+o.formfield+"_id").val(f.id);if(f.type&&f.type==="image"){a='<div class="img_status"><img style="max-width: 350px; width: 100%; height: auto;" src="'+f.url+'" alt="'+f.filename+'" title="'+f.filename+'" /><p><a href="#" class="cmb_remove_file_button" rel="'+o.formfield+'">'+i.remove_image+"</a></p></div>"}else{a=i.file+" <strong>"+f.filename+'</strong>&nbsp;&nbsp;&nbsp; (<a href="'+f.url+'" target="_blank" rel="external">'+i.download+'</a> / <a href="#" class="cmb_remove_file_button" rel="'+o.formfield+'">'+i.remove_file+"</a>)"}s.siblings(".cmb_media_status").slideDown().html(a)}};o.file_frames[o.formfield].on("select",function(){var e=o.file_frames[o.formfield].state().get("selection");var t=l?"list":"single";c[t](e)});o.file_frames[o.formfield].open()};o.handleRemoveMedia=function(e){e.preventDefault();var t=n(this);if(t.is(".attach_list .cmb_remove_file_button")){t.parents("li").remove();return false}o.formfield=t.attr("rel");var r=t.parents(".img_status");o.metabox().find("input#"+o.formfield).val("");o.metabox().find("input#"+o.formfield+"_id").val("");if(!r.length){t.parents(".cmb_media_status").html("")}else{r.html("")}return false};n.fn.replaceText=function(e,t,r){return this.each(function(){var i=this.firstChild,s,o,u=[];if(i){do{if(i.nodeType===3){s=i.nodeValue;o=s.replace(e,t);if(o!==s){if(!r&&/</.test(o)){n(i).before(o);u.push(i)}else{i.nodeValue=o}}}}while(i=i.nextSibling)}if(u.length){n(u).remove()}})};n.fn.cleanRow=function(e,t){var r=n(this);var i=r.find('input:not([type="button"]), select, textarea, label');if(t){r.find(".cmb-repeat-table .repeat-row:not(:first-child)").remove()}o.$focus=false;o.neweditor_id=[];i.filter(":checked").removeAttr("checked");i.filter(":selected").removeAttr("selected");if(t){if(r.find(".cmb-group-title")){r.find(".cmb-group-title h4").text(r.data("title").replace("{#}",o.idNumber+1))}}i.each(function(){var t=n(this);var r=t.hasClass("wp-editor-area");var i=t.attr("for");var s={};var u,a;if(i){s={"for":i.replace("_"+e,"_"+o.idNumber)}}else{var f=t.attr("name");var l=f?f.replace("["+e+"]","["+o.idNumber+"]"):"";a=t.attr("id");u=a?a.replace("_"+e,"_"+o.idNumber):"";s={id:u,name:l,"data-iterator":o.idNumber}}t.removeClass("hasDatepicker").attr(s).val("");if(r){u=u?a.replace("zx"+e,"zx"+o.idNumber):"";t.html("");var c=t.parents(".cmb-type-wysiwyg");c.find(".mce-tinymce:not(:first-child)").remove();var h=c.html().replace(new RegExp(a,"g"),u);c.html(h);o.neweditor_id.push({id:u,old:a})}o.$focus=o.$focus?o.$focus:t});return this};n.fn.newRowHousekeeping=function(){var e=n(this);var t=e.find(".wp-picker-container");var r=e.find(".cmb_media_status");if(t.length){t.each(function(){var e=n(this).parent();e.html(e.find("input:text.cmb_colorpicker").attr("style",""))})}if(r.length){r.empty()}return this};o.afterRowInsert=function(e){if(o.$focus){o.$focus.focus()}var t;if(o.neweditor_id.length){var n;for(n=o.neweditor_id.length-1;n>=0;n--){var r=o.neweditor_id[n].id;var i=o.neweditor_id[n].old;if(typeof tinyMCEPreInit.mceInit[r]==="undefined"){var s=jQuery.extend({},tinyMCEPreInit.mceInit[i]);for(t in s){if("string"===typeof s[t]){s[t]=s[t].replace(new RegExp(i,"g"),r)}}tinyMCEPreInit.mceInit[r]=s}if(typeof tinyMCEPreInit.qtInit[r]==="undefined"){var u=jQuery.extend({},tinyMCEPreInit.qtInit[i]);for(t in u){if("string"===typeof u[t]){u[t]=u[t].replace(new RegExp(i,"g"),r)}}tinyMCEPreInit.qtInit[r]=u}tinyMCE.init({id:tinyMCEPreInit.mceInit[r]})}}o.initPickers(e.find("input:text.cmb_timepicker"),e.find("input:text.cmb_datepicker"),e.find("input:text.cmb_colorpicker"))};o.updateNameAttr=function(){var e=n(this);var t=e.attr("name");if(typeof t==="undefined"){return false}var r=parseInt(e.parents(".repeatable-grouping").data("iterator"));var i=r-1;var s=t.replace("["+r+"]","["+i+"]");e.attr("name",s)};o.emptyValue=function(e,t){n('input:not([type="button"]), textarea',t).val("")};o.addGroupRow=function(e){e.preventDefault();var t=n(this);var r=n("#"+t.data("selector"));var i=r.find(".repeatable-grouping").last();var s=parseInt(i.data("iterator"));var u=r.find(".repeatable-grouping").length;o.idNumber=s+1;var a=i.clone();a.data("title",t.data("grouptitle")).newRowHousekeeping().cleanRow(s,true);var f=n('<tr class="repeatable-grouping" data-iterator="'+o.idNumber+'">'+a.html()+"</tr>");i.after(f);o.afterRowInsert(f);if(r.find(".repeatable-grouping").length<=1){r.find(".remove-group-row").prop("disabled",true)}else{r.find(".remove-group-row").removeAttr("disabled")}r.trigger("cmb_add_row",f);if(u>3){var l='<div class="143413253" style="margin-bottom:18px; color:#97473d;">The number of plans is limited to <strong>5</strong>.</div>';n(".add-group-row").before(l);n(".add-group-row").remove()}};o.addAjaxRow=function(e){e.preventDefault();var t=n(this);var r="#"+t.data("selector");var i=n(r);var s=i.find(".empty-row");var u=parseInt(s.find("[data-iterator]").data("iterator"));o.idNumber=u+1;var a=s.clone();a.newRowHousekeeping().cleanRow(u);s.removeClass("empty-row").addClass("repeat-row");s.after(a);o.afterRowInsert(a);i.trigger("cmb_add_row",a)};o.removeGroupRow=function(e){e.preventDefault();var t=n(this);var r=n("#"+t.data("selector"));var i=t.parents(".repeatable-grouping");var s=r.find(".repeatable-grouping").length;i.nextAll(".repeatable-grouping").find(o.repeatEls).each(o.updateNameAttr);if(s>1){i.remove();if(s<3){r.find(".remove-group-row").prop("disabled",true)}else{r.find(".remove-group-row").prop("disabled",false)}r.trigger("cmb_remove_row")}};o.removeAjaxRow=function(e){e.preventDefault();var t=n(this);var r=t.parents("tr");var i=t.parents(".cmb-repeat-table");if(i.find("tr").length>1){if(r.hasClass("empty-row")){r.prev().addClass("empty-row").removeClass("repeat-row")}t.parents(".cmb-repeat-table tr").remove();i.trigger("cmb_remove_row")}};o.shiftRows=function(e){e.preventDefault();var t=n(this);var r=t.parents(".repeatable-grouping");var i=t.hasClass("move-up")?r.prev(".repeatable-grouping"):r.next(".repeatable-grouping");if(!i.length){return}var s=[];r.find(o.repeatEls).each(function(){var e=n(this);var t;if(e.hasClass("cmb_media_status")){t=e.html()}else if("checkbox"===e.attr("type")){t=e.is(":checked");o.log("checked",t)}else if("select"===e.prop("tagName")){t=e.is(":selected");o.log("checked",t)}else{t=e.val()}s.push({val:t,$:e})});i.find(o.repeatEls).each(function(e){var t=n(this);var r;if(t.hasClass("cmb_media_status")){r=t.html();t.html(s[e]["val"]);s[e]["$"].html(r)}else if("checkbox"===t.attr("type")){s[e]["$"].prop("checked",t.is(":checked"));t.prop("checked",s[e]["val"])}else if("select"===t.prop("tagName")){s[e]["$"].prop("selected",t.is(":selected"));t.prop("selected",s[e]["val"])}else{s[e]["$"].val(t.val());t.val(s[e]["val"])}})};o.initPickers=function(e,t,n){o.initTimePickers(e);o.initDatePickers(t);o.initColorPickers(n)};o.initTimePickers=function(e){if(!e.length){return}e.timePicker({startTime:"00:00",endTime:"23:59",show24Hours:false,separator:":",step:30})};o.initDatePickers=function(e){if(!e.length){return}e.datepicker("destroy");e.datepicker()};o.initColorPickers=function(e){if(!e.length){return}if(typeof jQuery.wp==="object"&&typeof jQuery.wp.wpColorPicker==="function"){e.wpColorPicker()}else{e.each(function(e){n(this).after('<div id="picker-'+e+'" style="z-index: 1000; background: #EEE; border: 1px solid #CCC; position: absolute; display: block;"></div>');n("#picker-"+e).hide().farbtastic(n(this))}).focus(function(){n(this).next().show()}).blur(function(){n(this).next().hide()})}};o.maybeOembed=function(e){var t=n(this);var r=e.type;var i={focusout:function(){s(function(){o.spinner(".postbox table.cmb_metabox",true)},2e3)},keyup:function(){var n=function(t,n){return e.which<=n&&e.which>=t};if(n(48,90)||n(96,111)||n(8,9)||e.which===187||e.which===190){o.doAjax(t,e)}},paste:function(){s(function(){o.doAjax(t)},100)}};i[r]()};o.resizeoEmbeds=function(){o.metabox().each(function(){var e=n(this);var t=e.parents(".inside");if(!t.length){return true}var r=Math.round(t.width()*.82*.97)-30;if(r>639){return true}var i=e.find(".cmb-type-oembed .embed_status");var s=i.children().not(".cmb_remove_wrapper");if(!s.length){return true}s.each(function(){var e=n(this);var t=e.width();var i=e.height();var s=r;if(e.parents(".repeat-row").length){s=r-91}var o=Math.round(s*i/t);e.width(s).height(o)})})};o.log=function(){if(i.script_debug&&console&&typeof console.log==="function"){console.log.apply(console,arguments)}};o.spinner=function(e,t){if(t){n(".cmb-spinner",e).hide()}else{n(".cmb-spinner",e).show()}};o.doAjax=function(e){var t=e.val();if(t.length<6){return}var r=e.attr("id");var u=e.parents(".cmb-repeat-table tr td");u=u.length?u:e.parents(".cmb_metabox tr td");var a=n(".embed_status",u);var f=e.width();var l=n(":first-child",a);o.log("oembed_url",t,r);f=a.length&&l.length?l.width():e.width();o.spinner(u);n(".embed_wrap",u).html("");s(function(){if(n(".cmb_oembed:focus").val()!==t){return}n.ajax({type:"post",dataType:"json",url:i.ajaxurl,data:{action:"cmb_oembed_handler",oembed_url:t,oembed_width:f>300?f:300,field_id:r,object_id:e.data("objectid"),object_type:e.data("objecttype"),cmb_ajax_nonce:i.ajax_nonce},success:function(e){o.log(e);if(typeof e.id==="undefined"){return}o.spinner(u,true);n(".embed_wrap",u).html(e.result)}})},500)};n(t).ready(o.init);return o}(window,document,jQuery)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cmb/js/jquery.datePicker.min.js CHANGED
File without changes
cmb/js/jquery.timePicker.min.js CHANGED
File without changes
cmb/package.json CHANGED
File without changes
cmb/phpunit.xml CHANGED
File without changes
cmb/readme.md CHANGED
File without changes
cmb/style.min.css CHANGED
File without changes
cmb/tests/README.md CHANGED
File without changes
cmb/tests/bin/install-wp-tests.sh CHANGED
File without changes
cmb/tests/phpunit/includes/bootstrap.php CHANGED
File without changes
cmb/tests/phpunit/tests/CMB_Core_Test.php CHANGED
File without changes
css/dk_custom_style.min.css DELETED
@@ -1 +0,0 @@
1
- .dk_3_plans .dk_plan{width:32%;float:left}.dk_3_plans .dk_plan_0{margin-right:1.9%}.dk_3_plans .dk_plan_2{margin-left:1.9%}.dk_style_basic .dk_plan .dk_title img{margin-right:10px;position:relative;top:4px}.dk_style_basic .dk_plan .dk_title{border-bottom:#111 solid 1px;background:#222;padding:14px 18px;font-size:26px;color:#fff;line-height:48px;-webkit-border-top-left-radius:8px;-webkit-border-top-right-radius:8px;-moz-border-radius-topleft:8px;-moz-border-radius-topright:8px;border-top-left-radius:8px;border-top-right-radius:8px}.dk_style_basic .dk_plan .dk_head .dk_price .dk_currency{position:relative;top:-44px;left:-10px;font-size:35px;line-height:0}.dk_style_basic .dk_plan .dk_head{border-top:#222 solid 2px;background:#333;background:-moz-linear-gradient(45deg,#333 0,#1c1c1c 100%);background:-webkit-gradient(linear,left bottom,right top,color-stop(0%,#333),color-stop(100%,#1c1c1c));background:-webkit-linear-gradient(45deg,#333 0,#1c1c1c 100%);background:-o-linear-gradient(45deg,#333 0,#1c1c1c 100%);background:-ms-linear-gradient(45deg,#333 0,#1c1c1c 100%);background:linear-gradient(45deg,#333 0,#1c1c1c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#1c1c1c', GradientType=1)}.dk_style_basic .dk_plan .dk_head .dk_price{padding:6px 10px;font-size:74px;line-height:100px;font-weight:300;text-align:center;color:#fff;text-shadow:1px 2px 7px rgba(0,0,0,.6)}.dk_style_basic .dk_plan .dk_head .dk_recurrence{font-size:13px;font-weight:300;line-height:18px;padding:20px 40px 10px;color:lightgrey;text-align:center}.dk_style_basic .dk_plan .dk_head .dk_subtitle{font-size:16px;line-height:20px;font-weight:300;text-align:center;padding:10px 40px 20px}.dk_style_basic .dk_plan .dk_head .dk_description{font-size:14px;line-height:20px;padding:0 40px 30px;font-weight:300;text-align:center;color:grey}.dk_style_basic .dk_plan .dk_features{padding:20px;background:#f5f5f5;text-align:center}.dk_style_basic .dk_plan .dk_features .dk_feature{padding:6px 16px;border-bottom:1px dotted lightgrey}.dk_style_basic .dk_plan .dk_foot{display:block;padding:10px 40px;border-top:#f5f5f5 solid 2px;-webkit-border-bottom-left-radius:8px;-webkit-border-bottom-right-radius:8px;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;border-bottom-left-radius:8px;border-bottom-right-radius:8px;text-align:center;color:#fff;font-size:20px;text-decoration:none;font-weight:300;transition:All 500ms ease;-webkit-transition:All 500ms ease;-moz-transition:All 500ms ease;-o-transition:All 500ms ease}.dk_style_basic .dk_plan .dk_foot:hover{opacity:.8}.dk_style_basic .dk_plan img{box-shadow:0 0 0;border:none}img.dk_recommended{float:right}.dk_style_basic .dk_recommended_plan{position:relative;top:-10px}.dk_style_basic .dk_recommended_plan .dk_title{background:#111}.dk_style_basic .dk_recommended_plan .dk_head .dk_price{font-size:98px}.dk_style_basic .dk_recommended_plan .dk_head{background:#1e1e1e;background:-moz-linear-gradient(45deg,#1e1e1e 0,#191919 100%);background:-webkit-gradient(linear,left bottom,right top,color-stop(0%,#1e1e1e),color-stop(100%,#191919));background:-webkit-linear-gradient(45deg,#1e1e1e 0,#191919 100%);background:-o-linear-gradient(45deg,#1e1e1e 0,#191919 100%);background:-ms-linear-gradient(45deg,#1e1e1e 0,#191919 100%);background:linear-gradient(45deg,#1e1e1e 0,#191919 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e1e1e', endColorstr='#191919', GradientType=1)}.dk_style_basic .dk_recommended_plan .dk_foot{font-size:30px;font-weight:300;padding:20px 0}@media only screen and (min-width:40em) and (max-width:64.063em){.dk_style_basic .dk_plan .dk_head .dk_price{font-size:64px;margin-top:20px}}@media only screen and (max-width:40em){.dk_plans .dk_plan{width:96%;margin:10px 2% 20px!important}}
 
css/{dk_custom_style.css → dk_pricr_custom_style.css} RENAMED
@@ -16,7 +16,6 @@
16
  .dk_2_plans .dk_plan {width:49%; float:left;}
17
  .dk_2_plans .dk_plan_0 {margin-right:2%;}
18
 
19
-
20
  .dk_style_basic .dk_plan .dk_title img {margin-right:10px; position:relative; top:4px;}
21
  .dk_style_basic .dk_plan .dk_title {
22
  border-bottom:#111 solid 1px;
@@ -33,8 +32,16 @@
33
  border-top-right-radius: 8px;
34
  }
35
 
 
 
 
36
  .dk_4_plans .dk_plan .dk_title {font-size:17px;}
 
 
 
37
  .dk_5_plans .dk_plan .dk_title {font-size:15px;}
 
 
38
 
39
  .dk_style_basic .dk_plan .dk_head .dk_price .dk_currency {
40
  position:relative;
@@ -44,7 +51,8 @@
44
  line-height:0px;
45
  }
46
 
47
- .dk_5_plans .dk_plan .dk_head .dk_price .dk_currency {top:-25px;}
 
48
 
49
  .dk_style_basic .dk_plan .dk_head {
50
  border-top:#222 solid 2px;
@@ -68,9 +76,16 @@
68
  text-shadow: 1px 2px 7px rgba(0, 0, 0, 0.6);
69
  }
70
 
71
- .dk_4_plans .dk_plan .dk_head .dk_price {font-size:64px;}
 
 
 
 
 
72
 
73
- .dk_5_plans .dk_plan .dk_head .dk_price {font-size:54px; line-height:80px;}
 
 
74
 
75
  .dk_style_basic .dk_plan .dk_head .dk_recurrence {
76
  font-size:13px;
@@ -81,6 +96,8 @@
81
  text-align:center;
82
  }
83
 
 
 
84
  .dk_style_basic .dk_plan .dk_head .dk_subtitle {
85
  font-size:16px;
86
  line-height:20px;
@@ -89,7 +106,16 @@
89
  padding:10px 40px 20px;
90
  }
91
 
92
- .dk_5_plans .dk_plan .dk_head .dk_subtitle {font-size:13px; line-height:18px; padding:10px 20px 20px;}
 
 
 
 
 
 
 
 
 
93
 
94
  .dk_style_basic .dk_plan .dk_head .dk_description {
95
  font-size:14px;
@@ -100,7 +126,13 @@
100
  color:grey;
101
  }
102
 
103
- .dk_5_plans .dk_plan .dk_head .dk_description {font-size:11px; line-height:16px; padding:0px 40px 30px;}
 
 
 
 
 
 
104
 
105
  .dk_style_basic .dk_plan .dk_features {
106
  padding:20px;
@@ -109,18 +141,27 @@
109
  }
110
 
111
  .dk_style_basic .dk_plan .dk_features .dk_feature {
 
112
  padding:6px 16px;
113
  border-bottom: 1px dotted lightgrey;
114
  }
 
 
 
 
 
 
 
115
 
116
  .dk_5_plans .dk_plan .dk_features .dk_feature {
117
  padding:6px 10px;
118
- font-size: 12px;
119
  }
 
120
 
121
  .dk_style_basic .dk_plan .dk_foot {
122
  display:block;
123
- padding:10px 40px;
124
  border-top:whitesmoke solid 2px;
125
  -webkit-border-bottom-left-radius: 8px;
126
  -webkit-border-bottom-right-radius: 8px;
@@ -130,7 +171,7 @@
130
  border-bottom-right-radius: 8px;
131
  text-align:center;
132
  color: white;
133
- font-size: 20px;
134
  text-decoration:none;
135
  font-weight:300;
136
  transition:All 500ms ease;
@@ -138,15 +179,18 @@
138
  -moz-transition:All 500ms ease;
139
  -o-transition:All 500ms ease;
140
  }
 
 
 
 
141
 
142
- .dk_5_plans .dk_plan .dk_foot {padding:4px 30px; font-size:16px;}
 
143
 
144
  .dk_style_basic .dk_plan .dk_foot:hover {opacity:0.8;}
145
 
146
  .dk_style_basic .dk_plan img {box-shadow:0 0 0; border:none;}
147
 
148
- img.dk_recommended {float:right;}
149
-
150
  .dk_style_basic .dk_recommended_plan {position:relative; top:-10px;}
151
 
152
  .dk_style_basic .dk_recommended_plan .dk_title {background:#111;}
@@ -155,6 +199,14 @@ img.dk_recommended {float:right;}
155
  .dk_4_plans .dk_recommended_plan .dk_head .dk_price {font-size:74px;}
156
  .dk_5_plans .dk_recommended_plan .dk_head .dk_price {font-size:67px;}
157
 
 
 
 
 
 
 
 
 
158
  .dk_style_basic .dk_recommended_plan .dk_head {
159
  background: #1e1e1e; /* Old browsers */
160
  background: -moz-linear-gradient(45deg, #1e1e1e 0%, #191919 100%); /* FF3.6+ */
@@ -165,9 +217,17 @@ background: -ms-linear-gradient(45deg, #1e1e1e 0%,#191919 100%); /* IE10+ */
165
  background: linear-gradient(45deg, #1e1e1e 0%,#191919 100%); /* W3C */
166
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e1e1e', endColorstr='#191919',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
167
  }
168
- .dk_style_basic .dk_recommended_plan .dk_foot {font-size:30px; font-weight:300; padding:20px 0px;}
169
- .dk_5_plans .dk_recommended_plan .dk_foot {font-size:22px; font-weight:300; padding:12px 0px;}
170
 
 
 
 
 
 
 
 
 
 
 
171
 
172
  /* TABLETS */
173
 
@@ -175,16 +235,12 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e1e1e', end
175
  .dk_style_basic .dk_plan .dk_head .dk_price {font-size:64px; margin-top:20px;}
176
  }
177
 
178
-
179
  /* MOBILE SCREENS */
180
 
181
  @media only screen and (max-width: 40em) {
182
  .dk_style_basic .dk_recommended_plan .dk_foot {font-size:30px; font-weight:300; padding:20px 0px;}
183
  .dk_style_basic .dk_plan .dk_head .dk_price {font-size:74px;line-height:100px;}
184
- .dk_style_basic .dk_plan .dk_title {
185
- font-size:26px;
186
- line-height:48px;
187
- }
188
  .dk_style_basic .dk_plan .dk_head .dk_subtitle {
189
  font-size:16px;
190
  line-height:20px;
@@ -196,10 +252,8 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e1e1e', end
196
  line-height:20px;
197
  padding:0px 40px 30px;
198
  }
199
- .dk_style_basic .dk_plan .dk_features .dk_feature {
200
- padding:6px 16px;
201
- font-size:14px;
202
- }
203
 
204
  .dk_style_basic .dk_plan .dk_foot {
205
  padding:10px 40px;
@@ -207,7 +261,7 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e1e1e', end
207
  color: white;
208
  font-size: 20px;
209
  }
 
210
  .dk_plans .dk_plan {width:96%;}
211
  .dk_plans .dk_plan {margin:10px 2% 20px !important;}
212
-
213
  }
16
  .dk_2_plans .dk_plan {width:49%; float:left;}
17
  .dk_2_plans .dk_plan_0 {margin-right:2%;}
18
 
 
19
  .dk_style_basic .dk_plan .dk_title img {margin-right:10px; position:relative; top:4px;}
20
  .dk_style_basic .dk_plan .dk_title {
21
  border-bottom:#111 solid 1px;
32
  border-top-right-radius: 8px;
33
  }
34
 
35
+ .dk_style_basic .dk_sm_title .dk_plan .dk_title {font-size:20px;}
36
+ .dk_style_basic .dk_xsm_title .dk_plan .dk_title {font-size:17px;}
37
+
38
  .dk_4_plans .dk_plan .dk_title {font-size:17px;}
39
+ .dk_4_plans .dk_sm_title .dk_plan .dk_title {font-size:15px;}
40
+ .dk_4_plans .dk_xsm_title .dk_plan .dk_title {font-size:13px;}
41
+
42
  .dk_5_plans .dk_plan .dk_title {font-size:15px;}
43
+ .dk_5_plans .dk_sm_title .dk_plan .dk_title {font-size:13px;}
44
+ .dk_5_plans .dk_xsm_title .dk_plan .dk_title {font-size:12px;}
45
 
46
  .dk_style_basic .dk_plan .dk_head .dk_price .dk_currency {
47
  position:relative;
51
  line-height:0px;
52
  }
53
 
54
+ .dk_4_plans .dk_plan .dk_head .dk_price .dk_currency {top:-36px;}
55
+ .dk_5_plans .dk_plan .dk_head .dk_price .dk_currency {top:-26px;}
56
 
57
  .dk_style_basic .dk_plan .dk_head {
58
  border-top:#222 solid 2px;
76
  text-shadow: 1px 2px 7px rgba(0, 0, 0, 0.6);
77
  }
78
 
79
+ .dk_style_basic .dk_sm_price .dk_plan .dk_head .dk_price {font-size:72px;}
80
+ .dk_style_basic .dk_xsm_price .dk_plan .dk_head .dk_price {font-size:66px;}
81
+
82
+ .dk_4_plans .dk_plan .dk_head .dk_price {font-size:69px; line-height:80px;}
83
+ .dk_4_plans .dk_sm_price .dk_plan .dk_head .dk_price {font-size:63px; line-height:75px;}
84
+ .dk_4_plans .dk_xsm_price .dk_plan .dk_head .dk_price {font-size:57px; line-height:70px;}
85
 
86
+ .dk_5_plans .dk_plan .dk_head .dk_price {font-size:59px; line-height:80px;}
87
+ .dk_5_plans .dk_sm_price .dk_plan .dk_head .dk_price {font-size:54px; line-height:80px;}
88
+ .dk_5_plans .dk_xsm_price .dk_plan .dk_head .dk_price {font-size:47px; line-height:80px;}
89
 
90
  .dk_style_basic .dk_plan .dk_head .dk_recurrence {
91
  font-size:13px;
96
  text-align:center;
97
  }
98
 
99
+ .dk_style_basic .dk_sm_recurrence .dk_plan .dk_head .dk_recurrence {font-size:11px; padding:20px 40px 4px;}
100
+
101
  .dk_style_basic .dk_plan .dk_head .dk_subtitle {
102
  font-size:16px;
103
  line-height:20px;
106
  padding:10px 40px 20px;
107
  }
108
 
109
+ .dk_style_basic .dk_sm_subtitle .dk_plan .dk_head .dk_subtitle {font-size:14px;}
110
+ .dk_style_basic .dk_xsm_subtitle .dk_plan .dk_head .dk_subtitle {font-size:12px;}
111
+
112
+ .dk_4_plans .dk_plan .dk_head .dk_subtitle {font-size:16px; line-height:18px; padding:10px 20px 20px;}
113
+ .dk_4_plans .dk_sm_subtitle .dk_plan .dk_head .dk_subtitle {font-size:14px; line-height:17px;}
114
+ .dk_4_plans .dk_xsm_subtitle .dk_plan .dk_head .dk_subtitle {font-size:13px; line-height:16px;}
115
+
116
+ .dk_5_plans .dk_plan .dk_head .dk_subtitle {font-size:15px; line-height:18px; padding:10px 20px 20px;}
117
+ .dk_5_plans .dk_sm_subtitle .dk_plan .dk_head .dk_subtitle {font-size:13px; line-height:17px;}
118
+ .dk_5_plans .dk_xsm_subtitle .dk_plan .dk_head .dk_subtitle {font-size:12px; line-height:16px;}
119
 
120
  .dk_style_basic .dk_plan .dk_head .dk_description {
121
  font-size:14px;
126
  color:grey;
127
  }
128
 
129
+ .dk_style_basic .dk_sm_description .dk_plan .dk_head .dk_description {font-size:12px;}
130
+
131
+ .dk_4_plans .dk_plan .dk_head .dk_description {font-size:13px; line-height:18px; }
132
+ .dk_4_plans .dk_sm_description .dk_plan .dk_head .dk_description {font-size:12px; line-height:17px;}
133
+
134
+ .dk_5_plans .dk_plan .dk_head .dk_description {font-size:12px; line-height:18px;}
135
+ .dk_5_plans .dk_sm_description .dk_plan .dk_head .dk_description {font-size:11px; line-height:17px;}
136
 
137
  .dk_style_basic .dk_plan .dk_features {
138
  padding:20px;
141
  }
142
 
143
  .dk_style_basic .dk_plan .dk_features .dk_feature {
144
+ font-size: 16px;
145
  padding:6px 16px;
146
  border-bottom: 1px dotted lightgrey;
147
  }
148
+ .dk_style_basic .dk_sm_features .dk_plan .dk_features .dk_feature {font-size: 14px;}
149
+
150
+ .dk_4_plans .dk_plan .dk_features .dk_feature {
151
+ padding:6px 10px;
152
+ font-size: 14px;
153
+ }
154
+ .dk_4_plans .dk_sm_features .dk_plan .dk_features .dk_feature {font-size: 12px;}
155
 
156
  .dk_5_plans .dk_plan .dk_features .dk_feature {
157
  padding:6px 10px;
158
+ font-size: 13px;
159
  }
160
+ .dk_5_plans .dk_sm_features .dk_plan .dk_features .dk_feature {font-size: 11px;}
161
 
162
  .dk_style_basic .dk_plan .dk_foot {
163
  display:block;
164
+ padding:10px 30px;
165
  border-top:whitesmoke solid 2px;
166
  -webkit-border-bottom-left-radius: 8px;
167
  -webkit-border-bottom-right-radius: 8px;
171
  border-bottom-right-radius: 8px;
172
  text-align:center;
173
  color: white;
174
+ font-size: 24px;
175
  text-decoration:none;
176
  font-weight:300;
177
  transition:All 500ms ease;
179
  -moz-transition:All 500ms ease;
180
  -o-transition:All 500ms ease;
181
  }
182
+ .dk_style_basic .dk_sm_button .dk_plan .dk_foot {font-size: 19px;}
183
+
184
+ .dk_4_plans .dk_plan .dk_foot {padding:4px 20px; font-size:19px;}
185
+ .dk_4_plans .dk_sm_button .dk_plan .dk_foot {padding:4px 20px; font-size:17px;}
186
 
187
+ .dk_5_plans .dk_plan .dk_foot {padding:4px 20px; font-size:17px;}
188
+ .dk_5_plans .dk_sm_button .dk_plan .dk_foot {font-size:16px;}
189
 
190
  .dk_style_basic .dk_plan .dk_foot:hover {opacity:0.8;}
191
 
192
  .dk_style_basic .dk_plan img {box-shadow:0 0 0; border:none;}
193
 
 
 
194
  .dk_style_basic .dk_recommended_plan {position:relative; top:-10px;}
195
 
196
  .dk_style_basic .dk_recommended_plan .dk_title {background:#111;}
199
  .dk_4_plans .dk_recommended_plan .dk_head .dk_price {font-size:74px;}
200
  .dk_5_plans .dk_recommended_plan .dk_head .dk_price {font-size:67px;}
201
 
202
+ .dk_style_basic .dk_sm_price .dk_recommended_plan .dk_head .dk_price {font-size:93px;}
203
+ .dk_4_plans .dk_sm_price .dk_recommended_plan .dk_head .dk_price {font-size:70px;}
204
+ .dk_5_plans .dk_sm_price .dk_recommended_plan .dk_head .dk_price {font-size:64px;}
205
+
206
+ .dk_style_basic .dk_xsm_price .dk_recommended_plan .dk_head .dk_price {font-size:88px;}
207
+ .dk_4_plans .dk_xsm_price .dk_recommended_plan .dk_head .dk_price {font-size:67px;}
208
+ .dk_5_plans .dk_xsm_price .dk_recommended_plan .dk_head .dk_price {font-size:61px;}
209
+
210
  .dk_style_basic .dk_recommended_plan .dk_head {
211
  background: #1e1e1e; /* Old browsers */
212
  background: -moz-linear-gradient(45deg, #1e1e1e 0%, #191919 100%); /* FF3.6+ */
217
  background: linear-gradient(45deg, #1e1e1e 0%,#191919 100%); /* W3C */
218
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e1e1e', endColorstr='#191919',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
219
  }
 
 
220
 
221
+ .dk_style_basic .dk_recommended_plan .dk_foot {font-size:30px; padding:16px 0px;}
222
+ .dk_style_basic .dk_sm_button .dk_recommended_plan .dk_foot {font-size:30px;}
223
+
224
+ .dk_4_plans .dk_recommended_plan .dk_foot {font-size:22px; font-weight:300; padding:10px 0px;}
225
+ .dk_4_plans .dk_sm_button .dk_recommended_plan .dk_foot {font-size:19px; padding:10px 0px;}
226
+
227
+ .dk_5_plans .dk_recommended_plan .dk_foot {font-size:20px; font-weight:300; padding:10px 0px;}
228
+ .dk_5_plans .dk_sm_button .dk_recommended_plan .dk_foot {font-size:18px; padding:10px 0px;}
229
+
230
+ img.dk_recommended {float:right;}
231
 
232
  /* TABLETS */
233
 
235
  .dk_style_basic .dk_plan .dk_head .dk_price {font-size:64px; margin-top:20px;}
236
  }
237
 
 
238
  /* MOBILE SCREENS */
239
 
240
  @media only screen and (max-width: 40em) {
241
  .dk_style_basic .dk_recommended_plan .dk_foot {font-size:30px; font-weight:300; padding:20px 0px;}
242
  .dk_style_basic .dk_plan .dk_head .dk_price {font-size:74px;line-height:100px;}
243
+ .dk_style_basic .dk_plan .dk_title {font-size:26px;line-height:48px;}
 
 
 
244
  .dk_style_basic .dk_plan .dk_head .dk_subtitle {
245
  font-size:16px;
246
  line-height:20px;
252
  line-height:20px;
253
  padding:0px 40px 30px;
254
  }
255
+
256
+ .dk_style_basic .dk_plan .dk_features .dk_feature {padding:6px 16px;font-size:14px;}
 
 
257
 
258
  .dk_style_basic .dk_plan .dk_foot {
259
  padding:10px 40px;
261
  color: white;
262
  font-size: 20px;
263
  }
264
+
265
  .dk_plans .dk_plan {width:96%;}
266
  .dk_plans .dk_plan {margin:10px 2% 20px !important;}
 
267
  }
css/dk_pricr_custom_style.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .dk_5_plans .dk_plan{width:19.5%;float:left}.dk_5_plans .dk_plan_0{margin-right:.62%}.dk_5_plans .dk_plan_2,.dk_5_plans .dk_plan_3,.dk_5_plans .dk_plan_4{margin-left:.62%}.dk_4_plans .dk_plan{width:24.5%;float:left}.dk_4_plans .dk_plan_0{margin-right:.66%}.dk_4_plans .dk_plan_2,.dk_4_plans .dk_plan_3{margin-left:.66%}.dk_3_plans .dk_plan{width:32%;float:left}.dk_3_plans .dk_plan_0{margin-right:1.9%}.dk_3_plans .dk_plan_2{margin-left:1.9%}.dk_2_plans .dk_plan{width:49%;float:left}.dk_2_plans .dk_plan_0{margin-right:2%}.dk_style_basic .dk_plan .dk_title img{margin-right:10px;position:relative;top:4px}.dk_style_basic .dk_plan .dk_title{border-bottom:#111 solid 1px;background:#222;padding:14px 18px;font-size:26px;color:#fff;line-height:48px;-webkit-border-top-left-radius:8px;-webkit-border-top-right-radius:8px;-moz-border-radius-topleft:8px;-moz-border-radius-topright:8px;border-top-left-radius:8px;border-top-right-radius:8px}.dk_style_basic .dk_sm_title .dk_plan .dk_title{font-size:20px}.dk_4_plans .dk_plan .dk_title,.dk_style_basic .dk_xsm_title .dk_plan .dk_title{font-size:17px}.dk_4_plans .dk_sm_title .dk_plan .dk_title{font-size:15px}.dk_4_plans .dk_xsm_title .dk_plan .dk_title{font-size:13px}.dk_5_plans .dk_plan .dk_title{font-size:15px}.dk_5_plans .dk_sm_title .dk_plan .dk_title{font-size:13px}.dk_5_plans .dk_xsm_title .dk_plan .dk_title{font-size:12px}.dk_style_basic .dk_plan .dk_head .dk_price .dk_currency{position:relative;top:-44px;left:-10px;font-size:35px;line-height:0}.dk_4_plans .dk_plan .dk_head .dk_price .dk_currency{top:-36px}.dk_5_plans .dk_plan .dk_head .dk_price .dk_currency{top:-26px}.dk_style_basic .dk_plan .dk_head{border-top:#222 solid 2px;background:#333;background:-moz-linear-gradient(45deg,#333 0,#1c1c1c 100%);background:-webkit-gradient(linear,left bottom,right top,color-stop(0%,#333),color-stop(100%,#1c1c1c));background:-webkit-linear-gradient(45deg,#333 0,#1c1c1c 100%);background:-o-linear-gradient(45deg,#333 0,#1c1c1c 100%);background:-ms-linear-gradient(45deg,#333 0,#1c1c1c 100%);background:linear-gradient(45deg,#333 0,#1c1c1c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#1c1c1c', GradientType=1)}.dk_style_basic .dk_plan .dk_head .dk_price{padding:6px 10px;font-size:74px;line-height:100px;font-weight:300;text-align:center;color:#fff;text-shadow:1px 2px 7px rgba(0,0,0,.6)}.dk_style_basic .dk_sm_price .dk_plan .dk_head .dk_price{font-size:72px}.dk_style_basic .dk_xsm_price .dk_plan .dk_head .dk_price{font-size:66px}.dk_4_plans .dk_plan .dk_head .dk_price{font-size:69px;line-height:80px}.dk_4_plans .dk_sm_price .dk_plan .dk_head .dk_price{font-size:63px;line-height:75px}.dk_4_plans .dk_xsm_price .dk_plan .dk_head .dk_price{font-size:57px;line-height:70px}.dk_5_plans .dk_plan .dk_head .dk_price{font-size:59px;line-height:80px}.dk_5_plans .dk_sm_price .dk_plan .dk_head .dk_price{font-size:54px;line-height:80px}.dk_5_plans .dk_xsm_price .dk_plan .dk_head .dk_price{font-size:47px;line-height:80px}.dk_style_basic .dk_plan .dk_head .dk_recurrence{font-size:13px;font-weight:300;line-height:18px;padding:20px 40px 10px;color:lightgrey;text-align:center}.dk_style_basic .dk_sm_recurrence .dk_plan .dk_head .dk_recurrence{font-size:11px;padding:20px 40px 4px}.dk_style_basic .dk_plan .dk_head .dk_subtitle{font-size:16px;line-height:20px;font-weight:300;text-align:center;padding:10px 40px 20px}.dk_style_basic .dk_sm_subtitle .dk_plan .dk_head .dk_subtitle{font-size:14px}.dk_style_basic .dk_xsm_subtitle .dk_plan .dk_head .dk_subtitle{font-size:12px}.dk_4_plans .dk_plan .dk_head .dk_subtitle{font-size:16px;line-height:18px;padding:10px 20px 20px}.dk_4_plans .dk_sm_subtitle .dk_plan .dk_head .dk_subtitle{font-size:14px;line-height:17px}.dk_4_plans .dk_xsm_subtitle .dk_plan .dk_head .dk_subtitle{font-size:13px;line-height:16px}.dk_5_plans .dk_plan .dk_head .dk_subtitle{font-size:15px;line-height:18px;padding:10px 20px 20px}.dk_5_plans .dk_sm_subtitle .dk_plan .dk_head .dk_subtitle{font-size:13px;line-height:17px}.dk_5_plans .dk_xsm_subtitle .dk_plan .dk_head .dk_subtitle{font-size:12px;line-height:16px}.dk_style_basic .dk_plan .dk_head .dk_description{font-size:14px;line-height:20px;padding:0 40px 30px;font-weight:300;text-align:center;color:grey}.dk_style_basic .dk_sm_description .dk_plan .dk_head .dk_description{font-size:12px}.dk_4_plans .dk_plan .dk_head .dk_description{font-size:13px;line-height:18px}.dk_4_plans .dk_sm_description .dk_plan .dk_head .dk_description{font-size:12px;line-height:17px}.dk_5_plans .dk_plan .dk_head .dk_description{font-size:12px;line-height:18px}.dk_5_plans .dk_sm_description .dk_plan .dk_head .dk_description{font-size:11px;line-height:17px}.dk_style_basic .dk_plan .dk_features{padding:20px;background:#f5f5f5;text-align:center}.dk_style_basic .dk_plan .dk_features .dk_feature{font-size:16px;padding:6px 16px;border-bottom:1px dotted lightgrey}.dk_style_basic .dk_sm_features .dk_plan .dk_features .dk_feature{font-size:14px}.dk_4_plans .dk_plan .dk_features .dk_feature{padding:6px 10px;font-size:14px}.dk_4_plans .dk_sm_features .dk_plan .dk_features .dk_feature{font-size:12px}.dk_5_plans .dk_plan .dk_features .dk_feature{padding:6px 10px;font-size:13px}.dk_5_plans .dk_sm_features .dk_plan .dk_features .dk_feature{font-size:11px}.dk_style_basic .dk_plan .dk_foot{display:block;padding:10px 30px;border-top:#f5f5f5 solid 2px;-webkit-border-bottom-left-radius:8px;-webkit-border-bottom-right-radius:8px;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;border-bottom-left-radius:8px;border-bottom-right-radius:8px;text-align:center;color:#fff;font-size:24px;text-decoration:none;font-weight:300;transition:All 500ms ease;-webkit-transition:All 500ms ease;-moz-transition:All 500ms ease;-o-transition:All 500ms ease}.dk_style_basic .dk_sm_button .dk_plan .dk_foot{font-size:19px}.dk_4_plans .dk_plan .dk_foot{padding:4px 20px;font-size:19px}.dk_4_plans .dk_sm_button .dk_plan .dk_foot,.dk_5_plans .dk_plan .dk_foot{padding:4px 20px;font-size:17px}.dk_5_plans .dk_sm_button .dk_plan .dk_foot{font-size:16px}.dk_style_basic .dk_plan .dk_foot:hover{opacity:.8}.dk_style_basic .dk_plan img{box-shadow:0 0 0;border:none}.dk_style_basic .dk_recommended_plan{position:relative;top:-10px}.dk_style_basic .dk_recommended_plan .dk_title{background:#111}.dk_style_basic .dk_recommended_plan .dk_head .dk_price{font-size:98px}.dk_4_plans .dk_recommended_plan .dk_head .dk_price{font-size:74px}.dk_5_plans .dk_recommended_plan .dk_head .dk_price{font-size:67px}.dk_style_basic .dk_sm_price .dk_recommended_plan .dk_head .dk_price{font-size:93px}.dk_4_plans .dk_sm_price .dk_recommended_plan .dk_head .dk_price{font-size:70px}.dk_5_plans .dk_sm_price .dk_recommended_plan .dk_head .dk_price{font-size:64px}.dk_style_basic .dk_xsm_price .dk_recommended_plan .dk_head .dk_price{font-size:88px}.dk_4_plans .dk_xsm_price .dk_recommended_plan .dk_head .dk_price{font-size:67px}.dk_5_plans .dk_xsm_price .dk_recommended_plan .dk_head .dk_price{font-size:61px}.dk_style_basic .dk_recommended_plan .dk_head{background:#1e1e1e;background:-moz-linear-gradient(45deg,#1e1e1e 0,#191919 100%);background:-webkit-gradient(linear,left bottom,right top,color-stop(0%,#1e1e1e),color-stop(100%,#191919));background:-webkit-linear-gradient(45deg,#1e1e1e 0,#191919 100%);background:-o-linear-gradient(45deg,#1e1e1e 0,#191919 100%);background:-ms-linear-gradient(45deg,#1e1e1e 0,#191919 100%);background:linear-gradient(45deg,#1e1e1e 0,#191919 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e1e1e', endColorstr='#191919', GradientType=1)}.dk_style_basic .dk_recommended_plan .dk_foot{font-size:30px;padding:16px 0}.dk_style_basic .dk_sm_button .dk_recommended_plan .dk_foot{font-size:30px}.dk_4_plans .dk_recommended_plan .dk_foot{font-size:22px;font-weight:300;padding:10px 0}.dk_4_plans .dk_sm_button .dk_recommended_plan .dk_foot{font-size:19px;padding:10px 0}.dk_5_plans .dk_recommended_plan .dk_foot{font-size:20px;font-weight:300;padding:10px 0}.dk_5_plans .dk_sm_button .dk_recommended_plan .dk_foot{font-size:18px;padding:10px 0}img.dk_recommended{float:right}@media only screen and (min-width:40em) and (max-width:64.063em){.dk_style_basic .dk_plan .dk_head .dk_price{font-size:64px;margin-top:20px}}@media only screen and (max-width:40em){.dk_style_basic .dk_recommended_plan .dk_foot{font-size:30px;font-weight:300;padding:20px 0}.dk_style_basic .dk_plan .dk_head .dk_price{font-size:74px;line-height:100px}.dk_style_basic .dk_plan .dk_title{font-size:26px;line-height:48px}.dk_style_basic .dk_plan .dk_head .dk_subtitle{font-size:16px;line-height:20px;padding:10px 40px 20px}.dk_style_basic .dk_plan .dk_head .dk_description{font-size:14px;line-height:20px;padding:0 40px 30px}.dk_style_basic .dk_plan .dk_features .dk_feature{padding:6px 16px;font-size:14px}.dk_style_basic .dk_plan .dk_foot{padding:10px 40px;text-align:center;color:#fff;font-size:20px}.dk_plans .dk_plan{width:96%;margin:10px 2% 20px!important}}
dk_pricr.php CHANGED
@@ -1,19 +1,19 @@
1
  <?php
2
  /**
3
- * Plugin Name: DK Pricr - Responsive Pricing Table
4
- * Plugin URI: http://wpdarko.com/darko-tools/dk-pricr/
5
  * Description: A responsive, easy and elegant way to present your offer to your visitors. Just create a new pricing table (custom type) and copy-paste the shortcode into your posts/pages. This plugin has been tested with WordPress 4.0. Make sure you check out all our useful themes and plugins at <a href='http://wpdarko.com/'>WPDarko.com</a>.
6
- * Version: 2.0
7
  * Author: WP Darko
8
  * Author URI: http://wpdarko.com/
9
  * License: GPL2
10
  */
11
-
12
 
13
  //adds stylesheet
14
  add_action( 'wp_enqueue_scripts', 'add_pricr_style' );
15
  function add_pricr_style() {
16
- wp_enqueue_style( 'dk_pricr', plugins_url('css/dk_custom_style.css', __FILE__));
17
  }
18
 
19
  add_action( 'init', 'create_dk_pricing_table_type' );
@@ -22,8 +22,8 @@ function create_dk_pricing_table_type() {
22
  register_post_type( 'dk_pricing_table',
23
  array(
24
  'labels' => array(
25
- 'name' => __( 'Pricing Tables' ),
26
- 'singular_name' => __( 'Pricing Table' )
27
  ),
28
  'public' => true,
29
  'has_archive' => false,
@@ -55,7 +55,7 @@ function dkp_metaboxes( array $meta_boxes ) {
55
  //price table single metabox (built with CMB)
56
  $meta_boxes['tables_group'] = array(
57
  'id' => 'tables_group',
58
- 'title' => __( 'Create / Remove your plans', 'cmb' ),
59
  'pages' => array( 'dk_pricing_table', ),
60
  'cmb_styles' => true,
61
  'fields' => array(
@@ -63,9 +63,9 @@ function dkp_metaboxes( array $meta_boxes ) {
63
  'id' => $prefix . 'plan_group',
64
  'type' => 'group',
65
  'options' => array(
66
- 'group_title' => __( 'Plan {#}', 'cmb' ),
67
- 'add_button' => __( 'Add Plan', 'cmb' ),
68
- 'remove_button' => __( 'Remove Plan', 'cmb' ),
69
  'sortable' => true, // beta
70
  ),
71
  'fields' => array(
@@ -168,11 +168,96 @@ function dkp_metaboxes( array $meta_boxes ) {
168
  //price table single metabox (built with CMB)
169
  $meta_boxes['dk_settings_group'] = array(
170
  'id' => $prefix . 'settings_group',
171
- 'title' => __( 'Pricing table settings', 'cmb' ),
172
  'pages' => array( 'dk_pricing_table', ),
173
  'cmb_styles' => true,
174
  'context' => 'side',
175
  'fields' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  array(
177
  'name' => 'Change currency',
178
  'id' => $prefix . 'currency',
@@ -218,7 +303,6 @@ function add_dk_pricing_table_columns($columns) {
218
  }
219
  add_filter('manage_dk_pricing_table_posts_columns' , 'add_dk_pricing_table_columns');
220
 
221
-
222
  //dk_pricing shortcode
223
  function dkp_sc($atts) {
224
  extract(shortcode_atts(array(
@@ -235,8 +319,67 @@ function dkp_sc($atts) {
235
 
236
  $nb_entries = count($entries);;
237
 
238
- //opening dk_pricr
239
- $output .= '<div id="dk_pricr" class="dk_plans dk_'.$nb_entries.'_plans dk_style_basic">';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
 
241
  foreach ($entries as $key => $plans) {
242
 
@@ -347,8 +490,7 @@ function dkp_sc($atts) {
347
  $output .= '<div style="color:' . $check_color . ';" class="dk_feature dk_feature_' . $key . '-' . $small_key . '">';
348
  $output .= $feature;
349
  $output .= '</div>';
350
-
351
-
352
  }
353
  }
354
 
@@ -378,6 +520,10 @@ function dkp_sc($atts) {
378
 
379
  }
380
 
 
 
 
 
381
  $output .= '</div>';
382
 
383
  $output .= '<div style="clear:both;"></div>';
1
  <?php
2
  /**
3
+ * Plugin Name: Responsive Pricing Table
4
+ * Plugin URI: http://wpdarko.com/darko-tools/responsive-pricing-table/
5
  * Description: A responsive, easy and elegant way to present your offer to your visitors. Just create a new pricing table (custom type) and copy-paste the shortcode into your posts/pages. This plugin has been tested with WordPress 4.0. Make sure you check out all our useful themes and plugins at <a href='http://wpdarko.com/'>WPDarko.com</a>.
6
+ * Version: 2.1
7
  * Author: WP Darko
8
  * Author URI: http://wpdarko.com/
9
  * License: GPL2
10
  */
11
+
12
 
13
  //adds stylesheet
14
  add_action( 'wp_enqueue_scripts', 'add_pricr_style' );
15
  function add_pricr_style() {
16
+ wp_enqueue_style( 'dk_pricr', plugins_url('css/dk_pricr_custom_style.min.css', __FILE__));
17
  }
18
 
19
  add_action( 'init', 'create_dk_pricing_table_type' );
22
  register_post_type( 'dk_pricing_table',
23
  array(
24
  'labels' => array(
25
+ 'name' => __( 'Pricing Tables', 'dkp' ),
26
+ 'singular_name' => __( 'Pricing Table', 'dkp' )
27
  ),
28
  'public' => true,
29
  'has_archive' => false,
55
  //price table single metabox (built with CMB)
56
  $meta_boxes['tables_group'] = array(
57
  'id' => 'tables_group',
58
+ 'title' => __( 'Create / Remove your plans', 'dkp' ),
59
  'pages' => array( 'dk_pricing_table', ),
60
  'cmb_styles' => true,
61
  'fields' => array(
63
  'id' => $prefix . 'plan_group',
64
  'type' => 'group',
65
  'options' => array(
66
+ 'group_title' => __( 'Plan {#}', 'dkp' ),
67
+ 'add_button' => __( 'Add Plan', 'dkp' ),
68
+ 'remove_button' => __( 'Remove Plan', 'dkp' ),
69
  'sortable' => true, // beta
70
  ),
71
  'fields' => array(
168
  //price table single metabox (built with CMB)
169
  $meta_boxes['dk_settings_group'] = array(
170
  'id' => $prefix . 'settings_group',
171
+ 'title' => __( 'Pricing table settings', 'dkp' ),
172
  'pages' => array( 'dk_pricing_table', ),
173
  'cmb_styles' => true,
174
  'context' => 'side',
175
  'fields' => array(
176
+ array(
177
+ 'name' => '&#8212; Font sizes',
178
+ 'desc' => 'change the size of the font for each elements (just in case some word doesn\'t fit).',
179
+ 'id' => $prefix . 'font_sizes_desc',
180
+ 'type' => 'title',
181
+ ),
182
+ array(
183
+ 'name' => 'Title font size',
184
+ 'id' => $prefix . 'title_fontsize',
185
+ 'type' => 'select',
186
+ 'options' => array(
187
+ 'tiny' => __( 'Tiny', 'dkp' ),
188
+ 'small' => __( 'Small', 'dkp' ),
189
+ 'normal' => __( 'Normal', 'dkp' ),
190
+ ),
191
+ 'default' => 'normal',
192
+ ),
193
+ array(
194
+ 'name' => 'Subtitle font size',
195
+ 'id' => $prefix . 'subtitle_fontsize',
196
+ 'type' => 'select',
197
+ 'options' => array(
198
+ 'tiny' => __( 'Tiny', 'dkp' ),
199
+ 'small' => __( 'Small', 'dkp' ),
200
+ 'normal' => __( 'Normal', 'dkp' ),
201
+ ),
202
+ 'default' => 'normal',
203
+ ),
204
+ array(
205
+ 'name' => 'Description font size',
206
+ 'id' => $prefix . 'description_fontsize',
207
+ 'type' => 'select',
208
+ 'options' => array(
209
+ 'small' => __( 'Small', 'dkp' ),
210
+ 'normal' => __( 'Normal', 'dkp' ),
211
+ ),
212
+ 'default' => 'normal',
213
+ ),
214
+ array(
215
+ 'name' => 'Price font size',
216
+ 'id' => $prefix . 'price_fontsize',
217
+ 'type' => 'select',
218
+ 'options' => array(
219
+ 'tiny' => __( 'Tiny', 'dkp' ),
220
+ 'small' => __( 'Small', 'dkp' ),
221
+ 'normal' => __( 'Normal', 'dkp' ),
222
+ ),
223
+ 'default' => 'normal',
224
+ ),
225
+ array(
226
+ 'name' => 'Recurrence font size',
227
+ 'id' => $prefix . 'recurrence_fontsize',
228
+ 'type' => 'select',
229
+ 'options' => array(
230
+ 'small' => __( 'Small', 'dkp' ),
231
+ 'normal' => __( 'Normal', 'dkp' ),
232
+ ),
233
+ 'default' => 'normal',
234
+ ),
235
+ array(
236
+ 'name' => 'Features font size',
237
+ 'id' => $prefix . 'features_fontsize',
238
+ 'type' => 'select',
239
+ 'options' => array(
240
+ 'small' => __( 'Small', 'dkp' ),
241
+ 'normal' => __( 'Normal', 'dkp' ),
242
+ ),
243
+ 'default' => 'normal',
244
+ ),
245
+ array(
246
+ 'name' => 'Button font size',
247
+ 'id' => $prefix . 'button_fontsize',
248
+ 'type' => 'select',
249
+ 'options' => array(
250
+ 'small' => __( 'Small', 'dkp' ),
251
+ 'normal' => __( 'Normal', 'dkp' ),
252
+ ),
253
+ 'default' => 'normal',
254
+ ),
255
+ array(
256
+ 'name' => 'Other settings',
257
+ 'desc' => 'these are a few settings that you might want to change.',
258
+ 'id' => $prefix . 'other_settings_desc',
259
+ 'type' => 'title',
260
+ ),
261
  array(
262
  'name' => 'Change currency',
263
  'id' => $prefix . 'currency',
303
  }
304
  add_filter('manage_dk_pricing_table_posts_columns' , 'add_dk_pricing_table_columns');
305
 
 
306
  //dk_pricing shortcode
307
  function dkp_sc($atts) {
308
  extract(shortcode_atts(array(
319
 
320
  $nb_entries = count($entries);;
321
 
322
+ //get font sizes
323
+ $title_fontsize = get_post_meta( $post->ID, '_dkp_title_fontsize', true );
324
+ if ($title_fontsize == 'small') {
325
+ $title_fs_class = ' dk_sm_title';
326
+ } else if ($title_fontsize == 'tiny') {
327
+ $title_fs_class = ' dk_xsm_title';
328
+ } else {
329
+ $title_fs_class = '';
330
+ }
331
+
332
+ $subtitle_fontsize = get_post_meta( $post->ID, '_dkp_subtitle_fontsize', true );
333
+ if ($subtitle_fontsize == 'small') {
334
+ $subtitle_fs_class = ' dk_sm_subtitle';
335
+ } else if ($subtitle_fontsize == 'tiny') {
336
+ $subtitle_fs_class = ' dk_xsm_subtitle';
337
+ } else {
338
+ $subtitle_fs_class = '';
339
+ }
340
+
341
+ $description_fontsize = get_post_meta( $post->ID, '_dkp_description_fontsize', true );
342
+ if ($description_fontsize == 'small') {
343
+ $description_fs_class = ' dk_sm_description';
344
+ } else {
345
+ $description_fs_class = '';
346
+ }
347
+
348
+ $price_fontsize = get_post_meta( $post->ID, '_dkp_price_fontsize', true );
349
+ if ($price_fontsize == 'small') {
350
+ $price_fs_class = ' dk_sm_price';
351
+ } else if ($price_fontsize == 'tiny') {
352
+ $price_fs_class = ' dk_xsm_price';
353
+ } else {
354
+ $price_fs_class = '';
355
+ }
356
+
357
+ $recurrence_fontsize = get_post_meta( $post->ID, '_dkp_recurrence_fontsize', true );
358
+ if ($recurrence_fontsize == 'small') {
359
+ $recurrence_fs_class = ' dk_sm_recurrence';
360
+ } else {
361
+ $recurrence_fs_class = '';
362
+ }
363
+
364
+ $features_fontsize = get_post_meta( $post->ID, '_dkp_features_fontsize', true );
365
+ if ($features_fontsize == 'small') {
366
+ $features_fs_class = ' dk_sm_features';
367
+ } else {
368
+ $features_fs_class = '';
369
+ }
370
+
371
+ $button_fontsize = get_post_meta( $post->ID, '_dkp_button_fontsize', true );
372
+ if ($button_fontsize == 'small') {
373
+ $button_fs_class = ' dk_sm_button';
374
+ } else {
375
+ $button_fs_class = '';
376
+ }
377
+
378
+ //opening dk_pricr container
379
+ $output .= '<div id="dk_pricr" class="dk_plans dk_'.$nb_entries .'_plans dk_style_basic">';
380
+
381
+ //opening dk_pricr inner
382
+ $output .= '<div class="'. $title_fs_class . $subtitle_fs_class . $description_fs_class . $price_fs_class . $recurrence_fs_class . $features_fs_class. $button_fs_class .'">';
383
 
384
  foreach ($entries as $key => $plans) {
385
 
490
  $output .= '<div style="color:' . $check_color . ';" class="dk_feature dk_feature_' . $key . '-' . $small_key . '">';
491
  $output .= $feature;
492
  $output .= '</div>';
493
+
 
494
  }
495
  }
496
 
520
 
521
  }
522
 
523
+ //closing dk_inner
524
+ $output .= '</div>';
525
+
526
+ //closing dk_container
527
  $output .= '</div>';
528
 
529
  $output .= '<div style="clear:both;"></div>';
readme.txt CHANGED
@@ -6,36 +6,54 @@ Stable tag: trunk
6
  License: GPL2
7
  License URI: http://www.gnu.org/licenses/gpl.html
8
 
9
- A responsive and elegant way to present your offer to your visitors. Create your new pricing table (custom type) and copy-paste the shortcode.
10
 
11
  == Description ==
 
12
 
13
- A responsive, easy and elegant way to present your offer to your visitors. Just create a new pricing table (custom type) and copy-paste the shortcode into your posts/pages.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  = Usage =
16
- Go to [the plugin's page](http://wpdarko.com/darko-tools/dk-pricr/) for information on how to use it.
17
 
18
  = Support =
19
- Find help in [our forums](http://wpdarko.com/forums/forum/plugins/dk-pricr/) for this plugin (we’ll answer you fast, promise).
20
 
21
  == Installation ==
22
 
23
  = Installation =
24
  1. In your WordPress admin panel, go to Plugins > New Plugin
25
  2. Find our Responsive Pricing Table plugin by WP Darko and click Install now
26
- 3. Alternatively, download the plugin and upload the contents of dk-pricr-responsive-pricing-table.zip to your plugins directory, which usually is /wp-content/plugins/
27
  4. Activate the plugin
28
 
29
  = Usage =
30
- Go to [the plugin's page](http://wpdarko.com/darko-tools/dk-pricr/) for information on how to use it.
31
 
32
  == Frequently Asked Questions ==
33
 
34
  = Example & Support =
35
- Go to [the plugin's page](http://wpdarko.com/darko-tools/dk-pricr/) for information on how to use this plugin.
36
 
37
  = Where can I get help with this plugin? =
38
- Find help in [our forums](http://wpdarko.com/forums/forum/plugins/dk-pricr/) for this plugin (we’ll answer you fast, promise).
39
 
40
  == Screenshots ==
41
  1. Displaying the pricing table (front view)
@@ -46,6 +64,9 @@ Find help in [our forums](http://wpdarko.com/forums/forum/plugins/dk-pricr/) for
46
 
47
 
48
  == Changelog ==
 
 
 
49
  = 2.0 =
50
  * Use custom post type feature to create pricing tables
51
  * Plans can be set to Free
6
  License: GPL2
7
  License URI: http://www.gnu.org/licenses/gpl.html
8
 
9
+ A responsive and elegant way to present your offer to your visitors. Create a new pricing table now and copy-paste the shortcode anywhere.
10
 
11
  == Description ==
12
+ This plugin creates a new tab in the admin panel which allows you to create pricing tables for your website the easy way. You can quickly add features to your different plans, choose a color (as well as many other options) and display your price table anywhere with a simple shortcode. What you see is what you get, and it’s totally free.
13
 
14
+ = Rate and review =
15
+ We love to hear from our users, please take the time to rate this plugin and tell us what you think about it!
16
+
17
+ = Author =
18
+ [WP Darko](http://wpdarko.com/) is one more great place to find exclusive WordPress themes & plugins.
19
+
20
+
21
+ = Available fields/options =
22
+ * Title
23
+ * Subtitle
24
+ * Description
25
+ * Price (Duh!)
26
+ * Currency
27
+ * Recurrence (“one-time fee”, “per month”)
28
+ * Features (as many as you want)
29
+ * Button URL and text
30
+ * Color
31
+ * Font size
32
 
33
  = Usage =
34
+ Go to [the plugin's page](http://wpdarko.com/darko-tools/responsive-pricing-table/) if you need more information on how to use this plugin.
35
 
36
  = Support =
37
+ Find help in [our forums](http://wpdarko.com/forums/forum/plugins/responsive-pricing-table/) for this plugin (we’ll answer you fast, promise).
38
 
39
  == Installation ==
40
 
41
  = Installation =
42
  1. In your WordPress admin panel, go to Plugins > New Plugin
43
  2. Find our Responsive Pricing Table plugin by WP Darko and click Install now
44
+ 3. Alternatively, download the plugin and upload the contents of responsive-pricing-table.zip to your plugins directory, which usually is /wp-content/plugins/
45
  4. Activate the plugin
46
 
47
  = Usage =
48
+ Go to [the plugin's page](http://wpdarko.com/darko-tools/responsive-pricing-table/) for information on how to use it.
49
 
50
  == Frequently Asked Questions ==
51
 
52
  = Example & Support =
53
+ Go to [the plugin's page](http://wpdarko.com/darko-tools/responsive-pricing-table/) for information on how to use this plugin.
54
 
55
  = Where can I get help with this plugin? =
56
+ Find help in [our forums](http://wpdarko.com/forums/forum/plugins/responsive-pricing-table/) for this plugin (we’ll answer you fast, promise).
57
 
58
  == Screenshots ==
59
  1. Displaying the pricing table (front view)
64
 
65
 
66
  == Changelog ==
67
+ = 2.1 =
68
+ * Font sizes can be changed in case some word doesn’t fit
69
+
70
  = 2.0 =
71
  * Use custom post type feature to create pricing tables
72
  * Plans can be set to Free