CMP – Coming Soon & Maintenance Plugin by NiteoThemes - Version 3.8.3

Version Description

Download this release

Release Info

Developer niteo
Plugin Icon 128x128 CMP – Coming Soon & Maintenance Plugin by NiteoThemes
Version 3.8.3
Comparing to
See all releases

Code changes from version 3.8.2 to 3.8.3

inc/class-cmp-render_html.php CHANGED
@@ -358,30 +358,28 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
358
  'nonce' => wp_create_nonce( 'cn_save_cases' ),
359
  'hideEffect' => $closure_option($cookie_notice)['general']['hide_effect'],
360
  'position' => $closure_option($cookie_notice)['general']['position'],
361
- 'onScroll' => (int) $closure_option($cookie_notice)['general']['on_scroll'],
362
- 'onScrollOffset' => (int) $closure_option($cookie_notice)['general']['on_scroll_offset'],
363
- 'onClick' => (int) $closure_option($cookie_notice)['general']['on_click'],
364
  'cookieName' => 'cookie_notice_accepted',
365
  'cookieTime' => $closure_times($cookie_notice)[$closure_option($cookie_notice)['general']['time']][1],
366
  'cookieTimeRejected' => $closure_times($cookie_notice)[$closure_option($cookie_notice)['general']['time_rejected']][1],
367
  'cookiePath' => ( defined( 'COOKIEPATH' ) ? (string) COOKIEPATH : '' ),
368
  'cookieDomain' => ( defined( 'COOKIE_DOMAIN' ) ? (string) COOKIE_DOMAIN : '' ),
369
- 'redirection' => (int) $closure_option($cookie_notice)['general']['redirection'],
370
- 'cache' => (int) ( defined( 'WP_CACHE' ) && WP_CACHE ),
371
- 'refuse' => (int) $closure_option($cookie_notice)['general']['refuse_opt'],
372
- 'revokeCookies' => (int) $closure_option($cookie_notice)['general']['revoke_cookies'],
373
  'revokeCookiesOpt' => $closure_option($cookie_notice)['general']['revoke_cookies_opt'],
374
- 'secure' => (int) is_ssl(),
375
- 'coronabarActive' => (int) $closure_option($cookie_notice)['general']['coronabar'],
376
  ); ?>
377
 
378
  <link rel='stylesheet' id='cookie-notice-front-css' href='<?php echo plugins_url();?>/cookie-notice/css/front.min.css' media='all' />
379
 
380
- <script src='<?php echo plugins_url();?>/cookie-notice/js/front.min.js'></script>
381
 
382
- <script>
383
- var cnArgs = <?php echo json_encode( $cn_options );?>
384
- </script>
385
  <?php
386
 
387
  }
358
  'nonce' => wp_create_nonce( 'cn_save_cases' ),
359
  'hideEffect' => $closure_option($cookie_notice)['general']['hide_effect'],
360
  'position' => $closure_option($cookie_notice)['general']['position'],
361
+ 'onScroll' => (string) $closure_option($cookie_notice)['general']['on_scroll'],
362
+ 'onScrollOffset' => (string) $closure_option($cookie_notice)['general']['on_scroll_offset'],
363
+ 'onClick' => (string) $closure_option($cookie_notice)['general']['on_click'],
364
  'cookieName' => 'cookie_notice_accepted',
365
  'cookieTime' => $closure_times($cookie_notice)[$closure_option($cookie_notice)['general']['time']][1],
366
  'cookieTimeRejected' => $closure_times($cookie_notice)[$closure_option($cookie_notice)['general']['time_rejected']][1],
367
  'cookiePath' => ( defined( 'COOKIEPATH' ) ? (string) COOKIEPATH : '' ),
368
  'cookieDomain' => ( defined( 'COOKIE_DOMAIN' ) ? (string) COOKIE_DOMAIN : '' ),
369
+ 'redirection' => (string) $closure_option($cookie_notice)['general']['redirection'],
370
+ 'cache' => (string) ( defined( 'WP_CACHE' ) && WP_CACHE ),
371
+ 'refuse' => (string) $closure_option($cookie_notice)['general']['refuse_opt'],
372
+ 'revokeCookies' => (string) $closure_option($cookie_notice)['general']['revoke_cookies'],
373
  'revokeCookiesOpt' => $closure_option($cookie_notice)['general']['revoke_cookies_opt'],
374
+ 'secure' => (string) is_ssl(),
375
+ 'coronabarActive' => (string) $closure_option($cookie_notice)['general']['coronabar'],
376
  ); ?>
377
 
378
  <link rel='stylesheet' id='cookie-notice-front-css' href='<?php echo plugins_url();?>/cookie-notice/css/front.min.css' media='all' />
379
 
380
+ <script src='<?php echo plugins_url();?>/cookie-notice/js/front.min.js?ver=1.3.2'></script>
381
 
382
+ <script>var cnArgs = <?php echo json_encode( $cn_options );?></script>
 
 
383
  <?php
384
 
385
  }
inc/render/custom-css.php CHANGED
@@ -155,6 +155,12 @@ if ( get_option('niteoCS_counter_date' ) < time() && $countdown_action === 'hide
155
  <?php
156
  }
157
 
 
 
 
 
 
 
158
 
159
  $css = ob_get_clean();
160
 
155
  <?php
156
  }
157
 
158
+ // Plugin Name: Cookie Notice
159
+ if ( class_exists('Cookie_Notice') && get_option('cmp_cookie_notice_comp', '1') === '1' ) { ?>
160
+ <style>#cookie-notice.cookie-notice-hidden {display:none}</style>
161
+ <?php
162
+ }
163
+
164
 
165
  $css = ob_get_clean();
166
 
