Page 4 of 12

Re: [3.2][BETA] Advanced Polls

Posted: Thu Feb 07, 2019 12:33 pm
by Lord Phobos
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?

Re: [3.2][BETA] Advanced Polls

Posted: Thu Feb 07, 2019 7:56 pm
by jasolo
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.

Re: [3.2][BETA] Advanced Polls

Posted: Thu Feb 07, 2019 8:26 pm
by Lord Phobos
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.

Re: [3.2][BETA] Advanced Polls

Posted: Thu Feb 07, 2019 8:29 pm
by Lord Phobos
In which language file I should find the string "Your vote has been cast."?

Re: [3.2][BETA] Advanced Polls

Posted: Thu Feb 07, 2019 8:33 pm
by Lord Phobos
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);
		}
	},

Re: [3.2][BETA] Advanced Polls

Posted: Thu Feb 07, 2019 9:20 pm
by jasolo
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.

Re: [3.2][BETA] Advanced Polls

Posted: Thu Feb 07, 2019 9:59 pm
by Lord Phobos
It doesn't appear.

Re: [3.2][BETA] Advanced Polls

Posted: Thu Feb 07, 2019 10:57 pm
by jasolo
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.

Re: [3.2][BETA] Advanced Polls

Posted: Fri Feb 08, 2019 4:06 am
by Lord Phobos
I have this:

Code: Select all

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

Re: [3.2][BETA] Advanced Polls

Posted: Fri Feb 08, 2019 7:42 am
by jasolo
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.

Re: [3.2][BETA] Advanced Polls

Posted: Sat Feb 09, 2019 3:09 pm
by Lord Phobos
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?

Re: [3.2][BETA] Advanced Polls

Posted: Sat Feb 09, 2019 4:32 pm
by jasolo
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);
				});

Re: [3.2][BETA] Advanced Polls

Posted: Sun Feb 10, 2019 2:43 pm
by Lord Phobos
Where precisely should I add this line?

Re: [3.2][BETA] Advanced Polls

Posted: Sun Feb 10, 2019 2:49 pm
by Lord Phobos
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.

Re: [3.2][BETA] Advanced Polls

Posted: Sun Feb 10, 2019 2:52 pm
by jasolo
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.