I started checking-out SlyVote. The first thing I did was fire it up and got the "There are no voting areas configured." error. Rather than manually enter the sub-codes for all the areas I have configured to allow voting in SCFG, I just made this small modification to SlyVote.js:
The formatting is hosed because of the long lines, but you get the idea. It just takes all the areas in msg_area (which the user has access to) and where voting is enabled and uses that as the list. I can commit this if you like or if you don't like it, just ignore it or maybe do something different.
Also, there appears to be an issue with the "topic" selection widget when the number of topics (message areas) requires scrolling: the bottom-most item initially is blank (empty), but if you hit end or scroll down, it (the bottom-most item) will populate but get stuck. Login to Vertrauen, External Programs->Main->Voting Booth to see the problem live.
I started checking-out SlyVote. The first thing I did was fire it up and got the "There are no voting areas configured." error. Rather than manually enter the sub-codes for all the areas I have configured to allow voting in SCFG, I just made this small modification to SlyVote.js:
The formatting is hosed because of the long lines, but you get the idea. It just takes all the areas in msg_area (which the user has access to) and where voting is enabled and uses that as the list. I can commit this if you like or if you don't like it, just ignore it or maybe do something different.
Also, there appears to be an issue with the "topic" selection widget when the number of topics (message areas) requires scrolling: the bottom-most item initially is blank (empty), but if you hit end or scroll down, it (the bottom-most item) will populate but get stuck. Login to Vertrauen, External Programs->Main->Voting Booth to see the problem live.
One thing I'd like to see: If you have a lot of message areas that allow polls/voting, like I do, it'd be nice if the original list of "topic areas" indicated which have polls in them (most of the areas don't). Or maybe a separate menu item to scan the areas for polls (since it could take a few seconds). MsgBase.get_msg_index() might be faster than MsgBase.get_all_msg_headers() for just checking the 'attr' property.
Re: exec/load/DDLightbarMenu.js
By: Digital Man to Nightfox on Sun Aug 06 2017 02:01 pm
One thing I'd like to see: If you have a lot of message areas that allow polls/voting, like I do, it'd be nice if the original list of "topic areas" indicated which have polls in them (most of the areas don't). Or maybe a separate menu item to scan the areas for polls (since it could take a few seconds). MsgBase.get_msg_index() might be faster than MsgBase.get_all_msg_headers() for just checking the 'attr' property.
I just committed an update to SlyVote.js in CVS that will show a check mark in the area list next to areas that have polls in them. Please let me know if you think that looks okay.
It works and looks fine, but it takes 2 minutes to scan all my messages bases and displays no progress indicator while it's doing so. You can see for yourself at vert.synchro.net. Are you using get_msg_index() or get_all_msg_headers()?
Re: SlyVote
By: Digital Man to Nightfox on Mon Aug 07 2017 06:03 pm
It works and looks fine, but it takes 2 minutes to scan all my messages bases and displays no progress indicator while it's doing so. You can see for yourself at vert.synchro.net. Are you using get_msg_index() or get_all_msg_headers()?
Interesting.. On my BBS it loads fairly quick (about a second or so). I'm using get_msg_index() - You said that should be faster, correct?
I just committed a change where it now says "Loading areas..." when it's scanning the message areas.
If it might take that long to display the sub-boards, I wonder if there's a faster way it can check to see if there are polls in a sub-board..
If it might take that long to display the sub-boards, I wonder if
there's a faster way it can check to see if there are polls in a
sub-board..
1. I have a lot of sub-boards (100+), but most of them don't allow voting. Are you only checking the sub-boards that allow voting?
2. You might be doing something else after you open the message base and read the index (or before you close it) which is slowing down the scan. I guess I could have a look-see at your code if you can't find it.
On a slightly unrelated note: Do you mind renaming your "Read Me.txt" files to just "readme.txt"? If you notice, it messes up some of my CVS scripts: http://cvs.synchro.net/commitlog.ssjs
I make it a habit of not putting spaces (or other special characters) in filenames unless absolutely necessary. I guess I just assumed other CVS contributors would follow suit. :-)
Re: SlyVote
By: Digital Man to Nightfox on Mon Aug 07 2017 08:46 pm
If it might take that long to display the sub-boards, I wonder if
there's a faster way it can check to see if there are polls in a
sub-board..
1. I have a lot of sub-boards (100+), but most of them don't allow voting. Are you only checking the sub-boards that allow voting?
Yes, only the sub-board codes for sub-boards that allow voting will be used in SlyVote (I used your code that you posted several days ago for that).
2. You might be doing something else after you open the message base and read the index (or before you close it) which is slowing down the scan. I guess I could have a look-see at your code if you can't find it.
It's not doing anything else. I added a function for checking to see whether a sub-board has polls:
function subBoardHasPolls(pSubBoardCode)
{
var subBoardHasPolls = false;
var msgbase = new MsgBase(pSubBoardCode);
if (msgbase.open())
{
for (var i = 0; !subBoardHasPolls && (i < msgbase.total_msgs); ++i)
{
var msgIdx = msgbase.get_msg_index(true, i);
if ((msgIdx == null) || ((msgIdx.attr & MSG_DELETE) == MSG_DELETE))
continue;
if ((msgIdx.attr & MSG_POLL) == MSG_POLL)
subBoardHasPolls = true;
}
msgbase.close();
}
return subBoardHasPolls;
}
I'll play with tuning that in a couple of days. The first thing I notice is the reference to msgbase.total_msgs in your loop. It would be an improvement in speed to cache this property in a local variable as every time you read that property, the underlying code in the MsgBase class goes and reads the status of the message base:
var total_msgs = msgbase.total_msgs;
for (var i = 0; !subBoardHasPolls && (i < total_msgs); ++i)
I tried this enhancement on Vert and it made only a slight improvement in performance, so that's not the main issue. It could be a problem in the get_msg_index method. I'll look into it.
Re: SlyVote
By: Digital Man to Nightfox on Tue Aug 08 2017 11:56 am
I'll play with tuning that in a couple of days. The first thing I notice is the reference to msgbase.total_msgs in your loop. It would be an improvement in speed to cache this property in a local variable as every time you read that property, the underlying code in the MsgBase class goes and reads the status of the message base:
var total_msgs = msgbase.total_msgs;
for (var i = 0; !subBoardHasPolls && (i < total_msgs); ++i)
I tried this enhancement on Vert and it made only a slight improvement in performance, so that's not the main issue. It could be a problem in the get_msg_index method. I'll look into it.
Hi DM - I know this is an old message I'm replying to - we were discussing speed-related issues when I was initially working on SlyVote. I was curious if you had ever found anything that might help the speed issues we had noticed?
I added the MsgBase.get_index() method about a year ago for use in msglist.js which enhanced the performance considerable. Have you tried using that?
Re: SlyVote
By: Digital Man to Nightfox on Tue May 19 2020 03:00 pm
I added the MsgBase.get_index() method about a year ago for use in msglist.js which enhanced the performance considerable. Have you tried using that?
Yes, SlyVote uses get_index if it's available.
Sysop: | MCMLXXIX |
---|---|
Location: | Prospect, CT |
Users: | 325 |
Nodes: | 10 (0 / 10) |
Uptime: | 233:49:15 |
Calls: | 508 |
Messages: | 219886 |