Merge pull request #2411 from chmelevskij/add-semi-to-eslint
chore: add `semi` rule to the linter and run `--fix`10.8-maintenance
commit
99e36744d2
|
@ -13,6 +13,7 @@ module.exports = {
|
|||
},
|
||||
rules: {
|
||||
"no-trailing-spaces": "error",
|
||||
"eol-last": "error"
|
||||
"eol-last": "error",
|
||||
semi: "error"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -87,16 +87,16 @@ const Analytics = function (trackingId, userId, appName, appVersion, changesetId
|
|||
Analytics.prototype.setDimension = function (dimension, value) {
|
||||
const dimensionName = `dimension${dimension}`;
|
||||
this._googleAnalytics.custom(dimensionName, value);
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype.setMetric = function (metric, value) {
|
||||
const metricName = `metric${metric}`;
|
||||
this._googleAnalytics.custom(metricName, value);
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype.sendEvent = function (category, action, options) {
|
||||
this._googleAnalytics.event(category, action, options);
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype.sendChangeEvents = function (category, changeList) {
|
||||
for (const actionName in changeList) {
|
||||
|
@ -107,23 +107,23 @@ Analytics.prototype.sendChangeEvents = function (category, changeList) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype.sendAppView = function (viewName) {
|
||||
this._googleAnalytics.screenview(viewName);
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype.sendTiming = function (category, timing, value) {
|
||||
this._googleAnalytics.timing(category, timing, value);
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype.sendException = function (message) {
|
||||
this._googleAnalytics.exception(message);
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype.setOptOut = function (optOut) {
|
||||
window['ga-disable-' + this._trackingId] = !!optOut;
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype._rebuildFlightControllerEvent = function () {
|
||||
this.setDimension(this.DIMENSIONS.BOARD_TYPE, this._flightControllerData[this.DATA.BOARD_TYPE]);
|
||||
|
@ -137,19 +137,19 @@ Analytics.prototype._rebuildFlightControllerEvent = function () {
|
|||
this.setDimension(this.DIMENSIONS.BOARD_NAME, this._flightControllerData[this.DATA.BOARD_NAME]);
|
||||
this.setDimension(this.DIMENSIONS.MANUFACTURER_ID, this._flightControllerData[this.DATA.MANUFACTURER_ID]);
|
||||
this.setDimension(this.DIMENSIONS.MCU_TYPE, this._flightControllerData[this.DATA.MCU_TYPE]);
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype.setFlightControllerData = function (property, value) {
|
||||
this._flightControllerData[property] = value;
|
||||
|
||||
this._rebuildFlightControllerEvent();
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype.resetFlightControllerData = function () {
|
||||
this._flightControllerData = {};
|
||||
|
||||
this._rebuildFlightControllerEvent();
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype._rebuildFirmwareEvent = function () {
|
||||
this.setDimension(this.DIMENSIONS.FIRMWARE_NAME, this._firmwareData[this.DATA.FIRMWARE_NAME]);
|
||||
|
@ -157,16 +157,16 @@ Analytics.prototype._rebuildFirmwareEvent = function () {
|
|||
this.setDimension(this.DIMENSIONS.FIRMWARE_ERASE_ALL, this._firmwareData[this.DATA.FIRMWARE_ERASE_ALL]);
|
||||
this.setDimension(this.DIMENSIONS.FIRMWARE_CHANNEL, this._firmwareData[this.DATA.FIRMWARE_CHANNEL]);
|
||||
this.setMetric(this.METRICS.FIRMWARE_SIZE, this._firmwareData[this.DATA.FIRMWARE_SIZE]);
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype.setFirmwareData = function (property, value) {
|
||||
this._firmwareData[property] = value;
|
||||
|
||||
this._rebuildFirmwareEvent();
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype.resetFirmwareData = function () {
|
||||
this._firmwareData = {};
|
||||
|
||||
this._rebuildFirmwareEvent();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
const ConfigInserter = function () {
|
||||
}
|
||||
};
|
||||
|
||||
const CUSTOM_DEFAULTS_POINTER_ADDRESS = 0x08002800;
|
||||
const BLOCK_SIZE = 16384;
|
||||
|
@ -104,4 +104,4 @@ ConfigInserter.prototype.insertConfig = function (firmware, input) {
|
|||
console.timeEnd(CONFIG_LABEL);
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -38,4 +38,4 @@ const ConfigStorage = {
|
|||
window.localStorage.setItem(element, JSON.stringify(tmpObj));
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -201,7 +201,7 @@ Features.prototype.findFeatureByBit = function (bit) {
|
|||
return feature;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Features.prototype.updateData = function (featureElement) {
|
||||
const self = this;
|
||||
|
|
|
@ -273,7 +273,7 @@ TuningSliders.updateFilterSlidersDisplay = function() {
|
|||
$('.tuningFilterSliders .sliderLabels tr:nth-child(2)').hide();
|
||||
this.sliderGyroFilter = true;
|
||||
} else {
|
||||
$('.tuningFilterSliders .sliderLabels tr:nth-child(2)').show()
|
||||
$('.tuningFilterSliders .sliderLabels tr:nth-child(2)').show();
|
||||
this.cachedGyroSliderValues = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -436,7 +436,7 @@ function configuration_restore(callback) {
|
|||
}
|
||||
|
||||
if (configuration.apiVersion == undefined) {
|
||||
configuration.apiVersion = "1.0.0" // a guess that will satisfy the rest of the code
|
||||
configuration.apiVersion = "1.0.0"; // a guess that will satisfy the rest of the code
|
||||
}
|
||||
// apiVersion previously stored without patchlevel
|
||||
if (!semver.parse(configuration.apiVersion)) {
|
||||
|
|
|
@ -126,7 +126,7 @@ GuiControl.prototype.interval_add_condition = function (name, code, interval, fi
|
|||
this.interval_remove(name);
|
||||
}
|
||||
}, interval, first);
|
||||
}
|
||||
};
|
||||
|
||||
// name = string
|
||||
GuiControl.prototype.interval_remove = function (name) {
|
||||
|
|
|
@ -7,7 +7,7 @@ const JenkinsLoader = function (url) {
|
|||
|
||||
this._jobsRequest = '/api/json?tree=jobs[name]';
|
||||
this._buildsRequest = '/api/json?tree=builds[number,result,timestamp,artifacts[relativePath],changeSet[items[commitId,msg]]]';
|
||||
}
|
||||
};
|
||||
|
||||
JenkinsLoader.prototype.loadJobs = function (viewName, callback) {
|
||||
const self = this;
|
||||
|
@ -43,10 +43,10 @@ JenkinsLoader.prototype.loadJobs = function (viewName, callback) {
|
|||
// remove Betaflight prefix, rename Betaflight job to Development
|
||||
const jobs = jobsInfo.jobs.map(job => {
|
||||
return { title: job.name.replace('Betaflight ', '').replace('Betaflight', 'Development'), name: job.name };
|
||||
})
|
||||
});
|
||||
|
||||
// cache loaded info
|
||||
const object = {}
|
||||
const object = {};
|
||||
object[jobsDataTag] = jobs;
|
||||
object[cacheLastUpdateTag] = $.now();
|
||||
chrome.storage.local.set(object);
|
||||
|
@ -60,14 +60,14 @@ JenkinsLoader.prototype.loadJobs = function (viewName, callback) {
|
|||
cachedCallback();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
JenkinsLoader.prototype.loadBuilds = function (jobName, callback) {
|
||||
const self = this;
|
||||
|
||||
const jobUrl = `${self._url}/job/${jobName}`;
|
||||
const buildsDataTag = `${jobUrl}BuildsData`;
|
||||
const cacheLastUpdateTag = `${jobUrl}BuildsLastUpdate`
|
||||
const cacheLastUpdateTag = `${jobUrl}BuildsLastUpdate`;
|
||||
|
||||
chrome.storage.local.get([cacheLastUpdateTag, buildsDataTag], function (result) {
|
||||
const buildsDataTimestamp = $.now();
|
||||
|
@ -98,7 +98,7 @@ JenkinsLoader.prototype.loadBuilds = function (jobName, callback) {
|
|||
}));
|
||||
|
||||
// cache loaded info
|
||||
const object = {}
|
||||
const object = {};
|
||||
object[buildsDataTag] = builds;
|
||||
object[cacheLastUpdateTag] = $.now();
|
||||
chrome.storage.local.set(object);
|
||||
|
@ -112,7 +112,7 @@ JenkinsLoader.prototype.loadBuilds = function (jobName, callback) {
|
|||
cachedCallback();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
JenkinsLoader.prototype._parseBuilds = function (jobUrl, jobName, builds, callback) {
|
||||
// convert from `build -> targets` to `target -> builds` mapping
|
||||
|
@ -160,4 +160,4 @@ JenkinsLoader.prototype._parseBuilds = function (jobUrl, jobName, builds, callba
|
|||
});
|
||||
|
||||
callback(targetBuilds);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -845,7 +845,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
const serialPort = {
|
||||
identifier: data.readU8(),
|
||||
scenario: data.readU8(),
|
||||
}
|
||||
};
|
||||
FC.SERIAL_CONFIG.ports.push(serialPort);
|
||||
}
|
||||
FC.SERIAL_CONFIG.mspBaudRate = data.readU32();
|
||||
|
@ -1658,7 +1658,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Encode the request body for the MSP request with the given code and return it as an array of bytes.
|
||||
|
@ -2330,7 +2330,7 @@ MspHelper.prototype.setRawRx = function(channels) {
|
|||
}
|
||||
|
||||
MSP.send_message(MSPCodes.MSP_SET_RAW_RC, buffer, false);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Send a request to read a block of data from the dataflash at the given address and pass that address and a dataview
|
||||
|
@ -2568,7 +2568,7 @@ MspHelper.prototype.sendVoltageConfig = function(onCompleteCallback) {
|
|||
MSP.send_message(MSPCodes.MSP_SET_VOLTAGE_METER_CONFIG, buffer, false, nextFunction);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
MspHelper.prototype.sendCurrentConfig = function(onCompleteCallback) {
|
||||
|
||||
|
@ -2598,7 +2598,7 @@ MspHelper.prototype.sendCurrentConfig = function(onCompleteCallback) {
|
|||
MSP.send_message(MSPCodes.MSP_SET_CURRENT_METER_CONFIG, buffer, false, nextFunction);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
MspHelper.prototype.sendLedStripConfig = function(onCompleteCallback) {
|
||||
|
||||
|
@ -2688,7 +2688,7 @@ MspHelper.prototype.sendLedStripConfig = function(onCompleteCallback) {
|
|||
|
||||
MSP.send_message(MSPCodes.MSP_SET_LED_STRIP_CONFIG, buffer, false, nextFunction);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
MspHelper.prototype.sendLedStripColors = function(onCompleteCallback) {
|
||||
if (FC.LED_COLORS.length == 0) {
|
||||
|
@ -2703,7 +2703,7 @@ MspHelper.prototype.sendLedStripColors = function(onCompleteCallback) {
|
|||
}
|
||||
MSP.send_message(MSPCodes.MSP_SET_LED_COLORS, buffer, false, onCompleteCallback);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
MspHelper.prototype.sendLedStripModeColors = function(onCompleteCallback) {
|
||||
|
||||
|
@ -2733,7 +2733,7 @@ MspHelper.prototype.sendLedStripModeColors = function(onCompleteCallback) {
|
|||
|
||||
MSP.send_message(MSPCodes.MSP_SET_LED_STRIP_MODECOLOR, buffer, false, nextFunction);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
MspHelper.prototype.serialPortFunctionMaskToFunctions = function(functionMask) {
|
||||
const self = this;
|
||||
|
@ -2747,7 +2747,7 @@ MspHelper.prototype.serialPortFunctionMaskToFunctions = function(functionMask) {
|
|||
}
|
||||
}
|
||||
return functions;
|
||||
}
|
||||
};
|
||||
|
||||
MspHelper.prototype.serialPortFunctionsToMask = function(functions) {
|
||||
const self = this;
|
||||
|
@ -2761,7 +2761,7 @@ MspHelper.prototype.serialPortFunctionsToMask = function(functions) {
|
|||
}
|
||||
}
|
||||
return mask;
|
||||
}
|
||||
};
|
||||
|
||||
MspHelper.prototype.sendRxFailConfig = function(onCompleteCallback) {
|
||||
let nextFunction = send_next_rxfail_config;
|
||||
|
@ -2792,7 +2792,7 @@ MspHelper.prototype.sendRxFailConfig = function(onCompleteCallback) {
|
|||
}
|
||||
MSP.send_message(MSPCodes.MSP_SET_RXFAIL_CONFIG, buffer, false, nextFunction);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
MspHelper.prototype.setArmingEnabled = function(doEnable, disableRunawayTakeoffPrevention, onCompleteCallback) {
|
||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_37)
|
||||
|
@ -2822,7 +2822,7 @@ MspHelper.prototype.setArmingEnabled = function(doEnable, disableRunawayTakeoffP
|
|||
onCompleteCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
MspHelper.prototype.loadSerialConfig = function(callback) {
|
||||
const mspCode = semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_43) ? MSPCodes.MSP2_COMMON_SERIAL_CONFIG : MSPCodes.MSP_CF_SERIAL_CONFIG;
|
||||
|
|
|
@ -185,14 +185,14 @@ STM32_protocol.prototype.connect = function (port, baud, hex, options, callback)
|
|||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var onTimeoutHandler = function() {
|
||||
GUI.connect_lock = false;
|
||||
console.log('Looking for capabilities via MSP failed');
|
||||
|
||||
TABS.firmware_flasher.flashingMessage(i18n.getMessage('stm32RebootingToBootloaderFailed'), TABS.firmware_flasher.FLASH_MESSAGE_TYPES.INVALID);
|
||||
}
|
||||
};
|
||||
|
||||
var onFailureHandler = function() {
|
||||
GUI.connect_lock = false;
|
||||
|
@ -688,7 +688,7 @@ STM32_protocol.prototype.upload_procedure = function (step) {
|
|||
self.upload_procedure(6);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// start writing
|
||||
write();
|
||||
|
@ -783,7 +783,7 @@ STM32_protocol.prototype.upload_procedure = function (step) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// start reading
|
||||
reading();
|
||||
|
@ -840,7 +840,7 @@ STM32_protocol.prototype.cleanup = function () {
|
|||
if (self.callback) {
|
||||
self.callback();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// initialize object
|
||||
var STM32 = new STM32_protocol();
|
||||
|
|
|
@ -205,7 +205,7 @@ STM32DFU_protocol.prototype.getString = function (index, callback) {
|
|||
}
|
||||
callback(descriptor, result.resultCode);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
STM32DFU_protocol.prototype.getInterfaceDescriptors = function (interfaceNum, callback) {
|
||||
var self = this;
|
||||
|
@ -243,10 +243,10 @@ STM32DFU_protocol.prototype.getInterfaceDescriptors = function (interfaceNum, ca
|
|||
callback(descriptorStringArray, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
getDescriptorString();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
STM32DFU_protocol.prototype.getInterfaceDescriptor = function (_interface, callback) {
|
||||
|
@ -281,7 +281,7 @@ STM32DFU_protocol.prototype.getInterfaceDescriptor = function (_interface, callb
|
|||
|
||||
callback(descriptor, result.resultCode);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
STM32DFU_protocol.prototype.getFunctionalDescriptor = function (_interface, callback) {
|
||||
var self = this;
|
||||
|
@ -313,7 +313,7 @@ STM32DFU_protocol.prototype.getFunctionalDescriptor = function (_interface, call
|
|||
|
||||
callback(descriptor, result.resultCode);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
STM32DFU_protocol.prototype.getChipInfo = function (_interface, callback) {
|
||||
var self = this;
|
||||
|
@ -338,7 +338,7 @@ STM32DFU_protocol.prototype.getChipInfo = function (_interface, callback) {
|
|||
|
||||
// H750 Partitions: Flash, Config, Firmware, 1x BB Management block + x BB Replacement blocks)
|
||||
if (str == "@External Flash /0x90000000/1001*128Kg,3*128Kg,20*128Ka") {
|
||||
str = "@External Flash /0x90000000/998*128Kg,1*128Kg,4*128Kg,21*128Ka"
|
||||
str = "@External Flash /0x90000000/998*128Kg,1*128Kg,4*128Kg,21*128Ka";
|
||||
}
|
||||
|
||||
// split main into [location, start_addr, sectors]
|
||||
|
@ -408,16 +408,16 @@ STM32DFU_protocol.prototype.getChipInfo = function (_interface, callback) {
|
|||
'start_address': start_address,
|
||||
'sectors' : sectors,
|
||||
'total_size' : total_size
|
||||
}
|
||||
};
|
||||
return memory;
|
||||
}
|
||||
};
|
||||
var chipInfo = descriptors.map(parseDescriptor).reduce(function(o, v, i) {
|
||||
o[v.type.toLowerCase().replace(' ', '_')] = v;
|
||||
return o;
|
||||
}, {});
|
||||
callback(chipInfo, resultCode);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
STM32DFU_protocol.prototype.controlTransfer = function (direction, request, value, _interface, length, data, callback, _timeout) {
|
||||
var self = this;
|
||||
|
@ -626,7 +626,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
|
|||
console.log('Initiate read unprotect');
|
||||
let messageReadProtected = i18n.getMessage('stm32ReadProtected');
|
||||
GUI.log(messageReadProtected);
|
||||
TABS.firmware_flasher.flashingMessage(messageReadProtected, TABS.firmware_flasher.FLASH_MESSAGE_TYPES.ACTION)
|
||||
TABS.firmware_flasher.flashingMessage(messageReadProtected, TABS.firmware_flasher.FLASH_MESSAGE_TYPES.ACTION);
|
||||
|
||||
self.controlTransfer('out', self.request.DNLOAD, 0, 0, 0, [0x92], function () { // 0x92 initiates read unprotect
|
||||
self.controlTransfer('in', self.request.GETSTATUS, 0, 0, 6, 0, function (data) {
|
||||
|
@ -667,14 +667,14 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
|
|||
}, incr);
|
||||
} else {
|
||||
console.log('Failed to initiate unprotect memory command');
|
||||
let messageUnprotectInitFailed = i18n.getMessage('stm32UnprotectInitFailed')
|
||||
let messageUnprotectInitFailed = i18n.getMessage('stm32UnprotectInitFailed');
|
||||
GUI.log(messageUnprotectInitFailed);
|
||||
TABS.firmware_flasher.flashingMessage(messageUnprotectInitFailed, TABS.firmware_flasher.FLASH_MESSAGE_TYPES.INVALID)
|
||||
TABS.firmware_flasher.flashingMessage(messageUnprotectInitFailed, TABS.firmware_flasher.FLASH_MESSAGE_TYPES.INVALID);
|
||||
self.cleanup();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var tryReadOB = function() {
|
||||
// the following should fail if read protection is active
|
||||
|
@ -730,7 +730,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
|
|||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var initReadOB = function (loadAddressResponse) {
|
||||
// contrary to what is in the docs. Address load should in theory work even if read protection is active
|
||||
|
@ -747,7 +747,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
|
|||
GUI.log(i18n.getMessage('stm32AddressLoadUnknown'));
|
||||
self.cleanup();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
self.clearStatus(function () {
|
||||
// load address fails if read protection is active unlike as stated in the docs
|
||||
|
@ -809,7 +809,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
|
|||
} else {
|
||||
erase_page();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var erase_page = function() {
|
||||
var page_addr = erase_pages[page].page * self.flash_layout.sectors[erase_pages[page].sector].page_size +
|
||||
|
@ -848,7 +848,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
|
|||
console.log('Failed to erase page 0x' + page_addr.toString(16) + ' (did not reach dfuIDLE after clearing');
|
||||
self.cleanup();
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
} else if (data[4] == self.state.dfuDNLOAD_IDLE) {
|
||||
erase_page_next();
|
||||
|
@ -918,7 +918,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
|
|||
self.cleanup();
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
} else {
|
||||
if (flashing_block < blocks) {
|
||||
// move to another block
|
||||
|
@ -937,7 +937,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
|
|||
self.upload_procedure(5);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// start
|
||||
self.loadAddress(address, write);
|
||||
|
@ -1028,7 +1028,7 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -5,9 +5,9 @@ var ReleaseChecker = function (releaseName, releaseUrl) {
|
|||
|
||||
self._releaseName = releaseName;
|
||||
self._releaseDataTag = `${self._releaseName}ReleaseData`;
|
||||
self._releaseLastUpdateTag = `${self._releaseName}ReleaseLastUpdate`
|
||||
self._releaseLastUpdateTag = `${self._releaseName}ReleaseLastUpdate`;
|
||||
self._releaseUrl = releaseUrl;
|
||||
}
|
||||
};
|
||||
|
||||
ReleaseChecker.prototype.loadReleaseData = function (processFunction) {
|
||||
const self = this;
|
||||
|
@ -42,7 +42,7 @@ ReleaseChecker.prototype.loadReleaseData = function (processFunction) {
|
|||
self._processReleaseData(cacheReleaseData, processFunction);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
ReleaseChecker.prototype._processReleaseData = function (releaseData, processFunction) {
|
||||
|
@ -53,4 +53,4 @@ ReleaseChecker.prototype._processReleaseData = function (releaseData, processFun
|
|||
|
||||
processFunction();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -285,7 +285,7 @@ TABS.auxiliary.initialize = function (callback) {
|
|||
continue; // invalid!
|
||||
}
|
||||
|
||||
addRangeToMode(newMode, modeRange.auxChannelIndex, modeRangeExtra.modeLogic, range)
|
||||
addRangeToMode(newMode, modeRange.auxChannelIndex, modeRangeExtra.modeLogic, range);
|
||||
|
||||
} else {
|
||||
addLinkedToMode(newMode, modeRangeExtra.modeLogic, modeRangeExtra.linkedTo);
|
||||
|
@ -511,7 +511,7 @@ TABS.auxiliary.initialize = function (callback) {
|
|||
|
||||
const fillPrevChannelsValues = function () {
|
||||
prevChannelsValues = RC_channels.slice(0); //clone array
|
||||
}
|
||||
};
|
||||
|
||||
if (!prevChannelsValues || RC_channels.length === 0) return fillPrevChannelsValues();
|
||||
|
||||
|
|
|
@ -345,7 +345,7 @@ TABS.firmware_flasher.initialize = function (callback) {
|
|||
title: job.title,
|
||||
loader: () => self.jenkinsLoader.loadBuilds(job.name, loadUnifiedBuilds)
|
||||
};
|
||||
})
|
||||
});
|
||||
var buildTypesToShow;
|
||||
|
||||
var buildType_e = $('select[name="build_type"]');
|
||||
|
@ -741,7 +741,7 @@ TABS.firmware_flasher.initialize = function (callback) {
|
|||
if ($('input.erase_chip').is(':checked')) {
|
||||
options.erase_chip = true;
|
||||
|
||||
eraseAll = true
|
||||
eraseAll = true;
|
||||
}
|
||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_ERASE_ALL, eraseAll.toString());
|
||||
|
||||
|
@ -1249,7 +1249,7 @@ TABS.firmware_flasher.enableFlashing = function (enabled) {
|
|||
} else {
|
||||
$('a.flash_firmware').addClass('disabled');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
TABS.firmware_flasher.FLASH_MESSAGE_TYPES = {NEUTRAL : 'NEUTRAL',
|
||||
VALID : 'VALID',
|
||||
|
|
|
@ -61,7 +61,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
|||
usedWireNumbers.push(wireNumber);
|
||||
}
|
||||
});
|
||||
usedWireNumbers.sort(function(a,b){return a - b});
|
||||
usedWireNumbers.sort(function(a,b){return a - b;});
|
||||
return usedWireNumbers;
|
||||
}
|
||||
|
||||
|
@ -1011,21 +1011,21 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
|
|||
if (FC.LED_COLORS[selectedColorIndex].h != value) {
|
||||
FC.LED_COLORS[selectedColorIndex].h = value;
|
||||
$('.colorDefineSliderValue.Hvalue').text(FC.LED_COLORS[selectedColorIndex].h);
|
||||
change = true
|
||||
change = true;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (FC.LED_COLORS[selectedColorIndex].s != value) {
|
||||
FC.LED_COLORS[selectedColorIndex].s = value;
|
||||
$('.colorDefineSliderValue.Svalue').text(FC.LED_COLORS[selectedColorIndex].s);
|
||||
change = true
|
||||
change = true;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (FC.LED_COLORS[selectedColorIndex].v != value) {
|
||||
FC.LED_COLORS[selectedColorIndex].v = value;
|
||||
$('.colorDefineSliderValue.Vvalue').text(FC.LED_COLORS[selectedColorIndex].v);
|
||||
change = true
|
||||
change = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -15,11 +15,11 @@ logging.initialize = function (callback) {
|
|||
if (CONFIGURATOR.connectionValid) {
|
||||
const getMotorData = function () {
|
||||
MSP.send_message(MSPCodes.MSP_MOTOR, false, false, loadHtml);
|
||||
}
|
||||
};
|
||||
|
||||
const loadHtml = function () {
|
||||
$('#content').load("./tabs/logging.html", process_html);
|
||||
}
|
||||
};
|
||||
|
||||
MSP.send_message(MSPCodes.MSP_RC, false, false, getMotorData);
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ logging.initialize = function (callback) {
|
|||
for (let i = 0; i < requestedProperties.length; i++, requests++) {
|
||||
MSP.send_message(MSPCodes[requestedProperties[i]]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
GUI.interval_add('log_data_poll', logDataPoll, parseInt($('select.speed').val()), true); // refresh rate goes here
|
||||
GUI.interval_add('write_data', function write_data() {
|
||||
|
|
|
@ -369,7 +369,7 @@ TABS.motors.initialize = function (callback) {
|
|||
}
|
||||
|
||||
$('.tab-motors .sensor select').change(function(){
|
||||
TABS.motors.sensor = $('.tab-motors select[name="sensor_choice"]').val()
|
||||
TABS.motors.sensor = $('.tab-motors select[name="sensor_choice"]').val();
|
||||
ConfigStorage.set({'motors_tab_sensor_settings': {'sensor': TABS.motors.sensor}});
|
||||
|
||||
switch(TABS.motors.sensor){
|
||||
|
|
|
@ -690,4 +690,4 @@ TABS.onboard_logging.mscRebootFailedCallback = function () {
|
|||
.toggleClass("msc-supported", false);
|
||||
|
||||
showErrorDialog(i18n.getMessage('operationNotSupported'));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1036,7 +1036,7 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
}
|
||||
|
||||
return isVisible;
|
||||
}
|
||||
};
|
||||
|
||||
let isVisibleBaroMagGps = false;
|
||||
|
||||
|
@ -1440,18 +1440,18 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
{name: "MultiWii (2.3 - latest)"},
|
||||
{name: "MultiWii (2.3 - hybrid)"},
|
||||
{name: "Harakiri"}
|
||||
]
|
||||
];
|
||||
} else if (semver.lt(FC.CONFIG.apiVersion, "1.20.0")) {
|
||||
pidControllerList = [
|
||||
{name: ""},
|
||||
{name: "Integer"},
|
||||
{name: "Float"}
|
||||
]
|
||||
];
|
||||
} else {
|
||||
pidControllerList = [
|
||||
{name: "Legacy"},
|
||||
{name: "Betaflight"}
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
for (let i = 0; i < pidControllerList.length; i++) {
|
||||
|
@ -2225,7 +2225,7 @@ TABS.pid_tuning.checkUpdateProfile = function (updateRateProfile) {
|
|||
|
||||
if (changedRateProfile) {
|
||||
GUI.log(i18n.getMessage('pidTuningReceivedRateProfile', [FC.CONFIG.rateProfile + 1]));
|
||||
FC.CONFIG.rateProfile = self.currentRateProfile
|
||||
FC.CONFIG.rateProfile = self.currentRateProfile;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -2450,7 +2450,7 @@ TABS.pid_tuning.updateRatesLabels = function() {
|
|||
$('.maxRateWarning').toggle(warningRates);
|
||||
|
||||
// and sort them in descending order so the largest value is at the top always
|
||||
balloons.sort(function(a,b) {return (b.value - a.value)});
|
||||
balloons.sort(function(a,b) {return (b.value - a.value);});
|
||||
|
||||
// add the current rc values
|
||||
if (currentValues[0] && currentValues[1] && currentValues[2]) {
|
||||
|
|
|
@ -89,7 +89,7 @@ TABS.power.initialize = function (callback) {
|
|||
$(elementVoltageMeter).attr('id', `voltage-meter-${index}`);
|
||||
|
||||
const message = i18n.getMessage('powerVoltageId' + FC.VOLTAGE_METERS[index].id);
|
||||
$(elementVoltageMeter).find('.label').text(message)
|
||||
$(elementVoltageMeter).find('.label').text(message);
|
||||
destinationVoltageMeter.append(elementVoltageMeter);
|
||||
|
||||
elementVoltageMeter.hide();
|
||||
|
@ -147,7 +147,7 @@ TABS.power.initialize = function (callback) {
|
|||
$(elementAmperageMeter).attr('id', `amperage-meter-${index}`);
|
||||
|
||||
const message = i18n.getMessage('powerAmperageId' + FC.CURRENT_METERS[index].id);
|
||||
$(elementAmperageMeter).find('.label').text(message)
|
||||
$(elementAmperageMeter).find('.label').text(message);
|
||||
destinationAmperageMeter.append(elementAmperageMeter);
|
||||
|
||||
elementAmperageMeter.hide();
|
||||
|
|
|
@ -328,7 +328,7 @@ TABS.receiver.initialize = function (callback) {
|
|||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
windowWatcherUtil.passValue(createdWindow, 'darkTheme', DarkTheme.isDarkThemeEnabled(DarkTheme.configEnabled));
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ TABS.setup.initialize = function (callback) {
|
|||
arming_disable_flags_e.append('<span id="initialSetupArmingDisableFlags' + i + '" class="disarm-flag" style="display: none;">' + (i + 1) + '</span>');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
prepareDisarmFlags();
|
||||
|
||||
|
|
|
@ -11,14 +11,14 @@ windowWatcherUtil.invokeWatcher = function(bindingKey, bindingVal, watchersObjec
|
|||
if (watchersObject[bindingKey]) {
|
||||
watchersObject[bindingKey](bindingVal);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
windowWatcherUtil.iterateOverBindings = function(bindings, watchersObject) {
|
||||
let entries = Object.entries(bindings);
|
||||
for (const [key, val] of entries) {
|
||||
this.invokeWatcher(key, val, watchersObject);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
windowWatcherUtil.bindWatchers = function(windowObject, watchersObject) {
|
||||
if (!windowObject.bindings) {
|
||||
|
@ -33,7 +33,7 @@ windowWatcherUtil.bindWatchers = function(windowObject, watchersObject) {
|
|||
return Reflect.set(target, prop, val, receiver);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 'Windows' here could be array or single window reference
|
||||
windowWatcherUtil.passValue = function(windows, key, val) {
|
||||
|
@ -54,6 +54,6 @@ windowWatcherUtil.passValue = function(windows, key, val) {
|
|||
if (Array.isArray(windows)) {
|
||||
windows.forEach((el) => applyBinding(el, key, val));
|
||||
} else {
|
||||
applyBinding(windows, key, val)
|
||||
applyBinding(windows, key, val);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -81,7 +81,7 @@ function read_hex_file(data) {
|
|||
extended_linear_address = ((parseInt(content.substr(0, 2), 16) << 24) | parseInt(content.substr(2, 2), 16) << 16) >>> 0;
|
||||
break;
|
||||
case 0x05: // start linear address record
|
||||
result.start_linear_address = parseInt(content, 16)
|
||||
result.start_linear_address = parseInt(content, 16);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue