Merge pull request #2693 from chmelevskij/chore/eslint-trailing-comma

chore: add comman dangle rule for multiline
10.8-maintenance
haslinghuis 2021-12-22 01:56:16 +01:00 committed by GitHub
commit c09d64b9b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 203 additions and 202 deletions

View File

@ -1,7 +1,7 @@
module.exports = {
parserOptions: {
ecmaVersion: 2020,
sourceType: "module"
sourceType: "module",
},
extends: ["plugin:vue/recommended"],
env: {
@ -9,11 +9,12 @@ module.exports = {
jquery: true,
es2017: true,
browser: true,
webextensions: true
webextensions: true,
},
rules: {
"no-trailing-spaces": "error",
"eol-last": "error",
semi: "error"
}
}
semi: "error",
"comma-dangle": ["error", "always-multiline"],
},
};

View File

@ -424,7 +424,7 @@ function dist_rollup() {
// accordingly inside of `dist`
entryFileNames: '[name].js',
dir: DIST_DIR,
})
}),
);
}
@ -559,7 +559,7 @@ function injectARMCache(flavor, done) {
process.exit(1);
}
done();
}
},
);
}
});
@ -828,7 +828,7 @@ function release_osx64(appDirectory) {
},
},
},
})
}),
);
}

View File

@ -231,8 +231,8 @@ class MotorOutputReorderConfig
ArmWidth: 0.1 * screenSize,
Motors:
[
{x: -frameRadius, y: 0,},
{x: frameRadius, y: 0,},
{x: -frameRadius, y: 0},
{x: frameRadius, y: 0},
],
};
}

View File

@ -10,7 +10,7 @@ const Analytics = function (trackingId, userId, appName, appVersion, gitRevision
this._googleAnalytics.initialize(this._trackingId, {
storage: 'none',
clientId: userId,
debug: !!debugMode
debug: !!debugMode,
});
// Make it work for the Chrome App:

View File

@ -30,13 +30,13 @@ class Beepers {
beepers.push(
{ bit: 19, name: 'CRASH_FLIP', visible: true },
{ bit: 20, name: 'CAM_CONNECTION_OPEN', visible: true },
{ bit: 21, name: 'CAM_CONNECTION_CLOSE', visible: true }
{ bit: 21, name: 'CAM_CONNECTION_CLOSE', visible: true },
);
}
if (semver.gte(config.apiVersion, API_VERSION_1_39)) {
beepers.push(
{ bit: 22, name: 'RC_SMOOTHING_INIT_FAIL', visible: true }
{ bit: 22, name: 'RC_SMOOTHING_INIT_FAIL', visible: true },
);
}

View File

@ -276,7 +276,7 @@ CliAutoComplete._initTextcomplete = function() {
}, 0);
}
},
}
},
)
.on('textComplete:show', function() {
/**

View File

@ -10,7 +10,7 @@ const Clipboard = {
readAvailable : null,
writeAvailable : null,
writeText : null,
readText : null
readText : null,
};
Clipboard._configureClipboardAsNwJs = function(nwGui) {

View File

@ -11,7 +11,7 @@ function seek(firmware, address) {
for (; index < firmware.data.length && address >= firmware.data[index].address + firmware.data[index].bytes; index++);
const result = {
lineIndex: index
lineIndex: index,
};
if (firmware.data[index] && address >= firmware.data[index].address) {
@ -67,7 +67,7 @@ function generateData(firmware, input, startAddress) {
const line = {
address: address,
bytes: BLOCK_SIZE > remaining ? remaining : BLOCK_SIZE,
data: []
data: [],
};
if (firmware.data[index.lineIndex] && (line.address + line.bytes) > firmware.data[index.lineIndex].address) {

View File

@ -38,5 +38,5 @@ const ConfigStorage = {
tmpObj[element] = input[element];
window.localStorage.setItem(element, JSON.stringify(tmpObj));
});
}
},
};

View File

@ -18,59 +18,59 @@ const Features = function (config) {
{bit: 14, group: 'rxMode', mode: 'select', name: 'RX_MSP'},
{bit: 15, group: 'rssi', name: 'RSSI_ADC'},
{bit: 16, group: 'other', name: 'LED_STRIP'},
{bit: 17, group: 'other', name: 'DISPLAY', haveTip: true}
{bit: 17, group: 'other', name: 'DISPLAY', haveTip: true},
];
if (!semver.gte(config.apiVersion, API_VERSION_1_33)) {
features.push(
{bit: 19, group: 'other', name: 'BLACKBOX', haveTip: true}
{bit: 19, group: 'other', name: 'BLACKBOX', haveTip: true},
);
}
if (semver.gte(config.apiVersion, "1.12.0")) {
features.push(
{bit: 20, group: 'other', name: 'CHANNEL_FORWARDING'}
{bit: 20, group: 'other', name: 'CHANNEL_FORWARDING'},
);
}
if (semver.gte(FC.CONFIG.apiVersion, "1.15.0") && !semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_36)) {
features.push(
{bit: 8, group: 'rxFailsafe', name: 'FAILSAFE', haveTip: true}
{bit: 8, group: 'rxFailsafe', name: 'FAILSAFE', haveTip: true},
);
}
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
features.push(
{bit: 21, group: 'other', name: 'TRANSPONDER', haveTip: true}
{bit: 21, group: 'other', name: 'TRANSPONDER', haveTip: true},
);
}
if (config.flightControllerVersion !== '') {
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
features.push(
{bit: 22, group: 'other', name: 'AIRMODE'}
{bit: 22, group: 'other', name: 'AIRMODE'},
);
}
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
if (semver.lt(FC.CONFIG.apiVersion, "1.20.0")) {
features.push(
{bit: 23, group: 'superexpoRates', name: 'SUPEREXPO_RATES'}
{bit: 23, group: 'superexpoRates', name: 'SUPEREXPO_RATES'},
);
} else if (!semver.gte(config.apiVersion, API_VERSION_1_33)) {
features.push(
{bit: 23, group: 'other', name: 'SDCARD'}
{bit: 23, group: 'other', name: 'SDCARD'},
);
}
}
if (semver.gte(FC.CONFIG.apiVersion, "1.20.0")) {
features.push(
{bit: 18, group: 'other', name: 'OSD'}
{bit: 18, group: 'other', name: 'OSD'},
);
if (!semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_35)) {
features.push(
{bit: 24, group: 'other', name: 'VTX'}
{bit: 24, group: 'other', name: 'VTX'},
);
}
}
@ -78,17 +78,17 @@ const Features = function (config) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_31)) {
features.push(
{bit: 25, group: 'rxMode', mode: 'select', name: 'RX_SPI'},
{bit: 27, group: 'escSensor', name: 'ESC_SENSOR'}
{bit: 27, group: 'escSensor', name: 'ESC_SENSOR'},
);
}
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_36)) {
features.push(
{bit: 28, group: 'antiGravity', name: 'ANTI_GRAVITY', haveTip: true, hideName: true}
{bit: 28, group: 'antiGravity', name: 'ANTI_GRAVITY', haveTip: true, hideName: true},
);
if (semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_44)) { // DYNAMIC_FILTER got removed from FEATURES in BF 4.3 / API 1.44
features.push(
{bit: 29, group: 'other', name: 'DYNAMIC_FILTER'}
{bit: 29, group: 'other', name: 'DYNAMIC_FILTER'},
);
}
}
@ -96,7 +96,7 @@ const Features = function (config) {
if (!semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_36)) {
features.push(
{bit: 1, group: 'batteryVoltage', name: 'VBAT'},
{bit: 11, group: 'batteryCurrent', name: 'CURRENT_METER'}
{bit: 11, group: 'batteryCurrent', name: 'CURRENT_METER'},
);
}
}

View File

@ -268,7 +268,7 @@ LogoManager.replaceLogoInFont = function (img) {
x * this.font.constants.SIZES.CHAR_WIDTH,
y * this.font.constants.SIZES.CHAR_HEIGHT,
this.font.constants.SIZES.CHAR_WIDTH,
this.font.constants.SIZES.CHAR_HEIGHT
this.font.constants.SIZES.CHAR_HEIGHT,
),
newChar = imageToCharacter.apply(this, [imageData.data]);
replaceChar.apply(this, [newChar, charAddr]);

View File

@ -24,7 +24,7 @@ function configuration_backup(callback) {
MSPCodes.MSP_ACC_TRIM,
MSPCodes.MSP_SERVO_CONFIGURATIONS,
MSPCodes.MSP_MODE_RANGES,
MSPCodes.MSP_ADJUSTMENT_RANGES
MSPCodes.MSP_ADJUSTMENT_RANGES,
];
function update_profile_specific_data_list() {
@ -71,7 +71,7 @@ function configuration_backup(callback) {
'ServoConfig': jQuery.extend(true, [], FC.SERVO_CONFIG),
'ServoRules': jQuery.extend(true, [], FC.SERVO_RULES),
'ModeRanges': jQuery.extend(true, [], FC.MODE_RANGES),
'AdjustmentRanges': jQuery.extend(true, [], FC.ADJUSTMENT_RANGES)
'AdjustmentRanges': jQuery.extend(true, [], FC.ADJUSTMENT_RANGES),
});
if (semver.gte(FC.CONFIG.apiVersion, "1.15.0")) {
@ -96,7 +96,7 @@ function configuration_backup(callback) {
MSPCodes.MSP_RX_MAP,
MSPCodes.MSP_CF_SERIAL_CONFIG,
MSPCodes.MSP_LED_STRIP_CONFIG,
MSPCodes.MSP_LED_COLORS
MSPCodes.MSP_LED_COLORS,
];
function update_unique_data_list() {
@ -211,7 +211,7 @@ function configuration_backup(callback) {
const filename = generateFilename(prefix, suffix);
const accepts = [{
description: suffix.toUpperCase() + ' files', extensions: [suffix]
description: suffix.toUpperCase() + ' files', extensions: [suffix],
}];
// create or load the file
@ -282,7 +282,7 @@ function configuration_restore(callback) {
let chosenFileEntry = null;
const accepts = [{
description: 'JSON files', extensions: ['json']
description: 'JSON files', extensions: ['json'],
}];
// load up the file
@ -396,7 +396,7 @@ function configuration_restore(callback) {
if (!configuration.PIDs && configuration.PID) {
configuration.PIDs = configuration.PID;
configuration.PID = {
controller: 0 // assume pid controller 0 was used.
controller: 0, // assume pid controller 0 was used.
};
}
@ -484,7 +484,7 @@ function configuration_restore(callback) {
ports.push(newPort);
}
configuration.SERIAL_CONFIG = {
ports: ports
ports: ports,
};
GUI.log(i18n.getMessage('configMigratedTo', [migratedVersion]));
@ -496,14 +496,14 @@ function configuration_restore(callback) {
if (configuration.FC_CONFIG == undefined) {
configuration.FC_CONFIG = {
loopTime: 3500
loopTime: 3500,
};
}
if (configuration.ARMING_CONFIG == undefined) {
configuration.ARMING_CONFIG = {
auto_disarm_delay: 5,
disarm_kill_switch: 1
disarm_kill_switch: 1,
};
}
@ -578,7 +578,7 @@ function configuration_restore(callback) {
deadband3d_low: 1406,
deadband3d_high: 1514,
neutral: 1460,
deadband3d_throttle: 50
deadband3d_throttle: 50,
};
}
@ -603,7 +603,7 @@ function configuration_restore(callback) {
configuration.SENSOR_ALIGNMENT = {
align_gyro: 0,
align_acc: 0,
align_mag: 0
align_mag: 0,
};
}
@ -617,7 +617,7 @@ function configuration_restore(callback) {
stick_min: 1100,
stick_max: 1900,
rx_min_usec: 885,
rx_max_usec: 2115
rx_max_usec: 2115,
};
}
@ -628,7 +628,7 @@ function configuration_restore(callback) {
failsafe_throttle: 1000,
failsafe_switch_mode: 0,
failsafe_throttle_low_delay: 100,
failsafe_procedure: 0
failsafe_procedure: 0,
};
}
@ -637,13 +637,13 @@ function configuration_restore(callback) {
{mode: 0, value: 1500},
{mode: 0, value: 1500},
{mode: 0, value: 1500},
{mode: 0, value: 875}
{mode: 0, value: 875},
];
for (let i = 0; i < 14; i++) {
const rxfailChannel = {
mode: 1,
value: 1500
value: 1500,
};
configuration.RXFAIL_CONFIG.push(rxfailChannel);
}
@ -698,7 +698,7 @@ function configuration_restore(callback) {
MSPCodes.MSP_SET_PID_CONTROLLER,
MSPCodes.MSP_SET_PID,
MSPCodes.MSP_SET_RC_TUNING,
MSPCodes.MSP_SET_ACC_TRIM
MSPCodes.MSP_SET_ACC_TRIM,
];
if (semver.gte(FC.CONFIG.apiVersion, "1.15.0")) {
@ -772,7 +772,7 @@ function configuration_restore(callback) {
const defaultModeRangeExtra = {
modeId: FC.MODE_RANGES[modeIndex].modeId,
modeLogic: 0,
linkedTo: 0
linkedTo: 0,
};
FC.MODE_RANGES_EXTRA.push(defaultModeRangeExtra);
}
@ -797,7 +797,7 @@ function configuration_restore(callback) {
const uniqueData = [
MSPCodes.MSP_SET_RX_MAP,
MSPCodes.MSP_SET_CF_SERIAL_CONFIG
MSPCodes.MSP_SET_CF_SERIAL_CONFIG,
];
function update_unique_data_list() {

View File

@ -78,7 +78,7 @@ const BOARD_DEFINITIONS = [
];
const DEFAULT_BOARD_DEFINITION = {
name: "Unknown", identifier: "????", vcp: false
name: "Unknown", identifier: "????", vcp: false,
};
const BOARD = {};

View File

@ -94,7 +94,7 @@ JenkinsLoader.prototype.loadBuilds = function (jobName, callback) {
number: build.number,
artifacts: build.artifacts.map(artifact => artifact.relativePath),
changes: build.changeSet.items.map(item => `* ${item.msg}`).join('<br>\n'),
timestamp: build.timestamp
timestamp: build.timestamp,
}));
// cache loaded info
@ -148,7 +148,7 @@ JenkinsLoader.prototype._parseBuilds = function (jobUrl, jobName, builds, callba
'file' : relativePath.split('/').slice(-1)[0],
'target' : target,
'date' : formattedDate,
'notes' : build.changes
'notes' : build.changes,
};
if (targetBuilds[target]) {

View File

@ -45,7 +45,7 @@ function appReady() {
function checkSetupAnalytics(callback) {
if (!analytics) {
setTimeout(function () {
ConfigStorage.get(['userId', 'analyticsOptOut', 'checkForConfiguratorUnstableVersions', ], function (result) {
ConfigStorage.get(['userId', 'analyticsOptOut', 'checkForConfiguratorUnstableVersions' ], function (result) {
if (!analytics) {
setupAnalytics(result);
}
@ -200,7 +200,7 @@ function startProcess() {
}
},
i18n.getMessage('cordovaExitAppTitle'),
[i18n.getMessage('yes'),i18n.getMessage('no')]
[i18n.getMessage('yes'),i18n.getMessage('no')],
);
});
}
@ -305,27 +305,27 @@ function startProcess() {
switch (tab) {
case 'landing':
import("./tabs/landing").then(({ landing }) =>
landing.initialize(content_ready)
landing.initialize(content_ready),
);
break;
case 'changelog':
import("./tabs/static_tab").then(({ staticTab }) =>
staticTab.initialize("changelog", content_ready)
staticTab.initialize("changelog", content_ready),
);
break;
case 'privacy_policy':
import("./tabs/static_tab").then(({ staticTab }) =>
staticTab.initialize("privacy_policy", content_ready)
staticTab.initialize("privacy_policy", content_ready),
);
break;
case 'options':
import("./tabs/options").then(({ options }) =>
options.initialize(content_ready)
options.initialize(content_ready),
);
break;
case 'firmware_flasher':
import("./tabs/firmware_flasher").then(({ firmware_flasher }) =>
firmware_flasher.initialize(content_ready)
firmware_flasher.initialize(content_ready),
);
break;
case 'help':

View File

@ -389,5 +389,5 @@ const MSP = {
this.packet_error = 0; // reset CRC packet error counter for next session
this.callbacks_cleanup();
}
},
};

View File

@ -34,5 +34,5 @@ const PortUsage = {
this.port_usage_down = 0;
this.port_usage_up = 0;
}
},
};

View File

@ -26,7 +26,7 @@ const STM32_protocol = function () {
this.status = {
ACK: 0x79, // y
NACK: 0x1F
NACK: 0x1F,
};
this.command = {
@ -41,7 +41,7 @@ const STM32_protocol = function () {
write_protect: 0x63, // Enables the write protection for some sectors
write_unprotect: 0x73, // Disables the write protection for all Flash memory sectors
readout_protect: 0x82, // Enables the read protection
readout_unprotect: 0x92 // Disables the read protection
readout_unprotect: 0x92, // Disables the read protection
};
// Erase (x043) and Extended Erase (0x44) are exclusive. A device may support either the Erase command or the Extended Erase command but not both.
@ -63,7 +63,7 @@ STM32_protocol.prototype.connect = function (port, baud, hex, options, callback)
self.options = {
no_reboot: false,
reboot_baud: false,
erase_chip: false
erase_chip: false,
};
if (options.no_reboot) {

View File

@ -26,7 +26,7 @@ var STM32DFU_protocol = function () {
GETSTATUS: 0x03, // IN, Requests device to send status report to the Host (including status resulting from the last request execution and the state the device will enter immediately after this request).
CLRSTATUS: 0x04, // OUT, Requests device to clear error status and move to next step
GETSTATE: 0x05, // IN, Requests the device to send only the state it will enter immediately after this request.
ABORT: 0x06 // OUT, Requests device to exit the current state/operation and enter idle state immediately.
ABORT: 0x06, // OUT, Requests device to exit the current state/operation and enter idle state immediately.
};
this.status = {
@ -45,7 +45,7 @@ var STM32DFU_protocol = function () {
errUSBR: 0x0C, // Device detected unexpected USB reset signaling.
errPOR: 0x0D, // Device detected unexpected power on reset.
errUNKNOWN: 0x0E, // Something went wrong, but the device does not know what it was.
errSTALLEDPKT: 0x0F // Device stalled an unexpected request.
errSTALLEDPKT: 0x0F, // Device stalled an unexpected request.
};
this.state = {
@ -59,7 +59,7 @@ var STM32DFU_protocol = function () {
dfuMANIFEST: 7, // Device is in the Manifestation phase. (Not all devices will be able to respond to DFU_GETSTATUS when in this state.)
dfuMANIFEST_WAIT_RESET: 8, // Device has programmed its memories and is waiting for a USB reset or a power on reset. (Devices that must enter this state clear bitManifestationTolerant to 0.)
dfuUPLOAD_IDLE: 9, // The device is processing an upload operation. Expecting DFU_UPLOAD requests.
dfuERROR: 10 // An error has occurred. Awaiting the DFU_CLRSTATUS request.
dfuERROR: 10, // An error has occurred. Awaiting the DFU_CLRSTATUS request.
};
this.chipInfo = null; // information about chip's memory
@ -189,7 +189,7 @@ STM32DFU_protocol.prototype.getString = function (index, callback) {
'request': 6,
'value': 0x300 | index,
'index': 0, // specifies language
'length': 255 // max length to retreive
'length': 255, // max length to retreive
}, function (result) {
if (checkChromeRuntimeError()) {
console.log('USB getString failed! ' + result.resultCode);
@ -258,7 +258,7 @@ STM32DFU_protocol.prototype.getInterfaceDescriptor = function (_interface, callb
'request': 6,
'value': 0x200,
'index': 0,
'length': 18 + _interface * 9
'length': 18 + _interface * 9,
}, function (result) {
if (checkChromeRuntimeError()) {
console.log('USB getInterfaceDescriptor failed! ' + result.resultCode);
@ -276,7 +276,7 @@ STM32DFU_protocol.prototype.getInterfaceDescriptor = function (_interface, callb
'bInterfaceClass': buf[5],
'bInterfaceSubclass': buf[6],
'bInterfaceProtocol': buf[7],
'iInterface': buf[8]
'iInterface': buf[8],
};
callback(descriptor, result.resultCode);
@ -292,7 +292,7 @@ STM32DFU_protocol.prototype.getFunctionalDescriptor = function (_interface, call
'request': 6,
'value': 0x2100,
'index': 0,
'length': 255
'length': 255,
}, function (result) {
if (checkChromeRuntimeError()) {
console.log('USB getFunctionalDescriptor failed! ' + result.resultCode);
@ -308,7 +308,7 @@ STM32DFU_protocol.prototype.getFunctionalDescriptor = function (_interface, call
'bmAttributes': buf[2],
'wDetachTimeOut': (buf[4] << 8)|buf[3],
'wTransferSize': (buf[6] << 8)|buf[5],
'bcdDFUVersion': buf[7]
'bcdDFUVersion': buf[7],
};
callback(descriptor, result.resultCode);
@ -397,7 +397,7 @@ STM32DFU_protocol.prototype.getChipInfo = function (_interface, callback) {
'num_pages' : num_pages,
'start_address': start_address + total_size,
'page_size' : page_size,
'total_size' : num_pages * page_size
'total_size' : num_pages * page_size,
});
total_size += num_pages * page_size;
@ -407,7 +407,7 @@ STM32DFU_protocol.prototype.getChipInfo = function (_interface, callback) {
'type' : type,
'start_address': start_address,
'sectors' : sectors,
'total_size' : total_size
'total_size' : total_size,
};
return memory;
};
@ -440,7 +440,7 @@ STM32DFU_protocol.prototype.controlTransfer = function (direction, request, valu
'value': value,
'index': _interface,
'length': length,
'timeout': timeout
'timeout': timeout,
}, function (result) {
if (checkChromeRuntimeError()) {
console.log('USB controlTransfer IN failed for request ' + request + '!');
@ -468,7 +468,7 @@ STM32DFU_protocol.prototype.controlTransfer = function (direction, request, valu
'value': value,
'index': _interface,
'data': arrayBuf,
'timeout': timeout
'timeout': timeout,
}, function (result) {
if (checkChromeRuntimeError()) {
console.log('USB controlTransfer OUT failed for request ' + request + '!');

View File

@ -391,7 +391,7 @@ const serial = {
break;
}
}
}
},
},
onReceiveError: {
listeners: [],
@ -411,7 +411,7 @@ const serial = {
break;
}
}
}
},
},
emptyOutputBuffer: function () {
this.outputBuffer = [];

View File

@ -695,7 +695,7 @@ function update_live_status() {
const statuswrapper = $('#quad-status_wrapper');
$(".quad-status-contents").css({
display: 'inline-block'
display: 'inline-block',
});
if (GUI.active_tab !== 'cli' && GUI.active_tab !== 'presets') {
@ -806,25 +806,25 @@ function update_dataflash_global() {
if (supportsDataflash){
$(".noflash_global").css({
display: 'none'
display: 'none',
});
$(".dataflash-contents_global").css({
display: 'block'
display: 'block',
});
$(".dataflash-free_global").css({
width: (100-(FC.DATAFLASH.totalSize - FC.DATAFLASH.usedSize) / FC.DATAFLASH.totalSize * 100) + "%",
display: 'block'
display: 'block',
});
$(".dataflash-free_global div").text('Dataflash: free ' + formatFilesize(FC.DATAFLASH.totalSize - FC.DATAFLASH.usedSize));
} else {
$(".noflash_global").css({
display: 'block'
display: 'block',
});
$(".dataflash-contents_global").css({
display: 'none'
display: 'none',
});
}
}

View File

@ -88,7 +88,7 @@ TABS.adjustments.initialize = function (callback) {
const channel_range = {
'min': [ 900 ],
'max': [ 2100 ]
'max': [ 2100 ],
};
let rangeValues = [1300, 1700];
@ -106,8 +106,8 @@ TABS.adjustments.initialize = function (callback) {
connect: true,
range: channel_range,
format: wNumb({
decimals: 0
})
decimals: 0,
}),
});
$(newAdjustment).find('.channel-slider').Link('lower').to($(newAdjustment).find('.lowerLimitValue'));
@ -117,7 +117,7 @@ TABS.adjustments.initialize = function (callback) {
mode: 'values',
values: [900, 1000, 1200, 1400, 1500, 1600, 1800, 2000, 2100],
density: 4,
stepped: true
stepped: true,
});
//
@ -187,10 +187,10 @@ TABS.adjustments.initialize = function (callback) {
auxChannelIndex: 0,
range: {
start: 900,
end: 900
end: 900,
},
adjustmentFunction: 0,
auxSwitchChannelIndex: 0
auxSwitchChannelIndex: 0,
};
$('.tab-adjustments .adjustments .adjustment').each(function () {
@ -208,10 +208,10 @@ TABS.adjustments.initialize = function (callback) {
auxChannelIndex: parseInt($(this).find('.channelInfo .channel').val()),
range: {
start: rangeValues[0],
end: rangeValues[1]
end: rangeValues[1],
},
adjustmentFunction: parseInt($(this).find('.functionSelection .function').val()),
auxSwitchChannelIndex: parseInt($(this).find('.functionSwitchChannel .channel').val())
auxSwitchChannelIndex: parseInt($(this).find('.functionSwitchChannel .channel').val()),
};
FC.ADJUSTMENT_RANGES.push(adjustmentRange);
} else {

View File

@ -140,7 +140,7 @@ TABS.auxiliary.initialize = function (callback) {
const channel_range = {
'min': [ 900 ],
'max': [ 2100 ]
'max': [ 2100 ],
};
let rangeValues = [1300, 1700]; // matches MultiWii default values for the old checkbox MID range.
@ -169,7 +169,7 @@ TABS.auxiliary.initialize = function (callback) {
range: channel_range,
format: wNumb({
decimals: 0,
})
}),
});
const elementName = '#mode-' + modeIndex + '-range-' + rangeIndex;
@ -184,7 +184,7 @@ TABS.auxiliary.initialize = function (callback) {
mode: 'values',
values: sliderValues,
density: 4,
stepped: true
stepped: true,
});
$(rangeElement).find('.deleteRange').data('rangeElement', rangeElement);
@ -269,7 +269,7 @@ TABS.auxiliary.initialize = function (callback) {
let modeRangeExtra = {
id: modeRange.id,
modeLogic: 0,
linkedTo: 0
linkedTo: 0,
};
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_41)) {
modeRangeExtra = FC.MODE_RANGES_EXTRA[modeRangeIndex];
@ -333,15 +333,15 @@ TABS.auxiliary.initialize = function (callback) {
auxChannelIndex: parseInt($(this).find('.channel').val()),
range: {
start: rangeValues[0],
end: rangeValues[1]
}
end: rangeValues[1],
},
};
FC.MODE_RANGES.push(modeRange);
const modeRangeExtra = {
id: modeId,
modeLogic: parseInt($(this).find('.logic').val()),
linkedTo: 0
linkedTo: 0,
};
FC.MODE_RANGES_EXTRA.push(modeRangeExtra);
});
@ -357,15 +357,15 @@ TABS.auxiliary.initialize = function (callback) {
auxChannelIndex: 0,
range: {
start: 900,
end: 900
}
end: 900,
},
};
FC.MODE_RANGES.push(modeRange);
const modeRangeExtra = {
id: modeId,
modeLogic: parseInt($(this).find('.logic').val()),
linkedTo: linkedToSelection
linkedTo: linkedToSelection,
};
FC.MODE_RANGES_EXTRA.push(modeRangeExtra);
}
@ -378,15 +378,15 @@ TABS.auxiliary.initialize = function (callback) {
auxChannelIndex: 0,
range: {
start: 900,
end: 900
}
end: 900,
},
};
FC.MODE_RANGES.push(defaultModeRange);
const defaultModeRangeExtra = {
id: 0,
modeLogic: 0,
linkedTo: 0
linkedTo: 0,
};
FC.MODE_RANGES_EXTRA.push(defaultModeRangeExtra);
}

View File

@ -127,7 +127,7 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
i18n.getMessage('controlAxisRoll'),
i18n.getMessage('controlAxisPitch'),
i18n.getMessage('controlAxisYaw'),
i18n.getMessage('controlAxisThrottle')
i18n.getMessage('controlAxisThrottle'),
],
fullChannels_e = $('div.activechannellist');
let aux_index = 1,

View File

@ -214,7 +214,7 @@ firmware_flasher.initialize = function (callback) {
"file" : asset.name,
"target" : target,
"date" : formattedDate,
"notes" : release.body
"notes" : release.body,
};
releases[target].push(descriptor);
});
@ -323,24 +323,24 @@ firmware_flasher.initialize = function (callback) {
const buildTypes = [
{
tag: 'firmwareFlasherOptionLabelBuildTypeRelease',
loader: () => self.releaseChecker.loadReleaseData(releaseData => processBoardOptions(releaseData, false))
loader: () => self.releaseChecker.loadReleaseData(releaseData => processBoardOptions(releaseData, false)),
},
{
tag: 'firmwareFlasherOptionLabelBuildTypeReleaseCandidate',
loader: () => self.releaseChecker.loadReleaseData(releaseData => processBoardOptions(releaseData, true))
}
loader: () => self.releaseChecker.loadReleaseData(releaseData => processBoardOptions(releaseData, true)),
},
];
const ciBuildsTypes = self.jenkinsLoader._jobs.map(job => {
if (job.title === "Development") {
return {
tag: "firmwareFlasherOptionLabelBuildTypeDevelopment",
loader: () => self.jenkinsLoader.loadBuilds(job.name, loadUnifiedBuilds)
loader: () => self.jenkinsLoader.loadBuilds(job.name, loadUnifiedBuilds),
};
}
return {
title: job.title,
loader: () => self.jenkinsLoader.loadBuilds(job.name, loadUnifiedBuilds)
loader: () => self.jenkinsLoader.loadBuilds(job.name, loadUnifiedBuilds),
};
});
@ -353,8 +353,8 @@ firmware_flasher.initialize = function (callback) {
$(
`<option value='${index}'>${
tag ? i18n.getMessage(tag) : title
}</option>`
)
}</option>`,
),
);
});
buildType_e.val($('select[name="build_type"] option:first').val());
@ -460,9 +460,9 @@ firmware_flasher.initialize = function (callback) {
versions_element.append(
$(
`<option value='0'>${i18n.getMessage(
"firmwareFlasherOptionLabelSelectFirmwareVersionFor"
)} ${target}</option>`
)
"firmwareFlasherOptionLabelSelectFirmwareVersionFor",
)} ${target}</option>`,
),
);
targetVersions
.sort(sortVersions)
@ -580,9 +580,9 @@ firmware_flasher.initialize = function (callback) {
versions_e.append(
$(
`<option value='0'>${i18n.getMessage(
"firmwareFlasherOptionLabelSelectFirmwareVersion"
)}</option>`
)
"firmwareFlasherOptionLabelSelectFirmwareVersion",
)}</option>`,
),
);
} else {
// Show a loading message as there is a delay in loading a configuration
@ -590,9 +590,9 @@ firmware_flasher.initialize = function (callback) {
versions_e.append(
$(
`<option value='0'>${i18n.getMessage(
"firmwareFlasherOptionLoading"
)}</option>`
)
"firmwareFlasherOptionLoading",
)}</option>`,
),
);
const builds = [];
@ -967,9 +967,9 @@ firmware_flasher.initialize = function (callback) {
accepts: [
{
description: 'target files',
extensions: ['hex', 'config']
}
]
extensions: ['hex', 'config'],
},
],
}, function (fileEntry) {
if (checkChromeRuntimeError()) {
return;

View File

@ -123,7 +123,7 @@ TABS.gps.initialize = function (callback) {
const message = {
action: 'center',
lat: lat,
lon: lon
lon: lon,
};
frame = document.getElementById('map');
@ -190,7 +190,7 @@ TABS.gps.initialize = function (callback) {
$('#zoom_in').click(function() {
console.log('zoom in');
const message = {
action: 'zoom_in'
action: 'zoom_in',
};
frame.contentWindow.postMessage(message, '*');
});
@ -198,7 +198,7 @@ TABS.gps.initialize = function (callback) {
$('#zoom_out').click(function() {
console.log('zoom out');
const message = {
action: 'zoom_out'
action: 'zoom_out',
};
frame.contentWindow.postMessage(message, '*');
});

View File

@ -54,5 +54,5 @@ landing.cleanup = function (callback) {
// TODO: remove after all is using modules
window.TABS.landing = landing;
export {
landing
landing,
};

View File

@ -2,7 +2,7 @@
TABS.led_strip = {
wireMode: false,
directions: ['n', 'e', 's', 'w', 'u', 'd']
directions: ['n', 'e', 's', 'w', 'u', 'd'],
};
@ -288,7 +288,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
if (!colorDefineSliders.is(":hover")) {
colorDefineSliders.hide();
}
}
},
});
$('.funcWire').click(function() {
@ -422,7 +422,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
directionsInSelection.forEach(function(direction_e) {
$(direction_e).addClass('btnOn');
});
}
},
});
// UI: select LED function from drop-down
@ -691,7 +691,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
x: 0,
y: 0,
directions: '',
functions: ''
functions: '',
};
for (let i = 0; i < ledStripLength; i++) {

View File

@ -19,55 +19,55 @@ function initializeMap() {
mapView = new ol.View({
center: lonLat,
zoom: DEFAULT_ZOOM
zoom: DEFAULT_ZOOM,
});
map = new ol.Map({
target: 'map-canvas',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
source: new ol.source.OSM(),
}),
],
view: mapView,
controls: []
controls: [],
});
const icon = new ol.style.Icon(({
anchor: [0.5, 1],
opacity: 1,
scale: 0.5,
src: ICON_IMAGE
src: ICON_IMAGE,
}));
const iconNoFix = new ol.style.Icon(({
anchor: [0.5, 1],
opacity: 1,
scale: 0.5,
src: ICON_IMAGE_NOFIX
src: ICON_IMAGE_NOFIX,
}));
iconStyle = new ol.style.Style({
image: icon
image: icon,
});
iconStyleNoFix = new ol.style.Style({
image: iconNoFix
image: iconNoFix,
});
iconGeometry = new ol.geom.Point(lonLat);
iconFeature = new ol.Feature({
geometry: iconGeometry
geometry: iconGeometry,
});
iconFeature.setStyle(iconStyle);
const vectorSource = new ol.source.Vector({
features: [iconFeature]
features: [iconFeature],
});
const currentPositionLayer = new ol.layer.Vector({
source: vectorSource
source: vectorSource,
});
map.addLayer(currentPositionLayer);

View File

@ -418,7 +418,7 @@ TABS.motors.initialize = function (callback) {
x: [],
y: [],
z: [],
rms: []
rms: [],
};
$('.plot_control .x, .plot_control .y, .plot_control .z, .plot_control .rms').each(function () {
@ -529,7 +529,7 @@ TABS.motors.initialize = function (callback) {
const gyro = [
FC.SENSOR_DATA.gyroscope[0],
FC.SENSOR_DATA.gyroscope[1],
FC.SENSOR_DATA.gyroscope[2]
FC.SENSOR_DATA.gyroscope[2],
];
updateGraphHelperSize(gyroHelpers);

View File

@ -8,7 +8,7 @@ TABS.onboard_logging = {
BLOCK_SIZE: 4096,
VCP_BLOCK_SIZE_3_0: 512,
VCP_BLOCK_SIZE: 4096
VCP_BLOCK_SIZE: 4096,
};
TABS.onboard_logging.initialize = function (callback) {
const self = this;
@ -251,7 +251,7 @@ TABS.onboard_logging.initialize = function (callback) {
{num: 1, denom: 7},
{num: 1, denom: 8},
{num: 1, denom: 16},
{num: 1, denom: 32}
{num: 1, denom: 32},
];
@ -406,13 +406,13 @@ TABS.onboard_logging.initialize = function (callback) {
if (value > 0) {
bar.css({
width: (value / total * 100) + "%",
display: 'block'
display: 'block',
});
$("div", bar).text((label ? label + " " : "") + (valuesAreKilobytes ? formatFilesizeKilobytes(value) : formatFilesizeBytes(value)));
} else {
bar.css({
display: 'none'
display: 'none',
});
}
}

View File

@ -2569,7 +2569,7 @@ TABS.osd.initialize = function(callback) {
.append($(`<input name="video_system" type="radio"/>${videoFormatOptionText}</label>`)
.prop('checked', i === OSD.data.video_system)
.data('type', type)
.data('type', i)
.data('type', i),
);
$videoTypes.append($checkbox);
}
@ -2592,7 +2592,7 @@ TABS.osd.initialize = function(callback) {
.append($(`<input name="unit_mode" type="radio"/>${setupUnitOptionText}</label>`)
.prop('checked', i === OSD.data.unit_mode)
.data('type', type)
.data('type', i)
.data('type', i),
);
$unitMode.append($checkbox);
}
@ -2739,7 +2739,7 @@ TABS.osd.initialize = function(callback) {
.then(function() {
updateOsdView();
});
})
}),
);
$field.append(`<label for="${field.name}" class="char-label">${titleizeField(field)}</label>`);
@ -2783,7 +2783,7 @@ TABS.osd.initialize = function(callback) {
.then(function() {
updateOsdView();
});
})
}),
);
const finalFieldName = titleizeField(field);
@ -2912,7 +2912,7 @@ TABS.osd.initialize = function(callback) {
.then(function() {
updateOsdView();
});
})
}),
);
}
@ -2957,7 +2957,7 @@ TABS.osd.initialize = function(callback) {
.then(function() {
updateOsdView();
});
}))
})),
);
}

View File

@ -1453,7 +1453,7 @@ TABS.pid_tuning.initialize = function (callback) {
yawDeadband: FC.RC_DEADBAND_CONFIG.yaw_deadband,
roll_rate_limit: FC.RC_TUNING.roll_rate_limit,
pitch_rate_limit: FC.RC_TUNING.pitch_rate_limit,
yaw_rate_limit: FC.RC_TUNING.yaw_rate_limit
yaw_rate_limit: FC.RC_TUNING.yaw_rate_limit,
};
if (semver.lt(FC.CONFIG.apiVersion, "1.7.0")) {
@ -1764,18 +1764,18 @@ TABS.pid_tuning.initialize = function (callback) {
{name: "LuxFloat"},
{name: "MultiWii (2.3 - latest)"},
{name: "MultiWii (2.3 - hybrid)"},
{name: "Harakiri"}
{name: "Harakiri"},
];
} else if (semver.lt(FC.CONFIG.apiVersion, "1.20.0")) {
pidControllerList = [
{name: ""},
{name: "Integer"},
{name: "Float"}
{name: "Float"},
];
} else {
pidControllerList = [
{name: "Legacy"},
{name: "Betaflight"}
{name: "Betaflight"},
];
}
@ -2852,7 +2852,7 @@ TABS.pid_tuning.updateRatesLabels = function() {
const BALLOON_COLORS = {
roll : {color: 'rgba(255,128,128,0.4)', border: 'rgba(255,128,128,0.6)', text: '#000000'},
pitch : {color: 'rgba(128,255,128,0.4)', border: 'rgba(128,255,128,0.6)', text: '#000000'},
yaw : {color: 'rgba(128,128,255,0.4)', border: 'rgba(128,128,255,0.6)', text: '#000000'}
yaw : {color: 'rgba(128,128,255,0.4)', border: 'rgba(128,128,255,0.6)', text: '#000000'},
};
const rcStickElement = $('.rate_curve canvas#rate_curve_layer1').get(0);

View File

@ -76,7 +76,7 @@ TABS.power.initialize = function (callback) {
voltageDataSource[index] = {
vbatscale: parseInt($(`input[name="vbatscale-${index}"]`).val()),
vbatresdivval: parseInt($(`input[name="vbatresdivval-${index}"]`).val()),
vbatresdivmultiplier: parseInt($(`input[name="vbatresdivmultiplier-${index}"]`).val())
vbatresdivmultiplier: parseInt($(`input[name="vbatresdivmultiplier-${index}"]`).val()),
};
}
}

View File

@ -109,7 +109,7 @@ TABS.receiver.initialize = function (callback) {
i18n.getMessage('controlAxisRoll'),
i18n.getMessage('controlAxisPitch'),
i18n.getMessage('controlAxisYaw'),
i18n.getMessage('controlAxisThrottle')
i18n.getMessage('controlAxisThrottle'),
];
const barContainer = $('.tab-receiver .bars');
@ -143,7 +143,7 @@ TABS.receiver.initialize = function (callback) {
// we could probably use min and max throttle for the range, will see
const meterScale = {
'min': 800,
'max': 2200
'max': 2200,
};
const meterFillArray = [];
@ -288,7 +288,7 @@ TABS.receiver.initialize = function (callback) {
'FRSKY_X',
'A7105_FLYSKY',
'A7105_FLYSKY_2A',
'NRF24_KN'
'NRF24_KN',
);
}
@ -296,20 +296,20 @@ TABS.receiver.initialize = function (callback) {
spiRxTypes.push(
'SFHSS',
'SPEKTRUM',
'FRSKY_X_LBT'
'FRSKY_X_LBT',
);
}
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_43)) {
spiRxTypes.push(
'REDPINE'
'REDPINE',
);
}
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
spiRxTypes.push(
'FRSKY_X_V2',
'FRSKY_X_LBT_V2'
'FRSKY_X_LBT_V2',
);
}
@ -514,9 +514,9 @@ TABS.receiver.initialize = function (callback) {
innerBounds: {
minWidth: windowWidth, minHeight: windowHeight,
width: windowWidth, height: windowHeight,
maxWidth: windowWidth, maxHeight: windowHeight
maxWidth: windowWidth, maxHeight: windowHeight,
},
alwaysOnTop: true
alwaysOnTop: true,
}, function(createdWindow) {
// Give the window a callback it can use to send the channels (otherwise it can't see those objects)
createdWindow.contentWindow.setRawRx = function(channels) {

View File

@ -52,7 +52,7 @@ const watchers = {
} else {
applyNormalTheme();
}
}
},
};
$(document).ready(function () {
@ -182,8 +182,8 @@ $(document).ready(function() {
start: initialValue,
range: {
min: CHANNEL_MIN_VALUE,
max: CHANNEL_MAX_VALUE
}
max: CHANNEL_MAX_VALUE,
},
}).on('slide change set', function(e, value) {
value = Math.round(parseFloat(value));

View File

@ -265,7 +265,7 @@ TABS.sensors.initialize = function (callback) {
initDataArray(1),
initDataArray(1),
initDataArray(1),
initDataArray(1)
initDataArray(1),
];
let gyroHelpers = initGraphHelpers('#gyro', samples_gyro_i, [-2000, 2000]);
@ -277,13 +277,13 @@ TABS.sensors.initialize = function (callback) {
initGraphHelpers('#debug1', samples_debug_i),
initGraphHelpers('#debug2', samples_debug_i),
initGraphHelpers('#debug3', samples_debug_i),
initGraphHelpers('#debug4', samples_debug_i)
initGraphHelpers('#debug4', samples_debug_i),
];
const raw_data_text_ements = {
x: [],
y: [],
z: []
z: [],
};
$('.plot_control .x, .plot_control .y, .plot_control .z').each(function () {
const el = $(this);
@ -305,13 +305,13 @@ TABS.sensors.initialize = function (callback) {
'mag': parseInt($('.tab-sensors select[name="mag_refresh_rate"]').val(), 10),
'altitude': parseInt($('.tab-sensors select[name="altitude_refresh_rate"]').val(), 10),
'sonar': parseInt($('.tab-sensors select[name="sonar_refresh_rate"]').val(), 10),
'debug': parseInt($('.tab-sensors select[name="debug_refresh_rate"]').val(), 10)
'debug': parseInt($('.tab-sensors select[name="debug_refresh_rate"]').val(), 10),
};
const scales = {
'gyro': parseFloat($('.tab-sensors select[name="gyro_scale"]').val()),
'accel': parseFloat($('.tab-sensors select[name="accel_scale"]').val()),
'mag': parseFloat($('.tab-sensors select[name="mag_scale"]').val())
'mag': parseFloat($('.tab-sensors select[name="mag_scale"]').val()),
};
// handling of "data pulling" is a little bit funky here, as MSP_RAW_IMU contains values for gyro/accel/mag but not altitude

View File

@ -1,7 +1,7 @@
'use strict';
TABS.setup = {
yaw_fix: 0.0
yaw_fix: 0.0,
};
TABS.setup.initialize = function (callback) {

View File

@ -2,7 +2,7 @@
TABS.transponder = {
available: false
available: false,
};
TABS.transponder.initialize = function(callback, scrollPosition) {
@ -18,10 +18,10 @@ TABS.transponder.initialize = function(callback, scrollPosition) {
// CONFIGURATION HERE FOR ADD NEW TRANSPONDER
let transponderConfigurations = {
0: {
dataType: dataTypes.NONE // empty
dataType: dataTypes.NONE, // empty
}, //NONE
1: {
dataType: dataTypes.TEXT //<input type="text">
dataType: dataTypes.TEXT, //<input type="text">
}, //ilap
2: {
dataType: dataTypes.LIST, // <select>...</select>
@ -35,7 +35,7 @@ TABS.transponder.initialize = function(callback, scrollPosition) {
'ID 7': 'E003F03F00FF03F0C1',
'ID 8': '00FC0FFE071F3E00FE',
'ID 9': 'E083BFF00F9E38C0FF',
}
},
}, //arcitimer
3: {
dataType: dataTypes.LIST, // <select>...</select>
@ -104,7 +104,7 @@ TABS.transponder.initialize = function(callback, scrollPosition) {
'61':'3D',
'62':'3E',
'63':'3F',
}
},
}, //ERLT
};
/////////////////////////////////////////////
@ -164,7 +164,7 @@ TABS.transponder.initialize = function(callback, scrollPosition) {
//build radio buttons
if (transponderProviders.length > 1) {
transponderTypeSelect.append(
$('<option>').attr('value', 0).html(i18n.getMessage("transponderType0")) // NONE
$('<option>').attr('value', 0).html(i18n.getMessage("transponderType0")), // NONE
);
}
@ -173,7 +173,7 @@ TABS.transponder.initialize = function(callback, scrollPosition) {
if ( transponderProvider.hasOwnProperty('id') ) {
transponderTypeSelect.append(
$('<option>').attr('value', transponderProvider.id).html(i18n.getMessage("transponderType" + transponderProvider.id))
$('<option>').attr('value', transponderProvider.id).html(i18n.getMessage("transponderType" + transponderProvider.id)),
);
}
}

View File

@ -14,7 +14,7 @@ TABS.vtx = {
env: new djv(),
get _DEVICE_STATUS_UPDATE_INTERVAL_NAME() {
return "vtx_device_status_request";
}
},
};
TABS.vtx.isVtxDeviceStatusNotReady = function()
@ -96,7 +96,7 @@ TABS.vtx.initialize = function (callback) {
GUI.interval_add_condition(self._DEVICE_STATUS_UPDATE_INTERVAL_NAME,
TABS.vtx.updateVtxDeviceStatus,
1000, false,
TABS.vtx.isVtxDeviceStatusNotReady
TABS.vtx.isVtxDeviceStatusNotReady,
);
}
@ -178,7 +178,7 @@ TABS.vtx.initialize = function (callback) {
console.log("Validation against schema result:", valid);
valid ? callback_valid() : callback_error();
}
},
);
}
@ -754,7 +754,7 @@ TABS.vtx.initialize = function (callback) {
console.error('VTX Config from file failed validation against schema');
GUI.log(i18n.getMessage('vtxLoadFileKo'));
}
},
);
} catch (err) {
@ -803,13 +803,13 @@ TABS.vtx.initialize = function (callback) {
// JSON is NOT valid
GUI.log(i18n.getMessage('vtxLoadClipboardKo'));
console.error('VTX Config from clipboard failed validation against schema');
}
},
);
}, function(err) {
GUI.log(i18n.getMessage('vtxLoadClipboardKo'));
console.error('Failed to read clipboard contents: ', err);
}
},
);
} catch (err) {

View File

@ -51,7 +51,7 @@ const majorFirmwareVersions = {
"1.39": "3.4.*",
"1.37": "3.3.0",
"1.36": "3.2.*",
"1.31": "3.1.0"
"1.31": "3.1.0",
};
export function generateVirtualApiVersions() {

View File

@ -10,13 +10,13 @@ CSSUtil.prototype.colorTables = {
redWhiteGreen: [
{ percentage: -1, color: { r: 0xff, g: 0x00, b: 0x00, a: 1.0 } },
{ percentage: 0, color: { r: 0xff, g: 0xff, b: 0xff, a: 1.0 } },
{ percentage: 1, color: { r: 0x00, g: 0xff, b: 0x00, a: 1.0 } }
{ percentage: 1, color: { r: 0x00, g: 0xff, b: 0x00, a: 1.0 } },
],
pidSlider: [
{ percentage: -1, color: { r: 0xc5, g: 0xc5, b: 0xc5, a: 1.0 } },
{ percentage: 0, color: { r: 0xff, g: 0xff, b: 0xff, a: 0.0 } },
{ percentage: 1, color: { r: 0xff, g: 0x54, b: 0x0e, a: 1.0 } }
]
{ percentage: 1, color: { r: 0xff, g: 0x54, b: 0x0e, a: 1.0 } },
],
};
// Stack Overflow: https://stackoverflow.com/a/7128796/4107016
@ -41,7 +41,7 @@ CSSUtil.prototype.getColorForPercentage = function(percentage, colorTable = null
r: Math.floor(lower.color.r * percentageLower + upper.color.r * percentageUpper),
g: Math.floor(lower.color.g * percentageLower + upper.color.g * percentageUpper),
b: Math.floor(lower.color.b * percentageLower + upper.color.b * percentageUpper),
a: lower.color.a * percentageLower + upper.color.a * percentageUpper
a: lower.color.a * percentageLower + upper.color.a * percentageUpper,
};
return "rgba(" + [color.r, color.g, color.b, color.a].join(",") + ")";
};

View File

@ -31,7 +31,7 @@ windowWatcherUtil.bindWatchers = function(windowObject, watchersObject) {
set(target, prop, val, receiver) {
windowWatcherUtil.invokeWatcher(prop, val, watchersObject);
return Reflect.set(target, prop, val, receiver);
}
},
});
};
@ -46,7 +46,7 @@ windowWatcherUtil.passValue = function(windows, key, val) {
win.contentWindow.bindings[key] = val;
} else {
win.contentWindow.bindings = {
[key]: val
[key]: val,
};
}
};