docs(examples): update mashup to load resources from unpkg (#64)

This commit is contained in:
Miralem Drek
2019-06-10 09:47:28 +02:00
committed by GitHub
parent 08772bf05f
commit 73dd72f61d
6 changed files with 17 additions and 26 deletions

View File

@@ -3,7 +3,7 @@ window.connect = function connect() {
const createConnection = () => loadSchema().then(schema => window.enigma.create({ const createConnection = () => loadSchema().then(schema => window.enigma.create({
schema, schema,
url: `ws://${window.location.hostname || 'localhost'}:19076/app/${Date.now()}`, url: `ws://${window.location.hostname || 'localhost'}:9076/app/${Date.now()}`,
}).open().then(qix => qix.createSessionApp())); }).open().then(qix => qix.createSessionApp()));
return createConnection().then(app => app.setScript(` return createConnection().then(app => app.setScript(`

View File

@@ -2,8 +2,8 @@ version: "3.1"
services: services:
engine: engine:
image: qlikcore/engine:${ENGINE_VERSION:-latest} image: qlikcore/engine:${ENGINE_VERSION}
restart: always restart: always
command: -S AcceptEULA="${ACCEPT_EULA:-no}" command: -S AcceptEULA="${ACCEPT_EULA:-no}"
ports: ports:
- "19076:9076" - "9076:9076"

View File

@@ -3,8 +3,9 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Nebula mashup</title> <title>Nebula mashup</title>
<script src="./node_modules/enigma.js/enigma.js"></script>
<script src="../../packages/nucleus/dist/nucleus.js"></script> <script src="https://unpkg.com/enigma.js"></script>
<script src="https://unpkg.com/@nebula.js/nucleus@next"></script>
<style> <style>
body { body {
@@ -19,16 +20,21 @@
.object { .object {
position: relative; position: relative;
width: 600px;
height: 400px; height: 400px;
background-color: white; background-color: white;
} }
.toolbar {
background-color: white;
margin: 12px 0px;
}
</style> </style>
</head> </head>
<body> <body>
<div class="content"> <div class="content">
<div class="toolbar"></div>
<div class="object" data-type='foo'></div> <div class="object" data-type='foo'></div>
</div> </div>

View File

@@ -11,6 +11,8 @@ connect().then((app) => {
load: (type, config) => config.Promise.resolve(sn), load: (type, config) => config.Promise.resolve(sn),
}); });
nebbie.selections().mount(document.querySelector('.toolbar'));
document.querySelectorAll('.object').forEach((el) => { document.querySelectorAll('.object').forEach((el) => {
const type = el.getAttribute('data-type'); const type = el.getAttribute('data-type');

View File

@@ -1,6 +0,0 @@
{
"private": true,
"dependencies": {
"enigma.js": "^2.4.0"
}
}

View File

@@ -1,11 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
enigma.js@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/enigma.js/-/enigma.js-2.4.0.tgz#e5263116e7168e27f11cfe326ac83ed738bb7cc4"
leonardo-ui@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/leonardo-ui/-/leonardo-ui-1.6.0.tgz#65eab0a4fd9a54f87a75d08e4440900555f56c24"