Need help - viewHomeInNewTabFullBrowerWindow script

This topic has been viewed 8455 times and has 6 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
User avatar
Gildaniel
Posts: 135
Joined: Fri Aug 11, 2017 10:57 am
Country: Russia

Need help - viewHomeInNewTabFullBrowerWindow script

Post by Gildaniel »

Dear Colleagues, experienced in JavaScript sweethome lovers!

Could you please help me to adopt viewHomeInOverlay script, to see sh3d model online in full browser window, like model shows in Online Viewer? http://www.sweethome3d.com/viewHome.jsp?id=887

Exploring models online in framed overlay there are some incommodities to face:

With smartphones:
- too small window of 3d viewer, especially in vertical mode;
- if you ocasionally tap somewhere outside overlay window boundaries - it closes viewer.

With desktops:
- using mouse wheel without Shift button in some browsers scrolls the html page instead of zooming 3d (in aerial mode) or moving through (in virtual visit mode)
- also occasion tapping outside closes overlay.


Here http://www.sweethome3d.com/support/foru ... t,70#45816 Puybaret advised me to make some code changes; but after I import script and done it all navigation (aerial/virtual, levels) gone from the page, and my programming experience is not so good to correct it and compile new script :(

Can somebody help, to correct the code of viewHomeInOverlay and compile script, opening sh3d on a new tab to full browser window with navigation elements?
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Need help - viewHomeInNewTabFullBrowerWindow script

Post by Puybaret »

The Online viewer doesn't use [font=courier new]viewHomeInOverlay[/font] but [font=courier new]viewHome[/font]. If you want to inspire yourself from that viewer, just look at its source code!
Emmanuel Puybaret, Sweet Home 3D creator
User avatar
Gildaniel
Posts: 135
Joined: Fri Aug 11, 2017 10:57 am
Country: Russia

Re: Need help - viewHomeInNewTabFullBrowerWindow script

Post by Gildaniel »

Unfortunately, reading viewhome.js did not make the question more clear for me.

May be SweetHome3DJSViewer.html even better suits for "full screening"; but all my attempts to tie canvas size to innerHeight and innerHeight, 100%, 100vh/100vw made it even smaller :( https://woodmouse.ru/test/view/test.html

There is a way of adaptive full screen canvas alinement - https://stackoverflow.com/questions/428 ... f-viewport

Is it possible to use this method in SweetHome3DJSViewer.html?

Yours, Daniel
User avatar
Gildaniel
Posts: 135
Joined: Fri Aug 11, 2017 10:57 am
Country: Russia

Re: Need help - viewHomeInNewTabFullBrowerWindow script

Post by Gildaniel »

Next my step - I found function "window.onresize = function(ev)" in html of Online Viewer, and insert this script to SweetHome3DJSViewer.html

It almost works and reacting to browser resizing, but with mistakes.. ufffffff
https://woodmouse.ru/test/view/test2.html
User avatar
Gildaniel
Posts: 135
Joined: Fri Aug 11, 2017 10:57 am
Country: Russia

Re: Need help - viewHomeInNewTabFullBrowerWindow script

Post by Gildaniel »

User avatar
Gildaniel
Posts: 135
Joined: Fri Aug 11, 2017 10:57 am
Country: Russia

Re: Need help - viewHomeInNewTabFullBrowerWindow script

Post by Gildaniel »

Calling to the new browser window with button from https://woodmouse.ru/3dplan/iek/5.html
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Need help - viewHomeInNewTabFullBrowerWindow script

Post by Puybaret »

Congratulations! [:)]
Handling window space is really not the easiest thing in JavaScript...
Emmanuel Puybaret, Sweet Home 3D creator
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest