Page 1 of 2

Redirection

Posted: Sun Sep 21, 2014 6:32 pm
by Rajah
Hi!

Is it possible to show a virtual tour on a html5 homepage without having all the files in the same root?
Some kind of redirection to the files at another place on the server.
Must work for all platforms. So, not iFrame.

Frans

Re: Redirection

Posted: Mon Sep 22, 2014 4:49 pm
by JimWatters
Yes. Add the relative paths in the project to where the files will be generated. These paths are saved in the xml file.

How far have you got? What is not working for you?

Re: Redirection

Posted: Mon Sep 22, 2014 6:39 pm
by Rajah
Hi Jim!

Have checked the xml files:
[name]_out.xml
skin.xml
but no paths.

I work with the PRO version. Can that be different?

So far I did decide to put the pano files in the root of the website and it works fine now, but... still curious :D

Frans

Re: Redirection

Posted: Mon Sep 22, 2014 6:51 pm
by 360Texas
I found .xml's shown in our Pano2vr Pro generated html called elrey.html in the \output folder.
Looks like this might be for Flash and or HTML5... not sure

Hope this helps
<body>
<script type="text/javascript" src="pano2vr_player.js">
</script>
<script type="text/javascript" src="skin.js">
</script>
<div id="container" style="width:100%;height:100%;">
This content requires HTML5/CSS3, WebGL, or Adobe Flash Player Version 9 or higher.
</div>
<script type="text/javascript">

// check for CSS3 3D transformations and WebGL
if (ggHasHtml5Css3D() || ggHasWebGL()) {
// use HTML5 panorama

// create the panorama player with the container
pano=new pano2vrPlayer("container");
// add the skin object
skin=new pano2vrSkin(pano);
// load the configuration
pano.readConfigUrl("elrey.xml");
// hide the URL bar on the iPhone
setTimeout(function() { hideUrlBar(); }, 10);
} else
if (swfobject.hasFlashPlayerVersion("10.0.0")) {
var flashvars = {};
var params = {};
// enable javascript interface
flashvars.externalinterface="1";
params.quality = "high";
params.bgcolor = "#00aaff";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "true";
var attributes = {};
attributes.id = "pano";
attributes.name = "pano";
attributes.align = "middle";
flashvars.skinxml="skin.xml";
flashvars.panoxml="elrey.xml";
params.base=".";
swfobject.embedSWF(
"pano2vr_player.swf", "container",
"100%", "100%",
"9.0.0", "",
flashvars, params, attributes);

}
</script>
<noscript>
<p><b>Please enable Javascript!</b></p>
</noscript>
</body>

Re: Redirection

Posted: Mon Sep 22, 2014 7:00 pm
by Rajah
Hi Dave!

As I understand you well, I have to make url's where you did mark the xml red?

Frans

Re: Redirection

Posted: Mon Sep 22, 2014 7:32 pm
by 360Texas
You mentioned that you could not find reference to paths for .xml so I found a few for you.

Actually, we keep all files in 1 folder. That way we can delete the project files if do not need that panorama.

Re: Redirection

Posted: Mon Sep 22, 2014 7:58 pm
by JimWatters
So you solved the problem with the image files and tiles for the pano being in a separate folder. Now you want to have these files in a different folder than where the html code is.
pano2vr_player.js, skin.js, skin.xml, and swfobject.js

You said you are adding a pano to the main web sites main page but can not use iFrames so will be modifying the html code to combine the existing home page to include a pano.

This sounds like a temporary solution until the next better pano is made.

I would output the pano to a folder as normal.

Your modified home page with the pano html code will need to be updated to the locations of these files .
<script type="text/javascript" src="pano_folder/swfobject.js">
</script>

<body>
<script type="text/javascript" src="pano_folder/pano2vr_player.js">
</script>
<script type="text/javascript" src="pano_folder/skin.js">
</script>
<div id="container" style="width:100%;height:100%;">
This content requires HTML5/CSS3, WebGL, or Adobe Flash Player Version 9 or higher.
</div>
<script type="text/javascript">

