Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Loading icon at child page publish action
https://www.tinywebgallery.com/forum/viewtopic.php?f=21&t=4560
Page 1 of 1

Author:  alessandr0c [ 3. Mar 2018, 21:46 ]
Post subject:  Loading icon at child page publish action

Hello
I have a question.
I've built a front-end page that contains an advanced_iframe that shows a back-end page. The back-end page is Add new post.
I want that when the user publishes the post (press the button publish) the plug-in shows the upload icon.
At the moment the upload icon is shown only when the parent page is first opened
Thanks in advance

Author:  TinyWebGallery [ 8. Mar 2018, 12:59 ]
Post subject:  Re: Loading icon at child page publish action

Is the pressing triggering a page reload?

Because the loading icon is on the parent side. not on the iframe side.

Best, Michael

Author:  alessandr0c [ 17. Mar 2018, 11:18 ]
Post subject:  Re: Loading icon at child page publish action

Hi,

Exactly, the button is inside the iframe.
You're telling me that when there's a load inside the iframe, does not mean that there is also loading on the parent page. So the loading icon can't starts.

Then I'm now considering two options, and I ask you some help about they:
1. can I create new button in the parent page that trigger the button inside the iframe? can you suggest me how can I do it?
2. or, can I trigger the parent page when i press the button inside the iframe? in this case i can't modify the back-end page because e haven't the skills. Can you suggest me how can I do it?

Thanks in advance
Best regards
Alessandro

Author:  TinyWebGallery [ 17. Mar 2018, 18:45 ]
Post subject:  Re: Loading icon at child page publish action

The problem even if the page inside would trigger a reload. When should the loading icon be started? Because the onload event of the iframe happens after the iframe is loaded. This is the event I use to hide the the loading icon!

But why do you not simply add a loading icon inside the iframe to the button directly?
And are you on the same domain or a different domain?

Best, Michael

Author:  alessandr0c [ 17. Mar 2018, 19:18 ]
Post subject:  Re: Loading icon at child page publish action

Hi,

I do not have the skills for build a preload for a back-end page. And I have not found a plug-in for preload on back-end. Can you suggest me something?

these are the two pages:
the parent:
http://ipaddress/company/wp/home/aggiungi-avvisi/
the child:
http://ipaddress/company/wp/wp-admin/post-new.php
And I have Pro version

Thanks
Regards
Alessandro

Author:  TinyWebGallery [ 18. Mar 2018, 01:55 ]
Post subject:  Re: Loading icon at child page publish action

Hi Alessandro,

I think you need a custom solution. As you are on the same domain I could trigger the load icon by extending the plugin.
I don't know if the button does load a new page or works by ajax. Depending on this a different solution is needed.

But does the click really take this long?
Because normally I would simply disable the button once it is clicked.

Best, Michael

Author:  alessandr0c [ 18. Mar 2018, 08:58 ]
Post subject:  Re: Loading icon at child page publish action

Hi Michael,

Quote:
I don't know if the button does load a new page or works by ajax
The button is the classic Publish button on the wordpress admin pages (exaple in the pages: Add new post, Add new custom post).

I want to explain the problem better. I attach two images that show you the problem:
- In first i write my new post (on front-end, inside an advanced_iframe) and then I click on Publish.
Attachment:
NewPost_1.JPG
NewPost_1.JPG [ 149.82 KiB | Viewed 3785 times ]

- In the second image you can see some part (of back-end page) I had hidden with Advanced_iFrame parameters or with Adminimize or also with Advanced Acces Control.
Attachment:
NewPost_2.jpg
NewPost_2.jpg [ 185.37 KiB | Viewed 3785 times ]


So after clicking on Publish, Wordpress shows for a few milliseconds the parts that I had hidden and user can click on they. I do not want these parts to be shown.

Thanks.
Alessandro

Author:  TinyWebGallery [ 18. Mar 2018, 21:09 ]
Post subject:  Re: Loading icon at child page publish action

I think I understand. You are showing a part of the WP administration in an iframe? Can you show me your current configuration?
Because if the loading icon is shown still the user will see the content you are hiding.

Maybe using the external workaround although you are on the same domain works for you! Because then you could e.g. include css dynamically which does hide the areas you don't like before the content is shown.

Best, Michael

Author:  alessandr0c [ 19. Mar 2018, 09:30 ]
Post subject:  Re: Loading icon at child page publish action

Hi Michael,

Yes is an administration page inside an iframe. The code i have wirtten for my front-end page is:

Code:
<a href="http://ipaddress/company/wp/home/aggiungi-avvisi/trova-e-modifica-avvisi/">Trova e Modifica Avvisi</a>
<p style="text-align: right;">[login-logout text_to_login="Login" text_to_logout="Logout" redirect="http://ipaddress/company/wp/"]   [user_login]   <a href="http://ipaddress/company/wp/wp-admin">Edit</a></p>

