A teaser?
-
@planner said:
@Mr_Waffle
Looking good, but how is this supposed to work?
Is the poll going to be the topic or is it designed to be inserted into a topic or can it be used both ways?
Because of certain limitations in NodeBB (that would require some serious extra hard work to get into core) it currently works like this:
- Click poll button in composer
- Poll composer opens
- If all your entries are valid, it's send to server and saved in the database. (database now contains unlinked poll)
- A "special" identifier is added to the post content (
(%poll:1%)
for example)
- You post your topic
- Post gets parsed, if identifier is found, it checks a few things: are the author of the poll and post the same? Has the poll been linked yet? And something else, think it was if the post was OP
- If everything checks out, poll and topic/post get linked via some database entries
That covers the creation of a poll, now how I'm showing it:
- Register for ajaxify events, catch navigation to
/topic/\d+/
- Ask server if this topic has a poll
- If it does, poll is returned and will be parsed and displayed. Else do nothing
Interesting stuff
- Click poll button in composer
-
Wow, all that awesome hard work @mr_waffle!
I wanted to tackle this a long time ago, but I wanted to go about it a different way, and use a polling API instead. It would've ended up being less work in the end, except I couldn't find a good enough polling API service!
-
@julian said:
Wow, all that awesome hard work @mr_waffle!
I wanted to tackle this a long time ago, but I wanted to go about it a different way, and use a polling API instead. It would've ended up being less work in the end, except I couldn't find a good enough polling API service!
Yeah I read that in another thread. Figured I'd be that guy and just create something myself
-
Maybe markdown can be extended for polls like the checkboxes in github. So creating a poll might be just typing out the below
[] option 1 [] option 2 [] option 3
Obviously it will have to be parsed and rendered and clicks need to be registered. Thinking out loud.
-
@Mr_Waffle I think giving the users the options of both a GUI or simple markdown would probably be the best. To us markdown is easy and makes a lot of sense but in general Markdown is still very new and most users have very little idea how to use it.
Trying to explain to the average forum user how to make a forum poll through markdown could be a nightmare and completely not worth it
-
@Mr_Waffle Poll? Definitely getting my vote.
-
@Chris said:
@Mr_Waffle I think giving the users the options of both a GUI or simple markdown would probably be the best. To us markdown is easy and makes a lot of sense but in general Markdown is still very new and most users have very little idea how to use it.
Trying to explain to the average forum user how to make a forum poll through markdown could be a nightmare and completely not worth it
Ye my idea would be to let the GUI insert the correct markdown.
-
@San1ty Options options options, I for one would also like to allow my users to post polls depending on what category they're in. I'm unsure on how extensible the permissions system in NodeBB is, might be worth making one of the most advanced ones in existence because I've always felt they're limited.
-
Guys, guys, I'll finish a barebone version of polls soon, then you can all add your features and create a pull request!
-
roooooofl
yeah this reminds me of my static page plugin. "A sample plugin to show how to build a static page"
next think you know I'm getting requests to make it able to put google adwords on the sidebar etc