Sie sind nicht angemeldet.

Taurus

Schüler

  • »Taurus« ist der Autor dieses Themas

Beiträge: 130

Wohnort: Belarus

Beruf: photographer & virtual tour developer

  • Nachricht senden

1

Montag, 4. Juli 2016, 07:51

SOLVED: problem with addplugin in JS

Hi,
I need add plugin in my js

Quellcode

1
krpano.call("addplugin(test)");

- working normal, but I want use js argument as plugin name -

Quellcode

1
krpano.call("addplugin(" + arguments[i] + ")");
or

Quellcode

1
krpano.addplugin(arguments[i]);

- not working..

who can help?
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Virtual tour Elbrus
...

Windows 10x64 & krpano 1.19pr16

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Taurus« (5. Juli 2016, 13:26)


Beiträge: 799

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours

  • Nachricht senden

2

Montag, 4. Juli 2016, 12:05

Hi, maybe something like this:

Quellcode

1
krpano.set("plugin[test].argument", i);


docu

Piotr
You own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: facebook group :: youtube

cms4vr team *thumbsup*

Taurus

Schüler

  • »Taurus« ist der Autor dieses Themas

Beiträge: 130

Wohnort: Belarus

Beruf: photographer & virtual tour developer

  • Nachricht senden

3

Montag, 4. Juli 2016, 13:43

2Piotr
thanks for the answer, but maybe you misunderstood me
I want to create a new krpano plugin, with the name specified js variable: element of array my_var[1] or simply my_var, anyway
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Virtual tour Elbrus
...

Windows 10x64 & krpano 1.19pr16

Beiträge: 799

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours

  • Nachricht senden

4

Montag, 4. Juli 2016, 14:18

Ohh *cool*

good luck then


Piotr
You own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: facebook group :: youtube

cms4vr team *thumbsup*

Taurus

Schüler

  • »Taurus« ist der Autor dieses Themas

Beiträge: 130

Wohnort: Belarus

Beruf: photographer & virtual tour developer

  • Nachricht senden

5

Montag, 4. Juli 2016, 14:31

according to the documentation, this operation is not possible
I really want to make a mistake in this *huh*
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Virtual tour Elbrus
...

Windows 10x64 & krpano 1.19pr16

Beiträge: 799

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours

  • Nachricht senden

6

Montag, 4. Juli 2016, 15:59

Hi

You want to create a name by downloading it from the JS? By some JS functions?

Why not us jsget methot or ?

eg:


Quellcode

1
<action name="new_layer"> jsget(n, 'jsMethodWithReturn();');addlayer(get(n)); ...</action>


unless you want to do something else...


Piotr
You own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: facebook group :: youtube

cms4vr team *thumbsup*

Taurus

Schüler

  • »Taurus« ist der Autor dieses Themas

Beiträge: 130

Wohnort: Belarus

Beruf: photographer & virtual tour developer

  • Nachricht senden

7

Montag, 4. Juli 2016, 16:24

Hi, Piotr,
sorry because of the incomplete information in my post
Yes, all actions should be performed by means of JS+krpano within the JS script

I think that I will get the result I needed a little bit different *cool*
Thank you
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Virtual tour Elbrus
...

Windows 10x64 & krpano 1.19pr16

Taurus

Schüler

  • »Taurus« ist der Autor dieses Themas

Beiträge: 130

Wohnort: Belarus

Beruf: photographer & virtual tour developer

  • Nachricht senden

8

Dienstag, 5. Juli 2016, 13:26

Solved

my problem solved *smile*
this code work fine

Quellcode

1
2
3
        var plugin_name = "test";
        var create_plugin = "addplugin(" + plugin_name  + ")";
        krpano.call(create_plugin);
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Virtual tour Elbrus
...

Windows 10x64 & krpano 1.19pr16

Beiträge: 799

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours

  • Nachricht senden

9

Dienstag, 5. Juli 2016, 14:39

I'm glad that you did it *thumbsup*


Kind regards

Piotr
You own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: facebook group :: youtube

cms4vr team *thumbsup*

Taurus

Schüler

  • »Taurus« ist der Autor dieses Themas

Beiträge: 130

Wohnort: Belarus

Beruf: photographer & virtual tour developer

  • Nachricht senden

10

Dienstag, 5. Juli 2016, 17:39

Thank you)

Now it torments me another question: how to recognize a logical variable?

for example

Quellcode

1
set(check, true);


Quellcode

1
2
var check = krpano.get("check");
alert(check);


rezult: "1", not "true" *huh*
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Virtual tour Elbrus
...

Windows 10x64 & krpano 1.19pr16

Tuur

Erleuchteter

Beiträge: 3 021

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

11

Dienstag, 5. Juli 2016, 17:46

Hi,

this is a Boolean thingy..

true is also 1
false is also 0

so you can do set(check, true); or set(check, 1);

i think this is what is happening.

Hope it helps,

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Taurus

Schüler

  • »Taurus« ist der Autor dieses Themas

Beiträge: 130

Wohnort: Belarus

Beruf: photographer & virtual tour developer

  • Nachricht senden

12

Dienstag, 5. Juli 2016, 22:58

hello, Tuur
you're absolutely right, but I thought that krpano.get("Name_Logical_Var") distorts the type of a variable
but I checked more closely and realized that if there was a logic to krpano type - it is convert correctly in JS
it turned out that everything is working properly
Thank you for your attention
--
in order to comply the word with the affairs, you need to keep quiet and do nothing!

Virtual tour Gomel
Virtual tour
Virtual tour
Virtual tour Elbrus
...

Windows 10x64 & krpano 1.19pr16