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,17 +3,17 @@ window.connect = function connect() {
const createConnection = () => loadSchema().then(schema => window.enigma.create({
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()));
return createConnection().then(app => app.setScript(`
Characters:
Load Chr(RecNo()+Ord('A')-1) as Alpha, RecNo() as Num autogenerate 26;
ASCII:
Load
Load
if(RecNo()>=65 and RecNo()<=90,RecNo()-64) as Num,
Chr(RecNo()) as AsciiAlpha,
Chr(RecNo()) as AsciiAlpha,
RecNo() as AsciiNum
autogenerate 85
Where (RecNo()>=65 and RecNo()<=126) or RecNo()>=160;

View File

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

View File

@@ -3,8 +3,9 @@
<head>
<meta charset="UTF-8">
<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>
body {
@@ -19,16 +20,21 @@
.object {
position: relative;
width: 600px;
height: 400px;
background-color: white;
}
.toolbar {
background-color: white;
margin: 12px 0px;
}
</style>
</head>
<body>
<div class="content">
<div class="toolbar"></div>
<div class="object" data-type='foo'></div>
</div>

View File

@@ -11,6 +11,8 @@ connect().then((app) => {
load: (type, config) => config.Promise.resolve(sn),
});
nebbie.selections().mount(document.querySelector('.toolbar'));
document.querySelectorAll('.object').forEach((el) => {
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"