// check for CSS3 3D transformations and WebGL
if (ggHasHtml5Css3D() || ggHasWebGL()) {
// use HTML5 panorama

// create the panorama player with the container
pano=new pano2vrPlayer("container");
// add the skin object
skin=new pano2vrSkin(pano);
// load the configuration
pano.readConfigUrl("pano_folder/elrey.xml");
// hide the URL bar on the iPhone
setTimeout(function() { hideUrlBar(); }, 10);
} else
if (swfobject.hasFlashPlayerVersion("10.0.0")) {
var flashvars = {};
var params = {};
// enable javascript interface
flashvars.externalinterface="1";
params.quality = "high";
params.bgcolor = "#00aaff";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "true";
var attributes = {};
attributes.id = "pano";
attributes.name = "pano";
attributes.align = "middle";
flashvars.skinxml="pano_folder/skin.xml";
flashvars.panoxml="pano_folder/elrey.xml";
params.base="pano_folder";
swfobject.embedSWF(
"pano_folder/pano2vr_player.swf", "container",
"100%", "100%",
"9.0.0", "",
flashvars, params, attributes);

}
</script>
<noscript>
<p><b>Please enable Javascript!</b></p>
</noscript>
</body
>

Re: Redirection

Posted: Tue Sep 23, 2014 9:27 am
by Rajah
Jim & Dave thanks! This is just what I mend. Great! :D
http://www.virtueelbezoek.nl

Re: Redirection

Posted: Thu Apr 23, 2015 10:28 am
by ArkiTonio
Jim, is it possible to choose a path for "pano2vr_player.js", different from that of "pano.xml"? Or even decide not to output it at all?
I mean, having some different tours, each one outputting in it's own folder (with pano.xml, index.php, skin.js etc.), I find in those folders all those "pano2vr_player.js" files also, which are all replies, copies of itself...
Unuseful...
Instead I copied one and only "pano2vr_player.js" in a common folder, one level above, and I make all the tours refer to it through <script type="text/javascript" src="../pano2vr_player.js"></script> in "index.php"'s body, having modified the template adding those "../".
Great. It works.
So, my question is: how to avoid the creation of all those "pano2vr_player.js" files inside their respective folders?
Thank you again.

Re: Redirection

Posted: Thu Apr 23, 2015 3:57 pm
by 360Texas
Are you using the standard version of Pano2vr ?

1 tour .html, .swf, .xml, Pano2vr_player.js and other files
2nd tours etc same content

In Pano2vr Pro Multiple panoramas say 3 panorama tour
This version was developed to simplify files and folders structure. Primary feature, it creates all files and folders at 1 time with no required editing to merge many panoramas into one group project. Simple and time saving.

One main folder and only 1 set of working skin, xml, .js, swf, html etc support files
1 images folder with skin tool buttons

1 image folder with
_____3 sub folders
pano1 contains all tiles for only this panorama
pano2 contains all tiles for only this panorama
pano3 contains all tiles for only this panorama

Re: Redirection

Posted: Thu Apr 23, 2015 4:18 pm
by JimWatters
It is possible to move some files into common folders, but I find as tours get more complicated and special, it is worth to have all related files in the same folder. The files that are repeated with each tour are small in the scheme of things. I find the one advantage of having the files in a common location does make for easy upgrading to a newer version, because you have fewer files to replace.

Some of these files are copied into the output folder by HTML5 template file. other files, like pano2vr_player.js, are always needed and not controlled by the template.

You could modify a template and save it as a new name. It will show up as a new template in the dropdown list on the HTML tab. Easy way to find your template folder is File | Settings | File | Template Directory
For information of how the template works see the documentation. http://ggnome.com/wiki/HTML_Template

I have not tested these modifications.

For all occurrences of: document.addfile(source_file_location, destination_file_location);
change to: document.addfile(source_file_location, ../destination_file_location);
For every occurrence of destination_file_location change to ../destination_file_location

You can change the paths to files, like pano2vr_player.js to ../pano2vr_player.js, in this file, but it wont stop were the file being generated. For the pano to work the files will need to be in the location that you specify. They need to be manually moved at least once.

I find things like skin don't stay generic. I tend to customize for each tour although they will all be called skin.js, so they should remain in the tour folder.

