-
Notifications
You must be signed in to change notification settings - Fork 1
/
apex.js
70 lines (57 loc) · 1.67 KB
/
apex.js
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
function setApexCollectionClob(pBigValue) {
var apexAjaxObj = new apex.ajax.clob(
function() {
var rs = p.readyState;
if (rs == 4) {
// ok we have data in clob and we can save it in DB
apex.event.trigger(document, 'doSaveAllInDB')
} else {
//nok somthing went wrong
apex.event.trigger(document, 'displayNotification', 'Error during the save into collection!');
};
}
);
apexAjaxObj._set(pBigValue);
}
function doEditAll() {
var intro = introJs();
intro.setOptions({
steps: [{
element: document.querySelector('.editScheduleRegion'),
intro: 'Cliquez “Esc” pour annuler vous changements.',
position: 'left'
}],
showBullets: false,
showStepNumbers: false,
exitOnOverlayClick: false
});
intro.start();
$('div.popUpEdit').hide();
$('div.customPagination').hide();
$('a.introjs-skipbutton').text("Sauvegarder");
$('div.introjs-tooltipbuttons').detach().insertBefore($('div.introjs-tooltiptext'));
var id;
$('div.ClickableBlocksSteps').each(function(index) {
id = $(this).attr("data-clickB");
eval(id + '.editAllOn();');
});
intro.onexit(function() {
location.reload();
});
intro.oncomplete(function() {
var id;
var all_data = [];
var b_data = {};
$('div.ClickableBlocksSteps').each(function(index) {
id = $(this).attr("data-clickB");
eval(id + '.editAllOff();');
b_data = new Function('return ' + id + '.getBlocks();')();
all_data.push(b_data);
});
setApexCollectionClob(JSON.stringify(all_data));
$('div.popUpEdit').show();
$('div.customPagination').show();
apex.widget.waitPopup();
});
}