Sie sind nicht angemeldet.

1

Dienstag, 6. Dezember 2016, 15:11

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

Hi,

quick question :

is it possible to have in my xml :

Quellcode

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


i get error

in my main html, i have :

Quellcode

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

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »zadda« (6. Dezember 2016, 17:26)