You are not logged in.

  • "sachagriffin" started this thread

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

1

Monday, February 20th 2012, 7:37pm

Race condition in JS

This is just a preliminary report. JS ONLY
I've found that on first load, displaying a plugin it may not have its width and height set without explicit width and height attributes. They would be 0.
plugins declared out of scene
url is then changed in scene
Only happens once, loading, loaded all good. Looks like some sort of timing issue. Perhaps if url is changed when plugin is loading.. width and height won't be set correctly for new url. Yes that a good theory!

Source code

1
2
3
4
		<plugin name="contactus"	align="center" x="0"   y="0"	 zorder="5" edge="center" keep="true" url="%SWFPATH%/skin/textwindow_<?php print $style ?>.png" onhover="showtext(Close contact us, buttonstyle);"	onclick="hidewindows()" alpha="0" autoalpha="true" visible="false" />
	<plugin name="share"		align="center" x="0"   y="0"	 zorder="5" edge="center" keep="true" url="%SWFPATH%/skin/textwindow_<?php print $style ?>.png" onhover="showtext(Close share, buttonstyle);"		onclick="hidewindows()" alpha="0" autoalpha="true" visible="false" />
	<plugin name="contactus_closebutton"	parent="contactus"	url="%SWFPATH%/skin/close60.png" 	 x="13"	y="10"	width="40"	height="40"		align="righttop"	edge="center"	zorder="12"	onloaded="if (ishtml5, set(x,15);set(y,12);set(width,60);set(height,60););"	onclick="hidewindows()" onover="set(alpha,1)"	onout="set(alpha,0.7)" ondown="set(alpha,1)"	onup="set(alpha,0.7)" alpha="0.7"	keep="true"	/>
	<plugin name="share_closebutton"		parent="share"		url="%SWFPATH%/skin/close60.png" 	 x="13"	y="10"	width="40"	height="40"		align="righttop"	edge="center"	zorder="12"	onloaded="if (ishtml5, set(x,15);set(y,12);set(width,60);set(height,60););"	onclick="hidewindows()" onover="set(alpha,1)"	onout="set(alpha,0.7)" ondown="set(alpha,1)"	onup="set(alpha,0.7)" alpha="0.7"	keep="true"	/>
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

This post has been edited 1 times, last edit by "sachagriffin" (Feb 27th 2012, 5:23pm)


2

Monday, February 20th 2012, 7:50pm

Hi,

what krpanoJS version were you using?
there was such problem in the older versions, but this should be already fixed...

best regards,
Klaus

  • "sachagriffin" started this thread

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

3

Tuesday, February 21st 2012, 6:17am

1-10-12
Once I understood the issue, it was an easy fix.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

4

Tuesday, February 21st 2012, 3:33pm

Hi,

1-10-12 ???
there is no version with that number or build date...?
see here:
http://krpano.com/news/

please try using the latest one - 1.0.8.14 build 2012-02-20 - there this shouldn't happen,
but if there is still a problem with that version, please let me know,

best regards,
Klaus

  • "sachagriffin" started this thread

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

5

Tuesday, February 21st 2012, 4:22pm

Sorry it was a private build that you helped me with to fix something.
It still exists with the current build.
http://www.seeit360.com/test3.html
Clicking share or contact us shows the bug. Useragent ipad, disabled caches, everything is fine with the plugin except for width and height are 0. A non-disabled caches refresh is fine.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

6

Monday, February 27th 2012, 4:30pm

Hi,

sorry, the page is not working, there a lot of Javascript errors regarding jQuery and so on...

best regards,
Klaus

  • "sachagriffin" started this thread

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

7

Monday, February 27th 2012, 5:01pm

CSS/JS consolodated files were expired. This is fixed now.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

8

Monday, February 27th 2012, 5:08pm

okay, but where should I look to see the problem?

  • "sachagriffin" started this thread

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

9

Monday, February 27th 2012, 5:17pm

Safari iPad User agent,
disable cache
click share or contact upper right links.
The background window won't show.

The xml was posted above.
Notes: The url was changed for the plugin onscene start.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

Similar threads