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.

1

Tuesday, December 6th 2016, 3:11pm

are class="" supported for links in xml file ?

Hi,

quick question :

is it possible to have in my xml :

Source code

1
<a href="event:openurl(http://google.com)" class="external-link">Google (external link)</a>


i get error

in my main html, i have :

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    <script>
        // Set up Window for NW.js 0.12.3- and 0.13.0+
        if (typeof(nw) == "undefined") {
            window.nw = require('nw.gui');
        }

        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
        //### D05. Launch links in default browser (from UGUI.io)
        //
        //>Detects all links on the page with a class of `external-link`
        // and sets them to open the link in the user's default browser
        // instead of using NW.js as a browser which can cause issues.

        function openDefaultBrowser () {
            //Remove all click events before rebinding to prevent opening a link multiple times per click.
            $('.external-link').unbind('click');

            //Open URL with default browser.
            $('.external-link').click( function (event) {
                //Prevent the link from loading in NW.js
                event.preventDefault();
                //Get the `href` URL for the current link
                var url = $(this).attr('href');
                //Launch the user's default browser and load the URL for the link they clicked
                nw.Shell.openExternal(url);
            });
        }

        //Run once on page load
        openDefaultBrowser();
    </script>
as the krpano is encapsuled as an standalone app

thanks

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