Changes between Version 12 and Version 13 of TestWebSwing


Ignore:
Timestamp:
11/12/18 15:47:35 (6 years ago)
Author:
Bart Vastenhouw
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TestWebSwing

    v12 v13  
    22
    33
     4{{{!html
    45
     6<div
     7 style="height:500px;"
     8 data-webswing-instance="webswing"
     9 data-webswing-options="{autoStart:true,  anonym:true,  args:'foo',  applicationName:'SwingSet3', connectionUrl:'http://<webswing-host-and-port>'}">
     10</div>
    511
    6 {{{#!html
    7 <iframe src="http://webswing.ewi.tudelft.nl/bart/?anonym=true" width="800" height="600">Test</iframe>
     12<script>
     13    (function (window, document) {
     14      var loader = function () {
     15        //fix for ie
     16        if (!window.location.origin) {
     17            window.location.origin = window.location.protocol + "//" + window.location.hostname
     18                    + (window.location.port ? ':' + window.location.port : '');
     19        }
     20        var xmlhttp = new XMLHttpRequest();
     21        xmlhttp.onreadystatechange = function() {
     22            if (xmlhttp.readyState == XMLHttpRequest.DONE ) {
     23                var version = xmlhttp.status == 200 ? xmlhttp.responseText : "undefined";
     24                var script = document.createElement("script"), tag = document.getElementsByTagName("script")[0];
     25                script.src =  document.location.origin + document.location.pathname + "javascript/webswing-embed.js?version="+version;
     26                tag.parentNode.insertBefore(script, tag);
     27            }
     28        };
     29        xmlhttp.open("GET", document.location.origin + document.location.pathname +"rest/webswing/version", true);
     30        xmlhttp.send();
     31      };
     32      window.addEventListener ? window.addEventListener("load", loader, false) : window.attachEvent("onload", loader);
     33    })(window, document);
     34</script>
    835}}}
    9 
    10 {{{#!html
    11 Test
    12 }}}