Skip to content

Commit 97aa5a2

Browse files
chore: add plugin
1 parent 98ac951 commit 97aa5a2

File tree

4 files changed

+55
-1
lines changed

4 files changed

+55
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
# kotlin-playground-coursera-plugin
1+
# Kotlin Playground Coursera Plugin
2+

app.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
function initiateApp(configuration) {
2+
let node = document.getElementById('code');
3+
node.textContent = configuration["code"];
4+
KotlinPlayground('code');
5+
}
6+
7+
courseraApi.callMethod({
8+
type: "GET_SESSION_CONFIGURATION",
9+
onSuccess: initiateApp,
10+
onError: console.log
11+
});

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<link rel="stylesheet" href="https://www.coursera.org/widget/coursera-connect.css">
6+
</head>
7+
<body>
8+
<code id="code" theme="idea"></code>
9+
<script src="https://www.coursera.org/widget/coursera-widget-connect-v0.js"></script>
10+
<script src="https://unpkg.com/kotlin-playground@1"></script>
11+
<script src="./app.js"></script>
12+
</body>
13+
</html>

manifest.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"short_name": "Kotlin",
3+
"name": "Kotlin Playground",
4+
"description": "Enable a Kotlin Playground",
5+
"maintainer": {
6+
"name": "Alexander Prendota",
7+
"email": "alexander.prendotal@jetbrains.com"
8+
},
9+
"version": "0.0.0",
10+
"sandbox": "allow-presentation allow-scripts allow-same-origin",
11+
"configurationExamples": [
12+
{
13+
"name": "Hello world!",
14+
"configuration": {
15+
"code": "fun main(args: Array<String>) {\n println(\"Hello world\")\n}"
16+
}
17+
}
18+
],
19+
"authorizations": {},
20+
"actionTypes": ["GET_SESSION_CONFIGURATION", "SET_HEIGHT"],
21+
"macros": [],
22+
"accessibility": {
23+
"mobileCompatibility": {
24+
"supportsTouch": true,
25+
"minHeightPx": 0,
26+
"minWidthPx": 0
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)