-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-edit.html
95 lines (92 loc) · 4.24 KB
/
index-edit.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html>
<head>
<meta charset = "UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Story Link Card</title>
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> -->
<!-- <link rel="stylesheet" type="text/css" href="src/js/style.css"> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10/semantic.min.css" />
<link rel="stylesheet" type="text/css" href="./src/css/styles.css">
<link rel="stylesheet" type="text/css" href="./src/css/edit-form.css">
</head>
<body>
<div id="explainer-div"></div></br>
<script src="http://cdn.bootcss.com/react/15.4.1/react.js"></script>
<script src="http://cdn.bootcss.com/react/15.4.1/react-dom.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="./lib/js/react-jsonschema-form.js"></script>
<script src = "./dist/0.0.1/edit-card.min.js"></script>
<!-- <script src = "/dist/0.0.1/card.min.js"></script> -->
<script type="text/javascript">
// let param = location.search.split('HtmlCast_Unique_Identifier=')[1]
// function get(url) {
// return new Promise(function(resolve, reject) {
// var req = new XMLHttpRequest();
// req.open('GET', url);
// req.onload = function() {
// if (req.status == 200) {
// resolve(req.response);
// }
// else {
// reject(Error(req.statusText));
// }
// };
// req.onerror = function() {
// reject(Error("Network Error"));
// };
// req.send();
// });
// }
// get('http://192.168.0.103:3000/api/v1/view_casts/'+param).then(function (response) {
// console.log("Success!", response);
// let response_object = JSON.parse(response)
// var x = new ProtoGraph.Card.toExplain()
// console.log(x, "xxxx")
// x.init({
// selector: document.querySelector('#explainer-div'),
// data_url: response_object.data_url,
// schema_url: 'https://s3.ap-south-1.amazonaws.com/protos.dev/Schemas/toExplain/0.0.1/schema.json',
// configuration_url: response_object.configuration_url, //will come from local folder
// configuration_schema_url: '/dist/0.0.1/configuration_schema.json' //will come from local folder
// })
// x.renderLaptop();
// }, function(error) {
// console.error("Failed!", error);
// })
// var x = new ProtoGraph.Card.toExplain()
// x.init({
// selector: document.querySelector('#explainer-div'),
// data_url: 'https://s3.ap-south-1.amazonaws.com/protos.dev/Schemas/toExplain/0.0.1/sample.json',
// schema_url: 'https://s3.ap-south-1.amazonaws.com/protos.dev/Schemas/toExplain/0.0.1/schema.json',
// configuration_url: '/dist/0.0.1/configuration_sample.json', //will come from local folder
// configuration_schema_url: '/dist/0.0.1/configuration_schema.json' //will come from local folder
// })
// // x.renderLaptop();
// //x.renderScreenshot();
// x.renderEdit();
//This is for edit mode....
// var x = new ProtoGraph.Card.toExplain()
// x.init({
// selector: document.querySelector('#explainer-div'),
// data_url: 'https://s3.ap-south-1.amazonaws.com/protos.dev/Schemas/toExplain/0.0.1/sample.json',
// schema_url: 'https://s3.ap-south-1.amazonaws.com/protos.dev/Schemas/toExplain/0.0.1/schema.json',
// configuration_url: '/dist/0.0.1/configuration_sample.json', //will come from local folder
// configuration_schema_url: '/dist/0.0.1/configuration_schema.json' //will come from local folder
// })
// // x.renderLaptop();
// x.renderEdit();
//This is for laptop mode....
var x = new ProtoGraph.Card.toStoryLink()
x.init({
selector: document.querySelector('#explainer-div'),
data_url: './dist/0.0.1/sample.json',
schema_url: './dist/0.0.1/schema.json',
configuration_url: './dist/0.0.1/configuration_sample.json', //will come from local folder
configuration_schema_url: './dist/0.0.1/configuration_schema.json' //will come from local folder
})
// x.renderScreenshot();
x.renderEdit();
</script>
</body>
</html>