Changes between Version 7 and Version 8 of TestWebSwing2


Ignore:
Timestamp:
11/15/18 16:18:36 (6 years ago)
Author:
Bart Vastenhouw
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TestWebSwing2

    v7 v8  
    11{{{
    22#!html
    3 <script type="text/javascript" >
    4    alert("Test1");
     3<!DOCTYPE html>
     4<html class="ws-fullscreen" lang="en">
     5
     6<head>
     7    <title>Webswing</title>
     8    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
     9    <meta http-equiv="Content-Security-Policy" content="connect-src 'self' ws: wss:">
     10    <meta charset="utf-8"/>
     11    <link rel="stylesheet" href="css/style.css"/>
     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>
     23<script>
     24    var webswingInstance0 = {
     25        options: {
     26            autoStart: true,
     27                        connectionUrl:'https://webswing.ewi.tudelft.nl/bart/',
     28            args: getParam('args'),
     29            recording: getParam('recording'),
     30            binarySocket: getParam('binarySocket'),
     31            debugPort: getParam('debugPort'),
     32            recordingPlayback: getParam('recordingPlayback'),
     33            securityToken: getParam('securityToken'),
     34            realm: getParam('realm'),
     35            debugLog: getParam('debugLog')
     36        }
     37    }
     38
     39    function getParam(name) {
     40        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
     41        var results = new RegExp("[\\?&]" + name + "=([^&#]*)").exec(location.href);
     42        return results == null ? null : decodeURIComponent(results[1]);
     43    }
    544</script>
     45
     46<script data-webswing-global-var="webswing">
     47    (function (window, document) {
     48        var loader = function () {
     49            //fix for ie
     50            if (!window.location.origin) {
     51                window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
     52            }
     53                        var baseUrl = 'https://webswing.ewi.tudelft.nl/bart/';
     54            baseUrl = baseUrl.indexOf("/", baseUrl.length - 1) !== -1 ? baseUrl : (baseUrl + "/");
     55            var xmlhttp = new XMLHttpRequest();
     56            xmlhttp.onreadystatechange = function () {
     57                if (xmlhttp.readyState == XMLHttpRequest.DONE) {
     58                    var version = xmlhttp.status == 200 ? xmlhttp.responseText : "undefined";
     59                    var script = document.createElement("script"),
     60                        tag = document.getElementsByTagName("script")[0];
     61                    script.src = baseUrl + "javascript/webswing-embed.js?version=" + version;
     62                    tag.parentNode.insertBefore(script, tag);
     63                }
     64            };
     65            xmlhttp.open("GET", baseUrl + "rest/version", true);
     66            xmlhttp.send();
     67        };
     68        window.addEventListener ? window.addEventListener("load", loader, false) : window.attachEvent("onload", loader);
     69    })(window, document);
     70</script>
     71</body>
     72
     73</html>
    674}}}