Advertisement:

Author Topic: need help making a please wait notification  (Read 731 times)

ysalim

  • Newbie
  • *
  • Posts: 7
need help making a please wait notification
« on: August 29, 2016, 06:17:11 pm »
Hi,

I wonder if anyone can help me to create a "please wait while we submitting your post" notification when the publish item button is clicked

https://db.tt/rueKci3Y

currently, the wait time is more than 5-10 seconds, and it got worsen when I use social media autopost. it now takes 27 seconds of doing nothing screen after the button is clicked.
In order not to confused users, I thought it would be necessary to have the "please wait while we submitting your post" notification

can someone help, Thank you so much

ezybusy

  • Full Member
  • ***
  • Posts: 193
Re: need help making a please wait notification
« Reply #1 on: August 29, 2016, 10:10:12 pm »
Totally agree.
Am also suffering from the same issue.

ysalim

  • Newbie
  • *
  • Posts: 7
Re: need help making a please wait notification
« Reply #2 on: August 30, 2016, 12:40:39 pm »
the closest i can find to create such notification is

http://malsup.com/jquery/block/#page

but not sure how to implement into our zara and osclass.

Please someone help

ezybusy

  • Full Member
  • ***
  • Posts: 193
Re: need help making a please wait notification
« Reply #3 on: August 31, 2016, 01:29:42 am »
Wow.
Thats exactely what i am looking for.
Guys can someone help on how to implement this?

ezybusy

  • Full Member
  • ***
  • Posts: 193
Re: need help making a please wait notification
« Reply #4 on: September 01, 2016, 01:03:31 am »
Please guys can someone help?

ezybusy

  • Full Member
  • ***
  • Posts: 193
Re: need help making a please wait notification
« Reply #5 on: September 02, 2016, 03:48:31 pm »
I managed to get an alert message that says "Please wait" when the an impatient user tries to click on the publish button more than once.

Paste the following on the item-post page:
Code: [Select]
<script type="text/javascript">
function clickStopper(e)
{
alert("Please wait"); // notify user to wait since there is an ongoing process
e.preventDefault();
}
</script>

on the same page look for the submit button. Should be something like
Code: [Select]
<button  type="submit"><?php echo osc_esc_html(__('Publish''your theme')); ?></button>

Then add the following code to it:

Code: [Select]
onclick="this.addEventListener('click', clickStopper, false);"
so you should have something like the following:

Code: [Select]
<button  type="submit" onclick="this.addEventListener('click', clickStopper, false);">
<?php echo osc_esc_html(__('Publish''your theme')); ?>
           </button>

Got code from http://www.the-art-of-web.com/javascript/doublesubmit/. Credit to the owner

It works for me.

Truth being that i would have preferred the publish button to be disabled, but i think the above can be used for the mean time.

ysalim

  • Newbie
  • *
  • Posts: 7
Re: need help making a please wait notification
« Reply #6 on: September 03, 2016, 11:02:15 am »
Thanks for the input and tips, I'll try on my system.

for others, please contribute to make it better.

Thank you