You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Taurus

Trainee

  • "Taurus" started this thread

Posts: 133

Location: Belarus

Occupation: photographer & virtual tour developer

  • Send private message

1

Monday, July 4th 2016, 7:51am

SOLVED: problem with addplugin in JS

Hi,
I need add plugin in my js

Source code

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

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

Source code

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

Source code

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
Elbrus
...

Windows 10x64 & krpano 1.19pr16

This post has been edited 1 times, last edit by "Taurus" (Jul 5th 2016, 1:26pm)


spacerywirtualne

Professional

Posts: 857

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

2

Monday, July 4th 2016, 12:05pm

Hi, maybe something like this:

Source code

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

Trainee

  • "Taurus" started this thread

Posts: 133

Location: Belarus

Occupation: photographer & virtual tour developer

  • Send private message

3

Monday, July 4th 2016, 1:43pm

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
Elbrus
...

Windows 10x64 & krpano 1.19pr16

spacerywirtualne

Professional

Posts: 857

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

4

Monday, July 4th 2016, 2:18pm

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

Trainee

  • "Taurus" started this thread

Posts: 133

Location: Belarus

Occupation: photographer & virtual tour developer

  • Send private message

5

Monday, July 4th 2016, 2:31pm

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
Elbrus
...

Windows 10x64 & krpano 1.19pr16

spacerywirtualne

Professional

Posts: 857

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

6

Monday, July 4th 2016, 3:59pm

Hi

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

Why not us jsget methot or ?

eg:


Source code

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

Trainee

  • "Taurus" started this thread

Posts: 133

Location: Belarus

Occupation: photographer & virtual tour developer

  • Send private message

7

Monday, July 4th 2016, 4:24pm

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
Elbrus
...

Windows 10x64 & krpano 1.19pr16

Taurus

Trainee

  • "Taurus" started this thread

Posts: 133

Location: Belarus

Occupation: photographer & virtual tour developer

  • Send private message

8

Tuesday, July 5th 2016, 1:26pm

Solved

my problem solved *smile*
this code work fine

Source code

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
Elbrus
...

Windows 10x64 & krpano 1.19pr16

spacerywirtualne

Professional

Posts: 857

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

9

Tuesday, July 5th 2016, 2:39pm

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

Trainee

  • "Taurus" started this thread

Posts: 133

Location: Belarus

Occupation: photographer & virtual tour developer

  • Send private message

10

Tuesday, July 5th 2016, 5:39pm

Thank you)

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

for example

Source code

1
set(check, true);


Source code

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
Elbrus
...

Windows 10x64 & krpano 1.19pr16

Tuur

Sage

Posts: 3,098

Location: Netherlands

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

  • Send private message

11

Tuesday, July 5th 2016, 5:46pm

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

Trainee

  • "Taurus" started this thread

Posts: 133

Location: Belarus

Occupation: photographer & virtual tour developer

  • Send private message

12

Tuesday, July 5th 2016, 10:58pm

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
Elbrus
...

Windows 10x64 & krpano 1.19pr16