[advanced_iframe securitykey="SECURITYKEY" src="http://ipaddress/company/wp/wp-admin/post-new.php" id="aggiungiavvisi"
use_shortcode_attributes_only="true" width="944px" height="530px" show_part_of_iframe="true" show_part_of_iframe_x="54" show_part_of_iframe_y="58" show_part_of_iframe_width="944" show_part_of_iframe_height="330" show_part_of_iframe_allow_scrollbar_horizontal="false" show_part_of_iframe_allow_scrollbar_vertical="false"
iframe_hide_elements=".hide-if-no-js, .handlediv, .hndle, .inline-edit-group, .page-title-action, #message, #adminmenumain, #wpadminbar, #mw_adminimize_admin_bar, #footer-thankyou, #wpfooter, #footer-upgrade, #visibility, #wpchat, .wp-editor-tabs, #wp-word-count, #post-status-info, #postdivrich, .autosave-info, #minor-publishing-actions, .misc-pub-post-status, .tips, #edit-slug-box, #commentsdiv, #category-adder"
iframe_content_id="#wpcontent|.eo-grid-8|#categorydiv|#event-categorydiv|#submitdiv|#post-body-content|#post-body|#side-sortables|.eo-grid|#excerpt|#postexcerpt|#postbox-container-2|#normal-sortables"
iframe_content_styles="background-color:white|width:200px|width:300px|width:300px;height:400px|width:300px|width:535px|width:535px|width:300px|display:inline-block|height:314px|height:325px|height:305px|height:305px"
show_part_of_iframe_new_window="_top" show_part_of_iframe_new_url="http://ipaddress/company/wp/" hide_page_until_loaded="true" show_iframe_loader="true"]


Just to be clear ... the loading icon (advanced_iframe loadin icon, I mean. Not other preloader plug-in) is shown only when the parent page is open. Not also when user confirm the registration of the post. After user send the post, worpress show for only few second some parts I had hidded inside the iframe. After, the page (parent or child, I don't know) finish to load and the parts I had hidden correctly disappear. In this short period of time, user can click in some parts I wanted to hide. Moreover is unaesthetic.

Quote:
Maybe using the external workaround although you are on the same domain works for you! Because then you could e.g. include css dynamically which does hide the areas you don't like before the content is shown.

I believe I will not be able to develop this.

Thanks
Alessandro.

Author:  TinyWebGallery [ 19. Mar 2018, 10:37 ]
Post subject:  Re: Loading icon at child page publish action

The css solution I wrote is not much different to you existing one! You only have to define the settings in the administration and not in the shortcode. And then set "Write css directly" for the external workaround.

Please see the instruction there!

The only "hard" part is to include the ai_external.js. I have already an option for this for the site. But not for the administration yet.

Best, Michael

Author:  alessandr0c [ 19. Mar 2018, 23:01 ]
Post subject:  Re: Loading icon at child page publish action

Hi Michael,

Quote:
The css solution I wrote is not much different to you existing one!
I did not fully understand what you mean

Quote:
You only have to define the settings in the administration and not in the shortcode. And then set "Write css directly" for the external workaround. Please see the instruction there!
Ok, I think I understand how it works

Quote:
The only "hard" part is to include the ai_external.js.
How should I include a script on an administration page? The page I show in the iframe is this http: //ipaddress/company/wp/wp-admin/post-new.php. But I do not know how to include the ai_external.js file. And how to do it in the right place. I can not find a html page called post-new.

Quote:
I have already an option for this for the site. But not for the administration yet.




I really appreciate your help

Best regards

Alessandro

Author:  TinyWebGallery [ 19. Mar 2018, 23:24 ]
Post subject:  Re: Loading icon at child page publish action

Please send me an e-mail. I will send you a version where you can add the ai_external to the administration.

Best, Michael

Author:  alessandr0c [ 19. Mar 2018, 23:36 ]
Post subject:  Re: Loading icon at child page publish action

Hi Michael,

I sent you a private message with mi e-mail

Thank you so much for your help.

Alessandro

Author:  alessandr0c [ 25. Mar 2018, 17:14 ]
Post subject:  Re: Loading icon at child page publish action

Hi Michael,

I really appreciate the time you dedicate to me.
but at the moment I am not able to use the External workaround because I am not able to find the correct position for the script in the file of the admin page.
I'm sorry.
In any case, my site works well.

Thanks

Alessandro

Author:  TinyWebGallery [ 25. Mar 2018, 23:59 ]
Post subject:  Re: Loading icon at child page publish action

o.k. if you need any more help please let me know.

Best, Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/