Skip to content

Commit 6b0012b

Browse files
committed
fix: fix styles and fbug with DOCUMENT_ROOT
1 parent acda520 commit 6b0012b

33 files changed

+51
-41
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
/view/javascript/d_pax/.env
77
/view/javascript/d_pax/.idea
88
view/javascript/d_pax/node_modules
9+
view/javascript/.idea/

plugin.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ function VFA_vuefront_admin_action_turn_on() {
115115

116116
$catalog_path = $catalog_url_info['path'];
117117

118-
$catalog_path = $catalog_path . '/';
118+
$catalog_path = $catalog_path . '/';
119+
$document_path = $catalog_path;
120+
if(!empty($_SERVER['DOCUMENT_ROOT'])) {
121+
$document_path = str_replace(realpath($_SERVER['DOCUMENT_ROOT']), '', ABSPATH) . '/';
122+
}
119123
if(!file_exists(ABSPATH . '.htaccess')) {
120124
file_put_contents(ABSPATH.'.htaccess', "# BEGIN WordPress
121125
<IfModule mod_rewrite.c>
@@ -160,28 +164,28 @@ function VFA_vuefront_admin_action_turn_on() {
160164
# VueFront home page
161165
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout)
162166
RewriteCond %{QUERY_STRING} !.*(rest_route)
163-
RewriteCond %{DOCUMENT_ROOT}".$catalog_path."vuefront/index.html -f
167+
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/index.html -f
164168
RewriteRule ^$ vuefront/index.html [L]
165169
166170
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout)
167171
RewriteCond %{QUERY_STRING} !.*(rest_route)
168-
RewriteCond %{DOCUMENT_ROOT}".$catalog_path."vuefront/index.html !-f
172+
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/index.html !-f
169173
RewriteRule ^$ vuefront/200.html [L]
170174
171175
# VueFront page if exists html file
172176
RewriteCond %{REQUEST_FILENAME} !-f
173177
RewriteCond %{REQUEST_FILENAME} !-d
174178
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout)
175179
RewriteCond %{QUERY_STRING} !.*(rest_route)
176-
RewriteCond %{DOCUMENT_ROOT}".$catalog_path."vuefront/$1.html -f
180+
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/$1.html -f
177181
RewriteRule ^([^?]*) vuefront/$1.html [L,QSA]
178182
179183
# VueFront page if not exists html file
180184
RewriteCond %{REQUEST_FILENAME} !-f
181185
RewriteCond %{REQUEST_FILENAME} !-d
182186
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout)
183187
RewriteCond %{QUERY_STRING} !.*(rest_route)
184-
RewriteCond %{DOCUMENT_ROOT}".$catalog_path."vuefront/$1.html !-f
188+
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/$1.html !-f
185189
RewriteRule ^([^?]*) vuefront/200.html [L,QSA]";
186190

187191
$content = file_get_contents(ABSPATH . '.htaccess');

view/javascript/d_pax/components/header/Account.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<div class="header-account">
2+
<div
3+
id="vf-header-account"
4+
class="header-account"
5+
>
36
<b-nav-item-dropdown
47
toggle-class="text-decoration-none text-1 m-0 font-weight-semibold"
58
no-caret
@@ -84,7 +87,7 @@ export default {
8487
}
8588
</script>
8689
<style lang="scss">
87-
.header-account {
90+
#vf-header-account.header-account {
8891
display: flex;
8992
align-items: center;
9093
height: 52px;
@@ -93,7 +96,7 @@ export default {
9396
background-color: $white;
9497
padding: 13px 17px;
9598
96-
&__separator {
99+
.header-account__separator {
97100
border-top: 1px solid $white-eight;
98101
margin-top: 0;
99102
margin: 15px 0;
@@ -159,12 +162,12 @@ export default {
159162
box-shadow: none;
160163
}
161164
162-
&__icon {
165+
.header-account__icon {
163166
font-size: 24px;
164167
color: #1a1a1a;
165168
}
166169
167-
&__full_name {
170+
.header-account__full_name {
168171
margin-right: 5px;
169172
font-size: 18px;
170173
font-weight: 600;
@@ -177,7 +180,7 @@ export default {
177180
}
178181
}
179182
180-
&__image {
183+
.header-account__image {
181184
border-radius: 50%;
182185
margin-right: 10px;
183186
width: 24px;

view/javascript/d_pax/webpack.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ module.exports = (env, argv) => {
132132
let newBuffer = new Buffer.from(body)
133133

134134
const gzipRes = isZipped ? zlib.gzipSync(newBuffer) : newBuffer
135-
res.setHeader('content-length', gzipRes.length);
135+
if(isZipped) {
136+
res.setHeader('content-length', gzipRes.length);
137+
}
136138
_write.call(res, gzipRes)
137139
} catch (e) {
138140
_write.call(res, buffer)

view/javascript/d_vuefront/0.e6d693d90aa067fa8fbe.bundle.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

view/javascript/d_vuefront/0.e6da08e4c2cba367991f.bundle.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

view/javascript/d_vuefront/0.e6d693d90aa067fa8fbe.css renamed to view/javascript/d_vuefront/0.e6da08e4c2cba367991f.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)