Skip to content

Commit 164500e

Browse files
committed
feat: add popup for activate
1 parent ca2cda3 commit 164500e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1064
-234
lines changed

plugin.php

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function VFA_simulate_as_not_rest( $is_rest_api_request ) {
2626
add_action( 'admin_menu', 'VFA_add_plugin_page' );
2727
add_action( 'admin_enqueue_scripts', 'VFA_vuefront_admin_styles' );
2828
add_action( 'wp_ajax_vf_register', 'VFA_vuefront_admin_action_register' );
29+
add_action( 'wp_ajax_vf_turn_on', 'VFA_vuefront_admin_action_turn_on' );
2930
add_action( 'wp_ajax_vf_update', 'VFA_vuefront_admin_action_update' );
3031
add_action( 'wp_ajax_vf_turn_off', 'VFA_vuefront_admin_action_turn_off' );
3132
add_action( 'wp_ajax_vf_information', 'VFA_vuefront_admin_action_vf_information' );
@@ -71,10 +72,12 @@ function VFA_vuefront_admin_action_vf_information() {
7172
'status' => is_plugin_active( 'woocommerce/woocommerce.php' )
7273
);
7374

74-
$status = file_exists( __DIR__ . '/.htaccess.txt' ) && is_dir(ABSPATH.'vuefront');
75+
$status = file_exists( __DIR__ . '/.htaccess.txt' );
7576
echo json_encode(
7677
array(
77-
'apache' => strpos( $_SERVER["SERVER_SOFTWARE"], "Apache" ) !== false,
78+
'apache' => strpos( $_SERVER["SERVER_SOFTWARE"], "Apache" ) !== false,
79+
'backup' => 'wp-content/plugins/vuefront/.htaccess.txt',
80+
'htaccess' => file_exists( ABSPATH . '.htaccess' ),
7881
'status' => $status,
7982
'server' => $_SERVER['SERVER_SOFTWARE'],
8083
'phpversion' => phpversion(),
@@ -94,18 +97,11 @@ function VFA_vuefront_admin_action_turn_off() {
9497
unlink(__DIR__.'/.htaccess.txt');
9598
}
9699
}
97-
VFA_vuefront_rmdir(ABSPATH.'vuefront');
98-
99100
VFA_vuefront_admin_action_vf_information();
100101
}
101102

102-
function VFA_vuefront_admin_action_update() {
103+
function VFA_vuefront_admin_action_turn_on() {
103104
try {
104-
$tmpFile = download_url( $_POST['url'] );
105-
VFA_vuefront_rmdir( ABSPATH . 'vuefront' );
106-
$phar = new PharData( $tmpFile );
107-
$phar->extractTo( ABSPATH . 'vuefront' );
108-
109105
if ( strpos( $_SERVER["SERVER_SOFTWARE"], "Apache" ) !== false ) {
110106
if ( file_exists( ABSPATH . '.htaccess' ) ) {
111107
$inserting = "# VueFront scripts, styles and images
@@ -166,12 +162,25 @@ function VFA_vuefront_admin_action_update() {
166162
VFA_vuefront_admin_action_vf_information();
167163
}
168164

165+
function VFA_vuefront_admin_action_update() {
166+
try {
167+
$tmpFile = download_url( $_POST['url'] );
168+
VFA_vuefront_rmdir( ABSPATH . 'vuefront' );
169+
$phar = new PharData( $tmpFile );
170+
$phar->extractTo( ABSPATH . 'vuefront' );
171+
172+
} catch ( \Exception $e ) {
173+
echo $e->getMessage();
174+
}
175+
176+
VFA_vuefront_admin_action_vf_information();
177+
}
178+
169179
function VFA_vuefront_admin_general() {
170180
require_once 'view/template/general.tpl';
171181
}
172182

173183
function VFA_my_plugin_admin_scripts() {
174-
$pax_url = plugin_dir_url(__FILE__).'view/javascript/dist/';
175184
$pax_dist = plugin_dir_path(__FILE__).'view/javascript/dist/';
176185

177186
if(!file_exists(ABSPATH.'wp-includes/js/dist/vendor/wp-polyfill.js')) {
Lines changed: 29 additions & 0 deletions
Loading

view/javascript/assets/img/rocket.png

18.9 KB
Loading

view/javascript/assets/img/rocket.svg

Lines changed: 127 additions & 0 deletions
Loading
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
// .vf-modal {
2+
// display: block;
3+
// }
4+
.vf-modal-open {
5+
overflow: hidden;
6+
.vf-modal {
7+
overflow-x: hidden;
8+
overflow-y: auto;
9+
// display: none;
10+
display: block;
11+
position: fixed;
12+
top: 0;
13+
right: 0;
14+
bottom: 0;
15+
left: 0;
16+
z-index: 1050;
17+
-webkit-overflow-scrolling: touch;
18+
outline: 0;
19+
text-align: center;
20+
padding: 0 !important;
21+
&:before {
22+
content: '';
23+
display: inline-block;
24+
height: 100%;
25+
vertical-align: middle;
26+
margin-right: -4px; /* Adjusts for spacing */
27+
}
28+
> .vf-modal-dialog {
29+
display: inline-block;
30+
text-align: left;
31+
vertical-align: middle;
32+
position: relative;
33+
width: auto;
34+
margin: 10px;
35+
@media (--tablet) {
36+
width: 532px;
37+
margin: 30px auto;
38+
}
39+
@media (--laptop) {
40+
width: 920px;
41+
margin: 30px auto;
42+
}
43+
@media (--desktop) {
44+
width: 920px;
45+
margin: 30px auto;
46+
}
47+
> .vf-modal-content {
48+
position: relative;
49+
background-color: #fff;
50+
border-radius: 3px;
51+
box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.1);
52+
background-clip: padding-box;
53+
@media (--tablet) {
54+
box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);
55+
}
56+
.vf-modal-close {
57+
position: absolute;
58+
right: 40px;
59+
top: 30px;
60+
color: #1a1a1a;
61+
cursor: pointer;
62+
z-index: 2;
63+
font-size: 35px;
64+
}
65+
> .vf-modal-header {
66+
padding: 22px 36px 40px;
67+
text-align: center;
68+
font-weight: 400;
69+
font-family: "Open Sans", sans-serif;
70+
font-size: 30px;
71+
color: #1a1a1a;
72+
.vf-modal-title {
73+
margin: 0;
74+
line-height: 1.42857143;
75+
text-transform: uppercase;
76+
letter-spacing: -1.5px;
77+
span.yellow {
78+
font-weight: bold;
79+
color: #f7cf42 !important;
80+
background-color: inherit !important;
81+
}
82+
.sub-title {
83+
text-transform: none;
84+
font-size: 35px;
85+
padding: 3px;
86+
}
87+
}
88+
.vf-modal-sub-title {
89+
margin-top: 9px;
90+
font-size: 17px;
91+
letter-spacing: -1.5px;
92+
line-height: 2.26;
93+
}
94+
}
95+
> .vf-modal-body {
96+
position: relative;
97+
padding: 35px 70px 0;
98+
color: #ffffff;
99+
}
100+
> .vf-modal-footer {
101+
padding: 20px 70px 35px;
102+
text-align: center;
103+
}
104+
}
105+
}
106+
}
107+
.vf-modal-backdrop {
108+
position: fixed;
109+
top: 0;
110+
right: 0;
111+
bottom: 0;
112+
left: 0;
113+
z-index: 1040;
114+
background-color: #132026;
115+
&.fade {
116+
opacity: 0;
117+
filter: alpha(opacity=0);
118+
}
119+
&.in {
120+
opacity: 0.8;
121+
filter: alpha(opacity=8);
122+
}
123+
}
124+
}

view/javascript/assets/scss/main.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
@import './modal';
12
.vf-module-content {
3+
24
@import './colors';
35
@import 'node_modules/bootstrap/scss/functions';
46
@import './variables';
@@ -31,9 +33,9 @@
3133
// @import "node_modules/bootstrap/scss/list-group";
3234
@import "node_modules/bootstrap/scss/close";
3335
// @import "node_modules/bootstrap/scss/toasts";
34-
// @import "node_modules/bootstrap/scss/modal";
35-
@import "node_modules/bootstrap/scss/tooltip";
36-
@import "node_modules/bootstrap/scss/popover";
36+
@import "node_modules/bootstrap/scss/modal";
37+
@import "node_modules/bootstrap/scss/tooltip";
38+
@import "node_modules/bootstrap/scss/popover";
3739
// @import "node_modules/bootstrap/scss/carousel";
3840
@import "node_modules/bootstrap/scss/spinners";
3941
@import "node_modules/bootstrap/scss/utilities";

0 commit comments

Comments
 (0)