For the skin images you can set the output path in HTML5 Output | Skin/Controller | Image Output Path to "../simplex"
Or to whatever name of the skin you use. In case you have different skins for different projects they will be in different folders.

Re: Redirection

Posted: Fri Apr 24, 2015 1:01 am
by ArkiTonio
Yes, Dave, I know that the Pro version, which I'm trying to use, creates all the folders and files for the nodes of the tour into one group and then the subfolders with the tiles for the various nodes of that same tour. In my case the structure I get is something like this (in bold the folders):

Panos
Tour 1
——Common files (index.php, pano.xml, skin.js, pano2vr_player.js)
——Node 1 (tiles)
——Node 2 (tiles)
——Node 3 (tiles)
——...
Tour 2
——Common files (index.php, pano.xml, skin.js, pano2vr_player.js)
——Node 1 (tiles)
——Node 2 (tiles)
——Node 3 (tiles)
——...
Tour 3
——Common files (index.php, pano.xml, skin.js, pano2vr_player.js)
——Node 1 (tiles)
——Node 2 (tiles)
——Node 3 (tiles)
——...

Being all the files (and tiles) different from tour to tour, except pano2vr_player.js which is always the same for all the tours, it's obvious that each tour must contain theirs, but... why repeat pano2vr_player.js too in each folder, instead of putting it outside, one level above, for example, like this?...

Panos
pano2vr_player.js
Tour 1
——Common files (index.php, pano.xml, skin.js)
——Node 1 (tiles)
——Node 2 (tiles)
——Node 3 (tiles)
——...
Tour 2
——Common files (index.php, pano.xml, skin.js)
——Node 1 (tiles)
——Node 2 (tiles)
——Node 3 (tiles)
——...
Tour 3
——Common files (index.php, pano.xml, skin.js)
——Node 1 (tiles)
——Node 2 (tiles)
——Node 3 (tiles)
——...

That's exactly what I do, but I must do it manually, deleting all those pano2vr_player.js files from their subfolders each time, pointing to the one and only pano2vr_player.js file, common and external to them, making all the tours refer to it through <script type="text/javascript" src="../pano2vr_player.js"></script> in "index.php"'s bodies...
Jim, I can't do it automatically... I'm not sure I understand your suggestion... What is "document.addfile(source_file_location, destination_file_location);"?...

Re: Redirection

Posted: Fri Apr 24, 2015 5:27 am
by JimWatters
I created an HTML template file for you that is based on the normal template file, that places pano2vr_player.swf, pano2vrgyro.js, and swfobject.js into the parent folder if Flash fallback or gyro is enabled.
the generated webpage looks for those files in the parent folder. It also looks for pano2vr_player.js in the parent folder.

What the template does not do is place pano2vr_player.js in the parent folder. It will still be created in the output folder. You will need to move this file the first time to the parent folder.

Place the following HTML template file into your template folder. Easy way to find your template folder is File | Settings | File | Template Directory
ArkiTonio.ggt
Special HTML template file for ArkiTonio
(16.73 KiB) Downloaded 161 times
For information of how the template works see the documentation. http://ggnome.com/wiki/HTML_Template

PS I now realize that you were the one asking about changing the title and description in the template file. And rereading your post above you already figured out how to modify the file.

Re: Redirection

Posted: Fri Apr 24, 2015 9:33 am
by ArkiTonio
Yes, Jim, I'm that guy and as I wrote I yet used that trick of pointing to the parent folder in the template itself...
That's exactly what I do, but I must do it manually, deleting all those pano2vr_player.js files from their subfolders each time, pointing to the one and only pano2vr_player.js file, common and external to them, making all the tours refer to it through <script type="text/javascript" src="../pano2vr_player.js"></script> in "index.php"'s bodies...
So even using your last template ("ArkiTonio.ggt") my problem remains the same: all those pano2vr_player.js files are still recreated each time in their folders... just what I whish to avoid...
:(
Any other suggestion?

Thank you

Re: Redirection

Posted: Fri Apr 24, 2015 1:27 pm
by JimWatters
I use to do a similar thing, before I started working for Garden Gnome Software and before having the pro version. I have stopped, everything is now in its own folder, because of the convenience of moving an entire folder to a different server and knowing you have all the parts for that tour. The files in question are small.