Sie sind nicht angemeldet.

Zephyr

Profi

  • »Zephyr« ist der Autor dieses Themas

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

1

Mittwoch, 19. Oktober 2011, 21:47

links in tf on ipad

hi,

How can you make links to actions in a textfield for Ipad?

if I put <a href="event:someaction()" >action</a>

I get an error: safari doesnt know how to open this link.

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

2

Mittwoch, 19. Oktober 2011, 22:10

onclick in the plugin element
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

3

Donnerstag, 20. Oktober 2011, 05:21

Hi!
Hm....
it's realy don't work *confused* (works for PC but not for HTML5)

Well... you can use a little trick

put <a href="javascript:someaction()" >action</a>



and in html put
script
function someaction(){
var krpano = document.getElementById("krpanoSWFObject");
krpano.call("yourKrpanoAction()");
}
/script

Hope it's help

Andrey *thumbup*
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

4

Donnerstag, 20. Oktober 2011, 05:44

All my texfield actions use ondown/onclick on iPad which works ok if there just one action needed per plugin.
It would be a good idea for textfield to do what you're saying internally.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

Zephyr

Profi

  • »Zephyr« ist der Autor dieses Themas

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

5

Donnerstag, 20. Oktober 2011, 09:47

Well basicly Im making a breadcrum. Home -> floor 1 -> location.

I have an action that puts textstrings together and makes links of m, which work perfectly fine in flash, but safari complains.

I could do it with multiple textfields and just one ondown per textfield (global on the plugin, not internally on the text). But since the breadcrum is automaticly made, I would need to check how long the text is, so the next one fits perfectly next to it with the correct letterspacing, and the arrows -> would be repeated couple of times. Which is ofcourse is not the optimal way.

The javascript version would work, I guess, thanks! But im still secretly hoping on support of Klaus :) I need to make it both work on flash and ipad (and javascript wouldnt work in fullscreen flash). And I rather would not make a extra check, for maintenance sake.

Thanks for thinking with me :)

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

6

Donnerstag, 20. Oktober 2011, 14:10

I've done what you said with multiple plugins. But I'm about to scrap it. Calculating the exact length of the plugin is too complex with modern typography.
Why can you use txtadd and js calls in the href to replace event:?
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

Zephyr

Profi

  • »Zephyr« ist der Autor dieses Themas

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

7

Donnerstag, 20. Oktober 2011, 19:34

I can, but it means that I have to write 2 breadcrums, one for flash and one for ipad. Flash in fullscreen mode doesnt allow javascript (security). Not a problem, just a hassle.

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

8

Donnerstag, 20. Oktober 2011, 22:19

Oh, I forgot about that.
Thanks for stopping me from wasting my time.
Yes, you'll have to do it the way I've been doing it but you still have the serious issue of trying to find out what size to make each textfield.
For instance these are both 10 characters.
(iiiiiiiiii)
(wwwwwwwwww)
I'm not sure if there are any PC/Mac compatible block fonts.
If you learn anything let me know. *wacko*
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

Zephyr

Profi

  • »Zephyr« ist der Autor dieses Themas

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

9

Freitag, 21. Oktober 2011, 10:48

best way atm would be making 2 textfields, one with devices="flash" in which you put the event:action() stuff and other with the ipad links in it js(action());

other way would be using conditions to create a string of text.

Quellcode

1
2
3
4
5
6
if(isflash,
   set(_html, '<a href="events:action()" >link</a>');
   ,
   set(_html, '<a href="js(openlink(thelinkoraction, url))" >link</a>');
);
copy(plugin[tf].html, _html);


javascript:

Quellcode

1
2
3
4
5
6
7
function openlink(url,type){
   if(type == "url"){
      window.open(url);
   } else {
     krpano.call(url);
  }
}

Ipad doesnt have fullscreen, and the viewer is based on javascript, so there is no problem using javascript for links.

you can use txtadd to chain multiple links and dashes/arrows -> That way the html stays in 1 textfield, so you dont have issues with placing text next to eachother

Ähnliche Themen