refactor: avoid using var

This commit is contained in:
Andy Holmes
2023-09-21 23:10:07 -07:00
parent 3c7eac5f23
commit 0d779c6032
6 changed files with 15 additions and 15 deletions

View File

@@ -1412,10 +1412,10 @@ export function getInterestingWindows(app, monitor, isolateMonitors) {
}
export function cssHexTocssRgba(cssHex, opacity) {
var bigint = parseInt(cssHex.slice(1), 16);
var r = (bigint >> 16) & 255;
var g = (bigint >> 8) & 255;
var b = bigint & 255;
let bigint = parseInt(cssHex.slice(1), 16);
let r = (bigint >> 16) & 255;
let g = (bigint >> 8) & 255;
let b = bigint & 255;
return 'rgba(' + [r, g, b].join(',') + ',' + opacity + ')';
}
@@ -1851,7 +1851,7 @@ export const MyShowAppsIconMenu = class extends PopupMenu.PopupMenu {
return;
}
for (var entry = 0; entry < commandList.length; entry++) {
for (let entry = 0; entry < commandList.length; entry++) {
_appendItem({
title: titleList[entry],
cmd: commandList[entry].split(' ')

View File

@@ -42,7 +42,7 @@ const T2 = 'limitUpdateTimeout';
const T3 = 'postAnimateTimeout';
const T4 = 'panelBoxClipTimeout';
var SIDE_CONTROLS_ANIMATION_TIME = OverviewControls.SIDE_CONTROLS_ANIMATION_TIME / (OverviewControls.SIDE_CONTROLS_ANIMATION_TIME > 1 ? 1000 : 1);
const SIDE_CONTROLS_ANIMATION_TIME = OverviewControls.SIDE_CONTROLS_ANIMATION_TIME / (OverviewControls.SIDE_CONTROLS_ANIMATION_TIME > 1 ? 1000 : 1);
export const Hold = {
NONE: 0,

View File

@@ -1223,7 +1223,7 @@ export const Panel = GObject.registerClass({
return;
}
var scrollDelay = SETTINGS.get_int('scroll-panel-delay');
const scrollDelay = SETTINGS.get_int('scroll-panel-delay');
if (scrollDelay) {
this._timeoutsHandler.add([T6, scrollDelay, () => {}]);

View File

@@ -142,7 +142,7 @@ function checkHotkeyPrefix(settings) {
}
function mergeObjects(main, bck) {
for (var prop in bck) {
for (const prop in bck) {
if (!main.hasOwnProperty(prop) && bck.hasOwnProperty(prop)) {
main[prop] = bck[prop];
}
@@ -1933,7 +1933,7 @@ const Preferences = class {
{objectName: 'panel_length_scale', valueName: '', range: LENGTH_MARKS }
];
for(var idx in sizeScales) {
for(const idx in sizeScales) {
let size_scale = this._builder.get_object(sizeScales[idx].objectName);
let range = sizeScales[idx].range;
size_scale.set_range(range[range.length - 1], range[0]);

View File

@@ -47,7 +47,7 @@ import {SETTINGS} from './extension.js';
const SearchController = Main.overview.searchController;
export const DASH_ANIMATION_TIME = Dash.DASH_ANIMATION_TIME / (Dash.DASH_ANIMATION_TIME > 1 ? 1000 : 1);
var DASH_ITEM_HOVER_TIMEOUT = Dash.DASH_ITEM_HOVER_TIMEOUT;
const DASH_ITEM_HOVER_TIMEOUT = Dash.DASH_ITEM_HOVER_TIMEOUT;
export const MIN_ICON_SIZE = 4;
const T1 = 'ensureAppIconVisibilityTimeout'
@@ -1530,7 +1530,7 @@ export const TaskbarItemContainer = GObject.registerClass({
}
});
var DragPlaceholderItem = GObject.registerClass({
const DragPlaceholderItem = GObject.registerClass({
}, class DragPlaceholderItem extends St.Widget {
_init(appIcon, iconSize, isVertical) {

View File

@@ -35,7 +35,7 @@ import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js';
const Gi = imports._gi;
var SCROLL_TIME = Util.SCROLL_TIME / (Util.SCROLL_TIME > 1 ? 1000 : 1);
const SCROLL_TIME = Util.SCROLL_TIME / (Util.SCROLL_TIME > 1 ? 1000 : 1);
// simplify global signals and function injections handling
// abstract class
@@ -270,7 +270,7 @@ export const find = function(array, predicate) {
};
export const mergeObjects = function(main, bck) {
for (var prop in bck) {
for (const prop in bck) {
if (!main.hasOwnProperty(prop) && bck.hasOwnProperty(prop)) {
main[prop] = bck[prop];
}
@@ -869,8 +869,8 @@ export const drawRoundedLine = function(cr, x, y, width, height, isRoundLeft, is
height = 2.0 * Math.floor(height / 2.0);
var leftRadius = isRoundLeft ? height / 2.0 : 0.0;
var rightRadius = isRoundRight ? height / 2.0 : 0.0;
const leftRadius = isRoundLeft ? height / 2.0 : 0.0;
const rightRadius = isRoundRight ? height / 2.0 : 0.0;
cr.moveTo(x + width - rightRadius, y);
cr.lineTo(x + leftRadius, y);