[3.2][BETA] Advanced Polls

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Get Involved
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm

Re: [3.2][BETA] Advanced Polls

Post by Lord Phobos » Thu Feb 07, 2019 12:33 pm

My users complain the lack of visual feedback after selecting any option.
They come to me saying "polls don't work!", then I go watch and can see they voted.

They don't notice it. The system should give away a "thanks for voting" message, something like that.
Me too, at test polls before live, noticed that.

There's a way to solve?

User avatar
jasolo
Registered User
Posts: 51
Joined: Sat Jan 20, 2018 9:17 pm

Re: [3.2][BETA] Advanced Polls

Post by jasolo » Thu Feb 07, 2019 7:56 pm

With the Prosilver theme, after the vote is submitted, the message "Your vote has been cast." is visible during five seconds below the "Submit vote" button. It is the same as the phpBB default polls. Are you using Prosilver theme? With Prosilver you can increase the time delay: in the file ext/wolfsblvt/advancedpolls/styles/prosilver/template/js/functions.js change the value 5000 by another value in milliseconds in the line

Code: Select all

$(this).delay(5000).fadeOut(500, function () { 
You can also modify the style of the 'vote-submitted' class (styles/prosilver/theme/content.css) to increase the size of the font or the background color used for the message.

Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm

Re: [3.2][BETA] Advanced Polls

Post by Lord Phobos » Thu Feb 07, 2019 8:26 pm

I use a copy of prosilver, so generally I just copy the "prosilver" folder in the extensions I use in a new folder, rename it with the name of my style, and the parameters are loaded correctly.

In this case, I just see a loading rotation for a few seconds but no messages.

Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm

Re: [3.2][BETA] Advanced Polls

Post by Lord Phobos » Thu Feb 07, 2019 8:29 pm

In which language file I should find the string "Your vote has been cast."?

Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm

Re: [3.2][BETA] Advanced Polls

Post by Lord Phobos » Thu Feb 07, 2019 8:33 pm

I think this is the crucial part, in the function.js file:

Code: Select all

			// Display "Your vote has been cast." message. Disappears after 5 seconds.
			var confirmationDelay = (res.can_vote) ? 300 : 900;
			poll.find('.vote-submitted').delay(confirmationDelay).slideDown(200, function () {
				if (resultsVisible) {
					updatePanelHeight();
				}

				$(this).delay(5000).fadeOut(500, function () {
					resizePanel(300);
				});
			});

			// Remove the gap resulting from removing options
			setTimeout(function () {
				resizePanel(500);
			}, 1500);
		}
	},

User avatar
jasolo
Registered User
Posts: 51
Joined: Sat Jan 20, 2018 9:17 pm

Re: [3.2][BETA] Advanced Polls

Post by jasolo » Thu Feb 07, 2019 9:20 pm

Lord Phobos wrote:
Thu Feb 07, 2019 8:29 pm
In which language file I should find the string "Your vote has been cast."?
In "language/en/viewtopic.php". In other languages look for the variable VOTE_SUBMITTED.
Lord Phobos wrote:
Thu Feb 07, 2019 8:33 pm
I think this is the crucial part, in the function.js file:
Yes.
Lord Phobos wrote:
Thu Feb 07, 2019 8:26 pm
In this case, I just see a loading rotation for a few seconds but no messages.
The message appears after that loading rotation dissapears.

Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm

Re: [3.2][BETA] Advanced Polls

Post by Lord Phobos » Thu Feb 07, 2019 9:59 pm

It doesn't appear.

User avatar
jasolo
Registered User
Posts: 51
Joined: Sat Jan 20, 2018 9:17 pm

Re: [3.2][BETA] Advanced Polls

Post by jasolo » Thu Feb 07, 2019 10:57 pm

Check if this line appears after the button in the source code of the page with the poll:
<div class="vote-submitted hidden" style="display: none;">Your vote has been cast.</div>
After the vote is submitted, the jQuery function "slideDown" makes visible the message, "delay(5000)" waits 5 seconds and "fadeOut(500" fades the message to transparent during half second.

Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm

Re: [3.2][BETA] Advanced Polls

Post by Lord Phobos » Fri Feb 08, 2019 4:06 am

I have this:

Code: Select all

<div class="vote-submitted hidden">Il tuo voto è stato registrato.</div>

User avatar
jasolo
Registered User
Posts: 51
Joined: Sat Jan 20, 2018 9:17 pm

Re: [3.2][BETA] Advanced Polls

Post by jasolo » Fri Feb 08, 2019 7:42 am

That is the line. The part "style="display: none;" in my code is from the fading after the submitting. You should check the changes on that line during the submitting, with the Inspect option of the browser (right clic + Inspect in Chrome, Inspect element in Firefox). When visible, "display: block;" is added to the style. Because that message is initially hidden, inspect the submit button to activate the Inspector and then select the code of the message in the Inspector, below the submit button.

Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm

Re: [3.2][BETA] Advanced Polls

Post by Lord Phobos » Sat Feb 09, 2019 3:09 pm

When you make a mistake in voting, a popup appears and you need to close that popup. You can't miss it, you have to close the message saying "You cannot vote", etc.

I would like to have a similare behaviour even for "Your vote has been cast", would that be possibile?

User avatar
jasolo
Registered User
Posts: 51
Joined: Sat Jan 20, 2018 9:17 pm

Re: [3.2][BETA] Advanced Polls

Post by jasolo » Sat Feb 09, 2019 4:32 pm

One solution for the popup would be to add a line swith the phpbb.confirm function in function.js:

Code: Select all

				phpbb.confirm(poll.find('.vote-submitted').text()); 
				
				$(this).delay(5000).fadeOut(500, function () {
					resizePanel(300);
				});

Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm

Re: [3.2][BETA] Advanced Polls

Post by Lord Phobos » Sun Feb 10, 2019 2:43 pm

Where precisely should I add this line?

Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm

Re: [3.2][BETA] Advanced Polls

Post by Lord Phobos » Sun Feb 10, 2019 2:49 pm

I added the code like that in function.js

Code: Select all

			// Display "Your vote has been cast." message. Disappears after 5 seconds.
			var confirmationDelay = (res.can_vote) ? 300 : 900;
			poll.find('.vote-submitted').delay(confirmationDelay).slideDown(200, function () {
				if (resultsVisible) {
					updatePanelHeight();
				}

				$(this).delay(5000).fadeOut(500, function () {
					resizePanel(300);
				});
			});
				phpbb.confirm(poll.find('.vote-submitted').text()); 
				
				$(this).delay(5000).fadeOut(500, function () {
					resizePanel(300);
				});
But still the message popup doesn't show.

User avatar
jasolo
Registered User
Posts: 51
Joined: Sat Jan 20, 2018 9:17 pm

Re: [3.2][BETA] Advanced Polls

Post by jasolo » Sun Feb 10, 2019 2:52 pm

In the crucial part of function.js file that you indicated the other day. Just paste the first line, the other lines are the reference to know where to paste the first one.

Post Reply

Return to “Extensions in Development”