blob: aa46c2154737ea4ec7f12a35653e256e8d0f329e (
plain)
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
|
'use strict';
TABS.programming = {};
TABS.programming.initialize = function (callback, scrollPosition) {
let loadChainer = new MSPChainerClass(),
saveChainer = new MSPChainerClass();
if (GUI.active_tab != 'programming') {
GUI.active_tab = 'programming';
googleAnalytics.sendAppView('Programming');
}
loadChainer.setChain([
mspHelper.loadLogicConditions,
mspHelper.loadGlobalFunctions
]);
loadChainer.setExitPoint(loadHtml);
loadChainer.execute();
saveChainer.setChain([
mspHelper.sendLogicConditions,
mspHelper.sendGlobalFunctions,
mspHelper.saveToEeprom
]);
saveChainer.setExitPoint(reboot);
function reboot() {
//noinspection JSUnresolvedVariable
GUI.log(chrome.i18n.getMessage('configurationEepromSaved'));
GUI.tab_switch_cleanup(function() {
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, function () {
GUI.log(chrome.i18n.getMessage('deviceRebooting'));
GUI.handleReconnect($('.tab_programming a'));
});
});
}
function loadHtml() {
GUI.load("./tabs/programming.html", processHtml);
}
function processHtml() {
LOGIC_CONDITIONS.init($('#logic-wrapper'));
LOGIC_CONDITIONS.render();
localize();
GUI.content_ready(callback);
}
}
TABS.programming.cleanup = function (callback) {
if (callback) callback();
};
|