mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-19 09:48:18 -05:00
* fix: make sure checking stepCycle func exist before calling * fix: make sure stepCycle func exist before calling * fix: also check if app exist * fix: add return * fix: make sure checking stepCycle func exist before calling * fix: make sure stepCycle func exist before calling * fix: also check if app exist * fix: add return * chore: update engima and schema version * test: unit test * fix: remove engine version --------- Co-authored-by: caele <tsm@qlik.com>
35 lines
880 B
JavaScript
35 lines
880 B
JavaScript
window.connect = function connect() {
|
|
const loadSchema = () =>
|
|
fetch('https://unpkg.com/enigma.js/schemas/12.2015.0.json').then((response) => response.json());
|
|
|
|
const createConnection = () =>
|
|
loadSchema().then((schema) =>
|
|
window.enigma
|
|
.create({
|
|
schema,
|
|
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
|
|
if(RecNo()>=65 and RecNo()<=90,RecNo()-64) as Num,
|
|
Chr(RecNo()) as AsciiAlpha,
|
|
RecNo() as AsciiNum
|
|
autogenerate 85
|
|
Where (RecNo()>=65 and RecNo()<=126) or RecNo()>=160;
|
|
`
|
|
)
|
|
.then(() => app.doReload().then(() => app))
|
|
);
|
|
};
|