Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚧 [WIP] Revamp metabox into admin settings #17

Merged
merged 34 commits into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4551802
🚧 Create basic admin menu layout
williamchong Aug 20, 2018
8c85bc5
🎨 Prepend all functions with `likecoin_`
williamchong Aug 20, 2018
ae979c2
🚧 Add site options page
williamchong Aug 20, 2018
e2fe44d
✨ Add basic site likecoin id option UI
williamchong Aug 21, 2018
6b52be8
✨ Add site likebutton option
williamchong Aug 21, 2018
ccee141
✨ Add user likecoin id option page
williamchong Aug 21, 2018
4c8aa42
✨ Update content_filter logic for adding likebutton into posts
williamchong Aug 22, 2018
f5d1f02
🎨 Update metabox UI to new options model
williamchong Aug 22, 2018
70804df
✨ Add disconnect LikeCoin ID button
williamchong Aug 22, 2018
a0e109c
💄 Refactor web3 error/preview UI js
williamchong Aug 22, 2018
4a81a69
💬 Minor changes to wordings and class names
williamchong Aug 22, 2018
74b4df7
💄 Apply css accorindg to UI design
williamchong Aug 22, 2018
9ebb118
🚚 Rename css filename and wp style group name
williamchong Aug 22, 2018
55decdd
🚨 Fix lint warnings
williamchong Aug 22, 2018
0c88389
♻️ Rename all option into constant define() and store `likecoin_user`…
williamchong Aug 23, 2018
f3d916f
🔒 Add empty index.php in directories
williamchong Aug 23, 2018
4d04463
🚸 Make checkbox label clickable
williamchong Aug 23, 2018
b26f86a
✨ Add storing and displaying avatar
williamchong Aug 23, 2018
07e230c
🐛 Fix storing undefined avatar
williamchong Aug 23, 2018
8efb465
🐛 Fix metabox did not block author when setting is disabled
williamchong Aug 23, 2018
89f3680
🚸 Show error when user enable site likebutton without site likecoin ID
williamchong Aug 23, 2018
3fa5c55
🐛 Fix wrong meta key in uninstall hook
williamchong Aug 23, 2018
98ed46a
💬 Fix typo
williamchong Aug 23, 2018
6cef3b6
🐛 Fix check box and displlay behaviour when option was not set yet
williamchong Aug 24, 2018
96d38bd
🐛 Fix wrong site button judgement in content hook
williamchong Aug 24, 2018
871122c
🎨 Name all `get_option` as `$option`
williamchong Aug 24, 2018
abf2bf9
🐛 Fix wrong behaviour when author disable LikeButton
williamchong Aug 24, 2018
4efc6cb
🚸 Hide site LikeCoin ID table if site LikeButton is not enabled
williamchong Aug 24, 2018
a202cc5
🏗 Revamp js structure
williamchong Aug 24, 2018
08997b1
🚨 Fix lint error
williamchong Aug 24, 2018
ec50e01
💚 Fix build script diff location
williamchong Aug 24, 2018
8d2bbac
🐛 Fix site LikeButton cannot be enabled when author LikeCoin ID is mi…
williamchong Aug 24, 2018
b94ba34
🚸 Add default option logic for metabox
williamchong Aug 24, 2018
a32347c
🐛 Fix typo in metabox.php
williamchong Aug 24, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
- run:
name: Build Test
command: |
cd likecoin/assets/js
mv likecoin.es5.js likecoin.original.es5.js
cd likecoin/assets/js/dist
mv likecoin.js likecoin.original.js
npm run build
diff likecoin.es5.js likecoin.original.es5.js
diff likecoin.js likecoin.original.js
- save_cache:
key: likecoin-wordpress-{{ .Environment.CACHE_UUID }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
paths:
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
**/*.es5.js
node_modules
vendor
dist
188 changes: 188 additions & 0 deletions likecoin/assets/css/likecoin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
.likecoin {
font-family: 'Open Sans', 'Source Sans Pro', 'Noto Sans', 'Microsoft JhengHei', Arial, sans-serif;
}

.likecoin h3 {
color: #462405;
}

.likecoin a {
color: #28646e;
}

.likecoin section {
padding: 0 10px;
}

.likecoin .links {
float: right;
}

.likecoin .icon svg {
float: right;

width: 22px;
height: 22px;

color: #737373;
fill: currentColor;
}

.likecoin .likecoinButton {

min-width: 256px;

padding: 8px 16px;

cursor: pointer;

text-align: center;

text-decoration: none;

color: white;
border: 0;

background-color: #28646e;

font-size: 24px;
}

.likecoin .centerContainer {

display: flex;
align-items: center;
flex-direction: column;
justify-content: center;

width: 100%;
height: 100%;
}

.likecoin.optionsSection .changeBtn {
cursor: pointer;
text-decoration: underline;

font-size: 12px;
}

.likecoin .previewSection{
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;

padding: 20px 40px;

color: #d8d8d8;

background: white;
}

.likecoin .previewSection span{
margin: 20px 0;
}

.likecoin .likecoinId {

text-decoration: none;

color: #4a90e2;

font-size: 14px;
font-weight: 600;
}

/* likecoin ID table*/

.likecoin .likecoinTable {
border: solid 1px #e6e6e6;
background: #f9f9f9;
}

.likecoin .likecoinTable .likecoinAvatar {
max-width: 64px;
max-height: 64px;

margin-right: 16px;

border-radius: 50%;
}

.likecoin .likecoinTable .avatarWrapper {
display: flex;
align-items: center;
flex: 1;
}

.likecoin .likecoinTable tr {

white-space: nowrap;

border: solid 1px #e6e6e6;
}

.likecoin .likecoinTable th {

height: 40px;

padding: 0 14px;

vertical-align: middle;

background: white;

font-size: 14px;
font-weight: 600;
}

.likecoin .likecoinTable td {

height: 64px;
padding: 8px 14px;

font-size: 14px;
}

.likecoin .likecoinTable td.actions {

display: flex;
align-items: center;
justify-content: center;

margin-bottom: 0;
padding: 16px;

white-space: nowrap;
}

.likecoin .likecoinTable td.actions .actionWrapper {
display: flex;
align-items: center;
flex: 1;
justify-content: center;

height: 48px;

border-right: solid 1px #d8d8d8;

border-left: solid 1px #d8d8d8;
}

.likecoin .likecoinTable td.actions a {
cursor: pointer;

text-align: center;

text-decoration: none;

font-weight: 600;
}

.likecoin #likecoinChangeBtn{
color: #4a90e2;
}

