Where is that info? How to get that variable? Any example please.Just set a variable with the value of expiration and check if current time is lower or bigger...
Where is that info? How to get that variable? Any example please.
|
|
Quellcode |
1 2 3 4 5 |
<skin_settings
expiry="######"
gyro="true"
....
/>
|
|
|
Quellcode |
1 |
<krpano expirationDate="1594451340" onstart="checkExpiration();" > |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<action name="checkExpiration" type="javascript"><![CDATA[
var expirationDate = krpano.get("expirationDate");
var currentTime = new Date().getTime()/1000; // UNIX TIME IN SECONDS
if (currentTime > expirationDate) {
doSomething(); // Javascript Action
// or
krpano.call("myKrpanoAction()");
}
]]></action>
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 |
<!-- krpano version check -->
<action name="combobox_versioncheck" autorun="preinit">
if(build LT '2017-09-13',
error('combobox.xml - too old krpano version!');
set(events[combobox_xml_plugin_events].name, null);
set(action[addComboboxLayer].content, '');
set(action[removeComboboxLayer].content, '');
);
</action>
|
if(build LT '2017-09-13',
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 |
<!-- Expiration check -->
<action name="check_expire" scope="localonly" args="exp_date">
jsget(today, 'new Date().toISOString().slice(0,10);');
trace('Today is ', get(today));
if(today GT exp_date,
//your actions here e.g.:
error('Sorry, your creditcard has expired!');
);
</action>
|
|
|
Quellcode |
1 |
check_expire('2017-12-31');
|