Last active
September 10, 2020 15:53
-
-
Save Campano/d2025bc5f4463cd80f85b27daeb82164 to your computer and use it in GitHub Desktop.
Simplicité API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<title>Simplicité</title> | |
<!-- Basic styling --> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@exampledev/new.css@1/new.min.css"> | |
<link rel="stylesheet" href="https://fonts.xz.style/serve/inter.css"> | |
<!-- SIM Module (useless when using external object) --> | |
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/Campano/module-designertools@latest/resources/Disposition/default/dsn-tools.js"></script> | |
<script type="text/javascript"> | |
sim.init({ // init : dynamically loads ajax-bundle from instance & declare params | |
instanceRoot: "https://demo.dev.simplicite.io", | |
endpoint: "api", | |
params: null, | |
log: 'log-container-id', //false, true, 'debug', 'container-id' | |
},{ | |
login: "website", | |
password: "simplicite", | |
tryToken: true | |
}) | |
.then(function(){ | |
let app = sim.getApp(); | |
// use the app object as if it were fetched in external object with $ui.getApp(); | |
sim.disp( | |
'Simplicité "Ajax" object available for tests, connected with user "' | |
+app.grant.login | |
+'". See docs at https://docs.simplicite.io/4.0/jsdoc/Simplicite.Ajax.html', | |
'log-container-id' | |
); | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="log-container-id"></div> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<title>Simplicité</title> | |
<!-- Basic styling --> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@exampledev/new.css@1/new.min.css"> | |
<link rel="stylesheet" href="https://fonts.xz.style/serve/inter.css"> | |
<!-- SIM Module (useless when using external object) --> | |
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/Campano/module-designertools@latest/resources/Disposition/default/dsn-tools.js"></script> | |
<script type="text/javascript"> | |
sim.init({ // init : dynamically loads ajax-bundle from instance & declare params | |
instanceRoot: "https://myinstance.com", | |
endpoint: "api", | |
params: null, | |
log: 'log-container-id' //false, true, 'debug', 'container-id' | |
}) | |
// connect : connection, manages token in localstorage | |
.then(sim.connect({ | |
login: "designer", | |
password: "simplicite", | |
tryToken: true | |
})) | |
.then(function(){ | |
let app = sim.getApp(); | |
// use the app object as if it were fetched in external object with $ui.getApp(); | |
sim.disp( | |
'Simplicité "Ajax" object available for tests, connected with user "' | |
+app.grant.login | |
+'". See docs at https://docs.simplicite.io/4.0/jsdoc/Simplicite.Ajax.html', | |
'log-container-id' | |
); | |
return; | |
}).then(sim.logout); | |
</script> | |
</head> | |
<body> | |
<div id="log-container-id"></div> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment