Suggestions needed for poll plugin
-
@psychobunny thanks!
So what are you thoughts on the syntax? Something like in the first post or more something along the lines of:
[poll] - Option - Option [/poll]
The benefit of this one is that it allows for more "freedom" regarding possible settings.
-
Not sure really, I'd pick something that plays nice with Markdown with HTML sanitation turned on (default)
ie.
- Option - Option
If the poll's parse hook comes after Markdown, MD will turn this into bullet points before the poll plugin touches it. But if the parse hook is before MD, it would sanitize and zap all your HTML
Some things for you to think about when building this (future proofing)
- Poll expiration time
- Display results setting: always vs require vote first vs show only after poll expires or is manually stopped
- A button to end the poll
- Option to allow retracting/recasting votes
-
@psychobunny thanks, I'll keep that in mind.
I currently have the following "flow" in mind:
- Post gets saved (
filter:post.save
), poll is recognized before MD parses it - Poll is saved to database and markup is removed from post
- Using
action:post.gotTopic
, a poll is retrieved and client renders it
- Post gets saved (
-
Ah okay, makes sense. I thought you were rendering it in
filter:post.parse
, yours is a better strategy then. As far as your original question I'd say the second one feels neater I guess, but whatever works better for you -
@psychobunny doesn't really matter yet, but I also agree that the second will be the better option. It's both cleaner and can be extended easier.
-
So anyone feel like designing / creating some visuals? Specifically the poll view Would include both the vote and results screen.
-
@Carl I have this very ugly and quick mockup for testing purposes:
http://i.imgur.com/Lm1jv48.pngI've chosen to "embed" them inside the first post for theme compatibility reasons. In my opinion it would look best just above the first post, but I can't guarantee compatibility with all themes that way.
-
By the way... I got voting working
-
@Schamper Looks nice!
-
@baris Good catch hehe, this poll survived a few iterations and had a vote prior to adding a check if you had already voted, which wasn't backwards compatible. So the total count is at 2, but the option count is only at 1
-
I don't want to fully "release" just yet, so for anyone that wants to help out with the development of this: https://github.com/Schamper/nodebb-plugin-poll
I really need some code in there that's not mine (for new insights, you know), most of the stuff can probably be done better and more efficient.So for anyone reading, please help out
-
No promises ofc coz have a ton of other things on my plate, but will fork it and check it out, coz obviously I'm a bit impatient and all that