ElkArte Community

Elk Development => Feature Discussion => Topic started by: radu81 on August 01, 2015, 05:38:53 pm

Title: Confirmation before marking all posts as read
Post by: radu81 on August 01, 2015, 05:38:53 pm
Is the second or third time that on mobile for mistake I press the button "mark all as read". There were 3 pages with unread topics :( What do you think about the idea to add a confirm first window?
If I'm not wrong there was a mod for this on smf.
Title: Re: Confirmation before marking all posts as read
Post by: Flavio93Zena on August 01, 2015, 06:00:48 pm
Liked, saw that I have it installed on my own forum, it works, posting the link: http://custom.simplemachines.org/mods/index.php?action=parse;mod=3786;attach=224880;smf_version=2.0.10 WTFPL license, code by margarett.
Nuff said. ;D

P.S.: Cut off some fingers, your hands are too big, LOL.
Title: Re: Confirmation before marking all posts as read
Post by: emanuele on August 02, 2015, 05:15:51 am
I thought it was there... O_o

Oh well, there is to add the confirmation string to a javascript variable and add some confirm all around the globe. ;D
BTW, while writing this I realized: why don't we add a wrapper around confirm? In the future it may be the place to store some nicer interface for the function. Opinions?
Title: Re: Confirmation before marking all posts as read
Post by: Flavio93Zena on August 02, 2015, 10:37:29 am
It could either be browser-related or styled along with the forum. To be honest either way is fine, but I think that in 1.1 or something this might look "better" if it's styled ;) So yeah, go with the wrapper.
Title: Re: Confirmation before marking all posts as read
Post by: Flavio93Zena on August 11, 2015, 05:40:20 pm
Don't forget ♥  :D
Title: Re: Confirmation before marking all posts as read
Post by: emanuele on August 11, 2015, 05:50:24 pm
I tried, but I was not able to get it working... even on a simple textarea. LOL
Title: Re: Confirmation before marking all posts as read
Post by: Flavio93Zena on August 11, 2015, 05:54:17 pm
Temporarily code it the easier way to push it in a release (maybe?), and retry after you get some sleep :)
Title: Re: Confirmation before marking all posts as read
Post by: radu81 on September 19, 2016, 06:01:36 pm
Are there any news on this?  Sorry if I insist, but from mobile it's very easy to press that button by mistake and mark all as read, just happened today and I had 3 pages of unread messages.
Title: Re: Confirmation before marking all posts as read
Post by: emanuele on September 20, 2016, 03:17:00 am
:-[ :-[ :-[
I thought it was added a while ago...

/me hides

If you want a quick workaround for your site, open script_elk.js (themes/default/scripts) and replace the markboardreadButton function with:
Code: [Select]
function markboardreadButton(btn)
{
if (!confirm('Are you sure you want to mark all the messages in this board as read?'))
return false;

toggleButtonAJAX(btn);

// Remove all the "new" icons next to the topics subjects
$('.new_posts').remove();

return false;
}

ad the markallreadButton with:
Code: [Select]
function markallreadButton(btn)
{
if (!confirm('Are you sure you want to mark messages all as read?'))
return false;

toggleButtonAJAX(btn);

// Remove all the "new" icons next to the topics subjects
$('.new_posts').remove();

// Turn the board icon class to off
$('.board_icon').each(function() {
$(this).removeClass('on_board on2_board').addClass('off_board');
});

$('.board_new_posts').removeClass('board_new_posts');

return false;
}
Of course you can customize the message. ;)
Title: Re: Confirmation before marking all posts as read
Post by: radu81 on September 20, 2016, 03:41:43 am
I'll try this later, thank you Emanuele.
Title: Re: Confirmation before marking all posts as read
Post by: radu81 on September 21, 2016, 06:59:18 pm
Thank you Emanuele, it works ;)
Title: Re: Confirmation before marking all posts as read
Post by: ahrasis on September 21, 2016, 07:25:25 pm
I suggest we make it default in ElkArte core. It is always good to confirm.
Title: Re: Confirmation before marking all posts as read
Post by: radu81 on September 22, 2016, 06:32:39 pm
Where I usually press the "Mark all as read" is in "New Posts" (index.php?action=unread)
I suggest to also add the confirmation message for  markunreadButton function

Code: [Select]
function markunreadButton(btn)
{
if (!confirm('Are you sure .....?'))
return false;
toggleHeaderAJAX(btn, 'main_content_section');

return false;
}

Quote from: ahrasis – I suggest we make it default in ElkArte core. It is always good to confirm.
https://github.com/elkarte/Elkarte/issues/2690
Title: Re: Confirmation before marking all posts as read
Post by: emanuele on September 23, 2016, 07:30:48 am
I lost track of all the "mark as read" we have! LOL
Title: Re: Confirmation before marking all posts as read
Post by: live627 on September 23, 2016, 08:15:45 pm
that a dev-ish way of saying "I forgot"? :P
Title: Re: Confirmation before marking all posts as read
Post by: emanuele on September 25, 2016, 06:06:56 am
/me whistles innocently

Spoiler (click to show/hide)
Title: Re: Confirmation before marking all posts as read
Post by: emanuele on December 04, 2016, 08:48:13 am
I feel this is still pending, right?
Title: Re: Confirmation before marking all posts as read
Post by: Spuds on December 04, 2016, 09:46:31 am
If its not listed as a request on github, then it does not exist  O:-)
Title: Re: Confirmation before marking all posts as read
Post by: radu81 on December 04, 2016, 10:32:37 am
If this helps https://github.com/elkarte/Elkarte/issues/2690
Title: Re: Confirmation before marking all posts as read
Post by: Spuds on December 04, 2016, 10:53:22 am
And it does not exist since its been done  :P