Astra Starter Sites - Version 1.3.15

Version Description

Download this release

Release Info

Developer vrundakansara
Plugin Icon Astra Starter Sites
Version 1.3.15
Comparing to
See all releases

Code changes from version 1.3.14 to 1.3.15

astra-sites.php CHANGED
@@ -1,54 +1,54 @@
1
- <?php
2
- /**
3
- * Plugin Name: Astra Starter Sites
4
- * Plugin URI: http://www.wpastra.com/pro/
5
- * Description: Import free sites build with Astra theme.
6
- * Version: 1.3.14
7
- * Author: Brainstorm Force
8
- * Author URI: http://www.brainstormforce.com
9
- * Text Domain: astra-sites
10
- *
11
- * @package Astra Sites
12
- */
13
-
14
- /**
15
- * Set constants.
16
- */
17
- if ( ! defined( 'ASTRA_SITES_NAME' ) ) {
18
- define( 'ASTRA_SITES_NAME', __( 'Astra Sites', 'astra-sites' ) );
19
- }
20
-
21
- if ( ! defined( 'ASTRA_SITES_VER' ) ) {
22
- define( 'ASTRA_SITES_VER', '1.3.14' );
23
- }
24
-
25
- if ( ! defined( 'ASTRA_SITES_FILE' ) ) {
26
- define( 'ASTRA_SITES_FILE', __FILE__ );
27
- }
28
-
29
- if ( ! defined( 'ASTRA_SITES_BASE' ) ) {
30
- define( 'ASTRA_SITES_BASE', plugin_basename( ASTRA_SITES_FILE ) );
31
- }
32
-
33
- if ( ! defined( 'ASTRA_SITES_DIR' ) ) {
34
- define( 'ASTRA_SITES_DIR', plugin_dir_path( ASTRA_SITES_FILE ) );
35
- }
36
-
37
- if ( ! defined( 'ASTRA_SITES_URI' ) ) {
38
- define( 'ASTRA_SITES_URI', plugins_url( '/', ASTRA_SITES_FILE ) );
39
- }
40
-
41
- if ( ! function_exists( 'astra_sites_setup' ) ) :
42
-
43
- /**
44
- * Astra Sites Setup
45
- *
46
- * @since 1.0.5
47
- */
48
- function astra_sites_setup() {
49
- require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites.php';
50
- }
51
-
52
- add_action( 'plugins_loaded', 'astra_sites_setup' );
53
-
54
- endif;
1
+ <?php
2
+ /**
3
+ * Plugin Name: Astra Starter Sites
4
+ * Plugin URI: http://www.wpastra.com/pro/
5
+ * Description: Import free sites build with Astra theme.
6
+ * Version: 1.3.15
7
+ * Author: Brainstorm Force
8
+ * Author URI: http://www.brainstormforce.com
9
+ * Text Domain: astra-sites
10
+ *
11
+ * @package Astra Sites
12
+ */
13
+
14
+ /**
15
+ * Set constants.
16
+ */
17
+ if ( ! defined( 'ASTRA_SITES_NAME' ) ) {
18
+ define( 'ASTRA_SITES_NAME', __( 'Astra Sites', 'astra-sites' ) );
19
+ }
20
+
21
+ if ( ! defined( 'ASTRA_SITES_VER' ) ) {
22
+ define( 'ASTRA_SITES_VER', '1.3.15' );
23
+ }
24
+
25
+ if ( ! defined( 'ASTRA_SITES_FILE' ) ) {
26
+ define( 'ASTRA_SITES_FILE', __FILE__ );
27
+ }
28
+
29
+ if ( ! defined( 'ASTRA_SITES_BASE' ) ) {
30
+ define( 'ASTRA_SITES_BASE', plugin_basename( ASTRA_SITES_FILE ) );
31
+ }
32
+
33
+ if ( ! defined( 'ASTRA_SITES_DIR' ) ) {
34
+ define( 'ASTRA_SITES_DIR', plugin_dir_path( ASTRA_SITES_FILE ) );
35
+ }
36
+
37
+ if ( ! defined( 'ASTRA_SITES_URI' ) ) {
38
+ define( 'ASTRA_SITES_URI', plugins_url( '/', ASTRA_SITES_FILE ) );
39
+ }
40
+
41
+ if ( ! function_exists( 'astra_sites_setup' ) ) :
42
+
43
+ /**
44
+ * Astra Sites Setup
45
+ *
46
+ * @since 1.0.5
47
+ */
48
+ function astra_sites_setup() {
49
+ require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites.php';
50
+ }
51
+
52
+ add_action( 'plugins_loaded', 'astra_sites_setup' );
53
+
54
+ endif;
inc/assets/css/admin.css CHANGED
@@ -1,791 +1,791 @@
1
- .wrap .status,
2
- .wrap .site-type {
3
- position: absolute;
4
- z-index: 1;
5
- color: #fff;
6
- padding: 0.5em 1em;
7
- top: -0.5em;
8
- text-transform: uppercase;
9
- }
10
- .wrap .status,
11
- .wrap .site-type.premium {
12
- background: #0073aa;
13
- }
14
- .wrap .status {
15
- left: -0.5em;
16
- }
17
- .wrap .site-type.premium {
18
- right: -0.5em;
19
- }
20
-
21
- .wrap .status.publish,
22
- .wrap .site-type.free {
23
- display: none;
24
- }
25
-
26
- .install-theme-info .site-type {
27
- display: none;
28
- }
29
-
30
- .theme {
31
- position: relative;
32
- }
33
- .wrap .astra-sites-preview .site-type.premium {
34
- display: block;
35
- display: none;
36
- position: relative;
37
- margin: 0.5em 0em 1em 0em;
38
- top: 0;
39
- left: 0;
40
- text-align: center;
41
- }
42
-
43
- .theme-details-read-more.open {
44
- margin: 0.5em 0 0 0;
45
- }
46
-
47
- .astra-sites-preview .theme-screenshot {
48
- width: 100%;
49
- }
50
-
51
- .install-theme-info .site-type.premium {
52
- display: none;
53
- }
54
-
55
- /**
56
- * Required Plugins
57
- */
58
- .required-plugins.loading {
59
- text-align: center;
60
- }
61
- .required-plugins button {
62
- float: right;
63
- }
64
- .required-plugins .plugin-card {
65
- float: none;
66
- width: 100%;
67
- border: none;
68
- margin: 0 0 0.8em 0;
69
- display: flex;
70
- justify-content: space-between;
71
- align-items: center;
72
- transition: background ease 0.8s;
73
- }
74
- .required-plugins .plugin-card.plugin-card-update-failed {
75
- flex-wrap: wrap;
76
- }
77
- .required-plugins .spinner {
78
- float: none;
79
- margin: 0;
80
- }
81
-
82
- .expanded .wp-full-overlay-footer {
83
- height: 111px;
84
- }
85
-
86
- .wp-full-overlay-footer .view-site,
87
- .wp-full-overlay-footer .go-pro,
88
- .wp-full-overlay-footer .astra-demo-import {
89
- width: 100%;
90
- text-align: center;
91
- }
92
-
93
- .wp-core-ui .wp-full-overlay-footer .button.button-hero,
94
- .wp-core-ui .wp-full-overlay-footer .button-group.button-hero .button {
95
- padding: 0 10px 1px;
96
- }
97
-
98
- .wp-full-overlay-footer .installing:before {
99
- vertical-align: text-bottom;
100
- }
101
-
102
- .astra-sites-advanced-options-wrap h4 {
103
- margin: 1em 0 0.5em 0;
104
- padding: 0.5em 0;
105
- transition: all ease 0.3s;
106
- }
107
-
108
- /**
109
- * Read more link
110
- */
111
- .wp-core-ui .theme-details-read-more:focus,
112
- .wp-core-ui .theme-details-read-more:hover {
113
- outline: none;
114
- box-shadow: none;
115
- }
116
- .wp-core-ui .theme-details-read-more {
117
- margin: 10px 0;
118
- display: none;
119
- text-decoration: none;
120
- }
121
-
122
- /**
123
- * Go pro.
124
- */
125
- .wp-core-ui .go-pro.button[disabled] {
126
- background-color: #fcb92c !important;
127
- color: white !important;
128
- box-shadow: 1px 0 #eab23a !important;
129
- text-shadow: 1px 0 #6b4e13 !important;
130
- border-color: #e2a932 !important;
131
- cursor: pointer;
132
- }
133
- .wp-core-ui .view-site .dashicons,
134
- .wp-core-ui .go-pro .dashicons {
135
- font-size: 1rem;
136
- vertical-align: middle;
137
- }
138
-
139
- /**
140
- * Errors
141
- */
142
- .plugin-card-update-failed .notice {
143
- margin-top: 1.5em;
144
- }
145
-
146
- .no-themes {
147
- margin-top: 40px;
148
- }
149
-
150
- .no-themes p {
151
- font-size: 15px;
152
- }
153
-
154
- .no-themes .left-margin {
155
- margin-left: 30px;
156
- }
157
-
158
- /**
159
- *
160
- */
161
- .astra-sites-preview .wp-full-overlay-sidebar-content {
162
- bottom: 100px;
163
- }
164
-
165
- .footer-import-button-wrap {
166
- padding: 10px 20px;
167
- }
168
-
169
- .footer-import-button-wrap .button {
170
- margin: 0;
171
- }
172
-
173
- .astra-sites-preview.expanded .wp-full-overlay-footer {
174
- left: initial;
175
- }
176
-
177
- /**
178
- * Menu Page
179
- */
180
- .astra-sites-title {
181
- float: left;
182
- font-size: 23px;
183
- font-weight: 400;
184
- margin: 0 0 6px 0px;
185
- padding: 0;
186
- line-height: 29px;
187
- }
188
-
189
- #astra-sites-menu-page {
190
- margin-top: 10px;
191
- }
192
-
193
- /**
194
- * API Error
195
- */
196
- .astra-api-error {
197
- margin: 0 0 0.5em 0;
198
- }
199
-
200
- /**
201
- * Grid
202
- */
203
- .wp-filter .search-form {
204
- margin-left: 1em;
205
- }
206
- .wp-filter .search-form input[type="search"] {
207
- width: 200px;
208
- font-size: 13px;
209
- padding: 5px 10px;
210
- }
211
- .section-left {
212
- display: inline-block;
213
- }
214
- .section-right {
215
- float: right;
216
- }
217
- .filter-count {
218
- min-width: 3em;
219
- }
220
- .astra-site-preview-on {
221
- overflow: hidden;
222
- }
223
-
224
- .appearance_page_astra-sites .notice {
225
- margin-left: 0;
226
- width: auto;
227
- float: none;
228
- margin-right: 220px;
229
- }
230
-
231
- .filters-wrap {
232
- display: inline-block;
233
- }
234
- .spinner-wrap {
235
- text-align: center;
236
- }
237
- .spinner-wrap .spinner {
238
- float: none;
239
- }
240
- .hide-me {
241
- display: none !important;
242
- }
243
- #astra-sites-admin {
244
- height: 100vh;
245
- }
246
- .install-theme-info > .notice {
247
- margin: 5px 0 10px 0;
248
- }
249
-
250
- .astra-sites-suggestions:before {
251
- border: 5px dashed #ccc;
252
- position: absolute;
253
- left: 0;
254
- right: 0;
255
- top: 0;
256
- bottom: 0px;
257
- }
258
-
259
- .astra-sites-suggestions {
260
- min-height: 280px;
261
- border: none !important;
262
- }
263
-
264
- .astra-sites-suggestions a {
265
- border: none;
266
- outline: none;
267
- }
268
-
269
- .astra-sites-suggestions .inner {
270
- border: 6px solid #24282e !important;
271
- padding: 27% 10% 50% 10%;
272
- text-align: center;
273
- position: absolute;
274
- left: 0;
275
- right: 0;
276
- top: 0;
277
- background: #33383d;
278
- bottom: 0;
279
- color: #eee;
280
- cursor: auto;
281
- }
282
-
283
- .astra-sites-suggestions .inner a {
284
- color: #00b9eb;
285
- }
286
-
287
- .astra-sites-suggestions p {
288
- font-size: 1rem;
289
- margin: 0;
290
- }
291
-
292
- .astra-notice {
293
- margin: 2em 2em 0em 0em;
294
- }
295
-
296
- .no-themes .description {
297
- display: block;
298
- }
299
-
300
- /**
301
- * Responsive Button UI
302
- */
303
- .astra-sites-preview .wp-full-overlay-footer .devices button.active:before,
304
- .astra-sites-preview .wp-full-overlay-footer .devices button:hover:before {
305
- color: #0073aa;
306
- }
307
- .astra-sites-preview .wp-full-overlay-footer .devices button:before {
308
- color: #c1c1c1;
309
- }
310
- .astra-sites-preview .wp-full-overlay-footer .devices button:hover {
311
- background-color: transparent;
312
- }
313
- .astra-sites-preview .wp-full-overlay-footer .devices button {
314
- border: none;
315
- }
316
- .astra-sites-preview .wp-full-overlay-footer .devices button:focus,
317
- .astra-sites-preview .wp-full-overlay-footer .devices button.active:hover {
318
- border-bottom-color: transparent;
319
- background-color: transparent;
320
- }
321
- .not-click-able {
322
- pointer-events: none !important;
323
- }
324
- body.page-builder-selected .select-page-builder,
325
- body.loading-content .select-page-builder {
326
- display: none;
327
- }
328
- .select-page-builder .up-arrow {
329
- -webkit-transform: rotate(90deg);
330
- -moz-transform: rotate(90deg);
331
- -ms-transform: rotate(90deg);
332
- transform: rotate(90deg);
333
- display: inline-block;
334
- font-size: 1.5em;
335
- color: #797979;
336
- vertical-align: middle;
337
- margin-right: 10px;
338
- -webkit-transition: all linear 0.6s;
339
- -moz-transition: all linear 0.6s;
340
- -ms-transition: all linear 0.6s;
341
- transition: all linear 0.6s;
342
- -webkit-animation-duration: 1s;
343
- animation-duration: 1s;
344
- -webkit-animation-fill-mode: both;
345
- animation-fill-mode: both;
346
- -webkit-animation-timing-function: ease-in-out;
347
- animation-timing-function: ease-in-out;
348
- animation-iteration-count: infinite;
349
- -webkit-animation-iteration-count: infinite;
350
- animation-name: bounce;
351
- -moz-animation-name: bounce;
352
- }
353
- .select-page-builder {
354
- margin-left: 6em;
355
- }
356
-
357
- .select-page-builder img {
358
- max-width: 100%;
359
- }
360
-
361
- .select-page-builder .note-wrap {
362
- position: absolute;
363
- padding: 40px 0;
364
- margin-left: 170px;
365
- right: 0;
366
- left: 0;
367
- }
368
-
369
- .select-page-builder h3 {
370
- margin: 0;
371
- font-size: 2em;
372
- }
373
- .select-page-builder {
374
- margin: -20px 0 0 -5px;
375
- position: absolute;
376
- }
377
- .select-page-builder .note {
378
- margin-left: 1.5em;
379
- }
380
-
381
- @keyframes bounce {
382
- 0%,
383
- 100%,
384
- 20%,
385
- 50%,
386
- 80% {
387
- -webkit-transform: translateY(-0px) rotate(90deg);
388
- -moz-transform: translateY(-0px) rotate(90deg);
389
- -ms-transform: translateY(-0px) rotate(90deg);
390
- transform: translateY(-0px) rotate(90deg);
391
- }
392
- 40% {
393
- -webkit-transform: translateY(-2px) rotate(90deg);
394
- -moz-transform: translateY(-2px) rotate(90deg);
395
- -ms-transform: translateY(-2px) rotate(90deg);
396
- transform: translateY(-2px) rotate(90deg);
397
- }
398
- 60% {
399
- -webkit-transform: translateY(-1px) rotate(90deg);
400
- -moz-transform: translateY(-1px) rotate(90deg);
401
- -ms-transform: translateY(-1px) rotate(90deg);
402
- transform: translateY(-1px) rotate(90deg);
403
- }
404
- }
405
-
406
- /**
407
- * Processing Animation
408
- */
409
- .astra-demo-import.disabled {
410
- pointer-events: none;
411
- }
412
- .astra-demo-import.button.updating-message:before,
413
- .astra-demo-import.button.installing:before {
414
- -webkit-animation: cssAnimation .72s ease infinite;
415
- -moz-animation: cssAnimation .72s ease infinite;
416
- -o-animation: cssAnimation .72s ease infinite;
417
- -ms-animation: cssAnimation .72s ease infinite;
418
- animation: cssAnimation .72s ease infinite;
419
- }
420
-
421
- @-webkit-keyframes cssAnimation {
422
- from {
423
- -webkit-transform: rotate(0);
424
- -moz-transform: rotate(0);
425
- -o-transform: rotate(0);
426
- -ms-transform: rotate(0);
427
- transform: rotate(0);
428
- }
429
- to {
430
- -webkit-transform: rotate(360deg);
431
- -moz-transform: rotate(360deg);
432
- -o-transform: rotate(360deg);
433
- -ms-transform: rotate(360deg);
434
- transform: rotate(360deg);
435
- }
436
- }
437
- @-moz-keyframes cssAnimation {
438
- from {
439
- -webkit-transform: rotate(0);
440
- -moz-transform: rotate(0);
441
- -o-transform: rotate(0);
442
- -ms-transform: rotate(0);
443
- transform: rotate(0);
444
- }
445
- to {
446
- -webkit-transform: rotate(360deg);
447
- -moz-transform: rotate(360deg);
448
- -o-transform: rotate(360deg);
449
- -ms-transform: rotate(360deg);
450
- transform: rotate(360deg);
451
- }
452
- }
453
- @-o-keyframes cssAnimation {
454
- from {
455
- -webkit-transform: rotate(0);
456
- -moz-transform: rotate(0);
457
- -o-transform: rotate(0);
458
- -ms-transform: rotate(0);
459
- transform: rotate(0);
460
- }
461
- to {
462
- -webkit-transform: rotate(360deg);
463
- -moz-transform: rotate(360deg);
464
- -o-transform: rotate(360deg);
465
- -ms-transform: rotate(360deg);
466
- transform: rotate(360deg);
467
- }
468
- }
469
-
470
- #astra-sites-filters {
471
- display: inline-block;
472
- width: 100%;
473
- }
474
-
475
- .astra-site-down {
476
- padding: 1em 2em;
477
- margin-top: 1em;
478
- }
479
-
480
- #astra-sites-menu-page .nav-tab-wrapper {
481
- border: none;
482
- }
483
-
484
- #astra-sites-filters .wp-filter {
485
- margin-top: 0;
486
- }
487
-
488
- /**
489
- * Welcome Screen
490
- */
491
- .astra-sites-welcome {
492
- padding: 10em 0;
493
- text-align: center;
494
- }
495
- .astra-sites-welcome .inner {
496
- margin: 0 auto;
497
- display: inline-block;
498
- max-width: 700px;
499
- background: #fff;
500
- padding: 3em;
501
- }
502
-
503
- .astra-sites-welcome h1 {
504
- font-size: 2.5em;
505
- margin-bottom: 1em;
506
- }
507
-
508
- .astra-sites-welcome p {
509
- font-size: 1rem;
510
- }
511
-
512
- .astra-sites-welcome select {
513
- padding: 5px;
514
- height: 100%;
515
- }
516
-
517
- .astra-sites-welcome .submit {
518
- text-align: center;
519
- margin: 0;
520
- padding: 0;
521
- margin-left: .5em;
522
- }
523
-
524
- .astra-sites-welcome .disabled {
525
- pointer-events: none;
526
- }
527
-
528
- .astra-site-page-builder {
529
- opacity: 0;
530
- visibility: hidden;
531
- }
532
-
533
- .astra-sites-third-party-required-plugins-wrap .notice {
534
- margin: 0;
535
- }
536
-
537
- .required-plugins-list,
538
- .astra-sites-third-party-required-plugins {
539
- margin-left: 2em;
540
- margin-top: .5em;
541
- margin-bottom: .5em;
542
- list-style-type: disc;
543
- }
544
-
545
- .astra-sites-third-party-required-plugins .plugin-card,
546
- .required-plugins-list .plugin-card {
547
- background: transparent;
548
- border: none;
549
- margin: 0;
550
- line-height: 2;
551
- float: none;
552
- width: 100%;
553
- }
554
-
555
- .required-plugins-list .spinner {
556
- float: none;
557
- margin: 0;
558
- }
559
-
560
- .astra-site-import-process-wrap {
561
- display: flex;
562
- align-items: center;
563
- margin-top: -2px;
564
- z-index: 999999;
565
- position: relative;
566
- border-radius: 3px;
567
- overflow: hidden;
568
- }
569
-
570
- .astra-sites-result-preview .astra-site-import-process-wrap progress {
571
- background: #eeeeee;
572
- }
573
-
574
- .astra-sites-result-preview .astra-site-import-process-wrap progress::-webkit-progress-value {
575
- background: #0185ba;
576
- }
577
-
578
- .astra-site-import-process-wrap progress {
579
- padding: 0px;
580
- border: 0 none;
581
- background: #0085bd;
582
- border-radius: 5px;
583
- height: 4px;
584
- flex: 1;
585
- }
586
-
587
- .astra-sites-result-preview .dashicons {
588
- vertical-align: text-bottom;
589
- }
590
-
591
- .astra-site-import-process-wrap progress::-webkit-progress-value {
592
- background: #00679b;
593
- }
594
-
595
- .astra-site-import-process-wrap progress::-webkit-progress-bar {
596
- background: transparent;
597
- }
598
-
599
- .theme-browser .theme .site-preview > .theme-screenshot {
600
- transition: all linear 5s;
601
- background-position: center top;
602
- background-size: cover;
603
- background-repeat: no-repeat;
604
- }
605
- .theme-browser .theme .site-preview > .theme-screenshot:hover {
606
- background-position: center bottom;
607
- background-size: cover;
608
- }
609
-
610
- .astra-sites-tooltip-icon {
611
- cursor: pointer;
612
- }
613
-
614
- .astra-sites-preview .disabled {
615
- pointer-events: none;
616
- }
617
-
618
- .astra-sites-preview input[type="checkbox"].disabled {
619
- background: #eeeeee;
620
- opacity: 1;
621
- color: #fff;
622
- box-shadow: none;
623
- border-color: #b4b9be;
624
- }
625
-
626
- .astra-sites-tooltip-icon .dashicons {
627
- color: #757575;
628
- font-size: 15px;
629
- vertical-align: middle;
630
- height: auto;
631
- }
632
-
633
- #astra-sites-welcome-form-inline {
634
- position: absolute;
635
- right: 1em;
636
- top: 0;
637
- border-radius: 0;
638
- line-height: 1.7;
639
- padding: 0px 5px 2px 5px;
640
- outline: 2px solid transparent;
641
- outline-offset: 0;
642
- background: #fafafa;
643
- border: 1px solid #ccc;
644
- color: #72777c;
645
- font-weight: normal;
646
- font-size: 10px;
647
- font-size: 13px;
648
- line-height: 26px;
649
- height: 28px;
650
- cursor: pointer;
651
- }
652
-
653
- #astra-sites-welcome-form-inline select,
654
- #astra-sites-welcome-form-inline select:focus {
655
- border: none;
656
- outline: none;
657
- box-shadow: none;
658
- color: #72777c;
659
- }
660
-
661
- #astra-sites-menu-page .wp-full-overlay-main:before {
662
- content: '';
663
- display: none;
664
- }
665
-
666
- .theme-screenshot-wrap {
667
- overflow: hidden;
668
- max-height: 300px;
669
- margin: 15px 0;
670
- border: 1px solid #ccc;
671
- }
672
-
673
- .astra-sites-preview .install-theme-info .theme-screenshot {
674
- width: 100%;
675
- border: none;
676
- margin: 0;
677
- }
678
-
679
- #astra-sites-welcome-form #submit {
680
- padding: 0em 4rem;
681
- }
682
-
683
- .page-builders li {
684
- cursor: pointer;
685
- display: inline-block;
686
- padding: 1em;
687
- }
688
-
689
- .page-builders [type=radio] {
690
- position: absolute;
691
- opacity: 0;
692
- width: 0;
693
- height: 0;
694
- }
695
-
696
- .page-builders [type=radio] + img {
697
- cursor: pointer;
698
- opacity: .9;
699
- border: 3px solid transparent;
700
- border-radius: 10px;
701
- transition: all linear 0.2s;
702
- }
703
-
704
- .page-builders [type=radio]:hover + img,
705
- .page-builders [type=radio]:checked + img {
706
- opacity: 1;
707
- }
708
-
709
- .astra-sites-page-builder-notice {
710
- text-align: center;
711
- margin: 1em 0 2em 0;
712
- }
713
-
714
- .current-importing-status-wrap {
715
- font-size: 1rem;
716
- }
717
-
718
- .current-importing-status-wrap hr {
719
- border-color: #f1f1f1;
720
- }
721
-
722
- .astra-sites-result-preview {
723
- position: absolute;
724
- left: 0;
725
- right: 0;
726
- top: 0;
727
- bottom: 0;
728
- background: #fff;
729
- overflow-y: auto;
730
- }
731
-
732
- .astra-sites-result-preview .button {
733
- margin-top: 1em;
734
- }
735
-
736
- .astra-sites-result-preview .inner {
737
- margin: 0 auto;
738
- max-width: 700px;
739
- padding: 5em 0;
740
- }
741
-
742
- .astra-sites-result-preview h2 {
743
- font-size: 2rem;
744
- }
745
-
746
- .astra-sites-result-preview p {
747
- font-size: 1rem;
748
- }
749
-
750
- .current-importing-status {
751
- font-size: 1rem;
752
- background: #eeeeee;
753
- padding: 1em 1.5em;
754
- }
755
-
756
- .current-importing-status-title {
757
- margin-bottom: .5em;
758
- }
759
-
760
- .appearance_page_astra-sites .rotating {
761
- height: auto;
762
- animation: rotation 2s infinite linear;
763
- width: auto;
764
- color: #c1c1c1;
765
- }
766
-
767
- @-webkit-keyframes rotation {
768
- from {
769
- -webkit-transform: rotate(0deg);
770
- }
771
- to {
772
- -webkit-transform: rotate(359deg);
773
- }
774
- }
775
- .import-time {
776
- display: inline-block;
777
- background: #0185ba;
778
- color: #fff;
779
- padding: 2px 10px;
780
- border-radius: 3px;
781
- animation: astra-scale 0.5s alternate infinite ease-in;
782
- }
783
-
784
- @keyframes astra-scale {
785
- 0% {transform: scale(1);}
786
- 100% {transform: scale(1.03);}
787
- }
788
-
789
- .current-importing-status p {
790
- margin: 0;
791
}
1
+ .wrap .status,
2
+ .wrap .site-type {
3
+ position: absolute;
4
+ z-index: 1;
5
+ color: #fff;
6
+ padding: 0.5em 1em;
7
+ top: -0.5em;
8
+ text-transform: uppercase;
9
+ }
10
+ .wrap .status,
11
+ .wrap .site-type.premium {
12
+ background: #0073aa;
13
+ }
14
+ .wrap .status {
15
+ left: -0.5em;
16
+ }
17
+ .wrap .site-type.premium {
18
+ right: -0.5em;
19
+ }
20
+
21
+ .wrap .status.publish,
22
+ .wrap .site-type.free {
23
+ display: none;
24
+ }
25
+
26
+ .install-theme-info .site-type {
27
+ display: none;
28
+ }
29
+
30
+ .theme {
31
+ position: relative;
32
+ }
33
+ .wrap .astra-sites-preview .site-type.premium {
34
+ display: block;
35
+ display: none;
36
+ position: relative;
37
+ margin: 0.5em 0em 1em 0em;
38
+ top: 0;
39
+ left: 0;
40
+ text-align: center;
41
+ }
42
+
43
+ .theme-details-read-more.open {
44
+ margin: 0.5em 0 0 0;
45
+ }
46
+
47
+ .astra-sites-preview .theme-screenshot {
48
+ width: 100%;
49
+ }
50
+
51
+ .install-theme-info .site-type.premium {
52
+ display: none;
53
+ }
54
+
55
+ /**
56
+ * Required Plugins
57
+ */
58
+ .required-plugins.loading {
59
+ text-align: center;
60
+ }
61
+ .required-plugins button {
62
+ float: right;
63
+ }
64
+ .required-plugins .plugin-card {
65
+ float: none;
66
+ width: 100%;
67
+ border: none;
68
+ margin: 0 0 0.8em 0;
69
+ display: flex;
70
+ justify-content: space-between;
71
+ align-items: center;
72
+ transition: background ease 0.8s;
73
+ }
74
+ .required-plugins .plugin-card.plugin-card-update-failed {
75
+ flex-wrap: wrap;
76
+ }
77
+ .required-plugins .spinner {
78
+ float: none;
79
+ margin: 0;
80
+ }
81
+
82
+ .expanded .wp-full-overlay-footer {
83
+ height: 111px;
84
+ }
85
+
86
+ .wp-full-overlay-footer .view-site,
87
+ .wp-full-overlay-footer .go-pro,
88
+ .wp-full-overlay-footer .astra-demo-import {
89
+ width: 100%;
90
+ text-align: center;
91
+ }
92
+
93
+ .wp-core-ui .wp-full-overlay-footer .button.button-hero,
94
+ .wp-core-ui .wp-full-overlay-footer .button-group.button-hero .button {
95
+ padding: 0 10px 1px;
96
+ }
97
+
98
+ .wp-full-overlay-footer .installing:before {
99
+ vertical-align: text-bottom;
100
+ }
101
+
102
+ .astra-sites-advanced-options-wrap h4 {
103
+ margin: 1em 0 0.5em 0;
104
+ padding: 0.5em 0;
105
+ transition: all ease 0.3s;
106
+ }
107
+
108
+ /**
109
+ * Read more link
110
+ */
111
+ .wp-core-ui .theme-details-read-more:focus,
112
+ .wp-core-ui .theme-details-read-more:hover {
113
+ outline: none;
114
+ box-shadow: none;
115
+ }
116
+ .wp-core-ui .theme-details-read-more {
117
+ margin: 10px 0;
118
+ display: none;
119
+ text-decoration: none;
120
+ }
121
+
122
+ /**
123
+ * Go pro.
124
+ */
125
+ .wp-core-ui .go-pro.button[disabled] {
126
+ background-color: #fcb92c !important;
127
+ color: white !important;
128
+ box-shadow: 1px 0 #eab23a !important;
129
+ text-shadow: 1px 0 #6b4e13 !important;
130
+ border-color: #e2a932 !important;
131
+ cursor: pointer;
132
+ }
133
+ .wp-core-ui .view-site .dashicons,
134
+ .wp-core-ui .go-pro .dashicons {
135
+ font-size: 1rem;
136
+ vertical-align: middle;
137
+ }
138
+
139
+ /**
140
+ * Errors
141
+ */
142
+ .plugin-card-update-failed .notice {
143
+ margin-top: 1.5em;
144
+ }
145
+
146
+ .no-themes {
147
+ margin-top: 40px;
148
+ }
149
+
150
+ .no-themes p {
151
+ font-size: 15px;
152
+ }
153
+
154
+ .no-themes .left-margin {
155
+ margin-left: 30px;
156
+ }
157
+
158
+ /**
159
+ *
160
+ */
161
+ .astra-sites-preview .wp-full-overlay-sidebar-content {
162
+ bottom: 100px;
163
+ }
164
+
165
+ .footer-import-button-wrap {
166
+ padding: 10px 20px;
167
+ }
168
+
169
+ .footer-import-button-wrap .button {
170
+ margin: 0;
171
+ }
172
+
173
+ .astra-sites-preview.expanded .wp-full-overlay-footer {
174
+ left: initial;
175
+ }
176
+
177
+ /**
178
+ * Menu Page
179
+ */
180
+ .astra-sites-title {
181
+ float: left;
182
+ font-size: 23px;
183
+ font-weight: 400;
184
+ margin: 0 0 6px 0px;
185
+ padding: 0;
186
+ line-height: 29px;
187
+ }
188
+
189
+ #astra-sites-menu-page {
190
+ margin-top: 10px;
191
+ }
192
+
193
+ /**
194
+ * API Error
195
+ */
196
+ .astra-api-error {
197
+ margin: 0 0 0.5em 0;
198
+ }
199
+
200
+ /**
201
+ * Grid
202
+ */
203
+ .wp-filter .search-form {
204
+ margin-left: 1em;
205
+ }
206
+ .wp-filter .search-form input[type="search"] {
207
+ width: 200px;
208
+ font-size: 13px;
209
+ padding: 5px 10px;
210
+ }
211
+ .section-left {
212
+ display: inline-block;
213
+ }
214
+ .section-right {
215
+ float: right;
216
+ }
217
+ .filter-count {
218
+ min-width: 3em;
219
+ }
220
+ .astra-site-preview-on {
221
+ overflow: hidden;
222
+ }
223
+
224
+ .appearance_page_astra-sites .notice {
225
+ margin-left: 0;
226
+ width: auto;
227
+ float: none;
228
+ margin-right: 220px;
229
+ }
230
+
231
+ .filters-wrap {
232
+ display: inline-block;
233
+ }
234
+ .spinner-wrap {
235
+ text-align: center;
236
+ }
237
+ .spinner-wrap .spinner {
238
+ float: none;
239
+ }
240
+ .hide-me {
241
+ display: none !important;
242
+ }
243
+ #astra-sites-admin {
244
+ height: 100vh;
245
+ }
246
+ .install-theme-info > .notice {
247
+ margin: 5px 0 10px 0;
248
+ }
249
+
250
+ .astra-sites-suggestions:before {
251
+ border: 5px dashed #ccc;
252
+ position: absolute;
253
+ left: 0;
254
+ right: 0;
255
+ top: 0;
256
+ bottom: 0px;
257
+ }
258
+
259
+ .astra-sites-suggestions {
260
+ min-height: 280px;
261
+ border: none !important;
262
+ }
263
+
264
+ .astra-sites-suggestions a {
265
+ border: none;
266
+ outline: none;
267
+ }
268
+
269
+ .astra-sites-suggestions .inner {
270
+ border: 6px solid #24282e !important;
271
+ padding: 27% 10% 50% 10%;
272
+ text-align: center;
273
+ position: absolute;
274
+ left: 0;
275
+ right: 0;
276
+ top: 0;
277
+ background: #33383d;
278
+ bottom: 0;
279
+ color: #eee;
280
+ cursor: auto;
281
+ }
282
+
283
+ .astra-sites-suggestions .inner a {
284
+ color: #00b9eb;
285
+ }
286
+
287
+ .astra-sites-suggestions p {
288
+ font-size: 1rem;
289
+ margin: 0;
290
+ }
291
+
292
+ .astra-notice {
293
+ margin: 2em 2em 0em 0em;
294
+ }
295
+
296
+ .no-themes .description {
297
+ display: block;
298
+ }
299
+
300
+ /**
301
+ * Responsive Button UI
302
+ */
303
+ .astra-sites-preview .wp-full-overlay-footer .devices button.active:before,
304
+ .astra-sites-preview .wp-full-overlay-footer .devices button:hover:before {
305
+ color: #0073aa;
306
+ }
307
+ .astra-sites-preview .wp-full-overlay-footer .devices button:before {
308
+ color: #c1c1c1;
309
+ }
310
+ .astra-sites-preview .wp-full-overlay-footer .devices button:hover {
311
+ background-color: transparent;
312
+ }
313
+ .astra-sites-preview .wp-full-overlay-footer .devices button {
314
+ border: none;
315
+ }
316
+ .astra-sites-preview .wp-full-overlay-footer .devices button:focus,
317
+ .astra-sites-preview .wp-full-overlay-footer .devices button.active:hover {
318
+ border-bottom-color: transparent;
319
+ background-color: transparent;
320
+ }
321
+ .not-click-able {
322
+ pointer-events: none !important;
323
+ }
324
+ body.page-builder-selected .select-page-builder,
325
+ body.loading-content .select-page-builder {
326
+ display: none;
327
+ }
328
+ .select-page-builder .up-arrow {
329
+ -webkit-transform: rotate(90deg);
330
+ -moz-transform: rotate(90deg);
331
+ -ms-transform: rotate(90deg);
332
+ transform: rotate(90deg);
333
+ display: inline-block;
334
+ font-size: 1.5em;
335
+ color: #797979;
336
+ vertical-align: middle;
337
+ margin-right: 10px;
338
+ -webkit-transition: all linear 0.6s;
339
+ -moz-transition: all linear 0.6s;
340
+ -ms-transition: all linear 0.6s;
341
+ transition: all linear 0.6s;
342
+ -webkit-animation-duration: 1s;
343
+ animation-duration: 1s;
344
+ -webkit-animation-fill-mode: both;
345
+ animation-fill-mode: both;
346
+ -webkit-animation-timing-function: ease-in-out;
347
+ animation-timing-function: ease-in-out;
348
+ animation-iteration-count: infinite;
349
+ -webkit-animation-iteration-count: infinite;
350
+ animation-name: bounce;
351
+ -moz-animation-name: bounce;
352
+ }
353
+ .select-page-builder {
354
+ margin-left: 6em;
355
+ }
356
+
357
+ .select-page-builder img {
358
+ max-width: 100%;
359
+ }
360
+
361
+ .select-page-builder .note-wrap {
362
+ position: absolute;
363
+ padding: 40px 0;
364
+ margin-left: 170px;
365
+ right: 0;
366
+ left: 0;
367
+ }
368
+
369
+ .select-page-builder h3 {
370
+ margin: 0;
371
+ font-size: 2em;
372
+ }
373
+ .select-page-builder {
374
+ margin: -20px 0 0 -5px;
375
+ position: absolute;
376
+ }
377
+ .select-page-builder .note {
378
+ margin-left: 1.5em;
379
+ }
380
+
381
+ @keyframes bounce {
382
+ 0%,
383
+ 100%,
384
+ 20%,
385
+ 50%,
386
+ 80% {
387
+ -webkit-transform: translateY(-0px) rotate(90deg);
388
+ -moz-transform: translateY(-0px) rotate(90deg);
389
+ -ms-transform: translateY(-0px) rotate(90deg);
390
+ transform: translateY(-0px) rotate(90deg);
391
+ }
392
+ 40% {
393
+ -webkit-transform: translateY(-2px) rotate(90deg);
394
+ -moz-transform: translateY(-2px) rotate(90deg);
395
+ -ms-transform: translateY(-2px) rotate(90deg);
396
+ transform: translateY(-2px) rotate(90deg);
397
+ }
398
+ 60% {
399
+ -webkit-transform: translateY(-1px) rotate(90deg);
400
+ -moz-transform: translateY(-1px) rotate(90deg);
401
+ -ms-transform: translateY(-1px) rotate(90deg);
402
+ transform: translateY(-1px) rotate(90deg);
403
+ }
404
+ }
405
+
406
+ /**
407
+ * Processing Animation
408
+ */
409
+ .astra-demo-import.disabled {
410
+ pointer-events: none;
411
+ }
412
+ .astra-demo-import.button.updating-message:before,
413
+ .astra-demo-import.button.installing:before {
414
+ -webkit-animation: cssAnimation .72s ease infinite;
415
+ -moz-animation: cssAnimation .72s ease infinite;
416
+ -o-animation: cssAnimation .72s ease infinite;
417
+ -ms-animation: cssAnimation .72s ease infinite;
418
+ animation: cssAnimation .72s ease infinite;
419
+ }
420
+
421
+ @-webkit-keyframes cssAnimation {
422
+ from {
423
+ -webkit-transform: rotate(0);
424
+ -moz-transform: rotate(0);
425
+ -o-transform: rotate(0);
426
+ -ms-transform: rotate(0);
427
+ transform: rotate(0);
428
+ }
429
+ to {
430
+ -webkit-transform: rotate(360deg);
431
+ -moz-transform: rotate(360deg);
432
+ -o-transform: rotate(360deg);
433
+ -ms-transform: rotate(360deg);
434
+ transform: rotate(360deg);
435
+ }
436
+ }
437
+ @-moz-keyframes cssAnimation {
438
+ from {
439
+ -webkit-transform: rotate(0);
440
+ -moz-transform: rotate(0);
441
+ -o-transform: rotate(0);
442
+ -ms-transform: rotate(0);
443
+ transform: rotate(0);
444
+ }
445
+ to {
446
+ -webkit-transform: rotate(360deg);
447
+ -moz-transform: rotate(360deg);
448
+ -o-transform: rotate(360deg);
449
+ -ms-transform: rotate(360deg);
450
+ transform: rotate(360deg);
451
+ }
452
+ }
453
+ @-o-keyframes cssAnimation {
454
+ from {
455
+ -webkit-transform: rotate(0);
456
+ -moz-transform: rotate(0);
457
+ -o-transform: rotate(0);
458
+ -ms-transform: rotate(0);
459
+ transform: rotate(0);
460
+ }
461
+ to {
462
+ -webkit-transform: rotate(360deg);
463
+ -moz-transform: rotate(360deg);
464
+ -o-transform: rotate(360deg);
465
+ -ms-transform: rotate(360deg);
466
+ transform: rotate(360deg);
467
+ }
468
+ }
469
+
470
+ #astra-sites-filters {
471
+ display: inline-block;
472
+ width: 100%;
473
+ }
474
+
475
+ .astra-site-down {
476
+ padding: 1em 2em;
477
+ margin-top: 1em;
478
+ }
479
+
480
+ #astra-sites-menu-page .nav-tab-wrapper {
481
+ border: none;
482
+ }
483
+
484
+ #astra-sites-filters .wp-filter {
485
+ margin-top: 0;
486
+ }
487
+
488
+ /**
489
+ * Welcome Screen
490
+ */
491
+ .astra-sites-welcome {
492
+ padding: 10em 0;
493
+ text-align: center;
494
+ }
495
+ .astra-sites-welcome .inner {
496
+ margin: 0 auto;
497
+ display: inline-block;
498
+ max-width: 700px;
499
+ background: #fff;
500
+ padding: 3em;
501
+ }
502
+
503
+ .astra-sites-welcome h1 {
504
+ font-size: 2.5em;
505
+ margin-bottom: 1em;
506
+ }
507
+
508
+ .astra-sites-welcome p {
509
+ font-size: 1rem;
510
+ }
511
+
512
+ .astra-sites-welcome select {
513
+ padding: 5px;
514
+ height: 100%;
515
+ }
516
+
517
+ .astra-sites-welcome .submit {
518
+ text-align: center;
519
+ margin: 0;
520
+ padding: 0;
521
+ margin-left: .5em;
522
+ }
523
+
524
+ .astra-sites-welcome .disabled {
525
+ pointer-events: none;
526
+ }
527
+
528
+ .astra-site-page-builder {
529
+ opacity: 0;
530
+ visibility: hidden;
531
+ }
532
+
533
+ .astra-sites-third-party-required-plugins-wrap .notice {
534
+ margin: 0;
535
+ }
536
+
537
+ .required-plugins-list,
538
+ .astra-sites-third-party-required-plugins {
539
+ margin-left: 2em;
540
+ margin-top: .5em;
541
+ margin-bottom: .5em;
542
+ list-style-type: disc;
543
+ }
544
+
545
+ .astra-sites-third-party-required-plugins .plugin-card,
546
+ .required-plugins-list .plugin-card {
547
+ background: transparent;
548
+ border: none;
549
+ margin: 0;
550
+ line-height: 2;
551
+ float: none;
552
+ width: 100%;
553
+ }
554
+
555
+ .required-plugins-list .spinner {
556
+ float: none;
557
+ margin: 0;
558
+ }
559
+
560
+ .astra-site-import-process-wrap {
561
+ display: flex;
562
+ align-items: center;
563
+ margin-top: -2px;
564
+ z-index: 999999;
565
+ position: relative;
566
+ border-radius: 3px;
567
+ overflow: hidden;
568
+ }
569
+
570
+ .astra-sites-result-preview .astra-site-import-process-wrap progress {
571
+ background: #eeeeee;
572
+ }
573
+
574
+ .astra-sites-result-preview .astra-site-import-process-wrap progress::-webkit-progress-value {
575
+ background: #0185ba;
576
+ }
577
+
578
+ .astra-site-import-process-wrap progress {
579
+ padding: 0px;
580
+ border: 0 none;
581
+ background: #0085bd;
582
+ border-radius: 5px;
583
+ height: 4px;
584
+ flex: 1;
585
+ }
586
+
587
+ .astra-sites-result-preview .dashicons {
588
+ vertical-align: text-bottom;
589
+ }
590
+
591
+ .astra-site-import-process-wrap progress::-webkit-progress-value {
592
+ background: #00679b;
593
+ }
594
+
595
+ .astra-site-import-process-wrap progress::-webkit-progress-bar {
596
+ background: transparent;
597
+ }
598
+
599
+ .theme-browser .theme .site-preview > .theme-screenshot {
600
+ transition: all linear 5s;
601
+ background-position: center top;
602
+ background-size: cover;
603
+ background-repeat: no-repeat;
604
+ }
605
+ .theme-browser .theme .site-preview > .theme-screenshot:hover {
606
+ background-position: center bottom;
607
+ background-size: cover;
608
+ }
609
+
610
+ .astra-sites-tooltip-icon {
611
+ cursor: pointer;
612
+ }
613
+
614
+ .astra-sites-preview .disabled {
615
+ pointer-events: none;
616
+ }
617
+
618
+ .astra-sites-preview input[type="checkbox"].disabled {
619
+ background: #eeeeee;
620
+ opacity: 1;
621
+ color: #fff;
622
+ box-shadow: none;
623
+ border-color: #b4b9be;
624
+ }
625
+
626
+ .astra-sites-tooltip-icon .dashicons {
627
+ color: #757575;
628
+ font-size: 15px;
629
+ vertical-align: middle;
630
+ height: auto;
631
+ }
632
+
633
+ #astra-sites-welcome-form-inline {
634
+ position: absolute;
635
+ right: 1em;
636
+ top: 0;
637
+ border-radius: 0;
638
+ line-height: 1.7;
639
+ padding: 0px 5px 2px 5px;
640
+ outline: 2px solid transparent;
641
+ outline-offset: 0;
642
+ background: #fafafa;
643
+ border: 1px solid #ccc;
644
+ color: #72777c;
645
+ font-weight: normal;
646
+ font-size: 10px;
647
+ font-size: 13px;
648
+ line-height: 26px;
649
+ height: 28px;
650
+ cursor: pointer;
651
+ }
652
+
653
+ #astra-sites-welcome-form-inline select,
654
+ #astra-sites-welcome-form-inline select:focus {
655
+ border: none;
656
+ outline: none;
657
+ box-shadow: none;
658
+ color: #72777c;
659
+ }
660
+
661
+ #astra-sites-menu-page .wp-full-overlay-main:before {
662
+ content: '';
663
+ display: none;
664
+ }
665
+
666
+ .theme-screenshot-wrap {
667
+ overflow: hidden;
668
+ max-height: 300px;
669
+ margin: 15px 0;
670
+ border: 1px solid #ccc;
671
+ }
672
+
673
+ .astra-sites-preview .install-theme-info .theme-screenshot {
674
+ width: 100%;
675
+ border: none;
676
+ margin: 0;
677
+ }
678
+
679
+ #astra-sites-welcome-form #submit {
680
+ padding: 0em 4rem;
681
+ }
682
+
683
+ .page-builders li {
684
+ cursor: pointer;
685
+ display: inline-block;
686
+ padding: 1em;
687
+ }
688
+
689
+ .page-builders [type=radio] {
690
+ position: absolute;
691
+ opacity: 0;
692
+ width: 0;
693
+ height: 0;
694
+ }
695
+
696
+ .page-builders [type=radio] + img {
697
+ cursor: pointer;
698
+ opacity: .9;
699
+ border: 3px solid transparent;
700
+ border-radius: 10px;
701
+ transition: all linear 0.2s;
702
+ }
703
+
704
+ .page-builders [type=radio]:hover + img,
705
+ .page-builders [type=radio]:checked + img {
706
+ opacity: 1;
707
+ }
708
+
709
+ .astra-sites-page-builder-notice {
710
+ text-align: center;
711
+ margin: 1em 0 2em 0;
712
+ }
713
+
714
+ .current-importing-status-wrap {
715
+ font-size: 1rem;
716
+ }
717
+
718
+ .current-importing-status-wrap hr {
719
+ border-color: #f1f1f1;
720
+ }
721
+
722
+ .astra-sites-result-preview {
723
+ position: absolute;
724
+ left: 0;
725
+ right: 0;
726
+ top: 0;
727
+ bottom: 0;
728
+ background: #fff;
729
+ overflow-y: auto;
730
+ }
731
+
732
+ .astra-sites-result-preview .button {
733
+ margin-top: 1em;
734
+ }
735
+
736
+ .astra-sites-result-preview .inner {
737
+ margin: 0 auto;
738
+ max-width: 700px;
739
+ padding: 5em 0;
740
+ }
741
+
742
+ .astra-sites-result-preview h2 {
743
+ font-size: 2rem;
744
+ }
745
+
746
+ .astra-sites-result-preview p {
747
+ font-size: 1rem;
748
+ }
749
+
750
+ .current-importing-status {
751
+ font-size: 1rem;
752
+ background: #eeeeee;
753
+ padding: 1em 1.5em;
754
+ }
755
+
756
+ .current-importing-status-title {
757
+ margin-bottom: .5em;
758
+ }
759
+
760
+ .appearance_page_astra-sites .rotating {
761
+ height: auto;
762
+ animation: rotation 2s infinite linear;
763
+ width: auto;
764
+ color: #c1c1c1;
765
+ }
766
+
767
+ @-webkit-keyframes rotation {
768
+ from {
769
+ -webkit-transform: rotate(0deg);
770
+ }
771
+ to {
772
+ -webkit-transform: rotate(359deg);
773
+ }
774
+ }
775
+ .import-time {
776
+ display: inline-block;
777
+ background: #0185ba;
778
+ color: #fff;
779
+ padding: 2px 10px;
780
+ border-radius: 3px;
781
+ animation: astra-scale 0.5s alternate infinite ease-in;
782
+ }
783
+
784
+ @keyframes astra-scale {
785
+ 0% {transform: scale(1);}
786
+ 100% {transform: scale(1.03);}
787
+ }
788
+
789
+ .current-importing-status p {
790
+ margin: 0;
791
}
inc/assets/css/install-theme.css CHANGED
@@ -1,21 +1,21 @@
1
- .processing:before {
2
- margin: 0 3px 0px 0px;
3
- }
4
- .processing:before {
5
- animation: rotation 2s infinite linear;
6
- }
7
- .processing:before {
8
- color: #f56e28;
9
- content: "\f463";
10
- }
11
- .processing:before {
12
- display: inline-block;
13
- font: normal 20px/1 dashicons;
14
- -webkit-font-smoothing: antialiased;
15
- -moz-osx-font-smoothing: grayscale;
16
- vertical-align: top;
17
- }
18
- #astra-theme-activation-nag a {
19
- box-shadow: none;
20
- outline: none;
21
}
1
+ .processing:before {
2
+ margin: 0 3px 0px 0px;
3
+ }
4
+ .processing:before {
5
+ animation: rotation 2s infinite linear;
6
+ }
7
+ .processing:before {
8
+ color: #f56e28;
9
+ content: "\f463";
10
+ }
11
+ .processing:before {
12
+ display: inline-block;
13
+ font: normal 20px/1 dashicons;
14
+ -webkit-font-smoothing: antialiased;
15
+ -moz-osx-font-smoothing: grayscale;
16
+ vertical-align: top;
17
+ }
18
+ #astra-theme-activation-nag a {
19
+ box-shadow: none;
20
+ outline: none;
21
}
inc/assets/js/admin-page.js CHANGED
@@ -1,1863 +1,1872 @@
1
- /**
2
- * AJAX Request Queue
3
- *
4
- * - add()
5
- * - remove()
6
- * - run()
7
- * - stop()
8
- *
9
- * @since 1.0.0
10
- */
11
- var AstraSitesAjaxQueue = (function() {
12
-
13
- var requests = [];
14
-
15
- return {
16
-
17
- /**
18
- * Add AJAX request
19
- *
20
- * @since 1.0.0
21
- */
22
- add: function(opt) {
23
- requests.push(opt);
24
- },
25
-
26
- /**
27
- * Remove AJAX request
28
- *
29
- * @since 1.0.0
30
- */
31
- remove: function(opt) {
32
- if( jQuery.inArray(opt, requests) > -1 )
33
- requests.splice($.inArray(opt, requests), 1);
34
- },
35
-
36
- /**
37
- * Run / Process AJAX request
38
- *
39
- * @since 1.0.0
40
- */
41
- run: function() {
42
- var self = this,
43
- oriSuc;
44
-
45
- if( requests.length ) {
46
- oriSuc = requests[0].complete;
47
-
48
- requests[0].complete = function() {
49
- if( typeof(oriSuc) === 'function' ) oriSuc();
50
- requests.shift();
51
- self.run.apply(self, []);
52
- };
53
-
54
- jQuery.ajax(requests[0]);
55
-
56
- } else {
57
-
58
- self.tid = setTimeout(function() {
59
- self.run.apply(self, []);
60
- }, 1000);
61
- }
62
- },
63
-
64
- /**
65
- * Stop AJAX request
66
- *
67
- * @since 1.0.0
68
- */
69
- stop: function() {
70
-
71
- requests = [];
72
- clearTimeout(this.tid);
73
- }
74
- };
75
-
76
- }());
77
-
78
- (function($){
79
-
80
- var AstraSSEImport = {
81
- complete: {
82
- posts: 0,
83
- media: 0,
84
- users: 0,
85
- comments: 0,
86
- terms: 0,
87
- },
88
-
89
- updateDelta: function (type, delta) {
90
- this.complete[ type ] += delta;
91
-
92
- var self = this;
93
- requestAnimationFrame(function () {
94
- self.render();
95
- });
96
- },
97
- updateProgress: function ( type, complete, total ) {
98
- var text = complete + '/' + total;
99
-
100
- if( 'undefined' !== type && 'undefined' !== text ) {
101
- total = parseInt( total, 10 );
102
- if ( 0 === total || isNaN( total ) ) {
103
- total = 1;
104
- }
105
- var percent = parseInt( complete, 10 ) / total;
106
- var progress = Math.round( percent * 100 ) + '%';
107
- var progress_bar = percent * 100;
108
-
109
- if( progress_bar <= 100 ) {
110
- var process_bars = document.getElementsByClassName( 'astra-site-import-process' );
111
- for ( var i = 0; i < process_bars.length; i++ ) {
112
- process_bars[i].value = progress_bar;
113
- }
114
- AstraSitesAdmin._log_title( 'Importing Content.. ' + progress );
115
- }
116
- }
117
- },
118
- render: function () {
119
- var types = Object.keys( this.complete );
120
- var complete = 0;
121
- var total = 0;
122
-
123
- for (var i = types.length - 1; i >= 0; i--) {
124
- var type = types[i];
125
- this.updateProgress( type, this.complete[ type ], this.data.count[ type ] );
126
-
127
- complete += this.complete[ type ];
128
- total += this.data.count[ type ];
129
- }
130
-
131
- this.updateProgress( 'total', complete, total );
132
- }
133
- };
134
-
135
- AstraSitesAdmin = {
136
-
137
- reset_remaining_posts: 0,
138
- reset_remaining_wp_forms: 0,
139
- reset_remaining_terms: 0,
140
- reset_processed_posts: 0,
141
- reset_processed_wp_forms: 0,
142
- reset_processed_terms: 0,
143
- site_imported_data: null,
144
-
145
- backup_taken: false,
146
-
147
- current_site: [],
148
- current_screen: '',
149
-
150
- templateData: {},
151
-
152
- log_file : '',
153
- customizer_data : '',
154
- wxr_url : '',
155
- wpforms_url : '',
156
- options_data : '',
157
- widgets_data : '',
158
- import_start_time : '',
159
- import_end_time : '',
160
-
161
- init: function()
162
- {
163
- this._resetPagedCount();
164
- this._bind();
165
- },
166
-
167
- /**
168
- * Debugging.
169
- *
170
- * @param {mixed} data Mixed data.
171
- */
172
- _log: function( data ) {
173
-
174
- if( astraSitesAdmin.debug ) {
175
-
176
- var date = new Date();
177
- var time = date.toLocaleTimeString();
178
-
179
- if (typeof data == 'object') {
180
- console.log('%c ' + JSON.stringify( data ) + ' ' + time, 'background: #ededed; color: #444');
181
- } else {
182
- console.log('%c ' + data + ' ' + time, 'background: #ededed; color: #444');
183
- }
184
-
185
-
186
- }
187
- },
188
-
189
- _log_title: function( data, append ) {
190
-
191
- var markup = '<p>' + data + '</p>';
192
- if (typeof data == 'object' ) {
193
- var markup = '<p>' + JSON.stringify( data ) + '</p>';
194
- }
195
-
196
- if ( append ) {
197
- $('.current-importing-status-title').append( markup );
198
- } else {
199
- $('.current-importing-status-title').html( markup );
200
- }
201
- },
202
-
203
- /**
204
- * Binds events for the Astra Sites.
205
- *
206
- * @since 1.0.0
207
- * @access private
208
- * @method _bind
209
- */
210
- _bind: function()
211
- {
212
- $( document ).on( 'click' , '.astra-sites-reset-data .checkbox', AstraSitesAdmin._toggle_reset_notice );
213
- $( document ).on( 'click' , '.page-builders li', AstraSitesAdmin._toggle_reset_notice );
214
- $( document ).on('click' , '#astra-sites-welcome-form .submit', AstraSitesAdmin._show_page_builder_notice);
215
- $( document ).on('click' , '#astra-sites-welcome-form li', AstraSitesAdmin._show_next_button);
216
- $( document ).on('change' , '#astra-sites-welcome-form-inline select', AstraSitesAdmin._change_page_builder);
217
- $( document ).on('click' , '.astra-sites-tooltip-icon', AstraSitesAdmin._toggle_tooltip);
218
- $( document ).on('click' , '.astra-sites-advanced-options-button', AstraSitesAdmin._toggle_advanced_options);
219
-
220
- $( document ).on('click' , '.astra-import-settings', AstraSitesAdmin._import_settings);
221
- $( document ).on('click' , '.devices button', AstraSitesAdmin._previewDevice);
222
- $( document ).on('click' , '.theme-browser .theme-screenshot, .theme-browser .more-details, .theme-browser .install-theme-preview', AstraSitesAdmin._preview);
223
- $( document ).on('click' , '.next-theme', AstraSitesAdmin._nextTheme);
224
- $( document ).on('click' , '.previous-theme', AstraSitesAdmin._previousTheme);
225
- $( document ).on('click' , '.collapse-sidebar', AstraSitesAdmin._collapse);
226
- $( document ).on('click' , '.astra-demo-import', AstraSitesAdmin._importDemo);
227
-
228
- $( document ).on('astra-sites-install-and-activate-required-plugins-done' , AstraSitesAdmin._process_import );
229
-
230
- $( document ).on('click' , '.install-now', AstraSitesAdmin._installNow);
231
- $( document ).on('click' , '.close-full-overlay', AstraSitesAdmin._fullOverlay);
232
- $( document ).on('click' , '.activate-now', AstraSitesAdmin._activateNow);
233
- $( document ).on('wp-plugin-installing' , AstraSitesAdmin._pluginInstalling);
234
- $( document ).on('wp-plugin-install-error' , AstraSitesAdmin._installError);
235
- $( document ).on('wp-plugin-install-success' , AstraSitesAdmin._installSuccess);
236
-
237
- $( document ).on( 'astra-sites-import-set-site-data-done' , AstraSitesAdmin._resetData );
238
- $( document ).on( 'astra-sites-reset-data' , AstraSitesAdmin._backup_before_rest_options );
239
- $( document ).on( 'astra-sites-backup-settings-before-reset-done' , AstraSitesAdmin._reset_customizer_data );
240
- $( document ).on( 'astra-sites-reset-customizer-data-done' , AstraSitesAdmin._reset_site_options );
241
- $( document ).on( 'astra-sites-reset-site-options-done' , AstraSitesAdmin._reset_widgets_data );
242
- $( document ).on( 'astra-sites-reset-widgets-data-done' , AstraSitesAdmin._reset_terms );
243
- $( document ).on( 'astra-sites-delete-terms-done' , AstraSitesAdmin._reset_wp_forms );
244
- $( document ).on( 'astra-sites-delete-wp-forms-done' , AstraSitesAdmin._reset_posts );
245
-
246
- $( document ).on('astra-sites-reset-data-done' , AstraSitesAdmin._recheck_backup_options );
247
- $( document ).on('astra-sites-backup-settings-done' , AstraSitesAdmin._importWPForms );
248
- $( document ).on('astra-sites-import-wpforms-done' , AstraSitesAdmin._importCustomizerSettings );
249
- $( document ).on('astra-sites-import-customizer-settings-done' , AstraSitesAdmin._importXML );
250
- $( document ).on('astra-sites-import-xml-done' , AstraSitesAdmin._importSiteOptions );
251
- $( document ).on('astra-sites-import-options-done' , AstraSitesAdmin._importWidgets );
252
- $( document ).on('astra-sites-import-widgets-done' , AstraSitesAdmin._importEnd );
253
-
254
- },
255
-
256
- _show_next_button: function() {
257
- $( this ).parents('.page-builders').find('img').removeClass('wp-ui-highlight');
258
- $( this ).find('img').addClass('wp-ui-highlight');
259
-
260
- $('#submit').parent().removeClass('submit');
261
- $('#submit').removeClass('disabled');
262
- $('.astra-sites-page-builder-notice').hide();
263
- },
264
-
265
- _show_page_builder_notice: function() {
266
- $('.astra-sites-page-builder-notice').show();
267
- },
268
-
269
- _change_page_builder: function() {
270
- $(this).closest('form').submit();
271
- },
272
-
273
- _toggle_tooltip: function( event ) {
274
- event.preventDefault();
275
- var tip_id = $( this ).data('tip-id') || '';
276
- if( tip_id && $( '#' + tip_id ).length ) {
277
- $( '#' + tip_id ).toggle();
278
- }
279
- },
280
-
281
- _toggle_advanced_options: function( event ) {
282
- event.preventDefault();
283
- $('.astra-sites-advanced-options').toggle();
284
- },
285
-
286
- _resetData: function( event ) {
287
- event.preventDefault();
288
-
289
- if ( $( '.astra-sites-reset-data' ).find('.checkbox').is(':checked') ) {
290
- $(document).trigger( 'astra-sites-reset-data' );
291
- } else {
292
- $(document).trigger( 'astra-sites-reset-data-done' );
293
- }
294
- },
295
-
296
- _reset_customizer_data: function() {
297
- $.ajax({
298
- url : astraSitesAdmin.ajaxurl,
299
- type : 'POST',
300
- data : {
301
- action : 'astra-sites-reset-customizer-data'
302
- },
303
- beforeSend: function() {
304
- AstraSitesAdmin._log_title( 'Reseting Customizer Data..' );
305
- },
306
- })
307
- .fail(function( jqXHR ){
308
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
309
- })
310
- .done(function ( data ) {
311
- AstraSitesAdmin._log_title( 'Complete Resetting Customizer Data..' );
312
- $(document).trigger( 'astra-sites-reset-customizer-data-done' );
313
- });
314
- },
315
-
316
- _reset_site_options: function() {
317
- // Site Options.
318
- $.ajax({
319
- url : astraSitesAdmin.ajaxurl,
320
- type : 'POST',
321
- data : {
322
- action : 'astra-sites-reset-site-options'
323
- },
324
- beforeSend: function() {
325
- AstraSitesAdmin._log_title( 'Reseting Site Options..' );
326
- },
327
- })
328
- .fail(function( jqXHR ){
329
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
330
- })
331
- .done(function ( data ) {
332
- AstraSitesAdmin._log_title( 'Complete Reseting Site Options..' );
333
- $(document).trigger( 'astra-sites-reset-site-options-done' );
334
- });
335
- },
336
-
337
- _reset_widgets_data: function() {
338
- // Widgets.
339
- $.ajax({
340
- url : astraSitesAdmin.ajaxurl,
341
- type : 'POST',
342
- data : {
343
- action : 'astra-sites-reset-widgets-data'
344
- },
345
- beforeSend: function() {
346
- AstraSitesAdmin._log_title( 'Reseting Widgets..' );
347
- },
348
- })
349
- .fail(function( jqXHR ){
350
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
351
- })
352
- .done(function ( data ) {
353
- AstraSitesAdmin._log_title( 'Complete Reseting Widgets..' );
354
- $(document).trigger( 'astra-sites-reset-widgets-data-done' );
355
- });
356
- },
357
-
358
- _reset_posts: function() {
359
- if( AstraSitesAdmin.site_imported_data['reset_posts'].length ) {
360
-
361
- AstraSitesAdmin.reset_remaining_posts = AstraSitesAdmin.site_imported_data['reset_posts'].length;
362
-
363
- $.each( AstraSitesAdmin.site_imported_data['reset_posts'], function(index, post_id) {
364
-
365
- AstraSitesAdmin._log_title( 'Deleting Posts..' );
366
-
367
- AstraSitesAjaxQueue.add({
368
- url: astraSitesAdmin.ajaxurl,
369
- type: 'POST',
370
- data: {
371
- action : 'astra-sites-delete-posts',
372
- post_id : post_id,
373
- },
374
- success: function( result ){
375
-
376
- if( AstraSitesAdmin.reset_processed_posts < AstraSitesAdmin.site_imported_data['reset_posts'].length ) {
377
- AstraSitesAdmin.reset_processed_posts+=1;
378
- }
379
-
380
- AstraSitesAdmin._log_title( 'Deleting Post ' + AstraSitesAdmin.reset_processed_posts + ' of ' + AstraSitesAdmin.site_imported_data['reset_posts'].length + '<br/>' + result.data );
381
-
382
- AstraSitesAdmin.reset_remaining_posts-=1;
383
- if( 0 == AstraSitesAdmin.reset_remaining_posts ) {
384
- $(document).trigger( 'astra-sites-delete-posts-done' );
385
- $(document).trigger( 'astra-sites-reset-data-done' );
386
- }
387
- }
388
- });
389
- });
390
- AstraSitesAjaxQueue.run();
391
-
392
- } else {
393
- $(document).trigger( 'astra-sites-delete-posts-done' );
394
- $(document).trigger( 'astra-sites-reset-data-done' );
395
- }
396
- },
397
-
398
- _reset_wp_forms: function() {
399
-
400
- if( AstraSitesAdmin.site_imported_data['reset_wp_forms'].length ) {
401
- AstraSitesAdmin.reset_remaining_wp_forms = AstraSitesAdmin.site_imported_data['reset_wp_forms'].length;
402
-
403
- $.each( AstraSitesAdmin.site_imported_data['reset_wp_forms'], function(index, post_id) {
404
- AstraSitesAdmin._log_title( 'Deleting WP Forms..' );
405
- AstraSitesAjaxQueue.add({
406
- url: astraSitesAdmin.ajaxurl,
407
- type: 'POST',
408
- data: {
409
- action : 'astra-sites-delete-wp-forms',
410
- post_id : post_id,
411
- },
412
- success: function( result ){
413
-
414
- if( AstraSitesAdmin.reset_processed_wp_forms < AstraSitesAdmin.site_imported_data['reset_wp_forms'].length ) {
415
- AstraSitesAdmin.reset_processed_wp_forms+=1;
416
- }
417
-
418
- AstraSitesAdmin._log_title( 'Deleting Form ' + AstraSitesAdmin.reset_processed_wp_forms + ' of ' + AstraSitesAdmin.site_imported_data['reset_wp_forms'].length + '<br/>' + result.data );
419
-
420
- AstraSitesAdmin.reset_remaining_wp_forms-=1;
421
- if( 0 == AstraSitesAdmin.reset_remaining_wp_forms ) {
422
- $(document).trigger( 'astra-sites-delete-wp-forms-done' );
423
- }
424
- }
425
- });
426
- });
427
- AstraSitesAjaxQueue.run();
428
-
429
- } else {
430
- $(document).trigger( 'astra-sites-delete-wp-forms-done' );
431
- }
432
- },
433
-
434
-
435
- _reset_terms: function() {
436
-
437
-
438
- if( AstraSitesAdmin.site_imported_data['reset_terms'].length ) {
439
- AstraSitesAdmin.reset_remaining_terms = AstraSitesAdmin.site_imported_data['reset_terms'].length;
440
-
441
- $.each( AstraSitesAdmin.site_imported_data['reset_terms'], function(index, term_id) {
442
- AstraSitesAdmin._log_title( 'Deleting Terms..' );
443
- AstraSitesAjaxQueue.add({
444
- url: astraSitesAdmin.ajaxurl,
445
- type: 'POST',
446
- data: {
447
- action : 'astra-sites-delete-terms',
448
- term_id : term_id,
449
- },
450
- success: function( result ){
451
- if( AstraSitesAdmin.reset_processed_terms < AstraSitesAdmin.site_imported_data['reset_terms'].length ) {
452
- AstraSitesAdmin.reset_processed_terms+=1;
453
- }
454
-
455
- AstraSitesAdmin._log_title( 'Deleting Term ' + AstraSitesAdmin.reset_processed_terms + ' of ' + AstraSitesAdmin.site_imported_data['reset_terms'].length + '<br/>' + result.data );
456
-
457
- AstraSitesAdmin.reset_remaining_terms-=1;
458
- if( 0 == AstraSitesAdmin.reset_remaining_terms ) {
459
- $(document).trigger( 'astra-sites-delete-terms-done' );
460
- }
461
- }
462
- });
463
- });
464
- AstraSitesAjaxQueue.run();
465
-
466
- } else {
467
- $(document).trigger( 'astra-sites-delete-terms-done' );
468
- }
469
-
470
- },
471
-
472
- _toggle_reset_notice: function() {
473
- if ( $( this ).is(':checked') ) {
474
- $('#astra-sites-tooltip-reset-data').show();
475
- } else {
476
- $('#astra-sites-tooltip-reset-data').hide();
477
- }
478
- },
479
-
480
- _backup_before_rest_options: function() {
481
- AstraSitesAdmin._backupOptions( 'astra-sites-backup-settings-before-reset-done' );
482
- AstraSitesAdmin.backup_taken = true;
483
- },
484
-
485
- _recheck_backup_options: function() {
486
- AstraSitesAdmin._backupOptions( 'astra-sites-backup-settings-done' );
487
- AstraSitesAdmin.backup_taken = true;
488
- },
489
-
490
- _backupOptions: function( trigger_name ) {
491
- $.ajax({
492
- url : astraSitesAdmin.ajaxurl,
493
- type : 'POST',
494
- data : {
495
- action : 'astra-sites-backup-settings',
496
- },
497
- beforeSend: function() {
498
- AstraSitesAdmin._log_title( 'Processing Customizer Settings Backup..' );
499
- },
500
- })
501
- .fail(function( jqXHR ){
502
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
503
- })
504
- .done(function ( data ) {
505
-
506
- // 1. Pass - Import Customizer Options.
507
- AstraSitesAdmin._log_title( 'Customizer Settings Backup Done..' );
508
-
509
- // Custom trigger.
510
- $(document).trigger( trigger_name );
511
- });
512
- },
513
-
514
- _import_settings: function( event ) {
515
- event.preventDefault();
516
-
517
- var btn = $(this);
518
-
519
- btn.addClass('updating-message');
520
-
521
-
522
- $.ajax({
523
- url : astraSitesAdmin.ajaxurl,
524
- type : 'POST',
525
- dataType: 'json',
526
- data : {
527
- action : 'astra-sites-import-customizer-settings',
528
- customizer_data : AstraSitesAdmin.current_site['astra-site-customizer-data'],
529
- },
530
- beforeSend: function() {
531
- AstraSitesAdmin._log_title( 'Importing Customizer Settings..' );
532
- },
533
- })
534
- .fail(function( jqXHR ){
535
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
536
- })
537
- .done(function ( customizer_data ) {
538
-
539
- btn.removeClass( 'updating-message' );
540
-
541
- // 1. Fail - Import Customizer Options.
542
- if( false === customizer_data.success ) {
543
- AstraSitesAdmin._log_title( customizer_data.data );
544
- } else {
545
-
546
- // 1. Pass - Import Customizer Options.
547
- AstraSitesAdmin._log_title( 'Imported Customizer Settings..' );
548
-
549
- $(document).trigger( 'astra-sites-import-customizer-settings-done' );
550
- }
551
- });
552
- },
553
-
554
- /**
555
- * 5. Import Complete.
556
- */
557
- _importEnd: function( event ) {
558
-
559
- $.ajax({
560
- url : astraSitesAdmin.ajaxurl,
561
- type : 'POST',
562
- dataType: 'json',
563
- data : {
564
- action : 'astra-sites-import-end',
565
- },
566
- beforeSend: function() {
567
- AstraSitesAdmin._log_title( 'Import Complete!' );
568
- }
569
- })
570
- .fail(function( jqXHR ){
571
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
572
- })
573
- .done(function ( data ) {
574
-
575
- // 5. Fail - Import Complete.
576
- if( false === data.success ) {
577
- AstraSitesAdmin._log_title( data.data );
578
- } else {
579
-
580
- $('body').removeClass('importing-site');
581
- $('.previous-theme, .next-theme').removeClass('disabled');
582
-
583
- var date = new Date();
584
-
585
- AstraSitesAdmin.import_end_time = new Date();
586
- var diff = ( AstraSitesAdmin.import_end_time.getTime() - AstraSitesAdmin.import_start_time.getTime() );
587
-
588
- var time = '';
589
- var seconds = Math.floor( diff / 1000 );
590
- var minutes = Math.floor( seconds / 60 );
591
- var hours = Math.floor( minutes / 60 );
592
-
593
- minutes = minutes - ( hours * 60 );
594
- seconds = seconds - ( minutes * 60 );
595
-
596
- if( hours ) {
597
- time += hours + ' Hours ';
598
- }
599
- if( minutes ) {
600
- time += minutes + ' Minutes ';
601
- }
602
- if( seconds ) {
603
- time += seconds + ' Seconds';
604
- }
605
-
606
- var output = '<h2>Done 🎉</h2>';
607
- output += '<p>Your starter site has been imported successfully in '+time+'! Now go ahead, customize the text, images, and design to make it yours!</p>';
608
- output += '<p>You can now start making changes according to your requirements.</p>';
609
- output += '<p><a class="button button-primary button-hero" href="'+astraSitesAdmin.siteURL+'" target="_blank">View Site <i class="dashicons dashicons-external"></i></a></p>';
610
-
611
- $('.rotating,.current-importing-status-wrap,.notice-warning').remove();
612
- $('.astra-sites-result-preview .inner').html(output);
613
-
614
- // 5. Pass - Import Complete.
615
- AstraSitesAdmin._importSuccessButton();
616
- }
617
- });
618
- },
619
-
620
- /**
621
- * 4. Import Widgets.
622
- */
623
- _importWidgets: function( event ) {
624
- if ( AstraSitesAdmin._is_process_widgets() ) {
625
- $.ajax({
626
- url : astraSitesAdmin.ajaxurl,
627
- type : 'POST',
628
- dataType: 'json',
629
- data : {
630
- action : 'astra-sites-import-widgets',
631
- widgets_data : AstraSitesAdmin.widgets_data,
632
- },
633
- beforeSend: function() {
634
- AstraSitesAdmin._log_title( 'Importing Widgets..' );
635
- },
636
- })
637
- .fail(function( jqXHR ){
638
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
639
- })
640
- .done(function ( widgets_data ) {
641
-
642
- // 4. Fail - Import Widgets.
643
- if( false === widgets_data.success ) {
644
- AstraSitesAdmin._log_title( widgets_data.data );
645
-
646
- } else {
647
-
648
- // 4. Pass - Import Widgets.
649
- AstraSitesAdmin._log_title( 'Imported Widgets!' );
650
- $(document).trigger( 'astra-sites-import-widgets-done' );
651
- }
652
- });
653
- } else {
654
- $(document).trigger( 'astra-sites-import-widgets-done' );
655
- }
656
- },
657
-
658
- /**
659
- * 3. Import Site Options.
660
- */
661
- _importSiteOptions: function( event ) {
662
-
663
- if ( AstraSitesAdmin._is_process_xml() ) {
664
- $.ajax({
665
- url : astraSitesAdmin.ajaxurl,
666
- type : 'POST',
667
- dataType: 'json',
668
- data : {
669
- action : 'astra-sites-import-options',
670
- options_data : AstraSitesAdmin.options_data,
671
- },
672
- beforeSend: function() {
673
- AstraSitesAdmin._log_title( 'Importing Options..' );
674
- $('.astra-demo-import .percent').html('');
675
- },
676
- })
677
- .fail(function( jqXHR ){
678
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
679
- })
680
- .done(function ( options_data ) {
681
-
682
- // 3. Fail - Import Site Options.
683
- if( false === options_data.success ) {
684
- AstraSitesAdmin._log_title( options_data );
685
- } else {
686
-
687
- // 3. Pass - Import Site Options.
688
- $(document).trigger( 'astra-sites-import-options-done' );
689
- }
690
- });
691
- } else {
692
- $(document).trigger( 'astra-sites-import-options-done' );
693
- }
694
- },
695
-
696
- /**
697
- * 2. Prepare XML Data.
698
- */
699
- _importXML: function() {
700
-
701
- if ( AstraSitesAdmin._is_process_xml() ) {
702
- $.ajax({
703
- url : astraSitesAdmin.ajaxurl,
704
- type : 'POST',
705
- dataType: 'json',
706
- data : {
707
- action : 'astra-sites-import-prepare-xml',
708
- wxr_url : AstraSitesAdmin.current_site['astra-site-wxr-path'],
709
- },
710
- beforeSend: function() {
711
- $('.astra-site-import-process-wrap').show();
712
- AstraSitesAdmin._log_title( 'Importing Content..' );
713
- },
714
- })
715
- .fail(function( jqXHR ){
716
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
717
- })
718
- .done(function ( xml_data ) {
719
-
720
- // 2. Fail - Prepare XML Data.
721
- if( false === xml_data.success ) {
722
- AstraSitesAdmin._log_title( xml_data );
723
- var error_msg = xml_data.data.error || xml_data.data;
724
- AstraSitesAdmin._log_title( error_msg );
725
-
726
- } else {
727
-
728
- // 2. Pass - Prepare XML Data.
729
-
730
- // Import XML though Event Source.
731
- AstraSSEImport.data = xml_data.data;
732
- AstraSSEImport.render();
733
-
734
- $('.current-importing-status-description').html('').show();
735
-
736
- $('.astra-sites-result-preview .inner').append('<div class="astra-site-import-process-wrap"><progress class="astra-site-import-process" max="100" value="0"></progress></div>');
737
-
738
- var evtSource = new EventSource( AstraSSEImport.data.url );
739
- evtSource.onmessage = function ( message ) {
740
- var data = JSON.parse( message.data );
741
- switch ( data.action ) {
742
- case 'updateDelta':
743
-
744
- AstraSSEImport.updateDelta( data.type, data.delta );
745
- break;
746
-
747
- case 'complete':
748
- evtSource.close();
749
-
750
- $('.current-importing-status-description').hide();
751
-
752
- document.getElementsByClassName("astra-site-import-process").value = '100';
753
-
754
- $('.astra-site-import-process-wrap').hide();
755
-
756
- $(document).trigger( 'astra-sites-import-xml-done' );
757
-
758
- break;
759
- }
760
- };
761
- evtSource.addEventListener( 'log', function ( message ) {
762
- var data = JSON.parse( message.data );
763
- var message = data.message || '';
764
- if( message && 'info' === data.level ) {
765
- message = message.replace(/"/g, function(letter) {
766
- return '';
767
- });
768
- $('.current-importing-status-description').html( message );
769
- }
770
- });
771
- }
772
- });
773
- } else {
774
- $(document).trigger( 'astra-sites-import-xml-done' );
775
- }
776
-
777
-
778
- },
779
-
780
- _is_process_xml: function() {
781
- if ( $( '.astra-sites-import-xml' ).find('.checkbox').is(':checked') ) {
782
- return true;
783
- }
784
- return false;
785
- },
786
-
787
- _is_process_customizer: function() {
788
- if ( $( '.astra-sites-import-customizer' ).find('.checkbox').is(':checked') ) {
789
- return true;
790
- }
791
- return false;
792
- },
793
-
794
- _is_process_widgets: function() {
795
- if ( $( '.astra-sites-import-widgets' ).find('.checkbox').is(':checked') ) {
796
- return true;
797
- }
798
- return false;
799
- },
800
-
801
- /**
802
- * 1. Import WPForms Options.
803
- */
804
- _importWPForms: function( event ) {
805
- if ( AstraSitesAdmin._is_process_customizer() ) {
806
- $.ajax({
807
- url : astraSitesAdmin.ajaxurl,
808
- type : 'POST',
809
- dataType: 'json',
810
- data : {
811
- action : 'astra-sites-import-wpforms',
812
- wpforms_url : AstraSitesAdmin.wpforms_url,
813
- },
814
- beforeSend: function() {
815
- AstraSitesAdmin._log_title( 'Importing WP Forms..' );
816
- },
817
- })
818
- .fail(function( jqXHR ){
819
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
820
- })
821
- .done(function ( forms ) {
822
-
823
- // 1. Fail - Import WPForms Options.
824
- if( false === forms.success ) {
825
- AstraSitesAdmin._log_title( forms.data );
826
- } else {
827
-
828
- // 1. Pass - Import Customizer Options.
829
- $(document).trigger( 'astra-sites-import-wpforms-done' );
830
- }
831
- });
832
- } else {
833
- $(document).trigger( 'astra-sites-import-wpforms-done' );
834
- }
835
- },
836
-
837
- /**
838
- * 1. Import Customizer Options.
839
- */
840
- _importCustomizerSettings: function( event ) {
841
- if ( AstraSitesAdmin._is_process_customizer() ) {
842
- $.ajax({
843
- url : astraSitesAdmin.ajaxurl,
844
- type : 'POST',
845
- dataType: 'json',
846
- data : {
847
- action : 'astra-sites-import-customizer-settings',
848
- customizer_data : AstraSitesAdmin.customizer_data,
849
- },
850
- beforeSend: function() {
851
- },
852
- })
853
- .fail(function( jqXHR ){
854
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
855
- })
856
- .done(function ( customizer_data ) {
857
-
858
- // 1. Fail - Import Customizer Options.
859
- if( false === customizer_data.success ) {
860
- AstraSitesAdmin._log_title( customizer_data.data );
861
- } else {
862
-
863
- // 1. Pass - Import Customizer Options.
864
- $(document).trigger( 'astra-sites-import-customizer-settings-done' );
865
- }
866
- });
867
- } else {
868
- $(document).trigger( 'astra-sites-import-customizer-settings-done' );
869
- }
870
-
871
- },
872
-
873
- /**
874
- * Import Success Button.
875
- *
876
- * @param {string} data Error message.
877
- */
878
- _importSuccessButton: function() {
879
-
880
- $('.astra-demo-import').removeClass('updating-message installing')
881
- .removeAttr('data-import')
882
- .addClass('view-site')
883
- .removeClass('astra-demo-import')
884
- .text( astraSitesAdmin.strings.viewSite )
885
- .attr('target', '_blank')
886
- .append('<i class="dashicons dashicons-external"></i>')
887
- .attr('href', astraSitesAdmin.siteURL );
888
- },
889
-
890
- /**
891
- * Preview Device
892
- */
893
- _previewDevice: function( event ) {
894
- var device = $( event.currentTarget ).data( 'device' );
895
-
896
- $('.theme-install-overlay')
897
- .removeClass( 'preview-desktop preview-tablet preview-mobile' )
898
- .addClass( 'preview-' + device )
899
- .data( 'current-preview-device', device );
900
-
901
- AstraSitesAdmin._tooglePreviewDeviceButtons( device );
902
- },
903
-
904
- /**
905
- * Toggle Preview Buttons
906
- */
907
- _tooglePreviewDeviceButtons: function( newDevice ) {
908
- var $devices = $( '.wp-full-overlay-footer .devices' );
909
-
910
- $devices.find( 'button' )
911
- .removeClass( 'active' )
912
- .attr( 'aria-pressed', false );
913
-
914
- $devices.find( 'button.preview-' + newDevice )
915
- .addClass( 'active' )
916
- .attr( 'aria-pressed', true );
917
- },
918
-
919
- /**
920
- * Import Error Button.
921
- *
922
- * @param {string} data Error message.
923
- */
924
- _importFailMessage: function( message, from ) {
925
-
926
- $('.astra-demo-import')
927
- .addClass('go-pro button-primary')
928
- .removeClass('updating-message installing')
929
- .removeAttr('data-import')
930
- .attr('target', '_blank')
931
- .append('<i class="dashicons dashicons-external"></i>')
932
- .removeClass('astra-demo-import');
933
-
934
- // Add the doc link due to import log file not generated.
935
- if( 'undefined' === from ) {
936
-
937
- $('.wp-full-overlay-header .go-pro').text( astraSitesAdmin.strings.importFailedBtnSmall );
938
- $('.wp-full-overlay-footer .go-pro').text( astraSitesAdmin.strings.importFailedBtnLarge );
939
- $('.go-pro').attr('href', astraSitesAdmin.log.serverConfiguration );
940
-
941
- // Add the import log file link.
942
- } else {
943
-
944
- $('.wp-full-overlay-header .go-pro').text( astraSitesAdmin.strings.importFailBtn );
945
- $('.wp-full-overlay-footer .go-pro').text( astraSitesAdmin.strings.importFailBtnLarge )
946
-
947
- // Add the import log file link.
948
- if( 'undefined' !== AstraSitesAdmin.log_file_url ) {
949
- $('.go-pro').attr('href', AstraSitesAdmin.log_file_url );
950
- } else {
951
- $('.go-pro').attr('href', astraSitesAdmin.log.serverConfiguration );
952
- }
953
- }
954
-
955
- var output = '<div class="astra-api-error notice notice-error notice-alt is-dismissible">';
956
- output += ' <p>'+message+'</p>';
957
- output += ' <button type="button" class="notice-dismiss">';
958
- output += ' <span class="screen-reader-text">'+commonL10n.dismiss+'</span>';
959
- output += ' </button>';
960
- output += '</div>';
961
-
962
- // Fail Notice.
963
- $('.install-theme-info').append( output );
964
-
965
- // !important to add trigger.
966
- // Which reinitialize the dismiss error message events.
967
- $(document).trigger('wp-updates-notice-added');
968
- },
969
-
970
-
971
- /**
972
- * Install Now
973
- */
974
- _installNow: function(event)
975
- {
976
- event.preventDefault();
977
-
978
- var $button = jQuery( event.target ),
979
- $document = jQuery(document);
980
-
981
- if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
982
- return;
983
- }
984
-
985
- AstraSitesAdmin._log_title( 'Installing Required Plugin..' );
986
-
987
- if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
988
- wp.updates.requestFilesystemCredentials( event );
989
-
990
- $document.on( 'credential-modal-cancel', function() {
991
- var $message = $( '.install-now.updating-message' );
992
-
993
- $message
994
- .removeClass( 'updating-message' )
995
- .text( wp.updates.l10n.installNow );
996
-
997
- wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
998
- } );
999
- }
1000
-
1001
- AstraSitesAdmin._log_title( 'Installing Plugin - ' + AstraSitesAdmin.ucwords( $button.data( 'name' ) ) );
1002
-
1003
- wp.updates.installPlugin( {
1004
- slug: $button.data( 'slug' )
1005
- } );
1006
- },
1007
-
1008
- ucwords: function( str ) {
1009
- if( ! str ) {
1010
- return '';
1011
- }
1012
-
1013
- str = str.toLowerCase().replace(/\b[a-z]/g, function(letter) {
1014
- return letter.toUpperCase();
1015
- });
1016
-
1017
- str = str.replace(/-/g, function(letter) {
1018
- return ' ';
1019
- });
1020
-
1021
- return str;
1022
- },
1023
-
1024
- /**
1025
- * Install Success
1026
- */
1027
- _installSuccess: function( event, response ) {
1028
-
1029
- event.preventDefault();
1030
-
1031
-
1032
- var $siteOptions = $( '.wp-full-overlay-header').find('.astra-site-options').val();
1033
-
1034
- var $enabledExtensions = $( '.wp-full-overlay-header').find('.astra-enabled-extensions').val();
1035
-
1036
- // Transform the 'Install' button into an 'Activate' button.
1037
- var $init = $( '.plugin-card-' + response.slug ).data('init');
1038
- var $name = $( '.plugin-card-' + response.slug ).data('name');
1039
-
1040
- // Reset not installed plugins list.
1041
- var pluginsList = astraSitesAdmin.requiredPlugins.notinstalled;
1042
- astraSitesAdmin.requiredPlugins.notinstalled = AstraSitesAdmin._removePluginFromQueue( response.slug, pluginsList );
1043
-
1044
- // WordPress adds "Activate" button after waiting for 1000ms. So we will run our activation after that.
1045
- setTimeout( function() {
1046
-
1047
- AstraSitesAdmin._log_title( 'Installing Plugin - ' + AstraSitesAdmin.ucwords($name) );
1048
-
1049
- $.ajax({
1050
- url: astraSitesAdmin.ajaxurl,
1051
- type: 'POST',
1052
- data: {
1053
- 'action' : 'astra-required-plugin-activate',
1054
- 'init' : $init,
1055
- 'options' : $siteOptions,
1056
- 'enabledExtensions' : $enabledExtensions,
1057
- },
1058
- })
1059
- .done(function (result) {
1060
-
1061
- if( result.success ) {
1062
- var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
1063
-
1064
- AstraSitesAdmin._log_title( 'Installed Plugin - ' + AstraSitesAdmin.ucwords($name) );
1065
-
1066
- // Reset not installed plugins list.
1067
- astraSitesAdmin.requiredPlugins.inactive = AstraSitesAdmin._removePluginFromQueue( response.slug, pluginsList );
1068
-
1069
- // Enable Demo Import Button
1070
- AstraSitesAdmin._enable_demo_import_button();
1071
-
1072
- }
1073
- });
1074
-
1075
- }, 1200 );
1076
-
1077
- },
1078
-
1079
- /**
1080
- * Plugin Installation Error.
1081
- */
1082
- _installError: function( event, response ) {
1083
-
1084
- var $card = $( '.plugin-card-' + response.slug );
1085
- var $name = $card.data('name');
1086
-
1087
- AstraSitesAdmin._log_title( response.errorMessage + ' ' + AstraSitesAdmin.ucwords($name) );
1088
-
1089
-
1090
- $card
1091
- .removeClass( 'button-primary' )
1092
- .addClass( 'disabled' )
1093
- .html( wp.updates.l10n.installFailedShort );
1094
-
1095
- },
1096
-
1097
- /**
1098
- * Installing Plugin
1099
- */
1100
- _pluginInstalling: function(event, args) {
1101
- event.preventDefault();
1102
-
1103
- var $card = $( '.plugin-card-' + args.slug );
1104
- var $name = $card.data('name');
1105
-
1106
- AstraSitesAdmin._log_title( 'Installing Plugin - ' + AstraSitesAdmin.ucwords( $name ));
1107
-
1108
- $card.addClass('updating-message');
1109
-
1110
- },
1111
-
1112
- /**
1113
- * Render Demo Preview
1114
- */
1115
- _activateNow: function( eventn ) {
1116
-
1117
- event.preventDefault();
1118
-
1119
- var $button = jQuery( event.target ),
1120
- $init = $button.data( 'init' ),
1121
- $slug = $button.data( 'slug' );
1122
- $name = $button.data( 'name' );
1123
-
1124
- if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
1125
- return;
1126
- }
1127
-
1128
- AstraSitesAdmin._log_title( 'Activating Plugin - ' + AstraSitesAdmin.ucwords( $name ) );
1129
-
1130
- $button.addClass('updating-message button-primary')
1131
- .html( astraSitesAdmin.strings.btnActivating );
1132
-
1133
- var $siteOptions = jQuery( '.wp-full-overlay-header').find('.astra-site-options').val();
1134
- var $enabledExtensions = jQuery( '.wp-full-overlay-header').find('.astra-enabled-extensions').val();
1135
-
1136
- $.ajax({
1137
- url: astraSitesAdmin.ajaxurl,
1138
- type: 'POST',
1139
- data: {
1140
- 'action' : 'astra-required-plugin-activate',
1141
- 'init' : $init,
1142
- 'options' : $siteOptions,
1143
- 'enabledExtensions' : $enabledExtensions,
1144
- },
1145
- })
1146
- .done(function (result) {
1147
-
1148
- if( result.success ) {
1149
-
1150
- AstraSitesAdmin._log_title( 'Activated Plugin - ' + AstraSitesAdmin.ucwords($name) );
1151
-
1152
- var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
1153
-
1154
- // Reset not installed plugins list.
1155
- astraSitesAdmin.requiredPlugins.inactive = AstraSitesAdmin._removePluginFromQueue( $slug, pluginsList );
1156
-
1157
- $button.removeClass( 'button-primary install-now activate-now updating-message' )
1158
- .attr('disabled', 'disabled')
1159
- .addClass('disabled')
1160
- .text( astraSitesAdmin.strings.btnActive );
1161
-
1162
- // Enable Demo Import Button
1163
- AstraSitesAdmin._enable_demo_import_button();
1164
-
1165
- }
1166
-
1167
- })
1168
- .fail(function () {
1169
- });
1170
-
1171
- },
1172
-
1173
- /**
1174
- * Full Overlay
1175
- */
1176
- _fullOverlay: function (event) {
1177
- event.preventDefault();
1178
-
1179
- // Import process is started?
1180
- // And Closing the window? Then showing the warning confirm message.
1181
- if( $('body').hasClass('importing-site') && ! confirm( astraSitesAdmin.strings.warningBeforeCloseWindow ) ) {
1182
- return;
1183
- }
1184
-
1185
- $('body').removeClass('importing-site');
1186
- $('.previous-theme, .next-theme').removeClass('disabled');
1187
- $('.theme-install-overlay').css('display', 'none');
1188
- $('.theme-install-overlay').remove();
1189
- $('.theme-preview-on').removeClass('theme-preview-on');
1190
- $('html').removeClass('astra-site-preview-on');
1191
- },
1192
-
1193
- /**
1194
- * Bulk Plugin Active & Install
1195
- */
1196
- _bulkPluginInstallActivate: function()
1197
- {
1198
- if( 0 === astraSitesAdmin.requiredPlugins.length ) {
1199
- return;
1200
- }
1201
-
1202
- var not_installed = astraSitesAdmin.requiredPlugins.notinstalled || '';
1203
- var activate_plugins = astraSitesAdmin.requiredPlugins.inactive || '';
1204
-
1205
- // First Install Bulk.
1206
- if( not_installed.length > 0 ) {
1207
- AstraSitesAdmin._installAllPlugins( not_installed );
1208
- }
1209
-
1210
- // Second Activate Bulk.
1211
- if( activate_plugins.length > 0 ) {
1212
- AstraSitesAdmin._activateAllPlugins( activate_plugins );
1213
- }
1214
-
1215
- if( activate_plugins.length <= 0 && not_installed.length <= 0 ) {
1216
- AstraSitesAdmin._enable_demo_import_button();
1217
- }
1218
-
1219
- },
1220
-
1221
- /**
1222
- * Activate All Plugins.
1223
- */
1224
- _activateAllPlugins: function( activate_plugins ) {
1225
-
1226
- AstraSitesAdmin._log_title( 'Activating Required Plugins..' );
1227
-
1228
- $.each( activate_plugins, function(index, single_plugin) {
1229
-
1230
- var $card = $( '.plugin-card-' + single_plugin.slug ),
1231
- $siteOptions = $( '.wp-full-overlay-header').find('.astra-site-options').val(),
1232
- $enabledExtensions = $( '.wp-full-overlay-header').find('.astra-enabled-extensions').val();
1233
-
1234
-
1235
- AstraSitesAjaxQueue.add({
1236
- url: astraSitesAdmin.ajaxurl,
1237
- type: 'POST',
1238
- data: {
1239
- 'action' : 'astra-required-plugin-activate',
1240
- 'init' : single_plugin.init,
1241
- 'options' : $siteOptions,
1242
- 'enabledExtensions' : $enabledExtensions,
1243
- },
1244
- success: function( result ){
1245
-
1246
- if( result.success ) {
1247
-
1248
- var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
1249
-
1250
- // Reset not installed plugins list.
1251
- astraSitesAdmin.requiredPlugins.inactive = AstraSitesAdmin._removePluginFromQueue( single_plugin.slug, pluginsList );
1252
-
1253
- // Enable Demo Import Button
1254
- AstraSitesAdmin._enable_demo_import_button();
1255
- } else {
1256
- }
1257
- }
1258
- });
1259
- });
1260
- AstraSitesAjaxQueue.run();
1261
- },
1262
-
1263
- /**
1264
- * Install All Plugins.
1265
- */
1266
- _installAllPlugins: function( not_installed ) {
1267
-
1268
- AstraSitesAdmin._log_title( 'Installing Required Plugins..' );
1269
-
1270
- $.each( not_installed, function(index, single_plugin) {
1271
-
1272
- AstraSitesAdmin._log_title( 'Installing Plugin - ' + AstraSitesAdmin.ucwords( single_plugin.name ));
1273
-
1274
- var $card = $( '.plugin-card-' + single_plugin.slug );
1275
-
1276
- // Add each plugin activate request in Ajax queue.
1277
- // @see wp-admin/js/updates.js
1278
- wp.updates.queue.push( {
1279
- action: 'install-plugin', // Required action.
1280
- data: {
1281
- slug: single_plugin.slug
1282
- }
1283
- } );
1284
- });
1285
-
1286
- // Required to set queue.
1287
- wp.updates.queueChecker();
1288
- },
1289
-
1290
- /**
1291
- * Fires when a nav item is clicked.
1292
- *
1293
- * @since 1.0
1294
- * @access private
1295
- * @method _importDemo
1296
- */
1297
- _importDemo: function(event) {
1298
- event.preventDefault();
1299
-
1300
- var date = new Date();
1301
-
1302
- AstraSitesAdmin.import_start_time = new Date();
1303
-
1304
- var disabled = $(this).attr('data-import');
1305
-
1306
- if ( typeof disabled !== 'undefined' && disabled === 'disabled' || $this.hasClass('disabled') ) {
1307
-
1308
- $('.astra-demo-import').addClass('updating-message installing')
1309
- .text( wp.updates.l10n.installing );
1310
-
1311
- $('.astra-sites-result-preview').show();
1312
- var output = '<div class="current-importing-status-title"></div><div class="current-importing-status-description"></div>';
1313
- $('.current-importing-status').html( output );
1314
-
1315
- /**
1316
- * Process Bulk Plugin Install & Activate
1317
- */
1318
- AstraSitesAdmin._bulkPluginInstallActivate();
1319
- }
1320
- },
1321
-
1322
- _process_import: function() {
1323
-
1324
- var $theme = $('.astra-sites-preview').find('.wp-full-overlay-header'),
1325
- apiURL = $theme.data('demo-api') || '';
1326
-
1327
- $('body').addClass('importing-site');
1328
- $('.previous-theme, .next-theme').addClass('disabled');
1329
-
1330
- // Remove all notices before import start.
1331
- $('.install-theme-info > .notice').remove();
1332
-
1333
- $('.astra-demo-import').attr('data-import', 'disabled')
1334
- .addClass('updating-message installing')
1335
- .text( astraSitesAdmin.strings.importingDemo );
1336
-
1337
- // Site Import by API URL.
1338
- if( apiURL ) {
1339
- AstraSitesAdmin._importSite( apiURL );
1340
- }
1341
-
1342
- },
1343
-
1344
- /**
1345
- * Start Import Process by API URL.
1346
- *
1347
- * @param {string} apiURL Site API URL.
1348
- */
1349
- _importSite: function( apiURL ) {
1350
-
1351
- AstraSitesAdmin._log_title( 'Started Importing..' );
1352
-
1353
- // 1. Request Site Import
1354
- $.ajax({
1355
- url : astraSitesAdmin.ajaxurl,
1356
- type : 'POST',
1357
- dataType: 'json',
1358
- data : {
1359
- 'action' : 'astra-sites-import-set-site-data',
1360
- 'api_url' : apiURL,
1361
- },
1362
- })
1363
- .fail(function( jqXHR ){
1364
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
1365
- })
1366
- .done(function ( demo_data ) {
1367
-
1368
- // 1. Fail - Request Site Import
1369
- if( false === demo_data.success ) {
1370
-
1371
-
1372
- } else {
1373
-
1374
- // Set log file URL.
1375
- if( 'log_file' in demo_data.data ){
1376
- AstraSitesAdmin.log_file_url = decodeURIComponent( demo_data.data.log_file ) || '';
1377
- }
1378
-
1379
- // 1. Pass - Request Site Import
1380
- AstraSitesAdmin.customizer_data = JSON.stringify( demo_data.data['astra-site-customizer-data'] ) || '';
1381
- AstraSitesAdmin.wxr_url = encodeURI( demo_data.data['astra-site-wxr-path'] ) || '';
1382
- AstraSitesAdmin.wpforms_url = encodeURI( demo_data.data['astra-site-wpforms-path'] ) || '';
1383
- AstraSitesAdmin.options_data = JSON.stringify( demo_data.data['astra-site-options-data'] ) || '';
1384
- AstraSitesAdmin.widgets_data = JSON.stringify( demo_data.data['astra-site-widgets-data'] ) || '';
1385
-
1386
- $(document).trigger( 'astra-sites-import-set-site-data-done' );
1387
- }
1388
-
1389
- });
1390
-
1391
- },
1392
-
1393
- /**
1394
- * Collapse Sidebar.
1395
- */
1396
- _collapse: function() {
1397
- event.preventDefault();
1398
-
1399
- overlay = jQuery('.wp-full-overlay');
1400
-
1401
- if (overlay.hasClass('expanded')) {
1402
- overlay.removeClass('expanded');
1403
- overlay.addClass('collapsed');
1404
- return;
1405
- }
1406
-
1407
- if (overlay.hasClass('collapsed')) {
1408
- overlay.removeClass('collapsed');
1409
- overlay.addClass('expanded');
1410
- return;
1411
- }
1412
- },
1413
-
1414
- /**
1415
- * Previous Theme.
1416
- */
1417
- _previousTheme: function (event) {
1418
- event.preventDefault();
1419
-
1420
- currentDemo = jQuery('.theme-preview-on');
1421
- currentDemo.removeClass('theme-preview-on');
1422
- prevDemo = currentDemo.prev('.theme');
1423
- prevDemo.addClass('theme-preview-on');
1424
-
1425
- var site_id = $(this).parents('.wp-full-overlay-header').data('demo-id') || '';
1426
-
1427
- if( AstraSitesAPI._stored_data ) {
1428
- var site_data = AstraSitesAdmin._get_site_details( site_id );
1429
-
1430
-
1431
- if( site_data ) {
1432