Skip to content

Commit 0d83e32

Browse files
author
tsv2013
committed
Fixed #1 - Update the repository to the latest SurveyJS component version
1 parent 491b7be commit 0d83e32

File tree

13 files changed

+955
-1102
lines changed

13 files changed

+955
-1102
lines changed

favicon.ico

Whitespace-only changes.

gruntfile.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

index.css

Lines changed: 0 additions & 9 deletions
This file was deleted.

index.html

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
<!DOCTYPE html>
2-
2+
<html lang="en">
33
<head>
4-
<title>Knockout component loading via Requirejs sample</title>
5-
<script data-main="index" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.20/require.min.js"></script>
6-
<link href="index.css" rel="stylesheet" />
7-
<link href="https://surveyjs.azureedge.net/1.0.44/survey.css" type="text/css" rel="stylesheet" />
8-
<link href="https://surveyjs.azureedge.net/1.0.44/surveyeditor.css" type="text/css" rel="stylesheet" />
4+
<meta charset="UTF-8">
5+
<title>SurveyJS Example</title>
6+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/defaultV2.css" />
7+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/survey-creator-core.css" />
8+
<script data-main="scripts/main" src="node_modules/requirejs/require.js"></script>
99
</head>
10-
1110
<body>
12-
<div id="surveyElement"></div>
13-
<div id="surveyResult"></div>
14-
<div id="surveyContainer">
15-
<div id="editorElement"></div>
16-
</div>
11+
<h1>SurveyJS Example</h1>
12+
<div id="surveyContainer" style="min-height: 100hv;"></div>
13+
<div id="surveyCreatorContainer" style="min-height: 100hv;"></div>
1714
</body>
18-
1915
</html>

index.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

index.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import * as Survey from 'survey-core';
2+
import * as SurveyKnockout from 'survey-knockout-ui';
3+
import * as SurveyCreatorCore from 'survey-creator-core';
4+
import * as SurveyCreator from 'survey-creator-knockout';
5+
6+
console.log("survey-core: ", Survey);
7+
console.log("survey-knockout-ui: ", SurveyKnockout);
8+
console.log("survey-creator-core: ", SurveyCreatorCore);
9+
console.log("survey-creator-knockout: ", SurveyCreator);
10+
11+
const surveyJSON = {
12+
title: "Product Feedback Survey Example",
13+
pages: [
14+
{
15+
name: "page1",
16+
elements: [
17+
{
18+
type: "radiogroup",
19+
name: "satisfaction",
20+
title: "How satisfied are you with the product?",
21+
choices: [
22+
{ value: 1, text: "Not Satisfied" },
23+
{ value: 2, text: "Slightly Satisfied" },
24+
{ value: 3, text: "Satisfied" },
25+
{ value: 4, text: "Very Satisfied" },
26+
{ value: 5, text: "Extremely Satisfied" }
27+
]
28+
}
29+
]
30+
}
31+
]
32+
};
33+
34+
const survey = new SurveyKnockout.Survey(surveyJSON);
35+
survey.render(document.getElementById("surveyContainer"));
36+
37+
const options = {
38+
showLogicTab: true
39+
};
40+
const creator = new SurveyCreator.SurveyCreator(options);
41+
creator.JSON = surveyJSON;
42+
creator.render("surveyCreatorContainer");

main.js

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)