Changes between Version 18 and Version 19 of TestWebSwing


Ignore:
Timestamp:
11/13/18 13:18:48 (6 years ago)
Author:
Bart Vastenhouw
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TestWebSwing

    v18 v19  
    22
    33{{{#!html
    4 <div
    5  style="height:500px;"
    6  data-webswing-instance="webswing"
    7  data-webswing-options="{autoStart:true,  anonym:true,  args:'foo',  applicationName:'bart', connectionUrl:'http://webswing.ewi.tudelft.nl'}">
    8 </div>
     4<!DOCTYPE html>
     5<html class="ws-fullscreen" lang="en">
    96
     7<head>
     8    <title>Webswing</title>
     9    <meta charset="utf-8"/>
     10    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
     11    <meta http-equiv="Access-Control-Allow-Origin" content="*">
     12    <link rel="icon" href="favicon.ico"/>
     13</head>
     14
     15<body>
     16<div class="webswing-element" data-webswing-instance="webswingInstance0">
     17    <div id="loading" class="ws-modal-container">
     18        <div class="ws-login">
     19                                <div  class="ws-login-content"><div class="ws-spinner"><div class="ws-spinner-dot-1"></div> <div class="ws-spinner-dot-2"></div></div></div>
     20                </div>
     21            </div>
     22        </div>
    1023<script>
     24    var webswingInstance0 =
     25    {
     26        options:
     27        {
     28            autoStart: true,
     29            connectionUrl:'https://webswing.ewi.tudelft.nl/bart/',
     30            args: getParam('args'),
     31            recording: getParam('recording'),
     32            binarySocket: getParam('binarySocket'),
     33            debugPort: getParam('debugPort'),
     34            recordingPlayback: getParam('recordingPlayback'),
     35            securityToken: getParam('securityToken'),
     36            realm: getParam('realm'),
     37            debugLog: getParam('debugLog')
     38        }
     39    }
     40
     41    function getParam(name) {
     42        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
     43        var results = new RegExp("[\\?&]" + name + "=([^&#]*)").exec(location.href);
     44        return results == null ? null : decodeURIComponent(results[1]);
     45    }
     46</script>
     47
     48<script data-webswing-global-var="webswing">
    1149    (function (window, document) {
    12       var loader = function () {
    13         //fix for ie
    14         if (!window.location.origin) {
    15             window.location.origin = window.location.protocol + "//" + window.location.hostname
    16                     + (window.location.port ? ':' + window.location.port : '');
    17         }
    18         var xmlhttp = new XMLHttpRequest();
    19         xmlhttp.onreadystatechange = function() {
    20             if (xmlhttp.readyState == XMLHttpRequest.DONE ) {
    21                 var version = xmlhttp.status == 200 ? xmlhttp.responseText : "undefined";
    22                 var script = document.createElement("script"), tag = document.getElementsByTagName("script")[0];
    23                 script.src =  document.location.origin + document.location.pathname + "javascript/webswing-embed.js?version="+version;
    24                 tag.parentNode.insertBefore(script, tag);
     50        var loader = function () {
     51            //fix for ie
     52            if (!window.location.origin) {
     53                window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
    2554            }
     55            var baseUrl = 'https://webswing.ewi.tudelft.nl/bart/';
     56            var xmlhttp = new XMLHttpRequest();
     57            xmlhttp.onreadystatechange = function () {
     58                if (xmlhttp.readyState == XMLHttpRequest.DONE) {
     59                    var version = xmlhttp.status == 200 ? xmlhttp.responseText : "undefined";
     60                    var script = document.createElement("script"),
     61                        tag = document.getElementsByTagName("script")[0];
     62                    script.src = baseUrl + "javascript/webswing-embed.js?version=" + version;
     63                    tag.parentNode.insertBefore(script, tag);
     64                }
     65            };
     66            xmlhttp.open("GET", baseUrl + "rest/version", true);
     67            xmlhttp.send();
    2668        };
    27         xmlhttp.open("GET", document.location.origin + document.location.pathname +"rest/webswing/version", true);
    28         xmlhttp.send();
    29       };
    30       window.addEventListener ? window.addEventListener("load", loader, false) : window.attachEvent("onload", loader);
     69        window.addEventListener ? window.addEventListener("load", loader, false) : window.attachEvent("onload", loader);
    3170    })(window, document);
    3271</script>
     72</body>
     73</html>
    3374}}}