Skip to content

Commit

Permalink
Unify blank lines
Browse files Browse the repository at this point in the history
  • Loading branch information
PRO-2684 committed Jul 31, 2024
1 parent 346d5b6 commit d465cd9
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 25 deletions.
3 changes: 0 additions & 3 deletions modules/main/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ function getDesc(css) {
return null;
}
}

/**
* Parse arguments of `@var` line.
* @param {string} args The arguments string.
Expand All @@ -32,7 +31,6 @@ function parseVarArgs(args) {
return null;
}
}

/**
* Parse `@var` line.
* @param {string} value The value of the `@var` line.
Expand All @@ -52,7 +50,6 @@ function processVar(value) {
return null;
}
}

/**
* Parse the UserStyle metadata from the CSS content.
* @param {string} css The CSS content.
Expand Down
3 changes: 0 additions & 3 deletions modules/main/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
function normalize(path) {
return path.replace(":\\", "://").replaceAll("\\", "/");
}

/**
* Debounces a function.
* @param {Function} fn Function to debounce.
Expand All @@ -24,15 +23,13 @@ function debounce(fn, time) {
}, time);
}
}

/**
* Logs to the console with colored prefix.
* @param {...any} args The arguments to log.
*/
function simpleLog(...args) {
console.log("\x1b[38;2;116;169;246m%s\x1b[0m", "[Transitio]", ...args);
}

/**
* Logs nothing.
* @param {...any} args The arguments to log.
Expand Down
2 changes: 2 additions & 0 deletions modules/main/walker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
const { normalize } = require("./utils");
const fs = require("fs");
const { shell } = require("electron");

/** Folders to ignore. */
const ignoredFolders = new Set(["node_modules", ".git", ".vscode", ".idea", ".github"]);

/**
Expand Down
9 changes: 3 additions & 6 deletions modules/renderer/css.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Description: Utilities related to CSS.
import { log } from "./debug.js";

/** Attribute name for the style element to store the path of the CSS file. */
const styleDataAttr = "data-transitio-style";

/**
* Get the default value of a select variable, given the arguments.
* @param {Array} varArgs Arguments for the select variable.
Expand Down Expand Up @@ -95,7 +97,6 @@ function cssHelper(path, css, enabled, meta) {
injectCSS(path, processedCSS);
}
}

/**
* Remove all styles injected by transitio.
*/
Expand All @@ -106,8 +107,4 @@ function removeAllStyles() {
});
}

export {
getSelectDefaultValue,
cssHelper,
removeAllStyles
};
export { getSelectDefaultValue, cssHelper, removeAllStyles };
8 changes: 3 additions & 5 deletions modules/renderer/debug.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Description: Debugging utilities for the renderer.
let isDebug = false;
transitio.queryIsDebug().then((result) => {
isDebug = result;
});

/**
* Log to console if debug mode is enabled.
Expand All @@ -10,11 +13,6 @@ function log(...args) {
console.log("[Transitio]", ...args);
}
}

transitio.queryIsDebug().then((result) => {
isDebug = result;
});

/**
* Show debug hint on settings page.
* @param {Element} view View element.
Expand Down
1 change: 0 additions & 1 deletion modules/renderer/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ function doSearch(highlight, text, container) { // Main function for searching
detail.toggleAttribute(searchHiddenDataAttr, !isMatch); // Hide the `details` if it doesn't match
});
}

/** Setup the search bar for the settings view.
* @param {HTMLElement} view The settings view.
* @returns {void}
Expand Down
11 changes: 4 additions & 7 deletions modules/renderer/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ function addTransitioMore(right, args) {
more.title = args.title;
return more;
}
/** Function to add a item representing the user CSS with name and description.
/** Function to add a item representing the UserStyle with name and description.
* @param {string} path The path of the CSS file.
* @param {Element} container The container to add the item.
* @returns {Element} The added details element.
* @returns {Element} The added `details` element.
*/
function addItem(path, container) {
const details = container.appendChild(document.createElement("details"));
Expand Down Expand Up @@ -198,7 +198,7 @@ function constructVarInput(varObj) {
return varInput;
}
/** Function to setup the easter egg at the settings view.
* @param {HTMLElement} logo - The logo element.
* @param {HTMLElement} logo The logo element.
* @returns {void}
*/
function setupEasterEgg(logo) {
Expand Down Expand Up @@ -234,13 +234,11 @@ function setupEasterEgg(logo) {
});
});
}

/** Function to initialize the settings view.
* @param {Element} view The settings view element.
* @returns {Promise<Element>} The container to add the items.
*/
async function initTransitioSettings(view) {
log(pluginPath);
const r = await fetch(`local:///${pluginPath}/settings.html`);
const $ = view.querySelector.bind(view);
view.innerHTML = await r.text();
Expand Down Expand Up @@ -324,7 +322,6 @@ async function initTransitioSettings(view) {
const container = $("setting-section.snippets > setting-panel > setting-list");
return container;
}

/** Function to handle `updateStyle` event on settings view.
* @param {Element} container The settings container.
* @param {Object} args The arguments of the event.
Expand Down Expand Up @@ -390,7 +387,7 @@ function transitioSettingsUpdateStyle(container, args) {
lastFocused = [null, null, 0]; // Clear the last focused variable
}
}
log("onUpdateStyle", path, enabled);
log("transitioSettingsUpdateStyle", path, enabled);
}
/** Function to handle `resetStyle` event on settings view.
* @param {Element} container The settings container.
Expand Down

0 comments on commit d465cd9

Please sign in to comment.