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

api addUi userbox_button #973

Merged
merged 2 commits into from
Jul 1, 2021

Conversation

ItsOnlyBinary
Copy link
Collaborator

@ItsOnlyBinary ItsOnlyBinary commented May 12, 2019

not sure if the css for this is going to need looking over by allan

Test plugin here: https://gist.github.com/ItsOnlyBinary/cb0b1d788b752485d093d1d20c92215b

closes #897

@AllanOcelot
Copy link
Contributor

This adds an easy way to add plugin buttons to the userBox I take it?

@@ -320,7 +320,8 @@
color: var(--brand-default-fg);
}

.kiwi-userbox .kiwi-userbox-actions .kiwi-userbox-action:hover {
.kiwi-userbox .kiwi-userbox-actions .kiwi-userbox-action:hover,
Copy link
Member

Choose a reason for hiding this comment

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

This line can simply be .kiwi-userbox-action:hover,

Copy link
Contributor

Choose a reason for hiding this comment

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

This has been made less specific now

@prawnsalad
Copy link
Member

This could do with passing some props to the plugin like we do here https://github.com/kiwiirc/kiwiirc/blob/master/src/components/ControlInput.vue#L97

Passing {el: plugin.el, props: { user: user, userbox: self }} where self is a computed property returning this

@ItsOnlyBinary
Copy link
Collaborator Author

this doesnt appear to work with using data
typeof this.$el.dataset.user === "string" in my test plugin

@ItsOnlyBinary
Copy link
Collaborator Author

As a solution i propose we use:

props: {
    kiwiParent: self,
}

this should help prevent any conflicts and also keep it consistent throughout the api.
this would mean for UserBox.vue the user object could be accessed as follows:

this.$el.kiwiParent.user

@prawnsalad
Copy link
Member

Actually that makes sense, but I would use a .kiwi property to keep them separate and easier for plugins to see what they have.

props: {
    kiwi: { user: this, etc: etc }
}

@ItsOnlyBinary
Copy link
Collaborator Author

Note ive changed ControlInput.vue to match the others which will be a breaking change for anyone using the old props

@ItsOnlyBinary
Copy link
Collaborator Author

rebased

@ItsOnlyBinary
Copy link
Collaborator Author

rebased

@ItsOnlyBinary ItsOnlyBinary force-pushed the api-userbox-button branch 2 times, most recently from cc70af4 to 9ccf78b Compare June 28, 2021 16:29
@ItsOnlyBinary ItsOnlyBinary merged commit 6c1f571 into kiwiirc:master Jul 1, 2021
@ItsOnlyBinary ItsOnlyBinary deleted the api-userbox-button branch July 1, 2021 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Changes that can have a breakinig effect on plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API allow adding buttons to userbox
3 participants