-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.html
131 lines (120 loc) · 4.6 KB
/
build.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE html>
<html>
<head>
<title>Angular QuickStart</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="dist/vendor.bundle.js"></script>
<script src="dist/app.bundle.js"></script>
<script>
function mockAjax(url, data){
console.log('mockAjax', url, data);
data = JSON.parse(data.data);
console.log('mockAjax deJSON', data);
var r = {
status: 'ok',
message: '',
list: []
};
switch (url) {
case '/add':
r.list = [
{
id: '1',
name: 'First session Jura FR',
languageKey: 'fr',
cantonKey: 'ju',
isInAgenda: data.id == '1',
isCanAdd: false,
isCanRemove: data.id == '1'
},
{
id: '2',
name: 'Second session Zug EN',
languageKey: 'en',
cantonKey: 'zu',
isInAgenda: data.id == '2',
isCanAdd: false,
isCanRemove: data.id == '2'
}
];
break;
case '/remove':
r.list = [
{
id: '1',
name: 'First session Jura FR',
languageKey: 'fr',
cantonKey: 'ju',
isInAgenda: false,
isCanAdd: true,
isCanRemove: false
},
{
id: '2',
name: 'Second session Zug EN',
languageKey: 'en',
cantonKey: 'zu',
isInAgenda: false,
isCanAdd: true,
isCanRemove: false
}
];
break;
}
return r;
}
var options = {
name: 'bebebe',
mockAJAX: mockAjax,
formId: 'mod_accommodation_pluginMainForm',
formAction: '/submit',
hotel_id: 'hilton',
room_type_id: '2',
date_input: '01',
date_output: '02',
sharing_room_with: 'Mom',
hotels: [
{id: 'hilton', name: 'Hilton'},
{id: 'dnipro', name: 'Dnipro'},
{id: 'odessa', name: 'Odessa'}
],
rooms: [
{id:'1', hotel_id: 'hilton', name: 'Hilton single', periods:[['01','02','03','04','05'],['07']]},
{id:'2', hotel_id: 'hilton', name: 'Hilton double', periods:[['01','02'],['06','07']], allow_share: true},
{id:'3', hotel_id: 'dnipro', name: 'Dnipro double', periods:[['01'],['03','04','05']], allow_share: true},
{id:'4', hotel_id: 'odessa', name: 'Odessa single', periods:[['01','02','03'],['04','05'],['07']]}
],
days: [
{id:'01', name: '01.11.2016'},
{id:'02', name: '02.11.2016'},
{id:'03', name: '03.11.2016'},
{id:'04', name: '04.11.2016'},
{id:'05', name: '05.11.2016'},
{id:'06', name: '06.11.2016'},
{id:'07', name: '07.11.2016'}
],
translations:[
{code: 'translate_test', value: '-Translate Test-'}
],
onTranslate: function(){},
onChange: function(){ console.log('onChange')},
onInit: function (callback) {
$('#nextStep').on('click', function () {
console.log(callback());
// now we can use this value for submitting the form
});
}
};
RunApplication(options);
</script>
</head>
<body>
<session-public-plugin>Loading...</session-public-plugin>
<div id="nextStep">Next</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</body>
</html>