inc/render/footer.php CHANGED
@@ -16,7 +16,6 @@ if ( class_exists('InsertHeadersAndFooters') ) {
16
  if ( class_exists('Cookie_Notice') && get_option('cmp_cookie_notice_comp', '1') === '1' ) {
17
  $cookie_notice = Cookie_Notice();
18
  $cookie_notice->add_cookie_notice();
19
-
20
  }
21
 
22
  // Plugin Name: SimpleAnalytics
16
  if ( class_exists('Cookie_Notice') && get_option('cmp_cookie_notice_comp', '1') === '1' ) {
17
  $cookie_notice = Cookie_Notice();
18
  $cookie_notice->add_cookie_notice();
 
19
  }
20
 
21
  // Plugin Name: SimpleAnalytics
js/typography.js CHANGED
@@ -1,127 +1,127 @@
1
- jQuery(document).ready(function($){
2
 
3
  headingVariant = jQuery('.cmp-coming-soon-maintenance .headings-google-font-variant').val();
4
  contentVariant = jQuery('.cmp-coming-soon-maintenance .content-google-font-variant').val();
5
 
6
- fontVariant = function( variant ) {
7
- switch(variant) {
8
- case '100':
9
- return 'Thin 100';
10
- break;
11
- case '100italic':
12
- return 'Thin 100 Italic';
13
- break;
14
- case '200':
15
- return 'Extra-light 200';
16
- break;
17
- case '200italic':
18
- return 'Extra-light 200 Italic';
19
- break;
20
- case '300':
21
- return 'Light 300';
22
- break;
23
- case '300italic':
24
- return 'Light 300 Italic';
25
- break;
26
  case '400':
27
  case 'regular':
28
- return 'Regular 400';
29
- break;
30
  case '400italic':
31
  case 'italic':
32
- return 'Regular 400 Italic';
33
- break;
34
- case '500':
35
- return 'Medium 500';
36
- break;
37
- case '500italic':
38
- return 'Meidum 500 Italic';
39
- break;
40
- case '600':
41
- return 'Semi-Bold 600';
42
- break;
43
- case '600italic':
44
- return 'Semi-Bold 600 Italic';
45
- break;
46
- case '700':
47
- return 'Bold 700';
48
- break;
49
- case '700italic':
50
- return 'Bold 700 Italic';
51
- break;
52
- case '800':
53
- return 'Extra-Bold 800';
54
- break;
55
- case '800italic':
56
- return 'Extra-Bold Italic';
57
- break;
58
- case '900':
59
- return 'Black 900';
60
- break;
61
- case '900italic':
62
- return 'Black 900 Italic';
63
- break;
64
  case 'Not Applicable':
65
- return 'Not Applicable';
66
- break;
67
  default:
68
- break;
69
  }
70
  }
71
 
72
- loadCustomFont = function( fontFace, type ) {
73
 
74
  newFontFace = Array.isArray(fontFace) ? fontFace[0] : fontFace;
75
 
76
  for (let index = 0; index < newFontFace['urls'].length; index++) {
77
- if ( newFontFace['urls'][index].includes('woff') ) {
78
  var url = newFontFace['urls'][index];
79
  }
80
  }
81
 
82
- var junction_font = new FontFace( newFontFace['id'], 'url('+url+')');
83
- var preview = document.getElementById(type+'-example');
84
  var logo = document.getElementById('niteoCS-text-logo');
85
-
86
- junction_font.load().then(function(loaded_face) {
87
  document.fonts.add(loaded_face);
88
- preview.style.fontFamily = '"'+ loaded_face['family'] +'"';
89
- type === 'heading' ? logo.style.fontFamily = '"'+ loaded_face['family'] +'"' : null;
90
 
91
- }).catch(function(error) {
92
  console.log('Cannot load custom font: ' + error)
93
  });
94
  }
95
 
96
- var heading_font = fonts.google.filter(function (element) {
97
- return element.id === jQuery('.cmp-coming-soon-maintenance .headings-google-font option:selected').val();
98
  });
99
 
100
- var content_font = fonts.google.filter(function (element) {
101
- return element.id === jQuery('.cmp-coming-soon-maintenance .content-google-font option:selected').val();
102
  });
103
 
104
  if (heading_font.length) {
105
- var heading_font_variant = jQuery.map( heading_font[0].variants, function(obj) {
106
  return { id: obj, text: fontVariant(obj) };
107
  });
108
  }
109
 
110
  if (content_font.length) {
111
- var content_font_variant = jQuery.map( content_font[0].variants, function(obj) {
112
  return { id: obj, text: fontVariant(obj) };
113
  });
114
  }
115
 
116
  // ini select2
117
- $HeadingFont = jQuery( '.cmp-coming-soon-maintenance .headings-google-font' ).select2({
118
  data: fonts.google,
119
  width: '100%',
120
  // templateResult: formatFont
121
  });
122
 
123
  // ini select2
124
- $contentFont = jQuery( '.cmp-coming-soon-maintenance .content-google-font' ).select2({
125
  data: fonts.google,
126
  width: '100%',
127
  });
@@ -138,75 +138,75 @@ jQuery(document).ready(function($){
138
  width: '100%',
139
  })
140
 
141
- if ( heading_font.length ) {
142
 
143
- if ( heading_font[0]['variants'][0] == 'Not Applicable' ) {
144
  loadCustomFont(heading_font, 'heading');
145
  } else {
146
 
147
  // change fonts families upon a load
148
  WebFont.load({
149
- google: {
150
- families: [
151
- heading_font[0]['id']+':'+['variants'].join(',')
152
- ]
153
- },
154
- active: function() {
155
 
156
- if ( jQuery.isNumeric(headingVariant) ) {
157
- jQuery('#heading-example').css('font-weight', headingVariant ).css('font-style', 'normal' );
158
 
159
- } else if ( headingVariant == 'regular' ) {
160
- jQuery('#heading-example').css('font-weight', '400' ).css('font-style', 'normal' );
161
 
162
- } else if ( headingVariant == 'italic' ) {
163
- jQuery('#heading-example').css('font-style', 'italic' ).css('font-weight', '400' );
164
 
165
- } else {
166
- fontweight = parseInt(headingVariant, 10);
167
- jQuery('#heading-example').css('font-weight', fontweight ).css('font-style', 'italic' );
168
- }
169
 
170
- jQuery('#heading-example, #niteoCS-text-logo').css('font-family', heading_font[0]['id'] );
171
-
172
- }
173
- });
174
  }
175
  }
176
 
177
- if ( content_font.length ) {
178
 
179
- if ( content_font[0]['variants'][0] == 'Not Applicable' ) {
180
  loadCustomFont(content_font, 'content');
181
-
182
  } else {
183
  // change fonts families upon a load
184
  WebFont.load({
185
- google: {
186
- families: [
187
- content_font[0]['id']+':'+['variants'].join(',')
188
- ]
189
- },
190
- active: function() {
191
-
192
- if ( jQuery.isNumeric(contentVariant) ) {
193
- jQuery('#content-example').css('font-weight', contentVariant ).css('font-style', 'normal' );
194
-
195
- } else if ( contentVariant == 'regular' ) {
196
- jQuery('#content-example').css('font-weight', '400' ).css('font-style', 'normal' );
197
-
198
- } else if ( contentVariant == 'italic' ) {
199
- jQuery('#content-example').css('font-style', 'italic' ).css('font-weight', '400' );
200
-
201
- } else {
202
- fontweight = parseInt(contentVariant, 10);
203
- jQuery('#content-example').css('font-weight', fontweight ).css('font-style', 'italic' );
 
 
 
 
204
  }
205
-
206
- jQuery('#content-example').css('font-family', content_font[0]['id'] );
207
-
208
- }
209
- });
210
  }
211
  }
212
 
@@ -215,33 +215,35 @@ jQuery(document).ready(function($){
215
  var data = $(this).data().data;
216
  var type = data.element.parentNode.dataset.type;
217
 
218
- if ( type !== 'content' && type !== 'heading') {
219
  return
220
  }
221
 
222
- if ( data.variants[0] === 'Not Applicable' ) {
223
  loadCustomFont(data, type);
224
 
225
  } else {
226
  WebFont.load({
227
  google: {
228
- families: [ data.text ]
 
 
229
  },
230
- active: function() {
231
- jQuery('#'+type+'-example, #niteoCS-text-logo').css('font-family', data.text );
232
  },
233
- });
234
  }
235
-
236
 
237
  });
238
 
239
  // change preview fonts on select2 selection
240
- $HeadingFont.on('select2:select', function(e){
241
  // get current variant value
242
  var selected = $HeadingFontVariant.select2('data');
243
 
244
- var heading_font_variant = jQuery.map( e.params.data.variants, function(obj) {
245
  return { id: obj, text: fontVariant(obj) };
246
  });
247
 
@@ -253,9 +255,9 @@ jQuery(document).ready(function($){
253
  });
254
 
255
  // set same variant as before selection if variant is in array, else set regular
256
- if ( selected[0].id ) {
257
- if ( jQuery.inArray(selected[0].id, e.params.data.variants ) == '-1' ) {
258
- jQuery('#heading-example, #niteoCS-text-logo').css('font-weight', '400' ).css('font-style', 'normal' );
259
  } else {
260
  $HeadingFontVariant.val(selected[0].id).trigger('change.select2');
261
  }
@@ -264,33 +266,33 @@ jQuery(document).ready(function($){
264
  });
265
 
266
 
267
- $HeadingFontVariant.on('select2:select', function(e){
268
 
269
  headingVariant = e.params.data.id;
270
 
271
- if ( jQuery.isNumeric(headingVariant) ) {
272
- jQuery('#heading-example, #niteoCS-text-logo').css('font-weight', headingVariant ).css('font-style', 'normal' );
273
 
274
- } else if ( headingVariant == 'regular' ) {
275
- jQuery('#heading-example, #niteoCS-text-logo').css('font-weight', '400' ).css('font-style', 'normal' );
276
 
277
- } else if ( headingVariant == 'italic' ) {
278
- jQuery('#heading-example, #niteoCS-text-logo').css('font-style', 'italic' ).css('font-weight', '400' );
279
 
280
  } else {
281
  fontweight = parseInt(headingVariant, 10);
282
- jQuery('#heading-example, #niteoCS-text-logo').css('font-weight', fontweight ).css('font-style', 'italic' );
283
  }
284
-
285
  });
286
 
287
 
288
  // // change content preview fonts on font select
289
- $contentFont.on('select2:select', function(e){
290
  // get current variant value
291
  var selected = $contentFontVariant.select2('data');
292
 
293
- var content_font_variant = jQuery.map( e.params.data.variants, function(obj) {
294
  return { id: obj, text: fontVariant(obj) };
295
  });
296
 
@@ -302,10 +304,10 @@ jQuery(document).ready(function($){
302
  });
303
 
304
  // set same variant as before selection if variant is in array, else set regular
305
- if ( selected[0].id ) {
306
 
307
- if ( jQuery.inArray(selected[0].id, e.params.data.variants ) == '-1' ) {
308
- jQuery('#content-example').css('font-weight', '400' ).css('font-style', 'normal' );
309
  } else {
310
  $contentFontVariant.val(selected[0].id).trigger('change.select2');
311
  }
@@ -313,24 +315,24 @@ jQuery(document).ready(function($){
313
 
314
  });
315
 
316
- $contentFontVariant.on('select2:select', function(e){
317
 
318
  contentVariant = e.params.data.id;
319
 
320
- if ( jQuery.isNumeric(contentVariant) ) {
321
- jQuery('#content-example').css('font-weight', contentVariant ).css('font-style', 'normal' );
322
 
323
- } else if ( contentVariant == 'regular' ) {
324
- jQuery('#content-example').css('font-weight', '400' ).css('font-style', 'normal' );
325
 
326
- } else if ( contentVariant == 'italic' ) {
327
- jQuery('#content-example').css('font-style', 'italic' ).css('font-weight', '400' );
328
 
329
  } else {
330
  fontweight = parseInt(contentVariant, 10);
331
- jQuery('#content-example').css('font-weight', fontweight ).css('font-style', 'italic' );
332
  }
333
-
334
  });
335
 
336
  jQuery('.cmp-coming-soon-maintenance .font-selector input[type=range]').on('input', function () {
@@ -342,10 +344,10 @@ jQuery(document).ready(function($){
342
  jQuery(this).parent().find('span').html(value);
343
 
344
  // add px if css requires it
345
- value = (css == 'line-height') ? value : value+'px';
346
 
347
  // change example css
348
- if ( type == 'heading' ) {
349
  jQuery('#heading-example').css(css, value);
350
 
351
  } else {
@@ -356,17 +358,17 @@ jQuery(document).ready(function($){
356
 
357
 
358
  // Upload custom font
359
- jQuery('#cmp-install-font').click(function(e) {
360
  e.preventDefault();
361
 
362
  var file_frame;
363
 
364
- $( document.body ).on('click', '#cmp-install-font', function(event) {
365
  event.preventDefault();
366
 
367
  var security = $(this).data('security');
368
 
369
- var payload = {
370
  action: 'upload_font',
371
  files: []
372
  }
@@ -376,9 +378,9 @@ jQuery(document).ready(function($){
376
  security: security,
377
  payload: JSON.stringify(payload)
378
  };
379
-
380
  // If the media frame already exists, reopen it.
381
- if ( file_frame ) {
382
  file_frame.open();
383
  return;
384
  }
@@ -389,29 +391,29 @@ jQuery(document).ready(function($){
389
  });
390
 
391
  // When a file is selected in the media frame...
392
- file_frame.on( 'select', function() {
393
  // Get selected attachment
394
  var attachment = file_frame.state().get('selection').toJSON();
395
 
396
- if ( attachment.length ) {
397
  payload.action = 'upload_font';
398
  // create unique array of font names
399
  var titles = [];
400
 
401
- jQuery(attachment).each(function(i, value ) {
402
- if ( titles.indexOf(value.title) < 0 ) {
403
  titles.push(value.title);
404
  }
405
  });
406
 
407
  // loop trough Font titles
408
- jQuery(titles).each(function(i, title) {
409
 
410
  var urls = [];
411
  var ids = [];
412
  // get all urls of same font title
413
- jQuery(attachment).each(function(i, value ) {
414
- if ( value.title === title ) {
415
  urls.push(value.url);
416
  ids.push(value.id);
417
  }
@@ -429,7 +431,7 @@ jQuery(document).ready(function($){
429
 
430
  data.payload = JSON.stringify(payload);
431
 
432
- $.post(ajaxurl, data, function(response) {
433
  for (var i = 0; i < payload.files.length; ++i) {
434
  fonts.google.unshift(payload.files[i])
435
  }
1
+ jQuery(document).ready(function ($) {
2
 
3
  headingVariant = jQuery('.cmp-coming-soon-maintenance .headings-google-font-variant').val();
4
  contentVariant = jQuery('.cmp-coming-soon-maintenance .content-google-font-variant').val();
5
 
6
+ fontVariant = function (variant) {
7
+ switch (variant) {
8
+ case '100':
9
+ return 'Thin 100';
10
+ break;
11
+ case '100italic':
12
+ return 'Thin 100 Italic';
13
+ break;
14
+ case '200':
15
+ return 'Extra-light 200';
16
+ break;
17
+ case '200italic':
18
+ return 'Extra-light 200 Italic';
19
+ break;
20
+ case '300':
21
+ return 'Light 300';
22
+ break;
23
+ case '300italic':
24
+ return 'Light 300 Italic';
25
+ break;
26
  case '400':
27
  case 'regular':
28
+ return 'Regular 400';
29
+ break;
30
  case '400italic':
31
  case 'italic':
32
+ return 'Regular 400 Italic';
33
+ break;
34
+ case '500':
35
+ return 'Medium 500';
36
+ break;
37
+ case '500italic':
38
+ return 'Meidum 500 Italic';
39
+ break;
40
+ case '600':
41
+ return 'Semi-Bold 600';
42
+ break;
43
+ case '600italic':
44
+ return 'Semi-Bold 600 Italic';
45
+ break;
46
+ case '700':
47
+ return 'Bold 700';
48
+ break;
49
+ case '700italic':
50
+ return 'Bold 700 Italic';
51
+ break;
52
+ case '800':
53
+ return 'Extra-Bold 800';
54
+ break;
55
+ case '800italic':
56
+ return 'Extra-Bold Italic';
57
+ break;
58
+ case '900':
59
+ return 'Black 900';
60
+ break;
61
+ case '900italic':
62
+ return 'Black 900 Italic';
63
+ break;
64
  case 'Not Applicable':
65
+ return 'Not Applicable';
66
+ break;
67
  default:
68
+ break;
69
  }
70
  }
71
 
72
+ loadCustomFont = function (fontFace, type) {
73
 
74
  newFontFace = Array.isArray(fontFace) ? fontFace[0] : fontFace;
75
 
76
  for (let index = 0; index < newFontFace['urls'].length; index++) {
77
+ if (newFontFace['urls'][index].includes('woff')) {
78
  var url = newFontFace['urls'][index];
79
  }
80
  }
81
 
82
+ var junction_font = new FontFace(newFontFace['id'], 'url(' + url + ')');
83
+ var preview = document.getElementById(type + '-example');
84
  var logo = document.getElementById('niteoCS-text-logo');
85
+
86
+ junction_font.load().then(function (loaded_face) {
87
  document.fonts.add(loaded_face);
88
+ preview.style.fontFamily = '"' + loaded_face['family'] + '"';
89
+ type === 'heading' ? logo.style.fontFamily = '"' + loaded_face['family'] + '"' : null;
90
 
91
+ }).catch(function (error) {
92
  console.log('Cannot load custom font: ' + error)
93
  });
94
  }
95
 
96
+ var heading_font = fonts.google.filter(function (element) {
97
+ return element.id === jQuery('.cmp-coming-soon-maintenance .headings-google-font option:selected').val();
98
  });
99
 
100
+ var content_font = fonts.google.filter(function (element) {
101
+ return element.id === jQuery('.cmp-coming-soon-maintenance .content-google-font option:selected').val();
102
  });
103
 
104
  if (heading_font.length) {
105
+ var heading_font_variant = jQuery.map(heading_font[0].variants, function (obj) {
106
  return { id: obj, text: fontVariant(obj) };
107
  });
108
  }
109
 
110
  if (content_font.length) {
111
+ var content_font_variant = jQuery.map(content_font[0].variants, function (obj) {
112
  return { id: obj, text: fontVariant(obj) };
113
  });
114
  }
115
 
116
  // ini select2
117
+ $HeadingFont = jQuery('.cmp-coming-soon-maintenance .headings-google-font').select2({
118
  data: fonts.google,
119
  width: '100%',
120
  // templateResult: formatFont
121
  });
122
 
123
  // ini select2
124
+ $contentFont = jQuery('.cmp-coming-soon-maintenance .content-google-font').select2({
125
  data: fonts.google,
126
  width: '100%',
127
  });
138
  width: '100%',
139
  })
140
 
141
+ if (heading_font.length) {
142
 
143
+ if (heading_font[0]['variants'][0] == 'Not Applicable') {
144
  loadCustomFont(heading_font, 'heading');
145
  } else {
146
 
147
  // change fonts families upon a load
148
  WebFont.load({
149
+ google: {
150
+ families: [
151
+ heading_font[0]['id'] + ':' + heading_font[0]['variants'].join(',')
152
+ ]
153
+ },
154
+ active: function () {
155
 
156
+ if (jQuery.isNumeric(headingVariant)) {
157
+ jQuery('#heading-example').css('font-weight', headingVariant).css('font-style', 'normal');
158
 
159
+ } else if (headingVariant == 'regular') {
160
+ jQuery('#heading-example').css('font-weight', '400').css('font-style', 'normal');
161
 
162
+ } else if (headingVariant == 'italic') {
163
+ jQuery('#heading-example').css('font-style', 'italic').css('font-weight', '400');
164
 
165
+ } else {
166
+ fontweight = parseInt(headingVariant, 10);
167
+ jQuery('#heading-example').css('font-weight', fontweight).css('font-style', 'italic');
168
+ }
169
 
170
+ jQuery('#heading-example, #niteoCS-text-logo').css('font-family', heading_font[0]['id']);
171
+
172
+ }
173
+ });
174
  }
175
  }
176
 
177
+ if (content_font.length) {
178
 
179
+ if (content_font[0]['variants'][0] == 'Not Applicable') {
180
  loadCustomFont(content_font, 'content');
181
+
182
  } else {
183
  // change fonts families upon a load
184
  WebFont.load({
185
+ google: {
186
+ families: [
187
+ content_font[0]['id'] + ':' + content_font[0]['variants'].join(',')
188
+ ]
189
+ },
190
+ active: function () {
191
+
192
+ if (jQuery.isNumeric(contentVariant)) {
193
+ jQuery('#content-example').css('font-weight', contentVariant).css('font-style', 'normal');
194
+
195
+ } else if (contentVariant == 'regular') {
196
+ jQuery('#content-example').css('font-weight', '400').css('font-style', 'normal');
197
+
198
+ } else if (contentVariant == 'italic') {
199
+ jQuery('#content-example').css('font-style', 'italic').css('font-weight', '400');
200
+
201
+ } else {
202
+ fontweight = parseInt(contentVariant, 10);
203
+ jQuery('#content-example').css('font-weight', fontweight).css('font-style', 'italic');
204
+ }
205
+
206
+ jQuery('#content-example').css('font-family', content_font[0]['id']);
207
+
208
  }
209
+ });
 
 
 
 
210
  }
211
  }
212
 
215
  var data = $(this).data().data;
216
  var type = data.element.parentNode.dataset.type;
217
 
218
+ if (type !== 'content' && type !== 'heading') {
219
  return
220
  }
221
 
222
+ if (data.variants[0] === 'Not Applicable') {
223
  loadCustomFont(data, type);
224
 
225
  } else {
226
  WebFont.load({
227
  google: {
228
+ families: [
229
+ [data.text] + ':100,200,300,regular,600,700,900,100italic,200italic,300italic,400italic,600italic,700italic,900italic'
230
+ ]
231
  },
232
+ active: function () {
233
+ jQuery('#' + type + '-example, #niteoCS-text-logo').css('font-family', data.text);
234
  },
235
+ });
236
  }
237
+
238
 
239
  });
240
 
241
  // change preview fonts on select2 selection
242
+ $HeadingFont.on('select2:select', function (e) {
243
  // get current variant value
244
  var selected = $HeadingFontVariant.select2('data');
245
 
246
+ var heading_font_variant = jQuery.map(e.params.data.variants, function (obj) {
247
  return { id: obj, text: fontVariant(obj) };
248
  });
249
 
255
  });
256
 
257
  // set same variant as before selection if variant is in array, else set regular
258
+ if (selected[0].id) {
259
+ if (jQuery.inArray(selected[0].id, e.params.data.variants) == '-1') {
260
+ jQuery('#heading-example, #niteoCS-text-logo').css('font-weight', '400').css('font-style', 'normal');
261
  } else {
262
  $HeadingFontVariant.val(selected[0].id).trigger('change.select2');
263
  }
266
  });
267
 
268
 
269
+ $HeadingFontVariant.on('select2:select', function (e) {
270
 
271
  headingVariant = e.params.data.id;
272
 
273
+ if (jQuery.isNumeric(headingVariant)) {
274
+ jQuery('#heading-example, #niteoCS-text-logo').css('font-weight', headingVariant).css('font-style', 'normal');
275
 
276
+ } else if (headingVariant == 'regular') {
277
+ jQuery('#heading-example, #niteoCS-text-logo').css('font-weight', '400').css('font-style', 'normal');
278
 
279
+ } else if (headingVariant == 'italic') {
280
+ jQuery('#heading-example, #niteoCS-text-logo').css('font-style', 'italic').css('font-weight', '400');
281
 
282
  } else {
283
  fontweight = parseInt(headingVariant, 10);
284
+ jQuery('#heading-example, #niteoCS-text-logo').css('font-weight', fontweight).css('font-style', 'italic');
285
  }
286
+
287
  });
288
 
289
 
290
  // // change content preview fonts on font select
291
+ $contentFont.on('select2:select', function (e) {
292
  // get current variant value
293
  var selected = $contentFontVariant.select2('data');
294
 
295
+ var content_font_variant = jQuery.map(e.params.data.variants, function (obj) {
296
  return { id: obj, text: fontVariant(obj) };
297
  });
298
 
304
  });
305
 
306
  // set same variant as before selection if variant is in array, else set regular
307
+ if (selected[0].id) {
308
 
309
+ if (jQuery.inArray(selected[0].id, e.params.data.variants) == '-1') {
310
+ jQuery('#content-example').css('font-weight', '400').css('font-style', 'normal');
311
  } else {
312
  $contentFontVariant.val(selected[0].id).trigger('change.select2');
313
  }
315
 
316
  });
317
 
318
+ $contentFontVariant.on('select2:select', function (e) {
319
 
320
  contentVariant = e.params.data.id;
321
 
322
+ if (jQuery.isNumeric(contentVariant)) {
323
+ jQuery('#content-example').css('font-weight', contentVariant).css('font-style', 'normal');
324
 
325
+ } else if (contentVariant == 'regular') {
326
+ jQuery('#content-example').css('font-weight', '400').css('font-style', 'normal');
327
 
328
+ } else if (contentVariant == 'italic') {
329
+ jQuery('#content-example').css('font-style', 'italic').css('font-weight', '400');
330
 
331
  } else {
332
  fontweight = parseInt(contentVariant, 10);
333
+ jQuery('#content-example').css('font-weight', fontweight).css('font-style', 'italic');
334
  }
335
+
336
  });
337
 
338
  jQuery('.cmp-coming-soon-maintenance .font-selector input[type=range]').on('input', function () {
344
  jQuery(this).parent().find('span').html(value);
345
 
346
  // add px if css requires it
347
+ value = (css == 'line-height') ? value : value + 'px';
348
 
349
  // change example css
350
+ if (type == 'heading') {
351
  jQuery('#heading-example').css(css, value);
352
 
353
  } else {
358
 
359
 
360
  // Upload custom font
361
+ jQuery('#cmp-install-font').click(function (e) {
362
  e.preventDefault();
363
 
364
  var file_frame;
365
 
366
+ $(document.body).on('click', '#cmp-install-font', function (event) {
367
  event.preventDefault();
368
 
369
  var security = $(this).data('security');
370
 
371
+ var payload = {
372
  action: 'upload_font',
373
  files: []
374
  }
378
  security: security,
379
  payload: JSON.stringify(payload)
380
  };
381
+
382
  // If the media frame already exists, reopen it.
383
+ if (file_frame) {
384
  file_frame.open();
385
  return;
386
  }
391
  });
392
 
393
  // When a file is selected in the media frame...
394
+ file_frame.on('select', function () {
395
  // Get selected attachment
396
  var attachment = file_frame.state().get('selection').toJSON();
397
 
398
+ if (attachment.length) {
399
  payload.action = 'upload_font';
400
  // create unique array of font names
401
  var titles = [];
402
 
403
+ jQuery(attachment).each(function (i, value) {
404
+ if (titles.indexOf(value.title) < 0) {
405
  titles.push(value.title);
406
  }
407
  });
408
 
409
  // loop trough Font titles
410
+ jQuery(titles).each(function (i, title) {
411
 
412
  var urls = [];
413
  var ids = [];
414
  // get all urls of same font title
415
+ jQuery(attachment).each(function (i, value) {
416
+ if (value.title === title) {
417
  urls.push(value.url);
418
  ids.push(value.id);
419
  }
431
 
432
  data.payload = JSON.stringify(payload);
433
 
434
+ $.post(ajaxurl, data, function (response) {
435
  for (var i = 0; i < payload.files.length; ++i) {
436
  fonts.google.unshift(payload.files[i])
437
  }
js/typography.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(t){headingVariant=jQuery(".cmp-coming-soon-maintenance .headings-google-font-variant").val(),contentVariant=jQuery(".cmp-coming-soon-maintenance .content-google-font-variant").val(),fontVariant=function(t){switch(t){case"100":return"Thin 100";case"100italic":return"Thin 100 Italic";case"200":return"Extra-light 200";case"200italic":return"Extra-light 200 Italic";case"300":return"Light 300";case"300italic":return"Light 300 Italic";case"400":case"regular":return"Regular 400";case"400italic":case"italic":return"Regular 400 Italic";case"500":return"Medium 500";case"500italic":return"Meidum 500 Italic";case"600":return"Semi-Bold 600";case"600italic":return"Semi-Bold 600 Italic";case"700":return"Bold 700";case"700italic":return"Bold 700 Italic";case"800":return"Extra-Bold 800";case"800italic":return"Extra-Bold Italic";case"900":return"Black 900";case"900italic":return"Black 900 Italic";case"Not Applicable":return"Not Applicable"}},loadCustomFont=function(t,e){newFontFace=Array.isArray(t)?t[0]:t;for(let t=0;t<newFontFace.urls.length;t++)if(newFontFace.urls[t].includes("woff"))var n=newFontFace.urls[t];var a=new FontFace(newFontFace.id,"url("+n+")"),i=document.getElementById(e+"-example"),o=document.getElementById("niteoCS-text-logo");a.load().then(function(t){document.fonts.add(t),i.style.fontFamily='"'+t.family+'"',"heading"===e&&(o.style.fontFamily='"'+t.family+'"')}).catch(function(t){console.log("Cannot load custom font: "+t)})};var e=fonts.google.filter(function(t){return t.id===jQuery(".cmp-coming-soon-maintenance .headings-google-font option:selected").val()}),n=fonts.google.filter(function(t){return t.id===jQuery(".cmp-coming-soon-maintenance .content-google-font option:selected").val()});if(e.length)var a=jQuery.map(e[0].variants,function(t){return{id:t,text:fontVariant(t)}});if(n.length)var i=jQuery.map(n[0].variants,function(t){return{id:t,text:fontVariant(t)}});$HeadingFont=jQuery(".cmp-coming-soon-maintenance .headings-google-font").select2({data:fonts.google,width:"100%"}),$contentFont=jQuery(".cmp-coming-soon-maintenance .content-google-font").select2({data:fonts.google,width:"100%"}),$HeadingFontVariant=jQuery(".cmp-coming-soon-maintenance .headings-google-font-variant").select2({data:a,width:"100%"}),$contentFontVariant=jQuery(".cmp-coming-soon-maintenance .content-google-font-variant").select2({data:i,width:"100%"}),e.length&&("Not Applicable"==e[0].variants[0]?loadCustomFont(e,"heading"):WebFont.load({google:{families:[e[0].id+":"+["variants"].join(",")]},active:function(){jQuery.isNumeric(headingVariant)?jQuery("#heading-example").css("font-weight",headingVariant).css("font-style","normal"):"regular"==headingVariant?jQuery("#heading-example").css("font-weight","400").css("font-style","normal"):"italic"==headingVariant?jQuery("#heading-example").css("font-style","italic").css("font-weight","400"):(fontweight=parseInt(headingVariant,10),jQuery("#heading-example").css("font-weight",fontweight).css("font-style","italic")),jQuery("#heading-example, #niteoCS-text-logo").css("font-family",e[0].id)}})),n.length&&("Not Applicable"==n[0].variants[0]?loadCustomFont(n,"content"):WebFont.load({google:{families:[n[0].id+":"+["variants"].join(",")]},active:function(){jQuery.isNumeric(contentVariant)?jQuery("#content-example").css("font-weight",contentVariant).css("font-style","normal"):"regular"==contentVariant?jQuery("#content-example").css("font-weight","400").css("font-style","normal"):"italic"==contentVariant?jQuery("#content-example").css("font-style","italic").css("font-weight","400"):(fontweight=parseInt(contentVariant,10),jQuery("#content-example").css("font-weight",fontweight).css("font-style","italic")),jQuery("#content-example").css("font-family",n[0].id)}})),t("body").on("mouseenter",".select2-results__option.select2-results__option--highlighted",function(e){var n=t(this).data().data,a=n.element.parentNode.dataset.type;"content"!==a&&"heading"!==a||("Not Applicable"===n.variants[0]?loadCustomFont(n,a):WebFont.load({google:{families:[n.text]},active:function(){jQuery("#"+a+"-example, #niteoCS-text-logo").css("font-family",n.text)}}))}),$HeadingFont.on("select2:select",function(t){var e=$HeadingFontVariant.select2("data"),n=jQuery.map(t.params.data.variants,function(t){return{id:t,text:fontVariant(t)}});$HeadingFontVariant.empty(),$HeadingFontVariant.select2({data:n}),e[0].id&&("-1"==jQuery.inArray(e[0].id,t.params.data.variants)?jQuery("#heading-example, #niteoCS-text-logo").css("font-weight","400").css("font-style","normal"):$HeadingFontVariant.val(e[0].id).trigger("change.select2"))}),$HeadingFontVariant.on("select2:select",function(t){headingVariant=t.params.data.id,jQuery.isNumeric(headingVariant)?jQuery("#heading-example, #niteoCS-text-logo").css("font-weight",headingVariant).css("font-style","normal"):"regular"==headingVariant?jQuery("#heading-example, #niteoCS-text-logo").css("font-weight","400").css("font-style","normal"):"italic"==headingVariant?jQuery("#heading-example, #niteoCS-text-logo").css("font-style","italic").css("font-weight","400"):(fontweight=parseInt(headingVariant,10),jQuery("#heading-example, #niteoCS-text-logo").css("font-weight",fontweight).css("font-style","italic"))}),$contentFont.on("select2:select",function(t){var e=$contentFontVariant.select2("data"),n=jQuery.map(t.params.data.variants,function(t){return{id:t,text:fontVariant(t)}});$contentFontVariant.empty(),$contentFontVariant.select2({data:n}),e[0].id&&("-1"==jQuery.inArray(e[0].id,t.params.data.variants)?jQuery("#content-example").css("font-weight","400").css("font-style","normal"):$contentFontVariant.val(e[0].id).trigger("change.select2"))}),$contentFontVariant.on("select2:select",function(t){contentVariant=t.params.data.id,jQuery.isNumeric(contentVariant)?jQuery("#content-example").css("font-weight",contentVariant).css("font-style","normal"):"regular"==contentVariant?jQuery("#content-example").css("font-weight","400").css("font-style","normal"):"italic"==contentVariant?jQuery("#content-example").css("font-style","italic").css("font-weight","400"):(fontweight=parseInt(contentVariant,10),jQuery("#content-example").css("font-weight",fontweight).css("font-style","italic"))}),jQuery(".cmp-coming-soon-maintenance .font-selector input[type=range]").on("input",function(){var t=jQuery(this).data("type"),e=jQuery(this).data("css"),n=jQuery(this).val();jQuery(this).parent().find("span").html(n),n="line-height"==e?n:n+"px","heading"==t?jQuery("#heading-example").css(e,n):jQuery("#content-example").css(e,n)}),jQuery("#cmp-install-font").click(function(e){var n;e.preventDefault(),t(document.body).on("click","#cmp-install-font",function(e){e.preventDefault();var a=t(this).data("security"),i={action:"upload_font",files:[]},o={action:"cmp_ajax_upload_font",security:a,payload:JSON.stringify(i)};n?n.open():((n=wp.media.frames.file_frame=wp.media({multiple:!0})).on("select",function(){var e=n.state().get("selection").toJSON();if(e.length){i.action="upload_font";var a=[];jQuery(e).each(function(t,e){a.indexOf(e.title)<0&&a.push(e.title)}),jQuery(a).each(function(t,n){var a=[],o=[];jQuery(e).each(function(t,e){e.title===n&&(a.push(e.url),o.push(e.id))}),i.files[t]={id:n,text:n,urls:a,ids:o,variants:["Not Applicable"]}}),o.payload=JSON.stringify(i),t.post(ajaxurl,o,function(t){for(var e=0;e<i.files.length;++e)fonts.google.unshift(i.files[e]);$HeadingFont.select2({data:fonts.google}),$contentFont.select2({data:fonts.google}),alert("Following fonts have been added to Fonts Family selections: "+a.join(", "))})}}),n.open())})})});
1
+ jQuery(document).ready(function (t) { headingVariant = jQuery(".cmp-coming-soon-maintenance .headings-google-font-variant").val(), contentVariant = jQuery(".cmp-coming-soon-maintenance .content-google-font-variant").val(), fontVariant = function (t) { switch (t) { case "100": return "Thin 100"; case "100italic": return "Thin 100 Italic"; case "200": return "Extra-light 200"; case "200italic": return "Extra-light 200 Italic"; case "300": return "Light 300"; case "300italic": return "Light 300 Italic"; case "400": case "regular": return "Regular 400"; case "400italic": case "italic": return "Regular 400 Italic"; case "500": return "Medium 500"; case "500italic": return "Meidum 500 Italic"; case "600": return "Semi-Bold 600"; case "600italic": return "Semi-Bold 600 Italic"; case "700": return "Bold 700"; case "700italic": return "Bold 700 Italic"; case "800": return "Extra-Bold 800"; case "800italic": return "Extra-Bold Italic"; case "900": return "Black 900"; case "900italic": return "Black 900 Italic"; case "Not Applicable": return "Not Applicable" } }, loadCustomFont = function (t, e) { newFontFace = Array.isArray(t) ? t[0] : t; for (let t = 0; t < newFontFace.urls.length; t++)if (newFontFace.urls[t].includes("woff")) var n = newFontFace.urls[t]; var a = new FontFace(newFontFace.id, "url(" + n + ")"), i = document.getElementById(e + "-example"), o = document.getElementById("niteoCS-text-logo"); a.load().then(function (t) { document.fonts.add(t), i.style.fontFamily = '"' + t.family + '"', "heading" === e && (o.style.fontFamily = '"' + t.family + '"') }).catch(function (t) { console.log("Cannot load custom font: " + t) }) }; var e = fonts.google.filter(function (t) { return t.id === jQuery(".cmp-coming-soon-maintenance .headings-google-font option:selected").val() }), n = fonts.google.filter(function (t) { return t.id === jQuery(".cmp-coming-soon-maintenance .content-google-font option:selected").val() }); if (e.length) var a = jQuery.map(e[0].variants, function (t) { return { id: t, text: fontVariant(t) } }); if (n.length) var i = jQuery.map(n[0].variants, function (t) { return { id: t, text: fontVariant(t) } }); $HeadingFont = jQuery(".cmp-coming-soon-maintenance .headings-google-font").select2({ data: fonts.google, width: "100%" }), $contentFont = jQuery(".cmp-coming-soon-maintenance .content-google-font").select2({ data: fonts.google, width: "100%" }), $HeadingFontVariant = jQuery(".cmp-coming-soon-maintenance .headings-google-font-variant").select2({ data: a, width: "100%" }), $contentFontVariant = jQuery(".cmp-coming-soon-maintenance .content-google-font-variant").select2({ data: i, width: "100%" }), e.length && ("Not Applicable" == e[0].variants[0] ? loadCustomFont(e, "heading") : WebFont.load({ google: { families: [e[0].id + ":" + e[0].variants.join(",")] }, active: function () { jQuery.isNumeric(headingVariant) ? jQuery("#heading-example").css("font-weight", headingVariant).css("font-style", "normal") : "regular" == headingVariant ? jQuery("#heading-example").css("font-weight", "400").css("font-style", "normal") : "italic" == headingVariant ? jQuery("#heading-example").css("font-style", "italic").css("font-weight", "400") : (fontweight = parseInt(headingVariant, 10), jQuery("#heading-example").css("font-weight", fontweight).css("font-style", "italic")), jQuery("#heading-example, #niteoCS-text-logo").css("font-family", e[0].id) } })), n.length && ("Not Applicable" == n[0].variants[0] ? loadCustomFont(n, "content") : WebFont.load({ google: { families: [n[0].id + ":" + n[0].variants.join(",")] }, active: function () { jQuery.isNumeric(contentVariant) ? jQuery("#content-example").css("font-weight", contentVariant).css("font-style", "normal") : "regular" == contentVariant ? jQuery("#content-example").css("font-weight", "400").css("font-style", "normal") : "italic" == contentVariant ? jQuery("#content-example").css("font-style", "italic").css("font-weight", "400") : (fontweight = parseInt(contentVariant, 10), jQuery("#content-example").css("font-weight", fontweight).css("font-style", "italic")), jQuery("#content-example").css("font-family", n[0].id) } })), t("body").on("mouseenter", ".select2-results__option.select2-results__option--highlighted", function (e) { var n = t(this).data().data, a = n.element.parentNode.dataset.type; "content" !== a && "heading" !== a || ("Not Applicable" === n.variants[0] ? loadCustomFont(n, a) : WebFont.load({ google: { families: [[n.text] + ":100,200,300,regular,600,700,900,100italic,200italic,300italic,400italic,600italic,700italic,900italic"] }, active: function () { jQuery("#" + a + "-example, #niteoCS-text-logo").css("font-family", n.text) } })) }), $HeadingFont.on("select2:select", function (t) { var e = $HeadingFontVariant.select2("data"), n = jQuery.map(t.params.data.variants, function (t) { return { id: t, text: fontVariant(t) } }); $HeadingFontVariant.empty(), $HeadingFontVariant.select2({ data: n }), e[0].id && ("-1" == jQuery.inArray(e[0].id, t.params.data.variants) ? jQuery("#heading-example, #niteoCS-text-logo").css("font-weight", "400").css("font-style", "normal") : $HeadingFontVariant.val(e[0].id).trigger("change.select2")) }), $HeadingFontVariant.on("select2:select", function (t) { headingVariant = t.params.data.id, jQuery.isNumeric(headingVariant) ? jQuery("#heading-example, #niteoCS-text-logo").css("font-weight", headingVariant).css("font-style", "normal") : "regular" == headingVariant ? jQuery("#heading-example, #niteoCS-text-logo").css("font-weight", "400").css("font-style", "normal") : "italic" == headingVariant ? jQuery("#heading-example, #niteoCS-text-logo").css("font-style", "italic").css("font-weight", "400") : (fontweight = parseInt(headingVariant, 10), jQuery("#heading-example, #niteoCS-text-logo").css("font-weight", fontweight).css("font-style", "italic")) }), $contentFont.on("select2:select", function (t) { var e = $contentFontVariant.select2("data"), n = jQuery.map(t.params.data.variants, function (t) { return { id: t, text: fontVariant(t) } }); $contentFontVariant.empty(), $contentFontVariant.select2({ data: n }), e[0].id && ("-1" == jQuery.inArray(e[0].id, t.params.data.variants) ? jQuery("#content-example").css("font-weight", "400").css("font-style", "normal") : $contentFontVariant.val(e[0].id).trigger("change.select2")) }), $contentFontVariant.on("select2:select", function (t) { contentVariant = t.params.data.id, jQuery.isNumeric(contentVariant) ? jQuery("#content-example").css("font-weight", contentVariant).css("font-style", "normal") : "regular" == contentVariant ? jQuery("#content-example").css("font-weight", "400").css("font-style", "normal") : "italic" == contentVariant ? jQuery("#content-example").css("font-style", "italic").css("font-weight", "400") : (fontweight = parseInt(contentVariant, 10), jQuery("#content-example").css("font-weight", fontweight).css("font-style", "italic")) }), jQuery(".cmp-coming-soon-maintenance .font-selector input[type=range]").on("input", function () { var t = jQuery(this).data("type"), e = jQuery(this).data("css"), n = jQuery(this).val(); jQuery(this).parent().find("span").html(n), n = "line-height" == e ? n : n + "px", "heading" == t ? jQuery("#heading-example").css(e, n) : jQuery("#content-example").css(e, n) }), jQuery("#cmp-install-font").click(function (e) { var n; e.preventDefault(), t(document.body).on("click", "#cmp-install-font", function (e) { e.preventDefault(); var a = t(this).data("security"), i = { action: "upload_font", files: [] }, o = { action: "cmp_ajax_upload_font", security: a, payload: JSON.stringify(i) }; n ? n.open() : ((n = wp.media.frames.file_frame = wp.media({ multiple: !0 })).on("select", function () { var e = n.state().get("selection").toJSON(); if (e.length) { i.action = "upload_font"; var a = []; jQuery(e).each(function (t, e) { a.indexOf(e.title) < 0 && a.push(e.title) }), jQuery(a).each(function (t, n) { var a = [], o = []; jQuery(e).each(function (t, e) { e.title === n && (a.push(e.url), o.push(e.id)) }), i.files[t] = { id: n, text: n, urls: a, ids: o, variants: ["Not Applicable"] } }), o.payload = JSON.stringify(i), t.post(ajaxurl, o, function (t) { for (var e = 0; e < i.files.length; ++e)fonts.google.unshift(i.files[e]); $HeadingFont.select2({ data: fonts.google }), $contentFont.select2({ data: fonts.google }), alert("Following fonts have been added to Fonts Family selections: " + a.join(", ")) }) } }), n.open()) }) }) });
niteo-cmp.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: CMP - Coming Soon & Maintenance Plugin
4
  Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
5
  Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
6
- Version: 3.8.2
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
@@ -63,7 +63,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
63
 
64
  // define constants
65
  private function constants() {
66
- $this->define( 'CMP_VERSION', '3.8.2' );
67
  $this->define( 'CMP_DEBUG', FALSE );
68
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
69
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
3
  Plugin Name: CMP - Coming Soon & Maintenance Plugin
4
  Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
5
  Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
6
+ Version: 3.8.3
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
63
 
64
  // define constants
65
  private function constants() {
66
+ $this->define( 'CMP_VERSION', '3.8.3' );
67
  $this->define( 'CMP_DEBUG', FALSE );
68
  $this->define( 'CMP_AUTHOR', 'NiteoThemes' );
69
  $this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: coming soon, coming soon page, launch page, maintenance mode, under constr
5
  Requires at least: 3.0
6
  Requires PHP: 5.6
7
  Tested up to: 5.5
8
- Stable tag: 3.8.2
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -154,12 +154,19 @@ https://www.youtube.com/watch?v=uxuJfHzwdtE
154
  <p>Nothing is better than a good feedback! Please go to <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/">Plugin reviews</a> and rate it! Alternatively you can click on a Donate button too!:)</p>
155
 
156
  == Changelog ==
 
 
 
 
 
 
157
  <h4>CMP 3.8.2 - 03-Aug-20</h4>
158
  <ul>
159
  <li>Small UI typography changes.</li>
160
  <li>Import / Export function works with Favicon image correctly now.</li>
161
  <li>Compatibility with WordPress version 5.5</li>
162
  </ul>
 
163
  <h4>CMP 3.8.1 - 16-July-20</h4>
164
  <ul>
165
  <li>Resolved UI issue with multiple social media icons.</li>
5
  Requires at least: 3.0
6
  Requires PHP: 5.6
7
  Tested up to: 5.5
8
+ Stable tag: 3.8.3
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
154
  <p>Nothing is better than a good feedback! Please go to <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/">Plugin reviews</a> and rate it! Alternatively you can click on a Donate button too!:)</p>
155
 
156
  == Changelog ==
157
+ <h4>CMP 3.8.3 - 05-Aug-20</h4>
158
+ <ul>
159
+ <li>Resolved bug in Typography settings when font variants did not load correctly.</li>
160
+ <li>Updated compatibility with Cookie Notice plugin.</li>
161
+ </ul>
162
+
163
  <h4>CMP 3.8.2 - 03-Aug-20</h4>
164
  <ul>
165
  <li>Small UI typography changes.</li>
166
  <li>Import / Export function works with Favicon image correctly now.</li>
167
  <li>Compatibility with WordPress version 5.5</li>
168
  </ul>
169
+
170
  <h4>CMP 3.8.1 - 16-July-20</h4>
171
  <ul>
172
  <li>Resolved UI issue with multiple social media icons.</li>