Skip to content

Commit 6c26b16

Browse files
committed
npm package evaluatly
1 parent 1877fb3 commit 6c26b16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+8480
-7375
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
.DS_Store
2-
node_modules
3-
vendor
4-
5-
dist
62

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bundle
File renamed without changes.
File renamed without changes.

bundle/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+

bundle/entry.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import 'core-js/stable';
2+
import 'regenerator-runtime/runtime';
3+
4+
import { loadUrl, loadVar } from './src/Loader';
5+
6+
// Evaluatly = window.Evaluatly = (() => (
7+
// {
8+
// loadVar: loadVar,
9+
// loadUrl: loadUrl
10+
// }
11+
// ))();
12+
13+
export { loadVar, loadUrl}
File renamed without changes.

bundle/examples/npm/src/index.js

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
const wdrLoader = require("wdr-loader");
2+
const Evaluatly = require("evaluatly");
3+
4+
wdrLoader(data=> {
5+
render(data);
6+
})
7+
8+
function render(data) {
9+
document.title = 'WDR example (NPM)';
10+
Evaluatly.loadVar(template(data));
11+
}
12+
13+
function template(data) {
14+
15+
return (
16+
{
17+
"hash": "example/wdr",
18+
"story": {
19+
"env": {
20+
"back_label": "Back"
21+
},
22+
"pages": [
23+
{
24+
"items": [
25+
{ "type": "question", "value": data.title},
26+
{ "type": "radio", "save_key": "fruit", "required": true,
27+
"options": data.options.map(item => ({ "label": item }))
28+
}
29+
],
30+
"submit" : { "label": "Next", "program": {"next_page": true} }
31+
},
32+
{
33+
"items": [
34+
{ "type": "title", "value": "{{fruit.label}} is awesome!" }
35+
]
36+
}
37+
]
38+
},
39+
"theme": {
40+
"page": {
41+
"font-family": "google:Lato",
42+
"font-size": "20px",
43+
"color": "#4b3f32",
44+
"background-color": "#f5f1ed"
45+
},
46+
"content": {
47+
"align-items": "center",
48+
"text-align": "center",
49+
"justify-content": "center"
50+
},
51+
"title": {
52+
"color" : "#000000"
53+
},
54+
"subtitle": {
55+
"color" : "#000000"
56+
},
57+
"question": {
58+
"color" : "#000000"
59+
},
60+
"button": {
61+
"background-color": "#f1574b",
62+
"color": "#ffffff",
63+
"border-radius" : "100px",
64+
"border-width" : "3px"
65+
},
66+
"button:hover": {
67+
"background-color": "#ffffff",
68+
"color": "#f1574b"
69+
},
70+
"link": {
71+
"color": "#f1574b"
72+
},
73+
"form_submit.inputs": {
74+
"background-color": "#fff"
75+
},
76+
"form_submit .input": {
77+
"color": "#000"
78+
},
79+
"form .option:hover": {
80+
"color": "#3e306e"
81+
},
82+
"form_submit .option:hover": {
83+
"color": "#3e306e"
84+
}
85+
}
86+
});
87+
88+
}
89+

0 commit comments

Comments
 (0)