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

feat(plugin/page_vote): add page_vote plugin #983

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Liumingxun
Copy link

@Liumingxun Liumingxun commented Sep 21, 2024

I believe the "vote up/down page" button should be appended to a specified element. Style and update vote count still have some problem, but it's a work in progress.

Feel free to discuss with me and share your thoughts.

close #944

@pull-request-size pull-request-size bot added size/L and removed size/M labels Sep 22, 2024

function initPageVoteWidget(ctx: ContextApi, options: PageVoteOptions) {
const btnContainer = document.querySelector<HTMLElement>(options.btnEl)
if (!btnContainer) return // throw Error(`page vote's config \`btnEl\` selector ${options.btnEl} not found`)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to avoid test failed, it skips when enable page vote but there is no element to render, is this ok?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract this style for reuse
I think it can be further optimized, all of div.atk-actions span.atk-common-action-btn have duplicate style.

@Liumingxun Liumingxun marked this pull request as ready for review September 22, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[功能请求] 文章点赞功能
1 participant