.likecoin #likecoinLogoutBtn{
color: #d0021b;
}

113 changes: 0 additions & 113 deletions likecoin/assets/css/metabox.css

This file was deleted.

18 changes: 18 additions & 0 deletions likecoin/assets/icon/likecoin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions likecoin/assets/js/admin/likecoin_site_options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* global WP_CONFIG */

const siteCheckbox = document.querySelector(`#${WP_CONFIG.siteButtonCheckboxId}`);

function onToggleSiteButton() {
const element = document.querySelector('.site_liekcoin_id_table');
if (this.checked) {
element.style.display = '';
} else {
element.style.display = 'none';
}
}

if (siteCheckbox) {
siteCheckbox.addEventListener('change', onToggleSiteButton);
if (!siteCheckbox.checked) {
const element = document.querySelector('.site_liekcoin_id_table');
element.style.display = 'none';
}
}
21 changes: 21 additions & 0 deletions likecoin/assets/js/dist/admin/likecoin_site_options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* global WP_CONFIG */
var siteCheckbox = document.querySelector("#".concat(WP_CONFIG.siteButtonCheckboxId));

function onToggleSiteButton() {
var element = document.querySelector('.site_liekcoin_id_table');

if (this.checked) {
element.style.display = '';
} else {
element.style.display = 'none';
}
}

if (siteCheckbox) {
siteCheckbox.addEventListener('change', onToggleSiteButton);

if (!siteCheckbox.checked) {
var element = document.querySelector('.site_liekcoin_id_table');
element.style.display = 'none';
}
}
2 changes: 2 additions & 0 deletions likecoin/assets/js/dist/likecoin.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions likecoin/assets/js/dist/likecoin.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions likecoin/assets/js/likecoin.es5.js

This file was deleted.

1 change: 0 additions & 1 deletion likecoin/assets/js/likecoin.es5.js.map

This file was deleted.

Loading